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. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist package (which contains metaconfig) is available via SVN:
17 # svn co https://svn.code.sf.net/p/dist/code/trunk/dist
19 # Though this script was generated by metaconfig from metaunits, it is
20 # OK to send patches against Configure itself. It's up to the Configure
21 # pumpkin to backport the patch to the metaunits if it is accepted.
22 # For more information on patching Configure, see pod/perlhack.pod
24 # The metaunits are also available from the public git repository:
25 # http://perl5.git.perl.org/metaconfig.git/ or
26 # $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig
28 # See Porting/pumpkin.pod for more information on metaconfig.
31 # Generated using [metaconfig 3.5 PL0]
32 # (with additional metaconfig patches by perlbug@perl.org)
37 SCO csh still thinks true is false. Write to SCO today and tell them that next
38 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
40 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
41 we'd have to do is go in and swap the && and || tokens, wherever they are.)
43 [End of diatribe. We now return you to your regularly scheduled programming...]
47 OOPS! You naughty creature! You didn't run Configure with sh!
48 I will attempt to remedy the situation by running sh for you...
52 true || exec sh $0 $argv:q
54 (exit $?0) || cat c2$$
55 (exit $?0) || exec sh $0 $argv:q
58 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
61 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
62 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
63 *** Please read the README.plan9 for further instructions.
64 *** Cannot continue, aborting.
70 if test ! -c /dev/null ; then
73 *** I'm sorry, but /dev/null appears to be a file rather than a device.
74 *** Please consult your operating sytem's notes for making a device
76 *** Cannot continue, aborting.
82 : compute my invocation name
86 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
91 : Proper separator for the PATH environment variable
93 : On OS/2 this directory should exist if this is not floppy only system ":-]"
94 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' 2>&1 ) 2>&1 >/dev/null ; then
95 if test -n "$OS2_SHELL"; then
97 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
98 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
100 elif test -n "$DJGPP"; then
101 case "X${MACHTYPE:-nonesuchmach}" in
108 : Proper PATH setting
109 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
110 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
111 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
112 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
113 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
114 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
115 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
116 paths="$paths /sbin /usr/sbin /usr/libexec"
117 paths="$paths /system/gnu_library/bin"
121 case "$p_$PATH$p_" in
123 *) test -d $p && PATH=$PATH$p_$p ;;
130 : shall we be using ksh?
136 if (PATH=.; alias -x) >/dev/null 2>&1; then
139 if test -f /hp-ux -a -f /bin/ksh; then
140 needksh='to avoid sh bug in "here document" expansion'
142 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
143 if test X`/usr/bin/uname -v` = X4; then
144 avoidksh="to avoid AIX 4's /bin/sh"
148 if test -f /osf_boot -a -f /usr/sbin/setld; then
149 if test X`/usr/bin/uname -s` = XOSF1; then
150 avoidksh="to avoid Digital UNIX' ksh"
155 case "$inksh/$needksh" in
162 case "$inksh/$avoidksh" in
168 case "$inksh/$needksh-$avoidksh-" in
171 (I see you are using the Korn shell. Some ksh's blow up on $me,
172 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
179 echo "(Feeding myself to $newsh $reason.)"
181 Configure|*/Configure) exec $newsh $0 "$@";;
182 *) exec $newsh Configure "$@";;
186 test -x "${newsh}" || unset newsh
188 : if needed, set CDPATH to a harmless value that is not chatty
189 : avoid bash 2.02 problems with empty CDPATH.
193 *bash*) CDPATH='.' ;;
199 : Configure runs within the UU subdirectory
200 test -d UU || mkdir UU
344 useversionedarchname=''
350 initialinstalllocation=''
380 d_attribute_deprecated=''
381 d_attribute_format=''
382 d_attribute_malloc=''
383 d_attribute_nonnull=''
384 d_attribute_noreturn=''
386 d_attribute_unused=''
387 d_attribute_warn_unused_result=''
388 d_printf_format_null=''
392 d_builtin_choose_expr=''
395 d_c99_variadic_macros=''
443 endhostent_r_proto=''
449 endprotoent_r_proto=''
455 endservent_r_proto=''
512 gethostbyaddr_r_proto=''
514 gethostbyname_r_proto=''
516 gethostent_r_proto=''
529 getnetbyaddr_r_proto=''
531 getnetbyname_r_proto=''
545 d_getprotobyname_r=''
546 getprotobyname_r_proto=''
547 d_getprotobynumber_r=''
548 getprotobynumber_r_proto=''
550 getprotoent_r_proto=''
562 getservbyname_r_proto=''
564 getservbyport_r_proto=''
566 getservent_r_proto=''
597 d_libm_lib_version=''
600 d_localtime_r_needs_tzset=''
603 d_lc_monetary_2008=''
614 d_malloc_good_size=''
658 d_old_pthread_create_joinable=''
659 old_pthread_create_joinable=''
661 d_pthread_attr_setscope=''
701 sethostent_r_proto=''
718 setprotoent_r_proto=''
730 setservent_r_proto=''
752 d_ipv6_mreq_source=''
769 d_sprintf_returns_strlen=''
781 perl_static_inline=''
786 d_stdio_ptr_lval_nochange_cnt=''
787 d_stdio_ptr_lval_sets_cnt=''
937 d_gdbm_ndbm_h_uses_prototypes=''
938 d_gdbmndbm_h_uses_prototypes=''
940 d_ndbm_h_uses_prototypes=''
1016 d_inc_version_list=''
1018 inc_version_list_init=''
1022 installusrbinperl=''
1038 ignore_versioned_solibs=''
1098 d_perl_otherlibdirs=''
1106 api_versionstring=''
1112 version_patchlevel_string=''
1116 d_nv_preserves_uv=''
1117 d_nv_zero_is_allbits_zero=''
1128 nv_overflows_integers_at=''
1129 nv_preserves_uv_bits=''
1202 installsitehtml1dir=''
1205 installsitehtml3dir=''
1212 installsiteman1dir=''
1215 installsiteman3dir=''
1220 installsitescript=''
1238 d_stdio_stream_array=''
1239 stdio_stream_array=''
1257 usekernprocpathname=''
1258 ccflags_uselargefiles=''
1259 ldflags_uselargefiles=''
1260 libswanted_uselargefiles=''
1270 usensgetexecutablepath=''
1283 installvendorarch=''
1290 installvendorhtml1dir=''
1292 vendorhtml1direxp=''
1293 installvendorhtml3dir=''
1295 vendorhtml3direxp=''
1301 installvendorman1dir=''
1304 installvendorman3dir=''
1311 installvendorscript=''
1322 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1325 : We must find out about Eunice early
1327 if test -f /etc/unixtovms; then
1328 eunicefix=/etc/unixtovms
1330 if test -f /etc/unixtovms.exe; then
1331 eunicefix=/etc/unixtovms.exe
1334 : Set executable suffix now -- needed before hints available
1335 if test -f "/libs/version.library"; then
1338 elif test -f "/system/gnu_library/bin/ar.pm"; then
1341 elif test -n "$DJGPP"; then
1344 elif test -f /kern/cookiejar; then
1347 elif test -d c:/. -o -n "$is_os2" ; then
1354 : Trailing extension. Override this in a hint file, if needed.
1355 : Extra object files, if any, needed on this platform.
1358 : Possible local include directories to search.
1359 : Set locincpth to "" in a hint file to defeat local include searches.
1360 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1361 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1363 : no include file wanted by default
1366 : Enable -DEBUGGING and -DDEBUGGING from the command line
1371 : change the next line if compiling for Xenix/286 on Xenix/386
1372 xlibpth='/usr/lib/386 /lib/386'
1373 : Possible local library directories to search.
1374 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1375 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1377 : general looking path for locating libraries
1378 glibpth="/lib /usr/lib $xlibpth"
1379 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1380 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1381 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1382 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1384 : Private path used by Configure to find libraries. Its value
1385 : is prepended to libpth. This variable takes care of special
1386 : machines, like the mips. Usually, it should be empty.
1389 : default library list
1391 : some systems want to use only the non-versioned libso:s
1392 ignore_versioned_solibs=''
1393 : set usethreads on the Configure command line to enable threads.
1394 usereentrant='undef'
1398 : set useposix=false in your hint file to disable the POSIX extension.
1400 : set useopcode=false in your hint file to disable the Opcode extension.
1403 ccflags_uselargefiles=''
1404 ldflags_uselargefiles=''
1405 libswanted_uselargefiles=''
1406 : set usemultiplicity on the Configure command line to enable multiplicity.
1407 : set usesocks on the Configure command line to enable socks.
1408 : List of libraries we want.
1409 : If anyone needs extra -lxxx, put those in a hint file.
1410 libswanted="socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld sun"
1411 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1412 : We probably want to search /usr/shlib before most other libraries.
1413 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1414 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1415 glibpth="/usr/shlib $glibpth"
1416 : Do not use vfork unless overridden by a hint file.
1419 : Find the basic shell for Bourne shell scripts
1423 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1426 if test -f "$xxx"; then
1429 : Build up a list and do a single loop so we can 'break' out.
1430 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1431 for xxx in sh bash ksh pdksh ash; do
1433 try="$try ${p}/${xxx}"
1437 if test -f "$xxx"; then
1440 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1443 elif test -f "$xxx.exe"; then
1454 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1456 Usually it's in /bin/sh. How did you even get this far?
1457 Please contact me (Perl Maintainers) at perlbug@perl.org and
1458 we'll try to straighten this all out.
1464 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1465 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1468 : see if sh knows # comments
1469 if `$sh -c '#' >/dev/null 2>&1`; then
1473 test -f $xcat$_exe || xcat=/usr/bin/cat
1474 if test ! -f $xcat$_exe; then
1475 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1476 if test -f $p/cat$_exe; then
1481 if test ! -f $xcat$_exe; then
1482 echo "Can't find cat anywhere!"
1486 echo "#!$xcat" >sharp
1489 ./sharp > today 2>/dev/null
1490 if test -s today; then
1493 echo "#! $xcat" > sharp
1496 ./sharp > today 2>/dev/null
1497 if test -s today; then
1505 echo "Your $sh doesn't grok # comments--I will strip them later on."
1508 echo "exec grep -v '^[ ]*#'" >spitshell
1510 $eunicefix spitshell
1511 spitshell=`pwd`/spitshell
1513 echo "I presume that if # doesn't work, #! won't work either!"
1518 : figure out how to guarantee sh startup
1520 '') startsh=${sharpbang}${sh} ;;
1532 : echo "Yup, it does."
1534 echo "Hmm... '$startsh' does not guarantee sh startup..."
1535 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1539 : Save command line options in file UU/cmdline.opt for later use in
1540 : generating config.sh.
1541 cat > cmdline.opt <<EOSH
1542 : Configure command line arguments.
1551 cat >>cmdline.opt <<EOSH
1552 config_arg$argn='$arg'
1554 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1557 arg_exp=`cat cmdl.opt`
1558 args_exp="$args_exp$args_sep'$arg_exp'"
1559 argn=`expr $argn + 1`
1564 : produce awk script to parse command line options
1565 cat >options.awk <<'EOF'
1567 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1569 len = length(optstr);
1570 for (i = 1; i <= len; i++) {
1571 c = substr(optstr, i, 1);
1572 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1583 if (substr(str, 1, 1) != "-") {
1584 printf("'%s'\n", str);
1588 for (i = 2; i <= len; i++) {
1589 c = substr(str, i, 1);
1591 printf("-%s\n", substr(str, i));
1597 printf("'%s'\n", substr(str, i + 1));
1610 : process the command line options
1611 set X `for arg in "$@"; do echo "X$arg"; done |
1612 sed -e s/X// | awk -f options.awk`
1617 : set up default values
1627 rm -f optdef.sh posthint.sh
1628 cat >optdef.sh <<EOS
1634 while test $# -gt 0; do
1636 -d) shift; fastread=yes;;
1637 -e) shift; alldone=cont;;
1641 if test -r "$1"; then
1644 echo "$me: cannot read config file $1." >&2
1650 -h) shift; error=true;;
1651 -r) shift; reuseval=true;;
1652 -s) shift; silent=true; realsilent=true;;
1653 -E) shift; alldone=exit;;
1654 -K) shift; knowitall=true;;
1655 -O) shift; override=true;;
1656 -S) shift; silent=true; extractsh=true;;
1661 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1662 echo "$me: ignoring -D $1" >&2
1665 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1666 *) echo "$1='define'" >> optdef.sh;;
1673 *=) echo "$1" >> optdef.sh;;
1675 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1676 echo "$me: ignoring -U $1" >&2
1678 *) echo "$1='undef'" >> optdef.sh;;
1689 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1693 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1694 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1700 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1701 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1702 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1703 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1704 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1705 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1711 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1713 echo "$yyy=''" >> posthint.sh ;;
1718 echo "$yyy='$zzz'" >> posthint.sh ;;
1720 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1722 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1727 echo "$yyy=$zzz" >> posthint.sh ;;
1728 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1732 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1735 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1743 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1744 [-U symbol] [-U symbol=] [-A command:symbol...]
1745 -d : use defaults for all answers.
1746 -e : go on without questioning past the production of config.sh.
1747 -f : specify an alternate default configuration file.
1748 -h : print this help message and exit (with an error status).
1749 -r : reuse C symbols value if possible (skips costly nm extraction).
1750 -s : silent mode, only echoes questions and essential information.
1751 -D : define symbol to have some value:
1752 -D symbol symbol gets the value 'define'
1753 -D symbol=value symbol gets the value 'value'
1754 common used examples (see INSTALL for more info):
1755 -Duse64bitint use 64bit integers
1756 -Duse64bitall use 64bit integers and pointers
1757 -Dusethreads use thread support
1758 -Dinc_version_list=none do not include older perl trees in @INC
1759 -DEBUGGING=none DEBUGGING options
1760 -Dcc=gcc choose your compiler
1761 -Dprefix=/opt/perl5 choose your destination
1762 -E : stop at the end of questions, after having produced config.sh.
1763 -K : do not use unless you know what you are doing.
1764 -O : let -D and -U override definitions from loaded configuration file.
1765 -S : perform variable substitutions on all .SH files (can mix with -f)
1766 -U : undefine symbol:
1767 -U symbol symbol gets the value 'undef'
1768 -U symbol= symbol gets completely empty
1770 -A : manipulate symbol after the platform specific hints have been applied:
1771 -A append:symbol=value append value to symbol
1772 -A symbol=value like append:, but with a separating space
1773 -A define:symbol=value define symbol to have value
1774 -A clear:symbol define symbol to be ''
1775 -A define:symbol define symbol to be 'define'
1776 -A eval:symbol=value define symbol to be eval of value
1777 -A prepend:symbol=value prepend value to symbol
1778 -A undef:symbol define symbol to be 'undef'
1779 -A undef:symbol= define symbol to be ''
1780 e.g.: -A prepend:libswanted='cl pthread '
1781 -A ccflags=-DSOME_MACRO
1782 -V : print version number and exit (with a zero status).
1789 case "$fastread$alldone" in
1792 case "$extractsh" in
1795 if test ! -t 0; then
1796 echo "Say 'sh Configure', not 'sh <Configure'"
1806 true) exec 1>/dev/null;;
1809 : run the defines and the undefines, if any, but leave the file out there...
1812 : create the posthint manipulation script and leave the file out there...
1817 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1818 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1819 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1820 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1821 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1824 : Some greps do not return status, grrr.
1825 echo "grimblepritz" >grimble
1826 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1828 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1834 : the following should work in any shell
1838 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1839 cat >contains <<'EOSS'
1840 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1845 : Find the path to the source tree
1848 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1852 *) src=`cd ../$src && pwd` ;;
1865 if test -f $rsrc/Configure && \
1866 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1868 : found it, so we are ok.
1871 for src in . .. ../.. ../../.. ../../../..; do
1872 if test -f ../$src/Configure && \
1873 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1884 Sorry, I can't seem to locate the source dir for $package. Please start
1885 Configure with an explicit path -- i.e. /some/path/Configure.
1893 echo "Sources for $package found in \"$src\"." >&4
1897 : script used to extract .SH files with variable substitutions
1898 cat >extract <<'EOS'
1900 echo "Doing variable substitutions on .SH files..."
1901 if test -f MANIFEST; then
1902 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1904 echo "(Looking for .SH files under the source directory.)"
1905 set x `(cd "$src"; find . -name "*.SH" -print)`
1909 0) set x `(cd "$src"; echo *.SH)`; shift;;
1911 if test ! -f "$src/$1"; then
1917 while test $name; do
1918 if test ! -d "$name"; then
1919 create="$name $create";
1920 name=`echo $name | sed -e "s|^[^/]*$||"`;
1921 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1926 for file in $create; do
1935 dir=`expr X$file : 'X\(.*\)/'`
1936 file=`expr X$file : 'X.*/\(.*\)'`
1937 (cd "$dir" && . ./$file)
1947 dir=`expr X$file : 'X\(.*\)/'`
1948 file=`expr X$file : 'X.*/\(.*\)'`
1949 (set x $dir; shift; eval $mkdir_p)
1950 sh <"$src/$dir/$file"
1959 if test -f "$src/config_h.SH"; then
1960 if test ! -f config.h; then
1961 : oops, they left it out of MANIFEST, probably, so do it anyway.
1962 . "$src/config_h.SH"
1967 : extract files and exit if asked to do so
1968 case "$extractsh" in
1970 case "$realsilent" in
1974 case "$config_sh" in
1975 '') config_sh='config.sh';;
1978 echo "Fetching answers from $config_sh..."
1981 test "$override" && . ./optdef.sh
1985 echo "Extraction done."
1990 : Eunice requires " " instead of "", can you believe it
1993 echo "Beginning of configuration questions for $package."
1995 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1997 : first determine how to suppress newline on echo command
1999 echo "Checking echo to see how to suppress newlines..."
2000 (echo "hi there\c" ; echo " ") >.echotmp
2001 if $contains c .echotmp >/dev/null 2>&1 ; then
2012 echo $n "The star should be here-->$c"
2016 : Now test for existence of everything in MANIFEST
2018 if test -f "$rsrc/MANIFEST"; then
2019 echo "First let's make sure your kit is complete. Checking..." >&4
2020 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2021 (split -l 50 2>/dev/null || split -50)
2024 for filelist in x??; do
2025 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2026 >/dev/null 2>>"$tmppwd/missing")
2028 if test -s missing; then
2032 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2034 You have the option of continuing the configuration process, despite the
2035 distinct possibility that your kit is damaged, by typing 'y'es. If you
2036 do, don't blame me if something goes wrong. I advise you to type 'n'o
2037 and contact the author (perlbug@perl.org).
2040 echo $n "Continue? [n] $c" >&4
2044 echo "Continuing..." >&4
2048 echo "ABORTING..." >&4
2053 echo "Looks good..."
2056 echo "There is no MANIFEST file. I hope your kit is complete !"
2060 : Find the appropriate value for a newline for tr
2062 if test -n "$DJGPP"; then
2065 if test X"$trnl" = X; then
2066 case "`echo foo|tr '\n' x 2>/dev/null`" in
2070 if test X"$trnl" = X; then
2071 case "`echo foo|tr '\012' x 2>/dev/null`" in
2072 foox) trnl='\012' ;;
2075 if test X"$trnl" = X; then
2076 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2077 fooxy) trnl='\n\r' ;;
2080 if test X"$trnl" = X; then
2083 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2089 : compute the number of columns on the terminal for proper question formatting
2094 : set up the echo used in my read
2095 myecho="case \"\$xxxm\" in
2096 '') echo $n \"\$rp $c\" >&4;;
2098 '') echo $n \"[\$xxxm] $c\";;
2100 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2102 echo $n \"[\$xxxm] $c\" >&4
2104 echo $n \"\$rp [\$xxxm] $c\" >&4
2110 : now set up to do reads with possible shell escape and default assignment
2116 case "\$fastread" in
2117 yes) case "\$dflt" in
2120 case "\$silent-\$rp" in
2125 *) case "\$silent" in
2126 true) case "\$rp" in
2131 while expr "X\$ans" : "X!" >/dev/null; do
2135 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2143 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2152 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2157 echo "(OK, I'll run with -d after this question.)" >&4
2160 echo "*** Sorry, \$1 not supported yet." >&4
2170 echo "*** Substitution done -- please confirm."
2172 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2177 echo "*** Error -- try again."
2184 case "\$ans\$xxxm\$nostick" in
2196 : create .config dir to save info across Configure sessions
2197 test -d ../.config || mkdir ../.config
2198 cat >../.config/README <<EOF
2199 This directory created by Configure to save information that should
2200 persist across sessions for $package.
2202 You may safely delete it if you wish.
2205 : See if we are using a devel version and want that
2206 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2209 usedevel="$define" ;;
2210 *) case "$xversion" in
2213 *** WHOA THERE!!! ***
2215 This is an UNSTABLE DEVELOPMENT release.
2216 The version of this $package distribution is $xversion, that is, odd,
2217 (as opposed to even) and that signifies a development release.
2218 If you want a maintenance release, you want an even-numbered version.
2220 Do ***NOT*** install this into production use.
2221 Data corruption and crashes are possible.
2223 It is most seriously suggested that you do not continue any further
2224 unless you want to help in developing and debugging Perl.
2226 If you *still* want to build perl, you can answer 'y' now,
2227 or pass -Dusedevel to Configure.
2230 rp='Do you really want to continue?'
2234 [yY]) echo >&4 "Okay, continuing."
2235 usedevel="$define" ;;
2236 *) echo >&4 "Okay, bye."
2247 case "$versiononly" in
2248 '') versiononly="$define" ;;
2250 case "$installusrbinperl" in
2251 '') installusrbinperl="$undef" ;;
2256 : general instructions
2259 user=`(logname) 2>/dev/null`
2261 '') user=`whoami 2>&1`;;
2263 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2266 rp='Would you like to see the instructions?'
2277 This installation shell script will examine your system and ask you questions
2278 to determine how the perl5 package should be installed. If you get
2279 stuck on a question, you may use a ! shell escape to start a subshell or
2280 execute a command. Many of the questions will have default answers in square
2281 brackets; typing carriage return will give you the default.
2283 On some of the questions which ask for file or directory names you are allowed
2284 to use the ~name construct to specify the login directory belonging to "name",
2285 even if you don't have a shell which knows about that. Questions where this is
2286 allowed will be marked "(~name ok)".
2290 dflt='Type carriage return to continue'
2294 The prompter used in this script allows you to use shell variables and
2295 backticks in your answers. You may use $1, $2, etc... to refer to the words
2296 in the default answer, as if the default line was a set of arguments given to a
2297 script shell. This means you may also use $* to repeat the whole default line,
2298 so you do not have to re-type everything to add something to the default.
2300 Every time there is a substitution, you will have to confirm. If there is an
2301 error (e.g. an unmatched backtick), the default answer will remain unchanged
2302 and you will be prompted again.
2304 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2305 the questions and use the computed defaults (or the previous answers if there
2306 was already a config.sh file). Type 'Configure -h' for a list of options.
2307 You may also start interactively and then answer '& -d' at any prompt to turn
2308 on the non-interactive behaviour for the remainder of the execution.
2314 Much effort has been expended to ensure that this shell script will run on any
2315 Unix system. If despite that it blows up on yours, your best bet is to edit
2316 Configure and run it again. If you can't run Configure for some reason,
2317 you'll have to generate a config.sh file by hand. Whatever problems you
2318 have, let me (perlbug@perl.org) know how I blew it.
2320 This installation script affects things in two ways:
2322 1) it may do direct variable substitutions on some of the files included
2324 2) it builds a config.h file for inclusion in C programs. You may edit
2325 any of these files as the need arises after running this script.
2327 If you make a mistake on a question, there is no easy way to back up to it
2328 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2329 files. Configure will offer to let you do this before it runs the SH files.
2332 dflt='Type carriage return to continue'
2334 case "$firsttime" in
2335 true) echo $user >>../.config/instruct;;
2339 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2340 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2341 if test "X$sysroot" = X; then
2346 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2347 # _sysroot is used in places where we need --sysroot=foo
2348 # but using the rest of the flags could cause issues.
2349 _sysroot="--sysroot=$sysroot";
2353 ccflags="$ccflags $_sysroot"
2358 ldflags="$ldflags $_sysroot"
2363 cppflags="$cppflags $_sysroot"
2365 # lddlflags updated below in lddlflags section;
2366 # same with cccdlflags
2370 # Adjust some defaults to also use $sysroot
2371 for var in xlibpth loclibpth locincpth glibpth; do
2374 for path in $xxx; do
2375 eval $var=\"\$$var $sysroot$path\"
2381 : find out where common programs are
2383 echo "Locating common programs..." >&4
2396 if test -d \$dir/\$thing; then
2402 for thisthing in \$dir/\$thing; do
2403 : just loop through to pick last item
2405 if test -f \$thisthing; then
2408 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2411 elif test -f \$dir/\$thing.exe; then
2412 if test -n "$DJGPP"; then
2413 echo \$dir/\$thing.exe
2414 elif test "$eunicefix" != ":"; then
2415 : on Eunice apparently
2468 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2469 pth="$pth $sysroot/lib $sysroot/usr/lib"
2470 for file in $loclist; do
2474 if test -f "$xxx"; then
2477 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2478 xxx=`./loc $file $file $pth`
2481 '') xxx=`./loc $file $file $pth`;;
2482 *) xxx=`./loc $xxx $xxx $pth`;;
2484 eval $file=$xxx$_exe
2488 echo $file is in $xxx.
2491 echo $file is in $xxx.
2494 echo "I don't know where '$file' is, and my life depends on it." >&4
2495 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2501 echo "Don't worry if any of the following aren't found..."
2503 for file in $trylist; do
2507 if test -f "$xxx"; then
2510 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2511 xxx=`./loc $file $file $pth`
2514 '') xxx=`./loc $file $file $pth`;;
2515 *) xxx=`./loc $xxx $xxx $pth`;;
2517 eval $file=$xxx$_exe
2521 echo $file is in $xxx.
2524 echo $file is in $xxx.
2527 echo "I don't see $file out there, $say."
2534 echo "Substituting grep for egrep."
2541 *) if $less -R </dev/null >/dev/null 2>&1; then
2542 echo "Substituting less -R for less."
2550 echo "Substituting cp for ln."
2559 echo "I can't find make or gmake, and my life depends on it." >&4
2560 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2568 *) # We can't have osname yet.
2569 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2570 # Assume that gmake, if found, is definitely GNU make
2571 # and prefer it over the system make.
2572 echo "Substituting gmake for make."
2580 echo "Hopefully test is built into your sh."
2583 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2584 echo "Using the test built into your sh."
2592 echo "Hopefully echo is built into your sh."
2597 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2598 $echo $n "hi there$c" >foo1
2599 echo $n "hi there$c" >foo2
2600 if cmp foo1 foo2 >/dev/null 2>&1; then
2601 echo "They are compatible. In fact, they may be identical."
2608 They are not compatible! You are probably running ksh on a non-USG system.
2609 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2610 have echo built in and we may have to run some Bourne shell scripts. That
2611 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2614 $echo $n "The star should be here-->$c"
2621 # This question was auctioned at YAPC::Europe-2007 in Vienna
2622 # I never promised you could answer it. I only auctioned the question.
2624 The following message is sponsored by
2626 Dresden.pm<--The stars should be here.
2628 Dear Perl user, system administrator or package
2629 maintainer, the Perl community sends greetings to
2630 you. Do you (emblematical) greet back [Y/n]? n
2634 : Check what type of C compiler we use
2638 cat <<'EOSC' >>trygcc
2643 int main(int argc, char *argv[]) {
2647 if $cc -o try $ccflags $ldflags try.c; then
2650 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2656 # Skip this test because it gives a false match on output like:
2657 # ./trygcc: line 23: cc: command not found
2658 # case "`$cc -v -c try.c 2>&1`" in
2659 # *gcc*) trygcc=no ;;
2661 if $test X"$trygcc" = Xyes; then
2662 if gcc -o try -c try.c; then
2664 echo "You seem to have a working gcc, though." >&4
2665 # Switching compilers may undo the work of hints files.
2666 # The most common problem is -D_REENTRANT for threads.
2667 # This heuristic catches that case, but gets false positives
2668 # if -Dusethreads was not actually specified. Better to
2669 # bail out here with a useful message than fail
2670 # mysteriously later. Should we perhaps just try to
2671 # re-invoke Configure -Dcc=gcc config_args ?
2672 if $test -f usethreads.cbu; then
2675 *** However, any setting of the C compiler flags (e.g. for thread support)
2676 *** will be lost. It may be necessary for you to restart Configure and
2677 *** add -Dcc=gcc to your Configure command line.
2680 rp="Would you like to go ahead and try gcc anyway?"
2683 rp="Would you like to use it?"
2686 if $test -f myread; then
2689 if $test -f UU/myread; then
2692 echo "Cannot find myread, sorry. Aborting." >&2
2697 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2710 cat <<'EOSC' >>checkcc
2715 int main(int argc, char *argv[]) {
2719 if $cc -o try $ccflags $ldflags try.c; then
2722 if $test X"$despair" = Xyes; then
2723 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2726 You need to find a working C compiler.
2727 Either (purchase and) install the C compiler supplied by your OS vendor,
2728 or for a free C compiler try http://gcc.gnu.org/
2729 I cannot continue any further, aborting.
2738 : determine whether symbolic links are supported
2741 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2742 echo "Symbolic links are supported." >&4
2745 echo "Symbolic links are NOT supported." >&4
2750 : determine whether symbolic links are supported
2754 echo "Checking how to test for symbolic links..." >&4
2756 if $test "X$issymlink" = X; then
2758 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2759 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2761 if test $? = 0; then
2764 echo "Your builtin 'test -h' may be broken." >&4
2767 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2770 if test -f "$p/$test"; then
2779 echo "Trying external '$test -h'." >&4
2780 issymlink="$test -h"
2781 if $test ! -h sym >/dev/null 2>&1; then
2782 echo "External '$test -h' is broken, too." >&4
2790 if $test "X$issymlink" = X; then
2791 if $test -L sym 2>/dev/null; then
2792 issymlink="$test -L"
2793 echo "The builtin '$test -L' worked." >&4
2796 if $test "X$issymlink" != X; then
2797 echo "You can test for symbolic links with '$issymlink'." >&4
2799 echo "I do not know how you can test for symbolic links." >&4
2803 *) echo "No symbolic links, so not testing for their testing..." >&4
2808 : Make symlinks util
2809 case "$mksymlinks" in
2812 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2815 *) case "$lns:$issymlink" in
2816 *"ln"*" -s:"*"test -"?)
2817 echo "Creating the symbolic links..." >&4
2818 echo "(First creating the subdirectories...)" >&4
2820 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2822 test -z "$directory" && break
2826 if test ! -d t/base; then
2827 echo "Failed to create the subdirectories. Aborting." >&4
2830 echo "(Then creating the symlinks...)" >&4
2831 awk '{print $1}' $src/MANIFEST | while true; do
2833 test -z "$filename" && break
2834 if test -f $filename; then
2835 if $issymlink $filename; then
2839 if test -f $filename; then
2840 echo "$filename already exists, not symlinking."
2842 ln -s $src/$filename $filename
2846 if test ! -f t/base/lex.t; then
2847 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2852 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2860 : Check for Cross-Compilation
2861 if $test "X$targethost" = "X"; then
2864 if $test "X$targetenv" = "X"; then
2867 case "$usecrosscompile" in
2869 $echo "Cross-compiling..."
2872 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2873 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2874 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2875 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2876 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2877 # leave out ld, choosing it is more complex
2878 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2879 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2880 # We are in a weird spot. Just before us, some values
2881 # were 'saved', to be restored after the hints are
2882 # run. This means that the changes we made to ar,
2883 # nm and ranlib will get reverted.
2884 # To avoid that, we hijack the saving mechanism and
2885 # have it save our new values.
2886 for file in ar nm ranlib; do
2888 eval $file=$xxx$_exe
2893 case "$targetarch" in
2894 '') echo "Targetarch not defined." >&4; croak=y ;;
2895 *) echo "Using targetarch $targetarch." >&4 ;;
2897 case "$targethost" in
2898 '') echo "Targethost not defined." >&4; croak=y ;;
2899 *) echo "Using targethost $targethost." >&4
2904 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2906 : compile a host miniperl and generate_uudmap, unless we got passed them
2907 if $test "X$hostperl" = X; then
2908 echo "Building host miniperl and generate_uudmap binaries" >&4
2916 $src/Configure -des -Dusedevel -Dmksymlinks
2918 case "$hostgenerate" in
2919 '') $make generate_uudmap
2920 hostgenerate=$src/host/generate_uudmap
2922 "$undef") hostgenerate=''
2925 hostperl=$src/host/miniperl
2928 hostosname=`$hostperl -le 'print $^O'`
2931 usecrosscompile="$undef"
2935 : Define -Dtargethost=somecomputer to run compiled tests on another machine
2936 case "$targethost" in
2937 '') echo "Checking for cross-compile" >&4
2938 case "$usecrosscompile$multiarch" in
2939 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
2940 if [ -f Makefile ]; then
2942 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
2944 echo "Configure done."
2948 *) echo "No targethost for running compiler tests against defined, running locally" >&4
2955 *) echo "Using targethost $targethost." >&4
2957 /*) run=$src/Cross/run
2958 targetmkdir=$src/Cross/mkdir
2960 from=$src/Cross/from
2962 *) pwd=`$test -f ../Configure & cd ..; pwd`
2964 targetmkdir=$pwd/Cross/mkdir
2966 from=$pwd/Cross/from
2969 case "$targetrun" in
2970 '') targetrun=ssh ;;
2975 case "$targetfrom" in
2976 '') targetfrom=scp ;;
2980 from=$from-$targetfrom
2981 case "$targetdir" in
2983 echo "Guessing targetdir $targetdir." >&4
2986 case "$targetuser" in
2988 echo "Guessing targetuser $targetuser." >&4
2991 case "$targetport" in
2993 echo "Guessing targetport $targetport." >&4
2996 case "$targetfrom" in
3000 case "$targetrun" in
3020 '') cwd=$targetdir ;;
3025 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3031 *) echo "Unknown targetrun '$targetrun'" >&4
3035 case "$targetmkdir" in
3037 cat >$targetmkdir <<EOF
3039 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3041 $chmod a+rx $targetmkdir
3043 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3055 $targetmkdir \`dirname \$f\`
3056 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3059 $targetmkdir $targetdir/\`dirname \$f\`
3060 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3073 $mkdir -p $targetdir/\`dirname \$f\`
3074 $cp \$f $targetdir/\$f || exit 1
3077 $targetmkdir $targetdir/\`dirname \$f\`
3078 $cp \$f $targetdir/\$f || exit 1
3085 *) echo "Unknown targetto '$targetto'" >&4
3089 case "$targetfrom" in
3096 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3101 cp) cat >$from <<EOF
3106 cp $targetdir/\$f . || exit 1
3111 *) echo "Unknown targetfrom '$targetfrom'" >&4
3115 if $test ! -f $run; then
3116 echo "Target 'run' script '$run' not found." >&4
3120 if $test ! -f $to; then
3121 echo "Target 'to' script '$to' not found." >&4
3125 if $test ! -f $from; then
3126 echo "Target 'from' script '$from' not found." >&4
3130 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3134 Using '$run' for remote execution,
3135 and '$from' and '$to'
3136 for remote file transfer.
3142 usecrosscompile="$undef"
3147 : see whether [:lower:] and [:upper:] are supported character classes
3149 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3151 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3155 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3156 # (0xd9 and 0xe2), therefore that is a nice testing point.
3157 if test "X$up" = X -o "X$low" = X; then
3158 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3164 if test "X$up" = X -o "X$low" = X; then
3165 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3171 if test "X$up" = X -o "X$low" = X; then
3172 case "`echo RS | od -x 2>/dev/null`" in
3174 echo "Hey, this might be EBCDIC." >&4
3175 if test "X$up" = X -o "X$low" = X; then
3176 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3177 rs) up='[A-IJ-RS-Z]'
3182 if test "X$up" = X -o "X$low" = X; then
3183 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3193 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3195 echo "Using $up and $low to convert case." >&4
3198 echo "I don't know how to translate letters from upper to lower case." >&4
3199 echo "Your tr is not acting any way I know of." >&4
3203 : set up the translation script tr, must be called with ./tr of course
3207 '[A-Z][a-z]') exec $tr '$up' '$low';;
3208 '[a-z][A-Z]') exec $tr '$low' '$up';;
3215 : Try to determine whether config.sh was made on this system
3216 case "$config_sh" in
3218 myuname=`$uname -a 2>/dev/null`
3219 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3220 # Downcase everything to avoid ambiguity.
3221 # Remove slashes and single quotes so we can use parts of this in
3222 # directory and file names.
3223 # Remove newlines so myuname is sane to use elsewhere.
3224 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3225 # because the A-Z/a-z are not consecutive.
3226 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3227 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3228 newmyuname="$myuname"
3230 case "$knowitall" in
3232 if test -f ../config.sh; then
3233 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3234 eval "`grep myuname= ../config.sh`"
3236 if test "X$myuname" = "X$newmyuname"; then
3244 : Get old answers from old config file if Configure was run on the
3245 : same system, otherwise use the hints.
3248 if test -f config.sh; then
3250 rp="I see a config.sh file. Shall I use it to set the defaults?"
3253 n*|N*) echo "OK, I'll ignore it."
3254 mv config.sh config.sh.old
3255 myuname="$newmyuname"
3257 *) echo "Fetching default answers from your old config.sh file..." >&4
3265 : Older versions did not always set $sh. Catch re-use of such
3275 if test ! -f config.sh; then
3278 First time through, eh? I have some defaults handy for some systems
3279 that need some extra help getting the Configure answers right:
3282 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3284 : Half the following guesses are probably wrong... If you have better
3285 : tests or hints, please send them to perlbug@perl.org
3286 : The metaconfig authors would also appreciate a copy...
3287 $test -f /irix && osname=irix
3288 $test -f /xenix && osname=sco_xenix
3289 $test -f /dynix && osname=dynix
3290 $test -f /dnix && osname=dnix
3291 $test -f /lynx.os && osname=lynxos
3292 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3293 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3294 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3295 $test -f /bin/mips && /bin/mips && osname=mips
3296 $test -d /usr/apollo/bin && osname=apollo
3297 $test -f /etc/saf/_sactab && osname=svr4
3298 $test -d /usr/include/minix && osname=minix
3299 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3300 if $test -d /MachTen -o -d /MachTen_Folder; then
3302 if $test -x /sbin/version; then
3303 osvers=`/sbin/version | $awk '{print $2}' |
3304 $sed -e 's/[A-Za-z]$//'`
3305 elif $test -x /usr/etc/version; then
3306 osvers=`/usr/etc/version | $awk '{print $2}' |
3307 $sed -e 's/[A-Za-z]$//'`
3313 $test -f /sys/posix.dll &&
3314 $test -f /usr/bin/what &&
3315 set X `/usr/bin/what /sys/posix.dll` &&
3316 $test "$3" = UWIN &&
3320 if $test -f $uname; then
3328 umips) osname=umips ;;
3331 [23]100) osname=mips ;;
3333 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3334 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3337 elif $test -f /etc/kconfig; then
3339 if test "$lns" = "$ln -s"; then
3341 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3343 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3350 if test -n "$DJGPP"; then
3359 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3361 # oslevel can fail with:
3362 # oslevel: Unable to acquire lock.
3363 *not\ found) osvers="$4"."$3" ;;
3364 '<3240'|'<>3240') osvers=3.2.0 ;;
3365 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3366 '=3250'|'>3250') osvers=3.2.5 ;;
3370 bitrig) osname=bitrig
3373 bsd386) osname=bsd386
3376 cygwin*) osname=cygwin
3379 *dc.osx) osname=dcosx
3385 domainos) osname=apollo
3391 dragonfly) osname=dragonfly
3394 dynixptx*) osname=dynixptx
3395 osvers=`echo "$4"|sed 's/^v//'`
3397 freebsd) osname=freebsd
3399 genix) osname=genix ;;
3403 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3416 $test -f /system/lib/libandroid.so && osname=linux-android
3420 netbsd*) osname=netbsd
3423 news-os) osvers="$3"
3425 4*) osname=newsos4 ;;
3429 nonstop-ux) osname=nonstopux ;;
3430 openbsd) osname=openbsd
3436 POSIX-BC | posix-bc ) osname=posix-bc
3439 powerux | power_ux | powermax_os | powermaxos | \
3440 powerunix | power_unix) osname=powerux
3446 solaris) osname=solaris
3448 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3455 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3459 titanos) osname=titanos
3468 ultrix) osname=ultrix
3471 osf1|mls+) case "$5" in
3474 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3477 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3480 hp*) osname=hp_osf1 ;;
3481 mips) osname=mips_osf1 ;;
3484 # UnixWare 7.1.2 is known as Open UNIX 8
3485 openunix|unixware) osname=svr5
3493 $2) case "$osname" in
3497 : svr4.x or possibly later
3507 if test -f /stand/boot ; then
3508 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3509 if test -n "$INITPROG" -a -f "$INITPROG"; then
3510 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3511 if test -n "$isesix"; then
3519 *) if test -f /etc/systemid; then
3521 set `echo $3 | $sed 's/\./ /g'` $4
3522 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3524 elif $test -f $src/hints/sco_$1_$2.sh; then
3526 elif $test -f $src/hints/sco_$1.sh; then
3531 '') : Still unknown. Probably a generic Sys V.
3540 *) case "$osname" in
3541 '') : Still unknown. Probably a generic BSD.
3549 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3550 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3551 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3554 $rm -f UU/kernel.what
3555 elif test -d c:/. -o -n "$is_os2" ; then
3562 case "$targetarch" in
3565 case "$targetarch" in
3567 # Will load qnx.sh, which should change osname to nto
3572 # Catch arm-linux-androideabi, mipsel-linux-android,
3573 # and i686-linux-android
3574 osname=linux-android
3578 # Something like arm-linux-gnueabihf is really just
3585 # XXX perhaps we should just assume
3586 # osvers to be 2, or maybe take the value
3587 # from targetarch. Using $run before the
3588 # hints are run is somewhat icky.
3589 set X `$run $uname -a 2>/dev/null`
3592 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3597 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3604 : Now look for a hint file osname_osvers, unless one has been
3605 : specified already.
3608 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3609 : Also try without trailing minor version numbers.
3610 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3611 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3612 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3613 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3616 *) case "$osvers" in
3619 *) if $test -f $src/hints/$file.sh ; then
3621 elif $test -f $src/hints/$xfile.sh ; then
3623 elif $test -f $src/hints/$xxfile.sh ; then
3625 elif $test -f $src/hints/$xxxfile.sh ; then
3627 elif $test -f $src/hints/$xxxxfile.sh ; then
3629 elif $test -f "$src/hints/${osname}.sh" ; then
3638 if $test -f Policy.sh ; then
3641 none) dflt="Policy" ;;
3642 *) dflt="Policy $dflt" ;;
3647 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3651 if $test -f Policy.sh ; then
3654 There's also a Policy hint file available, which should make the
3655 site-specific (policy) questions easier to answer.
3662 You may give one or more space-separated answers, or "none" if appropriate.
3663 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3664 previous run of Configure, you may specify it as well as or instead of
3665 OS-specific hints. If hints are provided for your OS, you should use them:
3666 although Perl can probably be built without hints on many platforms, using
3667 hints often improve performance and may enable features that Configure can't
3668 set up on its own. If there are no hints that match your OS, specify "none";
3669 DO NOT give a wrong version or a wrong OS.
3673 rp="Which of these apply, if any?"
3676 for file in $tans; do
3677 if $test X$file = XPolicy -a -f Policy.sh; then
3679 $cat Policy.sh >> UU/config.sh
3680 elif $test -f $src/hints/$file.sh; then
3681 . $src/hints/$file.sh
3682 $cat $src/hints/$file.sh >> UU/config.sh
3683 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3686 : Give one chance to correct a possible typo.
3687 echo "$file.sh does not exist"
3689 rp="hint to use instead?"
3691 for file in $ans; do
3692 if $test -f "$src/hints/$file.sh"; then
3693 . $src/hints/$file.sh
3694 $cat $src/hints/$file.sh >> UU/config.sh
3695 elif $test X$ans = X -o X$ans = Xnone ; then
3698 echo "$file.sh does not exist -- ignored."
3705 : Remember our hint file for later.
3706 if $test -f "$src/hints/$file.sh" ; then
3716 echo "Fetching default answers from $config_sh..." >&4
3720 cp $config_sh config.sh 2>/dev/null
3730 test "$override" && . ./optdef.sh
3732 : Restore computed paths
3733 for file in $loclist $trylist; do
3734 eval $file="\$_$file"
3739 Configure uses the operating system name and version to set some defaults.
3740 The default value is probably right if the name rings a bell. Otherwise,
3741 since spelling matters for me, either accept the default or answer "none"
3748 ''|' '|none) dflt=none ;;
3749 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3752 *) dflt="$osname" ;;
3754 rp="Operating system name?"
3758 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3764 ''|' '|none) dflt=none ;;
3765 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3766 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3768 ''|' ') dflt=none ;;
3773 *) dflt="$osvers" ;;
3775 rp="Operating system version?"
3785 : who configured the system
3786 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3789 cf_by=`(logname) 2>/dev/null`
3792 cf_by=`(whoami) 2>/dev/null`
3794 "") cf_by=unknown ;;
3799 : decide how portable to be. Allow command line overrides.
3800 case "$d_portable" in
3802 *) d_portable="$define" ;;
3805 : set up shell script to do ~ expansion
3811 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3814 if $test -f /bin/csh; then
3815 /bin/csh -f -c "glob \$1"
3820 name=\`$expr x\$1 : '..\([^/]*\)'\`
3821 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3822 if $test ! -d "\$dir"; then
3824 echo "\$me: can't locate home directory for: \$name" >&2
3829 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3845 : now set up to get a file name
3849 cat <<'EOSC' >>getfile
3865 : getfile will accept an answer from the comma-separated list
3866 : enclosed in parentheses even if it does not meet other criteria.
3867 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3868 fn=`echo $fn | sed 's/(.*)//'`
3874 loc_file=`expr $fn : '.*:\(.*\)'`
3875 fn=`expr $fn : '\(.*\):.*'`
3883 */*) fullpath=true;;
3892 *e*) exp_file=true;;
3895 *p*) nopath_ok=true;;
3900 *d*) type='Directory';;
3901 *l*) type='Locate';;
3906 Locate) what='File';;
3911 case "$d_portable" in
3919 while test "$type"; do
3924 true) rp="$rp (~name ok)";;
3927 if test -f UU/getfile.ok && \
3928 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3947 value=`UU/filexp $ans`
3950 if test "$ans" != "$value"; then
3951 echo "(That expands to $value on this system.)"
3965 /*) value="$ansexp" ;;
3966 [a-zA-Z]:/*) value="$ansexp" ;;
3971 echo "I shall only accept a full path name, as in /bin/ls." >&4
3972 echo "Use a ! shell escape if you wish to check pathnames." >&4
3975 echo "Please give a full path name, starting with slash." >&4
3978 echo "Note that using ~name is ok provided it expands well." >&4
3991 for fp in $gfpth; do
3992 if test "X$fp" = X.; then
3997 if test -f "$pf"; then
3999 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4001 echo "($value is not a plain file, but that's ok.)"
4004 if test X"$type" = X; then
4011 for fp in $gfpth; do
4012 if test "X$fp" = X.; then
4017 direxp="$fp/$ansexp"
4019 if test -d "$direxp"; then
4027 if test -d "$ansexp"; then
4028 echo "(Looking for $loc_file in directory $value.)"
4029 value="$value/$loc_file"
4030 ansexp="$ansexp/$loc_file"
4032 if test -f "$ansexp"; then
4035 case "$nopath_ok" in
4036 true) case "$value" in
4038 *) echo "Assuming $value will be in people's path."
4054 if test "$fastread" = yes; then
4059 rp="$what $value doesn't exist. Use that name anyway?"
4078 test "X$gfpthkeep" != Xy && gfpth=""
4081 : determine root of directory hierarchy where package will be installed.
4084 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4087 dflt=`echo "$prefix" | sed 's/.$//'`
4095 By default, $package will be installed in $dflt/bin, manual pages
4096 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4097 installation directories. Typically this is something like /usr/local.
4098 If you wish to have binaries under /usr/bin but other parts of the
4099 installation under /usr/local, that's ok: you will be prompted
4100 separately for each of the installation directories, the prefix being
4101 only used to set the defaults.
4105 rp='Installation prefix to use?'
4113 *) oldprefix="$prefix";;
4120 : allow them to override the AFS root
4123 *) afsroot=$afsroot ;;
4129 $define|true) afs=true ;;
4130 $undef|false) afs=false ;;
4131 *) if $test -d $afsroot; then
4139 echo "AFS may be running... I'll be extra cautious then..." >&4
4141 echo "AFS does not seem to be running..." >&4
4144 : determine installation prefix for where package is to be installed.
4148 Since you are running AFS, I need to distinguish the directory in which
4149 files will reside from the directory in which they are installed (and from
4150 which they are presumably copied to the former directory by occult means).
4153 case "$installprefix" in
4154 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4155 *) dflt="$installprefix";;
4160 In some special cases, particularly when building $package for distribution,
4161 it is convenient to distinguish the directory in which files should be
4162 installed from the directory ($prefix) in which they will
4163 eventually reside. For most users, these two directories are the same.
4166 case "$installprefix" in
4168 *) dflt=$installprefix;;
4172 rp='What installation prefix should I use for installing files?'
4174 installprefix="$ans"
4175 installprefixexp="$ansexp"
4177 : Perform the prefixexp/installprefixexp correction if necessary
4178 cat <<EOS >installprefix
4181 cat <<'EOSC' >>installprefix
4182 : Change installation prefix, if necessary.
4183 if $test X"$prefix" != X"$installprefix"; then
4184 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4186 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4189 chmod +x installprefix
4190 $eunicefix installprefix
4192 : Set variables such as privlib and privlibexp from the output of ./getfile
4193 : performing the prefixexp/installprefixexp correction if necessary.
4194 cat <<EOS >setprefixvar
4197 cat <<'EOSC' >>setprefixvar
4198 eval "${prefixvar}=\"\$ans\""
4199 eval "${prefixvar}exp=\"\$ansexp\""
4202 chmod +x setprefixvar
4203 $eunicefix setprefixvar
4205 : set up the script used to warn in case of inconsistency
4214 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4216 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4217 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4222 echo "*** WHOA THERE!!! ***" >&4
4223 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4226 rp=" Keep the $hint value?"
4229 y) td=$was; tu=$was;;
4233 : function used to set '$1' to '$val'
4234 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4236 $define$undef) . ./whoa; eval "$var=\$td";;
4237 $undef$define) . ./whoa; eval "$var=\$tu";;
4238 *) eval "$var=$val";;
4241 : get the patchlevel
4243 echo "Getting the current patchlevel..." >&4
4244 if $test -r $rsrc/patchlevel.h;then
4245 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4246 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4247 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4248 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4249 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4250 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4251 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4260 $echo "(You do not have patchlevel.h. Eek.)"
4262 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4263 version_patchlevel_string="version $patchlevel subversion $subversion"
4264 case "$perl_patchlevel" in
4266 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4267 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4271 $echo "(You have $package $version_patchlevel_string.)"
4275 : XXX Should be a Configure test for double-dots in filenames.
4276 version=`echo $revision $patchlevel $subversion | \
4277 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4278 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4279 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4282 version=`echo $revision $patchlevel $subversion | \
4283 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4284 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4285 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4288 : Special case the 5.005_xx maintenance series, which used 5.005
4289 : without any subversion label as a subdirectory in $sitelib
4290 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4291 api_versionstring='5.005'
4294 : Do we want threads support and if so, what type
4295 case "$usethreads" in
4296 $define|true|[yY]*) dflt='y';;
4297 *) # Catch case where user specified ithreads or 5005threads but
4298 # forgot -Dusethreads (A.D. 4/2002)
4299 case "$useithreads$use5005threads" in
4300 *$define*) dflt='y';;
4307 Perl can be built to offer a form of threading support on some systems
4308 To do so, Configure can be run with -Dusethreads.
4310 Note that Perl built with threading support runs slightly slower
4311 and uses slightly more memory than plain Perl.
4313 If this doesn't make any sense to you, just accept the default '$dflt'.
4315 rp='Build a threading Perl?'
4318 y|Y) val="$define" ;;
4324 if $test $patchlevel -lt 9; then
4325 case "$usethreads" in
4327 : Default to ithreads unless overridden on command line or with
4330 case "$use5005threads" in
4332 echo "5.005 threads are no longer supported"
4336 case "$useithreads" in
4337 $undef|false|[nN]*) dflt='n';;
4339 rp='Use the newer interpreter-based ithreads?'
4342 y|Y) val="$define" ;;
4347 : Now set use5005threads to the opposite value.
4348 case "$useithreads" in
4349 $define) val="$undef" ;;
4356 useithreads="$undef"
4357 use5005threads="$undef"
4361 case "$useithreads$use5005threads" in
4365 You cannot have both the ithreads and the 5.005 threads enabled
4366 at the same time. Disabling the 5.005 threads since they are
4367 much less stable than the ithreads.
4370 use5005threads="$undef"
4375 : perl-5.9.x and later
4377 if test X"$usethreads" = "X$define"; then
4378 case "$use5005threads" in
4382 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4389 use5005threads="$undef"
4390 useithreads="$usethreads"
4393 case "$d_oldpthreads" in
4394 '') : Configure tests would be welcome here. For now, assume undef.
4396 *) val="$d_oldpthreads" ;;
4402 : Look for a hint-file generated 'call-back-unit'. If the
4403 : user has specified that a threading perl is to be built,
4404 : we may need to set or change some other defaults.
4405 if $test -f usethreads.cbu; then
4406 echo "Your platform has some specific hints regarding threaded builds, using them..."
4409 case "$usethreads" in
4410 "$define"|true|[yY]*)
4412 (Your platform does not have any specific hints for threaded builds.
4413 Assuming POSIX threads, then.)
4419 : Check if multiplicity is required
4422 Perl can be built so that multiple Perl interpreters can coexist
4423 within the same Perl executable.
4426 case "$useithreads" in
4429 This multiple interpreter support is required for interpreter-based threads.
4433 *) case "$usemultiplicity" in
4434 $define|true|[yY]*) dflt='y';;
4438 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4439 rp='Build Perl for multiplicity?'
4442 y|Y) val="$define" ;;
4450 : Check if usequadmath is requested
4451 case "$usequadmath" in
4452 "$define"|true|[yY]*)
4453 usequadmath="$define"
4454 # if usequadmath enabled also enable uselongdouble
4455 uselongdouble="$define"
4457 *) usequadmath="$undef" ;;
4460 : Check if morebits is requested
4461 case "$usemorebits" in
4462 "$define"|true|[yY]*)
4463 use64bitint="$define"
4464 uselongdouble="$define"
4465 usemorebits="$define"
4467 *) usemorebits="$undef"
4471 : Determine the C compiler to be used
4477 rp="Use which C compiler?"
4481 : See whether they have no cc but they do have gcc
4483 if $test -f cc.cbu; then
4488 : make some quick guesses about what we are up against
4490 $echo $n "Hmm... $c"
4500 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4501 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4503 echo "Looks kind of like an OSF/1 system, but we'll see..."
4505 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4506 xxx=`./loc addbib blurfl $pth`
4507 if $test -f $xxx; then
4508 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4512 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4513 echo "Looks kind of like an extended USG system, but we'll see..."
4515 echo "Looks kind of like a USG system, but we'll see..."
4519 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4520 echo "Looks kind of like a BSD system, but we'll see..."
4524 echo "Looks kind of like a Version 7 system, but we'll see..."
4527 case "$eunicefix" in
4530 There is, however, a strange, musty smell in the air that reminds me of
4531 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4535 : it so happens the Eunice I know will not run shell scripts in Unix format
4539 echo "Congratulations. You aren't running Eunice."
4543 : Detect OS2. The p_ variable is set above in the Head.U unit.
4544 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4545 : semicolon as a patch separator
4550 I have the feeling something is not exactly right, however...don't tell me...
4551 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4552 (Or you may be running DOS with DJGPP.)
4557 if test -f /xenix; then
4558 echo "Actually, this looks more like a XENIX system..."
4563 echo "It's not Xenix..."
4568 if test -f /venix; then
4569 echo "Actually, this looks more like a VENIX system..."
4576 echo "Nor is it Venix..."
4579 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4580 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4583 : Check if we are using GNU gcc and what its version is
4585 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4589 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4591 printf("%s\n", __VERSION__);
4593 printf("%s\n", "1");
4599 if $cc -o try $ccflags $ldflags try.c; then
4600 gccversion=`$run ./try`
4601 case "$gccversion" in
4602 '') echo "You are not using GNU cc." ;;
4603 *) echo "You are using GNU cc $gccversion."
4609 echo "*** WHOA THERE!!! ***" >&4
4610 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4611 case "$knowitall" in
4613 echo " You'd better start hunting for one and let me know about it." >&4
4619 case "$gccversion" in
4620 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4622 case "$gccversion" in
4623 '') gccosandvers='' ;;
4624 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4625 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4627 case "$gccosandvers" in
4628 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4629 $osname$osvers) ;; # looking good
4630 $osname*) cat <<EOM >&4
4632 *** WHOA THERE!!! ***
4634 Your gcc has not been compiled for the exact release of
4635 your operating system ($gccosandvers versus $osname$osvers).
4637 In general it is a good idea to keep gcc synchronized with
4638 the operating system because otherwise serious problems
4639 may ensue when trying to compile software, like Perl.
4641 I'm trying to be optimistic here, though, and will continue.
4642 If later during the configuration and build icky compilation
4643 problems appear (headerfile conflicts being the most common
4644 manifestation), I suggest reinstalling the gcc to match
4645 your operating system release.
4649 *) gccosandvers='' ;; # failed to parse, better be silent
4657 # gcc 3.* complain about adding -Idirectories that they already know about,
4658 # so we will take those off from locincpth.
4659 case "$gccversion" in
4661 echo "main(){}">try.c
4662 for incdir in $locincpth; do
4663 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4664 grep '^c[cp]p*[01]: warning: changing search order '`
4665 if test "X$warn" != X; then
4666 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4672 # gcc 4.9 by default does some optimizations that break perl.
4673 # see ticket 121505.
4675 # The -fwrapv disables those optimizations (and probably others,) so
4676 # for gcc 4.9 (and later, since the optimizations probably won't go
4677 # away), add -fwrapv unless the user requests -fno-wrapv, which
4678 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4679 # which turns the overflows -fwrapv ignores into runtime errors.
4680 case "$gccversion" in
4681 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4683 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4684 *) ccflags="$ccflags -fwrapv" ;;
4688 : What should the include directory be ?
4689 : Use sysroot if set, so findhdr looks in the right place.
4691 $echo $n "Hmm... $c"
4692 dflt="$sysroot/usr/include"
4695 if $test -f /bin/mips && /bin/mips; then
4696 echo "Looks like a MIPS system..."
4697 $cat >usr.c <<'EOCP'
4698 #ifdef SYSTYPE_BSD43
4702 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4703 dflt='/bsd43/usr/include'
4707 mips_type='System V'
4709 $rm -f usr.c usr.out
4710 echo "and you're compiling with the $mips_type compiler and libraries."
4714 echo "Doesn't look like a MIPS system."
4724 case "$xxx_prompt" in
4727 rp='Where are the include files you want to use?'
4735 : see how we invoke the C preprocessor
4737 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4738 cat <<'EOT' >testcpp.c
4744 if test ! -f cppstdin; then
4745 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4746 # AIX cc -E doesn't show the absolute headerfile
4747 # locations but we'll cheat by using the -M flag.
4748 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
4750 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4753 echo "Keeping your $hint cppstdin wrapper."
4756 wrapper=`pwd`/cppstdin
4760 if $test "X$cppstdin" != "X" && \
4761 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4762 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4764 echo "You used to use $cppstdin $cppminus so we'll use that again."
4766 '') echo "But let's see if we can live without a wrapper..." ;;
4768 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4769 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4771 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4774 echo "(However, $cpprun $cpplast does not work, let's see...)"
4782 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4789 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4790 $cc -E <testcpp.c >testcpp.out 2>&1; \
4791 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4792 echo "Yup, it does."
4793 x_cpp="$cc $cppflags -E"
4795 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4796 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4797 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4798 echo "Yup, it does."
4799 x_cpp="$cc $cppflags -E"
4801 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4802 $cc -P <testcpp.c >testcpp.out 2>&1; \
4803 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4804 echo "Yipee, that works!"
4805 x_cpp="$cc $cppflags -P"
4807 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4808 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4809 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4810 echo "At long last!"
4811 x_cpp="$cc $cppflags -P"
4813 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4814 $cpp <testcpp.c >testcpp.out 2>&1; \
4815 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4817 x_cpp="$cpp $cppflags"
4819 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4820 $cpp - <testcpp.c >testcpp.out 2>&1; \
4821 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4822 echo "Hooray, it works! I was beginning to wonder."
4823 x_cpp="$cpp $cppflags"
4825 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4826 $wrapper <testcpp.c >testcpp.out 2>&1; \
4827 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4833 rp="No dice. I can't find a C preprocessor. Name one:"
4837 $x_cpp <testcpp.c >testcpp.out 2>&1
4838 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4839 echo "OK, that will do." >&4
4841 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4856 echo "Perhaps can we force $cc -E using a wrapper..."
4857 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4858 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4864 echo "Nope, we'll have to live without it..."
4878 "$wrapper"|'cppstdin') ;;
4879 *) $rm -f $wrapper;;
4881 $rm -f testcpp.c testcpp.out
4883 : Adjust cppfilter for path component separator
4885 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4886 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4890 : Use gcc to determine libpth and incpth
4891 # If using gcc or clang, we can get better values for libpth, incpth
4892 # and usrinc directly from the compiler.
4893 # Note that ccname for clang is also gcc.
4896 $echo 'extern int foo;' > try.c
4897 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4899 if $test $# -gt 0; then
4901 incpth="`$echo $incpth|$sed 's/^ //'`"
4903 j="`$echo $i|$sed 's,/include$,/lib,'`"
4904 if $test -d $j; then
4908 libpth="`$echo $libpth|$sed 's/^ //'`"
4909 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4910 if $test -d $xxx; then
4913 *) libpth="$libpth $xxx";;
4920 '') for i in $incpth; do
4921 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
4929 case "$usecrosscompile" in
4932 '') echo "Incpth not defined." >&4; croak=y ;;
4933 *) echo "Using incpth '$incpth'." >&4 ;;
4936 '') echo "Libpth not defined." >&4; croak=y ;;
4937 *) echo "Using libpth '$libpth'." >&4 ;;
4940 '') echo "Usrinc not defined." >&4; croak=y ;;
4941 *) echo "Using usrinc $usrinc." >&4 ;;
4945 if test "X$sysroot" = X; then
4946 echo "Cannot continue, aborting." >&4; exit 1
4948 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
4957 : Default value for incpth is just usrinc
4959 '') incpth="$usrinc";;
4962 : Set private lib path
4965 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
4970 '') dlist="$loclibpth $plibpth $glibpth";;
4971 *) dlist="$libpth";;
4974 : Now check and see which directories actually exist, avoiding duplicates
4977 if $test -d $xxx; then
4980 *) libpth="$libpth $xxx";;
4986 Some systems have incompatible or broken versions of libraries. Among
4987 the directories listed in the question below, please remove any you
4988 know not to be holding relevant libraries, and add any that are needed.
4989 Say "none" for none.
4993 if test "X$sysroot" != X; then
4995 You have set sysroot to $sysroot, please supply the directories excluding sysroot
5008 rp="Directories to use for library searches?"
5015 : compute shared library extension
5018 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5028 On some systems, shared libraries may be available. Answer 'none' if
5029 you want to suppress searching of shared libraries for the remainder
5030 of this configuration.
5033 rp='What is the file extension used for shared libraries?'
5037 : Does target system insist that shared library basenames are unique
5040 Some dynamic loaders assume that the *basename* of shared library filenames
5041 are globally unique. We'll default this to undef as we assume your system
5042 is not this weird. Set to defined if you're on one of them.
5047 rp='Make shared library basenames unique?'
5050 y|Y) val="$define" ;;
5053 set d_libname_unique
5056 : Define several unixisms.
5057 : Hints files or command line option can be used to override them.
5058 : The convoluted testing is in case hints files set either the old
5061 '') case "$exe_ext" in
5063 *) _exe="$exe_ext" ;;
5068 '') case "$lib_ext" in
5075 '') case "$obj_ext" in
5082 '') case "$path_sep" in
5093 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5095 : Which makefile gets called first. This is used by make depend.
5096 case "$firstmakefile" in
5097 '') firstmakefile='makefile';;
5100 : Check is we will use socks
5102 $define|true|[yY]*) dflt='y';;
5107 Perl can be built to use the SOCKS proxy protocol library. To do so,
5108 Configure must be run with -Dusesocks. If you use SOCKS you also need
5109 to use the PerlIO abstraction layer, this will be implicitly selected.
5111 If this doesn't make any sense to you, just accept the default '$dflt'.
5113 rp='Build Perl for SOCKS?'
5116 y|Y) val="$define" ;;
5122 : Check for uselongdouble support
5124 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5127 case "$uselongdouble" in
5128 $define|true|[yY]*) dflt='y';;
5133 Perl can be built to take advantage of long doubles which
5134 (if available) may give more accuracy and range for floating point numbers.
5136 If this doesn't make any sense to you, just accept the default '$dflt'.
5138 rp='Try to use long doubles if available?'
5141 y|Y) val="$define" ;;
5147 case "$uselongdouble" in
5148 true|[yY]*) uselongdouble="$define" ;;
5151 : Look for a hint-file generated 'call-back-unit'. If the
5152 : user has specified that long doubles should be used,
5153 : we may need to set or change some other defaults.
5154 if $test -f uselongdouble.cbu; then
5155 echo "Your platform has some specific hints regarding long doubles, using them..."
5156 . ./uselongdouble.cbu
5158 case "$uselongdouble" in
5161 (Your platform does not have any specific hints for long doubles.)
5167 : Looking for optional libraries
5169 echo "Checking for optional libraries..." >&4
5174 case "$libswanted" in
5175 '') libswanted='c_s';;
5178 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5180 case "$usecbacktrace" in
5181 "$define") libswanted="$libswanted bfd" ;;
5183 case "$usequadmath" in
5184 "$define") libswanted="$libswanted quadmath" ;;
5190 for thisdir in $libpth $xlibpth; do
5191 test -d $thisdir && libspath="$libspath $thisdir"
5193 for thislib in $libswanted; do
5194 for thisdir in $libspath; do
5196 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5197 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5198 $test -f "$xxx" && eval $libscheck
5199 $test -f "$xxx" && libstyle=shared
5200 xxx=`ls $thisdir/lib$thislib.[0-9].$so 2>/dev/null|sed -n '$p'`
5201 $test -f "$xxx" && eval $libscheck
5202 $test -f "$xxx" && libstyle=shared
5204 if test ! -f "$xxx"; then
5205 xxx=$thisdir/lib$thislib.$so
5206 $test -f "$xxx" && eval $libscheck
5207 $test -f "$xxx" && libstyle=shared
5209 if test ! -f "$xxx"; then
5210 xxx=$thisdir/lib$thislib$_a
5211 $test -f "$xxx" && eval $libscheck
5212 $test -f "$xxx" && libstyle=static
5214 if test ! -f "$xxx"; then
5215 xxx=$thisdir/$thislib$_a
5216 $test -f "$xxx" && eval $libscheck
5217 $test -f "$xxx" && libstyle=static
5219 if test ! -f "$xxx"; then
5220 xxx=$thisdir/lib${thislib}_s$_a
5221 $test -f "$xxx" && eval $libscheck
5222 $test -f "$xxx" && libstyle=static
5223 $test -f "$xxx" && thislib=${thislib}_s
5225 if test ! -f "$xxx"; then
5226 xxx=$thisdir/Slib$thislib$_a
5227 $test -f "$xxx" && eval $libscheck
5228 $test -f "$xxx" && libstyle=static
5230 if $test -f "$xxx"; then
5232 shared) echo "Found -l$thislib (shared)." ;;
5233 static) echo "Found -l$thislib." ;;
5234 *) echo "Found -l$thislib ($libstyle)." ;;
5238 *) dflt="$dflt -l$thislib"
5239 libsfound="$libsfound $xxx"
5241 libsfiles="$libsfiles $yyy"
5242 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5243 case " $libsdirs " in
5245 *) libsdirs="$libsdirs $yyy" ;;
5252 if $test ! -f "$xxx"; then
5253 echo "No -l$thislib."
5264 ' '|'') dflt='none';;
5269 In order to compile $package on your machine, a number of libraries
5270 are usually needed. Include any other special libraries here as well.
5271 Say "none" for none. The default list is almost always right.
5275 rp="What libraries to use?"
5282 : determine optimization, if desired, or use for debug flag also
5284 ' '|$undef) dflt='none';;
5286 *) dflt="$optimize";;
5290 By default, $package compiles with the -O flag to use the optimizer.
5291 Alternately, you might want to use the symbolic debugger, which uses
5292 the -g flag (on traditional Unix systems). Either flag can be
5293 specified here. To use neither flag, specify the word "none".
5296 rp="What optimizer/debugger flag should be used?"
5300 'none') optimize=" ";;
5303 : Check what DEBUGGING is required from the command line
5304 : -DEBUGGING or -DDEBUGGING or
5305 : -DEBUGGING=both = -g + -DDEBUGGING
5306 : -DEBUGGING=-g or -Doptimize=-g = -g
5307 : -DEBUGGING=none or -UDEBUGGING =
5308 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5311 *) DEBUGGING=$EBUGGING ;;
5314 case "$DEBUGGING" in
5318 *) optimize="$optimize -g" ;;
5322 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5330 case "$DEBUGGING" in
5331 both|$define) dflt='-DDEBUGGING'
5334 : argument order is deliberate, as the flag will start with - which set could
5335 : think is an option
5336 checkccflag='check=$1; flag=$2; callback=$3;
5338 echo "Checking if your compiler accepts $flag" 2>&1;
5339 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5340 echo "int main(void) { return 0; }" > gcctest.c;
5341 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5342 echo "Yes, it does." 2>&1;
5343 if $test -s gcctest.out ; then
5344 echo "But your platform does not like it:";
5349 echo "Leaving current flags $ccflags alone." 2>&1
5351 *) dflt="$dflt $flag";
5357 echo "Nope, it does not, but that is ok." 2>&1;
5361 : We will not override a previous value, but we might want to
5362 : augment a hint file
5364 default|recommended)
5365 case "$gccversion" in
5366 1*) dflt="$dflt -fpcc-struct-return" ;;
5368 case "$optimize:$DEBUGGING" in
5369 *-g*:old) dflt="$dflt -DDEBUGGING";;
5371 case "$gccversion" in
5372 2*) if $test -d /etc/conf/kconfig.d &&
5373 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5375 # Interactive Systems (ISC) POSIX mode.
5380 case "$gccversion" in
5383 ?*) set strict-aliasing -fno-strict-aliasing
5387 # For gcc, adding -pipe speeds up compilations for some, but apparently
5388 # some assemblers can't read from stdin. (It also slows down compilations
5389 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5390 case "$gccversion" in
5396 # on x86_64 (at least) we require an extra library (libssp) in the
5397 # link command line. This library is not named, so I infer that it is
5398 # an implementation detail that may change. Hence the safest approach
5399 # is to add the flag to the flags passed to the compiler at link time,
5400 # as that way the compiler can do the right implementation dependant
5402 case "$gccversion" in
5403 ?*) set stack-protector-strong -fstack-protector-strong
5406 *-fstack-protector-strong*) ;; # It got added.
5407 *) # Try the plain/older -fstack-protector.
5408 set stack-protector -fstack-protector
5417 case "$mips_type" in
5418 *BSD*|'') inclwanted="$locincpth $usrinc";;
5419 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5421 for thisincl in $inclwanted; do
5422 if $test -d $thisincl; then
5423 if $test x$thisincl != x$usrinc; then
5425 *" -I$thisincl "*);;
5426 *) dflt="$dflt -I$thisincl ";;
5432 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5434 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5442 *) dflt="$dflt -D$2";;
5446 set signal.h LANGUAGE_C; eval $inctest
5450 ccflags="$ccflags -DSOCKS"
5455 default|recommended) dflt="$ccflags $dflt" ;;
5456 *) dflt="$ccflags";;
5465 Your C compiler may want other flags. For this question you should include
5466 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5467 but you should NOT include libraries or ld flags like -lwhatever. If you
5468 want $package to honor its debug switch, you should include -DDEBUGGING here.
5469 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5471 To use no flags, specify the word "none".
5477 rp="Any additional cc flags?"
5484 : the following weeds options from ccflags that are of no interest to cpp
5486 '') cppflags="$ccflags" ;;
5487 *) cppflags="$cppflags $ccflags" ;;
5489 case "$gccversion" in
5490 1*) cppflags="$cppflags -D__GNUC__"
5492 case "$mips_type" in
5494 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5500 echo "Let me guess what the preprocessor flags are..." >&4
5514 *) ftry="$previous $flag";;
5516 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5517 >cpp1.out 2>/dev/null && \
5518 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5519 >cpp2.out 2>/dev/null && \
5520 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5521 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5523 cppflags="$cppflags $ftry"
5533 *-*) echo "They appear to be: $cppflags";;
5535 $rm -f cpp.c cpp?.out
5539 : flags used in final linking phase
5541 '') if ./venix; then
5547 *-posix*) dflt="$dflt -posix" ;;
5550 *) dflt="$ldflags";;
5552 # See note above about -fstack-protector
5554 *-fstack-protector-strong*)
5556 *-fstack-protector-strong*) ;; # Don't add it again
5557 *) dflt="$dflt -fstack-protector-strong" ;;
5560 *-fstack-protector*)
5562 *-fstack-protector*) ;; # Don't add it again
5563 *) dflt="$dflt -fstack-protector" ;;
5568 : Try to guess additional flags to pick up local libraries.
5569 for thislibdir in $libpth; do
5570 case " $loclibpth " in
5573 *"-L$thislibdir "*) ;;
5574 *) dflt="$dflt -L$thislibdir" ;;
5586 Your C linker may need flags. For this question you should
5587 include -L/whatever and any other flags used by the C linker, but you
5588 should NOT include libraries like -lwhatever.
5590 Make sure you include the appropriate -L/path flags if your C linker
5591 does not normally search all of the directories you specified above,
5594 To use no flags, specify the word "none".
5598 rp="Any additional ld flags (NOT including libraries)?"
5604 rmlist="$rmlist pdp11"
5608 echo "Checking your choice of C compiler and flags for coherency..." >&4
5609 $cat > try.c <<'EOF'
5611 int main() { printf("Ok\n"); return(0); }
5613 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5615 $cat >try.msg <<'EOM'
5616 I've tried to compile and run the following simple program:
5619 $cat try.c >> try.msg
5621 $cat >> try.msg <<EOM
5628 and I got the following output:
5632 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5633 if $sh -c "$run ./try " >>try.msg 2>&1; then
5637 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5640 echo "The program compiled OK, but exited with status $?." >>try.msg
5641 rp="You have a problem. Shall I abort Configure"
5645 echo "I can't compile the test program." >>try.msg
5646 rp="You have a BIG problem. Shall I abort Configure"
5652 case "$knowitall" in
5654 echo "(The supplied flags or libraries might be incorrect.)"
5662 *) echo "Ok. Stopping Configure." >&4
5667 n) echo "OK, that should do.";;
5669 $rm_try gcctest gcctest.out
5671 : define a shorthand compile call
5675 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5676 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5680 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5681 : define a shorthand compile call for compilations that should be ok.
5685 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5687 : determine filename position in cpp output
5689 echo "Computing filename position in cpp output for #include directives..." >&4
5691 vos) testaccess=-e ;;
5694 echo '#include <stdio.h>' > foo.c
5697 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5698 $grep '^[ ]*#.*stdio\.h' | \
5699 while read cline; do
5702 while $test \$# -gt 0; do
5703 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5708 pos=\`expr \$pos + 1\`
5720 *) pos="${fieldn}th";;
5722 echo "Your cpp writes the filename in the $pos field of the line."
5724 : locate header file
5729 for usrincdir in $incpth
5731 if test -f \$usrincdir/\$wanted; then
5732 echo "\$usrincdir/\$wanted"
5736 awkprg='{ print \$$fieldn }'
5737 echo "#include <\$wanted>" > foo\$\$.c
5738 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5739 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5740 while read cline; do
5741 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5743 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5744 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5749 # status = 0: grep returned 0 lines, case statement not executed
5750 # status = 1: headerfile found
5751 # status = 2: while loop executed, no headerfile found
5755 if test \$status -eq 1; then
5762 : define an alternate in-header-list? function
5763 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5764 cont=true; xxf="echo \"<\$1> found.\" >&4";
5765 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5766 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5768 case $# in 4) instead=instead;; *) instead="at last";; esac;
5769 while $test "$cont"; do
5771 var=$2; eval "was=\$$2";
5772 if $test "$xxx" && $test -r "$xxx";
5774 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5777 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5778 set $yyy; shift; shift; yyy=$@;
5779 case $# in 0) cont="";;
5780 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5781 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5782 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5783 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5787 do set $yyy; var=$2; eval "was=\$$2";
5788 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5789 set $yyy; shift; shift; yyy=$@;
5792 : see if stdlib is available
5793 set stdlib.h i_stdlib
5796 : check for lengths of integral types
5800 echo "Checking to see how big your integers are..." >&4
5809 printf("intsize=%d;\n", (int)sizeof(int));
5810 printf("longsize=%d;\n", (int)sizeof(long));
5811 printf("shortsize=%d;\n", (int)sizeof(short));
5816 if eval $compile_ok && $run ./try > /dev/null; then
5818 echo "Your integers are $intsize bytes long."
5819 echo "Your long integers are $longsize bytes long."
5820 echo "Your short integers are $shortsize bytes long."
5824 Help! I can't compile and run the intsize test program: please enlighten me!
5825 (This is probably a misconfiguration in your system or libraries, and
5826 you really ought to fix it. Still, I'll try anyway.)
5830 rp="What is the size of an integer (in bytes)?"
5834 rp="What is the size of a long integer (in bytes)?"
5838 rp="What is the size of a short integer (in bytes)?"
5846 : check for long long
5848 echo "Checking to see if you have long long..." >&4
5849 echo 'int main() { long long x = 7; return 0; }' > try.c
5851 if eval $compile; then
5853 echo "You have long long."
5856 echo "You do not have long long."
5862 : check for length of long long
5863 case "${d_longlong}${longlongsize}" in
5866 echo "Checking to see how big your long longs are..." >&4
5867 $cat >try.c <<'EOCP'
5871 printf("%d\n", (int)sizeof(long long));
5876 if eval $compile_ok; then
5877 longlongsize=`$run ./try`
5878 echo "Your long longs are $longlongsize bytes long."
5882 echo "(I can't seem to compile the test program. Guessing...)"
5883 rp="What is the size of a long long (in bytes)?"
5887 if $test "X$longsize" = "X$longlongsize"; then
5888 echo "(That isn't any different from an ordinary long.)"
5894 : see if inttypes.h is available
5895 : we want a real compile instead of Inhdr because some systems
5896 : have an inttypes.h which includes non-existent headers
5899 #include <inttypes.h>
5901 static int32_t foo32 = 0x12345678;
5905 if eval $compile; then
5906 echo "<inttypes.h> found." >&4
5909 echo "<inttypes.h> NOT found." >&4
5918 echo "Checking to see if you have int64_t..." >&4
5920 #include <sys/types.h>
5921 #$i_inttypes I_INTTYPES
5923 #include <inttypes.h>
5925 int main() { int64_t x = 7; }
5928 if eval $compile; then
5930 echo "You have int64_t."
5933 echo "You do not have int64_t."
5939 : Check if 64bit ints have a quad type
5941 echo "Checking which 64-bit integer type we could use..." >&4
5947 val='"unsigned int"'
5952 *) case "$longsize" in
5956 val='"unsigned long"'
5961 *) case "$d_longlong:$longlongsize" in
5966 val='"unsigned long long"'
5971 *) case "$d_int64_t" in
5990 '') echo "Alas, no 64-bit integer types in sight." >&4
5993 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5998 : Do we want 64bit support
5999 case "$uselonglong" in
6000 "$define"|true|[yY]*)
6003 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
6005 use64bitint="$define"
6008 case "$use64bits" in
6009 "$define"|true|[yY]*)
6012 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
6014 use64bitint="$define"
6017 case "$use64bitints" in
6018 "$define"|true|[yY]*)
6021 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
6023 use64bitint="$define"
6026 case "$use64bitsint" in
6027 "$define"|true|[yY]*)
6030 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
6032 use64bitint="$define"
6035 case "$uselonglongs" in
6036 "$define"|true|[yY]*)
6039 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
6041 use64bitint="$define"
6044 case "$use64bitsall" in
6045 "$define"|true|[yY]*)
6048 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6050 use64bitall="$define"
6055 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6057 case "$use64bitall" in
6058 "$define"|true|[yY]*) use64bitint="$define" ;;
6064 You have natively 64-bit long integers.
6068 *) case "$use64bitint" in
6069 "$define"|true|[yY]*) dflt='y';;
6078 Perl can be built to take advantage of 64-bit integer types
6079 on some systems. To do so, Configure can be run with -Duse64bitint.
6080 Choosing this option will most probably introduce binary incompatibilities.
6082 If this doesn't make any sense to you, just accept the default '$dflt'.
6083 (The default has been chosen based on your configuration.)
6085 rp='Try to use 64-bit integers, if available?'
6088 [yY]*) val="$define" ;;
6096 case "$use64bitall" in
6097 "$define"|true|[yY]*) dflt='y' ;;
6098 *) case "$longsize" in
6106 You may also choose to try maximal 64-bitness. It means using as much
6107 64-bitness as possible on the platform. This in turn means even more
6108 binary incompatibilities. On the other hand, your platform may not
6109 have any more 64-bitness available than what you already have chosen.
6111 If this doesn't make any sense to you, just accept the default '$dflt'.
6112 (The default has been chosen based on your configuration.)
6114 rp='Try to use maximal 64-bit support, if available?'
6117 [yY]*) val="$define" ;;
6122 case "$use64bitall" in
6124 case "$use64bitint" in
6128 Since you have chosen a maximally 64-bit build, I'm also turning on
6129 the use of 64-bit integers.
6131 use64bitint="$define" ;;
6136 : Look for a hint-file generated 'call-back-unit'. If the
6137 : user has specified that a 64-bit perl is to be built,
6138 : we may need to set or change some other defaults.
6139 if $test -f use64bitint.cbu; then
6140 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6143 case "$use64bitint" in
6144 "$define"|true|[yY]*)
6145 : This test was common to all the OpenBSD forks, and seems harmless for
6148 echo "Checking if your C library has broken 64-bit functions..." >&4
6151 typedef $uquadtype myULL;
6158 {4294967303.15, 4294967303ULL},
6159 {4294967294.2, 4294967294ULL},
6160 {4294967295.7, 4294967295ULL},
6163 for (p = test; p->u; p++) {
6164 myULL x = (myULL)p->d;
6175 if eval $compile_ok; then
6176 libcquad=`$run ./try`
6177 echo "Your C library's 64-bit functions are $libcquad."
6179 echo "(I can't seem to compile the test program.)"
6180 echo "Assuming that your C library's 64-bit functions are ok."
6189 *** You have a C library with broken 64-bit functions.
6190 *** 64-bit support does not work reliably in this configuration.
6191 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6192 *** Cannot continue, aborting.
6199 4) case "$archname64" in
6200 '') archname64=64int ;;
6207 : Look for a hint-file generated 'call-back-unit'. If the
6208 : user has specified that a maximally 64-bit perl is to be built,
6209 : we may need to set or change some other defaults.
6210 if $test -f use64bitall.cbu; then
6211 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6214 case "$use64bitall" in
6215 "$define"|true|[yY]*)
6217 4) case "$archname64" in
6218 ''|64int) archname64=64all ;;
6225 case "$d_quad:$use64bitint" in
6229 *** You have chosen to use 64-bit integers,
6230 *** but none can be found.
6231 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6232 *** Cannot continue, aborting.
6239 : Check if we are using the GNU C library
6241 echo "Checking for GNU C Library..." >&4
6243 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6244 alone are insufficient to distinguish different versions, such as
6245 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6246 libc version 2.1.0. A. Dougherty, June 3, 2002.
6252 # ifdef __GLIBC_MINOR__
6253 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
6254 # include <gnu/libc-version.h>
6255 printf("%s\n", gnu_get_libc_version());
6257 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
6260 printf("%d\n", __GLIBC__);
6269 if eval $compile_ok && $run ./try > glibc.ver; then
6271 gnulibc_version=`$cat glibc.ver`
6272 echo "You are using the GNU C Library version $gnulibc_version"
6276 echo "You are not using the GNU C Library"
6282 : see if nm is to be used to determine whether a symbol is defined or not
6286 case "$d_gnulibc" in
6289 echo "nm probably won't work on the GNU C Library." >&4
6295 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
6297 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
6298 echo "'nm' won't be sufficient on this system." >&4
6304 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
6305 if $test $dflt -gt 20; then
6315 true|$define) dflt=y;;
6322 I can use $nm to extract the symbols from your C libraries. This
6323 is a time consuming task which may generate huge output on the disk (up
6324 to 3 megabytes) but that should make the symbols extraction faster. The
6325 alternative is to skip the 'nm' extraction part and to compile a small
6326 test program instead to determine whether each symbol is present. If
6327 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
6328 this may be the best solution.
6330 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
6333 rp="Shall I use $nm to extract C symbols from the libraries?"
6336 [Nn]*) usenm=false;;
6345 : nm options which may be necessary
6347 '') if $test -f /mach_boot; then
6349 elif $test -d /usr/ccs/lib; then
6350 nm_opt='-p' # Solaris (and SunOS?)
6351 elif $test -f /dgux; then
6353 elif $test -f /lib64/rld; then
6354 nm_opt='-p' # 64-bit Irix
6360 : nm options which may be necessary for shared libraries but illegal
6361 : for archive libraries. Thank you, Linux.
6362 case "$nm_so_opt" in
6363 '') case "$myuname" in
6365 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
6366 nm_so_opt='--dynamic'
6373 : Figure out where the libc is located
6376 : get list of predefined functions in a handy place
6381 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
6387 *) for thislib in $libs; do
6390 : Handle C library specially below.
6393 thislib=`echo $thislib | $sed -e 's/^-l//'`
6394 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
6396 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
6398 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
6400 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
6402 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
6404 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
6406 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
6411 libnames="$libnames $try"
6413 *) libnames="$libnames $thislib" ;;
6422 for xxx in $libpth; do
6423 $test -r $1 || set $xxx/libc.$so
6424 : The messy sed command sorts on library version numbers.
6426 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
6427 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
6429 s/[0-9][0-9]*/0000&/g
6430 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
6433 $sort | $sed -e 's/^.* //'`
6436 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
6437 $test -r $1 || set $sysroot/lib/libsys_s$_a
6443 if $test -r "$1"; then
6444 echo "Your (shared) C library seems to be in $1."
6446 elif $test -r /lib/libc && $test -r /lib/clib; then
6447 echo "Your C library seems to be in both /lib/clib and /lib/libc."
6449 libc='/lib/clib /lib/libc'
6450 if $test -r /lib/syslib; then
6451 echo "(Your math library is in /lib/syslib.)"
6452 libc="$libc /lib/syslib"
6454 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6455 echo "Your C library seems to be in $libc, as you said before."
6456 elif $test -r $incpath/usr/lib/libc$_a; then
6457 libc=$incpath/usr/lib/libc$_a;
6458 echo "Your C library seems to be in $libc. That's fine."
6459 elif $test -r /lib/libc$_a; then
6461 echo "Your C library seems to be in $libc. You're normal."
6463 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
6465 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
6466 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
6467 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
6469 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6471 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
6474 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
6476 if $test -r "$tans"; then
6477 echo "Your C library seems to be in $tans, of all places."
6483 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
6487 If the guess above is wrong (which it might be if you're using a strange
6488 compiler, or your machine supports multiple models), you can override it here.
6493 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
6495 I can't seem to find your C library. I've looked in the following places:
6498 $sed 's/^/ /' libpath
6501 None of these seems to contain your C library. I need to get its name...
6506 rp='Where is your C library?'
6511 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
6512 set X `cat libnames`
6515 case $# in 1) xxx=file; esac
6516 echo "Extracting names from the following $xxx for later perusal:" >&4
6518 $sed 's/^/ /' libnames >&4
6520 $echo $n "This may take a while...$c" >&4
6524 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
6525 *) $nm $nm_opt $file 2>/dev/null;;
6530 $grep fprintf libc.tmp > libc.ptf
6531 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
6532 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
6534 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
6536 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6538 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
6540 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6542 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
6544 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6546 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
6548 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6550 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
6552 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6554 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
6556 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6558 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
6559 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
6561 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6563 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
6565 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6567 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
6569 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6571 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
6573 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6575 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
6577 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6579 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
6581 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6583 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
6585 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6587 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
6589 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
6592 $nm -p $* 2>/dev/null >libc.tmp
6593 $grep fprintf libc.tmp > libc.ptf
6594 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
6595 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
6601 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
6603 if $ar t $libc > libc.tmp && \
6604 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
6606 for thisname in $libnames $libc; do
6607 $ar t $thisname >>libc.tmp
6609 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
6611 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
6612 for thisname in $libnames $libc; do
6613 $ar tv $thisname >>libc.tmp
6614 emximp -o tmp.imp $thisname \
6616 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
6617 < tmp.imp >>libc.tmp
6620 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
6623 echo "$ar didn't seem to work right." >&4
6624 echo "Maybe this is a Cray...trying bld instead..." >&4
6626 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
6629 for thisname in $libnames; do
6631 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
6632 $ar t $thisname >>libc.tmp
6636 echo "That didn't work either. Giving up." >&4
6646 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
6647 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
6649 *) if $test -f /lib/syscalls.exp; then
6651 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
6652 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
6653 /lib/syscalls.exp >>libc.list
6659 $rm -f libnames libpath
6661 : Check if we are using C++
6663 echo "Checking for C++..." >&4
6664 $cat >try.c <<'EOCP'
6676 if eval $compile_ok && $run ./try; then
6678 echo "You are using a C++ compiler."
6681 echo "You are not using a C++ compiler."
6687 : is a C symbol defined?
6690 -v) tf=libc.tmp; tdc="";;
6691 -a) tf=libc.tmp; tdc="[]";;
6692 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
6694 case "$d_cplusplus" in
6695 $define) extern_C="extern \"C\"" ;;
6696 *) extern_C="extern" ;;
6699 case "$reuseval-$4" in
6701 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
6706 if $test "$runnm" = true; then
6707 if $contains $tlook $tf >/dev/null 2>&1; then
6709 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
6710 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p() && p() != (void *)main) return(0); else return(1); }"> try.c;
6711 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
6712 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
6716 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p() && p() != (void *)main) return(0); else return(1); }"> try.c;
6717 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
6723 $define) tval=true;;
6730 : define an is-in-libc? function
6731 inlibc='echo " "; td=$define; tu=$undef;
6732 sym=$1; var=$2; eval "was=\$$2";
6734 case "$reuseval$was" in
6744 echo "$sym() found." >&4;
6745 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
6747 echo "$sym() NOT found." >&4;
6748 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
6752 $define) echo "$sym() found." >&4;;
6753 *) echo "$sym() NOT found." >&4;;
6757 : check for length of double
6759 case "$doublesize" in
6761 echo "Checking to see how big your double precision numbers are..." >&4
6770 printf("%d\n", (int)sizeof(double));
6775 if eval $compile_ok; then
6776 doublesize=`$run ./try`
6777 echo "Your double is $doublesize bytes long."
6780 echo "(I can't seem to compile the test program. Guessing...)"
6781 rp="What is the size of a double precision number (in bytes)?"
6789 : see if this is a float.h system
6793 : check for long doubles
6795 echo "Checking to see if you have long double..." >&4
6796 echo 'int main() { long double x = 7.0; }' > try.c
6798 if eval $compile; then
6800 echo "You have long double."
6803 echo "You do not have long double."
6809 : see if ldexpl exists
6813 : see if this is a quadmath.h system
6814 set quadmath.h i_quadmath
6817 : check for length of long double
6818 case "${d_longdbl}${longdblsize}" in
6821 echo "Checking to see how big your long doubles are..." >&4
6822 $cat >try.c <<'EOCP'
6826 printf("%d\n", sizeof(long double));
6831 if eval $compile; then
6832 longdblsize=`$run ./try`
6833 echo "Your long doubles are $longdblsize bytes long."
6837 echo "(I can't seem to compile the test program. Guessing...)" >&4
6838 rp="What is the size of a long double (in bytes)?"
6842 if $test "X$doublesize" = "X$longdblsize"; then
6843 echo "That isn't any different from an ordinary double."
6844 echo "I'll keep your setting anyway, but you may see some"
6845 echo "harmless compilation warnings."
6851 $echo "Checking the kind of long doubles you have..." >&4
6852 case "$d_longdbl" in
6857 #define LONGDBLSIZE $longdblsize
6864 #$usequadmath USE_QUADMATH
6865 #$i_quadmath I_QUADMATH
6866 #if defined(USE_QUADMATH) && defined(I_QUADMATH)
6867 #include <quadmath.h>
6868 static const __float128 d = -0.1Q;
6870 static const long double d = -0.1L;
6874 unsigned const char* b = (unsigned const char*)(&d);
6875 #if (LDBL_MANT_DIG == 113 || FLT128_MANT_DIG == 113) && LONGDBLSIZE == 16
6876 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
6877 /* IEEE 754 128-bit little-endian */
6881 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
6882 /* IEEE 128-bit big-endian, e.g. solaris sparc */
6887 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
6888 * while 64-bits platforms have it in 16 bytes. */
6889 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
6890 if (b[0] == 0xCD && b[9] == 0xBF && b[10] == 0x00) {
6891 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
6892 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
6893 * Also known as "extended precision". */
6897 if (b[0] == 0xBF && b[9] == 0xCD && b[10] == 0x00) {
6898 /* is there ever big-endian 80-bit, really? */
6903 #if (LDBL_MANT_DIG == 106 || LDBL_MANT_DIG == 107) && LONGDBLSIZE == 16
6904 /* software "double double", the 106 is 53+53.
6905 * but irix thinks it is 107. */
6906 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
6907 /* double double 128-bit little-endian,
6908 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
6912 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
6913 /* double double 128-bit big-endian, e.g. PPC/Power and MIPS:
6914 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
6919 printf("-1\n"); /* unknown */
6924 if eval $compile; then
6925 longdblkind=`$run ./try`
6932 case "$longdblkind" in
6933 0) echo "Your long doubles are doubles." >&4 ;;
6934 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
6935 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
6936 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
6937 *) echo "Cannot figure out your long double." >&4 ;;
6942 : determine the architecture name
6944 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6945 tarch=`arch`"-$osname"
6946 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6947 if uname -m > tmparch 2>&1 ; then
6948 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6949 -e 's/$/'"-$osname/" tmparch`
6957 case "$myarchname" in
6960 echo "(Your architecture name used to be $myarchname.)"
6964 case "$targetarch" in
6966 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6971 *) dflt="$archname";;
6973 rp='What is your architecture name'
6977 : optionally add API version to the architecture for versioned archlibs
6978 case "$useversionedarchname" in
6979 $define|true|[yY]*) dflt='y';;
6982 rp='Add the Perl API version to your archname?'
6985 y|Y) useversionedarchname="$define" ;;
6986 *) useversionedarchname="$undef" ;;
6988 case "$useversionedarchname" in
6991 *-$api_versionstring)
6992 echo "...and architecture name already has -$api_versionstring" >&4
6995 archname="$archname-$api_versionstring"
6996 echo "...setting architecture name to $archname." >&4
7002 case "$usethreads" in
7004 echo "Threads selected." >&4
7006 *-thread*) echo "...and architecture name already has -thread." >&4
7008 *) archname="$archname-thread"
7009 echo "...setting architecture name to $archname." >&4
7014 case "$usemultiplicity" in
7016 echo "Multiplicity selected." >&4
7018 *-multi*) echo "...and architecture name already has -multi." >&4
7020 *) archname="$archname-multi"
7021 echo "...setting architecture name to $archname." >&4
7026 case "$use64bitint$use64bitall" in
7028 case "$archname64" in
7030 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
7033 case "$use64bitint" in
7034 "$define") echo "64 bit integers selected." >&4 ;;
7036 case "$use64bitall" in
7037 "$define") echo "Maximal 64 bitness selected." >&4 ;;
7040 *-$archname64*) echo "...and architecture name already has $archname64." >&4
7042 *) archname="$archname-$archname64"
7043 echo "...setting architecture name to $archname." >&4
7049 case "$uselongdouble" in
7051 echo "Long doubles selected." >&4
7052 case "$longdblsize" in
7054 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
7058 *-ld*) echo "...and architecture name already has -ld." >&4
7060 *) archname="$archname-ld"
7061 echo "...setting architecture name to $archname." >&4
7068 if $test -f archname.cbu; then
7069 echo "Your platform has some specific hints for architecture name, using them..."
7073 : set the prefixit variable, to compute a suitable default value
7074 prefixit='case "$3" in
7076 case "$oldprefix" in
7077 "") eval "$1=\"\$$2\"";;
7084 ""|" ") eval "$1=\"\$$2\"";;
7090 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
7092 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
7093 /*-$oldprefix/*|\~*-$oldprefix/*)
7094 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
7095 *) eval "$1=\"\$$2\"";;
7099 : determine installation style
7100 : For now, try to deduce it from prefix unless it is already set.
7101 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
7102 case "$installstyle" in
7103 '') case "$prefix" in
7104 *perl*) dflt='lib';;
7105 *) dflt='lib/perl5' ;;
7108 *) dflt="$installstyle" ;;
7110 : Probably not worth prompting for this since we prompt for all
7111 : the directories individually, and the prompt would be too long and
7115 : determine where public executables go
7120 rp='Pathname where the public executables will reside?'
7122 if $test "X$ansexp" != "X$binexp"; then
7126 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7127 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
7128 : this via initialinstalllocation
7131 case "$userelocatableinc" in
7132 $define|true|[yY]*) dflt='y' ;;
7137 Would you like to build Perl so that the installation is relocatable, so that
7138 library paths in @INC are determined relative to the path of the perl binary?
7139 This is not advised for system Perl installs, or if you need to run setid
7140 scripts or scripts under taint mode.
7142 If this doesn't make any sense to you, just accept the default '$dflt'.
7144 rp='Use relocatable @INC?'
7147 y|Y) val="$define" ;;
7150 set userelocatableinc
7153 initialinstalllocation="$binexp"
7154 : Default prefix is now "up one level from where the binaries are"
7155 case "$userelocatableinc" in
7161 installprefixexp=".../.."
7165 : determine where private library files go
7166 : Usual default is /usr/local/lib/perl5/$version.
7167 : Also allow things like /opt/perl/lib/$version, since
7168 : /opt/perl/lib/perl5... would be redundant.
7169 : The default "style" setting is made in installstyle.U
7170 case "$installstyle" in
7171 *lib/perl5*) set dflt privlib lib/$package/$version ;;
7172 *) set dflt privlib lib/$version ;;
7177 There are some auxiliary files for $package that need to be put into a
7178 private library directory that is accessible by everyone.
7183 rp='Pathname where the private library files will reside?'
7188 : set the prefixup variable, to restore leading tilda escape
7189 prefixup='case "$prefixexp" in
7191 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
7194 : determine where public architecture dependent libraries go
7197 : privlib default is /usr/local/lib/$package/$version
7198 : archlib default is /usr/local/lib/$package/$version/$archname
7199 : privlib may have an optional trailing /share.
7200 tdflt=`echo $privlib | $sed 's,/share$,,'`
7201 tdflt=$tdflt/$archname
7210 $spackage contains architecture-dependent library files. If you are
7211 sharing libraries in a heterogeneous environment, you might store
7212 these files in a separate location. Otherwise, you can just include
7213 them with the rest of the public library files.
7218 rp='Where do you want to put the public architecture-dependent libraries?'
7222 if $test X"$archlib" = X"$privlib"; then
7228 : see if setuid scripts can be secure
7231 Some kernels have a bug that prevents setuid #! scripts from being
7232 secure. Some sites have disabled setuid #! scripts because of this.
7234 First let's decide if your kernel supports secure setuid #! scripts.
7235 (If setuid #! scripts would be secure but have been disabled anyway,
7236 don't say that they are secure if asked.)
7241 if $test -d /dev/fd; then
7242 echo "#!$ls" >reflect
7243 chmod +x,u+s reflect
7244 ./reflect >flect 2>&1
7245 if $contains "/dev/fd" flect >/dev/null; then
7246 echo "Congratulations, your kernel has secure setuid scripts!" >&4
7250 If you are not sure if they are secure, I can check but I'll need a
7251 username and password different from the one you are using right now.
7252 If you don't have such a username or don't want me to test, simply
7256 rp='Other username to test security of setuid scripts with?'
7261 case "$d_suidsafe" in
7262 '') echo "I'll assume setuid scripts are *not* secure." >&4
7265 echo "Well, the $hint value is *not* secure." >&4
7267 *) echo "Well, the $hint value *is* secure." >&4
7272 $rm -f reflect flect
7273 echo "#!$ls" >reflect
7274 chmod +x,u+s reflect
7277 echo '"su" will (probably) prompt you for '"$ans's password."
7278 su $ans -c './reflect >flect'
7279 if $contains "/dev/fd" flect >/dev/null; then
7280 echo "Okay, it looks like setuid scripts are secure." >&4
7283 echo "I don't think setuid scripts are secure." >&4
7288 rp='Does your kernel have *secure* setuid scripts?'
7291 [yY]*) val="$define";;
7296 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
7297 echo "(That's for file descriptors, not floppy disks.)"
7303 $rm -f reflect flect
7305 : now see if they want to do setuid emulation
7306 if $test $patchlevel -lt 11; then
7309 case "$d_suidsafe" in
7312 echo "No need to emulate SUID scripts since they are secure here." >&4
7316 Some systems have disabled setuid scripts, especially systems where
7317 setuid scripts cannot be secure. On systems where setuid scripts have
7318 been disabled, the setuid/setgid bits on scripts are currently
7319 useless. It is possible for $package to detect those bits and emulate
7320 setuid/setgid in a secure fashion. This emulation will only work if
7321 setuid scripts have been disabled in your kernel.
7325 "$define") dflt=y ;;
7328 rp="Do you want to do setuid/setgid emulation?"
7331 [yY]*) val="$define";;
7343 SUID emulation has been removed for 5.12
7344 Please re-run Configure without -Dd_dosuid
7353 : Find perl5.005 or later.
7354 echo "Looking for a previously installed perl5.005 or later... "
7356 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7357 : Check if this perl is recent and can load a simple module
7358 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7361 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7371 '') echo "None found. That's ok.";;
7372 *) echo "Using $perl5." ;;
7375 : Set the siteprefix variables
7378 After $package is installed, you may wish to install various
7379 add-on modules and utilities. Typically, these add-ons will
7380 be installed under $prefix with the rest
7381 of this package. However, you may wish to install such add-ons
7382 elsewhere under a different prefix.
7384 If you do not wish to put everything under a single prefix, that's
7385 ok. You will be prompted for the individual locations; this siteprefix
7386 is only used to suggest the defaults.
7388 The default should be fine for most people.
7392 rp='Installation prefix to use for add-on modules and utilities?'
7393 : XXX Here might be another good place for an installstyle setting.
7394 case "$siteprefix" in
7396 *) dflt=$siteprefix ;;
7399 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7401 case "$siteprefix" in
7405 *) oldsiteprefix="$prefix";;
7410 siteprefixexp="$ansexp"
7412 : determine where site specific libraries go.
7413 : Usual default is /usr/local/lib/perl5/site_perl/$version
7414 : The default "style" setting is made in installstyle.U
7415 : XXX No longer works with Prefixit stuff.
7416 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7418 '') case "$installstyle" in
7419 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7420 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7428 The installation process will create a directory for
7429 site-specific extensions and modules. Most users find it convenient
7430 to place all site-specific files in this directory rather than in the
7431 main distribution directory.
7435 rp='Pathname for the site-specific library files?'
7439 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7441 : Determine list of previous versions to include in @INC
7442 $cat > getverlist <<EOPL
7445 \$api_versionstring = "$api_versionstring";
7446 \$version = "$version";
7447 \$stem = "$sitelib_stem";
7448 \$archname = "$archname";
7450 $cat >> getverlist <<'EOPL'
7451 # The list found is store twice for each entry: the original name, and
7452 # the binary broken down version as pack "sss", so sorting is easy and
7453 # unambiguous. This will work for all versions that have a maximum of
7454 # three digit groups, separate by '.'s or '_'s. Names are extended with
7455 # ".0.0" to ensure at least three elements for the pack.
7456 # -- H.Merijn Brand (m)'06 23-10-2006
7458 # Can't have leading @ because metaconfig interprets it as a command!
7459 ;@inc_version_list=();
7460 # XXX Redo to do opendir/readdir?
7463 ;@candidates = map {
7464 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
7465 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
7471 ($pversion, $aversion, $vsn5005) = map {
7472 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
7473 foreach $d (@candidates) {
7474 if ($d->[1] lt $pversion) {
7475 if ($d->[1] ge $aversion) {
7476 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
7478 elsif ($d->[1] ge $vsn5005) {
7479 unshift(@inc_version_list, grep { -d } $d->[0]);
7483 # Skip newer version. I.e. don't look in
7484 # 5.7.0 if we're installing 5.6.1.
7488 if (@inc_version_list) {
7489 print join(' ', @inc_version_list);
7492 # Blank space to preserve value for next Configure run.
7497 case "$inc_version_list" in
7498 '') if test -x "$perl5$exe_ext"; then
7499 dflt=`$perl5 getverlist`
7504 $undef) dflt='none' ;;
7505 *) eval dflt=\"$inc_version_list\" ;;
7508 ''|' ') dflt=none ;;
7515 In order to ease the process of upgrading, this version of perl
7516 can be configured to use modules built and installed with earlier
7517 versions of perl that were installed under $prefix. Specify here
7518 the list of earlier versions that this version of perl should check.
7519 If Configure detected no earlier versions of perl installed under
7520 $prefix, then the list will be empty. Answer 'none' to tell perl
7521 to not search earlier versions.
7523 The default should almost always be sensible, so if you're not sure,
7524 just accept the default.
7527 rp='List of earlier versions to include in @INC?'
7530 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
7531 *) inc_version_list="$ans" ;;
7533 case "$inc_version_list" in
7535 inc_version_list_init='0'
7536 d_inc_version_list="$undef"
7538 *) inc_version_list_init=`echo $inc_version_list |
7539 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7540 d_inc_version_list="$define"
7545 : see if malloc/malloc.h has to be included
7546 set malloc/malloc.h i_mallocmalloc
7549 : see if this is a malloc.h system
7550 : we want a real compile instead of Inhdr because some systems have a
7551 : malloc.h that just gives a compile error saying to use stdlib.h instead
7556 #$i_mallocmalloc I_MALLOCMALLOC
7557 #ifdef I_MALLOCMALLOC
7558 # include <malloc/malloc.h>
7561 int main () { return 0; }
7564 if eval $compile; then
7565 echo "<malloc.h> found." >&4
7568 echo "<malloc.h> NOT found." >&4
7575 : check for length of pointer
7579 echo "Checking to see how big your pointers are..." >&4
7588 printf("%d\n", (int)sizeof(void *));
7593 if eval $compile_ok; then
7594 ptrsize=`$run ./try`
7595 echo "Your pointers are $ptrsize bytes long."
7598 echo "(I can't seem to compile the test program. Guessing...)" >&4
7599 rp="What is the size of a pointer (in bytes)?"
7606 case "$use64bitall" in
7607 "$define"|true|[yY]*)
7611 *** You have chosen a maximally 64-bit build,
7612 *** but your pointers are only 4 bytes wide.
7613 *** Please rerun Configure without -Duse64bitall.
7618 *** Since you have quads, you could possibly try with -Duse64bitint.
7623 *** Cannot continue, aborting.
7634 : determine whether to use malloc wrapping
7636 case "$usemallocwrap" in
7637 [yY]*|true|$define) dflt='y' ;;
7638 [nN]*|false|$undef) dflt='n' ;;
7639 *) case "$usedevel" in
7640 [yY]*|true|$define) dflt='y' ;;
7645 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
7647 usemallocwrap="$ans"
7650 usemallocwrap="$define" ;;
7652 usemallocwrap="$undef" ;;
7655 : determine which malloc to compile in
7657 case "$usemymalloc" in
7658 [yY]*|true|$define) dflt='y' ;;
7659 [nN]*|false|$undef) dflt='n' ;;
7660 *) case "$ptrsize" in
7664 if test "$useithreads" = "$define"; then dflt='n'; fi
7667 rp="Do you wish to attempt to use the malloc that comes with $package?"
7673 mallocsrc='malloc.c'
7674 mallocobj="malloc$_o"
7675 d_mymalloc="$define"
7678 : Remove malloc from list of libraries to use
7679 echo "Removing unneeded -lmalloc from library list" >&4
7680 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7683 echo "libs = $libs" >&4
7695 : compute the return types of malloc and free
7697 $cat >malloc.c <<END
7701 #include <sys/types.h>
7715 case "$malloctype" in
7717 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7724 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7728 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7735 echo "Your system uses $freetype free(), it would seem." >&4
7737 : determine where site specific architecture-dependent libraries go.
7738 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7739 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7740 : sitelib may have an optional trailing /share.
7742 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7743 dflt="$dflt/$archname"
7748 set sitearch sitearch none
7752 The installation process will also create a directory for
7753 architecture-dependent site-specific extensions and modules.
7757 rp='Pathname for the site-specific architecture-dependent library files?'
7761 if $test X"$sitearch" = X"$sitelib"; then
7764 d_sitearch="$define"
7767 : Set the vendorprefix variables
7770 The installation process will also create a directory for
7771 vendor-supplied add-ons. Vendors who supply perl with their system
7772 may find it convenient to place all vendor-supplied files in this
7773 directory rather than in the main distribution directory. This will
7774 ease upgrades between binary-compatible maintenance versions of perl.
7776 Of course you may also use these directories in whatever way you see
7777 fit. For example, you might use them to access modules shared over a
7778 company-wide network.
7780 The default answer should be fine for most people.
7781 This causes further questions about vendor add-ons to be skipped
7782 and no vendor-specific directories will be configured for perl.
7785 rp='Do you want to configure vendor-specific add-on directories?'
7786 case "$usevendorprefix" in
7787 define|true|[yY]*) dflt=y ;;
7788 *) : User may have set vendorprefix directly on Configure command line.
7789 case "$vendorprefix" in
7798 rp='Installation prefix to use for vendor-supplied add-ons?'
7799 case "$vendorprefix" in
7800 '') dflt="$prefix" ;;
7801 *) dflt=$vendorprefix ;;
7804 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7806 case "$vendorprefix" in
7810 *) oldvendorprefix="$prefix";;
7814 usevendorprefix="$define"
7816 vendorprefixexp="$ansexp"
7818 *) usevendorprefix="$undef"
7824 : Set the vendorlib variables
7825 case "$vendorprefix" in
7826 '') d_vendorlib="$undef"
7830 *) d_vendorlib="$define"
7831 : determine where vendor-supplied modules go.
7832 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7833 case "$vendorlib" in
7835 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7836 case "$installstyle" in
7837 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7838 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7841 *) dflt="$vendorlib"
7845 rp='Pathname for the vendor-supplied library files?'
7848 vendorlibexp="$ansexp"
7851 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7855 : Set the vendorarch variables
7856 case "$vendorprefix" in
7857 '') d_vendorarch="$undef"
7861 *) d_vendorarch="$define"
7862 : determine where vendor-supplied architecture-dependent libraries go.
7863 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7864 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7865 : vendorlib may have an optional trailing /share.
7866 case "$vendorarch" in
7867 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7868 dflt="$dflt/$archname"
7870 *) dflt="$vendorarch" ;;
7873 rp='Pathname for vendor-supplied architecture-dependent files?'
7876 vendorarchexp="$ansexp"
7879 prefixvar=vendorarch
7881 if $test X"$vendorarch" = X"$vendorlib"; then
7882 d_vendorarch="$undef"
7884 d_vendorarch="$define"
7887 : Final catch-all directories to search
7890 Lastly, you can have perl look in other directories for extensions and
7891 modules in addition to those already specified.
7892 These directories will be searched after
7896 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7897 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7899 case "$otherlibdirs" in
7900 ''|' ') dflt='none' ;;
7901 *) dflt="$otherlibdirs" ;;
7904 Enter a colon-separated set of extra paths to include in perl's @INC
7905 search path, or enter 'none' for no extra paths.
7909 rp='Colon-separated list of additional directories for perl to search?'
7912 ' '|''|none) otherlibdirs=' ' ;;
7913 *) otherlibdirs="$ans" ;;
7915 case "$otherlibdirs" in
7919 set d_perl_otherlibdirs
7922 : Cruising for prototypes
7924 echo "Checking out function prototypes..." >&4
7925 $cat >prototype.c <<EOCP
7930 int main(int argc, char *argv[]) {
7933 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7934 echo "Your C compiler appears to support function prototypes."
7937 echo "Your C compiler doesn't seem to understand function prototypes."
7944 : Check if ansi2knr is required
7945 case "$prototype" in
7947 *) ansi2knr='ansi2knr'
7952 This version of $package can only be compiled by a compiler that
7953 understands function prototypes. Unfortunately, your C compiler
7955 doesn't seem to understand them. Sorry about that.
7957 If GNU cc is available for your system, perhaps you could try that instead.
7959 Eventually, we hope to support building Perl with pre-ANSI compilers.
7960 If you would like to help in that effort, please contact <perlbug@perl.org>.
7962 Aborting Configure now.
7969 dflt_dtrace='/usr/sbin/dtrace'
7970 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
7974 Perl can be built to support DTrace on platforms that support it.
7975 DTrace is a diagnosis and performance analysis tool from Sun.
7977 If this doesn't make any sense to you, just accept the default '$dflt'.
7981 case "$usedtrace" in
7987 dflt_dtrace=$usedtrace
7994 rp='Support DTrace if available?'
7997 y|Y) val="$define" ;;
8003 test "X$usedtrace" != "X$define" && break
8006 rp='Where is the dtrace executable?'
8015 if $dtrace -h -s ../perldtrace.d \
8016 -o perldtrace.tmp >/dev/null 2>&1 \
8017 && rm -f perldtrace.tmp
8020 echo "Good: your $dtrace knows about the -h flag."
8024 *** $me: Fatal Error: $dtrace doesn't support -h flag
8026 *** Your installed dtrace doesn't support the -h switch to compile a D
8027 *** program into a C header. Can't continue.
8039 *** $me: Fatal Error: $dtrace not found.
8046 echo "*** $dtrace was not found."
8052 : See if we want extra modules installed
8059 Perl can be built with extra modules or bundles of modules which
8060 will be fetched from the CPAN and installed alongside Perl.
8062 Notice that you will need access to the CPAN; either via the Internet,
8063 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
8064 be asked later to configure the CPAN.pm module which will in turn do
8065 the installation of the rest of the extra modules or bundles.)
8067 Notice also that if the modules require any external software such as
8068 libraries and headers (the libz library and the zlib.h header for the
8069 Compress::Zlib module, for example) you MUST have any such software
8070 already installed, this configuration process will NOT install such
8073 If this doesn't make any sense to you, just accept the default '$dflt'.
8075 rp='Install any extra modules (y or n)?'
8081 Please list any extra modules or bundles to be installed from CPAN,
8082 with spaces between the names. The names can be in any format the
8083 'install' command of CPAN.pm will understand. (Answer 'none',
8084 without the quotes, to install no extra modules or bundles.)
8094 $rm -f ../extras.lst
8096 *) echo "(Saving the list of extras for later...)"
8097 echo "$extras" > ../extras.lst
8105 : determine where html pages for programs go
8106 set html1dir html1dir none
8110 If you wish to install html files for programs in $spackage, indicate
8111 the appropriate directory here. To skip installing html files,
8115 ''|none|$undef|' ') dflt=none ;;
8116 *) dflt=$html1dir ;;
8119 rp="Directory for the main $spackage html pages?"
8123 : Use ' ' for none so value is preserved next time through Configure
8124 $test X"$html1dir" = "X" && html1dir=' '
8126 : determine where html pages for libraries and modules go
8127 set html3dir html3dir none
8131 If you wish to install html files for modules associated with $spackage,
8132 indicate the appropriate directory here. To skip installing html files,
8135 : There is no obvious default. If they have specified html1dir, then
8136 : try to key off that, possibly changing .../html1 into .../html3.
8138 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
8139 *) dflt=$html3dir ;;
8142 rp="Directory for the $spackage module html pages?"
8146 : Use ' ' for none so value is preserved next time through Configure
8147 $test X"$html3dir" = "X" && html3dir=' '
8149 : determine whether to install perl also as /usr/bin/perl
8152 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
8154 Many scripts expect perl to be installed as /usr/bin/perl.
8156 If you want to, I can install the perl you are about to compile
8157 as /usr/bin/perl (in addition to $bin/perl).
8159 if test -f /usr/bin/perl; then
8162 However, please note that because you already have a /usr/bin/perl,
8163 overwriting that with a new Perl would very probably cause problems.
8164 Therefore I'm assuming you don't want to do that (unless you insist).
8167 case "$installusrbinperl" in
8168 "$define"|[yY]*) dflt='y';;
8174 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
8177 case "$installusrbinperl" in
8178 "$undef"|[nN]*) dflt='n';;
8182 rp="Do you want to install perl as /usr/bin/perl?"
8185 [yY]*) val="$define";;
8191 set installusrbinperl
8194 : see if dlopen exists
8196 xxx_ccflags="$ccflags"
8198 : with g++ one needs -shared to get is-in-libc to work for dlopen
8199 case "$gccversion" in
8201 *) case "$d_cplusplus" in
8202 "$define") ccflags="$ccflags -shared" ;;
8209 ccflags="$xxx_ccflags"
8211 : see if this is a unistd.h system
8212 set unistd.h i_unistd
8215 : determine which dynamic loading, if any, to compile in
8217 dldir="ext/DynaLoader"
8230 $define) dflt='y' ;;
8232 : Does a dl_xxx.xs file exist for this operating system
8233 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8236 rp="Do you wish to use dynamic loading?"
8243 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8244 dflt="$dldir/dl_${osname}.xs"
8245 elif $test "$d_dlopen" = "$define" ; then
8246 dflt="$dldir/dl_dlopen.xs"
8251 *) dflt="$dldir/$dlsrc"
8254 echo "The following dynamic loading files are available:"
8255 : Can not go over to $dldir because getfile has path hard-coded in.
8256 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8257 rp="Source file to use for dynamic loading"
8263 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8267 Some systems may require passing special flags to $cc -c to
8268 compile modules that will be used to create a shared library.
8269 To use no flags, say "none".
8272 case "$cccdlflags" in
8273 '') case "$gccversion" in
8274 '') case "$osname" in
8276 irix*) dflt='-KPIC' ;;
8277 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8278 sunos) dflt='-pic' ;;
8282 *) case "$osname" in
8283 darwin) dflt='none' ;;
8284 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8289 *) dflt="$cccdlflags" ;;
8296 # If -Dsysroot was specified, now's the time to add it
8298 if test "X$sysroot" != X; then
8299 case "$gccversion" in
8304 dflt="$dflt --sysroot=$sysroot" ;;
8314 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8317 none) cccdlflags=' ' ;;
8318 *) cccdlflags="$ans" ;;
8323 Some systems use ld to create libraries that can be dynamically loaded,
8324 while other systems (such as those using ELF) use $cc.
8328 : Determine if this is ELF
8330 /* Test for whether ELF binaries are produced */
8342 int i = open("a.out",O_RDONLY);
8345 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8346 exit(0); /* succeed (yes, it is ELF) */
8350 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8356 '') if $test $bin_ELF = "$define"; then
8358 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8362 echo "I'll use ld to build dynamic libraries."
8370 rp="What command should be used to create dynamic libraries?"
8376 Some systems may require passing special flags to $ld to create a
8377 library that can be dynamically loaded. If your ld flags include
8378 -L/other/path options to locate libraries outside your loader's normal
8379 search path, you may need to specify those -L options here as well. To
8380 use no flags, say "none".
8383 case "$lddlflags" in
8384 '') case "$osname" in
8385 haiku) dflt='-shared' ;;
8387 case "$gccversion" in
8388 '') dflt="$dflt +vnocompatwarnings" ;;
8391 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8392 solaris) # See [perl #66604].
8393 # On Solaris 11, gcc -m64 on amd64
8394 # appears not to understand -G. gcc versions at
8395 # least as old as 3.4.3 support -shared, so just
8396 # use that with Solaris 11 and later, but keep
8397 # the old behavior for older Solaris versions.
8398 case "$gccversion" in
8400 *) case "$osvers" in
8401 2.?|2.10) dflt='-G' ;;
8402 *) dflt='-shared' ;;
8407 sunos) dflt='-assert nodefinitions' ;;
8408 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8412 *) dflt="$lddlflags" ;;
8415 : Only do this for gcc, since, for example, qcc has no concept
8417 if $test "X$sysroot" != X; then
8418 case "$gccversion" in
8420 *) dflt="$dflt --sysroot $sysroot" ;;
8424 : Try to guess additional flags to pick up local libraries.
8425 : Be careful not to append to a plain 'none'
8429 for thisflag in $ldflags; do
8434 *) dflt="$dflt $thisflag" ;;
8441 ''|' ') dflt='none' ;;
8445 *-fstack-protector-strong*)
8447 *-fstack-protector-strong*) ;; # Don't add it again
8448 *) dflt="$dflt -fstack-protector-strong" ;;
8451 *-fstack-protector*)
8453 *-fstack-protector*) ;; # Don't add it again
8454 *) dflt="$dflt -fstack-protector" ;;
8459 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8462 none) lddlflags=' ' ;;
8463 *) lddlflags="$ans" ;;
8468 Some systems may require passing special flags to $cc to indicate that
8469 the resulting executable will use dynamic linking. To use no flags,
8473 case "$ccdlflags" in
8474 '') case "$osname" in
8475 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8476 sunos) dflt='none' ;;
8480 *) dflt="$ccdlflags" ;;
8482 rp="Any special flags to pass to $cc to use dynamic linking?"
8485 none) ccdlflags=' ' ;;
8486 *) ccdlflags="$ans" ;;
8498 ld_can_script="$undef"
8499 case "$bin_ELF$usedl" in
8501 # Abuse try.h and a.out names for neat cleanup
8513 if $cc $cccdlflags $ccdlflags $ccflags \
8514 $ldflags $lddlflags -o a.out try.c \
8515 -Wl,--version-script=try.h >/dev/null 2>&1 \
8516 && $test -s a.out ; then
8517 echo "ld supports scripting" >&4
8518 ld_can_script="$define"
8520 echo "ld does not support scripting" >&4
8526 : Do we want a shared libperl?
8530 # No dynamic loading being used, so don't bother even to prompt.
8533 *) case "$useshrplib" in
8534 '') case "$osname" in
8535 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8537 also='Building a shared libperl is required for dynamic loading to work on your system.'
8551 The perl executable is normally obtained by linking perlmain.c with
8552 libperl${_a}, any static extensions (usually just DynaLoader), and
8553 any other libraries needed on this system (such as -lm, etc.). Since
8554 your system supports dynamic loading, it is probably possible to build
8555 a shared libperl.$so. If you will have more than one executable linked
8556 to libperl.$so, this will significantly reduce the size of each
8557 executable, but it may have a noticeable effect on performance. The
8558 default is probably sensible for your system.
8562 rp="Build a shared libperl.$so (y/n)"
8566 useshrplib='true' ;;
8567 *) useshrplib='false' ;;
8572 case "$useshrplib" in
8574 case "$userelocatableinc" in
8576 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8577 echo "See INSTALL for an explanation why that won't work." >&4
8583 # Figure out a good name for libperl.so. Since it gets stored in
8584 # a version-specific architecture-dependent library, the version
8585 # number isn't really that important, except for making cc/ld happy.
8587 # A name such as libperl.so.10.1
8588 majmin="libperl.$so.$patchlevel.$subversion"
8589 # A name such as libperl.so.100
8590 majonly=`echo $patchlevel $subversion |
8591 $awk '{printf "%d%02d", $1, $2}'`
8592 majonly=libperl.$so.$majonly
8593 # I'd prefer to keep the os-specific stuff here to a minimum, and
8594 # rely on figuring it out from the naming of libc.
8595 case "${osname}${osvers}" in
8596 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8599 cygwin*) # ld links now against the dll directly
8600 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8601 majonly=`echo $patchlevel $subversion |
8602 $awk '{printf "%03d%03d", $1, $2}'`
8603 majonly=cygperl5.$majonly.$so
8606 *) # Try to guess based on whether libc has major.minor.
8608 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8609 *libc.$so.[0-9]*) dflt=$majonly ;;
8610 *) dflt=libperl.$so ;;
8620 I need to select a good name for the shared libperl. If your system uses
8621 library names with major and minor numbers, then you might want something
8622 like $majmin. Alternatively, if your system uses a single version
8623 number for shared libraries, then you might want to use $majonly.
8624 Or, your system might be quite happy with a simple libperl.$so.
8626 Since the shared libperl will get installed into a version-specific
8627 architecture-dependent directory, the version number of the shared perl
8628 library probably isn't important, so the default should be o.k.
8631 rp='What name do you want to give to the shared libperl?'
8634 echo "Ok, I'll use $libperl"
8637 libperl="libperl${_a}"
8641 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8645 WARNING: Use of the shrpdir variable for the installation location of
8646 the shared $libperl is not supported. It was never documented and
8647 will not work in this version. Let me (perlbug@perl.org)
8648 know of any problems this may cause.
8654 But your current setting of $shrpdir is
8655 the default anyway, so it's harmless.
8660 Further, your current attempted setting of $shrpdir
8661 conflicts with the value of $archlibexp/CORE
8662 that installperl will use.
8669 # How will the perl executable find the installed shared $libperl?
8670 # Add $xxx to ccdlflags.
8671 # If we can't figure out a command-line option, use $shrpenv to
8672 # set env LD_RUN_PATH. The main perl makefile uses this.
8673 shrpdir=$archlibexp/CORE
8676 if "$useshrplib"; then
8679 # We'll set it in Makefile.SH...
8684 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8685 xxx="-Wl,-R$shrpdir"
8687 bsdos|linux|irix*|dec_osf|gnu*)
8688 xxx="-Wl,-rpath,$shrpdir"
8691 # Haiku doesn't like the default, either.
8694 # hpux doesn't like the default, either.
8695 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8698 # cygwin needs only ldlibpth
8701 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8707 # Only add $xxx if it isn't already in ccdlflags.
8708 case " $ccdlflags " in
8710 *) ccdlflags="$ccdlflags $xxx"
8713 Adding $xxx to the flags
8714 passed to $ld so that the perl executable will find the
8715 installed shared $libperl.
8723 # Fix ccdlflags in AIX for building external extensions.
8724 # (For building Perl itself bare -bE:perl.exp is needed,
8725 # Makefile.SH takes care of this.)
8727 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8729 # Respect a hint or command-line value.
8731 '') shrpenv="$tmp_shrpenv" ;;
8733 case "$ldlibpthname" in
8734 '') ldlibpthname=LD_LIBRARY_PATH ;;
8735 none) ldlibpthname='' ;;
8738 : determine where manual pages are on this system
8742 syspath='/usr/share/man/man1 /usr/man/man1'
8743 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8744 syspath="$syspath /usr/man/u_man/man1"
8745 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8746 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8747 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8748 sysman=`./loc . /usr/man/man1 $syspath`
8751 if $test -d "$sysman"; then
8752 echo "System manual is in $sysman." >&4
8754 echo "Could not find manual pages in source form." >&4
8757 : determine where manual pages go
8758 set man1dir man1dir none
8762 $spackage has manual pages available in source form.
8766 echo "However, you don't have nroff, so they're probably useless to you."
8768 '') man1dir="none";;
8771 echo "If you don't want the manual sources installed, answer 'none'."
8776 lookpath="$prefixexp/share/man/man1"
8777 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8778 lookpath="$lookpath $prefixexp/man/p_man/man1"
8779 lookpath="$lookpath $prefixexp/man/u_man/man1"
8780 lookpath="$lookpath $prefixexp/man/man.1"
8782 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8783 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8793 rp="Where do the main $spackage manual pages (source) go?"
8795 if $test "X$man1direxp" != "X$ansexp"; then
8806 : What suffix to use on installed man pages
8813 rp="What suffix should be used for the main $spackage man pages?"
8815 '') case "$man1dir" in
8829 *) dflt="$man1ext";;
8836 : see if we can have long filenames
8838 first=123456789abcdef
8840 if (echo hi >$first) 2>/dev/null; then
8841 if $test -f 123456789abcde; then
8842 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8845 echo 'You can have filenames longer than 14 characters.'>&4
8850 You can't have filenames longer than 14 chars.
8851 You can't even think about them!
8857 $rm -rf 123456789abcde*
8859 : determine where library module manual pages go
8860 set man3dir man3dir none
8864 $spackage has manual pages for many of the library modules.
8870 However, you don't have nroff, so they're probably useless to you.
8873 '') man3dir="none";;
8877 case "$d_flexfnam" in
8880 However, your system can't handle the long file names like File::Basename.3.
8883 '') man3dir="none";;
8887 echo "If you don't want the manual sources installed, answer 'none'."
8888 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8890 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8891 if $test -d "$privlib/man/man3"; then
8894 WARNING: Previous versions of perl installed man3 pages into
8895 $privlib/man/man3. This version will suggest a
8896 new default of $dflt.
8900 rp='Do you wish to preserve the old behavior?(y/n)'
8903 y*) dflt="$privlib/man/man3" ;;
8908 *) dflt="$man3dir" ;;
8915 rp="Where do the $package library man pages (source) go?"
8925 : What suffix to use on installed man pages
8931 rp="What suffix should be used for the $package library man pages?"
8933 '') case "$man3dir" in
8947 *) dflt="$man3ext";;
8954 : see if we have to deal with yellow pages, now NIS.
8955 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8961 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8969 rp='Are you getting the hosts file via yellow pages?'
8972 y*) hostcat='ypcat hosts';;
8973 *) hostcat='cat /etc/hosts';;
8979 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8982 '') test -f /etc/group && groupcat='cat /etc/group';;
8985 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8988 : now get the host name
8990 echo "Figuring out host name..." >&4
8991 case "$myhostname" in
8993 echo 'Maybe "hostname" will work...'
8994 if tans=`sh -c hostname 2>&1` ; then
9002 if $test "$cont"; then
9004 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
9005 if tans=`cat /etc/systemid 2>&1` ; then
9007 phostname='cat /etc/systemid'
9008 echo "Whadyaknow. Xenix always was a bit strange..."
9011 elif $test -r /etc/systemid; then
9012 echo "(What is a non-Xenix system doing with /etc/systemid?)"
9015 if $test "$cont"; then
9016 echo 'No, maybe "uuname -l" will work...'
9017 if tans=`sh -c 'uuname -l' 2>&1` ; then
9019 phostname='uuname -l'
9021 echo 'Strange. Maybe "uname -n" will work...'
9022 if tans=`sh -c 'uname -n' 2>&1` ; then
9024 phostname='uname -n'
9026 echo 'Oh well, maybe I can mine it out of whoami.h...'
9027 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
9028 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
9029 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
9031 case "$myhostname" in
9032 '') echo "Does this machine have an identity crisis or something?"
9035 echo "Well, you said $myhostname before..."
9036 phostname='echo $myhostname';;
9042 case "$myhostname" in
9043 '') myhostname=noname ;;
9045 : you do not want to know about this
9050 if $test "$myhostname" ; then
9052 rp='Your host name appears to be "'$myhostname'".'" Right?"
9060 : bad guess or no guess
9061 while $test "X$myhostname" = X ; do
9063 rp="Please type the (one word) name of your host:"
9068 : translate upper to lower if necessary
9069 case "$myhostname" in
9071 echo "(Normalizing case in your host name)"
9072 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
9076 case "$myhostname" in
9078 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
9079 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
9080 echo "(Trimming domain name from host name--host name is now $myhostname)"
9082 *) case "$mydomain" in
9085 test "X$hostcat" = "Xypcat hosts" &&
9086 ypmatch "$myhostname" hosts 2>/dev/null |\
9087 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
9090 test "X$hostcat" != "X" &&
9091 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
9092 /[ ]$myhostname[ . ]/p" > hosts
9095 if $test -f hosts; then
9096 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
9097 END { print sum }" hosts` = x1 || tmp_re="[ ]"
9098 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
9099 hosts | $sort | $uniq | \
9100 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
9101 case `$echo X$dflt` in
9102 X*\ *) echo "(Several hosts in the database matched hostname)"
9105 X.) echo "(You do not have fully-qualified names in the hosts database)"
9109 echo "(I cannot locate a hosts database anywhere)"
9114 tans=`./loc resolv.conf X /etc /usr/etc`
9115 if $test -f "$tans"; then
9116 echo "(Attempting domain name extraction from $tans)"
9117 dflt=.`$sed -n -e 's/ / /g' \
9118 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
9121 .) dflt=.`$sed -n -e 's/ / /g' \
9122 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
9130 .) echo "(No help from resolv.conf either -- attempting clever guess)"
9131 dflt=.`sh -c domainname 2>/dev/null`
9134 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
9138 case "$dflt$osname" in
9139 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
9140 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
9144 .) echo "(Lost all hope -- silly guess then)"
9150 *) dflt="$mydomain";;
9154 rp="What is your domain name?"
9164 : translate upper to lower if necessary
9167 echo "(Normalizing case in your domain name)"
9168 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9172 : a little sanity check here
9173 case "$phostname" in
9176 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9177 $myhostname$mydomain|$myhostname) ;;
9179 case "$phostname" in
9181 echo "(That doesn't agree with your whoami.h file, by the way.)"
9184 echo "(That doesn't agree with your $phostname command, by the way.)"
9192 : determine the e-mail address of the user who is running us
9195 I need to get your e-mail address in Internet format if possible, i.e.
9196 something like user@host.domain. Please answer accurately since I have
9197 no easy means to double check it. The default value provided below
9198 is most probably close to reality but may not be valid from outside
9199 your organization...
9203 while test "$cont"; do
9204 case "$MAILDOMAIN" in
9206 if $test -s /etc/mailname; then
9207 maildomain=`$cat /etc/mailname`
9209 maildomain="$myhostname$mydomain"
9212 *) maildomain="$MAILDOMAIN";;
9215 '') dflt="$cf_by@$maildomain";;
9216 *) dflt="$cf_email";;
9218 rp='What is your e-mail address?'
9224 rp='Address does not look like an Internet one. Use it anyway?'
9238 : Ask e-mail of administrator
9241 If you or somebody else will be maintaining perl at your site, please
9242 fill in the correct e-mail address here so that they may be contacted
9243 if necessary. Currently, the "perlbug" program included with perl
9244 will send mail to this address in addition to perlbug@perl.org. You may
9245 enter "none" for no administrator.
9248 case "$perladmin" in
9249 '') dflt="$cf_email";;
9250 *) dflt="$perladmin";;
9252 rp='Perl administrator e-mail address'
9256 : determine whether to only install version-specific parts.
9259 Do you want to install only the version-specific parts of the perl
9260 distribution? Usually you do *not* want to do this.
9262 case "$versiononly" in
9263 "$define"|[Yy]*|true) dflt='y' ;;
9266 rp="Do you want to install only the version-specific parts of perl?"
9269 [yY]*) val="$define";;
9275 case "$versiononly" in
9276 "$define") inc_version_list=''
9277 inc_version_list_init=0
9281 : figure out how to guarantee perl startup
9282 : XXX Note that this currently takes advantage of the bug that binexp ignores
9283 : the Configure -Dinstallprefix setting, which in turn means that under
9284 : relocatable @INC, initialinstalllocation is what binexp started as.
9285 case "$startperl" in
9287 case "$sharpbang" in
9291 I can use the #! construct to start perl on your system. This will
9292 make startup of perl scripts faster, but may cause problems if you
9293 want to share those scripts and perl is not in a standard place
9294 ($initialinstalllocation/perl) on all your platforms. The alternative
9295 is to force a shell by starting the script with a single ':' character.
9298 case "$versiononly" in
9299 "$define") dflt="$initialinstalllocation/perl$version";;
9300 *) dflt="$initialinstalllocation/perl";;
9302 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9305 none) startperl=": # use perl";;
9306 *) startperl="#!$ans"
9307 if $test 30 -lt `echo "$ans" | wc -c`; then
9310 WARNING: Some systems limit the #! command to 32 characters.
9311 If you experience difficulty running Perl scripts with #!, try
9312 installing Perl in a directory with a shorter pathname.
9318 *) startperl=": # use perl"
9323 echo "I'll use $startperl to start perl scripts."
9325 : figure best path for perl in scripts
9328 case "$versiononly" in
9329 "$define") perlpath="$initialinstalllocation/perl$version";;
9330 *) perlpath="$initialinstalllocation/perl";;
9332 case "$startperl" in
9337 I will use the "eval 'exec'" idiom to start Perl on your system.
9338 I can use the full path of your Perl binary for this purpose, but
9339 doing so may cause problems if you want to share those scripts and
9340 Perl is not always in a standard place ($initialinstalllocation/perl).
9343 dflt="$initialinstalllocation/perl"
9344 rp="What path shall I use in \"eval 'exec'\"?"
9351 case "$startperl" in
9353 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9356 : determine where public executable scripts go
9357 set scriptdir scriptdir
9359 case "$scriptdir" in
9362 : guess some guesses
9363 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9364 $test -d /usr/share/bin && dflt=/usr/share/bin
9365 $test -d /usr/local/script && dflt=/usr/local/script
9366 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9367 $test -d $prefixexp/script && dflt=$prefixexp/script
9371 *) dflt="$scriptdir"
9376 Some installations have a separate directory just for executable scripts so
9377 that they can mount it across multiple architectures but keep the scripts in
9378 one spot. You might, for example, have a subdirectory of /usr/share for this.
9379 Or you might just lump your scripts in with all your other executables.
9383 rp='Where do you keep publicly executable scripts?'
9385 if $test "X$ansexp" != "X$scriptdirexp"; then
9391 : A little fix up for an irregularly named variable.
9392 installscript="$installscriptdir"
9394 : determine where add-on public executables go
9396 '') dflt=$siteprefix/bin ;;
9400 rp='Pathname where the add-on public executables should be installed?'
9405 : determine where add-on html pages go
9406 : There is no standard location, so try to copy the previously-selected
9407 : directory structure for the core html pages.
9408 case "$sitehtml1dir" in
9409 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9410 *) dflt=$sitehtml1dir ;;
9413 ''|' ') dflt=none ;;
9416 rp='Pathname where the site-specific html pages should be installed?'
9418 prefixvar=sitehtml1dir
9421 : determine where add-on library html pages go
9422 : There is no standard location, so try to copy the previously-selected
9423 : directory structure for the core html pages.
9424 case "$sitehtml3dir" in
9425 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9426 *) dflt=$sitehtml3dir ;;
9429 ''|' ') dflt=none ;;
9432 rp='Pathname where the site-specific library html pages should be installed?'
9434 prefixvar=sitehtml3dir
9437 : determine where add-on manual pages go
9438 case "$siteman1dir" in
9439 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9440 *) dflt=$siteman1dir ;;
9443 ''|' ') dflt=none ;;
9446 rp='Pathname where the site-specific manual pages should be installed?'
9448 prefixvar=siteman1dir
9451 : determine where add-on library man pages go
9452 case "$siteman3dir" in
9453 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9454 *) dflt=$siteman3dir ;;
9457 ''|' ') dflt=none ;;
9460 rp='Pathname where the site-specific library manual pages should be installed?'
9462 prefixvar=siteman3dir
9465 : determine where add-on public executable scripts go
9466 case "$sitescript" in
9467 '') dflt=$siteprefix/script
9468 $test -d $dflt || dflt=$sitebin ;;
9469 *) dflt="$sitescript" ;;
9472 rp='Pathname where add-on public executable scripts should be installed?'
9474 prefixvar=sitescript
9477 : see if backtrace exists
9478 set backtrace d_backtrace
9481 : add flags if using c backtrace
9482 case "$usecbacktrace" in
9483 "") usecbacktrace=$undef ;;
9485 case "$d_backtrace" in
9487 case " $ccflags " in
9488 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9489 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9493 echo "This system does not support backtrace" >&4
9494 usecbacktrace=$undef
9500 : Check if faststdio is requested and available
9501 case "$usefaststdio" in
9502 $define|true|[yY]*|'')
9503 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9513 Perl can be built to use 'fast stdio', which means using the stdio
9514 library but also directly manipulating the stdio buffers to enable
9515 faster I/O. Using stdio is better for backward compatibility (especially
9516 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9517 interface has been preferred instead of stdio.
9519 If this doesn't make any sense to you, just accept the default '$dflt'.
9521 rp='Use the "fast stdio" if available?'
9524 y|Y) val="$define" ;;
9531 : define an is-a-typedef? function
9532 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9534 "") inclist="sys/types.h";;
9536 eval "varval=\$$var";
9540 for inc in $inclist; do
9541 echo "#include <$inc>" >>temp.c;
9543 echo "#ifdef $type" >> temp.c;
9544 echo "printf(\"We have $type\");" >> temp.c;
9545 echo "#endif" >> temp.c;
9546 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9547 if $contains $type temp.E >/dev/null 2>&1; then
9553 *) eval "$var=\$varval";;
9556 : define an is-a-typedef? function that prompts if the type is not available.
9557 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9559 "") inclist="sys/types.h";;
9561 eval "varval=\$$var";
9565 for inc in $inclist; do
9566 echo "#include <$inc>" >>temp.c;
9568 echo "#ifdef $type" >> temp.c;
9569 echo "printf(\"We have $type\");" >> temp.c;
9570 echo "#endif" >> temp.c;
9571 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9573 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9574 if $contains $type temp.E >/dev/null 2>&1; then
9575 echo "$type found." >&4;
9578 echo "$type NOT found." >&4;
9584 *) eval "$var=\$varval";;
9587 : see what type lseek is declared as in the kernel
9588 rp="What is the type used for lseek's offset on this system?"
9589 set off_t lseektype long stdio.h sys/types.h
9593 echo "Checking to see how big your file offsets are..." >&4
9595 #include <sys/types.h>
9599 printf("%d\n", (int)sizeof($lseektype));
9604 if eval $compile_ok; then
9605 lseeksize=`$run ./try`
9606 echo "Your file offsets are $lseeksize bytes long."
9610 echo "(I can't seem to compile the test program. Guessing...)"
9611 rp="What is the size of your file offsets (in bytes)?"
9617 : see what type file positions are declared as in the library
9618 rp="What is the type for file position used by fsetpos()?"
9619 set fpos_t fpostype long stdio.h sys/types.h
9622 : Check size for Fpos_t
9625 *_t) zzz="$fpostype" ;;
9628 echo "Checking the size of $zzz..." >&4
9630 #include <sys/types.h>
9637 printf("%d\n", (int)sizeof($fpostype));
9642 if eval $compile_ok; then
9646 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9649 echo "Your $zzz is $fpossize bytes long."
9655 echo "(I can't compile the test program. Guessing...)" >&4
9656 rp="What is the size of your file positions (in bytes)?"
9661 : Check for large file support
9662 # Backward compatibility (uselfs is deprecated).
9664 "$define"|true|[yY]*)
9667 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9669 uselargefiles="$define"
9673 case "$lseeksize:$fpossize" in
9676 You can have files larger than 2 gigabytes.
9679 *) case "$uselargefiles" in
9680 "$undef"|false|[nN]*) dflt='n' ;;
9685 Perl can be built to understand large files (files larger than 2 gigabytes)
9686 on some systems. To do so, Configure can be run with -Duselargefiles.
9688 If this doesn't make any sense to you, just accept the default '$dflt'.
9690 rp='Try to understand large files, if available?'
9693 y|Y) val="$define" ;;
9700 : Look for a hint-file generated 'call-back-unit'. If the
9701 : user has specified that a large files perl is to be built,
9702 : we may need to set or change some other defaults.
9703 if $test -f uselargefiles.cbu; then
9704 echo "Your platform has some specific hints regarding large file builds, using them..."
9705 . ./uselargefiles.cbu
9707 case "$uselargefiles" in
9709 if $test -f uselargefiles.cbu; then
9711 echo "Rechecking to see how big your file offsets are..." >&4
9713 #include <sys/types.h>
9717 printf("%d\n", (int)sizeof($lseektype));
9722 if eval $compile_ok; then
9723 lseeksize=`$run ./try`
9724 $echo "Your file offsets are now $lseeksize bytes long."
9728 echo "(I can't seem to compile the test program. Guessing...)"
9729 rp="What is the size of your file offsets (in bytes)?"
9734 *_t) zzz="$fpostype" ;;
9737 $echo $n "Rechecking the size of $zzz...$c" >&4
9739 #include <sys/types.h>
9746 printf("%d\n", (int)sizeof($fpostype));
9751 if eval $compile_ok; then
9756 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9759 echo " $fpossize bytes." >&4
9765 echo "(I can't compile the test program. Guessing...)" >&4
9766 rp="What is the size of your file positions (in bytes)?"
9775 : Check if we want perlio
9778 : Set the vendorbin variables
9779 case "$vendorprefix" in
9780 '') d_vendorbin="$undef"
9784 *) d_vendorbin="$define"
9785 : determine where vendor-supplied executables go.
9786 case "$vendorbin" in
9787 '') dflt=$vendorprefix/bin ;;
9788 *) dflt="$vendorbin" ;;
9791 rp='Pathname for the vendor-supplied executables directory?'
9794 vendorbinexp="$ansexp"
9800 : Set the vendorhtml1dir variables
9801 case "$vendorprefix" in
9802 '') vendorhtml1dir=''
9803 vendorhtml1direxp=''
9805 *) : determine where vendor-supplied html pages go.
9806 : There is no standard location, so try to copy the previously-selected
9807 : directory structure for the core html pages.
9808 : XXX Better default suggestions would be welcome.
9809 case "$vendorhtml1dir" in
9810 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9811 *) dflt=$vendorhtml1dir ;;
9814 ''|' ') dflt=none ;;
9817 rp='Pathname for the vendor-supplied html pages?'
9819 vendorhtml1dir="$ans"
9820 vendorhtml1direxp="$ansexp"
9823 : Use ' ' for none so value is preserved next time through Configure
9824 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9825 prefixvar=vendorhtml1dir
9828 : Set the vendorhtml3dir variables
9829 case "$vendorprefix" in
9830 '') vendorhtml3dir=''
9831 vendorhtml3direxp=''
9833 *) : determine where vendor-supplied module html pages go.
9834 : There is no standard location, so try to copy the previously-selected
9835 : directory structure for the core html pages.
9836 : XXX Better default suggestions would be welcome.
9837 case "$vendorhtml3dir" in
9838 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9839 *) dflt=$vendorhtml3dir ;;
9842 ''|' ') dflt=none ;;
9845 rp='Pathname for the vendor-supplied html pages?'
9847 vendorhtml3dir="$ans"
9848 vendorhtml3direxp="$ansexp"
9851 : Use ' ' for none so value is preserved next time through Configure
9852 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9853 prefixvar=vendorhtml3dir
9856 : Set the vendorman1dir variables
9857 case "$vendorprefix" in
9858 '') vendorman1dir=''
9861 *) : determine where vendor-supplied manual pages go.
9862 case "$vendorman1dir" in
9863 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9864 *) dflt=$vendorman1dir ;;
9867 ''|' ') dflt=none ;;
9870 rp='Pathname for the vendor-supplied manual section 1 pages?'
9872 vendorman1dir="$ans"
9873 vendorman1direxp="$ansexp"
9876 : Use ' ' for none so value is preserved next time through Configure
9877 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9878 prefixvar=vendorman1dir
9881 : Set the vendorman3dir variables
9882 case "$vendorprefix" in
9883 '') vendorman3dir=''
9886 *) : determine where vendor-supplied module manual pages go.
9887 case "$vendorman3dir" in
9888 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9889 *) dflt=$vendorman3dir ;;
9892 ''|' ') dflt=none ;;
9895 rp='Pathname for the vendor-supplied manual section 3 pages?'
9897 vendorman3dir="$ans"
9898 vendorman3direxp="$ansexp"
9901 : Use ' ' for none so value is preserved next time through Configure
9902 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9903 prefixvar=vendorman3dir
9906 : Set the vendorscript variables
9907 case "$vendorprefix" in
9908 '') d_vendorscript="$undef"
9912 *) d_vendorscript="$define"
9913 : determine where vendor-supplied scripts go.
9914 case "$vendorscript" in
9915 '') dflt=$vendorprefix/script
9916 $test -d $dflt || dflt=$vendorbin ;;
9917 *) dflt="$vendorscript" ;;
9921 The installation process will create a directory for
9922 vendor-supplied scripts.
9926 rp='Pathname for the vendor-supplied scripts directory?'
9929 vendorscriptexp="$ansexp"
9932 prefixvar=vendorscript
9935 : script used to emit important warnings
9938 if test \$# -gt 0; then
9943 echo "*** WARNING:" >&4
9944 sed -e 's/^/*** /' <msg >&4
9946 cat msg >>config.msg
9947 echo " " >>config.msg
9953 : see which of string.h or strings.h is needed
9955 strings=`./findhdr string.h`
9956 if $test "$strings" && $test -r "$strings"; then
9957 echo "Using <string.h> instead of <strings.h>." >&4
9961 strings=`./findhdr strings.h`
9962 if $test "$strings" && $test -r "$strings"; then
9963 echo "Using <strings.h> instead of <string.h>." >&4
9965 ./warn "No string header found -- You'll surely have problems."
9971 "$undef") strings=`./findhdr strings.h`;;
9972 *) strings=`./findhdr string.h`;;
9975 : see if qgcvt exists
9979 : Check print/scan long double stuff
9982 if $test X"$d_longdbl" = X"$define"; then
9984 echo "Checking how to print long doubles..." >&4
9986 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9987 $cat >try.c <<'EOCP'
9988 #include <sys/types.h>
9992 printf("%.3f\n", d);
9996 if eval $compile; then
10000 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
10001 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
10002 echo "We will use %f."
10008 if $test X"$sPRIfldbl" = X; then
10009 $cat >try.c <<'EOCP'
10010 #include <sys/types.h>
10013 long double d = 123.456;
10014 printf("%.3Lf\n", d);
10018 if eval $compile; then
10022 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
10023 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
10024 echo "We will use %Lf."
10030 if $test X"$sPRIfldbl" = X; then
10031 $cat >try.c <<'EOCP'
10032 #include <sys/types.h>
10035 long double d = 123.456;
10036 printf("%.3llf\n", d);
10040 if eval $compile; then
10044 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
10045 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
10046 echo "We will use %llf."
10052 if $test X"$sPRIfldbl" = X; then
10053 $cat >try.c <<'EOCP'
10054 #include <sys/types.h>
10057 long double d = 123.456;
10058 printf("%.3lf\n", d);
10062 if eval $compile; then
10066 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
10067 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
10068 echo "We will use %lf."
10074 if $test X"$sPRIfldbl" = X; then
10075 echo "Cannot figure out how to print long doubles." >&4
10077 sSCNfldbl=$sPRIfldbl # expect consistency
10084 case "$sPRIfldbl" in
10085 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
10086 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
10087 d_SCNfldbl="$undef";
10089 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
10090 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
10091 d_SCNfldbl="$define";
10095 : Check how to convert floats to strings.
10097 if test "X$d_Gconvert" = X; then
10100 echo "Checking for an efficient way to convert floats to strings."
10102 case "$uselongdouble" in
10103 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
10105 case "$d_longdbl" in
10106 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
10108 case "$d_PRIgldbl" in
10109 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
10112 #ifdef TRY_gconvert
10113 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
10114 char *myname = "gconvert";
10117 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
10118 char *myname = "gcvt";
10121 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
10122 char *myname = "qgcvt";
10123 #define DOUBLETYPE long double
10126 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10127 #ifdef HAS_PRIgldbl
10128 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
10130 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
10133 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
10135 char *myname = "sprintf";
10139 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
10140 #define DOUBLETYPE long double
10142 #define DOUBLETYPE double
10148 #$i_stdlib I_STDLIB
10150 #include <stdlib.h>
10152 #$i_string I_STRING
10154 # include <string.h>
10156 # include <strings.h>
10159 int checkit(char *expect, char *got)
10161 if (strcmp(expect, got)) {
10162 printf("%s oddity: Expected %s, got %s\n",
10163 myname, expect, got);
10173 /* This must be 1st test on (which?) platform */
10174 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10175 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10176 checkit("0.1", buf);
10178 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10179 checkit("0.01", buf);
10181 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10182 checkit("0.001", buf);
10184 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10185 checkit("0.0001", buf);
10187 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10188 if (strlen(buf) > 5)
10189 checkit("9e-005", buf); /* for Microsoft ?? */
10191 checkit("9e-05", buf);
10193 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10196 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10197 checkit("1.1", buf);
10199 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10200 checkit("1.01", buf);
10202 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10203 checkit("1.001", buf);
10205 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10206 checkit("1.0001", buf);
10208 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10209 checkit("1.00001", buf);
10211 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10212 checkit("1.000001", buf);
10214 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10217 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10218 checkit("-1", buf);
10220 /* Some Linux gcvt's give 1.e+5 here. */
10221 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10222 checkit("100000", buf);
10224 /* Some Linux gcvt's give -1.e+5 here. */
10225 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10226 checkit("-100000", buf);
10228 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10229 checkit("123.456", buf);
10231 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10232 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10233 /* 34 should be enough to scare even long double
10234 * places into using the e notation. */
10235 if (strlen(buf) > 5)
10236 checkit("1e+034", buf); /* for Microsoft */
10238 checkit("1e+34", buf);
10240 /* For Perl, if you add additional tests here, also add them to
10241 * t/base/num.t for benefit of platforms not using Configure or
10242 * overriding d_Gconvert */
10247 : first add preferred functions to our list
10249 for xxx_convert in $gconvert_preference; do
10250 case $xxx_convert in
10251 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10252 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10255 : then add any others
10256 for xxx_convert in gconvert gcvt sprintf; do
10257 case "$xxx_list" in
10259 *) xxx_list="$xxx_list $xxx_convert" ;;
10263 case "$d_longdbl$uselongdouble" in
10265 : again, add preferred functions to our list first
10267 for xxx_convert in $gconvert_ld_preference; do
10268 case $xxx_convert in
10269 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10270 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10273 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10274 for xxx_convert in qgcvt sprintf $xxx_list; do
10275 case "$xxx_ld_list" in
10276 $xxx_convert*|*" $xxx_convert"*) ;;
10277 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10280 : if sprintf cannot do long doubles, move it to the end
10281 if test "$d_PRIgldbl" != "$define"; then
10282 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10284 : if no qgcvt, remove it
10285 if test "$d_qgcvt" != "$define"; then
10286 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10289 xxx_list="$xxx_ld_list"
10293 for xxx_convert in $xxx_list; do
10294 echo "Trying $xxx_convert..."
10295 $rm -f try try$_o core
10296 set try -DTRY_$xxx_convert
10297 if eval $compile; then
10298 echo "$xxx_convert() found." >&4
10299 if $run ./try; then
10300 echo "I'll use $xxx_convert to convert floats into a string." >&4
10303 echo "...But $xxx_convert didn't work as I expected."
10307 echo "$xxx_convert NOT found." >&4
10311 if test X$xxx_convert = X; then
10312 echo "*** WHOA THERE!!! ***" >&4
10313 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10314 xxx_convert=sprintf
10317 case "$xxx_convert" in
10318 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10319 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10320 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10321 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10322 "$define$define$define")
10323 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10324 "$define$define$undef")
10325 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10326 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10334 : see if _fwalk exists
10338 : Initialize h_fcntl
10341 : Initialize h_sysfile
10344 : access call always available on UNIX
10345 set access d_access
10348 : locate the flags for 'access()'
10349 case "$d_access" in
10352 $cat >access.c <<EOCP
10353 #include <sys/types.h>
10358 #include <sys/file.h>
10361 #include <unistd.h>
10363 #$i_stdlib I_STDLIB
10365 #include <stdlib.h>
10371 : check sys/file.h first, no particular reason here
10372 if $test `./findhdr sys/file.h` && \
10373 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10375 echo "<sys/file.h> defines the *_OK access constants." >&4
10376 elif $test `./findhdr fcntl.h` && \
10377 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10379 echo "<fcntl.h> defines the *_OK access constants." >&4
10380 elif $test `./findhdr unistd.h` && \
10381 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10382 echo "<unistd.h> defines the *_OK access constants." >&4
10384 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10390 : see if accessx exists
10391 set accessx d_accessx
10394 : see if acosh exists
10398 : see if aintl exists
10402 : see if alarm exists
10406 : see if 64bit time functions exists
10408 set ctime64 d_ctime64
10411 set localtime64 d_localtime64
10414 set gmtime64 d_gmtime64
10417 set mktime64 d_mktime64
10420 set difftime64 d_difftime64
10423 set asctime64 d_asctime64
10426 : see if POSIX threads are available
10427 set pthread.h i_pthread
10430 : define a function to check prototypes
10431 $cat > protochk <<EOSH
10434 optimize="$optimize"
10436 prototype="$prototype"
10439 usethreads=$usethreads
10440 i_pthread=$i_pthread
10441 pthread_h_first=$pthread_h_first
10444 $cat >> protochk <<'EOSH'
10449 while test $# -ge 2; do
10451 $define) echo "#include <$2>" >> try.c ;;
10452 literal) echo "$2" >> try.c ;;
10454 # Extra magic for the benefit of systems that need pthread.h
10455 # to be included early to correctly detect threadsafe functions.
10456 # Such functions must guarantee themselves, though, that the usethreads
10457 # and i_pthread have been defined, before calling protochk.
10458 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10459 echo "#include <pthread.h>" >> try.c
10464 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10465 cat >> try.c <<'EOCP'
10466 #ifdef CAN_PROTOTYPE
10467 #define _(args) args
10472 echo "$foo" >> try.c
10473 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10474 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10480 $eunicefix protochk
10482 : Define hasproto macro for Configure internal use
10483 hasproto='varname=$1; func=$2; shift; shift;
10484 while $test $# -ge 2; do
10486 $define) echo "#include <$2>";;
10490 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10491 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10492 echo "$func() prototype found.";
10495 echo "$func() prototype NOT found.";
10502 : see if sys/types.h has to be included
10503 set sys/types.h i_systypes
10506 : see if sys/select.h has to be included
10507 set sys/select.h i_sysselct
10510 : Define hasfield macro for Configure internal use
10511 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10512 while $test $# -ge 2; do
10514 $define) echo "#include <$2>";;
10518 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10520 if eval $compile; then
10529 : see if we should include time.h, sys/time.h, or both
10531 if test "X$timeincl" = X; then
10532 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10533 $echo $n "I'm now running the test program...$c"
10535 #include <sys/types.h>
10540 #ifdef SYSTIMEKERNEL
10543 #include <sys/time.h>
10546 #include <sys/select.h>
10548 #$i_stdlib I_STDLIB
10550 #include <stdlib.h>
10556 struct timeval bar;
10559 struct timezone tzp;
10561 if (foo.tm_sec == foo.tm_sec)
10564 if (bar.tv_sec == bar.tv_sec)
10571 for s_timezone in '-DS_TIMEZONE' ''; do
10573 for s_timeval in '-DS_TIMEVAL' ''; do
10574 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10575 for i_time in '' '-DI_TIME'; do
10576 for i_systime in '-DI_SYSTIME' ''; do
10579 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10580 if eval $compile; then
10581 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10585 $echo $n "Succeeded with $flags$c"
10597 *SYSTIMEKERNEL*) i_systimek="$define"
10598 timeincl=`./findhdr sys/time.h`
10599 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10600 *) i_systimek="$undef";;
10603 *I_TIME*) i_time="$define"
10604 timeincl=`./findhdr time.h`" $timeincl"
10605 echo "We'll include <time.h>." >&4;;
10606 *) i_time="$undef";;
10609 *I_SYSTIME*) i_systime="$define"
10610 timeincl=`./findhdr sys/time.h`" $timeincl"
10611 echo "We'll include <sys/time.h>." >&4;;
10612 *) i_systime="$undef";;
10616 : see if struct tm knows about tm_zone
10617 case "$i_systime$i_time" in
10620 echo "Checking to see if your struct tm has tm_zone field..." >&4
10621 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10629 case "$d_tm_tm_zone" in
10630 "$define") echo "Yes, it does." ;;
10631 *) echo "No, it doesn't." ;;
10633 : see if struct tm knows about tm_gmtoff
10634 case "$i_systime$i_time" in
10637 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10638 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10646 case "$d_tm_tm_gmtoff" in
10647 "$define") echo "Yes, it does." ;;
10648 *) echo "No, it doesn't." ;;
10651 : see if asctime_r exists
10652 set asctime_r d_asctime_r
10654 case "$d_asctime_r" in
10656 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10657 case "$d_asctime_r_proto:$usethreads" in
10658 ":define") d_asctime_r_proto=define
10659 set d_asctime_r_proto asctime_r $hdrs
10663 case "$d_asctime_r_proto" in
10665 case "$asctime_r_proto" in
10666 ''|0) try='char* asctime_r(const struct tm*, char*);'
10667 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10669 case "$asctime_r_proto" in
10670 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10671 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10673 case "$asctime_r_proto" in
10674 ''|0) try='int asctime_r(const struct tm*, char*);'
10675 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10677 case "$asctime_r_proto" in
10678 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10679 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10681 case "$asctime_r_proto" in
10682 ''|0) d_asctime_r=undef
10684 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10685 * ) case "$asctime_r_proto" in
10686 REENTRANT_PROTO*) ;;
10687 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10689 echo "Prototype: $try" ;;
10692 *) case "$usethreads" in
10693 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10700 *) asctime_r_proto=0
10704 : see if atolf exists
10708 : see if atoll exists
10712 : Look for GCC-style attribute format
10713 case "$d_attribute_format" in
10716 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10717 $cat >attrib.c <<'EOCP'
10719 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10721 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10722 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10723 echo "Your C compiler doesn't support __attribute__((format))."
10726 echo "Your C compiler supports __attribute__((format))."
10730 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10734 *) val="$d_attribute_format" ;;
10736 set d_attribute_format
10740 : Look for GCC-style attribute format with null format allowed
10741 case "$d_printf_format_null" in
10742 '') case "$d_attribute_format" in
10745 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10746 $cat >attrib.c <<EOCP
10748 #$i_stdlib I_STDLIB
10750 #include <stdlib.h>
10752 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10753 int null_printf (char* pat,...) { return (int)pat; }
10754 int main () { exit(null_printf(NULL)); }
10756 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10757 : run the executable in case it produces a run-time warning
10758 if $run ./attrib >>attrib.out 2>&1; then
10759 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10760 echo "Your C compiler doesn't allow __printf__ format to be null."
10763 echo "Your C compiler allows __printf__ format to be null."
10767 echo "Your C compiler executable failed with __printf__ format null."
10771 echo "Your C compiler fails with __printf__ format null."
10778 *) val="$d_printf_format_null" ;;
10780 set d_printf_format_null
10784 : Look for GCC-style attribute malloc
10785 case "$d_attribute_malloc" in
10788 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10789 $cat >attrib.c <<'EOCP'
10791 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10793 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10794 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10795 echo "Your C compiler doesn't support __attribute__((malloc))."
10798 echo "Your C compiler supports __attribute__((malloc))."
10802 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10806 *) val="$d_attribute_malloc" ;;
10808 set d_attribute_malloc
10812 : Look for GCC-style attribute nonnull
10813 case "$d_attribute_nonnull" in
10816 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10817 $cat >attrib.c <<'EOCP'
10819 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10821 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10822 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10823 echo "Your C compiler doesn't support __attribute__((nonnull))."
10826 echo "Your C compiler supports __attribute__((nonnull))."
10830 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10834 *) val="$d_attribute_nonnull" ;;
10836 set d_attribute_nonnull
10840 : Look for GCC-style attribute noreturn
10841 case "$d_attribute_noreturn" in
10844 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10845 $cat >attrib.c <<'EOCP'
10847 void fall_over_dead( void ) __attribute__((noreturn));
10849 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10850 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10851 echo "Your C compiler doesn't support __attribute__((noreturn))."
10854 echo "Your C compiler supports __attribute__((noreturn))."
10858 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10862 *) val="$d_attribute_noreturn" ;;
10864 set d_attribute_noreturn
10868 : Look for GCC-style attribute pure
10869 case "$d_attribute_pure" in
10872 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10873 $cat >attrib.c <<'EOCP'
10875 int square( int n ) __attribute__((pure));
10877 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10878 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10879 echo "Your C compiler doesn't support __attribute__((pure))."
10882 echo "Your C compiler supports __attribute__((pure))."
10886 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10890 *) val="$d_attribute_pure" ;;
10892 set d_attribute_pure
10896 : Look for GCC-style attribute unused
10897 case "$d_attribute_unused" in
10900 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10901 $cat >attrib.c <<'EOCP'
10903 int do_something( int dummy __attribute__((unused)), int n );
10905 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10906 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10907 echo "Your C compiler doesn't support __attribute__((unused))."
10910 echo "Your C compiler supports __attribute__((unused))."
10914 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10918 *) val="$d_attribute_unused" ;;
10920 set d_attribute_unused
10924 : Look for GCC-style attribute deprecated
10925 case "$d_attribute_deprecated" in
10928 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10929 $cat >attrib.c <<'EOCP'
10931 int I_am_deprecated(void) __attribute__((deprecated));
10933 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10934 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10935 echo "Your C compiler doesn't support __attribute__((deprecated))."
10938 echo "Your C compiler supports __attribute__((deprecated))."
10942 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10946 *) val="$d_attribute_deprecated" ;;
10948 set d_attribute_deprecated
10952 : Look for GCC-style attribute warn_unused_result
10953 case "$d_attribute_warn_unused_result" in
10956 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10957 $cat >attrib.c <<'EOCP'
10959 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10961 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10962 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10963 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10966 echo "Your C compiler supports __attribute__((warn_unused_result))."
10970 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10974 *) val="$d_attribute_warn_unused_result" ;;
10976 set d_attribute_warn_unused_result
10980 : see if bcmp exists
10984 : see if bcopy exists
10988 : see if getpgrp exists
10989 set getpgrp d_getpgrp
10992 case "$d_getpgrp" in
10995 echo "Checking to see which flavor of getpgrp is in use..."
10997 #$i_unistd I_UNISTD
10998 #include <sys/types.h>
11000 # include <unistd.h>
11002 #$i_stdlib I_STDLIB
11004 #include <stdlib.h>
11008 if (getuid() == 0) {
11009 printf("(I see you are running Configure as super-user...)\n");
11012 #ifdef TRY_BSD_PGRP
11013 if (getpgrp(1) == 0)
11022 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11023 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
11025 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11026 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
11029 echo "I can't seem to compile and run the test program."
11031 xxx="a USG one, i.e. you use getpgrp()."
11033 # SVR4 systems can appear rather BSD-ish.
11034 case "$i_unistd" in
11036 xxx="a BSD one, i.e. you use getpgrp(pid)."
11040 xxx="probably a USG one, i.e. you use getpgrp()."
11045 echo "Assuming your getpgrp is $xxx" >&4
11054 : see if setpgrp exists
11055 set setpgrp d_setpgrp
11058 case "$d_setpgrp" in
11061 echo "Checking to see which flavor of setpgrp is in use..."
11063 #$i_unistd I_UNISTD
11064 #include <sys/types.h>
11066 # include <unistd.h>
11068 #$i_stdlib I_STDLIB
11070 #include <stdlib.h>
11074 if (getuid() == 0) {
11075 printf("(I see you are running Configure as super-user...)\n");
11078 #ifdef TRY_BSD_PGRP
11079 if (-1 == setpgrp(1, 1))
11082 if (setpgrp() != -1)
11088 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11089 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
11091 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
11092 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
11095 echo "(I can't seem to compile and run the test program.)"
11097 xxx="a USG one, i.e. you use setpgrp()."
11099 # SVR4 systems can appear rather BSD-ish.
11100 case "$i_unistd" in
11102 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
11106 xxx="probably a USG one, i.e. you use setpgrp()."
11111 echo "Assuming your setpgrp is $xxx" >&4
11120 : Look for GCC-style __builtin_choose_expr
11121 case "$d_builtin_choose_expr" in
11124 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
11125 $cat >try.c <<'EOCP'
11126 #include <assert.h>
11127 #include <stdlib.h>
11130 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
11133 assert( SYRINX(1) == 2112 );
11134 assert( SYRINX(1) != 5150 );
11135 assert( SYRINX(0) == 5150 );
11136 assert( SYRINX(0) != 2112 );
11137 puts( "All good!" );
11143 if eval $compile && $run ./try; then
11144 echo "Your C compiler supports __builtin_choose_expr."
11147 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
11151 *) val="$d_builtin_choose_expr" ;;
11154 set d_builtin_choose_expr
11158 : Look for GCC-style __builtin_expect
11159 case "$d_builtin_expect" in
11162 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11163 $cat >try.c <<'EOCP'
11166 if ( __builtin_expect(n, 0) ) n = 1;
11167 /* Remember shell exit code truth is 0, C truth is non-zero */
11172 if eval $compile && $run ./try; then
11173 echo "Your C compiler supports __builtin_expect."
11176 echo "Your C compiler doesn't seem to understand __builtin_expect."
11180 *) val="$d_builtin_expect" ;;
11183 set d_builtin_expect
11187 : see if bzero exists
11191 : see if stdarg is available
11193 if $test `./findhdr stdarg.h`; then
11194 echo "<stdarg.h> found." >&4
11197 echo "<stdarg.h> NOT found." >&4
11201 : see if varargs is available
11203 if $test `./findhdr varargs.h`; then
11204 echo "<varargs.h> found." >&4
11206 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11209 : set up the varargs testing programs
11210 $cat > varargs.c <<EOP
11212 #include <stdarg.h>
11215 #include <varargs.h>
11219 int f(char *p, ...)
11233 p = va_arg(ap, char *);
11239 $cat > varargs <<EOP
11241 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11250 : now check which varargs header should be included
11256 if `./varargs I_STDARG`; then
11258 elif `./varargs I_VARARGS`; then
11263 if `./varargs I_VARARGS`; then
11271 echo "*** WHOA THERE!!! ***" >&4
11272 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
11273 case "$knowitall" in
11275 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
11279 echo "I could not find the definition for va_dcl... You have problems..." >&4
11280 val="$undef"; set i_stdarg; eval $setvar
11281 val="$undef"; set i_varargs; eval $setvar
11286 case "$i_varhdr" in
11288 val="$define"; set i_stdarg; eval $setvar
11289 val="$undef"; set i_varargs; eval $setvar
11292 val="$undef"; set i_stdarg; eval $setvar
11293 val="$define"; set i_varargs; eval $setvar
11296 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11300 : see if the Compiler supports C99 variadic macros
11301 case "$i_stdarg$i_stdlib" in
11303 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
11306 #include <stdarg.h>
11308 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11312 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11318 if eval $compile && $run ./try 2>&1 >/dev/null; then
11319 case "`$run ./try`" in
11321 echo "You have C99 variadic macros." >&4
11322 d_c99_variadic_macros="$define"
11325 echo "You don't have functional C99 variadic macros." >&4
11326 d_c99_variadic_macros="$undef"
11330 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11331 d_c99_variadic_macros="$undef"
11336 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
11337 d_c99_variadic_macros="$undef"
11341 : see if signal is declared as pointer to function returning int or void
11343 xxx=`./findhdr signal.h`
11344 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11345 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11346 echo "You have int (*signal())() instead of void." >&4
11348 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11349 echo "You have void (*signal())()." >&4
11351 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11352 echo "You have int (*signal())() instead of void." >&4
11354 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11355 echo "You have void (*signal())()." >&4
11358 case "$d_voidsig" in
11360 echo "I can't determine whether signal handler returns void or int..." >&4
11362 rp="What type does your signal handler return?"
11365 v*) val="$define";;
11369 echo "As you already told me, signal handler returns void." >&4
11372 *) echo "As you already told me, signal handler returns int." >&4
11379 case "$d_voidsig" in
11380 "$define") signal_t="void";;
11381 *) signal_t="int";;
11385 : check for ability to cast large floats to 32-bit ints.
11387 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11388 if $test "$intsize" -ge 4; then
11395 #$i_stdlib I_STDLIB
11397 #include <stdlib.h>
11399 #include <sys/types.h>
11400 #include <signal.h>
11401 $signal_t blech(int s) { exit(3); }
11408 signal(SIGFPE, blech);
11410 /* Don't let compiler optimize the test away. Store the number
11411 in a writable string for gcc to pass to sscanf under HP-UX.
11413 sprintf(str, "2147483647");
11414 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11418 /* x86 processors will probably give 0x8000 0000, which is a
11419 sign change. We don't want that. We want to mimic SPARC
11420 behavior here, which is to preserve the sign and give
11423 if (i32 != ($xxx) f)
11429 if eval $compile_ok; then
11433 echo "(I can't seem to compile the test program--assuming it can't)"
11438 echo "Yup, it can."
11441 echo "Nope, it can't."
11448 : check for ability to cast negative floats to unsigned
11450 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11453 #$i_stdlib I_STDLIB
11455 #include <stdlib.h>
11457 #include <sys/types.h>
11458 #include <signal.h>
11459 $signal_t blech(int s) { exit(7); }
11460 $signal_t blech_in_list(int s) { exit(4); }
11461 unsigned long dummy_long(unsigned long p) { return p; }
11462 unsigned int dummy_int(unsigned int p) { return p; }
11463 unsigned short dummy_short(unsigned short p) { return p; }
11467 unsigned long along;
11469 unsigned short ashort;
11473 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11474 a direct f = -123. assignment. gcc-2.8.0 reportedly
11475 optimized the whole file away
11477 /* Store the number in a writable string for gcc to pass to
11478 sscanf under HP-UX.
11480 sprintf(str, "-123");
11481 sscanf(str, "%lf", &f); /* f = -123.; */
11483 signal(SIGFPE, blech);
11484 along = (unsigned long)f;
11485 aint = (unsigned int)f;
11486 ashort = (unsigned short)f;
11487 if (along != (unsigned long)-123)
11489 if (aint != (unsigned int)-123)
11491 if (ashort != (unsigned short)-123)
11493 sprintf(str, "1073741824.");
11494 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11497 along = (unsigned long)f;
11498 if (along != 0x80000000)
11502 along = (unsigned long)f;
11503 if (along != 0x7fffffff)
11507 along = (unsigned long)f;
11508 if (along != 0x80000001)
11512 signal(SIGFPE, blech_in_list);
11513 sprintf(str, "123.");
11514 sscanf(str, "%lf", &f); /* f = 123.; */
11515 along = dummy_long((unsigned long)f);
11516 aint = dummy_int((unsigned int)f);
11517 ashort = dummy_short((unsigned short)f);
11518 if (along != (unsigned long)123)
11520 if (aint != (unsigned int)123)
11522 if (ashort != (unsigned short)123)
11529 if eval $compile_ok; then
11533 echo "(I can't seem to compile the test program--assuming it can't)"
11536 case "$castflags" in
11538 echo "Yup, it can."
11541 echo "Nope, it can't."
11548 : see if vprintf exists
11550 if set vprintf val -f d_vprintf; eval $csym; $val; then
11551 echo 'vprintf() found.' >&4
11554 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11555 #$i_varargs I_VARARGS
11557 #$i_stdlib I_STDLIB
11558 #$i_unistd I_UNISTD
11561 # include <stdarg.h>
11562 #else /* I_VARARGS */
11563 # include <varargs.h>
11567 # include <unistd.h>
11571 # include <stdlib.h>
11574 #include <stdio.h> /* vsprintf prototype */
11577 void xxx(int n, ...)
11582 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11584 int main() { xxx(1, "foo"); }
11586 #else /* I_VARARGS */
11594 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11596 int main() { xxx("foo"); }
11602 if eval $compile_ok; then
11603 if $run ./try; then
11604 echo "Your vsprintf() returns (int)." >&4
11607 echo "Your vsprintf() returns (char*)." >&4
11611 echo 'I am unable to compile the vsprintf() test program.' >&4
11612 # We shouldn't get here. If we do, assume the standard signature,
11613 # not the old BSD one.
11614 echo 'Guessing that vsprintf() returns (int).' >&4
11618 echo 'vprintf() NOT found.' >&4
11629 : see if chown exists
11633 : see if chroot exists
11634 set chroot d_chroot
11637 : see if chsize exists
11638 set chsize d_chsize
11641 : see if class exists
11645 : see if clearenv exists
11646 set clearenv d_clearenv
11649 : Define hasstruct macro for Configure internal use
11650 hasstruct='varname=$1; struct=$2; shift; shift;
11651 while $test $# -ge 2; do
11653 $define) echo "#include <$2>";;
11657 echo "int main () { struct $struct foo; }" >> try.c;
11659 if eval $compile; then
11668 : see whether socket exists
11672 $echo $n "Hmm... $c" >&4
11673 if set socket val -f d_socket; eval $csym; $val; then
11674 echo "Looks like you have Berkeley networking support." >&4
11676 if set setsockopt val -f; eval $csym; $val; then
11679 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11680 d_oldsock="$define"
11683 if $contains socklib libc.list >/dev/null 2>&1; then
11684 echo "Looks like you have Berkeley networking support." >&4
11686 : we will have to assume that it supports the 4.2 BSD interface
11689 echo "You don't have Berkeley networking in libc$_a..." >&4
11690 if test "X$d_socket" = "X$define"; then
11691 echo "...but you seem to believe that you have sockets." >&4
11693 for net in net socket
11695 if test -f $sysroot/usr/lib/lib$net$_a; then
11696 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11697 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11698 if $contains socket libc.list >/dev/null 2>&1; then
11703 echo "...but the Wollongong group seems to have hacked it in." >&4
11704 sockethdr="-I$sysroot/usr/netinclude"
11707 echo "Found Berkeley sockets interface in lib$net." >&4
11708 if $contains setsockopt libc.list >/dev/null 2>&1; then
11711 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11712 d_oldsock="$define"
11718 if test "X$d_socket" != "X$define"; then
11719 echo "or anywhere else I see." >&4
11727 : see if socketpair exists
11728 set socketpair d_sockpair
11733 echo "Checking the availability sa_len in the sock struct ..." >&4
11735 #include <sys/types.h>
11736 #include <sys/socket.h>
11738 struct sockaddr sa;
11739 return (sa.sa_len);
11743 set try; if eval $compile; then
11746 set d_sockaddr_sa_len; eval $setvar
11750 echo "Checking the availability struct sockaddr_in6 ..." >&4
11752 #include <sys/types.h>
11753 #include <sys/socket.h>
11754 #include <netinet/in.h>
11756 struct sockaddr_in6 sin6;
11757 return (sin6.sin6_family);
11761 set try; if eval $compile; then
11764 set d_sockaddr_in6; eval $setvar
11768 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11770 #include <sys/types.h>
11771 #include <sys/socket.h>
11772 #include <netinet/in.h>
11774 struct sockaddr_in6 sin6;
11775 return (sin6.sin6_scope_id);
11779 set try; if eval $compile; then
11782 set d_sin6_scope_id; eval $setvar
11786 echo "Checking the availability struct ip_mreq ..." >&4
11788 #include <sys/types.h>
11789 #include <sys/socket.h>
11790 #include <netinet/in.h>
11792 struct ip_mreq mreq;
11793 return (mreq.imr_multiaddr.s_addr);
11797 set try; if eval $compile; then
11800 set d_ip_mreq; eval $setvar
11804 echo "Checking the availability struct ip_mreq_source ..." >&4
11806 #include <sys/types.h>
11807 #include <sys/socket.h>
11808 #include <netinet/in.h>
11810 struct ip_mreq_source mreq;
11811 return (mreq.imr_multiaddr.s_addr);
11815 set try; if eval $compile; then
11818 set d_ip_mreq_source; eval $setvar
11822 echo "Checking the availability struct ipv6_mreq ..." >&4
11824 #include <sys/types.h>
11825 #include <sys/socket.h>
11826 #include <netinet/in.h>
11828 struct ipv6_mreq mreq;
11829 return (mreq.ipv6mr_interface);
11833 set try; if eval $compile; then
11836 set d_ipv6_mreq; eval $setvar
11840 echo "Checking the availability struct ipv6_mreq_source ..." >&4
11842 #include <sys/types.h>
11843 #include <sys/socket.h>
11844 #include <netinet/in.h>
11846 struct ipv6_mreq_source mreq;
11847 return (mreq.imr_multiaddr.s_addr);
11851 set try; if eval $compile; then
11854 set d_ipv6_mreq_source; eval $setvar
11858 echo "Checking the availability of certain socket constants..." >&4
11859 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11860 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11862 #include <sys/types.h>
11863 #include <sys/socket.h>
11869 set try; if eval $compile; then
11872 set d_${enum}; eval $setvar
11876 : see if this is a sys/uio.h system
11877 set sys/uio.h i_sysuio
11880 : Check for cmsghdr support
11882 echo "Checking to see if your system supports struct cmsghdr..." >&4
11883 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11885 case "$d_cmsghdr_s" in
11886 "$define") echo "Yes, it does." ;;
11887 *) echo "No, it doesn't." ;;
11891 : check for const keyword
11893 echo 'Checking to see if your C compiler knows about "const"...' >&4
11894 $cat >const.c <<'EOCP'
11895 typedef struct spug { int drokk; } spug;
11899 const spug y = { 0 };
11902 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11904 echo "Yup, it does."
11907 echo "Nope, it doesn't."
11912 : see if copysignl exists
11913 set copysignl d_copysignl
11916 : see if crypt exists
11921 $define) cryptlib='' ;;
11922 *) if set crypt val -f d_crypt; eval $csym; $val; then
11923 echo 'crypt() found.' >&4
11927 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11928 if $test -z "$cryptlib"; then
11929 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11933 if $test -z "$cryptlib"; then
11934 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11938 if $test -z "$cryptlib"; then
11939 cryptlib=`./loc libcrypt$_a "" $libpth`
11943 if $test -z "$cryptlib"; then
11944 echo 'crypt() NOT found.' >&4
11955 : see if this is a crypt.h system
11956 set crypt.h i_crypt
11959 : see if crypt_r exists
11960 set crypt_r d_crypt_r
11962 case "$d_crypt_r" in
11964 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11965 case "$d_crypt_r_proto:$usethreads" in
11966 ":define") d_crypt_r_proto=define
11967 set d_crypt_r_proto crypt_r $hdrs
11971 case "$d_crypt_r_proto" in
11973 case "$crypt_r_proto" in
11974 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11975 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11977 case "$crypt_r_proto" in
11978 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11979 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11981 case "$crypt_r_proto" in
11982 ''|0) d_crypt_r=undef
11984 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11985 * ) case "$crypt_r_proto" in
11986 REENTRANT_PROTO*) ;;
11987 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11989 echo "Prototype: $try" ;;
11992 *) case "$usethreads" in
11993 define) echo "crypt_r has no prototype, not using it." >&4 ;;
12004 : get csh whereabouts
12006 'csh') val="$undef" ;;
12007 *) val="$define" ;;
12011 : Respect a hint or command line value for full_csh.
12012 case "$full_csh" in
12013 '') full_csh=$csh ;;
12016 : see if ctermid exists
12017 set ctermid d_ctermid
12020 : see if ctermid_r exists
12021 set ctermid_r d_ctermid_r
12023 case "$d_ctermid_r" in
12025 hdrs="$i_systypes sys/types.h define stdio.h "
12026 case "$d_ctermid_r_proto:$usethreads" in
12027 ":define") d_ctermid_r_proto=define
12028 set d_ctermid_r_proto ctermid_r $hdrs
12032 case "$d_ctermid_r_proto" in
12034 case "$ctermid_r_proto" in
12035 ''|0) try='char* ctermid_r(char*);'
12036 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
12038 case "$ctermid_r_proto" in
12039 ''|0) d_ctermid_r=undef
12041 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
12042 * ) case "$ctermid_r_proto" in
12043 REENTRANT_PROTO*) ;;
12044 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
12046 echo "Prototype: $try" ;;
12049 *) case "$usethreads" in
12050 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
12057 *) ctermid_r_proto=0
12061 : see if ctime_r exists
12062 set ctime_r d_ctime_r
12064 case "$d_ctime_r" in
12066 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12067 case "$d_ctime_r_proto:$usethreads" in
12068 ":define") d_ctime_r_proto=define
12069 set d_ctime_r_proto ctime_r $hdrs
12073 case "$d_ctime_r_proto" in
12075 case "$ctime_r_proto" in
12076 ''|0) try='char* ctime_r(const time_t*, char*);'
12077 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
12079 case "$ctime_r_proto" in
12080 ''|0) try='char* ctime_r(const time_t*, char*, int);'
12081 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
12083 case "$ctime_r_proto" in
12084 ''|0) try='int ctime_r(const time_t*, char*);'
12085 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
12087 case "$ctime_r_proto" in
12088 ''|0) try='int ctime_r(const time_t*, char*, int);'
12089 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
12091 case "$ctime_r_proto" in
12092 ''|0) d_ctime_r=undef
12094 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
12095 * ) case "$ctime_r_proto" in
12096 REENTRANT_PROTO*) ;;
12097 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
12099 echo "Prototype: $try" ;;
12102 *) case "$usethreads" in
12103 define) echo "ctime_r has no prototype, not using it." >&4 ;;
12114 : see if cuserid exists
12115 set cuserid d_cuserid
12118 : see if this is a limits.h system
12119 set limits.h i_limits
12122 : See if number of significant digits in a double precision number is known
12124 $cat >dbl_dig.c <<EOM
12125 #$i_limits I_LIMITS
12128 #include <limits.h>
12134 printf("Contains DBL_DIG");
12137 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
12138 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
12139 echo "DBL_DIG found." >&4
12142 echo "DBL_DIG NOT found." >&4
12149 : see if dbm.h is available
12150 : see if dbmclose exists
12151 set dbmclose d_dbmclose
12154 case "$d_dbmclose" in
12164 *) set rpcsvc/dbm.h i_rpcsvcdbm
12169 *) echo "We won't be including <dbm.h>"
12179 : see if prototype for dbminit is available
12181 set d_dbminitproto dbminit $i_dbm dbm.h
12184 : see if difftime exists
12185 set difftime d_difftime
12188 : see if this is a dirent system
12190 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12192 echo "<dirent.h> found." >&4
12195 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12196 echo "<sys/dir.h> found." >&4
12199 xinc=`./findhdr sys/ndir.h`
12201 echo "<dirent.h> NOT found." >&4
12206 : Look for type of directory structure.
12208 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12210 case "$direntrytype" in
12212 case "$i_dirent" in
12213 $define) guess1='struct dirent' ;;
12214 *) guess1='struct direct' ;;
12217 *) guess1="$direntrytype"
12222 'struct dirent') guess2='struct direct' ;;
12223 *) guess2='struct dirent' ;;
12226 if $contains "$guess1" try.c >/dev/null 2>&1; then
12227 direntrytype="$guess1"
12228 echo "Your directory entries are $direntrytype." >&4
12229 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12230 direntrytype="$guess2"
12231 echo "Your directory entries seem to be $direntrytype." >&4
12233 echo "I don't recognize your system's directory entries." >&4
12234 rp="What type is used for directory entries on this system?"
12237 direntrytype="$ans"
12241 : see if the directory entry stores field length
12243 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12244 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12245 echo "Good, your directory entry keeps length information in d_namlen." >&4
12248 echo "Your directory entry does not know about the d_namlen field." >&4
12255 : Look for DIR.dd_fd
12256 case "$i_dirent" in
12258 echo "Checking to see if DIR has a dd_fd member variable" >&4
12260 #$i_stdlib I_STDLIB
12262 #include <stdlib.h>
12264 #include <dirent.h>
12274 if eval $compile; then
12275 echo "Yes, it does."
12278 echo "No, it does not."
12283 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12291 : see if this is an sysdir system
12292 set sys/dir.h i_sysdir
12295 : see if this is an sysndir system
12296 set sys/ndir.h i_sysndir
12301 $cat >dirfd.c <<EOM
12303 #$i_stdlib I_STDLIB
12305 #include <stdlib.h>
12307 #$i_dirent I_DIRENT /**/
12308 #$i_sysdir I_SYS_DIR /**/
12309 #$i_sysndir I_SYS_NDIR /**/
12310 #$i_systypes I_SYS_TYPES /**/
12311 #if defined(I_SYS_TYPES)
12312 #include <sys/types.h>
12314 #if defined(I_DIRENT)
12315 #include <dirent.h>
12318 #include <sys/ndir.h>
12322 #include <ndir.h> /* may be wrong in the future */
12324 #include <sys/dir.h>
12330 DIR *dirp = opendir(".");
12331 if (dirfd(dirp) >= 0)
12339 if eval $compile; then
12343 $define) echo "dirfd() found." >&4 ;;
12344 *) echo "dirfd() NOT found." >&4 ;;
12350 : see if dladdr exists
12351 set dladdr d_dladdr
12354 : see if dlerror exists
12357 set dlerror d_dlerror
12361 : see if dlfcn is available
12362 set dlfcn.h i_dlfcn
12365 : Check what extension to use for shared libs
12370 On a few systems, the dynamically loaded modules that perl generates and uses
12371 will need a different extension than shared libs. The default will probably
12377 *) dflt="$dlext" ;;
12379 rp='What is the extension of dynamically loaded modules'
12388 : Check if dlsym need a leading underscore
12394 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12395 $cat >dyna.c <<'EOM'
12402 #$i_stdlib I_STDLIB
12404 #include <stdlib.h>
12408 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12410 #include <sys/types.h>
12415 extern int fred() ;
12424 int mode = RTLD_LAZY ;
12426 handle = dlopen("./dyna.$dlext", mode) ;
12427 if (handle == NULL) {
12432 symbol = dlsym(handle, "fred") ;
12433 if (symbol == NULL) {
12434 /* try putting a leading underscore */
12435 symbol = dlsym(handle, "_fred") ;
12436 if (symbol == NULL) {
12449 : Call the object file tmp-dyna.o in case dlext=o.
12450 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12451 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12452 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12453 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12456 1) echo "Test program failed using dlopen." >&4
12457 echo "Perhaps you should not use dynamic loading." >&4;;
12458 2) echo "Test program failed using dlsym." >&4
12459 echo "Perhaps you should not use dynamic loading." >&4;;
12460 3) echo "dlsym needs a leading underscore" >&4
12462 4) echo "dlsym doesn't need a leading underscore." >&4;;
12465 echo "I can't compile and run the test program." >&4
12466 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12471 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12476 : see if drand48_r exists
12477 set drand48_r d_drand48_r
12479 case "$d_drand48_r" in
12481 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12482 case "$d_drand48_r_proto:$usethreads" in
12483 ":define") d_drand48_r_proto=define
12484 set d_drand48_r_proto drand48_r $hdrs
12488 case "$d_drand48_r_proto" in
12490 case "$drand48_r_proto" in
12491 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12492 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12494 case "$drand48_r_proto" in
12495 ''|0) d_drand48_r=undef
12497 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12498 * ) case "$drand48_r_proto" in
12499 REENTRANT_PROTO*) ;;
12500 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12502 echo "Prototype: $try" ;;
12505 *) case "$usethreads" in
12506 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12513 *) drand48_r_proto=0
12517 : see if prototype for drand48 is available
12519 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12522 : see if dup2 exists
12526 : see if eaccess exists
12527 set eaccess d_eaccess
12530 : see if endgrent exists
12531 set endgrent d_endgrent
12534 : see if this is an grp system
12540 xxx=`./findhdr grp.h`
12541 $cppstdin $cppflags $cppminus < $xxx >$$.h
12543 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12555 set d_grpasswd; eval $setvar
12559 : see if endgrent_r exists
12560 set endgrent_r d_endgrent_r
12562 case "$d_endgrent_r" in
12564 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12565 case "$d_endgrent_r_proto:$usethreads" in
12566 ":define") d_endgrent_r_proto=define
12567 set d_endgrent_r_proto endgrent_r $hdrs
12571 case "$d_endgrent_r_proto" in
12573 case "$endgrent_r_proto" in
12574 ''|0) try='int endgrent_r(FILE**);'
12575 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12577 case "$endgrent_r_proto" in
12578 ''|0) try='void endgrent_r(FILE**);'
12579 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12581 case "$endgrent_r_proto" in
12582 ''|0) d_endgrent_r=undef
12584 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12585 * ) case "$endgrent_r_proto" in
12586 REENTRANT_PROTO*) ;;
12587 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12589 echo "Prototype: $try" ;;
12592 *) case "$usethreads" in
12593 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12600 *) endgrent_r_proto=0
12604 : see if endhostent exists
12605 set endhostent d_endhent
12608 : see if this is a netdb.h system
12609 set netdb.h i_netdb
12612 : see if endhostent_r exists
12613 set endhostent_r d_endhostent_r
12615 case "$d_endhostent_r" in
12617 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12618 case "$d_endhostent_r_proto:$usethreads" in
12619 ":define") d_endhostent_r_proto=define
12620 set d_endhostent_r_proto endhostent_r $hdrs
12624 case "$d_endhostent_r_proto" in
12626 case "$endhostent_r_proto" in
12627 ''|0) try='int endhostent_r(struct hostent_data*);'
12628 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12630 case "$endhostent_r_proto" in
12631 ''|0) try='void endhostent_r(struct hostent_data*);'
12632 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12634 case "$endhostent_r_proto" in
12635 ''|0) d_endhostent_r=undef
12636 endhostent_r_proto=0
12637 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12638 * ) case "$endhostent_r_proto" in
12639 REENTRANT_PROTO*) ;;
12640 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12642 echo "Prototype: $try" ;;
12645 *) case "$usethreads" in
12646 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12648 d_endhostent_r=undef
12649 endhostent_r_proto=0
12653 *) endhostent_r_proto=0
12657 : see if endnetent exists
12658 set endnetent d_endnent
12661 : see if endnetent_r exists
12662 set endnetent_r d_endnetent_r
12664 case "$d_endnetent_r" in
12666 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12667 case "$d_endnetent_r_proto:$usethreads" in
12668 ":define") d_endnetent_r_proto=define
12669 set d_endnetent_r_proto endnetent_r $hdrs
12673 case "$d_endnetent_r_proto" in
12675 case "$endnetent_r_proto" in
12676 ''|0) try='int endnetent_r(struct netent_data*);'
12677 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12679 case "$endnetent_r_proto" in
12680 ''|0) try='void endnetent_r(struct netent_data*);'
12681 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12683 case "$endnetent_r_proto" in
12684 ''|0) d_endnetent_r=undef
12685 endnetent_r_proto=0
12686 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12687 * ) case "$endnetent_r_proto" in
12688 REENTRANT_PROTO*) ;;
12689 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12691 echo "Prototype: $try" ;;
12694 *) case "$usethreads" in
12695 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12697 d_endnetent_r=undef
12698 endnetent_r_proto=0
12702 *) endnetent_r_proto=0
12706 : see if endprotoent exists
12707 set endprotoent d_endpent
12710 : see if endprotoent_r exists
12711 set endprotoent_r d_endprotoent_r
12713 case "$d_endprotoent_r" in
12715 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12716 case "$d_endprotoent_r_proto:$usethreads" in
12717 ":define") d_endprotoent_r_proto=define
12718 set d_endprotoent_r_proto endprotoent_r $hdrs
12722 case "$d_endprotoent_r_proto" in
12724 case "$endprotoent_r_proto" in
12725 ''|0) try='int endprotoent_r(struct protoent_data*);'
12726 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12728 case "$endprotoent_r_proto" in
12729 ''|0) try='void endprotoent_r(struct protoent_data*);'
12730 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12732 case "$endprotoent_r_proto" in
12733 ''|0) d_endprotoent_r=undef
12734 endprotoent_r_proto=0
12735 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12736 * ) case "$endprotoent_r_proto" in
12737 REENTRANT_PROTO*) ;;
12738 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12740 echo "Prototype: $try" ;;
12743 *) case "$usethreads" in
12744 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12746 d_endprotoent_r=undef
12747 endprotoent_r_proto=0
12751 *) endprotoent_r_proto=0
12755 : see if endpwent exists
12756 set endpwent d_endpwent
12759 : see if this is a pwd.h system
12765 xxx=`./findhdr pwd.h`
12766 $cppstdin $cppflags $cppminus < $xxx >$$.h
12768 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12776 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12784 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12792 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12800 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12808 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12816 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12824 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12836 set d_pwquota; eval $setvar
12837 set d_pwage; eval $setvar
12838 set d_pwchange; eval $setvar
12839 set d_pwclass; eval $setvar
12840 set d_pwexpire; eval $setvar
12841 set d_pwcomment; eval $setvar
12842 set d_pwgecos; eval $setvar
12843 set d_pwpasswd; eval $setvar
12847 : see if endpwent_r exists
12848 set endpwent_r d_endpwent_r
12850 case "$d_endpwent_r" in
12852 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12853 case "$d_endpwent_r_proto:$usethreads" in
12854 ":define") d_endpwent_r_proto=define
12855 set d_endpwent_r_proto endpwent_r $hdrs
12859 case "$d_endpwent_r_proto" in
12861 case "$endpwent_r_proto" in
12862 ''|0) try='int endpwent_r(FILE**);'
12863 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12865 case "$endpwent_r_proto" in
12866 ''|0) try='void endpwent_r(FILE**);'
12867 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12869 case "$endpwent_r_proto" in
12870 ''|0) d_endpwent_r=undef
12872 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12873 * ) case "$endpwent_r_proto" in
12874 REENTRANT_PROTO*) ;;
12875 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12877 echo "Prototype: $try" ;;
12880 *) case "$usethreads" in
12881 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12888 *) endpwent_r_proto=0
12892 : see if endservent exists
12893 set endservent d_endsent
12896 : see if endservent_r exists
12897 set endservent_r d_endservent_r
12899 case "$d_endservent_r" in
12901 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12902 case "$d_endservent_r_proto:$usethreads" in
12903 ":define") d_endservent_r_proto=define
12904 set d_endservent_r_proto endservent_r $hdrs
12908 case "$d_endservent_r_proto" in
12910 case "$endservent_r_proto" in
12911 ''|0) try='int endservent_r(struct servent_data*);'
12912 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12914 case "$endservent_r_proto" in
12915 ''|0) try='void endservent_r(struct servent_data*);'
12916 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12918 case "$endservent_r_proto" in
12919 ''|0) d_endservent_r=undef
12920 endservent_r_proto=0
12921 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12922 * ) case "$endservent_r_proto" in
12923 REENTRANT_PROTO*) ;;
12924 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12926 echo "Prototype: $try" ;;
12929 *) case "$usethreads" in
12930 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12932 d_endservent_r=undef
12933 endservent_r_proto=0
12937 *) endservent_r_proto=0
12941 : Locate the flags for 'open()'
12944 #include <sys/types.h>
12949 #include <sys/file.h>
12951 #$i_stdlib I_STDLIB
12953 #include <stdlib.h>
12964 : check sys/file.h first to get FREAD on Sun
12965 if $test `./findhdr sys/file.h` && \
12966 set try -DI_SYS_FILE && eval $compile; then
12968 echo "<sys/file.h> defines the O_* constants..." >&4
12969 if $run ./try; then
12970 echo "and you have the 3 argument form of open()." >&4
12973 echo "but not the 3 argument form of open(). Oh, well." >&4
12976 elif $test `./findhdr fcntl.h` && \
12977 set try -DI_FCNTL && eval $compile; then
12979 echo "<fcntl.h> defines the O_* constants..." >&4
12980 if $run ./try; then
12981 echo "and you have the 3 argument form of open()." >&4
12984 echo "but not the 3 argument form of open(). Oh, well." >&4
12989 echo "I can't find the O_* constant definitions! You got problems." >&4
12995 : see if this is a sys/file.h system
13000 : do we need to include sys/file.h ?
13004 if $h_sysfile; then
13006 echo "We'll be including <sys/file.h>." >&4
13009 echo "We won't be including <sys/file.h>." >&4
13019 : see if fcntl.h is there
13024 : see if we can include fcntl.h
13030 echo "We'll be including <fcntl.h>." >&4
13033 if $h_sysfile; then
13034 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
13036 echo "We won't be including <fcntl.h>." >&4
13048 : see if fork exists
13052 : see if pipe exists
13056 : check for non-blocking I/O stuff
13057 case "$h_sysfile" in
13058 true) echo "#include <sys/file.h>" > head.c;;
13061 true) echo "#include <fcntl.h>" > head.c;;
13062 *) echo "#include <sys/fcntl.h>" > head.c;;
13067 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
13068 case "$o_nonblock" in
13070 $cat head.c > try.c
13071 $cat >>try.c <<EOCP
13073 #$i_stdlib I_STDLIB
13075 #include <stdlib.h>
13083 printf("O_NONBLOCK\n");
13087 printf("O_NDELAY\n");
13091 printf("FNDELAY\n");
13098 if eval $compile_ok; then
13099 o_nonblock=`$run ./try`
13100 case "$o_nonblock" in
13101 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
13102 *) echo "Seems like we can use $o_nonblock.";;
13105 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
13108 *) echo "Using $hint value $o_nonblock.";;
13113 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
13116 case "$d_fork:$d_pipe" in
13118 $cat head.c > try.c
13119 $cat >>try.c <<EOCP
13121 #include <sys/types.h>
13122 #include <signal.h>
13124 #$i_stdlib I_STDLIB
13126 #include <stdlib.h>
13132 #define MY_O_NONBLOCK $o_nonblock
13133 #ifndef errno /* XXX need better Configure test */
13136 #$i_unistd I_UNISTD
13138 #include <unistd.h>
13140 #$i_string I_STRING
13142 #include <string.h>
13144 #include <strings.h>
13146 $signal_t blech(int x) { exit(3); }
13148 $cat >> try.c <<'EOCP'
13157 ret = pipe(pd); /* Down: child -> parent */
13160 ret = pipe(pu); /* Up: parent -> child */
13164 close(pd[1]); /* Parent reads from pd[0] */
13165 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13167 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13172 signal(SIGALRM, blech);
13174 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13176 sprintf(string, "%d\n", ret);
13177 ret = write(2, string, strlen(string));
13178 if (ret != strlen(string))
13182 if (errno == EAGAIN) {
13183 printf("EAGAIN\n");
13188 if (errno == EWOULDBLOCK)
13189 printf("EWOULDBLOCK\n");
13192 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13195 sleep(2); /* Give it time to close our pipe */
13197 ret = read(pd[0], buf, 1); /* Should read EOF */
13199 sprintf(string, "%d\n", ret);
13200 ret = write(4, string, strlen(string));
13201 if (ret != strlen(string))
13206 close(pd[0]); /* We write to pd[1] */
13207 close(pu[1]); /* We read from pu[0] */
13208 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13211 close(pd[1]); /* Pipe pd is now fully closed! */
13212 exit(0); /* Bye bye, thank you for playing! */
13216 if eval $compile_ok; then
13217 echo "$startsh" >mtry
13218 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13220 $run ./mtry >/dev/null 2>&1
13222 0) eagain=`$cat try.out`;;
13223 1) echo "Could not perform non-blocking setting!";;
13224 2) echo "I did a successful read() for something that was not there!";;
13225 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13226 4) echo "Could not find F_SETFL!";;
13227 *) echo "Something terribly wrong happened during testing.";;
13229 rd_nodata=`$cat try.ret`
13230 echo "A read() system call with no data present returns $rd_nodata."
13231 case "$rd_nodata" in
13234 echo "(That's peculiar, fixing that to be -1.)"
13240 echo "Forcing errno EAGAIN on read() with no data available."
13244 echo "Your read() sets errno to $eagain when no data is available."
13247 status=`$cat try.err`
13249 0) echo "And it correctly returns 0 to signal EOF.";;
13250 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13251 *) echo "However, your read() returns '$status' on EOF??";;
13254 if test "$status" = "$rd_nodata"; then
13255 echo "WARNING: you can't distinguish between EOF and no data!"
13259 echo "I can't compile the test program--assuming errno EAGAIN will do."
13263 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13272 echo "Using $hint value $eagain."
13273 echo "Your read() returns $rd_nodata when no data is present."
13274 case "$d_eofnblk" in
13275 "$define") echo "And you can see EOF because read() returns 0.";;
13276 "$undef") echo "But you can't see EOF status from read() returned value.";;
13278 echo "(Assuming you can't see EOF status from read anyway.)"
13284 $rm_try head.c mtry
13286 : see if _ptr and _cnt from stdio act std
13289 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13290 echo "(Looks like you have stdio.h from BSD.)"
13291 case "$stdio_ptr" in
13292 '') stdio_ptr='((fp)->_p)'
13295 *) ptr_lval=$d_stdio_ptr_lval;;
13297 case "$stdio_cnt" in
13298 '') stdio_cnt='((fp)->_r)'
13301 *) cnt_lval=$d_stdio_cnt_lval;;
13303 case "$stdio_base" in
13304 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13306 case "$stdio_bufsiz" in
13307 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13309 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13310 echo "(Looks like you have stdio.h from Linux.)"
13311 case "$stdio_ptr" in
13312 '') stdio_ptr='((fp)->_IO_read_ptr)'
13315 *) ptr_lval=$d_stdio_ptr_lval;;
13317 case "$stdio_cnt" in
13318 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13321 *) cnt_lval=$d_stdio_cnt_lval;;
13323 case "$stdio_base" in
13324 '') stdio_base='((fp)->_IO_read_base)';;
13326 case "$stdio_bufsiz" in
13327 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13330 case "$stdio_ptr" in
13331 '') stdio_ptr='((fp)->_ptr)'
13334 *) ptr_lval=$d_stdio_ptr_lval;;
13336 case "$stdio_cnt" in
13337 '') stdio_cnt='((fp)->_cnt)'
13340 *) cnt_lval=$d_stdio_cnt_lval;;
13342 case "$stdio_base" in
13343 '') stdio_base='((fp)->_base)';;
13345 case "$stdio_bufsiz" in
13346 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13350 : test whether _ptr and _cnt really work
13351 echo "Checking how std your stdio is..." >&4
13354 #$i_stdlib I_STDLIB
13356 #include <stdlib.h>
13358 #define FILE_ptr(fp) $stdio_ptr
13359 #define FILE_cnt(fp) $stdio_cnt
13361 FILE *fp = fopen("try.c", "r");
13364 18 <= FILE_cnt(fp) &&
13365 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13373 if eval $compile && $to try.c; then
13374 if $run ./try; then
13375 echo "Your stdio acts pretty std."
13378 echo "Your stdio isn't very std."
13381 echo "Your stdio doesn't appear very std."
13385 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13386 # direct buffer manipulation no longer works. The Configure tests
13387 # should be changed to correctly detect this, but until then,
13388 # the following check should at least let perl compile and run.
13389 # (This quick fix should be updated before 5.8.1.)
13390 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13391 # A. Dougherty, June 3, 2002.
13392 case "$d_gnulibc" in
13394 case "$gnulibc_version" in
13398 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13407 : Can _ptr be used as an lvalue?
13408 case "$d_stdstdio$ptr_lval" in
13409 $define$define) val=$define ;;
13412 set d_stdio_ptr_lval
13415 : Can _cnt be used as an lvalue?
13416 case "$d_stdstdio$cnt_lval" in
13417 $define$define) val=$define ;;
13420 set d_stdio_cnt_lval
13424 : test whether setting _ptr sets _cnt as a side effect
13425 d_stdio_ptr_lval_sets_cnt="$undef"
13426 d_stdio_ptr_lval_nochange_cnt="$undef"
13427 case "$d_stdio_ptr_lval$d_stdstdio" in
13429 echo "Checking to see what happens if we set the stdio ptr..." >&4
13432 /* Can we scream? */
13433 /* Eat dust sed :-) */
13434 /* In the buffer space, no one can hear you scream. */
13435 #$i_stdlib I_STDLIB
13437 #include <stdlib.h>
13439 #define FILE_ptr(fp) $stdio_ptr
13440 #define FILE_cnt(fp) $stdio_cnt
13441 #include <sys/types.h>
13443 FILE *fp = fopen("try.c", "r");
13448 puts("Fail even to read");
13451 c = getc(fp); /* Read away the first # */
13453 puts("Fail even to read");
13457 18 <= FILE_cnt(fp) &&
13458 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13460 puts("Fail even to read");
13463 ptr = (char*) FILE_ptr(fp);
13464 cnt = (size_t)FILE_cnt(fp);
13466 FILE_ptr(fp) += 42;
13468 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13469 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13472 if (FILE_cnt(fp) <= 20) {
13473 printf ("Fail (<20 chars to test)");
13476 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13477 puts("Fail compare");
13480 if (cnt == FILE_cnt(fp)) {
13481 puts("Pass_unchanged");
13484 if (FILE_cnt(fp) == (cnt - 42)) {
13485 puts("Pass_changed");
13488 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13494 if eval $compile && $to try.c; then
13495 case `$run ./try` in
13497 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13498 d_stdio_ptr_lval_sets_cnt="$define" ;;
13500 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13501 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13503 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13505 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13508 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13514 : see if _base is also standard
13516 case "$d_stdstdio" in
13520 #$i_stdlib I_STDLIB
13522 #include <stdlib.h>
13524 #define FILE_base(fp) $stdio_base
13525 #define FILE_bufsiz(fp) $stdio_bufsiz
13527 FILE *fp = fopen("try.c", "r");
13530 19 <= FILE_bufsiz(fp) &&
13531 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13538 if eval $compile && $to try.c; then
13539 if $run ./try; then
13540 echo "And its _base field acts std."
13543 echo "But its _base field isn't std."
13546 echo "However, it seems to be lacking the _base field."
13554 : see if fast_stdio exists
13556 case "$d_stdstdio:$d_stdio_ptr_lval" in
13558 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13560 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13571 : see if fchdir exists
13572 set fchdir d_fchdir
13575 : see if fchmod exists
13576 set fchmod d_fchmod
13579 : see if fchown exists
13580 set fchown d_fchown
13583 : see if this is an fcntl system
13587 : See if fcntl-based locking works.
13590 #$i_stdlib I_STDLIB
13592 #include <stdlib.h>
13594 #include <unistd.h>
13596 #include <signal.h>
13597 $signal_t blech(int x) { exit(3); }
13599 #if defined(F_SETLK) && defined(F_SETLKW)
13600 struct flock flock;
13602 fd = open("try.c", O_RDONLY);
13603 flock.l_type = F_RDLCK;
13604 flock.l_whence = SEEK_SET;
13605 flock.l_start = flock.l_len = 0;
13606 signal(SIGALRM, blech);
13608 retval = fcntl(fd, F_SETLK, &flock);
13610 (retval < 0 ? exit(2) : exit(0));
13616 echo "Checking if fcntl-based file locking works... "
13620 if eval $compile_ok; then
13621 if $run ./try; then
13622 echo "Yes, it seems to work."
13625 echo "Nope, it didn't work."
13630 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13631 *** This is (almost) impossible.
13632 *** If your NFS lock daemons are not feeling well, something like
13633 *** this may happen, please investigate. Cannot continue, aborting.
13641 echo "I'm unable to compile the test program, so I'll assume not."
13646 echo "Nope, since you don't even have fcntl()."
13649 set d_fcntl_can_lock
13653 : check for fd_set items
13656 Checking to see how well your C compiler handles fd_set and friends ...
13659 #$i_stdlib I_STDLIB
13661 #include <stdlib.h>
13663 #$i_systime I_SYS_TIME
13664 #$i_sysselct I_SYS_SELECT
13665 #$d_socket HAS_SOCKET
13666 #include <sys/types.h>
13668 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13671 #include <sys/time.h>
13673 #ifdef I_SYS_SELECT
13674 #include <sys/select.h>
13683 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13691 if eval $compile; then
13692 d_fds_bits="$define"
13694 echo "Well, your system knows about the normal fd_set typedef..." >&4
13695 if $run ./try; then
13696 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13697 d_fd_macros="$define"
13700 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13702 d_fd_macros="$undef"
13706 Hmm, your compiler has some difficulty with fd_set. Checking further...
13709 if eval $compile; then
13710 d_fds_bits="$undef"
13712 echo "Well, your system has some sort of fd_set available..." >&4
13713 if $run ./try; then
13714 echo "and you have the normal fd_set macros." >&4
13715 d_fd_macros="$define"
13718 but not the normal fd_set macros! Gross! More work for me...
13720 d_fd_macros="$undef"
13723 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13725 d_fds_bits="$undef"
13726 d_fd_macros="$undef"
13731 : see if fegetround exists
13732 set fegetround d_fegetround
13735 : see if fgetpos exists
13736 set fgetpos d_fgetpos
13739 : see if finite exists
13740 set finite d_finite
13743 : see if finitel exists
13744 set finitel d_finitel
13747 : see if flock exists
13751 : see if prototype for flock is available
13753 set d_flockproto flock $i_sysfile sys/file.h
13756 : see if fp_class exists
13757 set fp_class d_fp_class
13760 : see if this is a math.h system
13764 : check for fpclassify
13765 echo "Checking to see if you have fpclassify..." >&4
13771 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
13774 if eval $compile; then
13776 echo "You have fpclassify."
13779 echo "You do not have fpclassify."
13785 : see if fp_classify exists
13786 set fp_classify d_fp_classify
13789 : see if fp_classl exists
13790 set fp_classl d_fp_classl
13793 : see if pathconf exists
13794 set pathconf d_pathconf
13797 : see if fpathconf exists
13798 set fpathconf d_fpathconf
13801 : see if fpclass exists
13802 set fpclass d_fpclass
13805 : see if fpclassl exists
13806 set fpclassl d_fpclassl
13809 : see if fpgetround exists
13810 set fpgetround d_fpgetround
13813 : check for fpos64_t
13815 echo "Checking to see if you have fpos64_t..." >&4
13818 int main() { fpos64_t x = 7; }
13821 if eval $compile; then
13823 echo "You have fpos64_t."
13826 echo "You do not have fpos64_t."
13827 case "$fpossize" in
13828 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13835 : see if frexpl exists
13836 set frexpl d_frexpl
13839 : see if this is a sys/param system
13840 set sys/param.h i_sysparam
13843 : see if this is a sys/mount.h system
13844 set sys/mount.h i_sysmount
13847 : Check for fs_data_s
13849 echo "Checking to see if your system supports struct fs_data..." >&4
13850 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13852 case "$d_fs_data_s" in
13853 "$define") echo "Yes, it does." ;;
13854 *) echo "No, it doesn't." ;;
13857 : see if fseeko exists
13858 set fseeko d_fseeko
13860 case "$longsize" in
13861 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13864 : see if fsetpos exists
13865 set fsetpos d_fsetpos
13868 : see if fstatfs exists
13869 set fstatfs d_fstatfs
13872 : see if statvfs exists
13873 set statvfs d_statvfs
13876 : see if fstatvfs exists
13877 set fstatvfs d_fstatvfs
13881 : see if fsync exists
13885 : see if ftello exists
13886 set ftello d_ftello
13888 case "$longsize" in
13889 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13892 : check for a working futimes
13895 echo "Checking if you have a working futimes()" >&4
13898 #include <sys/time.h>
13905 fd = open ("try.c", O_RDWR);
13906 if (-1 == fd) exit (1);
13907 rv = futimes (fd, NULL);
13908 exit (rv == -1 ? errno : 0);
13912 if eval $compile; then
13916 0) echo "Yes, you have" >&4
13917 d_futimes="$define"
13919 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13923 echo "No, it does not (probably harmless)" >&4
13927 : see if ndbm.h is available
13930 : Compatibility location for RedHat 7.1
13931 set gdbm/ndbm.h i_gdbmndbm
13933 : Compatibility location for Debian 4.0
13934 set gdbm-ndbm.h i_gdbm_ndbm
13938 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13939 : see if dbm_open exists
13940 set dbm_open d_dbm_open
13942 case "$d_dbm_open" in
13945 i_gdbmndbm="$undef"
13946 i_gdbm_ndbm="$undef"
13947 echo "We won't be including <ndbm.h>"
13957 ndbm_hdr_protochk='name=$1; hdr=$2;
13958 eval "ihdr=\$""i_$name";
13960 if $test "$ihdr" = "$define"; then
13961 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13962 case "$d_cplusplus" in
13963 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13964 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13967 $define) $echo "Your <$hdr> seems to have prototypes";;
13968 *) $echo "Your <$hdr> does not seem to have prototypes";;
13971 set "d_${name}_h_uses_prototypes";
13975 eval $ndbm_hdr_protochk
13976 set gdbmndbm gdbm/ndbm.h
13977 eval $ndbm_hdr_protochk
13978 set gdbm_ndbm gdbm-ndbm.h
13979 eval $ndbm_hdr_protochk
13981 : see if getaddrinfo exists
13982 set getaddrinfo d_getaddrinfo
13985 : see if getcwd exists
13986 set getcwd d_getcwd
13989 : see if getespwnam exists
13990 set getespwnam d_getespwnam
13993 : see if getfsstat exists
13994 set getfsstat d_getfsstat
13997 : see if getgrent exists
13998 set getgrent d_getgrent
14001 : see if getgrent_r exists
14002 set getgrent_r d_getgrent_r
14004 case "$d_getgrent_r" in
14006 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14007 case "$d_getgrent_r_proto:$usethreads" in
14008 ":define") d_getgrent_r_proto=define
14009 set d_getgrent_r_proto getgrent_r $hdrs
14013 case "$d_getgrent_r_proto" in
14015 case "$getgrent_r_proto" in
14016 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
14017 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
14019 case "$getgrent_r_proto" in
14020 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
14021 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
14023 case "$getgrent_r_proto" in
14024 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
14025 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
14027 case "$getgrent_r_proto" in
14028 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
14029 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
14031 case "$getgrent_r_proto" in
14032 ''|0) try='int getgrent_r(struct group*, char*, int);'
14033 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
14035 case "$getgrent_r_proto" in
14036 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
14037 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
14039 case "$getgrent_r_proto" in
14040 ''|0) d_getgrent_r=undef
14042 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
14043 * ) case "$getgrent_r_proto" in
14044 REENTRANT_PROTO*) ;;
14045 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
14047 echo "Prototype: $try" ;;
14050 *) case "$usethreads" in
14051 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
14058 *) getgrent_r_proto=0
14062 : see if getgrgid_r exists
14063 set getgrgid_r d_getgrgid_r
14065 case "$d_getgrgid_r" in
14067 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14068 case "$d_getgrgid_r_proto:$usethreads" in
14069 ":define") d_getgrgid_r_proto=define
14070 set d_getgrgid_r_proto getgrgid_r $hdrs
14074 case "$d_getgrgid_r_proto" in
14076 case "$getgrgid_r_proto" in
14077 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
14078 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
14080 case "$getgrgid_r_proto" in
14081 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
14082 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
14084 case "$getgrgid_r_proto" in
14085 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
14086 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
14088 case "$getgrgid_r_proto" in
14089 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
14090 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
14092 case "$getgrgid_r_proto" in
14093 ''|0) d_getgrgid_r=undef
14095 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
14096 * ) case "$getgrgid_r_proto" in
14097 REENTRANT_PROTO*) ;;
14098 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
14100 echo "Prototype: $try" ;;
14103 *) case "$usethreads" in
14104 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
14111 *) getgrgid_r_proto=0
14115 : see if getgrnam_r exists
14116 set getgrnam_r d_getgrnam_r
14118 case "$d_getgrnam_r" in
14120 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14121 case "$d_getgrnam_r_proto:$usethreads" in
14122 ":define") d_getgrnam_r_proto=define
14123 set d_getgrnam_r_proto getgrnam_r $hdrs
14127 case "$d_getgrnam_r_proto" in
14129 case "$getgrnam_r_proto" in
14130 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
14131 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
14133 case "$getgrnam_r_proto" in
14134 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
14135 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
14137 case "$getgrnam_r_proto" in
14138 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
14139 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
14141 case "$getgrnam_r_proto" in
14142 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
14143 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
14145 case "$getgrnam_r_proto" in
14146 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
14147 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
14149 case "$getgrnam_r_proto" in
14150 ''|0) d_getgrnam_r=undef
14152 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
14153 * ) case "$getgrnam_r_proto" in
14154 REENTRANT_PROTO*) ;;
14155 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
14157 echo "Prototype: $try" ;;
14160 *) case "$usethreads" in
14161 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
14168 *) getgrnam_r_proto=0
14172 : see if gethostbyaddr exists
14173 set gethostbyaddr d_gethbyaddr
14176 : see if gethostbyname exists
14177 set gethostbyname d_gethbyname
14180 : see if gethostent exists
14181 set gethostent d_gethent
14184 : see how we will look up host name
14187 if set gethostname val -f d_gethname; eval $csym; $val; then
14188 echo 'gethostname() found.' >&4
14189 d_gethname="$define"
14192 if set uname val -f d_uname; eval $csym; $val; then
14195 uname() was found, but you're running xenix, and older versions of xenix
14196 have a broken uname(). If you don't really know whether your xenix is old
14197 enough to have a broken system call, use the default answer.
14202 "$define") dflt=n;;
14204 rp='Is your uname() broken?'
14207 n*) d_uname="$define"; call=uname;;
14210 echo 'uname() found.' >&4
14217 case "$d_gethname" in
14218 '') d_gethname="$undef";;
14221 '') d_uname="$undef";;
14223 case "$d_uname$d_gethname" in
14228 Every now and then someone has a $call() that lies about the hostname
14229 but can't be fixed for political or economic reasons. If you wish, I can
14230 pretend $call() isn't there and maybe compute hostname at run-time
14231 thanks to the '$phostname' command.
14234 rp="Shall I ignore $call() from now on?"
14237 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14240 case "$phostname" in
14241 '') aphostname='';;
14242 *) case "$aphostname" in
14244 *) set X $phostname
14248 file=`./loc $file $file $pth`
14249 aphostname=`echo $file $*`
14254 case "$d_uname$d_gethname" in
14257 case "$phostname" in
14259 echo "There will be no way for $package to get your hostname." >&4;;
14261 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14265 case "$d_phostname" in
14266 '') d_phostname="$undef";;
14269 : see if gethostbyaddr_r exists
14270 set gethostbyaddr_r d_gethostbyaddr_r
14272 case "$d_gethostbyaddr_r" in
14274 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14275 case "$d_gethostbyaddr_r_proto:$usethreads" in
14276 ":define") d_gethostbyaddr_r_proto=define
14277 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14281 case "$d_gethostbyaddr_r_proto" in
14283 case "$gethostbyaddr_r_proto" in
14284 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14285 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14287 case "$gethostbyaddr_r_proto" in
14288 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14289 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14291 case "$gethostbyaddr_r_proto" in
14292 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14293 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14295 case "$gethostbyaddr_r_proto" in
14296 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14297 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14299 case "$gethostbyaddr_r_proto" in
14300 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14301 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14303 case "$gethostbyaddr_r_proto" in
14304 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14305 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14307 case "$gethostbyaddr_r_proto" in
14308 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14309 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14311 case "$gethostbyaddr_r_proto" in
14312 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14313 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14315 case "$gethostbyaddr_r_proto" in
14316 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14317 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14319 case "$gethostbyaddr_r_proto" in
14320 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14321 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14323 case "$gethostbyaddr_r_proto" in
14324 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14325 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14327 case "$gethostbyaddr_r_proto" in
14328 ''|0) d_gethostbyaddr_r=undef
14329 gethostbyaddr_r_proto=0
14330 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14331 * ) case "$gethostbyaddr_r_proto" in
14332 REENTRANT_PROTO*) ;;
14333 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14335 echo "Prototype: $try" ;;
14338 *) case "$usethreads" in
14339 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14341 d_gethostbyaddr_r=undef
14342 gethostbyaddr_r_proto=0
14346 *) gethostbyaddr_r_proto=0
14350 : see if gethostbyname_r exists
14351 set gethostbyname_r d_gethostbyname_r
14353 case "$d_gethostbyname_r" in
14355 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14356 case "$d_gethostbyname_r_proto:$usethreads" in
14357 ":define") d_gethostbyname_r_proto=define
14358 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14362 case "$d_gethostbyname_r_proto" in
14364 case "$gethostbyname_r_proto" in
14365 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14366 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14368 case "$gethostbyname_r_proto" in
14369 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14370 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14372 case "$gethostbyname_r_proto" in
14373 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14374 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14376 case "$gethostbyname_r_proto" in
14377 ''|0) d_gethostbyname_r=undef
14378 gethostbyname_r_proto=0
14379 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14380 * ) case "$gethostbyname_r_proto" in
14381 REENTRANT_PROTO*) ;;
14382 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14384 echo "Prototype: $try" ;;
14387 *) case "$usethreads" in
14388 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14390 d_gethostbyname_r=undef
14391 gethostbyname_r_proto=0
14395 *) gethostbyname_r_proto=0
14399 : see if gethostent_r exists
14400 set gethostent_r d_gethostent_r
14402 case "$d_gethostent_r" in
14404 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14405 case "$d_gethostent_r_proto:$usethreads" in
14406 ":define") d_gethostent_r_proto=define
14407 set d_gethostent_r_proto gethostent_r $hdrs
14411 case "$d_gethostent_r_proto" in
14413 case "$gethostent_r_proto" in
14414 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14415 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14417 case "$gethostent_r_proto" in
14418 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14419 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14421 case "$gethostent_r_proto" in
14422 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14423 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14425 case "$gethostent_r_proto" in
14426 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14427 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14429 case "$gethostent_r_proto" in
14430 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14431 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14433 case "$gethostent_r_proto" in
14434 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14435 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14437 case "$gethostent_r_proto" in
14438 ''|0) d_gethostent_r=undef
14439 gethostent_r_proto=0
14440 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14441 * ) case "$gethostent_r_proto" in
14442 REENTRANT_PROTO*) ;;
14443 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14445 echo "Prototype: $try" ;;
14448 *) case "$usethreads" in
14449 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14451 d_gethostent_r=undef
14452 gethostent_r_proto=0
14456 *) gethostent_r_proto=0
14460 : see if prototypes for various gethostxxx netdb.h functions are available
14462 set d_gethostprotos gethostent $i_netdb netdb.h
14465 : see if getitimer exists
14466 set getitimer d_getitimer
14469 : see if getlogin exists
14470 set getlogin d_getlogin
14473 : see if getlogin_r exists
14474 set getlogin_r d_getlogin_r
14476 case "$d_getlogin_r" in
14478 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14479 case "$d_getlogin_r_proto:$usethreads" in
14480 ":define") d_getlogin_r_proto=define
14481 set d_getlogin_r_proto getlogin_r $hdrs
14485 case "$d_getlogin_r_proto" in
14487 case "$getlogin_r_proto" in
14488 ''|0) try='int getlogin_r(char*, size_t);'
14489 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14491 case "$getlogin_r_proto" in
14492 ''|0) try='int getlogin_r(char*, int);'
14493 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14495 case "$getlogin_r_proto" in
14496 ''|0) try='char* getlogin_r(char*, size_t);'
14497 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14499 case "$getlogin_r_proto" in
14500 ''|0) try='char* getlogin_r(char*, int);'
14501 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14503 case "$getlogin_r_proto" in
14504 ''|0) d_getlogin_r=undef
14506 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14507 * ) case "$getlogin_r_proto" in
14508 REENTRANT_PROTO*) ;;
14509 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14511 echo "Prototype: $try" ;;
14514 *) case "$usethreads" in
14515 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14522 *) getlogin_r_proto=0
14526 : see if getmnt exists
14527 set getmnt d_getmnt
14530 : see if getmntent exists
14531 set getmntent d_getmntent
14534 : see if getnameinfo exists
14535 set getnameinfo d_getnameinfo
14538 : see if getnetbyaddr exists
14539 set getnetbyaddr d_getnbyaddr
14542 : see if getnetbyname exists
14543 set getnetbyname d_getnbyname
14546 : see if getnetent exists
14547 set getnetent d_getnent
14550 : see if getnetbyaddr_r exists
14551 set getnetbyaddr_r d_getnetbyaddr_r
14553 case "$d_getnetbyaddr_r" in
14555 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14556 case "$d_getnetbyaddr_r_proto:$usethreads" in
14557 ":define") d_getnetbyaddr_r_proto=define
14558 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14562 case "$d_getnetbyaddr_r_proto" in
14564 case "$getnetbyaddr_r_proto" in
14565 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14566 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14568 case "$getnetbyaddr_r_proto" in
14569 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14570 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14572 case "$getnetbyaddr_r_proto" in
14573 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14574 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14576 case "$getnetbyaddr_r_proto" in
14577 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14578 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14580 case "$getnetbyaddr_r_proto" in
14581 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14582 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14584 case "$getnetbyaddr_r_proto" in
14585 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14586 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14588 case "$getnetbyaddr_r_proto" in
14589 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14590 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14592 case "$getnetbyaddr_r_proto" in
14593 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14594 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14596 case "$getnetbyaddr_r_proto" in
14597 ''|0) d_getnetbyaddr_r=undef
14598 getnetbyaddr_r_proto=0
14599 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14600 * ) case "$getnetbyaddr_r_proto" in
14601 REENTRANT_PROTO*) ;;
14602 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14604 echo "Prototype: $try" ;;
14607 *) case "$usethreads" in
14608 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14610 d_getnetbyaddr_r=undef
14611 getnetbyaddr_r_proto=0
14615 *) getnetbyaddr_r_proto=0
14619 : see if getnetbyname_r exists
14620 set getnetbyname_r d_getnetbyname_r
14622 case "$d_getnetbyname_r" in
14624 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14625 case "$d_getnetbyname_r_proto:$usethreads" in
14626 ":define") d_getnetbyname_r_proto=define
14627 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14631 case "$d_getnetbyname_r_proto" in
14633 case "$getnetbyname_r_proto" in
14634 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14635 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14637 case "$getnetbyname_r_proto" in
14638 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14639 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14641 case "$getnetbyname_r_proto" in
14642 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14643 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14645 case "$getnetbyname_r_proto" in
14646 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14647 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14649 case "$getnetbyname_r_proto" in
14650 ''|0) d_getnetbyname_r=undef
14651 getnetbyname_r_proto=0
14652 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14653 * ) case "$getnetbyname_r_proto" in
14654 REENTRANT_PROTO*) ;;
14655 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14657 echo "Prototype: $try" ;;
14660 *) case "$usethreads" in
14661 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14663 d_getnetbyname_r=undef
14664 getnetbyname_r_proto=0
14668 *) getnetbyname_r_proto=0
14672 : see if getnetent_r exists
14673 set getnetent_r d_getnetent_r
14675 case "$d_getnetent_r" in
14677 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14678 case "$d_getnetent_r_proto:$usethreads" in
14679 ":define") d_getnetent_r_proto=define
14680 set d_getnetent_r_proto getnetent_r $hdrs
14684 case "$d_getnetent_r_proto" in
14686 case "$getnetent_r_proto" in
14687 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14688 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14690 case "$getnetent_r_proto" in
14691 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14692 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14694 case "$getnetent_r_proto" in
14695 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14696 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14698 case "$getnetent_r_proto" in
14699 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14700 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14702 case "$getnetent_r_proto" in
14703 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14704 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14706 case "$getnetent_r_proto" in
14707 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14708 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14710 case "$getnetent_r_proto" in
14711 ''|0) d_getnetent_r=undef
14712 getnetent_r_proto=0
14713 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14714 * ) case "$getnetent_r_proto" in
14715 REENTRANT_PROTO*) ;;
14716 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14718 echo "Prototype: $try" ;;
14721 *) case "$usethreads" in
14722 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14724 d_getnetent_r=undef
14725 getnetent_r_proto=0
14729 *) getnetent_r_proto=0
14733 : see if prototypes for various getnetxxx netdb.h functions are available
14735 set d_getnetprotos getnetent $i_netdb netdb.h
14738 : see if getpagesize exists
14739 set getpagesize d_getpagsz
14742 : Optional checks for getprotobyname and getprotobynumber
14744 : see if getprotobyname exists
14745 set getprotobyname d_getpbyname
14748 : see if getprotobynumber exists
14749 set getprotobynumber d_getpbynumber
14752 : see if getprotoent exists
14753 set getprotoent d_getpent
14756 : see if getpgid exists
14757 set getpgid d_getpgid
14760 : see if getpgrp2 exists
14761 set getpgrp2 d_getpgrp2
14764 : see if getppid exists
14765 set getppid d_getppid
14768 : see if getpriority exists
14769 set getpriority d_getprior
14772 : see if getprotobyname_r exists
14773 set getprotobyname_r d_getprotobyname_r
14775 case "$d_getprotobyname_r" in
14777 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14778 case "$d_getprotobyname_r_proto:$usethreads" in
14779 ":define") d_getprotobyname_r_proto=define
14780 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14784 case "$d_getprotobyname_r_proto" in
14786 case "$getprotobyname_r_proto" in
14787 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14788 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14790 case "$getprotobyname_r_proto" in
14791 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14792 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14794 case "$getprotobyname_r_proto" in
14795 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14796 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14798 case "$getprotobyname_r_proto" in
14799 ''|0) d_getprotobyname_r=undef
14800 getprotobyname_r_proto=0
14801 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14802 * ) case "$getprotobyname_r_proto" in
14803 REENTRANT_PROTO*) ;;
14804 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14806 echo "Prototype: $try" ;;
14809 *) case "$usethreads" in
14810 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14812 d_getprotobyname_r=undef
14813 getprotobyname_r_proto=0
14817 *) getprotobyname_r_proto=0
14821 : see if getprotobynumber_r exists
14822 set getprotobynumber_r d_getprotobynumber_r
14824 case "$d_getprotobynumber_r" in
14826 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14827 case "$d_getprotobynumber_r_proto:$usethreads" in
14828 ":define") d_getprotobynumber_r_proto=define
14829 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14833 case "$d_getprotobynumber_r_proto" in
14835 case "$getprotobynumber_r_proto" in
14836 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14837 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14839 case "$getprotobynumber_r_proto" in
14840 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14841 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14843 case "$getprotobynumber_r_proto" in
14844 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14845 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14847 case "$getprotobynumber_r_proto" in
14848 ''|0) d_getprotobynumber_r=undef
14849 getprotobynumber_r_proto=0
14850 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14851 * ) case "$getprotobynumber_r_proto" in
14852 REENTRANT_PROTO*) ;;
14853 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14855 echo "Prototype: $try" ;;
14858 *) case "$usethreads" in
14859 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14861 d_getprotobynumber_r=undef
14862 getprotobynumber_r_proto=0
14866 *) getprotobynumber_r_proto=0
14870 : see if getprotoent_r exists
14871 set getprotoent_r d_getprotoent_r
14873 case "$d_getprotoent_r" in
14875 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14876 case "$d_getprotoent_r_proto:$usethreads" in
14877 ":define") d_getprotoent_r_proto=define
14878 set d_getprotoent_r_proto getprotoent_r $hdrs
14882 case "$d_getprotoent_r_proto" in
14884 case "$getprotoent_r_proto" in
14885 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14886 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14888 case "$getprotoent_r_proto" in
14889 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14890 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14892 case "$getprotoent_r_proto" in
14893 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14894 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14896 case "$getprotoent_r_proto" in
14897 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14898 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14900 case "$getprotoent_r_proto" in
14901 ''|0) d_getprotoent_r=undef
14902 getprotoent_r_proto=0
14903 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14904 * ) case "$getprotoent_r_proto" in
14905 REENTRANT_PROTO*) ;;
14906 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14908 echo "Prototype: $try" ;;
14911 *) case "$usethreads" in
14912 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14914 d_getprotoent_r=undef
14915 getprotoent_r_proto=0
14919 *) getprotoent_r_proto=0
14923 : see if prototypes for various getprotoxxx netdb.h functions are available
14925 set d_getprotoprotos getprotoent $i_netdb netdb.h
14928 : see if getprpwnam exists
14929 set getprpwnam d_getprpwnam
14932 : see if getpwent exists
14933 set getpwent d_getpwent
14936 : see if getpwent_r exists
14937 set getpwent_r d_getpwent_r
14939 case "$d_getpwent_r" in
14941 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14942 case "$d_getpwent_r_proto:$usethreads" in
14943 ":define") d_getpwent_r_proto=define
14944 set d_getpwent_r_proto getpwent_r $hdrs
14948 case "$d_getpwent_r_proto" in
14950 case "$getpwent_r_proto" in
14951 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14952 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14954 case "$getpwent_r_proto" in
14955 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14956 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14958 case "$getpwent_r_proto" in
14959 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14960 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14962 case "$getpwent_r_proto" in
14963 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14964 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14966 case "$getpwent_r_proto" in
14967 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14968 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14970 case "$getpwent_r_proto" in
14971 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14972 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14974 case "$getpwent_r_proto" in
14975 ''|0) d_getpwent_r=undef
14977 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14978 * ) case "$getpwent_r_proto" in
14979 REENTRANT_PROTO*) ;;
14980 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14982 echo "Prototype: $try" ;;
14985 *) case "$usethreads" in
14986 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14993 *) getpwent_r_proto=0
14997 : see if getpwnam_r exists
14998 set getpwnam_r d_getpwnam_r
15000 case "$d_getpwnam_r" in
15002 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15003 case "$d_getpwnam_r_proto:$usethreads" in
15004 ":define") d_getpwnam_r_proto=define
15005 set d_getpwnam_r_proto getpwnam_r $hdrs
15009 case "$d_getpwnam_r_proto" in
15011 case "$getpwnam_r_proto" in
15012 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
15013 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
15015 case "$getpwnam_r_proto" in
15016 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
15017 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
15019 case "$getpwnam_r_proto" in
15020 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
15021 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
15023 case "$getpwnam_r_proto" in
15024 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
15025 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
15027 case "$getpwnam_r_proto" in
15028 ''|0) d_getpwnam_r=undef
15030 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
15031 * ) case "$getpwnam_r_proto" in
15032 REENTRANT_PROTO*) ;;
15033 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
15035 echo "Prototype: $try" ;;
15038 *) case "$usethreads" in
15039 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
15046 *) getpwnam_r_proto=0
15050 : see if getpwuid_r exists
15051 set getpwuid_r d_getpwuid_r
15053 case "$d_getpwuid_r" in
15055 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15056 case "$d_getpwuid_r_proto:$usethreads" in
15057 ":define") d_getpwuid_r_proto=define
15058 set d_getpwuid_r_proto getpwuid_r $hdrs
15062 case "$d_getpwuid_r_proto" in
15064 case "$getpwuid_r_proto" in
15065 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
15066 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
15068 case "$getpwuid_r_proto" in
15069 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
15070 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
15072 case "$getpwuid_r_proto" in
15073 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
15074 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
15076 case "$getpwuid_r_proto" in
15077 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
15078 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
15080 case "$getpwuid_r_proto" in
15081 ''|0) d_getpwuid_r=undef
15083 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
15084 * ) case "$getpwuid_r_proto" in
15085 REENTRANT_PROTO*) ;;
15086 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
15088 echo "Prototype: $try" ;;
15091 *) case "$usethreads" in
15092 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
15099 *) getpwuid_r_proto=0
15103 : Optional checks for getsbyname and getsbyport
15105 : see if getservbyname exists
15106 set getservbyname d_getsbyname
15109 : see if getservbyport exists
15110 set getservbyport d_getsbyport
15113 : see if getservent exists
15114 set getservent d_getsent
15117 : see if getservbyname_r exists
15118 set getservbyname_r d_getservbyname_r
15120 case "$d_getservbyname_r" in
15122 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15123 case "$d_getservbyname_r_proto:$usethreads" in
15124 ":define") d_getservbyname_r_proto=define
15125 set d_getservbyname_r_proto getservbyname_r $hdrs
15129 case "$d_getservbyname_r_proto" in
15131 case "$getservbyname_r_proto" in
15132 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
15133 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
15135 case "$getservbyname_r_proto" in
15136 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
15137 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
15139 case "$getservbyname_r_proto" in
15140 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
15141 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
15143 case "$getservbyname_r_proto" in
15144 ''|0) d_getservbyname_r=undef
15145 getservbyname_r_proto=0
15146 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
15147 * ) case "$getservbyname_r_proto" in
15148 REENTRANT_PROTO*) ;;
15149 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
15151 echo "Prototype: $try" ;;
15154 *) case "$usethreads" in
15155 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
15157 d_getservbyname_r=undef
15158 getservbyname_r_proto=0
15162 *) getservbyname_r_proto=0
15166 : see if getservbyport_r exists
15167 set getservbyport_r d_getservbyport_r
15169 case "$d_getservbyport_r" in
15171 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15172 case "$d_getservbyport_r_proto:$usethreads" in
15173 ":define") d_getservbyport_r_proto=define
15174 set d_getservbyport_r_proto getservbyport_r $hdrs
15178 case "$d_getservbyport_r_proto" in
15180 case "$getservbyport_r_proto" in
15181 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
15182 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
15184 case "$getservbyport_r_proto" in
15185 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
15186 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
15188 case "$getservbyport_r_proto" in
15189 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15190 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15192 case "$getservbyport_r_proto" in
15193 ''|0) d_getservbyport_r=undef
15194 getservbyport_r_proto=0
15195 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15196 * ) case "$getservbyport_r_proto" in
15197 REENTRANT_PROTO*) ;;
15198 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15200 echo "Prototype: $try" ;;
15203 *) case "$usethreads" in
15204 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15206 d_getservbyport_r=undef
15207 getservbyport_r_proto=0
15211 *) getservbyport_r_proto=0
15215 : see if getservent_r exists
15216 set getservent_r d_getservent_r
15218 case "$d_getservent_r" in
15220 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15221 case "$d_getservent_r_proto:$usethreads" in
15222 ":define") d_getservent_r_proto=define
15223 set d_getservent_r_proto getservent_r $hdrs
15227 case "$d_getservent_r_proto" in
15229 case "$getservent_r_proto" in
15230 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15231 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15233 case "$getservent_r_proto" in
15234 ''|0) try='int getservent_r(struct servent*, char*, int);'
15235 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15237 case "$getservent_r_proto" in
15238 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15239 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15241 case "$getservent_r_proto" in
15242 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15243 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15245 case "$getservent_r_proto" in
15246 ''|0) d_getservent_r=undef
15247 getservent_r_proto=0
15248 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15249 * ) case "$getservent_r_proto" in
15250 REENTRANT_PROTO*) ;;
15251 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15253 echo "Prototype: $try" ;;
15256 *) case "$usethreads" in
15257 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15259 d_getservent_r=undef
15260 getservent_r_proto=0
15264 *) getservent_r_proto=0
15268 : see if prototypes for various getservxxx netdb.h functions are available
15270 set d_getservprotos getservent $i_netdb netdb.h
15273 : see if getspnam exists
15274 set getspnam d_getspnam
15277 : see if this is a shadow.h system
15278 set shadow.h i_shadow
15281 : see if getspnam_r exists
15282 set getspnam_r d_getspnam_r
15284 case "$d_getspnam_r" in
15286 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15287 case "$d_getspnam_r_proto:$usethreads" in
15288 ":define") d_getspnam_r_proto=define
15289 set d_getspnam_r_proto getspnam_r $hdrs
15293 case "$d_getspnam_r_proto" in
15295 case "$getspnam_r_proto" in
15296 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15297 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15299 case "$getspnam_r_proto" in
15300 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15301 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15303 case "$getspnam_r_proto" in
15304 ''|0) d_getspnam_r=undef
15306 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15307 * ) case "$getspnam_r_proto" in
15308 REENTRANT_PROTO*) ;;
15309 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15311 echo "Prototype: $try" ;;
15314 *) case "$usethreads" in
15315 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15322 *) getspnam_r_proto=0
15326 : see if gettimeofday or ftime exists
15327 set gettimeofday d_gettimeod
15329 case "$d_gettimeod" in
15335 val="$undef"; set d_ftime; eval $setvar
15338 case "$d_gettimeod$d_ftime" in
15341 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15345 : see if gmtime_r exists
15346 set gmtime_r d_gmtime_r
15348 case "$d_gmtime_r" in
15350 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15351 case "$d_gmtime_r_proto:$usethreads" in
15352 ":define") d_gmtime_r_proto=define
15353 set d_gmtime_r_proto gmtime_r $hdrs
15357 case "$d_gmtime_r_proto" in
15359 case "$gmtime_r_proto" in
15360 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15361 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15363 case "$gmtime_r_proto" in
15364 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15365 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15367 case "$gmtime_r_proto" in
15368 ''|0) d_gmtime_r=undef
15370 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15371 * ) case "$gmtime_r_proto" in
15372 REENTRANT_PROTO*) ;;
15373 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15375 echo "Prototype: $try" ;;
15378 *) case "$usethreads" in
15379 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15386 *) gmtime_r_proto=0
15390 : see if hasmntopt exists
15391 set hasmntopt d_hasmntopt
15394 : see if this is a netinet/in.h or sys/in.h system
15395 set netinet/in.h i_niin sys/in.h i_sysin
15398 : see if arpa/inet.h has to be included
15399 set arpa/inet.h i_arpainet
15402 : see if htonl --and friends-- exists
15407 : Maybe they are macros.
15410 $cat >htonl.c <<EOM
15412 #include <sys/types.h>
15413 #$i_niin I_NETINET_IN
15415 #$i_arpainet I_ARPA_INET
15416 #ifdef I_NETINET_IN
15417 #include <netinet/in.h>
15420 #include <sys/in.h>
15423 #include <arpa/inet.h>
15426 printf("Defined as a macro.");
15429 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15430 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15432 echo "But it seems to be defined as a macro." >&4
15440 : see if ilogbl exists
15441 set ilogbl d_ilogbl
15446 if set index val -f; eval $csym; $val; then
15447 if set strchr val -f d_strchr; eval $csym; $val; then
15448 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15451 echo "strchr() found." >&4
15455 echo "index() found." >&4
15460 echo "index() found." >&4
15463 if set strchr val -f d_strchr; eval $csym; $val; then
15466 echo "strchr() found." >&4
15468 echo "No index() or strchr() found!" >&4
15473 set d_strchr; eval $setvar
15475 set d_index; eval $setvar
15477 : check whether inet_aton exists
15478 set inet_aton d_inetaton
15481 : see if inet_ntop exists
15482 set inet_ntop d_inetntop
15485 : see if inet_pton exists
15486 set inet_pton d_inetpton
15491 $cat >isascii.c <<EOCP
15494 #$i_stdlib I_STDLIB
15496 #include <stdlib.h>
15507 if eval $compile; then
15508 echo "isascii() found." >&4
15511 echo "isascii() NOT found." >&4
15520 $cat >isblank.c <<'EOCP'
15531 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15532 echo "isblank() found." >&4
15535 echo "isblank() NOT found." >&4
15542 : check for isfinite
15543 echo "Checking to see if you have isfinite..." >&4
15549 int main() { return isfinite(0.0); }
15552 if eval $compile; then
15554 echo "You have isfinite."
15557 echo "You do not have isfinite."
15563 : see if isfinitel exists
15564 set isfinitel d_isfinitel
15568 echo "Checking to see if you have isinf..." >&4
15574 int main() { return isinf(0.0); }
15577 if eval $compile; then
15579 echo "You have isinf."
15582 echo "You do not have isinf."
15588 : see if isinfl exists
15589 set isinfl d_isinfl
15593 echo "Checking to see if you have isnan..." >&4
15599 int main() { return isnan(0.0); }
15602 if eval $compile; then
15604 echo "You have isnan."
15607 echo "You do not have isnan."
15613 : see if isnanl exists
15614 set isnanl d_isnanl
15621 : see if j0l exists
15625 : see if killpg exists
15626 set killpg d_killpg
15629 : see if lchown exists
15631 $cat > try.c <<'EOCP'
15632 /* System header to define __stub macros and hopefully few prototypes,
15633 which can conflict with char lchown(); below. */
15634 #include <assert.h>
15635 /* Override any gcc2 internal prototype to avoid an error. */
15636 /* We use char because int might match the return type of a gcc2
15637 builtin and then its argument prototype would still apply. */
15640 /* The GNU C library defines this for functions which it implements
15641 to always fail with ENOSYS. Some functions are actually named
15642 something starting with __ and the normal name is an alias. */
15643 #if defined (__stub_lchown) || defined (__stub___lchown)
15651 if eval $compile; then
15652 $echo "lchown() found." >&4
15655 $echo "lchown() NOT found." >&4
15661 : See if number of significant digits in a double precision number is known
15663 $cat >ldbl_dig.c <<EOM
15664 #$i_limits I_LIMITS
15667 #include <limits.h>
15673 printf("Contains LDBL_DIG");
15676 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15677 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15678 echo "LDBL_DIG found." >&4
15681 echo "LDBL_DIG NOT found." >&4
15688 : check to see if math.h defines _LIB_VERSION
15689 d_libm_lib_version="$undef"
15693 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15695 #include <unistd.h>
15697 int main (int argc, char *argv[])
15699 printf ("%d\n", _LIB_VERSION);
15704 if eval $compile; then
15706 echo "Yes, it does ($foo)" >&4
15707 d_libm_lib_version="$define"
15709 echo "No, it does not (probably harmless)" >&4
15716 : check for fpclassify
15718 echo "Checking to see if you have fpclassify..." >&4
15724 int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; }
15727 if eval $compile; then
15729 echo "You have fpclassify."
15732 echo "You do not have fpclassify."
15738 : check for isfinite
15740 echo "Checking to see if you have isfinite..." >&4
15746 int main() { return isfinite(0.0); }
15749 if eval $compile; then
15751 echo "You have isfinite."
15754 echo "You do not have isfinite."
15762 echo "Checking to see if you have isinf..." >&4
15768 int main() { return isinf(0.0); }
15771 if eval $compile; then
15773 echo "You have isinf."
15776 echo "You do not have isinf."
15784 echo "Checking to see if you have isnan..." >&4
15790 int main() { return isnan(0.0); }
15793 if eval $compile; then
15795 echo "You have isnan."
15798 echo "You do not have isnan."
15804 : see if this is a quadmath.h system
15805 set quadmath.h i_quadmath
15808 : see if link exists
15812 : see if localtime_r exists
15813 set localtime_r d_localtime_r
15815 case "$d_localtime_r" in
15817 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15818 case "$d_localtime_r_proto:$usethreads" in
15819 ":define") d_localtime_r_proto=define
15820 set d_localtime_r_proto localtime_r $hdrs
15824 case "$d_localtime_r_proto" in
15826 case "$localtime_r_proto" in
15827 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15828 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15830 case "$localtime_r_proto" in
15831 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15832 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15834 case "$localtime_r_proto" in
15835 ''|0) d_localtime_r=undef
15836 localtime_r_proto=0
15837 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15838 * ) case "$localtime_r_proto" in
15839 REENTRANT_PROTO*) ;;
15840 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15842 echo "Prototype: $try" ;;
15845 *) case "$usethreads" in
15846 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15848 d_localtime_r=undef
15849 localtime_r_proto=0
15853 *) localtime_r_proto=0
15857 : see if localtime_r calls tzset
15858 case "$localtime_r_proto" in
15861 /* Does our libc's localtime_r call tzset ?
15862 * return 0 if so, 1 otherwise.
15864 #$i_systypes I_SYS_TYPES
15865 #$i_unistd I_UNISTD
15867 #$i_stdlib I_STDLIB
15868 #$i_string I_STRING
15869 #$i_malloc I_MALLOC
15871 # include <sys/types.h>
15874 # include <unistd.h>
15880 #include <stdlib.h>
15883 # include <string.h>
15885 # include <strings.h>
15888 # include <malloc.h>
15892 time_t t = time(0L);
15893 char w_tz[]="TZ" "=GMT+5",
15894 e_tz[]="TZ" "=GMT-5",
15895 *tz_e = (char*)malloc(16),
15896 *tz_w = (char*)malloc(16);
15897 struct tm tm_e, tm_w;
15898 memset(&tm_e,'\0',sizeof(struct tm));
15899 memset(&tm_w,'\0',sizeof(struct tm));
15904 localtime_r(&t, &tm_e);
15907 localtime_r(&t, &tm_w);
15909 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15915 if eval $compile; then
15916 if $run ./try; then
15917 d_localtime_r_needs_tzset=undef;
15919 d_localtime_r_needs_tzset=define;
15922 d_localtime_r_needs_tzset=undef;
15926 d_localtime_r_needs_tzset=undef;
15931 : see if localeconv exists
15932 set localeconv d_locconv
15935 : see if libc has the POSIX.1-2008 currency locale rules
15936 case "$d_locconv:$d_lc_monetary_2008" in
15939 #include <locale.h>
15941 struct lconv *lc = localeconv();
15942 char int_p_cs_precedes = lc->int_p_cs_precedes;
15947 if eval $compile; then
15948 d_lc_monetary_2008="$define"
15950 d_lc_monetary_2008="$undef"
15956 : see if lockf exists
15960 : see if prototype for lseek is available
15962 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15965 : see if lstat exists
15969 : see if madvise exists
15970 set madvise d_madvise
15973 : see if malloc_size exists
15974 set malloc_size d_malloc_size
15977 : see if malloc_size_good exists
15978 set malloc_good_size d_malloc_good_size
15981 : see if mblen exists
15985 : see if mbstowcs exists
15986 set mbstowcs d_mbstowcs
15989 : see if mbtowc exists
15990 set mbtowc d_mbtowc
15993 : see if memchr exists
15994 set memchr d_memchr
15997 : see if memcmp exists
15998 set memcmp d_memcmp
16001 : see if memcpy exists
16002 set memcpy d_memcpy
16005 : see if memmove exists
16006 set memmove d_memmove
16009 : see if memset exists
16010 set memset d_memset
16013 : see if mkdir exists
16017 : see if mkdtemp exists
16018 set mkdtemp d_mkdtemp
16021 : see if mkfifo exists
16022 set mkfifo d_mkfifo
16025 : see if mkstemp exists
16026 set mkstemp d_mkstemp
16029 : see if mkstemps exists
16030 set mkstemps d_mkstemps
16033 : see if mktime exists
16034 set mktime d_mktime
16037 : see if this is a sys/mman.h system
16038 set sys/mman.h i_sysmman
16041 : see if mmap exists
16044 : see what shmat returns
16045 : default to something harmless
16047 case "$i_sysmman$d_mmap" in
16049 $cat >mmap.c <<'END'
16050 #include <sys/mman.h>
16053 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
16058 echo "and it returns ($mmaptype)." >&4
16064 : see if sqrtl exists
16068 : see if scalbnl exists
16069 set scalbnl d_scalbnl
16072 : see if truncl exists
16073 set truncl d_truncl
16076 : see if modfl exists
16080 : see if prototype for modfl is available
16082 set d_modflproto modfl $i_math math.h
16085 d_modfl_pow32_bug="$undef"
16087 case "$d_longdbl$d_modfl" in
16090 Checking to see whether your modfl() is okay for large values...
16096 if $test "X$d_modflproto" != "X$define"; then
16097 $cat >>try.c <<EOCP
16098 /* Sigh. many current glibcs provide the function, but do not prototype it. */
16099 long double modfl (long double, long double *);
16102 $cat >>try.c <<EOCP
16104 long double nv = 4294967303.15;
16110 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
16114 case "$osname:$gccversion" in
16115 aix:) saveccflags="$ccflags"
16116 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
16119 if eval $compile; then
16122 *" 4294967303.150000 1.150000 4294967302.000000")
16123 echo >&4 "Your modfl() is broken for large values."
16124 d_modfl_pow32_bug="$define"
16126 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
16130 *" 4294967303.150000 0.150000 4294967303.000000")
16131 echo >&4 "Your modfl() seems okay for large values."
16133 *) echo >&4 "I don't understand your modfl() at all."
16139 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
16142 case "$osname:$gccversion" in
16143 aix:) ccflags="$saveccflags" ;; # restore
16148 if $test "$uselongdouble" = "$define"; then
16150 if $test "$d_sqrtl" != "$define"; then
16151 message="$message sqrtl"
16153 if $test "$d_modfl" != "$define"; then
16154 if $test "$d_truncl:$d_copysignl" = "$define:$define"; then
16155 echo "You have both truncl and copysignl, so I can emulate modfl."
16157 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
16158 echo "You have both aintl and copysignl, so I can emulate modfl."
16160 message="$message modfl"
16164 if $test "$d_frexpl" != "$define"; then
16165 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
16166 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
16168 message="$message frexpl"
16171 if $test "$d_ldexpl" != "$define"; then
16172 message="$message ldexpl"
16175 if $test "$message" != ""; then
16178 *** You requested the use of long doubles but you do not seem to have
16179 *** the following mathematical functions needed for long double support:
16181 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
16182 *** Cannot continue, aborting.
16190 : see if mprotect exists
16191 set mprotect d_mprotect
16194 : see if msgctl exists
16195 set msgctl d_msgctl
16198 : see if msgget exists
16199 set msgget d_msgget
16202 : see if msgsnd exists
16203 set msgsnd d_msgsnd
16206 : see if msgrcv exists
16207 set msgrcv d_msgrcv
16210 : see how much of the 'msg*(2)' library is present.
16213 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
16214 *"$undef"*) h_msg=false;;
16218 case "`ipcs 2>&1`" in
16219 "SVID messages"*"not configured"*)
16220 echo "Your $osname does not have the msg*(2) configured." >&4
16223 set msgctl d_msgctl
16225 set msgget d_msgget
16227 set msgsnd d_msgsnd
16229 set msgrcv d_msgrcv
16235 : we could also check for sys/ipc.h ...
16236 if $h_msg && $test `./findhdr sys/msg.h`; then
16237 echo "You have the full msg*(2) library." >&4
16240 echo "You don't have the full msg*(2) library." >&4
16246 : Check for msghdr_s
16248 echo "Checking to see if your system supports struct msghdr..." >&4
16249 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
16251 case "$d_msghdr_s" in
16252 "$define") echo "Yes, it does." ;;
16253 *) echo "No, it doesn't." ;;
16257 : see if msync exists
16261 : see if munmap exists
16262 set munmap d_munmap
16265 : see if nice exists
16269 : see if this is a langinfo.h system
16270 set langinfo.h i_langinfo
16273 : see if nl_langinfo exists
16274 set nl_langinfo d_nl_langinfo
16277 : check for volatile keyword
16279 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
16280 $cat >try.c <<'EOCP'
16283 typedef struct _goo_struct goo_struct;
16284 goo_struct * volatile goo = ((goo_struct *)0);
16285 struct _goo_struct {
16290 typedef unsigned short foo_t;
16291 char *volatile foo;
16293 volatile foo_t blech;
16297 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
16299 echo "Yup, it does."
16302 echo "Nope, it doesn't."
16308 : Check basic sizes
16310 $echo "Choosing the C types to be used for Perl's internal types..." >&4
16312 case "$use64bitint:$d_quad:$quadtype" in
16315 uvtype="$uquadtype"
16320 uvtype="unsigned long"
16326 case "$uselongdouble:$d_longdbl" in
16328 nvtype="long double"
16329 nvsize=$longdblsize
16336 case "$usequadmath:$i_quadmath" in
16338 nvtype="__float128"
16344 *** You requested the use of the quadmath library, but you
16345 *** do not seem to have the quadmath library installed.
16346 *** Cannot continue, aborting.
16352 define:*) $cat <<EOM >&4
16354 *** You requested the use of the quadmath library, but you
16355 *** do not seem to have the required header, <quadmath.h>.
16357 case "$gccversion" in
16360 *** Your gcc looks a bit old:
16366 *** You are not running a gcc.
16371 *** For the quadmath library you need at least gcc 4.6.
16372 *** Cannot continue, aborting.
16378 $echo "(IV will be "$ivtype", $ivsize bytes)"
16379 $echo "(UV will be "$uvtype", $uvsize bytes)"
16380 $echo "(NV will be "$nvtype", $nvsize bytes)"
16383 #$i_inttypes I_INTTYPES
16385 #include <inttypes.h>
16390 int8_t i = INT8_MAX;
16391 uint8_t u = UINT8_MAX;
16392 printf("int8_t\n");
16395 int16_t i = INT16_MAX;
16396 uint16_t u = UINT16_MAX;
16397 printf("int16_t\n");
16400 int32_t i = INT32_MAX;
16401 uint32_t u = UINT32_MAX;
16402 printf("int32_t\n");
16407 i8type="signed char"
16408 u8type="unsigned char"
16413 '') case "$shortsize" in
16415 u16type="unsigned short"
16423 '') set try -DINT16
16424 if eval $compile; then
16425 case "`$run ./try`" in
16437 '') if $test $shortsize -ge 2; then
16439 u16type="unsigned short"
16447 '') case "$longsize" in
16449 u32type="unsigned long"
16453 *) case "$intsize" in
16455 u32type="unsigned int"
16465 '') set try -DINT32
16466 if eval $compile; then
16467 case "`$run ./try`" in
16479 '') if $test $intsize -ge 4; then
16481 u32type="unsigned int"
16489 '') case "$d_quad:$quadtype" in
16491 i64type="$quadtype"
16492 u64type="$uquadtype"
16500 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16501 : volatile so that the compiler has to store it out to memory.
16502 if test X"$d_volatile" = X"$define"; then
16507 #$i_stdlib I_STDLIB
16509 #include <stdlib.h>
16511 #include <sys/types.h>
16512 #include <signal.h>
16514 $volatile int bletched = 0;
16515 $signal_t blech(int s) { bletched = 1; }
16520 int n = 8 * $uvsize;
16523 signal(SIGFPE, blech);
16526 for (i = 0; i < n; i++) {
16527 u = u << 1 | ($uvtype)1;
16529 if (($uvtype)d != u)
16533 d = ($nvtype)(u - 1);
16534 if (($uvtype)d != (u - 1))
16541 printf("%d\n", ((i == n) ? -n : i));
16547 d_nv_preserves_uv="$undef"
16548 if eval $compile; then
16549 nv_preserves_uv_bits="`$run ./try`"
16551 case "$nv_preserves_uv_bits" in
16553 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16554 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16555 d_nv_preserves_uv="$define"
16557 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16558 d_nv_preserves_uv="$undef" ;;
16559 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16560 nv_preserves_uv_bits="0" ;;
16564 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16565 : volatile so that the compiler has to store it out to memory.
16566 if test X"$d_volatile" = X"$define"; then
16572 typedef $nvtype NV;
16579 while(count < 256) {
16580 $volatile NV up = value + 1.0;
16581 $volatile NV negated = -value;
16582 $volatile NV down = negated - 1.0;
16583 $volatile NV got_up = up - value;
16584 int up_good = got_up == 1.0;
16585 int got_down = down - negated;
16586 int down_good = got_down == -1.0;
16588 if (down_good != up_good) {
16590 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16591 up_good, (double) got_up, down_good, (double) got_down,
16592 count, (double) value);
16599 fputs("256.0", stdout);
16602 fputs("2.0", stdout);
16608 fputs("*", stdout);
16614 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16615 count, (double) value);
16621 nv_overflows_integers_at='0'
16622 if eval $compile; then
16628 The largest integer your NVs can preserve is equal to $xxx
16630 nv_overflows_integers_at="$xxx"
16633 Cannot determine the largest integer value your NVs can hold, unexpected output
16640 Cannot determine the largest integer value your NVs can hold
16647 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16648 : volatile so that the compiler has to store it out to memory.
16649 if test X"$d_volatile" = X"$define"; then
16654 #$i_stdlib I_STDLIB
16656 #include <stdlib.h>
16658 #$i_string I_STRING
16660 # include <string.h>
16662 # include <strings.h>
16664 #include <sys/types.h>
16665 #include <signal.h>
16667 $volatile int bletched = 0;
16668 $signal_t blech(int s) { bletched = 1; }
16671 int checkit($nvtype d, char *where) {
16672 unsigned char *p = (char *)&d;
16673 unsigned char *end = p + sizeof(d);
16683 printf("No - %s: 0x", where);
16685 printf ("%02X", *p++);
16690 int main(int argc, char **argv) {
16693 fail += checkit(d, "0.0");
16695 /* The compiler shouldn't be assuming that bletched is 0 */
16698 fail += checkit(d, "bleched");
16701 signal(SIGFPE, blech);
16704 /* Paranoia - the compiler should have no way of knowing that ANSI says
16705 that argv[argc] will always be NULL. Actually, if it did assume this it
16706 would be buggy, as this is C and main() can be called from elsewhere in
16708 d = argv[argc] ? 1 : 0;
16711 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16714 fail += checkit(d, "ternary");
16716 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16719 printf("No - memset doesn't give 0.0\n");
16720 /* This might just blow up: */
16721 printf("(gives %g)\n", d);
16727 printf("No - something bleched\n");
16732 printf("No - %d fail(s)\n", fail);
16741 d_nv_zero_is_allbits_zero="$undef"
16742 if eval $compile; then
16748 0.0 is represented as all bits zero in memory
16750 d_nv_zero_is_allbits_zero="$define"
16753 0.0 is not represented as all bits zero in memory
16755 d_nv_zero_is_allbits_zero="$undef"
16760 0.0 is not represented as all bits zero in memory
16762 d_nv_zero_is_allbits_zero="$undef"
16768 : check for off64_t
16770 echo "Checking to see if you have off64_t..." >&4
16772 #include <sys/types.h>
16773 #include <unistd.h>
16774 int main() { off64_t x = 7; }
16777 if eval $compile; then
16779 echo "You have off64_t."
16782 echo "You do not have off64_t."
16783 case "$lseeksize" in
16784 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16791 : how to create joinable pthreads
16792 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16794 echo "Checking what constant to use for creating joinable pthreads..." >&4
16795 $cat >try.c <<'EOCP'
16796 #include <pthread.h>
16798 int detachstate = JOINABLE;
16801 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16802 if eval $compile; then
16803 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16804 val="$undef" # Yes, undef.
16805 set d_old_pthread_create_joinable
16808 set old_pthread_create_joinable
16811 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16812 if eval $compile; then
16813 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16815 set d_old_pthread_create_joinable
16817 val=PTHREAD_CREATE_UNDETACHED
16818 set old_pthread_create_joinable
16821 set try -DJOINABLE=__UNDETACHED
16822 if eval $compile; then
16823 echo "You seem to use __UNDETACHED." >&4
16825 set d_old_pthread_create_joinable
16828 set old_pthread_create_joinable
16831 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16833 set d_old_pthread_create_joinable
16836 set old_pthread_create_joinable
16843 d_old_pthread_create_joinable="$undef"
16844 old_pthread_create_joinable=""
16847 : see if pause exists
16851 : see if poll exists
16855 : see if prctl exists
16859 : see if prctl supports PR_SET_NAME
16860 d_prctl_set_name=$undef
16865 #include <unistd.h>
16867 #include <sys/prctl.h>
16869 int main (int argc, char *argv[])
16871 return (prctl (PR_SET_NAME, "Test"));
16875 if eval $compile_ok && $run ./try; then
16876 echo "Your prctl (PR_SET_NAME, ...) works"
16877 d_prctl_set_name=$define
16883 : see if readlink exists
16884 set readlink d_readlink
16887 : Check if exe is symlink to abs path of executing program
16891 case "$d_readlink" in
16893 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
16894 : more tidy to avoid an extra level of symlink
16895 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16896 while test $# -gt 0; do
16899 if $issymlink $try; then
16900 $ls -l $try > reflect
16901 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16902 echo "You have $type-like $try."
16903 procselfexe='"'$try'"'
16905 : This will break out of the loop
16916 : backward compatibility for d_hvfork
16917 if test X$d_hvfork != X; then
16918 d_vfork="$d_hvfork"
16921 : see if there is a vfork
16926 d_pseudofork=$undef
16928 : Ok, but do we want to use it. vfork is reportedly unreliable in
16929 : perl on Solaris 2.x, and probably elsewhere.
16933 case "$usevfork" in
16939 Perl can only use a vfork() that doesn't suffer from strict
16940 restrictions on calling functions or modifying global data in
16941 the child. For example, glibc-2.1 contains such a vfork()
16942 that is unsuitable. If your system provides a proper fork()
16943 call, chances are that you do NOT want perl to use vfork().
16946 rp="Do you still want to use vfork()?"
16951 echo "Ok, we won't use vfork()."
16960 $define) usevfork='true';;
16961 *) usevfork='false';;
16964 : see whether the pthread_atfork exists
16966 #include <pthread.h>
16969 #ifdef PTHREAD_ATFORK
16970 pthread_atfork(NULL,NULL,NULL);
16975 : see if pthread_atfork exists
16976 set try -DPTHREAD_ATFORK
16977 if eval $compile; then
16982 case "$usethreads" in
16985 $define) echo 'pthread_atfork found.' >&4 ;;
16986 *) echo 'pthread_atfork NOT found.' >&4 ;;
16989 set d_pthread_atfork
16992 : see if pthread_attr_setscope exists
16993 set pthread_attr_setscope d_pthread_attr_setscope
16996 : see whether the various POSIXish _yields exist
16998 #include <pthread.h>
17004 #ifdef PTHREAD_YIELD
17007 #ifdef PTHREAD_YIELD_NULL
17008 pthread_yield(NULL);
17014 : see if sched_yield exists
17015 set try -DSCHED_YIELD
17016 if eval $compile; then
17018 sched_yield='sched_yield()'
17022 case "$usethreads" in
17025 $define) echo 'sched_yield() found.' >&4 ;;
17026 *) echo 'sched_yield() NOT found.' >&4 ;;
17032 : see if pthread_yield exists
17033 set try -DPTHREAD_YIELD
17034 if eval $compile; then
17036 case "$sched_yield" in
17037 '') sched_yield='pthread_yield()' ;;
17040 set try -DPTHREAD_YIELD_NULL
17041 if eval $compile; then
17043 case "$sched_yield" in
17044 '') sched_yield='pthread_yield(NULL)' ;;
17050 case "$usethreads" in
17053 $define) echo 'pthread_yield() found.' >&4 ;;
17054 *) echo 'pthread_yield() NOT found.' >&4 ;;
17058 set d_pthread_yield
17060 case "$sched_yield" in
17061 '') sched_yield=undef ;;
17065 : check for ptrdiff_t
17067 echo "Checking to see if you have ptrdiff_t..." >&4
17069 #include <stddef.h>
17070 int main() { ptrdiff_t x = 7; }
17073 if eval $compile; then
17075 echo "You have ptrdiff_t."
17078 echo "You do not have ptrdiff_t."
17084 : see if random_r exists
17085 set random_r d_random_r
17087 case "$d_random_r" in
17089 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17090 case "$d_random_r_proto:$usethreads" in
17091 ":define") d_random_r_proto=define
17092 set d_random_r_proto random_r $hdrs
17096 case "$d_random_r_proto" in
17098 case "$random_r_proto" in
17099 ''|0) try='int random_r(int*, struct random_data*);'
17100 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
17102 case "$random_r_proto" in
17103 ''|0) try='int random_r(long*, struct random_data*);'
17104 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
17106 case "$random_r_proto" in
17107 ''|0) try='int random_r(struct random_data*, int32_t*);'
17108 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
17110 case "$random_r_proto" in
17111 ''|0) d_random_r=undef
17113 echo "Disabling random_r, cannot determine prototype." >&4 ;;
17114 * ) case "$random_r_proto" in
17115 REENTRANT_PROTO*) ;;
17116 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
17118 echo "Prototype: $try" ;;
17121 *) case "$usethreads" in
17122 define) echo "random_r has no prototype, not using it." >&4 ;;
17129 *) random_r_proto=0
17133 : see if readdir and friends exist
17134 set readdir d_readdir
17136 set seekdir d_seekdir
17138 set telldir d_telldir
17140 set rewinddir d_rewinddir
17143 : see if readdir64_r exists
17144 set readdir64_r d_readdir64_r
17146 case "$d_readdir64_r" in
17148 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17149 case "$d_readdir64_r_proto:$usethreads" in
17150 ":define") d_readdir64_r_proto=define
17151 set d_readdir64_r_proto readdir64_r $hdrs
17155 case "$d_readdir64_r_proto" in
17157 case "$readdir64_r_proto" in
17158 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
17159 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
17161 case "$readdir64_r_proto" in
17162 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
17163 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
17165 case "$readdir64_r_proto" in
17166 ''|0) d_readdir64_r=undef
17167 readdir64_r_proto=0
17168 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
17169 * ) case "$readdir64_r_proto" in
17170 REENTRANT_PROTO*) ;;
17171 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
17173 echo "Prototype: $try" ;;
17176 *) case "$usethreads" in
17177 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
17179 d_readdir64_r=undef
17180 readdir64_r_proto=0
17184 *) readdir64_r_proto=0
17188 : see if readdir_r exists
17189 set readdir_r d_readdir_r
17191 case "$d_readdir_r" in
17193 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
17194 case "$d_readdir_r_proto:$usethreads" in
17195 ":define") d_readdir_r_proto=define
17196 set d_readdir_r_proto readdir_r $hdrs
17200 case "$d_readdir_r_proto" in
17202 case "$readdir_r_proto" in
17203 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
17204 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
17206 case "$readdir_r_proto" in
17207 ''|0) try='int readdir_r(DIR*, struct dirent*);'
17208 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
17210 case "$readdir_r_proto" in
17211 ''|0) d_readdir_r=undef
17213 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
17214 * ) case "$readdir_r_proto" in
17215 REENTRANT_PROTO*) ;;
17216 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
17218 echo "Prototype: $try" ;;
17221 *) case "$usethreads" in
17222 define) echo "readdir_r has no prototype, not using it." >&4 ;;
17229 *) readdir_r_proto=0
17233 : see if readv exists
17237 : see if recvmsg exists
17238 set recvmsg d_recvmsg
17241 : see if rename exists
17242 set rename d_rename
17245 : see if rmdir exists
17249 : see if memory.h is available.
17254 : See if it conflicts with string.h
17260 $cppstdin $cppflags $cppminus < $strings > mem.h
17261 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
17263 echo "We won't be including <memory.h>."
17273 : can bcopy handle overlapping blocks?
17276 case "$d_memmove" in
17277 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
17278 *) case "$d_bcopy" in
17280 echo "Checking to see if bcopy() can do overlapping copies..." >&4
17282 #$i_memory I_MEMORY
17283 #$i_stdlib I_STDLIB
17284 #$i_string I_STRING
17285 #$i_unistd I_UNISTD
17287 $cat >>try.c <<'EOCP'
17290 # include <memory.h>
17293 # include <stdlib.h>
17296 # include <string.h>
17298 # include <strings.h>
17301 # include <unistd.h> /* Needed for NetBSD */
17305 char buf[128], abc[128];
17311 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17312 try to store the string in read-only memory. */
17313 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
17315 for (align = 7; align >= 0; align--) {
17316 for (len = 36; len; len--) {
17318 bcopy(abc, b, len);
17319 for (off = 1; off <= len; off++) {
17320 bcopy(b, b+off, len);
17321 bcopy(b+off, b, len);
17322 if (bcmp(b, abc, len))
17331 if eval $compile_ok; then
17332 if $run ./try 2>/dev/null; then
17333 echo "Yes, it can."
17336 echo "It can't, sorry."
17339 echo "(I can't compile the test program, so we'll assume not...)"
17349 : can memcpy handle overlapping blocks?
17352 case "$d_memmove" in
17353 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
17354 *) case "$d_memcpy" in
17356 echo "Checking to see if memcpy() can do overlapping copies..." >&4
17358 #$i_memory I_MEMORY
17359 #$i_stdlib I_STDLIB
17360 #$i_string I_STRING
17361 #$i_unistd I_UNISTD
17363 $cat >>try.c <<'EOCP'
17366 # include <memory.h>
17369 # include <stdlib.h>
17372 # include <string.h>
17374 # include <strings.h>
17377 # include <unistd.h> /* Needed for NetBSD */
17381 char buf[128], abc[128];
17387 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17388 try to store the string in read-only memory. */
17389 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
17391 for (align = 7; align >= 0; align--) {
17392 for (len = 36; len; len--) {
17394 memcpy(b, abc, len);
17395 for (off = 1; off <= len; off++) {
17396 memcpy(b+off, b, len);
17397 memcpy(b, b+off, len);
17398 if (memcmp(b, abc, len))
17407 if eval $compile_ok; then
17408 if $run ./try 2>/dev/null; then
17409 echo "Yes, it can."
17412 echo "It can't, sorry."
17415 echo "(I can't compile the test program, so we'll assume not...)"
17425 : can memcmp be trusted to compare relative magnitude?
17427 case "$d_memcmp" in
17430 echo "Checking if your memcmp() can compare relative magnitude..." >&4
17432 #$i_memory I_MEMORY
17433 #$i_stdlib I_STDLIB
17434 #$i_string I_STRING
17435 #$i_unistd I_UNISTD
17437 $cat >>try.c <<'EOCP'
17440 # include <memory.h>
17443 # include <stdlib.h>
17446 # include <string.h>
17448 # include <strings.h>
17451 # include <unistd.h> /* Needed for NetBSD */
17457 if ((a < b) && memcmp(&a, &b, 1) < 0)
17463 if eval $compile_ok; then
17464 if $run ./try 2>/dev/null; then
17465 echo "Yes, it can."
17468 echo "No, it can't (it uses signed chars)."
17471 echo "(I can't compile the test program, so we'll assume not...)"
17479 : see if prototype for sbrk is available
17481 set d_sbrkproto sbrk $i_unistd unistd.h
17484 : see if select exists
17485 set select d_select
17488 : see if semctl exists
17489 set semctl d_semctl
17492 : see if semget exists
17493 set semget d_semget
17496 : see if semop exists
17500 : see how much of the 'sem*(2)' library is present.
17503 case "$d_semctl$d_semget$d_semop" in
17504 *"$undef"*) h_sem=false;;
17508 case "`ipcs 2>&1`" in
17509 "SVID messages"*"not configured"*)
17510 echo "Your $osname does not have the sem*(2) configured." >&4
17513 set semctl d_semctl
17515 set semget d_semget
17523 : we could also check for sys/ipc.h ...
17524 if $h_sem && $test `./findhdr sys/sem.h`; then
17525 echo "You have the full sem*(2) library." >&4
17528 echo "You don't have the full sem*(2) library." >&4
17534 : see whether sys/sem.h defines union semun
17536 $cat > try.c <<'END'
17537 #include <sys/types.h>
17538 #include <sys/ipc.h>
17539 #include <sys/sem.h>
17540 int main () { union semun semun; semun.buf = 0; }
17543 if eval $compile; then
17544 echo "You have union semun in <sys/sem.h>." >&4
17547 echo "You do not have union semun in <sys/sem.h>." >&4
17554 : see how to do semctl IPC_STAT
17558 $cat > tryh.h <<END
17561 # define S_IRUSR S_IREAD
17562 # define S_IWUSR S_IWRITE
17563 # define S_IXUSR S_IEXEC
17565 # define S_IRUSR 0400
17566 # define S_IWUSR 0200
17567 # define S_IXUSR 0100
17569 # define S_IRGRP (S_IRUSR>>3)
17570 # define S_IWGRP (S_IWUSR>>3)
17571 # define S_IXGRP (S_IXUSR>>3)
17572 # define S_IROTH (S_IRUSR>>6)
17573 # define S_IWOTH (S_IWUSR>>6)
17574 # define S_IXOTH (S_IXUSR>>6)
17577 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17578 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17579 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17582 : see whether semctl IPC_STAT can use union semun
17583 case "$d_semctl_semun" in
17587 #include <sys/types.h>
17588 #include <sys/ipc.h>
17589 #include <sys/sem.h>
17590 #include <sys/stat.h>
17597 #$d_union_semun HAS_UNION_SEMUN
17600 #ifndef HAS_UNION_SEMUN
17603 struct semid_ds *buf;
17604 unsigned short *array;
17610 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17611 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17613 struct semid_ds argbuf;
17616 st = semctl(sem, 0, IPC_STAT, arg);
17620 # endif /* IPC_STAT */
17621 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17623 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17624 # endif /* IPC_RMID */
17625 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17627 #endif /* IPC_PRIVATE && ... */
17628 printf("semget failed: errno = %d\n", errno);
17633 if eval $compile; then
17636 semun) val="$define" ;;
17644 case "$d_semctl_semun" in
17646 echo "You can use union semun for semctl IPC_STAT." >&4
17649 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17654 : see whether semctl IPC_STAT can use struct semid_ds pointer
17655 case "$d_semctl_semid_ds" in
17658 $cat > try.c <<'END'
17659 #include <sys/types.h>
17660 #include <sys/ipc.h>
17661 #include <sys/sem.h>
17662 #include <sys/stat.h>
17670 struct semid_ds arg;
17673 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17674 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17677 st = semctl(sem, 0, IPC_STAT, &arg);
17679 printf("semid_ds\n");
17681 # endif /* IPC_STAT */
17682 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17684 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
17685 # endif /* IPC_RMID */
17686 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17688 #endif /* IPC_PRIVATE && ... */
17689 printf("semget failed: errno = %d\n", errno);
17695 if eval $compile; then
17698 semid_ds) val="$define" ;;
17702 set d_semctl_semid_ds
17706 case "$d_semctl_semid_ds" in
17708 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17710 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17716 # We do not have the full sem*(2) library, so assume we can not
17722 set d_semctl_semid_ds
17728 : see if sendmsg exists
17729 set sendmsg d_sendmsg
17732 : see if setegid exists
17733 set setegid d_setegid
17736 : see if seteuid exists
17737 set seteuid d_seteuid
17740 : see if setgrent exists
17741 set setgrent d_setgrent
17744 : see if setgrent_r exists
17745 set setgrent_r d_setgrent_r
17747 case "$d_setgrent_r" in
17749 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17750 case "$d_setgrent_r_proto:$usethreads" in
17751 ":define") d_setgrent_r_proto=define
17752 set d_setgrent_r_proto setgrent_r $hdrs
17756 case "$d_setgrent_r_proto" in
17758 case "$setgrent_r_proto" in
17759 ''|0) try='int setgrent_r(FILE**);'
17760 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17762 case "$setgrent_r_proto" in
17763 ''|0) try='void setgrent_r(FILE**);'
17764 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17766 case "$setgrent_r_proto" in
17767 ''|0) d_setgrent_r=undef
17769 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17770 * ) case "$setgrent_r_proto" in
17771 REENTRANT_PROTO*) ;;
17772 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17774 echo "Prototype: $try" ;;
17777 *) case "$usethreads" in
17778 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17785 *) setgrent_r_proto=0
17789 : see if sethostent exists
17790 set sethostent d_sethent
17793 : see if sethostent_r exists
17794 set sethostent_r d_sethostent_r
17796 case "$d_sethostent_r" in
17798 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17799 case "$d_sethostent_r_proto:$usethreads" in
17800 ":define") d_sethostent_r_proto=define
17801 set d_sethostent_r_proto sethostent_r $hdrs
17805 case "$d_sethostent_r_proto" in
17807 case "$sethostent_r_proto" in
17808 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17809 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17811 case "$sethostent_r_proto" in
17812 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17813 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17815 case "$sethostent_r_proto" in
17816 ''|0) d_sethostent_r=undef
17817 sethostent_r_proto=0
17818 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17819 * ) case "$sethostent_r_proto" in
17820 REENTRANT_PROTO*) ;;
17821 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17823 echo "Prototype: $try" ;;
17826 *) case "$usethreads" in
17827 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17829 d_sethostent_r=undef
17830 sethostent_r_proto=0
17834 *) sethostent_r_proto=0
17838 : see if setitimer exists
17839 set setitimer d_setitimer
17842 : see if setlinebuf exists
17843 set setlinebuf d_setlinebuf
17846 : see if setlocale exists
17847 set setlocale d_setlocale
17850 : see if locale.h is available
17851 set locale.h i_locale
17854 : see if setlocale_r exists
17855 set setlocale_r d_setlocale_r
17857 case "$d_setlocale_r" in
17859 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17860 case "$d_setlocale_r_proto:$usethreads" in
17861 ":define") d_setlocale_r_proto=define
17862 set d_setlocale_r_proto setlocale_r $hdrs
17866 case "$d_setlocale_r_proto" in
17868 case "$setlocale_r_proto" in
17869 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17870 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17872 case "$setlocale_r_proto" in
17873 ''|0) d_setlocale_r=undef
17874 setlocale_r_proto=0
17875 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17876 * ) case "$setlocale_r_proto" in
17877 REENTRANT_PROTO*) ;;
17878 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17880 echo "Prototype: $try" ;;
17883 *) case "$usethreads" in
17884 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17886 d_setlocale_r=undef
17887 setlocale_r_proto=0
17891 *) setlocale_r_proto=0
17895 : see if setnetent exists
17896 set setnetent d_setnent
17899 : see if setnetent_r exists
17900 set setnetent_r d_setnetent_r
17902 case "$d_setnetent_r" in
17904 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17905 case "$d_setnetent_r_proto:$usethreads" in
17906 ":define") d_setnetent_r_proto=define
17907 set d_setnetent_r_proto setnetent_r $hdrs
17911 case "$d_setnetent_r_proto" in
17913 case "$setnetent_r_proto" in
17914 ''|0) try='int setnetent_r(int, struct netent_data*);'
17915 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17917 case "$setnetent_r_proto" in
17918 ''|0) try='void setnetent_r(int, struct netent_data*);'
17919 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17921 case "$setnetent_r_proto" in
17922 ''|0) d_setnetent_r=undef
17923 setnetent_r_proto=0
17924 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17925 * ) case "$setnetent_r_proto" in
17926 REENTRANT_PROTO*) ;;
17927 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17929 echo "Prototype: $try" ;;
17932 *) case "$usethreads" in
17933 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17935 d_setnetent_r=undef
17936 setnetent_r_proto=0
17940 *) setnetent_r_proto=0
17944 : see if setprotoent exists
17945 set setprotoent d_setpent
17948 : see if setpgid exists
17949 set setpgid d_setpgid
17952 : see if setpgrp2 exists
17953 set setpgrp2 d_setpgrp2
17956 : see if setpriority exists
17957 set setpriority d_setprior
17960 : see if setproctitle exists
17961 set setproctitle d_setproctitle
17964 : see if setprotoent_r exists
17965 set setprotoent_r d_setprotoent_r
17967 case "$d_setprotoent_r" in
17969 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17970 case "$d_setprotoent_r_proto:$usethreads" in
17971 ":define") d_setprotoent_r_proto=define
17972 set d_setprotoent_r_proto setprotoent_r $hdrs
17976 case "$d_setprotoent_r_proto" in
17978 case "$setprotoent_r_proto" in
17979 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17980 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17982 case "$setprotoent_r_proto" in
17983 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17984 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17986 case "$setprotoent_r_proto" in
17987 ''|0) d_setprotoent_r=undef
17988 setprotoent_r_proto=0
17989 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17990 * ) case "$setprotoent_r_proto" in
17991 REENTRANT_PROTO*) ;;
17992 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17994 echo "Prototype: $try" ;;
17997 *) case "$usethreads" in
17998 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
18000 d_setprotoent_r=undef
18001 setprotoent_r_proto=0
18005 *) setprotoent_r_proto=0
18009 : see if setpwent exists
18010 set setpwent d_setpwent
18013 : see if setpwent_r exists
18014 set setpwent_r d_setpwent_r
18016 case "$d_setpwent_r" in
18018 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
18019 case "$d_setpwent_r_proto:$usethreads" in
18020 ":define") d_setpwent_r_proto=define
18021 set d_setpwent_r_proto setpwent_r $hdrs
18025 case "$d_setpwent_r_proto" in
18027 case "$setpwent_r_proto" in
18028 ''|0) try='int setpwent_r(FILE**);'
18029 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
18031 case "$setpwent_r_proto" in
18032 ''|0) try='void setpwent_r(FILE**);'
18033 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
18035 case "$setpwent_r_proto" in
18036 ''|0) d_setpwent_r=undef
18038 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
18039 * ) case "$setpwent_r_proto" in
18040 REENTRANT_PROTO*) ;;
18041 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
18043 echo "Prototype: $try" ;;
18046 *) case "$usethreads" in
18047 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
18054 *) setpwent_r_proto=0
18058 : see if setregid exists
18059 set setregid d_setregid
18061 set setresgid d_setresgid
18064 : see if setreuid exists
18065 set setreuid d_setreuid
18067 set setresuid d_setresuid
18070 : see if setrgid exists
18071 set setrgid d_setrgid
18074 : see if setruid exists
18075 set setruid d_setruid
18078 : see if setservent exists
18079 set setservent d_setsent
18082 : see if setservent_r exists
18083 set setservent_r d_setservent_r
18085 case "$d_setservent_r" in
18087 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
18088 case "$d_setservent_r_proto:$usethreads" in
18089 ":define") d_setservent_r_proto=define
18090 set d_setservent_r_proto setservent_r $hdrs
18094 case "$d_setservent_r_proto" in
18096 case "$setservent_r_proto" in
18097 ''|0) try='int setservent_r(int, struct servent_data*);'
18098 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
18100 case "$setservent_r_proto" in
18101 ''|0) try='void setservent_r(int, struct servent_data*);'
18102 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
18104 case "$setservent_r_proto" in
18105 ''|0) d_setservent_r=undef
18106 setservent_r_proto=0
18107 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
18108 * ) case "$setservent_r_proto" in
18109 REENTRANT_PROTO*) ;;
18110 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
18112 echo "Prototype: $try" ;;
18115 *) case "$usethreads" in
18116 define) echo "setservent_r has no prototype, not using it." >&4 ;;
18118 d_setservent_r=undef
18119 setservent_r_proto=0
18123 *) setservent_r_proto=0
18127 : see if setsid exists
18128 set setsid d_setsid
18131 : see if setvbuf exists
18132 set setvbuf d_setvbuf
18135 : see if shmctl exists
18136 set shmctl d_shmctl
18139 : see if shmget exists
18140 set shmget d_shmget
18143 : see if shmat exists
18146 : see what shmat returns
18149 $cat >shmat.c <<'END'
18150 #include <sys/shm.h>
18153 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
18158 echo "and it returns ($shmattype)." >&4
18159 : see if a prototype for shmat is available
18160 xxx=`./findhdr sys/shm.h`
18161 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
18162 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
18173 set d_shmatprototype
18176 : see if shmdt exists
18180 : see how much of the 'shm*(2)' library is present.
18183 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
18184 *"$undef"*) h_shm=false;;
18188 case "`ipcs 2>&1`" in
18189 "SVID shared memory"*"not configured"*)
18190 echo "Your $osname does not have the shm*(2) configured." >&4
18193 set shmctl d_shmctl
18195 set shmget d_shmget
18205 : we could also check for sys/ipc.h ...
18206 if $h_shm && $test `./findhdr sys/shm.h`; then
18207 echo "You have the full shm*(2) library." >&4
18210 echo "You don't have the full shm*(2) library." >&4
18216 : see if we have sigaction
18218 if set sigaction val -f d_sigaction; eval $csym; $val; then
18219 echo 'sigaction() found.' >&4
18222 #include <sys/types.h>
18223 #include <signal.h>
18224 #$i_stdlib I_STDLIB
18226 #include <stdlib.h>
18230 struct sigaction act, oact;
18232 oact.sa_handler = 0;
18233 /* so that act and oact are used */
18234 exit(act.sa_flags == 0 && oact.sa_handler == 0);
18238 if eval $compile_ok; then
18241 echo "But you don't seem to have a usable struct sigaction." >&4
18245 echo 'sigaction NOT found.' >&4
18248 set d_sigaction; eval $setvar
18251 : see if this is a sunmath.h system
18252 set sunmath.h i_sunmath
18255 : see if signbit exists
18256 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
18259 #$i_sunmath I_SUNMATH
18263 #ifdef I_SUNMATH /* Solaris special math library */
18264 # include <sunmath.h>
18267 int main(int argc, char **argv)
18271 if ((signbit(x) == 0) && (signbit(y) != 0))
18279 if eval $compile; then
18280 if $run ./try; then
18284 $echo "Signbit seems to be available, but doesn't work as I expected."
18285 $echo "I won't use it." >&4
18296 : see if sigprocmask exists
18297 set sigprocmask d_sigprocmask
18300 : see if sigsetjmp exists
18302 case "$d_sigsetjmp" in
18305 #include <setjmp.h>
18306 #$i_stdlib I_STDLIB
18308 #include <stdlib.h>
18314 if (sigsetjmp(env,1))
18317 siglongjmp(env, 1);
18322 if eval $compile; then
18323 if $run ./try >/dev/null 2>&1; then
18324 echo "POSIX sigsetjmp found." >&4
18328 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18334 echo "sigsetjmp not found." >&4
18338 *) val="$d_sigsetjmp"
18339 case "$d_sigsetjmp" in
18340 $define) echo "POSIX sigsetjmp found." >&4;;
18341 $undef) echo "sigsetjmp not found." >&4;;
18349 : see if snprintf exists
18350 set snprintf d_snprintf
18353 : see if vsnprintf exists
18354 set vsnprintf d_vsnprintf
18357 case "$d_snprintf-$d_vsnprintf" in
18360 Checking whether your snprintf() and vsnprintf() work okay...
18362 $cat >try.c <<'EOCP'
18363 /* v?snprintf testing logic courtesy of Russ Allbery.
18364 * According to C99:
18365 * - if the buffer is too short it still must be \0-terminated
18366 * - if the buffer is too short the potentially required length
18367 * must be returned and not -1
18368 * - if the buffer is NULL the potentially required length
18369 * must be returned and not -1 or core dump
18372 #include <stdarg.h>
18376 int test (char *format, ...)
18381 va_start (args, format);
18382 count = vsnprintf (buf, sizeof buf, format, args);
18389 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18390 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18394 if eval $compile; then
18397 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18399 Your snprintf() and snprintf() don't seem to be working okay.
18401 d_snprintf="$undef"
18402 d_vsnprintf="$undef"
18406 echo "(I can't seem to compile the test program--assuming they don't)"
18407 d_snprintf="$undef"
18408 d_vsnprintf="$undef"
18414 : see if sockatmark exists
18415 set sockatmark d_sockatmark
18418 : see if prototype for sockatmark is available
18420 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18423 : see if socks5_init exists
18424 set socks5_init d_socks5_init
18427 : see if sprintf returns the length of the string in the buffer as per ANSI
18428 $echo "Checking whether sprintf returns the length of the string..." >&4
18431 #$i_stdlib I_STDLIB
18433 #include <stdlib.h>
18435 #$i_string I_STRING
18437 # include <string.h>
18439 # include <strings.h>
18448 int check (size_t expect, int test) {
18449 size_t got = strlen(buffer);
18453 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
18458 int main(int argc, char **argv) {
18461 check(sprintf(buffer, ""), ++test);
18462 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
18463 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
18470 if eval $compile; then
18474 sprintf returns the length of the string (as ANSI says it should)
18476 d_sprintf_returns_strlen="$define"
18479 sprintf does not return the length of the string (how old is this system?)
18481 d_sprintf_returns_strlen="$undef"
18485 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
18486 d_sprintf_returns_strlen="$undef"
18490 : see if srand48_r exists
18491 set srand48_r d_srand48_r
18493 case "$d_srand48_r" in
18495 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18496 case "$d_srand48_r_proto:$usethreads" in
18497 ":define") d_srand48_r_proto=define
18498 set d_srand48_r_proto srand48_r $hdrs
18502 case "$d_srand48_r_proto" in
18504 case "$srand48_r_proto" in
18505 ''|0) try='int srand48_r(long, struct drand48_data*);'
18506 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18508 case "$srand48_r_proto" in
18509 ''|0) d_srand48_r=undef
18511 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18512 * ) case "$srand48_r_proto" in
18513 REENTRANT_PROTO*) ;;
18514 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18516 echo "Prototype: $try" ;;
18519 *) case "$usethreads" in
18520 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18527 *) srand48_r_proto=0
18531 : see if srandom_r exists
18532 set srandom_r d_srandom_r
18534 case "$d_srandom_r" in
18536 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18537 case "$d_srandom_r_proto:$usethreads" in
18538 ":define") d_srandom_r_proto=define
18539 set d_srandom_r_proto srandom_r $hdrs
18543 case "$d_srandom_r_proto" in
18545 case "$srandom_r_proto" in
18546 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18547 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18549 case "$srandom_r_proto" in
18550 ''|0) d_srandom_r=undef
18552 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18553 * ) case "$srandom_r_proto" in
18554 REENTRANT_PROTO*) ;;
18555 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18557 echo "Prototype: $try" ;;
18560 *) case "$usethreads" in
18561 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18568 *) srandom_r_proto=0
18572 : see if prototype for setresgid is available
18574 set d_sresgproto setresgid $i_unistd unistd.h
18577 : see if prototype for setresuid is available
18579 set d_sresuproto setresuid $i_unistd unistd.h
18582 : see if sys/stat.h is available
18583 set sys/stat.h i_sysstat
18586 : see if stat knows about block sizes
18588 echo "Checking to see if your struct stat has st_blocks field..." >&4
18589 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18592 : see if this is a sys/vfs.h system
18593 set sys/vfs.h i_sysvfs
18596 : see if this is a sys/statfs.h system
18597 set sys/statfs.h i_sysstatfs
18600 : Check for statfs_s
18602 echo "Checking to see if your system supports struct statfs..." >&4
18603 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
18605 case "$d_statfs_s" in
18606 "$define") echo "Yes, it does." ;;
18607 *) echo "No, it doesn't." ;;
18611 : see if struct statfs knows about f_flags
18612 case "$d_statfs_s" in
18615 echo "Checking to see if your struct statfs has f_flags field..." >&4
18616 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
18620 set d_statfs_f_flags
18624 case "$d_statfs_f_flags" in
18625 "$define") echo "Yes, it does." ;;
18626 *) echo "No, it doesn't." ;;
18629 : see what flavor, if any, of static inline is supported
18631 echo "Checking to see if your system supports static inline..."
18632 $cat > try.c <<'EOCP'
18633 #include <stdlib.h>
18634 extern int f_via_a(int x);
18635 extern int f_via_b(int x);
18636 int main(int argc, char **argv)
18645 return EXIT_SUCCESS;
18648 return EXIT_FAILURE;
18652 $cat > a.c <<'EOCP'
18653 static INLINE int f(int x) {
18664 $cat > b.c <<'EOCP'
18665 extern int f(int x);
18673 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18674 case "$perl_static_inline" in
18675 '') # Check the various possibilities, and break out on success.
18676 # For gcc, prefer __inline__, which will still permit
18677 # cflags.SH to add in -ansi.
18678 case "$gccversion" in
18679 '') xxx="inline __inline__ __inline _inline";;
18680 *) xxx="__inline__ inline __inline _inline";;
18682 for inline in $xxx; do
18683 set try -DINLINE=$inline a.c
18684 if eval $compile && $run ./try; then
18685 # Now make sure there is no external linkage of static
18687 set try -DINLINE=$inline -DUSE_B a.c b.c
18688 if eval $compile && $run ./try; then
18689 $echo "Your compiler supports static $inline, " >&4
18690 $echo "but it also creates an external definition," >&4
18691 $echo "so I won't use it." >&4
18694 $echo "Your compiler supports static $inline." >&4
18696 perl_static_inline="static $inline";
18700 $echo "Your compiler does NOT support static $inline." >&4
18705 *inline*) # Some variant of inline exists.
18706 echo "Keeping your $hint value of $perl_static_inline."
18709 static) # No inline capabilities
18710 echo "Keeping your $hint value of $perl_static_inline."
18713 *) # Unrecognized previous value -- blindly trust the supplied
18714 # value and hope it makes sense. Use old value for
18715 # d_static_inline, if there is one.
18716 echo "Keeping your $hint value of $perl_static_inline."
18717 case "$d_static_inline" in
18719 *) val=$d_static_inline ;;
18723 # Fallback to plain 'static' if nothing worked.
18724 case "$perl_static_inline" in
18726 perl_static_inline="static"
18730 set d_static_inline
18732 $rm -f a.[co] b.[co]
18735 : Check stream access
18737 Checking how to access stdio streams by file descriptor number...
18739 case "$stdio_stream_array" in
18740 '') $cat >try.c <<EOCP
18743 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18747 for s in _iob __iob __sF
18749 set try -DSTDIO_STREAM_ARRAY=$s
18750 if eval $compile; then
18751 case "`$run ./try`" in
18752 yes) stdio_stream_array=$s; break ;;
18758 case "$stdio_stream_array" in
18760 I can't figure out how to access stdio streams by file descriptor number.
18762 d_stdio_stream_array="$undef"
18765 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18767 d_stdio_stream_array="$define"
18771 : see if strcoll exists
18772 set strcoll d_strcoll
18775 : check for structure copying
18777 echo "Checking to see if your C compiler can copy structs..." >&4
18778 $cat >try.c <<'EOCP'
18788 if $cc -c try.c >/dev/null 2>&1 ; then
18790 echo "Yup, it can."
18793 echo "Nope, it can't."
18799 : see if strerror and/or sys_errlist[] exist
18801 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18802 if set strerror val -f d_strerror; eval $csym; $val; then
18803 echo 'strerror() found.' >&4
18804 d_strerror="$define"
18805 d_strerrm='strerror(e)'
18806 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18807 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18808 d_syserrlst="$define"
18810 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
18811 d_syserrlst="$undef"
18813 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18814 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18815 echo 'strerror() found in string header.' >&4
18816 d_strerror="$define"
18817 d_strerrm='strerror(e)'
18818 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18819 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18820 d_syserrlst="$define"
18822 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18823 d_syserrlst="$undef"
18825 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18826 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18827 d_strerror="$undef"
18828 d_syserrlst="$define"
18829 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18831 echo 'strerror() and sys_errlist[] NOT found.' >&4
18832 d_strerror="$undef"
18833 d_syserrlst="$undef"
18834 d_strerrm='"unknown"'
18838 : see if strerror_r exists
18839 set strerror_r d_strerror_r
18841 case "$d_strerror_r" in
18843 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18844 case "$d_strerror_r_proto:$usethreads" in
18845 ":define") d_strerror_r_proto=define
18846 set d_strerror_r_proto strerror_r $hdrs
18850 case "$d_strerror_r_proto" in
18852 case "$strerror_r_proto" in
18853 ''|0) try='int strerror_r(int, char*, size_t);'
18854 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18856 case "$strerror_r_proto" in
18857 ''|0) try='int strerror_r(int, char*, int);'
18858 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18860 case "$strerror_r_proto" in
18861 ''|0) try='char* strerror_r(int, char*, size_t);'
18862 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18864 case "$strerror_r_proto" in
18865 ''|0) d_strerror_r=undef
18867 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18868 * ) case "$strerror_r_proto" in
18869 REENTRANT_PROTO*) ;;
18870 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18872 echo "Prototype: $try" ;;
18875 *) case "$usethreads" in
18876 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18883 *) strerror_r_proto=0
18887 : see if strftime exists
18888 set strftime d_strftime
18891 : see if strlcat exists
18892 set strlcat d_strlcat
18895 : see if strlcpy exists
18896 set strlcpy d_strlcpy
18899 : see if strtod exists
18900 set strtod d_strtod
18903 : see if strtol exists
18904 set strtol d_strtol
18907 : see if strtold exists
18908 set strtold d_strtold
18911 : see if strtoll exists
18912 set strtoll d_strtoll
18915 case "$d_longlong-$d_strtoll" in
18918 Checking whether your strtoll() works okay...
18920 $cat >try.c <<'EOCP'
18923 #define strtoll __strtoll
18926 #define strtoll _strtoll
18929 extern long long int strtoll(char *s, char **, int);
18930 static int bad = 0;
18931 int check(char *s, long long ell, int een) {
18934 gll = strtoll(s, 0, 10);
18935 if (!((gll == ell) && (errno == een)))
18939 check(" 1", 1LL, 0);
18940 check(" 0", 0LL, 0);
18941 check("-1", -1LL, 0);
18942 check("-9223372036854775808", -9223372036854775808LL, 0);
18943 check("-9223372036854775808", -9223372036854775808LL, 0);
18944 check(" 9223372036854775807", 9223372036854775807LL, 0);
18945 check("-9223372036854775808", -9223372036854775808LL, 0);
18946 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18947 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18953 if eval $compile; then
18956 ok) echo "Your strtoll() seems to be working okay." ;;
18958 Your strtoll() doesn't seem to be working okay.
18964 echo "(I can't seem to compile the test program--assuming it doesn't)"
18970 : see if strtoq exists
18971 set strtoq d_strtoq
18974 : see if strtoul exists
18975 set strtoul d_strtoul
18978 case "$d_strtoul" in
18981 Checking whether your strtoul() works okay...
18983 $cat >try.c <<'EOCP'
18986 extern unsigned long int strtoul(char *s, char **, int);
18987 static int bad = 0;
18988 void check(char *s, unsigned long eul, int een) {
18991 gul = strtoul(s, 0, 10);
18992 if (!((gul == eul) && (errno == een)))
18996 check(" 1", 1L, 0);
18997 check(" 0", 0L, 0);
18999 case "$longsize" in
19001 $cat >>try.c <<'EOCP'
19002 check("18446744073709551615", 18446744073709551615UL, 0);
19003 check("18446744073709551616", 18446744073709551615UL, ERANGE);
19004 #if 0 /* strtoul() for /^-/ strings is undefined. */
19005 check("-1", 18446744073709551615UL, 0);
19006 check("-18446744073709551614", 2, 0);
19007 check("-18446744073709551615", 1, 0);
19008 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
19009 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
19014 $cat >>try.c <<'EOCP'
19015 check("4294967295", 4294967295UL, 0);
19016 check("4294967296", 4294967295UL, ERANGE);
19017 #if 0 /* strtoul() for /^-/ strings is undefined. */
19018 check("-1", 4294967295UL, 0);
19019 check("-4294967294", 2, 0);
19020 check("-4294967295", 1, 0);
19021 check("-4294967296", 4294967295UL, ERANGE);
19022 check("-4294967297", 4294967295UL, ERANGE);
19027 : Should we write these tests to be more portable by sprintf-ing
19028 : ~0 and then manipulating that char string as input for strtol?
19031 $cat >>try.c <<'EOCP'
19038 if eval $compile; then
19039 case "`$run ./try`" in
19040 ok) echo "Your strtoul() seems to be working okay." ;;
19042 Your strtoul() doesn't seem to be working okay.
19048 echo "(I can't seem to compile the test program--assuming it doesn't)"
19054 : see if strtoull exists
19055 set strtoull d_strtoull
19058 case "$d_longlong-$d_strtoull" in
19061 Checking whether your strtoull() works okay...
19063 $cat >try.c <<'EOCP'
19066 #define strtoull __strtoull
19069 extern unsigned long long int strtoull(char *s, char **, int);
19070 static int bad = 0;
19071 int check(char *s, long long eull, int een) {
19074 gull = strtoull(s, 0, 10);
19075 if (!((gull == eull) && (errno == een)))
19079 check(" 1", 1LL, 0);
19080 check(" 0", 0LL, 0);
19081 check("18446744073709551615", 18446744073709551615ULL, 0);
19082 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19083 #if 0 /* strtoull() for /^-/ strings is undefined. */
19084 check("-1", 18446744073709551615ULL, 0);
19085 check("-18446744073709551614", 2LL, 0);
19086 check("-18446744073709551615", 1LL, 0);
19087 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19088 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19095 if eval $compile; then
19096 case "`$run ./try`" in
19097 ok) echo "Your strtoull() seems to be working okay." ;;
19099 Your strtoull() doesn't seem to be working okay.
19101 d_strtoull="$undef"
19105 echo "(I can't seem to compile the test program--assuming it doesn't)"
19106 d_strtoull="$undef"
19111 : see if strtouq exists
19112 set strtouq d_strtouq
19115 case "$d_strtouq" in
19118 Checking whether your strtouq() works okay...
19120 $cat >try.c <<'EOCP'
19123 extern unsigned long long int strtouq(char *s, char **, int);
19124 static int bad = 0;
19125 void check(char *s, unsigned long long eull, int een) {
19126 unsigned long long gull;
19128 gull = strtouq(s, 0, 10);
19129 if (!((gull == eull) && (errno == een)))
19133 check(" 1", 1LL, 0);
19134 check(" 0", 0LL, 0);
19135 check("18446744073709551615", 18446744073709551615ULL, 0);
19136 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
19137 #if 0 /* strtouq() for /^-/ strings is undefined. */
19138 check("-1", 18446744073709551615ULL, 0);
19139 check("-18446744073709551614", 2LL, 0);
19140 check("-18446744073709551615", 1LL, 0);
19141 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
19142 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
19150 if eval $compile; then
19151 case "`$run ./try`" in
19152 ok) echo "Your strtouq() seems to be working okay." ;;
19154 Your strtouq() doesn't seem to be working okay.
19160 echo "(I can't seem to compile the test program--assuming it doesn't)"
19166 : see if strxfrm exists
19167 set strxfrm d_strxfrm
19170 : see if symlink exists
19171 set symlink d_symlink
19174 : see if syscall exists
19175 set syscall d_syscall
19178 : see if prototype for syscall is available
19180 set d_syscallproto syscall $i_unistd unistd.h
19183 : see if sysconf exists
19184 set sysconf d_sysconf
19187 : see if system exists
19188 set system d_system
19191 : see if tcgetpgrp exists
19192 set tcgetpgrp d_tcgetpgrp
19195 : see if tcsetpgrp exists
19196 set tcsetpgrp d_tcsetpgrp
19199 : see if prototype for telldir is available
19201 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
19204 : see if time exists
19206 if test "X$d_time" = X -o X"$timetype" = X; then
19207 if set time val -f d_time; eval $csym; $val; then
19208 echo 'time() found.' >&4
19210 rp="What is the type returned by time() on this system?"
19211 set time_t timetype long stdio.h sys/types.h
19214 echo 'time() not found, hope that will do.' >&4
19222 : see if timegm exists
19223 set timegm d_timegm
19226 : see if this is a sys/times.h system
19227 set sys/times.h i_systimes
19230 : see if times exists
19232 if set times val -f d_times; eval $csym; $val; then
19233 echo 'times() found.' >&4
19236 case "$i_systimes" in
19237 "$define") inc='sys/times.h';;
19239 rp="What is the type returned by times() on this system?"
19240 set clock_t clocktype long stdio.h sys/types.h $inc
19243 echo 'times() NOT found, hope that will do.' >&4
19248 : see if tmpnam_r exists
19249 set tmpnam_r d_tmpnam_r
19251 case "$d_tmpnam_r" in
19253 hdrs="$i_systypes sys/types.h define stdio.h "
19254 case "$d_tmpnam_r_proto:$usethreads" in
19255 ":define") d_tmpnam_r_proto=define
19256 set d_tmpnam_r_proto tmpnam_r $hdrs
19260 case "$d_tmpnam_r_proto" in
19262 case "$tmpnam_r_proto" in
19263 ''|0) try='char* tmpnam_r(char*);'
19264 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
19266 case "$tmpnam_r_proto" in
19267 ''|0) d_tmpnam_r=undef
19269 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
19270 * ) case "$tmpnam_r_proto" in
19271 REENTRANT_PROTO*) ;;
19272 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
19274 echo "Prototype: $try" ;;
19277 *) case "$usethreads" in
19278 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
19285 *) tmpnam_r_proto=0
19289 : see if truncate exists
19290 set truncate d_truncate
19293 : see if ttyname_r exists
19294 set ttyname_r d_ttyname_r
19296 case "$d_ttyname_r" in
19298 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
19299 case "$d_ttyname_r_proto:$usethreads" in
19300 ":define") d_ttyname_r_proto=define
19301 set d_ttyname_r_proto ttyname_r $hdrs
19305 case "$d_ttyname_r_proto" in
19307 case "$ttyname_r_proto" in
19308 ''|0) try='int ttyname_r(int, char*, size_t);'
19309 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
19311 case "$ttyname_r_proto" in
19312 ''|0) try='int ttyname_r(int, char*, int);'
19313 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
19315 case "$ttyname_r_proto" in
19316 ''|0) try='char* ttyname_r(int, char*, int);'
19317 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
19319 case "$ttyname_r_proto" in
19320 ''|0) d_ttyname_r=undef
19322 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
19323 * ) case "$ttyname_r_proto" in
19324 REENTRANT_PROTO*) ;;
19325 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
19327 echo "Prototype: $try" ;;
19330 *) case "$usethreads" in
19331 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19338 *) ttyname_r_proto=0
19342 : see if tzname[] exists
19344 if set tzname val -a d_tzname; eval $csym; $val; then
19346 echo 'tzname[] found.' >&4
19349 echo 'tzname[] NOT found.' >&4
19354 : Check if is a multiplatform env
19356 darwin) multiarch="$define" ;;
19358 case "$multiarch" in
19359 ''|[nN]*) multiarch="$undef" ;;
19362 : check for ordering of bytes in a UV
19364 case "$multiarch" in
19367 You seem to be doing a multiarchitecture build,
19368 skipping the byteorder check.
19374 case "$byteorder" in
19377 In the following, larger digits indicate more significance. A big-endian
19378 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19379 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19380 machines may have weird orders like 3412. A Cray will report 87654321,
19381 an Alpha will report 12345678. If the test program works the default is
19383 I'm now running the test program...
19387 #$i_stdlib I_STDLIB
19389 #include <stdlib.h>
19391 #include <sys/types.h>
19392 typedef $uvtype UV;
19402 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19404 u.l = (UV)0x04030201;
19405 for (i = 0; i < $uvsize; i++)
19406 printf("%c", u.c[i]+'0');
19413 if eval $compile && $run ./try > /dev/null; then
19416 [1-4][1-4][1-4][1-4]|12345678|87654321)
19417 echo "(The test program ran ok.)"
19418 echo "byteorder=$dflt"
19421 ????|????????) echo "(The test program ran ok.)" ;;
19422 *) echo "(The test program didn't run right for some reason.)" ;;
19427 (I can't seem to compile the test program. Guessing big-endian...)
19430 case "$xxx_prompt" in
19432 rp="What is the order of bytes in $uvtype?"
19445 : Checking 32bit alignedness
19448 Checking to see whether you can access character data unalignedly...
19450 case "$d_u32align" in
19451 '') $cat >try.c <<EOCP
19453 #$i_stdlib I_STDLIB
19455 #include <stdlib.h>
19457 #define U32 $u32type
19458 #define BYTEORDER 0x$byteorder
19460 #include <signal.h>
19462 $signal_t bletch(int s) { exit(4); }
19465 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19466 volatile U8 buf[8];
19470 if (sizeof(U32) != 4) {
19471 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19478 signal(SIGBUS, bletch);
19490 for (i = 0; i < 4; i++) {
19491 up = (U32*)(buf + i);
19492 if (! ((*up == 1 << (8*i)) || /* big-endian */
19493 (*up == 1 << (8*(3-i))) /* little-endian */
19497 printf("read failed (%x)\n", *up);
19503 for (i = 0; i < 4; i++) {
19504 up = (U32*)(buf + i);
19506 if (*up != 0xBeef) {
19507 printf("write failed (%x)\n", *up);
19521 if eval $compile_ok; then
19522 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19523 $run ./try 2>&1 >/dev/null
19526 You can access character data pretty unalignedly.
19528 d_u32align="$undef"
19531 It seems that you must access character data in an aligned manner.
19533 d_u32align="$define"
19537 rp='Can you access character data at unaligned addresses?'
19541 [yY]*) d_u32align="$undef" ;;
19542 *) d_u32align="$define" ;;
19549 : see if ualarm exists
19550 set ualarm d_ualarm
19553 : see if umask exists
19557 : see if unordered exists
19558 set unordered d_unordered
19561 : see if unsetenv exists
19562 set unsetenv d_unsetenv
19565 : see if usleep exists
19566 set usleep d_usleep
19569 : see if prototype for usleep is available
19571 set d_usleepproto usleep $i_unistd unistd.h
19574 : see if ustat exists
19578 : see if closedir exists
19579 set closedir d_closedir
19582 case "$d_closedir" in
19585 echo "Checking whether closedir() returns a status..." >&4
19587 #$i_dirent I_DIRENT /**/
19588 #$i_sysdir I_SYS_DIR /**/
19589 #$i_sysndir I_SYS_NDIR /**/
19590 #$i_systypes I_SYS_TYPES /**/
19592 #if defined(I_SYS_TYPES)
19593 #include <sys/types.h>
19595 #if defined(I_DIRENT)
19596 #include <dirent.h>
19599 #include <sys/ndir.h>
19603 #include <ndir.h> /* may be wrong in the future */
19605 #include <sys/dir.h>
19610 int main() { return closedir(opendir(".")); }
19613 if eval $compile_ok; then
19614 if $run ./try > /dev/null 2>&1 ; then
19615 echo "Yes, it does."
19618 echo "No, it doesn't."
19622 echo "(I can't seem to compile the test program--assuming it doesn't)"
19630 set d_void_closedir
19634 : see if there is a wait4
19638 : see if waitpid exists
19639 set waitpid d_waitpid
19644 $cat >try.c <<'EOCP'
19650 return (wcscmp (s, s) ? 1 : 0);
19655 if eval $compile; then
19658 0) echo "A working wcscmp() found." >&4
19660 *) echo "wcscmp() found, but it doesn't work" >&4
19664 echo "wcscmp() NOT found." >&4
19670 : see if wcstombs exists
19671 set wcstombs d_wcstombs
19676 $cat >try.c <<'EOCP'
19681 wchar_t dst[4], *src = L" ";
19683 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
19688 if eval $compile; then
19691 0) echo "A working wcsxfrm() found." >&4
19693 *) echo "wcsxfrm() found, but it doesn't work" >&4
19697 echo "wcsxfrm() NOT found." >&4
19703 : see if wctomb exists
19704 set wctomb d_wctomb
19707 : see if writev exists
19708 set writev d_writev
19711 : check for alignment requirements
19713 case "$alignbytes" in
19714 '') echo "Checking alignment constraints..." >&4
19715 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
19716 $cat >try.c <<'EOCP'
19717 typedef long double NV;
19720 $cat >try.c <<'EOCP'
19724 $cat >>try.c <<'EOCP'
19732 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19737 if eval $compile_ok; then
19741 echo "(I can't seem to compile the test program...)"
19743 case "$multiarch" in
19745 : The usual safe value is 8, but Darwin with -Duselongdouble
19746 : needs 16. Hence, we will take 8 as a minimum, but allow
19747 : Configure to pick a larger value if needed.
19748 if $test "$dflt" -lt 8; then
19750 echo "Setting alignment to 8 for multiarch support.">&4
19755 *) dflt="$alignbytes"
19758 rp="Doubles must be aligned on a how-many-byte boundary?"
19763 : set the base revision
19766 : length of character in bytes. Is always 1, otherwise it is not C
19767 : This used to be a test using sizeof
19770 : Check for the number of bits in a character
19771 case "$charbits" in
19772 '') echo "Checking how long a character is (in bits)..." >&4
19779 for (c = 1, n = 0; c; c <<= 1, n++) ;
19780 printf ("%d\n", n);
19785 if eval $compile_ok; then
19789 echo "(I can't seem to compile the test program. Guessing...)"
19796 rp="What is the length of a character (in bits)?"
19800 case "$charbits" in
19803 Your system has an unsigned character size of $charbits bits, which
19804 is rather unusual (normally it is 8 bits). Perl likely will not work
19805 correctly on your system, with subtle bugs in various places.
19807 rp='Do you really want to continue?'
19811 [yY]) echo >&4 "Okay, continuing." ;;
19816 : how do we concatenate cpp tokens here?
19818 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19819 $cat >cpp_stuff.c <<'EOCP'
19820 #define RCAT(a,b)a/**/b
19821 #define ACAT(a,b)a ## b
19825 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19826 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19827 echo "Oh! Smells like ANSI's been here." >&4
19828 echo "We can catify or stringify, separately or together!"
19830 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19831 echo "Ah, yes! The good old days!" >&4
19832 echo "However, in the good old days we don't know how to stringify and"
19833 echo "catify at the same time."
19837 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19838 You're going to have to edit the values of CAT[2-5] in config.h...
19840 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19844 : see if this is a db.h system
19850 : Check db version.
19852 echo "Checking Berkeley DB version ..." >&4
19858 #include <sys/types.h>
19860 #$i_stdlib I_STDLIB
19862 #include <stdlib.h>
19865 int main(int argc, char *argv[])
19867 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19868 int Major, Minor, Patch ;
19869 unsigned long Version ;
19870 (void)db_version(&Major, &Minor, &Patch) ;
19872 printf("%d %d %d %d %d %d\n",
19873 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19874 Major, Minor, Patch);
19877 printf("You have Berkeley DB Version 2 or greater.\n");
19879 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19880 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19881 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19882 Major, Minor, Patch) ;
19884 /* check that db.h & libdb are compatible */
19885 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19886 printf("db.h and libdb are incompatible.\n") ;
19890 printf("db.h and libdb are compatible.\n") ;
19892 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19893 + DB_VERSION_PATCH ;
19895 /* needs to be >= 2.3.4 */
19896 if (Version < 2003004) {
19897 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19898 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19904 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19909 printf("You have Berkeley DB Version 1.\n");
19910 exit(0); /* DB version < 2: the coast is clear. */
19912 exit(1); /* <db.h> not Berkeley DB? */
19918 if eval $compile_ok && $run ./try; then
19919 echo 'Looks OK.' >&4
19921 db_version_major=$1
19922 db_version_minor=$2
19923 db_version_patch=$3
19925 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19929 : Remove db from list of libraries to use
19930 echo "Removing unusable -ldb from library list" >&4
19931 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19934 echo "libs = $libs" >&4
19944 : Check the return type needed for hash
19946 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19952 #include <sys/types.h>
19955 #ifndef DB_VERSION_MAJOR
19956 u_int32_t hash_cb (const void* ptr, size_t size)
19962 info.hash = hash_cb;
19966 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19967 if $contains warning try.out >>/dev/null 2>&1 ; then
19970 db_hashtype='u_int32_t'
19973 : XXX Maybe we should just give up here.
19974 db_hashtype=u_int32_t
19976 echo "Help: I can't seem to compile the db test program." >&4
19977 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19980 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19982 *) db_hashtype=u_int32_t
19987 : Check the return type needed for prefix
19989 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19995 #include <sys/types.h>
19998 #ifndef DB_VERSION_MAJOR
19999 size_t prefix_cb (const DBT *key1, const DBT *key2)
20005 info.prefix = prefix_cb;
20009 if $cc $ccflags -c try.c >try.out 2>&1 ; then
20010 if $contains warning try.out >>/dev/null 2>&1 ; then
20011 db_prefixtype='int'
20013 db_prefixtype='size_t'
20016 db_prefixtype='size_t'
20017 : XXX Maybe we should just give up here.
20019 echo "Help: I can't seem to compile the db test program." >&4
20020 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
20023 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
20025 *) db_prefixtype='size_t'
20029 : How can we generate normalized random numbers ?
20031 echo "Using our internal random number implementation..." >&4
20034 *-Dmy_rand=*|*-Dmy_srand=*)
20035 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
20036 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
20037 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
20038 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
20042 randfunc=Perl_drand48
20043 drand01="Perl_drand48()"
20044 seedfunc="Perl_drand48_init"
20048 : Determine if this is an EBCDIC system
20050 echo "Determining whether or not we are on an EBCDIC system..." >&4
20051 $cat >try.c <<'EOM'
20054 if ('M'==0xd4) return 0;
20061 if eval $compile_ok; then
20062 if $run ./try; then
20063 echo "You seem to speak EBCDIC." >&4
20066 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
20069 echo "I'm unable to compile the test program." >&4
20070 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
20076 : Check how to flush
20079 Checking how to flush all pending stdio output...
20081 # I only know how to find the first 32 possibly open files on SunOS.
20082 # See also hints/sunos_4_1.sh and util.c --AD
20084 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
20086 $cat >>try.c <<EOCP
20088 #$i_stdlib I_STDLIB
20090 #include <stdlib.h>
20092 #$i_unistd I_UNISTD
20094 # include <unistd.h>
20096 #$d_sysconf HAS_SYSCONF
20097 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
20098 #ifdef HAS_STDIO_STREAM_ARRAY
20099 # define STDIO_STREAM_ARRAY $stdio_stream_array
20104 p = fopen("try.out", "w");
20108 # ifdef TRY_FPRINTF
20112 #ifdef TRY_FFLUSH_NULL
20115 #ifdef TRY_FFLUSH_ALL
20117 long open_max = -1;
20118 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
20119 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
20121 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
20122 open_max = sysconf(_SC_OPEN_MAX);
20125 open_max = FOPEN_MAX;
20128 open_max = OPEN_MAX;
20137 # ifdef HAS_STDIO_STREAM_ARRAY
20138 if (open_max > 0) {
20140 for (i = 0; i < open_max; i++)
20141 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
20142 STDIO_STREAM_ARRAY[i]._file < open_max &&
20143 STDIO_STREAM_ARRAY[i]._flag)
20144 fflush(&STDIO_STREAM_ARRAY[i]);
20152 : first we have to find out how _not_ to flush
20154 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
20156 set try -DTRY_FPUTC
20157 if eval $compile; then
20158 $run ./try 2>/dev/null
20161 if $test ! -s try.out -a "X$code" = X42; then
20167 set try -DTRY_FPRINTF
20168 if eval $compile; then
20169 $run ./try 2>/dev/null
20172 if $test ! -s try.out -a "X$code" = X42; then
20173 output=-DTRY_FPRINTF
20179 : check for fflush NULL behavior
20180 case "$fflushNULL" in
20181 '') set try -DTRY_FFLUSH_NULL $output
20182 if eval $compile; then
20183 $run ./try 2>/dev/null
20186 if $test -s try.out -a "X$code" = X42; then
20187 fflushNULL="`$cat try.out`"
20189 if $test "X$code" != X42; then
20191 (If this test failed, don't worry, we'll try another method shortly.)
20196 $rm -f core try.core core.try.*
20197 case "$fflushNULL" in
20199 Your fflush(NULL) works okay for output streams.
20200 Let's see if it clobbers input pipes...
20202 # As of mid-March 2000 all versions of Solaris appear to have a stdio
20203 # bug that improperly flushes the input end of pipes. So we avoid the
20204 # autoflush on fork/system/exec support for now. :-(
20205 $cat >tryp.c <<EOCP
20208 main(int argc, char **argv)
20214 while ((i = getc(stdin)) != -1
20215 && (*bp++ = i) != '\n'
20216 && bp < &buf[1024])
20219 fprintf(stdout, "%s", buf);
20227 fflushNULL="$define"
20229 if eval $compile; then
20231 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
20232 if $test "X$targethost" != X; then
20235 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20237 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20239 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20241 fflush(NULL) seems to behave okay with input streams.
20243 fflushNULL="$define"
20246 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
20248 fflushNULL="$undef"
20251 $rm -f core tryp.c tryp.core core.tryp.*
20254 Your fflush(NULL) isn't working (contrary to ANSI C).
20256 fflushNULL="$undef"
20259 Cannot figure out whether your fflush(NULL) works or not.
20260 I'm assuming it doesn't (contrary to ANSI C).
20262 fflushNULL="$undef"
20266 $define|true|[yY]*)
20267 fflushNULL="$define"
20270 fflushNULL="$undef"
20273 : check explicit looping only if NULL did not work, and if the pipe
20274 : bug does not show up on an explicit flush too
20275 case "$fflushNULL" in
20277 $cat >tryp.c <<EOCP
20280 main(int argc, char **argv)
20286 while ((i = getc(stdin)) != -1
20287 && (*bp++ = i) != '\n'
20288 && bp < &buf[1024])
20291 fprintf(stdout, "%s", buf);
20300 if eval $compile; then
20302 if $test "X$targethost" != X; then
20305 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
20307 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
20309 if cmp tryp.c tryp.out >/dev/null 2>&1; then
20311 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
20313 : now check for fflushall behaviour
20314 case "$fflushall" in
20315 '') set try -DTRY_FFLUSH_ALL $output
20316 if eval $compile; then
20318 (Now testing the other method--but note that this also may fail.)
20320 $run ./try 2>/dev/null
20323 if $test -s try.out -a "X$code" = X42; then
20324 fflushall="`$cat try.out`"
20328 case "$fflushall" in
20330 Whew. Flushing explicitly all the stdio streams works.
20332 fflushall="$define"
20335 Sigh. Flushing explicitly all the stdio streams doesn't work.
20340 Cannot figure out whether flushing stdio streams explicitly works or not.
20341 I'm assuming it doesn't.
20347 "$define"|true|[yY]*)
20348 fflushall="$define"
20356 All is futile. Even fflush(stdin) clobbers input pipes!
20363 $rm -f core tryp.c tryp.core core.tryp.*
20365 *) fflushall="$undef"
20369 case "$fflushNULL$fflushall" in
20372 OK, I give up. I cannot figure out how to flush pending stdio output.
20373 We won't be flushing handles at all before fork/exec/popen.
20379 : Store the full pathname to the ar program for use in the C program
20380 : Respect a hint or command line value for full_ar.
20385 : Store the full pathname to the sed program for use in the C program
20388 : see what type gids are declared as in the kernel
20390 echo "Looking for the type for group ids returned by getgid()."
20391 set gid_t gidtype xxx stdio.h sys/types.h
20395 xxx=`./findhdr sys/user.h`
20396 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
20398 unsigned) dflt="$1 $2" ;;
20402 *) dflt="$gidtype";;
20405 gid_t) echo "gid_t found." ;;
20406 *) rp="What is the type for group ids returned by getgid()?"
20412 : Check the size of GID
20415 *_t) zzz="$gidtype" ;;
20418 echo "Checking the size of $zzz..." >&4
20420 #include <sys/types.h>
20422 #$i_stdlib I_STDLIB
20424 #include <stdlib.h>
20427 printf("%d\n", (int)sizeof($gidtype));
20432 if eval $compile_ok; then
20436 echo "(I can't execute the test program--guessing $gidsize.)" >&4
20439 echo "Your $zzz is $gidsize bytes long."
20444 echo "(I can't compile the test program--guessing $gidsize.)" >&4
20448 : Check if GID is signed
20451 *_t) zzz="$gidtype" ;;
20454 echo "Checking the sign of $zzz..." >&4
20456 #include <sys/types.h>
20467 if eval $compile; then
20471 echo "(I can't execute the test program--guessing unsigned.)" >&4
20475 1) echo "Your $zzz is unsigned." ;;
20476 -1) echo "Your $zzz is signed." ;;
20482 echo "(I can't compile the test program--guessing unsigned.)" >&4
20486 : Check 64bit sizes
20489 if $test X"$quadtype" != X; then
20491 echo "Checking how to print 64-bit integers..." >&4
20493 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
20494 $cat >try.c <<'EOCP'
20495 #include <sys/types.h>
20498 int q = 12345678901;
20499 printf("%ld\n", q);
20503 if eval $compile; then
20507 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
20508 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
20509 echo "We will use %d."
20515 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
20516 $cat >try.c <<'EOCP'
20517 #include <sys/types.h>
20520 long q = 12345678901;
20521 printf("%ld\n", q);
20525 if eval $compile; then
20529 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
20530 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
20531 echo "We will use %ld."
20537 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
20538 $cat >try.c <<'EOCP'
20539 #include <sys/types.h>
20540 #include <inttypes.h>
20543 int64_t q = 12345678901;
20544 printf("%" PRId64 "\n", q);
20548 if eval $compile; then
20552 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
20553 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
20554 echo "We will use the C9X style."
20560 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20562 #include <sys/types.h>
20565 $quadtype q = 12345678901;
20566 printf("%Ld\n", q);
20570 if eval $compile; then
20574 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
20575 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
20576 echo "We will use %Ld."
20582 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
20583 $cat >try.c <<'EOCP'
20584 #include <sys/types.h>
20587 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
20588 printf("%lld\n", q);
20592 if eval $compile; then
20596 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
20597 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
20598 echo "We will use the %lld style."
20604 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20606 #include <sys/types.h>
20609 $quadtype q = 12345678901;
20610 printf("%qd\n", q);
20614 if eval $compile; then
20618 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
20619 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
20620 echo "We will use %qd."
20626 if $test X"$sPRId64" = X; then
20627 echo "Cannot figure out how to print 64-bit integers." >&4
20634 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
20635 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
20637 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
20638 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
20642 : Check format strings for internal types
20644 $echo "Checking the format strings to be used for Perl's internal types..." >&4
20646 if $test X"$ivsize" = X8; then
20647 ivdformat="$sPRId64"
20648 uvuformat="$sPRIu64"
20649 uvoformat="$sPRIo64"
20650 uvxformat="$sPRIx64"
20651 uvXUformat="$sPRIXU64"
20653 if $test X"$ivsize" = X"$longsize"; then
20660 if $test X"$ivsize" = X"$intsize"; then
20668 if $test X"$ivsize" = X"$shortsize"; then
20679 if $test X"$usequadmath" = X"$define"; then
20687 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
20688 nveformat="$sPRIeldbl"
20689 nvfformat="$sPRIfldbl"
20690 nvgformat="$sPRIgldbl"
20691 nvEUformat="$sPRIEUldbl"
20692 nvFUformat="$sPRIFUldbl"
20693 nvGUformat="$sPRIGUldbl"
20704 case "$ivdformat" in
20705 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
20710 : Check format string for GID
20713 $echo "Checking the format string to be used for gids..." >&4
20716 -1) if $test X"$gidsize" = X"$ivsize"; then
20717 gidformat="$ivdformat"
20719 if $test X"$gidsize" = X"$longsize"; then
20722 if $test X"$gidsize" = X"$intsize"; then
20725 if $test X"$gidsize" = X"$shortsize"; then
20732 *) if $test X"$gidsize" = X"$uvsize"; then
20733 gidformat="$uvuformat"
20735 if $test X"$gidsize" = X"$longsize"; then
20738 if $test X"$gidsize" = X"$intsize"; then
20741 if $test X"$gidsize" = X"$shortsize"; then
20750 : see if getgroups exists
20751 set getgroups d_getgrps
20754 : see if setgroups exists
20755 set setgroups d_setgrps
20758 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
20760 case "$d_getgrps$d_setgrps" in
20762 case "$groupstype" in
20763 '') dflt="$gidtype" ;;
20764 *) dflt="$groupstype" ;;
20767 What type of pointer is the second argument to getgroups() and setgroups()?
20768 Usually this is the same as group ids, $gidtype, but not always.
20771 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20775 *) groupstype="$gidtype";;
20778 : check whether make sets MAKE
20780 echo "Checking if your $make program sets \$(MAKE)..." >&4
20781 case "$make_set_make" in
20783 $sed 's/^X //' > testmake.mak << 'EOF'
20785 X @echo 'maketemp="$(MAKE)"'
20787 case "`$make -f testmake.mak 2>/dev/null`" in
20788 *maketemp=*) make_set_make='#' ;;
20789 *) make_set_make="MAKE=$make" ;;
20791 $rm -f testmake.mak
20794 case "$make_set_make" in
20795 '#') echo "Yup, it does.";;
20796 *) echo "Nope, it doesn't.";;
20799 : see what type is used for mode_t
20800 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20801 set mode_t modetype int stdio.h sys/types.h
20804 : see if we need va_copy
20806 case "$i_stdarg" in
20809 #include <stdarg.h>
20811 #$i_stdlib I_STDLIB
20813 #include <stdlib.h>
20815 #include <signal.h>
20818 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20820 return vfprintf(f, fmt, *valp);
20824 myvfprintf(FILE *f, const char *fmt, va_list val)
20826 return ivfprintf(f, fmt, &val);
20830 myprintf(char *fmt, ...)
20833 va_start(val, fmt);
20834 return myvfprintf(stdout, fmt, val);
20838 main(int ac, char **av)
20840 signal(SIGSEGV, exit);
20842 myprintf("%s%cs all right, then\n", "that", '\'');
20847 if eval $compile && $run ./try 2>&1 >/dev/null; then
20848 case "`$run ./try`" in
20849 "that's all right, then")
20855 yes) echo "It seems that you don't need va_copy()." >&4
20856 need_va_copy="$undef"
20858 *) echo "It seems that va_copy() or similar will be needed." >&4
20859 need_va_copy="$define"
20864 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20865 need_va_copy="$undef"
20869 : see what type is used for size_t
20870 rp="What is the type used for the length parameter for string functions?"
20871 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20874 : check for type of arguments to gethostbyaddr.
20875 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20876 case "$d_gethbyaddr" in
20880 Checking to see what type of arguments are accepted by gethostbyaddr().
20882 hdrs="$define sys/types.h
20883 $d_socket sys/socket.h
20884 $i_niin netinet/in.h
20886 $i_unistd unistd.h"
20887 : The first arg can 'char *' or 'void *'
20888 : The second arg is some of integral type
20889 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20890 for yyy in size_t long int; do
20891 case "$netdb_host_type" in
20892 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20893 if ./protochk "$try" $hdrs; then
20894 echo "Your system accepts $xxx for the first arg."
20895 echo "...and $yyy for the second arg."
20896 netdb_host_type="$xxx"
20897 netdb_hlen_type="$yyy"
20903 : In case none of those worked, prompt the user.
20904 case "$netdb_host_type" in
20905 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20908 netdb_host_type=$ans
20909 rp='What is the type for the 2nd argument to gethostbyaddr?'
20912 netdb_hlen_type=$ans
20916 *) : no gethostbyaddr, so pick harmless defaults
20917 netdb_host_type='char *'
20918 netdb_hlen_type="$sizetype"
20921 # Remove the "const" if needed. -- but then we'll have a
20923 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20926 : check for type of argument to gethostbyname.
20927 if test "X$netdb_name_type" = X ; then
20928 case "$d_gethbyname" in
20932 Checking to see what type of argument is accepted by gethostbyname().
20934 hdrs="$define sys/types.h
20935 $d_socket sys/socket.h
20936 $i_niin netinet/in.h
20938 $i_unistd unistd.h"
20939 for xxx in "const char *" "char *"; do
20940 case "$netdb_name_type" in
20941 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20942 if ./protochk "$try" $hdrs; then
20943 echo "Your system accepts $xxx."
20944 netdb_name_type="$xxx"
20949 : In case none of those worked, prompt the user.
20950 case "$netdb_name_type" in
20951 '') rp='What is the type for the 1st argument to gethostbyname?'
20954 netdb_name_type=$ans
20958 *) : no gethostbyname, so pick harmless default
20959 netdb_name_type='char *'
20964 : check for type of 1st argument to getnetbyaddr.
20965 if test "X$netdb_net_type" = X ; then
20966 case "$d_getnbyaddr" in
20970 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20972 hdrs="$define sys/types.h
20973 $d_socket sys/socket.h
20974 $i_niin netinet/in.h
20976 $i_unistd unistd.h"
20977 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20978 case "$netdb_net_type" in
20979 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20980 if ./protochk "$try" $hdrs; then
20981 echo "Your system accepts $xxx."
20982 netdb_net_type="$xxx"
20987 : In case none of those worked, prompt the user.
20988 case "$netdb_net_type" in
20989 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20992 netdb_net_type=$ans
20996 *) : no getnetbyaddr, so pick harmless default
20997 netdb_net_type='long'
21001 : locate the preferred pager for this system
21008 [a-zA-Z]:/*) dflt=$pg;;
21012 [a-zA-Z]:/*) dflt=$more;;
21016 [a-zA-Z]:/*) dflt=$less;;
21019 '') dflt=/usr/ucb/more;;
21027 rp='What pager is used on your system?'
21031 : see what type pids are declared as in the kernel
21032 rp="What is the type of process ids on this system?"
21033 set pid_t pidtype int stdio.h sys/types.h
21036 : see if ar generates random libraries by itself
21038 echo "Checking how to generate random libraries on your machine..." >&4
21039 echo 'int bar1() { return bar2(); }' > bar1.c
21040 echo 'int bar2() { return 2; }' > bar2.c
21042 #$i_stdlib I_STDLIB
21044 #include <stdlib.h>
21046 int main() { printf("%d\n", bar1()); exit(0); }
21048 $cc $ccflags -c bar1.c >/dev/null 2>&1
21049 $cc $ccflags -c bar2.c >/dev/null 2>&1
21050 $cc $ccflags -c foo.c >/dev/null 2>&1
21051 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
21052 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21053 $run ./foobar >/dev/null 2>&1; then
21054 echo "$ar appears to generate random libraries itself."
21056 if [ "X$ranlib" = "X" ]; then
21059 elif $ar s bar$_a >/dev/null 2>&1 &&
21060 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21061 $run ./foobar >/dev/null 2>&1; then
21062 echo "a table of contents needs to be added with '$ar s'."
21065 elif $ar ts bar$_a >/dev/null 2>&1 &&
21066 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
21067 $run ./foobar >/dev/null 2>&1; then
21068 echo "a table of contents needs to be added with '$ar ts'."
21075 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
21076 $test -f $ranlib || ranlib=''
21079 if $test -n "$ranlib"; then
21080 echo "your system has '$ranlib'; we'll use that."
21083 echo "your system doesn't seem to support random libraries"
21084 echo "so we'll use lorder and tsort to order the libraries."
21091 : see if this is a values.h system
21092 set values.h i_values
21095 : Check the max offset that gmtime and localtime accept
21096 echo "Checking max offsets that gmtime () accepts"
21099 define) yyy="#include <values.h>" ;;
21103 case "$sGMTIME_min/$sGMTIME_max" in
21106 #include <sys/types.h>
21115 void gm_check (time_t t, int min_year, int max_year)
21118 if ( tmp == NULL ||
21119 /* Check tm_year overflow */
21120 tmp->tm_year < min_year || tmp->tm_year > max_year)
21131 gm_check (MAXLONG, 69, 0x7fffffff);
21133 if (tmp == NULL || tmp->tm_year < 0) {
21134 for (i = 63; i >= 0; i--) {
21135 time_t x = pt | ((time_t)1 << i);
21136 if (x < 0 || x < pt) continue;
21137 gm_check (x, 69, 0x7fffffff);
21140 printf ("sGMTIME_max=%ld\n", pt);
21149 gm_check (MINLONG, -1900, 70);
21152 for (i = 36; i >= 0; i--) {
21153 time_t x = pt - ((time_t)1 << i);
21154 if (x > 0) continue;
21155 gm_check (x, -1900, 70);
21158 printf ("sGMTIME_min=%ld\n", pt);
21162 int main (int argc, char *argv[])
21164 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
21171 if eval $compile; then
21174 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
21180 echo "Checking max offsets that localtime () accepts"
21182 case "$sLOCALTIME_min/$sLOCALTIME_max" in
21185 #include <sys/types.h>
21194 void local_check (time_t t, int min_year, int max_year)
21196 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
21199 tmp = localtime (&t);
21200 if ( tmp == NULL ||
21201 /* Check tm_year overflow */
21202 tmp->tm_year < min_year || tmp->tm_year > max_year)
21206 } /* local_check */
21213 local_check (MAXLONG, 69, 0x7fffffff);
21215 if (tmp == NULL || tmp->tm_year < 0) {
21216 for (i = 63; i >= 0; i--) {
21217 time_t x = pt | ((time_t)1 << i);
21218 if (x < 0 || x < pt) continue;
21219 local_check (x, 69, 0x7fffffff);
21222 printf ("sLOCALTIME_max=%ld\n", pt);
21231 local_check (MINLONG, -1900, 70);
21234 for (i = 36; i >= 0; i--) {
21235 time_t x = pt - ((time_t)1 << i);
21236 if (x > 0) continue;
21237 local_check (x, -1900, 70);
21240 printf ("sLOCALTIME_min=%ld\n", pt);
21244 int main (int argc, char *argv[])
21252 if eval $compile; then
21255 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
21261 : check for type of arguments to select.
21262 case "$selecttype" in
21263 '') case "$d_select" in
21267 Checking to see what type of arguments are accepted by select().
21269 hdrs="$define sys/types.h
21270 $i_systime sys/time.h
21271 $i_sysselct sys/select.h
21272 $d_socket sys/socket.h"
21273 : The first arg can be int, unsigned, or size_t
21274 : The last arg may or may not be 'const'
21276 : void pointer has been seen but using that
21277 : breaks the selectminbits test
21278 for xxx in 'fd_set *' 'int *'; do
21279 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
21280 for tmo in 'struct timeval *' 'const struct timeval *'; do
21282 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
21283 if ./protochk "$try" $hdrs; then
21284 echo "Your system accepts $xxx."
21293 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
21294 case "$d_fd_set" in
21295 $define) dflt="fd_set *" ;;
21304 *) : no select, so pick a harmless default
21311 : check for the select 'width'
21312 case "$selectminbits" in
21313 '') safebits=`expr $ptrsize \* 8`
21314 case "$d_select" in
21318 Checking to see on how many bits at a time your select() operates...
21321 #include <sys/types.h>
21323 #$i_systime I_SYS_TIME
21324 #$i_systimek I_SYS_TIME_KERNEL
21329 # ifdef I_SYS_TIME_KERNEL
21332 # include <sys/time.h>
21333 # ifdef I_SYS_TIME_KERNEL
21337 #$i_sysselct I_SYS_SELECT
21338 #ifdef I_SYS_SELECT
21339 #include <sys/select.h>
21341 #$d_socket HAS_SOCKET
21343 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
21346 #$i_stdlib I_STDLIB
21348 #include <stdlib.h>
21351 #define S sizeof(*(b))
21353 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
21354 #define NBITS (NBYTES * 8)
21356 char *s = (char *)malloc(NBYTES);
21365 fp = fopen("try.c", "r");
21371 b = ($selecttype)s;
21372 for (i = 0; i < NBITS; i++)
21376 select(fd + 1, b, 0, 0, &t);
21377 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
21379 printf("%d\n", i + 1);
21384 if eval $compile_ok; then
21385 selectminbits=`$run ./try`
21386 case "$selectminbits" in
21388 Cannot figure out on how many bits at a time your select() operates.
21389 I'll play safe and guess it is $safebits bits.
21391 selectminbits=$safebits
21392 bits="$safebits bits"
21395 *) bits="$selectminbits bits" ;;
21397 echo "Your select() operates on $bits at a time." >&4
21399 rp='What is the minimum number of bits your select() operates on?'
21400 case "$byteorder" in
21401 12345678) dflt=64 ;;
21407 selectminbits="$val"
21411 *) : no select, so pick a harmless default
21412 selectminbits=$safebits
21418 : Trace out the files included by signal.h, then look for SIGxxx names.
21419 if [ "X$fieldn" = X ]; then
21420 : Just make some guesses. We check them later.
21421 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
21423 xxx=`echo '#include <signal.h>' |
21424 $cppstdin $cppminus $cppflags 2>/dev/null |
21425 $grep '^[ ]*#.*include' |
21426 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
21427 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
21430 for xx in $xxx /dev/null ; do
21431 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
21433 case "$xxxfiles" in
21434 '') xxxfiles=`./findhdr signal.h` ;;
21437 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
21438 print substr($2, 4, 20)
21440 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
21441 print substr($3, 4, 20)
21443 : Append some common names just in case the awk scan failed.
21444 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
21445 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
21446 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
21447 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
21448 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
21450 : generate a few handy files for later
21451 $cat > signal.c <<EOCP
21452 #include <sys/types.h>
21453 #include <signal.h>
21454 #$i_stdlib I_STDLIB
21456 #include <stdlib.h>
21461 /* Strange style to avoid deeply-nested #if/#else/#endif */
21464 # define NSIG (_NSIG)
21470 # define NSIG (SIGMAX+1)
21476 # define NSIG (SIG_MAX+1)
21482 # define NSIG (_SIG_MAX+1)
21488 # define NSIG (MAXSIG+1)
21494 # define NSIG (MAX_SIG+1)
21499 # ifdef SIGARRAYSIZE
21500 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
21506 # define NSIG (_sys_nsig) /* Solaris 2.5 */
21510 /* Default to some arbitrary number that's big enough to get most
21511 of the common signals.
21517 printf("NSIG %d\n", NSIG);
21523 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
21525 printf "#ifdef SIG"; printf $1; printf "\n"
21526 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
21527 printf $1; printf ");\n"
21531 printf "#endif /* JUST_NSIG */\n";
21532 printf "exit(0);\n}\n";
21535 $cat >signal.awk <<'EOP'
21536 BEGIN { ndups = 0 }
21537 $1 ~ /^NSIG$/ { nsig = $2 }
21538 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
21539 if ($2 > maxsig) { maxsig = $2 }
21540 if (sig_name[$2]) {
21541 dup_name[ndups] = $1
21542 dup_num[ndups] = $2
21554 printf("NSIG %d\n", nsig);
21555 for (n = 1; n < nsig; n++) {
21557 printf("%s %d\n", sig_name[n], sig_num[n])
21560 printf("NUM%d %d\n", n, n)
21563 for (n = 0; n < ndups; n++) {
21564 printf("%s %d\n", dup_name[n], dup_num[n])
21568 $cat >signal_cmd <<EOS
21570 if $test -s signal.lst; then
21571 echo "Using your existing signal.lst file"
21576 $cat >>signal_cmd <<'EOS'
21579 if eval $compile_ok; then
21580 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
21581 $uniq | $awk -f signal.awk >signal.lst
21583 echo "(I can't seem be able to compile the whole test program)" >&4
21584 echo "(I'll try it in little pieces.)" >&4
21585 set signal -DJUST_NSIG
21586 if eval $compile_ok; then
21587 $run ./signal$_exe > signal.nsg
21590 echo "I can't seem to figure out how many signals you have." >&4
21591 echo "Guessing 50." >&4
21592 echo 'NSIG 50' > signal.nsg
21594 : Now look at all the signal names, one at a time.
21595 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
21596 $cat > signal.c <<EOCP
21597 #include <sys/types.h>
21598 #include <signal.h>
21601 printf("$xx %d\n", SIG${xx});
21606 if eval $compile; then
21607 echo "SIG${xx} found."
21608 $run ./signal$_exe >> signal.ls1
21610 echo "SIG${xx} NOT found."
21613 if $test -s signal.ls1; then
21614 $cat signal.nsg signal.ls1 |
21615 $sort -n | $uniq | $awk -f signal.awk >signal.lst
21619 if $test -s signal.lst; then
21622 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
21623 echo 'kill -l' >signal
21624 set X `csh -f <signal`
21628 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
21630 echo $@ | $tr ' ' $trnl | \
21631 $awk '{ printf "%s %d\n", $1, ++s; }
21632 END { printf "NSIG %d\n", ++s }' >signal.lst
21634 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
21636 chmod a+x signal_cmd
21637 $eunicefix signal_cmd
21639 : generate list of signal names
21641 case "$sig_name_init" in
21643 *) case "$sig_num_init" in
21644 ''|*,*) doinit=yes ;;
21649 echo "Generating a list of signal names and numbers..." >&4
21651 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
21652 sig_name=`$awk 'BEGIN { printf "ZERO " }
21653 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
21654 sig_num=`$awk 'BEGIN { printf "0 " }
21655 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
21656 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
21657 !/^NSIG/ { printf "\"%s\", ", $1 }
21658 END { printf "0\n" }' signal.lst`
21659 sig_num_init=`$awk 'BEGIN { printf "0, " }
21660 !/^NSIG/ { printf "%d, ", $2}
21661 END { printf "0\n"}' signal.lst`
21664 echo "The following $sig_count signals are available:"
21666 echo $sig_name | $awk \
21667 'BEGIN { linelen = 0 }
21669 for (i = 1; i <= NF; i++) {
21670 name = "SIG" $i " "
21671 linelen = linelen + length(name)
21672 if (linelen > 70) {
21674 linelen = length(name)
21680 sig_size=`echo $sig_name | awk '{print NF}'`
21681 $rm -f signal signal.c signal.awk signal.lst signal_cmd
21683 : Check size of size
21685 case "$sizetype" in
21686 *_t) zzz="$sizetype" ;;
21687 *) zzz="filesize" ;;
21689 echo "Checking the size of $zzz..." >&4
21691 #include <sys/types.h>
21693 #$i_stdlib I_STDLIB
21695 #include <stdlib.h>
21698 printf("%d\n", (int)sizeof($sizetype));
21703 if eval $compile_ok; then
21707 echo "(I can't execute the test program--guessing $sizesize.)" >&4
21710 echo "Your $zzz size is $sizesize bytes."
21715 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21719 : check for socklen_t
21721 echo "Checking to see if you have socklen_t..." >&4
21723 #include <sys/types.h>
21724 #$d_socket HAS_SOCKET
21726 #include <sys/socket.h>
21728 int main() { socklen_t x = 16; }
21731 if eval $compile; then
21733 echo "You have socklen_t."
21736 echo "You do not have socklen_t."
21737 case "$sizetype" in
21738 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21745 : see if this is a socks.h system
21746 set socks.h i_socks
21749 : check for type of the size argument to socket calls
21750 case "$d_socket" in
21754 Checking to see what type is the last argument of accept().
21757 case "$d_socklen_t" in
21758 "$define") yyy="$yyy socklen_t"
21760 yyy="$yyy $sizetype int long unsigned"
21761 for xxx in $yyy; do
21762 case "$socksizetype" in
21763 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21764 case "$usesocks" in
21766 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21767 echo "Your system accepts '$xxx *' for the last argument of accept()."
21768 socksizetype="$xxx"
21771 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21772 echo "Your system accepts '$xxx *' for the last argument of accept()."
21773 socksizetype="$xxx"
21780 : In case none of those worked, prompt the user.
21781 case "$socksizetype" in
21782 '') rp='What is the type for socket address structure sizes?'
21789 *) : no sockets, so pick relatively harmless default
21794 : see what type is used for signed size_t
21795 set ssize_t ssizetype int stdio.h sys/types.h
21800 #$i_stdlib I_STDLIB
21802 #include <stdlib.h>
21804 #include <sys/types.h>
21805 #define Size_t $sizetype
21806 #define SSize_t $dflt
21809 if (sizeof(Size_t) == sizeof(SSize_t))
21811 else if (sizeof(Size_t) == sizeof(int))
21820 if eval $compile_ok && $run ./try > /dev/null; then
21821 ssizetype=`$run ./try`
21822 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21825 Help! I can't compile and run the ssize_t test program: please enlighten me!
21826 (This is probably a misconfiguration in your system or libraries, and
21827 you really ought to fix it. Still, I'll try anyway.)
21829 I need a type that is the same size as $sizetype, but is guaranteed to
21830 be signed. Common values are ssize_t, int and long.
21833 rp="What signed type is the same size as $sizetype?"
21839 : Check the size of st_ino
21841 $echo "Checking the size of st_ino..." >&4
21842 $cat > try.c <<EOCP
21843 #include <sys/stat.h>
21845 #$i_stdlib I_STDLIB
21847 #include <stdlib.h>
21851 printf("%d\n", (int)sizeof(st.st_ino));
21856 if eval $compile_ok; then
21860 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
21862 *) st_ino_size=$val
21863 $echo "Your st_ino is $st_ino_size bytes long."
21868 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
21872 : Check if st_ino is signed
21874 $echo "Checking the sign of st_ino..." >&4
21875 $cat > try.c <<EOCP
21876 #include <sys/stat.h>
21881 if (foo.st_ino < 0)
21888 if eval $compile; then
21892 $echo "(I can't execute the test program--guessing unsigned.)" >&4
21894 *) st_ino_sign=$val
21895 case "$st_ino_sign" in
21896 1) $echo "Your st_ino is unsigned." ;;
21897 -1) $echo "Your st_ino is signed." ;;
21903 $echo "(I can't compile the test program--guessing unsigned.)" >&4
21907 : see what type of char stdio uses.
21909 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21910 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21911 echo "Your stdio uses unsigned chars." >&4
21912 stdchar="unsigned char"
21914 echo "Your stdio uses signed chars." >&4
21919 : see what type uids are declared as in the kernel
21921 echo "Looking for the type for user ids returned by getuid()."
21922 set uid_t uidtype xxx stdio.h sys/types.h
21926 xxx=`./findhdr sys/user.h`
21927 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21929 unsigned) dflt="$1 $2" ;;
21933 *) dflt="$uidtype";;
21936 uid_t) echo "uid_t found." ;;
21937 *) rp="What is the type for user ids returned by getuid()?"
21943 : Check size of UID
21946 *_t) zzz="$uidtype" ;;
21949 echo "Checking the size of $zzz..." >&4
21951 #include <sys/types.h>
21953 #$i_stdlib I_STDLIB
21955 #include <stdlib.h>
21958 printf("%d\n", (int)sizeof($uidtype));
21963 if eval $compile_ok; then
21967 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21970 echo "Your $zzz is $uidsize bytes long."
21975 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21978 : Check if UID is signed
21981 *_t) zzz="$uidtype" ;;
21984 echo "Checking the sign of $zzz..." >&4
21986 #include <sys/types.h>
21997 if eval $compile; then
22001 echo "(I can't execute the test program--guessing unsigned.)" >&4
22005 1) echo "Your $zzz is unsigned." ;;
22006 -1) echo "Your $zzz is signed." ;;
22012 echo "(I can't compile the test program--guessing unsigned.)" >&4
22016 : Check format string for UID
22018 $echo "Checking the format string to be used for uids..." >&4
22021 -1) if $test X"$uidsize" = X"$ivsize"; then
22022 uidformat="$ivdformat"
22024 if $test X"$uidsize" = X"$longsize"; then
22027 if $test X"$uidsize" = X"$intsize"; then
22030 if $test X"$uidsize" = X"$shortsize"; then
22037 *) if $test X"$uidsize" = X"$uvsize"; then
22038 uidformat="$uvuformat"
22040 if $test X"$uidsize" = X"$longsize"; then
22043 if $test X"$uidsize" = X"$intsize"; then
22046 if $test X"$uidsize" = X"$shortsize"; then
22055 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
22057 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
22058 $cat >try.c <<'EOM'
22059 /* Intentionally a long probe as I'd like to sanity check that the exact
22060 approach is going to work, as thinking it will work, but only having it
22061 part working at runtime is worse than not having it. */
22063 #include <sys/types.h>
22064 #include <sys/sysctl.h>
22065 #include <sys/param.h>
22067 #include <string.h>
22068 #include <stdlib.h>
22069 #include <unistd.h>
22072 main(int argc, char **argv) {
22074 char *argv_leaf = strrchr(argv[0], '/');
22080 mib[1] = KERN_PROC;
22081 mib[2] = KERN_PROC_PATHNAME;
22085 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22089 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
22094 if (size < strlen(argv_leaf) + 1) {
22095 fprintf(stderr, "size %lu is too short for a path\n",
22096 (unsigned long) size);
22100 if (size > MAXPATHLEN * MAXPATHLEN) {
22101 fprintf(stderr, "size %lu is too long for a path\n",
22102 (unsigned long) size);
22106 buffer = malloc(size);
22112 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
22117 if (strlen(buffer) + 1 != size) {
22118 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
22119 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
22124 if (*buffer != '/') {
22125 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
22129 if (strstr(buffer, "/./")) {
22130 fprintf(stderr, "Contains /./: '%s'\n", buffer);
22134 if (strstr(buffer, "/../")) {
22135 fprintf(stderr, "Contains /../: '%s'\n", buffer);
22139 buffer_leaf = strrchr(buffer, '/');
22140 if (strcmp(buffer_leaf, argv_leaf) != 0) {
22141 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
22153 if eval $compile; then
22154 if $run ./try; then
22155 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
22158 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
22162 echo "I'm unable to compile the test program." >&4
22163 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
22167 set usekernprocpathname
22170 : Determine if we can use _NSGetExecutablePath to find executing program
22172 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
22173 $cat >try.c <<'EOM'
22174 /* Intentionally a long probe as I'd like to sanity check that the exact
22175 approach is going to work, as thinking it will work, but only having it
22176 part working at runtime is worse than not having it. */
22177 #include <mach-o/dyld.h>
22179 #include <stdlib.h>
22180 #include <sys/param.h>
22181 #include <string.h>
22184 main(int argc, char **argv) {
22186 uint32_t size = sizeof(buf);
22190 char *argv_leaf = strrchr(argv[0], '/');
22194 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
22198 _NSGetExecutablePath(buf, &size);
22199 if (size > MAXPATHLEN * MAXPATHLEN) {
22200 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
22201 (unsigned int) size);
22205 buffer = malloc(size);
22211 result = _NSGetExecutablePath(buffer, &size);
22213 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
22214 result, (unsigned int) size);
22218 tidied = realpath(buffer, NULL);
22220 perror("realpath");
22226 if (*tidied != '/') {
22227 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
22231 if (strstr(tidied, "/./")) {
22232 fprintf(stderr, "Contains /./: '%s'\n", tidied);
22236 if (strstr(tidied, "/../")) {
22237 fprintf(stderr, "Contains /../: '%s'\n", tidied);
22241 tidied_leaf = strrchr(tidied, '/');
22242 if (strcmp(tidied_leaf, argv_leaf) != 0) {
22243 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
22255 if eval $compile; then
22256 if $run ./try; then
22257 echo "You can use _NSGetExecutablePath to find the executing program." >&4
22260 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
22263 echo "I'm unable to compile the test program." >&4
22264 echo "I'll assume no _NSGetExecutablePath here." >&4
22267 set usensgetexecutablepath
22270 : Check if site customization support was requested
22271 case "$usesitecustomize" in
22272 $define|true|[Yy]*)
22273 usesitecustomize="$define"
22276 usesitecustomize="$undef"
22280 : see if prototypes support variable argument declarations
22282 case "$prototype$i_stdarg" in
22284 echo "It appears we'll be able to prototype varargs functions." >&4
22288 echo "Too bad... We won't be using prototyped varargs functions..." >&4
22295 : determine compiler compiler
22304 if $test -f "$byacc$_exe"; then
22306 comp="byacc or $comp"
22308 if $test -f "$bison$_exe"; then
22309 comp="$comp or bison -y"
22311 rp="Which compiler compiler ($comp) shall I use?"
22320 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
22326 : see if this is a assert.h system
22327 set assert.h i_assert
22330 : see if this is a bfd.h system
22334 : see if this is an execinfo.h system
22335 set execinfo.h i_execinfo
22338 : see if this is a fenv.h system
22342 : see if this is a fp.h system
22346 : see if this is a fp_class.h system
22347 set fp_class.h i_fp_class
22350 : see if gdbm.h is available
22355 : see if gdbm_open exists
22356 set gdbm_open d_gdbm_open
22358 case "$d_gdbm_open" in
22361 echo "We won't be including <gdbm.h>"
22370 : see if this is a ieeefp.h system
22371 case "$i_ieeefp" in
22372 '' ) set ieeefp.h i_ieeefp
22377 : see if this is a libutil.h system
22378 set libutil.h i_libutil
22381 : see if mach cthreads are available
22382 if test "X$usethreads" = "X$define"; then
22383 set mach/cthreads.h i_machcthr
22386 i_machcthr="$undef"
22389 : see if this is a mntent.h system
22390 set mntent.h i_mntent
22393 : see if net/errno.h is available
22395 set net/errno.h val
22398 : Unfortunately, it causes problems on some systems. Arrgh.
22401 cat > try.c <<'EOM'
22404 #include <net/errno.h>
22410 if $cc $ccflags -c try.c >/dev/null 2>&1; then
22411 echo "We'll be including <net/errno.h>." >&4
22413 echo "We won't be including <net/errno.h>." >&4
22422 : see if netinet/tcp.h is available
22423 set netinet/tcp.h i_netinettcp
22426 : see if this is a poll.h system
22430 : see if this is a prot.h system
22434 : Preprocessor symbols
22436 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
22437 $cat <<'EOSH' > Cppsym.know
22438 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
22439 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
22440 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
22441 arch_pwr ardent ARM ARM32 atarist att386 att3b
22442 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
22443 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
22444 byteorder byte_order
22445 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
22446 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
22447 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
22448 ELF encore EPI EXTENSIONS
22449 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
22450 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
22451 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
22452 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
22453 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400 hp9000s500
22454 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
22455 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
22456 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
22457 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
22459 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
22460 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
22461 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
22463 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
22464 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
22465 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
22466 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
22467 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
22468 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
22469 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
22470 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
22471 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
22472 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
22473 ns32000 ns32016 ns32332 ns32k nsc32000
22474 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
22475 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
22476 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
22477 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
22479 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
22480 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
22481 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
22482 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
22483 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
22484 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
22485 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
22486 SYSV4 SYSV5 sysV68 sysV88
22487 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
22488 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
22489 tower32_800 tower32_850 tss
22490 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
22491 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
22492 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
22493 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
22494 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
22495 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
22497 vax venix VMESA vms
22498 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
22499 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
22502 # Maybe put other stuff here too.
22503 ./tr '-' '_' <<EOSH >>Cppsym.know
22506 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
22507 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
22508 $cat Cppsym.know > Cppsym.c
22509 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
22510 $rm -f Cppsym.a Cppsym.b Cppsym.c
22511 cat <<EOSH > Cppsym
22513 if $test \$# -gt 0; then
22514 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
22515 if $test -s Cppsym.got; then
22522 $tr " " "$trnl" | ./Cppsym.try
22528 cat <<EOSH > Cppsym.try
22530 cat <<'EOCP' > try.c
22533 #define STRINGIFY(a) "a"
22535 #if cpp_stuff == 42
22536 #define StGiFy(a) #a
22537 #define STRINGIFY(a) StGiFy(a)
22539 #if $cpp_stuff != 1 && $cpp_stuff != 42
22540 # include "Bletch: How does this C preprocessor stringify macros?"
22546 cat <<'EOSH' >> Cppsym.try
22548 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
22549 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
22550 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
22551 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
22553 echo 'return 0;}' >> try.c
22555 cat <<EOSH >> Cppsym.try
22557 case "$osname-$gccversion" in
22558 irix-) ccflags="\$ccflags -woff 1178" ;;
22559 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
22561 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
22563 chmod +x Cppsym.try
22564 $eunicefix Cppsym.try
22565 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
22566 : Add in any Linux cpp "predefined macros":
22567 case "$osname::$gccversion" in
22568 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
22570 rm -f $tHdrH'.h' $tHdrH
22572 # Filter out macro arguments, such as Linux's __INT8_C(c)
22573 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
22574 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
22575 if [ -s $tHdrH'_cppsym.real' ]; then
22576 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
22579 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
22582 : now check the C compiler for additional symbols
22583 postprocess_cc_v=''
22585 aix) postprocess_cc_v="|$tr , ' '" ;;
22592 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
22595 -D*) echo "\$i" | $sed 's/^-D//';;
22596 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
22601 postprocess_cc_v=''
22604 ./ccsym > ccsym1.raw
22605 if $test -s ccsym1.raw; then
22606 $sort ccsym1.raw | $uniq >ccsym.raw
22608 mv ccsym1.raw ccsym.raw
22611 $awk '/\=/ { print $0; next }
22612 { print $0"=1" }' ccsym.raw >ccsym.list
22613 $comm -13 Cppsym.true ccsym.list >ccsym.own
22614 $comm -12 Cppsym.true ccsym.list >ccsym.com
22615 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
22617 if $test -z ccsym.raw; then
22618 echo "Your C compiler doesn't seem to define any symbols!" >&4
22620 echo "However, your C preprocessor defines the following symbols:"
22623 cppsymbols=`$cat Cppsym.true`
22624 cppsymbols=`echo $cppsymbols`
22625 cppccsymbols="$cppsymbols"
22627 if $test -s ccsym.com; then
22628 echo "Your C compiler and pre-processor define these symbols:"
22629 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
22632 cppccsymbols=`$cat ccsym.com`
22633 cppccsymbols=`echo $cppccsymbols`
22634 $test "$silent" || sleep 1
22636 if $test -s ccsym.cpp; then
22637 $test "$also" && echo " "
22638 echo "Your C pre-processor ${also}defines the following symbols:"
22639 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
22641 cppsymbols=`$cat ccsym.cpp`
22642 cppsymbols=`echo $cppsymbols`
22643 $test "$silent" || sleep 1
22645 if $test -s ccsym.own; then
22646 $test "$also" && echo " "
22647 echo "Your C compiler ${also}defines the following cpp symbols:"
22648 $sed -e 's/\(..*\)=1/\1/' ccsym.own
22649 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
22650 ccsymbols=`$cat ccsym.own`
22651 ccsymbols=`echo $ccsymbols`
22652 $test "$silent" || sleep 1
22656 : add -D_FORTIFY_SOURCE if feasible and not already there
22657 case "$gccversion" in
22658 4.*) case "$optimize$ccflags" in
22659 *-O*) case "$ccflags$cppsymbols" in
22660 *_FORTIFY_SOURCE=*) # Don't add it again.
22661 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
22663 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
22664 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
22668 *) echo "You have gcc 4.* but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
22672 *) echo "You seem not to have gcc 4.*, not adding -D_FORTIFY_SOURCE." >&4
22676 : see if this is a termio system
22680 if $test `./findhdr termios.h`; then
22681 set tcsetattr i_termios
22687 "$define") echo "You have POSIX termios.h... good!" >&4;;
22688 *) if ./Cppsym pyr; then
22689 case "`$run /bin/universe`" in
22690 ucb) if $test `./findhdr sgtty.h`; then
22692 echo "<sgtty.h> found." >&4
22694 echo "System is pyramid with BSD universe."
22695 ./warn "<sgtty.h> not found--you could have problems."
22697 *) if $test `./findhdr termio.h`; then
22699 echo "<termio.h> found." >&4
22701 echo "System is pyramid with USG universe."
22702 ./warn "<termio.h> not found--you could have problems."
22706 if $test `./findhdr termio.h`; then
22707 echo "<termio.h> found." >&4
22709 elif $test `./findhdr sgtty.h`; then
22710 echo "<sgtty.h> found." >&4
22713 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
22716 if $test `./findhdr sgtty.h`; then
22717 echo "<sgtty.h> found." >&4
22719 elif $test `./findhdr termio.h`; then
22720 echo "<termio.h> found." >&4
22723 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
22727 set i_termio; eval $setvar
22728 val=$val2; set i_sgtty; eval $setvar
22729 val=$val3; set i_termios; eval $setvar
22731 : see if stdbool is available
22732 : we want a real compile instead of Inhdr because some Solaris systems
22733 : have stdbool.h, but it can only be used if the compiler indicates it
22734 : is sufficiently c99-compliant.
22738 #include <stdbool.h>
22743 int main(int argc, char **argv)
22749 if eval $compile; then
22750 echo "<stdbool.h> found." >&4
22753 echo "<stdbool.h> NOT found." >&4
22760 : see if stddef is available
22761 set stddef.h i_stddef
22764 : see if stdint is available
22765 set stdint.h i_stdint
22768 : see if sys/access.h is available
22769 set sys/access.h i_sysaccess
22772 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
22773 set sys/filio.h i_sysfilio
22776 if $test `./findhdr sys/ioctl.h`; then
22778 echo '<sys/ioctl.h> found.' >&4
22781 if $test $i_sysfilio = "$define"; then
22782 echo '<sys/ioctl.h> NOT found.' >&4
22784 $test $i_sgtty = "$define" && xxx="sgtty.h"
22785 $test $i_termio = "$define" && xxx="termio.h"
22786 $test $i_termios = "$define" && xxx="termios.h"
22787 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
22793 : see if socket ioctl defs are in sys/sockio.h
22795 xxx=`./findhdr sys/sockio.h`
22796 if $test "$xxx"; then
22797 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
22799 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
22802 echo "No socket ioctls found in <sys/sockio.h>." >&4
22807 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
22813 : see if this is a syslog.h system
22814 set syslog.h i_syslog
22817 : see if this is a sys/mode.h system
22818 set sys/mode.h i_sysmode
22821 : see if there is a sys/poll.h file
22822 set sys/poll.h i_syspoll
22825 : see if sys/resource.h has to be included
22826 set sys/resource.h i_sysresrc
22829 : see if sys/security.h is available
22830 set sys/security.h i_syssecrt
22833 : see if this is a sys/statvfs.h system
22834 set sys/statvfs.h i_sysstatvfs
22837 : see if this is a sys/un.h system
22838 set sys/un.h i_sysun
22841 : see if this is a sys/utsname.h system
22842 set sys/utsname.h i_sysutsname
22845 : see if this is a syswait system
22846 set sys/wait.h i_syswait
22849 : see if this is a ustat.h system
22850 set ustat.h i_ustat
22853 : see if this is an utime system
22854 set utime.h i_utime
22857 : see if this is a vfork system
22860 set vfork.h i_vfork
22870 echo "Looking for extensions..." >&4
22871 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
22872 : contain old or inaccurate or duplicate values.
22873 nonxs_extensions=''
22875 : We do not use find because it might not be available.
22876 : We do not just use MANIFEST because the user may have dropped
22877 : some additional extensions into the source tree and expect them
22880 : Function to recursively find available extensions, ignoring DynaLoader
22881 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
22882 : In 5.10.1 and later, extensions are stored in directories
22883 : like File-Glob instead of the older File/Glob/.
22887 DynaLoader|dynaload) ;;
22889 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
22890 case "$this_ext" in
22891 Scalar/List/Utils) this_ext="List/Util" ;;
22892 PathTools) this_ext="Cwd" ;;
22894 echo " $xs_extensions $nonxs_extensions" > $tdir/$$.tmp;
22895 if $contains " $this_ext " $tdir/$$.tmp; then
22897 echo "Duplicate directories detected for extension $xxx" >&4;
22898 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
22899 case "$knowitall" in
22907 echo "Ok. Stopping Configure." >&4;
22908 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
22911 echo "Ok. You will need to correct config.sh before running make." >&4;
22913 $ls -1 $xxx > $tdir/$$.tmp;
22914 if $contains "\.xs$" $tdir/$$.tmp > /dev/null 2>&1; then
22915 xs_extensions="$xs_extensions $this_ext";
22916 elif $contains "\.c$" $tdir/$$.tmp > /dev/null 2>&1; then
22917 xs_extensions="$xs_extensions $this_ext";
22918 elif $test -d $xxx; then
22919 nonxs_extensions="$nonxs_extensions $this_ext";
22921 $rm -f $tdir/$$.tmp;
22929 eval $find_extensions
22933 eval $find_extensions
22937 eval $find_extensions
22938 set X $xs_extensions
22940 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22941 set X $nonxs_extensions
22943 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22945 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
22947 : Now see which are supported on this system.
22949 for xxx in $xs_extensions ; do
22953 $define) avail_ext="$avail_ext $xxx" ;;
22956 GDBM_File|gdbm_fil)
22958 $define) avail_ext="$avail_ext $xxx" ;;
22961 I18N/Langinfo|i18n_lan)
22962 case "$i_langinfo$d_nl_langinfo" in
22963 $define$define) avail_ext="$avail_ext $xxx" ;;
22967 : XXX Do we need a useipcsysv variable here
22968 case "${d_msg}${d_sem}${d_shm}" in
22969 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
22972 NDBM_File|ndbm_fil)
22975 case "$osname-$use64bitint" in
22978 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
22981 *) avail_ext="$avail_ext $xxx" ;;
22986 ODBM_File|odbm_fil)
22987 case "${i_dbm}${i_rpcsvcdbm}" in
22989 case "$d_cplusplus" in
22990 define) ;; # delete as a function name will not work
22991 *) case "$osname-$use64bitint" in
22994 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
22997 *) avail_ext="$avail_ext $xxx" ;;
23005 case "$useopcode" in
23006 true|define|y) avail_ext="$avail_ext $xxx" ;;
23010 case "$useposix" in
23011 true|define|y) avail_ext="$avail_ext $xxx" ;;
23015 case "$d_socket" in
23016 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23019 Sys/Syslog|sys/syslog)
23020 : XXX syslog requires socket
23021 case "$d_socket" in
23022 true|$define|y) avail_ext="$avail_ext $xxx" ;;
23026 case "$usethreads" in
23028 case "$use5005threads" in
23029 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
23033 threads|threads/shared)
23034 # threads and threads::shared are special cases.
23035 # To stop people from asking "Perl 5.8.0 was supposed
23036 # to have this new fancy threads implementation but my
23037 # perl doesn't have it" and from people trying to
23038 # (re)install the threads module using CPAN.pm and
23039 # CPAN.pm then offering to reinstall Perl 5.8.0,
23040 # the threads.pm and threads/shared.pm will always be
23041 # there, croaking informatively ("you need to rebuild
23042 # all of Perl with threads, sorry") when threads haven't
23043 # been compiled in.
23045 avail_ext="$avail_ext $xxx"
23051 cygwin) avail_ext="$avail_ext $xxx" ;;
23054 XS/APItest|xs/apitest)
23055 # This is just for testing. Skip it unless we have dynamic loading.
23058 $define) avail_ext="$avail_ext $xxx" ;;
23061 XS/Typemap|xs/typemap)
23062 # This is just for testing. Skip it unless we have dynamic loading.
23064 $define) avail_ext="$avail_ext $xxx" ;;
23067 *) avail_ext="$avail_ext $xxx"
23076 case "$onlyextensions" in
23078 *) keepextensions=''
23079 echo "You have requested that only certain extensions be included..." >&4
23080 for i in $onlyextensions; do
23081 case " $avail_ext " in
23083 echo "Keeping extension $i."
23084 keepextensions="$keepextensions $i"
23086 *) echo "Ignoring extension $i." ;;
23089 avail_ext="$keepextensions"
23093 case "$noextensions" in
23095 *) keepextensions=''
23096 echo "You have requested that certain extensions be ignored..." >&4
23097 for i in $avail_ext; do
23098 case " $noextensions " in
23099 *" $i "*) echo "Ignoring extension $i." ;;
23100 *) echo "Keeping extension $i.";
23101 keepextensions="$keepextensions $i"
23105 avail_ext="$keepextensions"
23109 : Now see which nonxs extensions are supported on this system.
23110 : For now assume all are.
23112 for xxx in $nonxs_extensions ; do
23116 *) nonxs_ext="$nonxs_ext $xxx"
23128 A number of extensions are supplied with $package. You may choose to
23129 compile these extensions for dynamic loading (the default), compile
23130 them into the $package executable (static loading), or not include
23131 them at all. Answer "none" to include no extensions.
23132 Note that DynaLoader is always built and need not be mentioned here.
23135 case "$dynamic_ext" in
23137 : Exclude those listed in static_ext
23139 for xxx in $avail_ext; do
23140 case " $static_ext " in
23142 *) dflt="$dflt $xxx" ;;
23149 *) dflt="$dynamic_ext"
23150 # Perhaps we are reusing an old out-of-date config.sh.
23153 if test X"$dynamic_ext" != X"$avail_ext"; then
23155 NOTICE: Your previous config.sh list may be incorrect.
23156 The extensions now available to you are
23158 but the default list from your previous config.sh is
23170 rp="What extensions do you wish to load dynamically?"
23173 none) dynamic_ext=' ' ;;
23174 *) dynamic_ext="$ans" ;;
23177 case "$static_ext" in
23179 : Exclude those already listed in dynamic linking
23181 for xxx in $avail_ext; do
23182 case " $dynamic_ext " in
23184 *) dflt="$dflt $xxx" ;;
23191 *) dflt="$static_ext"
23198 rp="What extensions do you wish to load statically?"
23201 none) static_ext=' ' ;;
23202 *) static_ext="$ans" ;;
23207 A number of extensions are supplied with $package. Answer "none"
23208 to include no extensions.
23209 Note that DynaLoader is always built and need not be mentioned here.
23212 case "$static_ext" in
23213 '') dflt="$avail_ext" ;;
23214 *) dflt="$static_ext"
23215 # Perhaps we are reusing an old out-of-date config.sh.
23218 if test X"$static_ext" != X"$avail_ext"; then
23220 NOTICE: Your previous config.sh list may be incorrect.
23221 The extensions now available to you are
23223 but the default list from your previous config.sh is
23232 : Exclude those that are not xs extensions
23236 rp="What extensions do you wish to include?"
23239 none) static_ext=' ' ;;
23240 *) static_ext="$ans" ;;
23245 # Encode is a special case. If we are building Encode as a static
23246 # extension, we need to explicitly list its subextensions as well.
23247 # For other nested extensions, this is handled automatically by
23248 # the appropriate Makefile.PL.
23249 case " $static_ext " in
23250 *" Encode "*) # Add the subextensions of Encode
23252 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
23253 static_ext="$static_ext Encode/$xxx"
23254 known_extensions="$known_extensions Encode/$xxx"
23260 set X $dynamic_ext $static_ext $nonxs_ext
23264 # Sanity check: We require an extension suitable for use with
23265 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
23266 # should show up as failures in the test suite, but it's helpful to
23267 # catch them now.) The 'extensions' list is normally sorted
23268 # alphabetically, so we need to accept either
23269 # DB_File ... Fcntl ... IO ....
23270 # or something like
23271 # Fcntl ... NDBM_File ... IO ....
23272 case " $extensions" in
23273 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
23274 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
23275 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
23276 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
23277 echo "WARNING: The Perl you are building will be quite crippled." >& 4
23281 : Remove libraries needed only for extensions
23282 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
23283 : The exception is SunOS 4.x, which needs them.
23284 case "${osname}X${osvers}" in
23288 *) case "$usedl" in
23289 $define|true|[yY]*)
23290 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
23294 *) perllibs="$libs"
23300 : Remove build directory name from cppstdin so it can be used from
23301 : either the present location or the final installed location.
23303 : Get out of the UU directory to get correct path name.
23305 case "$cppstdin" in
23307 echo "Stripping down cppstdin path name"
23313 : end of configuration questions
23315 echo "End of configuration questions."
23318 : back to where it started
23319 if test -d ../UU; then
23323 : configuration may be unconditionally patched via a 'config.arch' file
23324 if $test -f config.arch; then
23325 echo "I see a config.arch file, loading it." >&4
23329 : configuration may be patched via a 'config.over' file
23330 if $test -f config.over; then
23333 rp='I see a config.over file. Do you wish to load it?'
23336 n*) echo "OK, I'll ignore it.";;
23338 echo "Configuration override changes have been loaded."
23343 : in case they want portability, strip down executable paths
23344 case "$d_portable" in
23347 echo "Stripping down executable paths..." >&4
23348 for file in $loclist $trylist; do
23350 eval $file=`basename $temp`
23355 : create config.sh file
23357 echo "Creating config.sh..." >&4
23358 $spitshell <<EOT >config.sh
23361 # This file was produced by running the Configure script. It holds all the
23362 # definitions figured out by Configure. Should you modify one of these values,
23363 # do not forget to propagate your changes by running "Configure -der". You may
23364 # instead choose to run each of the .SH files by yourself, or "Configure -S".
23367 # Package name : $package
23368 # Source directory : $src
23369 # Configuration time: $cf_time
23370 # Configured by : $cf_by
23371 # Target system : $myuname
23374 : Add in command line options if available
23375 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23377 $spitshell <<EOT >>config.sh
23386 Revision='$Revision'
23394 alignbytes='$alignbytes'
23395 ansi2knr='$ansi2knr'
23396 aphostname='$aphostname'
23397 api_revision='$api_revision'
23398 api_subversion='$api_subversion'
23399 api_version='$api_version'
23400 api_versionstring='$api_versionstring'
23403 archlibexp='$archlibexp'
23404 archname64='$archname64'
23405 archname='$archname'
23406 archobjs='$archobjs'
23407 asctime_r_proto='$asctime_r_proto'
23416 byteorder='$byteorder'
23418 castflags='$castflags'
23421 cccdlflags='$cccdlflags'
23422 ccdlflags='$ccdlflags'
23424 ccflags_uselargefiles='$ccflags_uselargefiles'
23426 ccsymbols='$ccsymbols'
23427 ccversion='$ccversion'
23429 cf_email='$cf_email'
23431 charbits='$charbits'
23432 charsize='$charsize'
23436 clocktype='$clocktype'
23438 compress='$compress'
23439 contains='$contains'
23443 cpp_stuff='$cpp_stuff'
23444 cppccsymbols='$cppccsymbols'
23445 cppflags='$cppflags'
23447 cppminus='$cppminus'
23449 cppstdin='$cppstdin'
23450 cppsymbols='$cppsymbols'
23451 crypt_r_proto='$crypt_r_proto'
23452 cryptlib='$cryptlib'
23454 ctermid_r_proto='$ctermid_r_proto'
23455 ctime_r_proto='$ctime_r_proto'
23456 d_Gconvert='$d_Gconvert'
23457 d_PRIEUldbl='$d_PRIEUldbl'
23458 d_PRIFUldbl='$d_PRIFUldbl'
23459 d_PRIGUldbl='$d_PRIGUldbl'
23460 d_PRIXU64='$d_PRIXU64'
23461 d_PRId64='$d_PRId64'
23462 d_PRIeldbl='$d_PRIeldbl'
23463 d_PRIfldbl='$d_PRIfldbl'
23464 d_PRIgldbl='$d_PRIgldbl'
23465 d_PRIi64='$d_PRIi64'
23466 d_PRIo64='$d_PRIo64'
23467 d_PRIu64='$d_PRIu64'
23468 d_PRIx64='$d_PRIx64'
23469 d_SCNfldbl='$d_SCNfldbl'
23470 d__fwalk='$d__fwalk'
23471 d_access='$d_access'
23472 d_accessx='$d_accessx'
23476 d_archlib='$d_archlib'
23477 d_asctime64='$d_asctime64'
23478 d_asctime_r='$d_asctime_r'
23481 d_attribute_deprecated='$d_attribute_deprecated'
23482 d_attribute_format='$d_attribute_format'
23483 d_attribute_malloc='$d_attribute_malloc'
23484 d_attribute_nonnull='$d_attribute_nonnull'
23485 d_attribute_noreturn='$d_attribute_noreturn'
23486 d_attribute_pure='$d_attribute_pure'
23487 d_attribute_unused='$d_attribute_unused'
23488 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
23489 d_backtrace='$d_backtrace'
23493 d_bsdgetpgrp='$d_bsdgetpgrp'
23494 d_bsdsetpgrp='$d_bsdsetpgrp'
23495 d_builtin_choose_expr='$d_builtin_choose_expr'
23496 d_builtin_expect='$d_builtin_expect'
23498 d_c99_variadic_macros='$d_c99_variadic_macros'
23499 d_casti32='$d_casti32'
23500 d_castneg='$d_castneg'
23501 d_charvspr='$d_charvspr'
23503 d_chroot='$d_chroot'
23504 d_chsize='$d_chsize'
23506 d_clearenv='$d_clearenv'
23507 d_closedir='$d_closedir'
23508 d_cmsghdr_s='$d_cmsghdr_s'
23510 d_copysignl='$d_copysignl'
23511 d_cplusplus='$d_cplusplus'
23513 d_crypt_r='$d_crypt_r'
23515 d_ctermid='$d_ctermid'
23516 d_ctermid_r='$d_ctermid_r'
23517 d_ctime64='$d_ctime64'
23518 d_ctime_r='$d_ctime_r'
23519 d_cuserid='$d_cuserid'
23520 d_dbl_dig='$d_dbl_dig'
23521 d_dbminitproto='$d_dbminitproto'
23522 d_difftime64='$d_difftime64'
23523 d_difftime='$d_difftime'
23524 d_dir_dd_fd='$d_dir_dd_fd'
23526 d_dirnamlen='$d_dirnamlen'
23527 d_dladdr='$d_dladdr'
23528 d_dlerror='$d_dlerror'
23529 d_dlopen='$d_dlopen'
23530 d_dlsymun='$d_dlsymun'
23531 d_dosuid='$d_dosuid'
23532 d_drand48_r='$d_drand48_r'
23533 d_drand48proto='$d_drand48proto'
23535 d_eaccess='$d_eaccess'
23536 d_endgrent='$d_endgrent'
23537 d_endgrent_r='$d_endgrent_r'
23538 d_endhent='$d_endhent'
23539 d_endhostent_r='$d_endhostent_r'
23540 d_endnent='$d_endnent'
23541 d_endnetent_r='$d_endnetent_r'
23542 d_endpent='$d_endpent'
23543 d_endprotoent_r='$d_endprotoent_r'
23544 d_endpwent='$d_endpwent'
23545 d_endpwent_r='$d_endpwent_r'
23546 d_endsent='$d_endsent'
23547 d_endservent_r='$d_endservent_r'
23548 d_eofnblk='$d_eofnblk'
23549 d_eunice='$d_eunice'
23550 d_faststdio='$d_faststdio'
23551 d_fchdir='$d_fchdir'
23552 d_fchmod='$d_fchmod'
23553 d_fchown='$d_fchown'
23555 d_fcntl_can_lock='$d_fcntl_can_lock'
23556 d_fd_macros='$d_fd_macros'
23557 d_fd_set='$d_fd_set'
23558 d_fds_bits='$d_fds_bits'
23559 d_fegetround='$d_fegetround'
23560 d_fgetpos='$d_fgetpos'
23561 d_finite='$d_finite'
23562 d_finitel='$d_finitel'
23563 d_flexfnam='$d_flexfnam'
23565 d_flockproto='$d_flockproto'
23567 d_fp_class='$d_fp_class'
23568 d_fp_classify='$d_fp_classify'
23569 d_fp_classl='$d_fp_classl'
23570 d_fpathconf='$d_fpathconf'
23571 d_fpclass='$d_fpclass'
23572 d_fpclassify='$d_fpclassify'
23573 d_fpclassl='$d_fpclassl'
23574 d_fpgetround='$d_fpgetround'
23575 d_fpos64_t='$d_fpos64_t'
23576 d_frexpl='$d_frexpl'
23577 d_fs_data_s='$d_fs_data_s'
23578 d_fseeko='$d_fseeko'
23579 d_fsetpos='$d_fsetpos'
23580 d_fstatfs='$d_fstatfs'
23581 d_fstatvfs='$d_fstatvfs'
23583 d_ftello='$d_ftello'
23585 d_futimes='$d_futimes'
23586 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
23587 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
23588 d_getaddrinfo='$d_getaddrinfo'
23589 d_getcwd='$d_getcwd'
23590 d_getespwnam='$d_getespwnam'
23591 d_getfsstat='$d_getfsstat'
23592 d_getgrent='$d_getgrent'
23593 d_getgrent_r='$d_getgrent_r'
23594 d_getgrgid_r='$d_getgrgid_r'
23595 d_getgrnam_r='$d_getgrnam_r'
23596 d_getgrps='$d_getgrps'
23597 d_gethbyaddr='$d_gethbyaddr'
23598 d_gethbyname='$d_gethbyname'
23599 d_gethent='$d_gethent'
23600 d_gethname='$d_gethname'
23601 d_gethostbyaddr_r='$d_gethostbyaddr_r'
23602 d_gethostbyname_r='$d_gethostbyname_r'
23603 d_gethostent_r='$d_gethostent_r'
23604 d_gethostprotos='$d_gethostprotos'
23605 d_getitimer='$d_getitimer'
23606 d_getlogin='$d_getlogin'
23607 d_getlogin_r='$d_getlogin_r'
23608 d_getmnt='$d_getmnt'
23609 d_getmntent='$d_getmntent'
23610 d_getnameinfo='$d_getnameinfo'
23611 d_getnbyaddr='$d_getnbyaddr'
23612 d_getnbyname='$d_getnbyname'
23613 d_getnent='$d_getnent'
23614 d_getnetbyaddr_r='$d_getnetbyaddr_r'
23615 d_getnetbyname_r='$d_getnetbyname_r'
23616 d_getnetent_r='$d_getnetent_r'
23617 d_getnetprotos='$d_getnetprotos'
23618 d_getpagsz='$d_getpagsz'
23619 d_getpbyname='$d_getpbyname'
23620 d_getpbynumber='$d_getpbynumber'
23621 d_getpent='$d_getpent'
23622 d_getpgid='$d_getpgid'
23623 d_getpgrp2='$d_getpgrp2'
23624 d_getpgrp='$d_getpgrp'
23625 d_getppid='$d_getppid'
23626 d_getprior='$d_getprior'
23627 d_getprotobyname_r='$d_getprotobyname_r'
23628 d_getprotobynumber_r='$d_getprotobynumber_r'
23629 d_getprotoent_r='$d_getprotoent_r'
23630 d_getprotoprotos='$d_getprotoprotos'
23631 d_getprpwnam='$d_getprpwnam'
23632 d_getpwent='$d_getpwent'
23633 d_getpwent_r='$d_getpwent_r'
23634 d_getpwnam_r='$d_getpwnam_r'
23635 d_getpwuid_r='$d_getpwuid_r'
23636 d_getsbyname='$d_getsbyname'
23637 d_getsbyport='$d_getsbyport'
23638 d_getsent='$d_getsent'
23639 d_getservbyname_r='$d_getservbyname_r'
23640 d_getservbyport_r='$d_getservbyport_r'
23641 d_getservent_r='$d_getservent_r'
23642 d_getservprotos='$d_getservprotos'
23643 d_getspnam='$d_getspnam'
23644 d_getspnam_r='$d_getspnam_r'
23645 d_gettimeod='$d_gettimeod'
23646 d_gmtime64='$d_gmtime64'
23647 d_gmtime_r='$d_gmtime_r'
23648 d_gnulibc='$d_gnulibc'
23649 d_grpasswd='$d_grpasswd'
23650 d_hasmntopt='$d_hasmntopt'
23652 d_ilogbl='$d_ilogbl'
23653 d_inc_version_list='$d_inc_version_list'
23655 d_inetaton='$d_inetaton'
23656 d_inetntop='$d_inetntop'
23657 d_inetpton='$d_inetpton'
23658 d_int64_t='$d_int64_t'
23659 d_ip_mreq='$d_ip_mreq'
23660 d_ip_mreq_source='$d_ip_mreq_source'
23661 d_ipv6_mreq='$d_ipv6_mreq'
23662 d_ipv6_mreq_source='$d_ipv6_mreq_source'
23663 d_isascii='$d_isascii'
23664 d_isblank='$d_isblank'
23665 d_isfinite='$d_isfinite'
23666 d_isfinitel='$d_isfinitel'
23668 d_isinfl='$d_isinfl'
23670 d_isnanl='$d_isnanl'
23673 d_killpg='$d_killpg'
23674 d_lchown='$d_lchown'
23675 d_ldbl_dig='$d_ldbl_dig'
23676 d_ldexpl='$d_ldexpl'
23677 d_libm_lib_version='$d_libm_lib_version'
23678 d_libname_unique='$d_libname_unique'
23680 d_localtime64='$d_localtime64'
23681 d_localtime_r='$d_localtime_r'
23682 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
23683 d_locconv='$d_locconv'
23684 d_lc_monetary_2008='$d_lc_monetary_2008'
23686 d_longdbl='$d_longdbl'
23687 d_longlong='$d_longlong'
23688 d_lseekproto='$d_lseekproto'
23690 d_madvise='$d_madvise'
23691 d_malloc_good_size='$d_malloc_good_size'
23692 d_malloc_size='$d_malloc_size'
23694 d_mbstowcs='$d_mbstowcs'
23695 d_mbtowc='$d_mbtowc'
23696 d_memchr='$d_memchr'
23697 d_memcmp='$d_memcmp'
23698 d_memcpy='$d_memcpy'
23699 d_memmove='$d_memmove'
23700 d_memset='$d_memset'
23702 d_mkdtemp='$d_mkdtemp'
23703 d_mkfifo='$d_mkfifo'
23704 d_mkstemp='$d_mkstemp'
23705 d_mkstemps='$d_mkstemps'
23706 d_mktime64='$d_mktime64'
23707 d_mktime='$d_mktime'
23710 d_modfl_pow32_bug='$d_modfl_pow32_bug'
23711 d_modflproto='$d_modflproto'
23712 d_mprotect='$d_mprotect'
23714 d_msg_ctrunc='$d_msg_ctrunc'
23715 d_msg_dontroute='$d_msg_dontroute'
23716 d_msg_oob='$d_msg_oob'
23717 d_msg_peek='$d_msg_peek'
23718 d_msg_proxy='$d_msg_proxy'
23719 d_msgctl='$d_msgctl'
23720 d_msgget='$d_msgget'
23721 d_msghdr_s='$d_msghdr_s'
23722 d_msgrcv='$d_msgrcv'
23723 d_msgsnd='$d_msgsnd'
23725 d_munmap='$d_munmap'
23726 d_mymalloc='$d_mymalloc'
23728 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
23730 d_nl_langinfo='$d_nl_langinfo'
23731 d_nv_preserves_uv='$d_nv_preserves_uv'
23732 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
23733 d_off64_t='$d_off64_t'
23734 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
23735 d_oldpthreads='$d_oldpthreads'
23736 d_oldsock='$d_oldsock'
23738 d_pathconf='$d_pathconf'
23740 d_perl_otherlibdirs='$d_perl_otherlibdirs'
23741 d_phostname='$d_phostname'
23744 d_portable='$d_portable'
23746 d_prctl_set_name='$d_prctl_set_name'
23747 d_printf_format_null='$d_printf_format_null'
23748 d_procselfexe='$d_procselfexe'
23749 d_pseudofork='$d_pseudofork'
23750 d_pthread_atfork='$d_pthread_atfork'
23751 d_pthread_attr_setscope='$d_pthread_attr_setscope'
23752 d_pthread_yield='$d_pthread_yield'
23753 d_ptrdiff_t='$d_ptrdiff_t'
23755 d_pwchange='$d_pwchange'
23756 d_pwclass='$d_pwclass'
23757 d_pwcomment='$d_pwcomment'
23758 d_pwexpire='$d_pwexpire'
23759 d_pwgecos='$d_pwgecos'
23760 d_pwpasswd='$d_pwpasswd'
23761 d_pwquota='$d_pwquota'
23764 d_random_r='$d_random_r'
23765 d_readdir64_r='$d_readdir64_r'
23766 d_readdir='$d_readdir'
23767 d_readdir_r='$d_readdir_r'
23768 d_readlink='$d_readlink'
23770 d_recvmsg='$d_recvmsg'
23771 d_rename='$d_rename'
23772 d_rewinddir='$d_rewinddir'
23774 d_safebcpy='$d_safebcpy'
23775 d_safemcpy='$d_safemcpy'
23776 d_sanemcmp='$d_sanemcmp'
23777 d_sbrkproto='$d_sbrkproto'
23778 d_scalbnl='$d_scalbnl'
23779 d_sched_yield='$d_sched_yield'
23780 d_scm_rights='$d_scm_rights'
23781 d_seekdir='$d_seekdir'
23782 d_select='$d_select'
23784 d_semctl='$d_semctl'
23785 d_semctl_semid_ds='$d_semctl_semid_ds'
23786 d_semctl_semun='$d_semctl_semun'
23787 d_semget='$d_semget'
23789 d_sendmsg='$d_sendmsg'
23790 d_setegid='$d_setegid'
23791 d_seteuid='$d_seteuid'
23792 d_setgrent='$d_setgrent'
23793 d_setgrent_r='$d_setgrent_r'
23794 d_setgrps='$d_setgrps'
23795 d_sethent='$d_sethent'
23796 d_sethostent_r='$d_sethostent_r'
23797 d_setitimer='$d_setitimer'
23798 d_setlinebuf='$d_setlinebuf'
23799 d_setlocale='$d_setlocale'
23800 d_setlocale_r='$d_setlocale_r'
23801 d_setnent='$d_setnent'
23802 d_setnetent_r='$d_setnetent_r'
23803 d_setpent='$d_setpent'
23804 d_setpgid='$d_setpgid'
23805 d_setpgrp2='$d_setpgrp2'
23806 d_setpgrp='$d_setpgrp'
23807 d_setprior='$d_setprior'
23808 d_setproctitle='$d_setproctitle'
23809 d_setprotoent_r='$d_setprotoent_r'
23810 d_setpwent='$d_setpwent'
23811 d_setpwent_r='$d_setpwent_r'
23812 d_setregid='$d_setregid'
23813 d_setresgid='$d_setresgid'
23814 d_setresuid='$d_setresuid'
23815 d_setreuid='$d_setreuid'
23816 d_setrgid='$d_setrgid'
23817 d_setruid='$d_setruid'
23818 d_setsent='$d_setsent'
23819 d_setservent_r='$d_setservent_r'
23820 d_setsid='$d_setsid'
23821 d_setvbuf='$d_setvbuf'
23824 d_shmatprototype='$d_shmatprototype'
23825 d_shmctl='$d_shmctl'
23827 d_shmget='$d_shmget'
23828 d_sigaction='$d_sigaction'
23829 d_signbit='$d_signbit'
23830 d_sigprocmask='$d_sigprocmask'
23831 d_sigsetjmp='$d_sigsetjmp'
23832 d_sin6_scope_id='$d_sin6_scope_id'
23833 d_sitearch='$d_sitearch'
23834 d_snprintf='$d_snprintf'
23835 d_sockaddr_in6='$d_sockaddr_in6'
23836 d_sockaddr_sa_len='$d_sockaddr_sa_len'
23837 d_sockatmark='$d_sockatmark'
23838 d_sockatmarkproto='$d_sockatmarkproto'
23839 d_socket='$d_socket'
23840 d_socklen_t='$d_socklen_t'
23841 d_sockpair='$d_sockpair'
23842 d_socks5_init='$d_socks5_init'
23843 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
23845 d_srand48_r='$d_srand48_r'
23846 d_srandom_r='$d_srandom_r'
23847 d_sresgproto='$d_sresgproto'
23848 d_sresuproto='$d_sresuproto'
23849 d_statblks='$d_statblks'
23850 d_statfs_f_flags='$d_statfs_f_flags'
23851 d_statfs_s='$d_statfs_s'
23852 d_static_inline='$d_static_inline'
23853 d_statvfs='$d_statvfs'
23854 d_stdio_cnt_lval='$d_stdio_cnt_lval'
23855 d_stdio_ptr_lval='$d_stdio_ptr_lval'
23856 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
23857 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
23858 d_stdio_stream_array='$d_stdio_stream_array'
23859 d_stdiobase='$d_stdiobase'
23860 d_stdstdio='$d_stdstdio'
23861 d_strchr='$d_strchr'
23862 d_strcoll='$d_strcoll'
23863 d_strctcpy='$d_strctcpy'
23864 d_strerrm='$d_strerrm'
23865 d_strerror='$d_strerror'
23866 d_strerror_r='$d_strerror_r'
23867 d_strftime='$d_strftime'
23868 d_strlcat='$d_strlcat'
23869 d_strlcpy='$d_strlcpy'
23870 d_strtod='$d_strtod'
23871 d_strtol='$d_strtol'
23872 d_strtold='$d_strtold'
23873 d_strtoll='$d_strtoll'
23874 d_strtoq='$d_strtoq'
23875 d_strtoul='$d_strtoul'
23876 d_strtoull='$d_strtoull'
23877 d_strtouq='$d_strtouq'
23878 d_strxfrm='$d_strxfrm'
23879 d_suidsafe='$d_suidsafe'
23880 d_symlink='$d_symlink'
23881 d_syscall='$d_syscall'
23882 d_syscallproto='$d_syscallproto'
23883 d_sysconf='$d_sysconf'
23884 d_sysernlst='$d_sysernlst'
23885 d_syserrlst='$d_syserrlst'
23886 d_system='$d_system'
23887 d_tcgetpgrp='$d_tcgetpgrp'
23888 d_tcsetpgrp='$d_tcsetpgrp'
23889 d_telldir='$d_telldir'
23890 d_telldirproto='$d_telldirproto'
23892 d_timegm='$d_timegm'
23894 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
23895 d_tm_tm_zone='$d_tm_tm_zone'
23896 d_tmpnam_r='$d_tmpnam_r'
23897 d_truncate='$d_truncate'
23898 d_truncl='$d_truncl'
23899 d_ttyname_r='$d_ttyname_r'
23900 d_tzname='$d_tzname'
23901 d_u32align='$d_u32align'
23902 d_ualarm='$d_ualarm'
23905 d_union_semun='$d_union_semun'
23906 d_unordered='$d_unordered'
23907 d_unsetenv='$d_unsetenv'
23908 d_usleep='$d_usleep'
23909 d_usleepproto='$d_usleepproto'
23911 d_vendorarch='$d_vendorarch'
23912 d_vendorbin='$d_vendorbin'
23913 d_vendorlib='$d_vendorlib'
23914 d_vendorscript='$d_vendorscript'
23916 d_void_closedir='$d_void_closedir'
23917 d_voidsig='$d_voidsig'
23918 d_voidtty='$d_voidtty'
23919 d_volatile='$d_volatile'
23920 d_vprintf='$d_vprintf'
23921 d_vsnprintf='$d_vsnprintf'
23923 d_waitpid='$d_waitpid'
23924 d_wcscmp='$d_wcscmp'
23925 d_wcstombs='$d_wcstombs'
23926 d_wcsxfrm='$d_wcsxfrm'
23927 d_wctomb='$d_wctomb'
23928 d_writev='$d_writev'
23931 db_hashtype='$db_hashtype'
23932 db_prefixtype='$db_prefixtype'
23933 db_version_major='$db_version_major'
23934 db_version_minor='$db_version_minor'
23935 db_version_patch='$db_version_patch'
23936 direntrytype='$direntrytype'
23939 doublesize='$doublesize'
23941 drand48_r_proto='$drand48_r_proto'
23943 dynamic_ext='$dynamic_ext'
23949 endgrent_r_proto='$endgrent_r_proto'
23950 endhostent_r_proto='$endhostent_r_proto'
23951 endnetent_r_proto='$endnetent_r_proto'
23952 endprotoent_r_proto='$endprotoent_r_proto'
23953 endpwent_r_proto='$endpwent_r_proto'
23954 endservent_r_proto='$endservent_r_proto'
23955 eunicefix='$eunicefix'
23958 extensions='$extensions'
23959 extern_C='$extern_C'
23961 fflushNULL='$fflushNULL'
23962 fflushall='$fflushall'
23964 firstmakefile='$firstmakefile'
23966 fpossize='$fpossize'
23967 fpostype='$fpostype'
23968 freetype='$freetype'
23971 full_csh='$full_csh'
23972 full_sed='$full_sed'
23973 gccansipedantic='$gccansipedantic'
23974 gccosandvers='$gccosandvers'
23975 gccversion='$gccversion'
23976 getgrent_r_proto='$getgrent_r_proto'
23977 getgrgid_r_proto='$getgrgid_r_proto'
23978 getgrnam_r_proto='$getgrnam_r_proto'
23979 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
23980 gethostbyname_r_proto='$gethostbyname_r_proto'
23981 gethostent_r_proto='$gethostent_r_proto'
23982 getlogin_r_proto='$getlogin_r_proto'
23983 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
23984 getnetbyname_r_proto='$getnetbyname_r_proto'
23985 getnetent_r_proto='$getnetent_r_proto'
23986 getprotobyname_r_proto='$getprotobyname_r_proto'
23987 getprotobynumber_r_proto='$getprotobynumber_r_proto'
23988 getprotoent_r_proto='$getprotoent_r_proto'
23989 getpwent_r_proto='$getpwent_r_proto'
23990 getpwnam_r_proto='$getpwnam_r_proto'
23991 getpwuid_r_proto='$getpwuid_r_proto'
23992 getservbyname_r_proto='$getservbyname_r_proto'
23993 getservbyport_r_proto='$getservbyport_r_proto'
23994 getservent_r_proto='$getservent_r_proto'
23995 getspnam_r_proto='$getspnam_r_proto'
23996 gidformat='$gidformat'
24002 gmtime_r_proto='$gmtime_r_proto'
24003 gnulibc_version='$gnulibc_version'
24005 groupcat='$groupcat'
24006 groupstype='$groupstype'
24009 h_sysfile='$h_sysfile'
24012 hostgenerate='$hostgenerate'
24013 hostosname='$hostosname'
24014 hostperl='$hostperl'
24015 html1dir='$html1dir'
24016 html1direxp='$html1direxp'
24017 html3dir='$html3dir'
24018 html3direxp='$html3direxp'
24027 i_arpainet='$i_arpainet'
24028 i_assert='$i_assert'
24030 i_bsdioctl='$i_bsdioctl'
24034 i_dirent='$i_dirent'
24036 i_execinfo='$i_execinfo'
24041 i_fp_class='$i_fp_class'
24043 i_gdbm_ndbm='$i_gdbm_ndbm'
24044 i_gdbmndbm='$i_gdbmndbm'
24046 i_ieeefp='$i_ieeefp'
24047 i_inttypes='$i_inttypes'
24048 i_langinfo='$i_langinfo'
24049 i_libutil='$i_libutil'
24050 i_limits='$i_limits'
24051 i_locale='$i_locale'
24052 i_machcthr='$i_machcthr'
24053 i_malloc='$i_malloc'
24054 i_mallocmalloc='$i_mallocmalloc'
24056 i_memory='$i_memory'
24057 i_mntent='$i_mntent'
24060 i_neterrno='$i_neterrno'
24061 i_netinettcp='$i_netinettcp'
24065 i_pthread='$i_pthread'
24067 i_quadmath='$i_quadmath'
24068 i_rpcsvcdbm='$i_rpcsvcdbm'
24070 i_shadow='$i_shadow'
24072 i_stdarg='$i_stdarg'
24073 i_stdbool='$i_stdbool'
24074 i_stddef='$i_stddef'
24075 i_stdint='$i_stdint'
24076 i_stdlib='$i_stdlib'
24077 i_string='$i_string'
24078 i_sunmath='$i_sunmath'
24079 i_sysaccess='$i_sysaccess'
24080 i_sysdir='$i_sysdir'
24081 i_sysfile='$i_sysfile'
24082 i_sysfilio='$i_sysfilio'
24084 i_sysioctl='$i_sysioctl'
24085 i_syslog='$i_syslog'
24086 i_sysmman='$i_sysmman'
24087 i_sysmode='$i_sysmode'
24088 i_sysmount='$i_sysmount'
24089 i_sysndir='$i_sysndir'
24090 i_sysparam='$i_sysparam'
24091 i_syspoll='$i_syspoll'
24092 i_sysresrc='$i_sysresrc'
24093 i_syssecrt='$i_syssecrt'
24094 i_sysselct='$i_sysselct'
24095 i_syssockio='$i_syssockio'
24096 i_sysstat='$i_sysstat'
24097 i_sysstatfs='$i_sysstatfs'
24098 i_sysstatvfs='$i_sysstatvfs'
24099 i_systime='$i_systime'
24100 i_systimek='$i_systimek'
24101 i_systimes='$i_systimes'
24102 i_systypes='$i_systypes'
24103 i_sysuio='$i_sysuio'
24105 i_sysutsname='$i_sysutsname'
24106 i_sysvfs='$i_sysvfs'
24107 i_syswait='$i_syswait'
24108 i_termio='$i_termio'
24109 i_termios='$i_termios'
24111 i_unistd='$i_unistd'
24114 i_values='$i_values'
24115 i_varargs='$i_varargs'
24116 i_varhdr='$i_varhdr'
24118 ignore_versioned_solibs='$ignore_versioned_solibs'
24119 inc_version_list='$inc_version_list'
24120 inc_version_list_init='$inc_version_list_init'
24124 initialinstalllocation='$initialinstalllocation'
24125 installarchlib='$installarchlib'
24126 installbin='$installbin'
24127 installhtml1dir='$installhtml1dir'
24128 installhtml3dir='$installhtml3dir'
24129 installman1dir='$installman1dir'
24130 installman3dir='$installman3dir'
24131 installprefix='$installprefix'
24132 installprefixexp='$installprefixexp'
24133 installprivlib='$installprivlib'
24134 installscript='$installscript'
24135 installsitearch='$installsitearch'
24136 installsitebin='$installsitebin'
24137 installsitehtml1dir='$installsitehtml1dir'
24138 installsitehtml3dir='$installsitehtml3dir'
24139 installsitelib='$installsitelib'
24140 installsiteman1dir='$installsiteman1dir'
24141 installsiteman3dir='$installsiteman3dir'
24142 installsitescript='$installsitescript'
24143 installstyle='$installstyle'
24144 installusrbinperl='$installusrbinperl'
24145 installvendorarch='$installvendorarch'
24146 installvendorbin='$installvendorbin'
24147 installvendorhtml1dir='$installvendorhtml1dir'
24148 installvendorhtml3dir='$installvendorhtml3dir'
24149 installvendorlib='$installvendorlib'
24150 installvendorman1dir='$installvendorman1dir'
24151 installvendorman3dir='$installvendorman3dir'
24152 installvendorscript='$installvendorscript'
24154 issymlink='$issymlink'
24155 ivdformat='$ivdformat'
24158 known_extensions='$known_extensions'
24161 ld_can_script='$ld_can_script'
24162 lddlflags='$lddlflags'
24164 ldflags_uselargefiles='$ldflags_uselargefiles'
24165 ldlibpthname='$ldlibpthname'
24172 libsdirs='$libsdirs'
24173 libsfiles='$libsfiles'
24174 libsfound='$libsfound'
24175 libspath='$libspath'
24176 libswanted='$libswanted'
24177 libswanted_uselargefiles='$libswanted_uselargefiles'
24183 localtime_r_proto='$localtime_r_proto'
24184 locincpth='$locincpth'
24185 loclibpth='$loclibpth'
24186 longdblkind='$longdblkind'
24187 longdblsize='$longdblsize'
24188 longlongsize='$longlongsize'
24189 longsize='$longsize'
24193 lseeksize='$lseeksize'
24194 lseektype='$lseektype'
24198 make_set_make='$make_set_make'
24199 mallocobj='$mallocobj'
24200 mallocsrc='$mallocsrc'
24201 malloctype='$malloctype'
24203 man1direxp='$man1direxp'
24206 man3direxp='$man3direxp'
24208 mips_type='$mips_type'
24209 mistrustnm='$mistrustnm'
24211 mmaptype='$mmaptype'
24212 modetype='$modetype'
24214 multiarch='$multiarch'
24216 myarchname='$myarchname'
24217 mydomain='$mydomain'
24218 myhostname='$myhostname'
24221 need_va_copy='$need_va_copy'
24222 netdb_hlen_type='$netdb_hlen_type'
24223 netdb_host_type='$netdb_host_type'
24224 netdb_name_type='$netdb_name_type'
24225 netdb_net_type='$netdb_net_type'
24228 nm_so_opt='$nm_so_opt'
24229 nonxs_ext='$nonxs_ext'
24231 nvEUformat='$nvEUformat'
24232 nvFUformat='$nvFUformat'
24233 nvGUformat='$nvGUformat'
24234 nv_overflows_integers_at='$nv_overflows_integers_at'
24235 nv_preserves_uv_bits='$nv_preserves_uv_bits'
24236 nveformat='$nveformat'
24237 nvfformat='$nvfformat'
24238 nvgformat='$nvgformat'
24241 o_nonblock='$o_nonblock'
24243 old_pthread_create_joinable='$old_pthread_create_joinable'
24244 optimize='$optimize'
24245 orderlib='$orderlib'
24248 otherlibdirs='$otherlibdirs'
24252 patchlevel='$patchlevel'
24253 path_sep='$path_sep'
24256 perl_patchlevel='$perl_patchlevel'
24257 perl_static_inline='$perl_static_inline'
24258 perladmin='$perladmin'
24259 perllibs='$perllibs'
24260 perlpath='$perlpath'
24262 phostname='$phostname'
24268 prefixexp='$prefixexp'
24270 privlibexp='$privlibexp'
24271 procselfexe='$procselfexe'
24272 prototype='$prototype'
24274 quadkind='$quadkind'
24275 quadtype='$quadtype'
24276 randbits='$randbits'
24277 randfunc='$randfunc'
24278 random_r_proto='$random_r_proto'
24279 randseedtype='$randseedtype'
24281 rd_nodata='$rd_nodata'
24282 readdir64_r_proto='$readdir64_r_proto'
24283 readdir_r_proto='$readdir_r_proto'
24284 revision='$revision'
24290 sGMTIME_max='$sGMTIME_max'
24291 sGMTIME_min='$sGMTIME_min'
24292 sLOCALTIME_max='$sLOCALTIME_max'
24293 sLOCALTIME_min='$sLOCALTIME_min'
24294 sPRIEUldbl='$sPRIEUldbl'
24295 sPRIFUldbl='$sPRIFUldbl'
24296 sPRIGUldbl='$sPRIGUldbl'
24297 sPRIXU64='$sPRIXU64'
24299 sPRIeldbl='$sPRIeldbl'
24300 sPRIfldbl='$sPRIfldbl'
24301 sPRIgldbl='$sPRIgldbl'
24306 sSCNfldbl='$sSCNfldbl'
24307 sched_yield='$sched_yield'
24308 scriptdir='$scriptdir'
24309 scriptdirexp='$scriptdirexp'
24311 seedfunc='$seedfunc'
24312 selectminbits='$selectminbits'
24313 selecttype='$selecttype'
24314 sendmail='$sendmail'
24315 setgrent_r_proto='$setgrent_r_proto'
24316 sethostent_r_proto='$sethostent_r_proto'
24317 setlocale_r_proto='$setlocale_r_proto'
24318 setnetent_r_proto='$setnetent_r_proto'
24319 setprotoent_r_proto='$setprotoent_r_proto'
24320 setpwent_r_proto='$setpwent_r_proto'
24321 setservent_r_proto='$setservent_r_proto'
24324 sharpbang='$sharpbang'
24325 shmattype='$shmattype'
24326 shortsize='$shortsize'
24329 sig_count='$sig_count'
24330 sig_name='$sig_name'
24331 sig_name_init='$sig_name_init'
24333 sig_num_init='$sig_num_init'
24334 sig_size='$sig_size'
24335 signal_t='$signal_t'
24336 sitearch='$sitearch'
24337 sitearchexp='$sitearchexp'
24339 sitebinexp='$sitebinexp'
24340 sitehtml1dir='$sitehtml1dir'
24341 sitehtml1direxp='$sitehtml1direxp'
24342 sitehtml3dir='$sitehtml3dir'
24343 sitehtml3direxp='$sitehtml3direxp'
24345 sitelib_stem='$sitelib_stem'
24346 sitelibexp='$sitelibexp'
24347 siteman1dir='$siteman1dir'
24348 siteman1direxp='$siteman1direxp'
24349 siteman3dir='$siteman3dir'
24350 siteman3direxp='$siteman3direxp'
24351 siteprefix='$siteprefix'
24352 siteprefixexp='$siteprefixexp'
24353 sitescript='$sitescript'
24354 sitescriptexp='$sitescriptexp'
24355 sizesize='$sizesize'
24356 sizetype='$sizetype'
24360 sockethdr='$sockethdr'
24361 socketlib='$socketlib'
24362 socksizetype='$socksizetype'
24364 spackage='$spackage'
24365 spitshell='$spitshell'
24366 srand48_r_proto='$srand48_r_proto'
24367 srandom_r_proto='$srandom_r_proto'
24369 ssizetype='$ssizetype'
24370 st_ino_sign='$st_ino_sign'
24371 st_ino_size='$st_ino_size'
24372 startperl='$startperl'
24374 static_ext='$static_ext'
24376 stdio_base='$stdio_base'
24377 stdio_bufsiz='$stdio_bufsiz'
24378 stdio_cnt='$stdio_cnt'
24379 stdio_filbuf='$stdio_filbuf'
24380 stdio_ptr='$stdio_ptr'
24381 stdio_stream_array='$stdio_stream_array'
24382 strerror_r_proto='$strerror_r_proto'
24385 subversion='$subversion'
24390 targetarch='$targetarch'
24391 targetdir='$targetdir'
24392 targetenv='$targetenv'
24393 targethost='$targethost'
24394 targetmkdir='$targetmkdir'
24395 targetport='$targetport'
24396 targetsh='$targetsh'
24400 timeincl='$timeincl'
24401 timetype='$timetype'
24402 tmpnam_r_proto='$tmpnam_r_proto'
24408 ttyname_r_proto='$ttyname_r_proto'
24417 uidformat='$uidformat'
24423 uquadtype='$uquadtype'
24424 use5005threads='$use5005threads'
24425 use64bitall='$use64bitall'
24426 use64bitint='$use64bitint'
24427 usecbacktrace='$usecbacktrace'
24428 usecrosscompile='$usecrosscompile'
24429 usedevel='$usedevel'
24431 usedtrace='$usedtrace'
24432 usefaststdio='$usefaststdio'
24433 useithreads='$useithreads'
24434 usekernprocpathname='$usekernprocpathname'
24435 uselargefiles='$uselargefiles'
24436 uselongdouble='$uselongdouble'
24437 usemallocwrap='$usemallocwrap'
24438 usemorebits='$usemorebits'
24439 usemultiplicity='$usemultiplicity'
24440 usemymalloc='$usemymalloc'
24442 usensgetexecutablepath='$usensgetexecutablepath'
24443 useopcode='$useopcode'
24444 useperlio='$useperlio'
24445 useposix='$useposix'
24446 usequadmath='$usequadmath'
24447 usereentrant='$usereentrant'
24448 userelocatableinc='$userelocatableinc'
24449 useshrplib='$useshrplib'
24450 usesitecustomize='$usesitecustomize'
24451 usesocks='$usesocks'
24452 usethreads='$usethreads'
24453 usevendorprefix='$usevendorprefix'
24454 useversionedarchname='$useversionedarchname'
24455 usevfork='$usevfork'
24458 uvXUformat='$uvXUformat'
24459 uvoformat='$uvoformat'
24462 uvuformat='$uvuformat'
24463 uvxformat='$uvxformat'
24465 vendorarch='$vendorarch'
24466 vendorarchexp='$vendorarchexp'
24467 vendorbin='$vendorbin'
24468 vendorbinexp='$vendorbinexp'
24469 vendorhtml1dir='$vendorhtml1dir'
24470 vendorhtml1direxp='$vendorhtml1direxp'
24471 vendorhtml3dir='$vendorhtml3dir'
24472 vendorhtml3direxp='$vendorhtml3direxp'
24473 vendorlib='$vendorlib'
24474 vendorlib_stem='$vendorlib_stem'
24475 vendorlibexp='$vendorlibexp'
24476 vendorman1dir='$vendorman1dir'
24477 vendorman1direxp='$vendorman1direxp'
24478 vendorman3dir='$vendorman3dir'
24479 vendorman3direxp='$vendorman3direxp'
24480 vendorprefix='$vendorprefix'
24481 vendorprefixexp='$vendorprefixexp'
24482 vendorscript='$vendorscript'
24483 vendorscriptexp='$vendorscriptexp'
24485 version_patchlevel_string='$version_patchlevel_string'
24486 versiononly='$versiononly'
24490 yaccflags='$yaccflags'
24495 : add special variables
24496 $test -f $src/patchlevel.h && \
24497 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
24498 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
24499 echo "PERL_CONFIG_SH=true" >>config.sh
24501 : propagate old symbols
24502 if $test -f UU/config.sh; then
24503 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
24504 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
24505 config.sh config.sh UU/oldconfig.sh |\
24506 $sort | $uniq -u >UU/oldsyms
24507 set X `$cat UU/oldsyms`
24513 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
24515 echo ": Variables propagated from previous config.sh file." >>config.sh
24516 for sym in `$cat UU/oldsyms`; do
24517 echo " Propagating $hint variable "'$'"$sym..."
24518 eval 'tmp="$'"${sym}"'"'
24520 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
24526 : preserve RCS keywords in files with variable substitution, grrr
24529 : Finish up by extracting the .SH files
24533 echo "Extraction done."
24543 If you'd like to make any changes to the config.sh file before I begin
24544 to configure things, do it as a shell escape now (e.g. !vi config.sh).
24547 rp="Press return or use a shell escape to edit config.sh:"
24552 *) : in case they cannot read
24553 sh 1>&4 -c "$ans";;
24558 : if this fails, just run all the .SH files by hand
24567 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
24574 Now you need to generate make dependencies by running "$make depend".
24575 You might prefer to run it in background: "$make depend > makedepend.out &"
24576 It can take a while, so you might not want to run it right now.
24581 rp="Run $make depend now?"
24585 $make depend && echo "Now you must run '$make'."
24588 echo "You must run '$make depend' then '$make'."
24591 elif test -f [Mm]akefile; then
24593 echo "Now you must run a $make."
24595 echo "Configure done."
24598 if $test -f Policy.sh; then
24601 If you compile $package on a different machine or from a different object
24602 directory, copy the Policy.sh file from this object directory to the
24603 new one before you run Configure -- this will help you with most of
24604 the policy defaults.
24608 if $test -f config.msg; then
24609 echo "Hmm. I also noted the following information while running:"
24611 $cat config.msg >&4
24614 $rm -f kit*isdone ark*isdone