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=''
379 d_attribute_deprecated=''
380 d_attribute_format=''
381 d_attribute_malloc=''
382 d_attribute_nonnull=''
383 d_attribute_noreturn=''
385 d_attribute_unused=''
386 d_attribute_warn_unused_result=''
387 d_printf_format_null=''
391 d_builtin_choose_expr=''
394 d_c99_variadic_macros=''
442 endhostent_r_proto=''
448 endprotoent_r_proto=''
454 endservent_r_proto=''
507 gethostbyaddr_r_proto=''
509 gethostbyname_r_proto=''
511 gethostent_r_proto=''
524 getnetbyaddr_r_proto=''
526 getnetbyname_r_proto=''
540 d_getprotobyname_r=''
541 getprotobyname_r_proto=''
542 d_getprotobynumber_r=''
543 getprotobynumber_r_proto=''
545 getprotoent_r_proto=''
557 getservbyname_r_proto=''
559 getservbyport_r_proto=''
561 getservent_r_proto=''
589 d_libm_lib_version=''
592 d_localtime_r_needs_tzset=''
604 d_malloc_good_size=''
648 d_old_pthread_create_joinable=''
649 old_pthread_create_joinable=''
651 d_pthread_attr_setscope=''
691 sethostent_r_proto=''
708 setprotoent_r_proto=''
720 setservent_r_proto=''
742 d_ipv6_mreq_source=''
759 d_sprintf_returns_strlen=''
771 perl_static_inline=''
776 d_stdio_ptr_lval_nochange_cnt=''
777 d_stdio_ptr_lval_sets_cnt=''
925 d_gdbm_ndbm_h_uses_prototypes=''
926 d_gdbmndbm_h_uses_prototypes=''
928 d_ndbm_h_uses_prototypes=''
1002 d_inc_version_list=''
1004 inc_version_list_init=''
1008 installusrbinperl=''
1024 ignore_versioned_solibs=''
1084 d_perl_otherlibdirs=''
1092 api_versionstring=''
1098 version_patchlevel_string=''
1102 d_nv_preserves_uv=''
1103 d_nv_zero_is_allbits_zero=''
1114 nv_overflows_integers_at=''
1115 nv_preserves_uv_bits=''
1188 installsitehtml1dir=''
1191 installsitehtml3dir=''
1198 installsiteman1dir=''
1201 installsiteman3dir=''
1206 installsitescript=''
1224 d_stdio_stream_array=''
1225 stdio_stream_array=''
1243 usekernprocpathname=''
1244 ccflags_uselargefiles=''
1245 ldflags_uselargefiles=''
1246 libswanted_uselargefiles=''
1255 usensgetexecutablepath=''
1268 installvendorarch=''
1275 installvendorhtml1dir=''
1277 vendorhtml1direxp=''
1278 installvendorhtml3dir=''
1280 vendorhtml3direxp=''
1286 installvendorman1dir=''
1289 installvendorman3dir=''
1296 installvendorscript=''
1307 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1310 : We must find out about Eunice early
1312 if test -f /etc/unixtovms; then
1313 eunicefix=/etc/unixtovms
1315 if test -f /etc/unixtovms.exe; then
1316 eunicefix=/etc/unixtovms.exe
1319 : Set executable suffix now -- needed before hints available
1320 if test -f "/libs/version.library"; then
1323 elif test -f "/system/gnu_library/bin/ar.pm"; then
1326 elif test -n "$DJGPP"; then
1329 elif test -f /kern/cookiejar; then
1332 elif test -d c:/. -o -n "$is_os2" ; then
1339 : Trailing extension. Override this in a hint file, if needed.
1340 : Extra object files, if any, needed on this platform.
1343 : Possible local include directories to search.
1344 : Set locincpth to "" in a hint file to defeat local include searches.
1345 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1346 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1348 : no include file wanted by default
1351 : Enable -DEBUGGING and -DDEBUGGING from the command line
1356 : change the next line if compiling for Xenix/286 on Xenix/386
1357 xlibpth='/usr/lib/386 /lib/386'
1358 : Possible local library directories to search.
1359 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1360 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1362 : general looking path for locating libraries
1363 glibpth="/lib /usr/lib $xlibpth"
1364 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1365 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1366 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1367 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1369 : Private path used by Configure to find libraries. Its value
1370 : is prepended to libpth. This variable takes care of special
1371 : machines, like the mips. Usually, it should be empty.
1374 : default library list
1376 : some systems want to use only the non-versioned libso:s
1377 ignore_versioned_solibs=''
1378 : set usethreads on the Configure command line to enable threads.
1379 usereentrant='undef'
1383 : set useposix=false in your hint file to disable the POSIX extension.
1385 : set useopcode=false in your hint file to disable the Opcode extension.
1388 ccflags_uselargefiles=''
1389 ldflags_uselargefiles=''
1390 libswanted_uselargefiles=''
1391 : set usemultiplicity on the Configure command line to enable multiplicity.
1392 : set usesocks on the Configure command line to enable socks.
1393 : List of libraries we want.
1394 : If anyone needs extra -lxxx, put those in a hint file.
1395 libswanted="socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld sun"
1396 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1397 : We probably want to search /usr/shlib before most other libraries.
1398 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1399 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1400 glibpth="/usr/shlib $glibpth"
1401 : Do not use vfork unless overridden by a hint file.
1404 : Find the basic shell for Bourne shell scripts
1408 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1411 if test -f "$xxx"; then
1414 : Build up a list and do a single loop so we can 'break' out.
1415 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1416 for xxx in sh bash ksh pdksh ash; do
1418 try="$try ${p}/${xxx}"
1422 if test -f "$xxx"; then
1425 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1428 elif test -f "$xxx.exe"; then
1439 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1441 Usually it's in /bin/sh. How did you even get this far?
1442 Please contact me (Perl Maintainers) at perlbug@perl.org and
1443 we'll try to straighten this all out.
1449 : When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
1450 : default both to the same thing, cross-compilers can then set targetsh differently if they like
1453 : see if sh knows # comments
1454 if `$sh -c '#' >/dev/null 2>&1`; then
1458 test -f $xcat$_exe || xcat=/usr/bin/cat
1459 if test ! -f $xcat$_exe; then
1460 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1461 if test -f $p/cat$_exe; then
1466 if test ! -f $xcat$_exe; then
1467 echo "Can't find cat anywhere!"
1471 echo "#!$xcat" >sharp
1474 ./sharp > today 2>/dev/null
1475 if test -s today; then
1478 echo "#! $xcat" > sharp
1481 ./sharp > today 2>/dev/null
1482 if test -s today; then
1490 echo "Your $sh doesn't grok # comments--I will strip them later on."
1493 echo "exec grep -v '^[ ]*#'" >spitshell
1495 $eunicefix spitshell
1496 spitshell=`pwd`/spitshell
1498 echo "I presume that if # doesn't work, #! won't work either!"
1503 : figure out how to guarantee sh startup
1505 '') startsh=${sharpbang}${sh} ;;
1517 : echo "Yup, it does."
1519 echo "Hmm... '$startsh' does not guarantee sh startup..."
1520 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1524 : Save command line options in file UU/cmdline.opt for later use in
1525 : generating config.sh.
1526 cat > cmdline.opt <<EOSH
1527 : Configure command line arguments.
1536 cat >>cmdline.opt <<EOSH
1537 config_arg$argn='$arg'
1539 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1542 arg_exp=`cat cmdl.opt`
1543 args_exp="$args_exp$args_sep'$arg_exp'"
1544 argn=`expr $argn + 1`
1549 : produce awk script to parse command line options
1550 cat >options.awk <<'EOF'
1552 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1554 len = length(optstr);
1555 for (i = 1; i <= len; i++) {
1556 c = substr(optstr, i, 1);
1557 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1568 if (substr(str, 1, 1) != "-") {
1569 printf("'%s'\n", str);
1573 for (i = 2; i <= len; i++) {
1574 c = substr(str, i, 1);
1576 printf("-%s\n", substr(str, i));
1582 printf("'%s'\n", substr(str, i + 1));
1595 : process the command line options
1596 set X `for arg in "$@"; do echo "X$arg"; done |
1597 sed -e s/X// | awk -f options.awk`
1602 : set up default values
1612 rm -f optdef.sh posthint.sh
1613 cat >optdef.sh <<EOS
1619 while test $# -gt 0; do
1621 -d) shift; fastread=yes;;
1622 -e) shift; alldone=cont;;
1626 if test -r "$1"; then
1629 echo "$me: cannot read config file $1." >&2
1635 -h) shift; error=true;;
1636 -r) shift; reuseval=true;;
1637 -s) shift; silent=true; realsilent=true;;
1638 -E) shift; alldone=exit;;
1639 -K) shift; knowitall=true;;
1640 -O) shift; override=true;;
1641 -S) shift; silent=true; extractsh=true;;
1646 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1647 echo "$me: ignoring -D $1" >&2
1650 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1651 *) echo "$1='define'" >> optdef.sh;;
1658 *=) echo "$1" >> optdef.sh;;
1660 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1661 echo "$me: ignoring -U $1" >&2
1663 *) echo "$1='undef'" >> optdef.sh;;
1674 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1678 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1679 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1685 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1686 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1687 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1688 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1689 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1690 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1696 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1698 echo "$yyy=''" >> posthint.sh ;;
1703 echo "$yyy='$zzz'" >> posthint.sh ;;
1705 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1707 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1712 echo "$yyy=$zzz" >> posthint.sh ;;
1713 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1717 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1720 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1728 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1729 [-U symbol] [-U symbol=] [-A command:symbol...]
1730 -d : use defaults for all answers.
1731 -e : go on without questioning past the production of config.sh.
1732 -f : specify an alternate default configuration file.
1733 -h : print this help message and exit (with an error status).
1734 -r : reuse C symbols value if possible (skips costly nm extraction).
1735 -s : silent mode, only echoes questions and essential information.
1736 -D : define symbol to have some value:
1737 -D symbol symbol gets the value 'define'
1738 -D symbol=value symbol gets the value 'value'
1739 common used examples (see INSTALL for more info):
1740 -Duse64bitint use 64bit integers
1741 -Duse64bitall use 64bit integers and pointers
1742 -Dusethreads use thread support
1743 -Dinc_version_list=none do not include older perl trees in @INC
1744 -DEBUGGING=none DEBUGGING options
1745 -Dcc=gcc choose your compiler
1746 -Dprefix=/opt/perl5 choose your destination
1747 -E : stop at the end of questions, after having produced config.sh.
1748 -K : do not use unless you know what you are doing.
1749 -O : let -D and -U override definitions from loaded configuration file.
1750 -S : perform variable substitutions on all .SH files (can mix with -f)
1751 -U : undefine symbol:
1752 -U symbol symbol gets the value 'undef'
1753 -U symbol= symbol gets completely empty
1755 -A : manipulate symbol after the platform specific hints have been applied:
1756 -A append:symbol=value append value to symbol
1757 -A symbol=value like append:, but with a separating space
1758 -A define:symbol=value define symbol to have value
1759 -A clear:symbol define symbol to be ''
1760 -A define:symbol define symbol to be 'define'
1761 -A eval:symbol=value define symbol to be eval of value
1762 -A prepend:symbol=value prepend value to symbol
1763 -A undef:symbol define symbol to be 'undef'
1764 -A undef:symbol= define symbol to be ''
1765 e.g.: -A prepend:libswanted='cl pthread '
1766 -A ccflags=-DSOME_MACRO
1767 -V : print version number and exit (with a zero status).
1774 case "$fastread$alldone" in
1777 case "$extractsh" in
1780 if test ! -t 0; then
1781 echo "Say 'sh Configure', not 'sh <Configure'"
1791 true) exec 1>/dev/null;;
1794 : run the defines and the undefines, if any, but leave the file out there...
1797 : create the posthint manipulation script and leave the file out there...
1802 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1803 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1804 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1805 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1806 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1809 : Some greps do not return status, grrr.
1810 echo "grimblepritz" >grimble
1811 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1813 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1819 : the following should work in any shell
1823 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1824 cat >contains <<'EOSS'
1825 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1830 : Find the path to the source tree
1833 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1837 *) src=`cd ../$src && pwd` ;;
1850 if test -f $rsrc/Configure && \
1851 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1853 : found it, so we are ok.
1856 for src in . .. ../.. ../../.. ../../../..; do
1857 if test -f ../$src/Configure && \
1858 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1869 Sorry, I can't seem to locate the source dir for $package. Please start
1870 Configure with an explicit path -- i.e. /some/path/Configure.
1878 echo "Sources for $package found in \"$src\"." >&4
1882 : script used to extract .SH files with variable substitutions
1883 cat >extract <<'EOS'
1885 echo "Doing variable substitutions on .SH files..."
1886 if test -f MANIFEST; then
1887 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1889 echo "(Looking for .SH files under the source directory.)"
1890 set x `(cd "$src"; find . -name "*.SH" -print)`
1894 0) set x `(cd "$src"; echo *.SH)`; shift;;
1896 if test ! -f "$src/$1"; then
1902 while test $name; do
1903 if test ! -d "$name"; then
1904 create="$name $create";
1905 name=`echo $name | sed -e "s|^[^/]*$||"`;
1906 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1911 for file in $create; do
1920 dir=`expr X$file : 'X\(.*\)/'`
1921 file=`expr X$file : 'X.*/\(.*\)'`
1922 (cd "$dir" && . ./$file)
1932 dir=`expr X$file : 'X\(.*\)/'`
1933 file=`expr X$file : 'X.*/\(.*\)'`
1934 (set x $dir; shift; eval $mkdir_p)
1935 sh <"$src/$dir/$file"
1944 if test -f "$src/config_h.SH"; then
1945 if test ! -f config.h; then
1946 : oops, they left it out of MANIFEST, probably, so do it anyway.
1947 . "$src/config_h.SH"
1952 : extract files and exit if asked to do so
1953 case "$extractsh" in
1955 case "$realsilent" in
1959 case "$config_sh" in
1960 '') config_sh='config.sh';;
1963 echo "Fetching answers from $config_sh..."
1966 test "$override" && . ./optdef.sh
1970 echo "Extraction done."
1975 : Eunice requires " " instead of "", can you believe it
1978 echo "Beginning of configuration questions for $package."
1980 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1982 : first determine how to suppress newline on echo command
1984 echo "Checking echo to see how to suppress newlines..."
1985 (echo "hi there\c" ; echo " ") >.echotmp
1986 if $contains c .echotmp >/dev/null 2>&1 ; then
1997 echo $n "The star should be here-->$c"
2001 : Now test for existence of everything in MANIFEST
2003 if test -f "$rsrc/MANIFEST"; then
2004 echo "First let's make sure your kit is complete. Checking..." >&4
2005 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
2006 (split -l 50 2>/dev/null || split -50)
2009 for filelist in x??; do
2010 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
2011 >/dev/null 2>>"$tmppwd/missing")
2013 if test -s missing; then
2017 THIS PACKAGE SEEMS TO BE INCOMPLETE.
2019 You have the option of continuing the configuration process, despite the
2020 distinct possibility that your kit is damaged, by typing 'y'es. If you
2021 do, don't blame me if something goes wrong. I advise you to type 'n'o
2022 and contact the author (perlbug@perl.org).
2025 echo $n "Continue? [n] $c" >&4
2029 echo "Continuing..." >&4
2033 echo "ABORTING..." >&4
2038 echo "Looks good..."
2041 echo "There is no MANIFEST file. I hope your kit is complete !"
2045 : Find the appropriate value for a newline for tr
2047 if test -n "$DJGPP"; then
2050 if test X"$trnl" = X; then
2051 case "`echo foo|tr '\n' x 2>/dev/null`" in
2055 if test X"$trnl" = X; then
2056 case "`echo foo|tr '\012' x 2>/dev/null`" in
2057 foox) trnl='\012' ;;
2060 if test X"$trnl" = X; then
2061 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2062 fooxy) trnl='\n\r' ;;
2065 if test X"$trnl" = X; then
2068 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2074 : compute the number of columns on the terminal for proper question formatting
2079 : set up the echo used in my read
2080 myecho="case \"\$xxxm\" in
2081 '') echo $n \"\$rp $c\" >&4;;
2083 '') echo $n \"[\$xxxm] $c\";;
2085 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2087 echo $n \"[\$xxxm] $c\" >&4
2089 echo $n \"\$rp [\$xxxm] $c\" >&4
2095 : now set up to do reads with possible shell escape and default assignment
2101 case "\$fastread" in
2102 yes) case "\$dflt" in
2105 case "\$silent-\$rp" in
2110 *) case "\$silent" in
2111 true) case "\$rp" in
2116 while expr "X\$ans" : "X!" >/dev/null; do
2120 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2128 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2137 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2142 echo "(OK, I'll run with -d after this question.)" >&4
2145 echo "*** Sorry, \$1 not supported yet." >&4
2155 echo "*** Substitution done -- please confirm."
2157 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2162 echo "*** Error -- try again."
2169 case "\$ans\$xxxm\$nostick" in
2181 : create .config dir to save info across Configure sessions
2182 test -d ../.config || mkdir ../.config
2183 cat >../.config/README <<EOF
2184 This directory created by Configure to save information that should
2185 persist across sessions for $package.
2187 You may safely delete it if you wish.
2190 : See if we are using a devel version and want that
2191 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2194 usedevel="$define" ;;
2195 *) case "$xversion" in
2198 *** WHOA THERE!!! ***
2200 This is an UNSTABLE DEVELOPMENT release.
2201 The version of this $package distribution is $xversion, that is, odd,
2202 (as opposed to even) and that signifies a development release.
2203 If you want a maintenance release, you want an even-numbered version.
2205 Do ***NOT*** install this into production use.
2206 Data corruption and crashes are possible.
2208 It is most seriously suggested that you do not continue any further
2209 unless you want to help in developing and debugging Perl.
2211 If you *still* want to build perl, you can answer 'y' now,
2212 or pass -Dusedevel to Configure.
2215 rp='Do you really want to continue?'
2219 [yY]) echo >&4 "Okay, continuing."
2220 usedevel="$define" ;;
2221 *) echo >&4 "Okay, bye."
2232 case "$versiononly" in
2233 '') versiononly="$define" ;;
2235 case "$installusrbinperl" in
2236 '') installusrbinperl="$undef" ;;
2241 : general instructions
2244 user=`(logname) 2>/dev/null`
2246 '') user=`whoami 2>&1`;;
2248 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2251 rp='Would you like to see the instructions?'
2262 This installation shell script will examine your system and ask you questions
2263 to determine how the perl5 package should be installed. If you get
2264 stuck on a question, you may use a ! shell escape to start a subshell or
2265 execute a command. Many of the questions will have default answers in square
2266 brackets; typing carriage return will give you the default.
2268 On some of the questions which ask for file or directory names you are allowed
2269 to use the ~name construct to specify the login directory belonging to "name",
2270 even if you don't have a shell which knows about that. Questions where this is
2271 allowed will be marked "(~name ok)".
2275 dflt='Type carriage return to continue'
2279 The prompter used in this script allows you to use shell variables and
2280 backticks in your answers. You may use $1, $2, etc... to refer to the words
2281 in the default answer, as if the default line was a set of arguments given to a
2282 script shell. This means you may also use $* to repeat the whole default line,
2283 so you do not have to re-type everything to add something to the default.
2285 Every time there is a substitution, you will have to confirm. If there is an
2286 error (e.g. an unmatched backtick), the default answer will remain unchanged
2287 and you will be prompted again.
2289 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2290 the questions and use the computed defaults (or the previous answers if there
2291 was already a config.sh file). Type 'Configure -h' for a list of options.
2292 You may also start interactively and then answer '& -d' at any prompt to turn
2293 on the non-interactive behaviour for the remainder of the execution.
2299 Much effort has been expended to ensure that this shell script will run on any
2300 Unix system. If despite that it blows up on yours, your best bet is to edit
2301 Configure and run it again. If you can't run Configure for some reason,
2302 you'll have to generate a config.sh file by hand. Whatever problems you
2303 have, let me (perlbug@perl.org) know how I blew it.
2305 This installation script affects things in two ways:
2307 1) it may do direct variable substitutions on some of the files included
2309 2) it builds a config.h file for inclusion in C programs. You may edit
2310 any of these files as the need arises after running this script.
2312 If you make a mistake on a question, there is no easy way to back up to it
2313 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2314 files. Configure will offer to let you do this before it runs the SH files.
2317 dflt='Type carriage return to continue'
2319 case "$firsttime" in
2320 true) echo $user >>../.config/instruct;;
2324 : Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
2325 : This is primarily meant for cross-compile environments, and may fail to be useful in other cases
2326 if test "X$sysroot" = X; then
2331 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
2332 # _sysroot is used in places where we need --sysroot=foo
2333 # but using the rest of the flags could cause issues.
2334 _sysroot="--sysroot=$sysroot";
2338 ccflags="$ccflags $_sysroot"
2343 ldflags="$ldflags $_sysroot"
2348 cppflags="$cppflags $_sysroot"
2350 # lddlflags updated below in lddlflags section;
2351 # same with cccdlflags
2355 # Adjust some defaults to also use $sysroot
2356 for var in xlibpth loclibpth locincpth glibpth; do
2359 for path in $xxx; do
2360 eval $var=\"\$$var $sysroot$path\"
2366 : find out where common programs are
2368 echo "Locating common programs..." >&4
2381 if test -d \$dir/\$thing; then
2387 for thisthing in \$dir/\$thing; do
2388 : just loop through to pick last item
2390 if test -f \$thisthing; then
2393 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2396 elif test -f \$dir/\$thing.exe; then
2397 if test -n "$DJGPP"; then
2398 echo \$dir/\$thing.exe
2399 elif test "$eunicefix" != ":"; then
2400 : on Eunice apparently
2453 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2454 pth="$pth $sysroot/lib $sysroot/usr/lib"
2455 for file in $loclist; do
2459 if test -f "$xxx"; then
2462 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2463 xxx=`./loc $file $file $pth`
2466 '') xxx=`./loc $file $file $pth`;;
2467 *) xxx=`./loc $xxx $xxx $pth`;;
2469 eval $file=$xxx$_exe
2473 echo $file is in $xxx.
2476 echo $file is in $xxx.
2479 echo "I don't know where '$file' is, and my life depends on it." >&4
2480 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2486 echo "Don't worry if any of the following aren't found..."
2488 for file in $trylist; do
2492 if test -f "$xxx"; then
2495 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2496 xxx=`./loc $file $file $pth`
2499 '') xxx=`./loc $file $file $pth`;;
2500 *) xxx=`./loc $xxx $xxx $pth`;;
2502 eval $file=$xxx$_exe
2506 echo $file is in $xxx.
2509 echo $file is in $xxx.
2512 echo "I don't see $file out there, $say."
2519 echo "Substituting grep for egrep."
2526 *) if $less -R </dev/null >/dev/null 2>&1; then
2527 echo "Substituting less -R for less."
2535 echo "Substituting cp for ln."
2544 echo "I can't find make or gmake, and my life depends on it." >&4
2545 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2553 *) # We can't have osname yet.
2554 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2555 # Assume that gmake, if found, is definitely GNU make
2556 # and prefer it over the system make.
2557 echo "Substituting gmake for make."
2565 echo "Hopefully test is built into your sh."
2568 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2569 echo "Using the test built into your sh."
2577 echo "Hopefully echo is built into your sh."
2582 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2583 $echo $n "hi there$c" >foo1
2584 echo $n "hi there$c" >foo2
2585 if cmp foo1 foo2 >/dev/null 2>&1; then
2586 echo "They are compatible. In fact, they may be identical."
2593 They are not compatible! You are probably running ksh on a non-USG system.
2594 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2595 have echo built in and we may have to run some Bourne shell scripts. That
2596 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2599 $echo $n "The star should be here-->$c"
2606 # This question was auctioned at YAPC::Europe-2007 in Vienna
2607 # I never promised you could answer it. I only auctioned the question.
2609 The following message is sponsored by
2611 Dresden.pm<--The stars should be here.
2613 Dear Perl user, system administrator or package
2614 maintainer, the Perl community sends greetings to
2615 you. Do you (emblematical) greet back [Y/n]? n
2619 : Check what type of C compiler we use
2623 cat <<'EOSC' >>trygcc
2628 int main(int argc, char *argv[]) {
2632 if $cc -o try $ccflags $ldflags try.c; then
2635 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2641 # Skip this test because it gives a false match on output like:
2642 # ./trygcc: line 23: cc: command not found
2643 # case "`$cc -v -c try.c 2>&1`" in
2644 # *gcc*) trygcc=no ;;
2646 if $test X"$trygcc" = Xyes; then
2647 if gcc -o try -c try.c; then
2649 echo "You seem to have a working gcc, though." >&4
2650 # Switching compilers may undo the work of hints files.
2651 # The most common problem is -D_REENTRANT for threads.
2652 # This heuristic catches that case, but gets false positives
2653 # if -Dusethreads was not actually specified. Better to
2654 # bail out here with a useful message than fail
2655 # mysteriously later. Should we perhaps just try to
2656 # re-invoke Configure -Dcc=gcc config_args ?
2657 if $test -f usethreads.cbu; then
2660 *** However, any setting of the C compiler flags (e.g. for thread support)
2661 *** will be lost. It may be necessary for you to restart Configure and
2662 *** add -Dcc=gcc to your Configure command line.
2665 rp="Would you like to go ahead and try gcc anyway?"
2668 rp="Would you like to use it?"
2671 if $test -f myread; then
2674 if $test -f UU/myread; then
2677 echo "Cannot find myread, sorry. Aborting." >&2
2682 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2695 cat <<'EOSC' >>checkcc
2700 int main(int argc, char *argv[]) {
2704 if $cc -o try $ccflags $ldflags try.c; then
2707 if $test X"$despair" = Xyes; then
2708 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2711 You need to find a working C compiler.
2712 Either (purchase and) install the C compiler supplied by your OS vendor,
2713 or for a free C compiler try http://gcc.gnu.org/
2714 I cannot continue any further, aborting.
2723 : determine whether symbolic links are supported
2726 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2727 echo "Symbolic links are supported." >&4
2730 echo "Symbolic links are NOT supported." >&4
2735 : determine whether symbolic links are supported
2739 echo "Checking how to test for symbolic links..." >&4
2741 if $test "X$issymlink" = X; then
2743 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2744 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2746 if test $? = 0; then
2749 echo "Your builtin 'test -h' may be broken." >&4
2752 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2755 if test -f "$p/$test"; then
2764 echo "Trying external '$test -h'." >&4
2765 issymlink="$test -h"
2766 if $test ! -h sym >/dev/null 2>&1; then
2767 echo "External '$test -h' is broken, too." >&4
2775 if $test "X$issymlink" = X; then
2776 if $test -L sym 2>/dev/null; then
2777 issymlink="$test -L"
2778 echo "The builtin '$test -L' worked." >&4
2781 if $test "X$issymlink" != X; then
2782 echo "You can test for symbolic links with '$issymlink'." >&4
2784 echo "I do not know how you can test for symbolic links." >&4
2788 *) echo "No symbolic links, so not testing for their testing..." >&4
2793 : Make symlinks util
2794 case "$mksymlinks" in
2797 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2800 *) case "$lns:$issymlink" in
2801 *"ln"*" -s:"*"test -"?)
2802 echo "Creating the symbolic links..." >&4
2803 echo "(First creating the subdirectories...)" >&4
2805 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2807 test -z "$directory" && break
2811 if test ! -d t/base; then
2812 echo "Failed to create the subdirectories. Aborting." >&4
2815 echo "(Then creating the symlinks...)" >&4
2816 awk '{print $1}' $src/MANIFEST | while true; do
2818 test -z "$filename" && break
2819 if test -f $filename; then
2820 if $issymlink $filename; then
2824 if test -f $filename; then
2825 echo "$filename already exists, not symlinking."
2827 ln -s $src/$filename $filename
2831 if test ! -f t/base/lex.t; then
2832 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2837 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2845 : Check for Cross-Compilation
2846 if $test "X$targethost" = "X"; then
2849 if $test "X$targetenv" = "X"; then
2852 case "$usecrosscompile" in
2854 $echo "Cross-compiling..."
2857 *-gcc*|*-g++*) # A cross-compiling gcc, probably.
2858 # arm-linux-androideabi-gcc -> arm-linux-androideabi
2859 # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
2860 targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
2861 ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
2862 # leave out ld, choosing it is more complex
2863 nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
2864 ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
2865 # We are in a weird spot. Just before us, some values
2866 # were 'saved', to be restored after the hints are
2867 # run. This means that the changes we made to ar,
2868 # nm and ranlib will get reverted.
2869 # To avoid that, we hijack the saving mechanism and
2870 # have it save our new values.
2871 for file in ar nm ranlib; do
2873 eval $file=$xxx$_exe
2878 case "$targetarch" in
2879 '') echo "Targetarch not defined." >&4; croak=y ;;
2880 *) echo "Using targetarch $targetarch." >&4 ;;
2882 case "$targethost" in
2883 '') echo "Targethost not defined." >&4; croak=y ;;
2884 *) echo "Using targethost $targethost." >&4
2889 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2891 : compile a host miniperl and generate_uudmap, unless we got passed them
2892 if $test "X$hostperl" = X; then
2893 echo "Building host miniperl and generate_uudmap binaries" >&4
2901 $src/Configure -des -Dusedevel -Dmksymlinks
2903 case "$hostgenerate" in
2904 '') $make generate_uudmap
2905 hostgenerate=$src/host/generate_uudmap
2907 "$undef") hostgenerate=''
2910 hostperl=$src/host/miniperl
2913 hostosname=`$hostperl -le 'print $^O'`
2916 usecrosscompile="$undef"
2920 : Define -Dtargethost=somecomputer to run compiled tests on another machine
2921 case "$targethost" in
2922 '') echo "Checking for cross-compile" >&4
2923 case "$usecrosscompile$multiarch" in
2924 *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
2925 if [ -f Makefile ]; then
2927 echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
2929 echo "Configure done."
2933 *) echo "No targethost for running compiler tests against defined, running locally" >&4
2940 *) echo "Using targethost $targethost." >&4
2942 /*) run=$src/Cross/run
2943 targetmkdir=$src/Cross/mkdir
2945 from=$src/Cross/from
2947 *) pwd=`$test -f ../Configure & cd ..; pwd`
2949 targetmkdir=$pwd/Cross/mkdir
2951 from=$pwd/Cross/from
2954 case "$targetrun" in
2955 '') targetrun=ssh ;;
2960 case "$targetfrom" in
2961 '') targetfrom=scp ;;
2965 from=$from-$targetfrom
2966 case "$targetdir" in
2968 echo "Guessing targetdir $targetdir." >&4
2971 case "$targetuser" in
2973 echo "Guessing targetuser $targetuser." >&4
2976 case "$targetport" in
2978 echo "Guessing targetport $targetport." >&4
2981 case "$targetfrom" in
2985 case "$targetrun" in
3005 '') cwd=$targetdir ;;
3010 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
3016 *) echo "Unknown targetrun '$targetrun'" >&4
3020 case "$targetmkdir" in
3022 cat >$targetmkdir <<EOF
3024 $targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
3026 $chmod a+rx $targetmkdir
3028 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
3040 $targetmkdir \`dirname \$f\`
3041 $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f 2>/dev/null || exit 1
3044 $targetmkdir $targetdir/\`dirname \$f\`
3045 $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
3058 $mkdir -p $targetdir/\`dirname \$f\`
3059 $cp \$f $targetdir/\$f || exit 1
3062 $targetmkdir $targetdir/\`dirname \$f\`
3063 $cp \$f $targetdir/\$f || exit 1
3070 *) echo "Unknown targetto '$targetto'" >&4
3074 case "$targetfrom" in
3081 $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
3086 cp) cat >$from <<EOF
3091 cp $targetdir/\$f . || exit 1
3096 *) echo "Unknown targetfrom '$targetfrom'" >&4
3100 if $test ! -f $run; then
3101 echo "Target 'run' script '$run' not found." >&4
3105 if $test ! -f $to; then
3106 echo "Target 'to' script '$to' not found." >&4
3110 if $test ! -f $from; then
3111 echo "Target 'from' script '$from' not found." >&4
3115 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3119 Using '$run' for remote execution,
3120 and '$from' and '$to'
3121 for remote file transfer.
3127 usecrosscompile="$undef"
3132 : see whether [:lower:] and [:upper:] are supported character classes
3134 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3136 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3140 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3141 # (0xd9 and 0xe2), therefore that is a nice testing point.
3142 if test "X$up" = X -o "X$low" = X; then
3143 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3149 if test "X$up" = X -o "X$low" = X; then
3150 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3156 if test "X$up" = X -o "X$low" = X; then
3157 case "`echo RS | od -x 2>/dev/null`" in
3159 echo "Hey, this might be EBCDIC." >&4
3160 if test "X$up" = X -o "X$low" = X; then
3161 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3162 rs) up='[A-IJ-RS-Z]'
3167 if test "X$up" = X -o "X$low" = X; then
3168 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3178 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3180 echo "Using $up and $low to convert case." >&4
3183 echo "I don't know how to translate letters from upper to lower case." >&4
3184 echo "Your tr is not acting any way I know of." >&4
3188 : set up the translation script tr, must be called with ./tr of course
3192 '[A-Z][a-z]') exec $tr '$up' '$low';;
3193 '[a-z][A-Z]') exec $tr '$low' '$up';;
3200 : Try to determine whether config.sh was made on this system
3201 case "$config_sh" in
3203 myuname=`$uname -a 2>/dev/null`
3204 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3205 # Downcase everything to avoid ambiguity.
3206 # Remove slashes and single quotes so we can use parts of this in
3207 # directory and file names.
3208 # Remove newlines so myuname is sane to use elsewhere.
3209 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3210 # because the A-Z/a-z are not consecutive.
3211 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3212 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3213 newmyuname="$myuname"
3215 case "$knowitall" in
3217 if test -f ../config.sh; then
3218 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3219 eval "`grep myuname= ../config.sh`"
3221 if test "X$myuname" = "X$newmyuname"; then
3229 : Get old answers from old config file if Configure was run on the
3230 : same system, otherwise use the hints.
3233 if test -f config.sh; then
3235 rp="I see a config.sh file. Shall I use it to set the defaults?"
3238 n*|N*) echo "OK, I'll ignore it."
3239 mv config.sh config.sh.old
3240 myuname="$newmyuname"
3242 *) echo "Fetching default answers from your old config.sh file..." >&4
3250 : Older versions did not always set $sh. Catch re-use of such
3260 if test ! -f config.sh; then
3263 First time through, eh? I have some defaults handy for some systems
3264 that need some extra help getting the Configure answers right:
3267 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3269 : Half the following guesses are probably wrong... If you have better
3270 : tests or hints, please send them to perlbug@perl.org
3271 : The metaconfig authors would also appreciate a copy...
3272 $test -f /irix && osname=irix
3273 $test -f /xenix && osname=sco_xenix
3274 $test -f /dynix && osname=dynix
3275 $test -f /dnix && osname=dnix
3276 $test -f /lynx.os && osname=lynxos
3277 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3278 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3279 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3280 $test -f /bin/mips && /bin/mips && osname=mips
3281 $test -d /usr/apollo/bin && osname=apollo
3282 $test -f /etc/saf/_sactab && osname=svr4
3283 $test -d /usr/include/minix && osname=minix
3284 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3285 if $test -d /MachTen -o -d /MachTen_Folder; then
3287 if $test -x /sbin/version; then
3288 osvers=`/sbin/version | $awk '{print $2}' |
3289 $sed -e 's/[A-Za-z]$//'`
3290 elif $test -x /usr/etc/version; then
3291 osvers=`/usr/etc/version | $awk '{print $2}' |
3292 $sed -e 's/[A-Za-z]$//'`
3298 $test -f /sys/posix.dll &&
3299 $test -f /usr/bin/what &&
3300 set X `/usr/bin/what /sys/posix.dll` &&
3301 $test "$3" = UWIN &&
3305 if $test -f $uname; then
3313 umips) osname=umips ;;
3316 [23]100) osname=mips ;;
3318 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3319 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3322 elif $test -f /etc/kconfig; then
3324 if test "$lns" = "$ln -s"; then
3326 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3328 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3335 if test -n "$DJGPP"; then
3344 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3346 # oslevel can fail with:
3347 # oslevel: Unable to acquire lock.
3348 *not\ found) osvers="$4"."$3" ;;
3349 '<3240'|'<>3240') osvers=3.2.0 ;;
3350 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3351 '=3250'|'>3250') osvers=3.2.5 ;;
3355 bitrig) osname=bitrig
3358 bsd386) osname=bsd386
3361 cygwin*) osname=cygwin
3364 *dc.osx) osname=dcosx
3370 domainos) osname=apollo
3376 dragonfly) osname=dragonfly
3379 dynixptx*) osname=dynixptx
3380 osvers=`echo "$4"|sed 's/^v//'`
3382 freebsd) osname=freebsd
3384 genix) osname=genix ;;
3388 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3401 $test -f /system/lib/libandroid.so && osname=linux-android
3405 netbsd*) osname=netbsd
3408 news-os) osvers="$3"
3410 4*) osname=newsos4 ;;
3414 nonstop-ux) osname=nonstopux ;;
3415 openbsd) osname=openbsd
3421 POSIX-BC | posix-bc ) osname=posix-bc
3424 powerux | power_ux | powermax_os | powermaxos | \
3425 powerunix | power_unix) osname=powerux
3431 solaris) osname=solaris
3433 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3440 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3444 titanos) osname=titanos
3453 ultrix) osname=ultrix
3456 osf1|mls+) case "$5" in
3459 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3462 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3465 hp*) osname=hp_osf1 ;;
3466 mips) osname=mips_osf1 ;;
3469 # UnixWare 7.1.2 is known as Open UNIX 8
3470 openunix|unixware) osname=svr5
3478 $2) case "$osname" in
3482 : svr4.x or possibly later
3492 if test -f /stand/boot ; then
3493 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3494 if test -n "$INITPROG" -a -f "$INITPROG"; then
3495 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3496 if test -n "$isesix"; then
3504 *) if test -f /etc/systemid; then
3506 set `echo $3 | $sed 's/\./ /g'` $4
3507 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3509 elif $test -f $src/hints/sco_$1_$2.sh; then
3511 elif $test -f $src/hints/sco_$1.sh; then
3516 '') : Still unknown. Probably a generic Sys V.
3525 *) case "$osname" in
3526 '') : Still unknown. Probably a generic BSD.
3534 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3535 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3536 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3539 $rm -f UU/kernel.what
3540 elif test -d c:/. -o -n "$is_os2" ; then
3547 case "$targetarch" in
3550 case "$targetarch" in
3552 # Will load qnx.sh, which should change osname to nto
3557 # Catch arm-linux-androideabi, mipsel-linux-android,
3558 # and i686-linux-android
3559 osname=linux-android
3563 # Something like arm-linux-gnueabihf is really just
3570 # XXX perhaps we should just assume
3571 # osvers to be 2, or maybe take the value
3572 # from targetarch. Using $run before the
3573 # hints are run is somewhat icky.
3574 set X `$run $uname -a 2>/dev/null`
3577 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3582 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3589 : Now look for a hint file osname_osvers, unless one has been
3590 : specified already.
3593 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3594 : Also try without trailing minor version numbers.
3595 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3596 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3597 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3598 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3601 *) case "$osvers" in
3604 *) if $test -f $src/hints/$file.sh ; then
3606 elif $test -f $src/hints/$xfile.sh ; then
3608 elif $test -f $src/hints/$xxfile.sh ; then
3610 elif $test -f $src/hints/$xxxfile.sh ; then
3612 elif $test -f $src/hints/$xxxxfile.sh ; then
3614 elif $test -f "$src/hints/${osname}.sh" ; then
3623 if $test -f Policy.sh ; then
3626 none) dflt="Policy" ;;
3627 *) dflt="Policy $dflt" ;;
3632 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3636 if $test -f Policy.sh ; then
3639 There's also a Policy hint file available, which should make the
3640 site-specific (policy) questions easier to answer.
3647 You may give one or more space-separated answers, or "none" if appropriate.
3648 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3649 previous run of Configure, you may specify it as well as or instead of
3650 OS-specific hints. If hints are provided for your OS, you should use them:
3651 although Perl can probably be built without hints on many platforms, using
3652 hints often improve performance and may enable features that Configure can't
3653 set up on its own. If there are no hints that match your OS, specify "none";
3654 DO NOT give a wrong version or a wrong OS.
3658 rp="Which of these apply, if any?"
3661 for file in $tans; do
3662 if $test X$file = XPolicy -a -f Policy.sh; then
3664 $cat Policy.sh >> UU/config.sh
3665 elif $test -f $src/hints/$file.sh; then
3666 . $src/hints/$file.sh
3667 $cat $src/hints/$file.sh >> UU/config.sh
3668 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3671 : Give one chance to correct a possible typo.
3672 echo "$file.sh does not exist"
3674 rp="hint to use instead?"
3676 for file in $ans; do
3677 if $test -f "$src/hints/$file.sh"; then
3678 . $src/hints/$file.sh
3679 $cat $src/hints/$file.sh >> UU/config.sh
3680 elif $test X$ans = X -o X$ans = Xnone ; then
3683 echo "$file.sh does not exist -- ignored."
3690 : Remember our hint file for later.
3691 if $test -f "$src/hints/$file.sh" ; then
3701 echo "Fetching default answers from $config_sh..." >&4
3705 cp $config_sh config.sh 2>/dev/null
3715 test "$override" && . ./optdef.sh
3717 : Restore computed paths
3718 for file in $loclist $trylist; do
3719 eval $file="\$_$file"
3724 Configure uses the operating system name and version to set some defaults.
3725 The default value is probably right if the name rings a bell. Otherwise,
3726 since spelling matters for me, either accept the default or answer "none"
3733 ''|' '|none) dflt=none ;;
3734 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3737 *) dflt="$osname" ;;
3739 rp="Operating system name?"
3743 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3749 ''|' '|none) dflt=none ;;
3750 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3751 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3753 ''|' ') dflt=none ;;
3758 *) dflt="$osvers" ;;
3760 rp="Operating system version?"
3770 : who configured the system
3771 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3774 cf_by=`(logname) 2>/dev/null`
3777 cf_by=`(whoami) 2>/dev/null`
3779 "") cf_by=unknown ;;
3784 : decide how portable to be. Allow command line overrides.
3785 case "$d_portable" in
3787 *) d_portable="$define" ;;
3790 : set up shell script to do ~ expansion
3796 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3799 if $test -f /bin/csh; then
3800 /bin/csh -f -c "glob \$1"
3805 name=\`$expr x\$1 : '..\([^/]*\)'\`
3806 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3807 if $test ! -d "\$dir"; then
3809 echo "\$me: can't locate home directory for: \$name" >&2
3814 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3830 : now set up to get a file name
3834 cat <<'EOSC' >>getfile
3850 : getfile will accept an answer from the comma-separated list
3851 : enclosed in parentheses even if it does not meet other criteria.
3852 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3853 fn=`echo $fn | sed 's/(.*)//'`
3859 loc_file=`expr $fn : '.*:\(.*\)'`
3860 fn=`expr $fn : '\(.*\):.*'`
3868 */*) fullpath=true;;
3877 *e*) exp_file=true;;
3880 *p*) nopath_ok=true;;
3885 *d*) type='Directory';;
3886 *l*) type='Locate';;
3891 Locate) what='File';;
3896 case "$d_portable" in
3904 while test "$type"; do
3909 true) rp="$rp (~name ok)";;
3912 if test -f UU/getfile.ok && \
3913 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3932 value=`UU/filexp $ans`
3935 if test "$ans" != "$value"; then
3936 echo "(That expands to $value on this system.)"
3950 /*) value="$ansexp" ;;
3951 [a-zA-Z]:/*) value="$ansexp" ;;
3956 echo "I shall only accept a full path name, as in /bin/ls." >&4
3957 echo "Use a ! shell escape if you wish to check pathnames." >&4
3960 echo "Please give a full path name, starting with slash." >&4
3963 echo "Note that using ~name is ok provided it expands well." >&4
3976 for fp in $gfpth; do
3977 if test "X$fp" = X.; then
3982 if test -f "$pf"; then
3984 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3986 echo "($value is not a plain file, but that's ok.)"
3989 if test X"$type" = X; then
3996 for fp in $gfpth; do
3997 if test "X$fp" = X.; then
4002 direxp="$fp/$ansexp"
4004 if test -d "$direxp"; then
4012 if test -d "$ansexp"; then
4013 echo "(Looking for $loc_file in directory $value.)"
4014 value="$value/$loc_file"
4015 ansexp="$ansexp/$loc_file"
4017 if test -f "$ansexp"; then
4020 case "$nopath_ok" in
4021 true) case "$value" in
4023 *) echo "Assuming $value will be in people's path."
4039 if test "$fastread" = yes; then
4044 rp="$what $value doesn't exist. Use that name anyway?"
4063 test "X$gfpthkeep" != Xy && gfpth=""
4066 : determine root of directory hierarchy where package will be installed.
4069 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
4072 dflt=`echo "$prefix" | sed 's/.$//'`
4080 By default, $package will be installed in $dflt/bin, manual pages
4081 under $dflt/man, etc..., i.e. with $dflt as prefix for all
4082 installation directories. Typically this is something like /usr/local.
4083 If you wish to have binaries under /usr/bin but other parts of the
4084 installation under /usr/local, that's ok: you will be prompted
4085 separately for each of the installation directories, the prefix being
4086 only used to set the defaults.
4090 rp='Installation prefix to use?'
4098 *) oldprefix="$prefix";;
4105 : allow them to override the AFS root
4108 *) afsroot=$afsroot ;;
4114 $define|true) afs=true ;;
4115 $undef|false) afs=false ;;
4116 *) if $test -d $afsroot; then
4124 echo "AFS may be running... I'll be extra cautious then..." >&4
4126 echo "AFS does not seem to be running..." >&4
4129 : determine installation prefix for where package is to be installed.
4133 Since you are running AFS, I need to distinguish the directory in which
4134 files will reside from the directory in which they are installed (and from
4135 which they are presumably copied to the former directory by occult means).
4138 case "$installprefix" in
4139 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4140 *) dflt="$installprefix";;
4145 In some special cases, particularly when building $package for distribution,
4146 it is convenient to distinguish the directory in which files should be
4147 installed from the directory ($prefix) in which they will
4148 eventually reside. For most users, these two directories are the same.
4151 case "$installprefix" in
4153 *) dflt=$installprefix;;
4157 rp='What installation prefix should I use for installing files?'
4159 installprefix="$ans"
4160 installprefixexp="$ansexp"
4162 : Perform the prefixexp/installprefixexp correction if necessary
4163 cat <<EOS >installprefix
4166 cat <<'EOSC' >>installprefix
4167 : Change installation prefix, if necessary.
4168 if $test X"$prefix" != X"$installprefix"; then
4169 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4171 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4174 chmod +x installprefix
4175 $eunicefix installprefix
4177 : Set variables such as privlib and privlibexp from the output of ./getfile
4178 : performing the prefixexp/installprefixexp correction if necessary.
4179 cat <<EOS >setprefixvar
4182 cat <<'EOSC' >>setprefixvar
4183 eval "${prefixvar}=\"\$ans\""
4184 eval "${prefixvar}exp=\"\$ansexp\""
4187 chmod +x setprefixvar
4188 $eunicefix setprefixvar
4190 : set up the script used to warn in case of inconsistency
4199 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4201 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4202 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4207 echo "*** WHOA THERE!!! ***" >&4
4208 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4211 rp=" Keep the $hint value?"
4214 y) td=$was; tu=$was;;
4218 : function used to set '$1' to '$val'
4219 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4221 $define$undef) . ./whoa; eval "$var=\$td";;
4222 $undef$define) . ./whoa; eval "$var=\$tu";;
4223 *) eval "$var=$val";;
4226 : get the patchlevel
4228 echo "Getting the current patchlevel..." >&4
4229 if $test -r $rsrc/patchlevel.h;then
4230 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4231 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4232 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4233 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4234 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4235 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4236 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4245 $echo "(You do not have patchlevel.h. Eek.)"
4247 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4248 version_patchlevel_string="version $patchlevel subversion $subversion"
4249 case "$perl_patchlevel" in
4251 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4252 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4256 $echo "(You have $package $version_patchlevel_string.)"
4260 : XXX Should be a Configure test for double-dots in filenames.
4261 version=`echo $revision $patchlevel $subversion | \
4262 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4263 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4264 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4267 version=`echo $revision $patchlevel $subversion | \
4268 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4269 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4270 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4273 : Special case the 5.005_xx maintenance series, which used 5.005
4274 : without any subversion label as a subdirectory in $sitelib
4275 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4276 api_versionstring='5.005'
4279 : Do we want threads support and if so, what type
4280 case "$usethreads" in
4281 $define|true|[yY]*) dflt='y';;
4282 *) # Catch case where user specified ithreads or 5005threads but
4283 # forgot -Dusethreads (A.D. 4/2002)
4284 case "$useithreads$use5005threads" in
4285 *$define*) dflt='y';;
4292 Perl can be built to offer a form of threading support on some systems
4293 To do so, Configure can be run with -Dusethreads.
4295 Note that Perl built with threading support runs slightly slower
4296 and uses slightly more memory than plain Perl.
4298 If this doesn't make any sense to you, just accept the default '$dflt'.
4300 rp='Build a threading Perl?'
4303 y|Y) val="$define" ;;
4309 if $test $patchlevel -lt 9; then
4310 case "$usethreads" in
4312 : Default to ithreads unless overridden on command line or with
4315 case "$use5005threads" in
4317 echo "5.005 threads are no longer supported"
4321 case "$useithreads" in
4322 $undef|false|[nN]*) dflt='n';;
4324 rp='Use the newer interpreter-based ithreads?'
4327 y|Y) val="$define" ;;
4332 : Now set use5005threads to the opposite value.
4333 case "$useithreads" in
4334 $define) val="$undef" ;;
4341 useithreads="$undef"
4342 use5005threads="$undef"
4346 case "$useithreads$use5005threads" in
4350 You cannot have both the ithreads and the 5.005 threads enabled
4351 at the same time. Disabling the 5.005 threads since they are
4352 much less stable than the ithreads.
4355 use5005threads="$undef"
4360 : perl-5.9.x and later
4362 if test X"$usethreads" = "X$define"; then
4363 case "$use5005threads" in
4367 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4374 use5005threads="$undef"
4375 useithreads="$usethreads"
4378 case "$d_oldpthreads" in
4379 '') : Configure tests would be welcome here. For now, assume undef.
4381 *) val="$d_oldpthreads" ;;
4387 : Look for a hint-file generated 'call-back-unit'. If the
4388 : user has specified that a threading perl is to be built,
4389 : we may need to set or change some other defaults.
4390 if $test -f usethreads.cbu; then
4391 echo "Your platform has some specific hints regarding threaded builds, using them..."
4394 case "$usethreads" in
4395 "$define"|true|[yY]*)
4397 (Your platform does not have any specific hints for threaded builds.
4398 Assuming POSIX threads, then.)
4404 : Check if multiplicity is required
4407 Perl can be built so that multiple Perl interpreters can coexist
4408 within the same Perl executable.
4411 case "$useithreads" in
4414 This multiple interpreter support is required for interpreter-based threads.
4418 *) case "$usemultiplicity" in
4419 $define|true|[yY]*) dflt='y';;
4423 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4424 rp='Build Perl for multiplicity?'
4427 y|Y) val="$define" ;;
4435 : Check if morebits is requested
4436 case "$usemorebits" in
4437 "$define"|true|[yY]*)
4438 use64bitint="$define"
4439 uselongdouble="$define"
4440 usemorebits="$define"
4442 *) usemorebits="$undef"
4446 : Determine the C compiler to be used
4452 rp="Use which C compiler?"
4456 : See whether they have no cc but they do have gcc
4458 if $test -f cc.cbu; then
4463 : make some quick guesses about what we are up against
4465 $echo $n "Hmm... $c"
4475 $cat $sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h >foo 2>/dev/null
4476 if test -f /osf_boot || $contains 'OSF/1' $sysroot/usr/include/ctype.h >/dev/null 2>&1
4478 echo "Looks kind of like an OSF/1 system, but we'll see..."
4480 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4481 xxx=`./loc addbib blurfl $pth`
4482 if $test -f $xxx; then
4483 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4487 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4488 echo "Looks kind of like an extended USG system, but we'll see..."
4490 echo "Looks kind of like a USG system, but we'll see..."
4494 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4495 echo "Looks kind of like a BSD system, but we'll see..."
4499 echo "Looks kind of like a Version 7 system, but we'll see..."
4502 case "$eunicefix" in
4505 There is, however, a strange, musty smell in the air that reminds me of
4506 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4510 : it so happens the Eunice I know will not run shell scripts in Unix format
4514 echo "Congratulations. You aren't running Eunice."
4518 : Detect OS2. The p_ variable is set above in the Head.U unit.
4519 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4520 : semicolon as a patch separator
4525 I have the feeling something is not exactly right, however...don't tell me...
4526 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4527 (Or you may be running DOS with DJGPP.)
4532 if test -f /xenix; then
4533 echo "Actually, this looks more like a XENIX system..."
4538 echo "It's not Xenix..."
4543 if test -f /venix; then
4544 echo "Actually, this looks more like a VENIX system..."
4551 echo "Nor is it Venix..."
4554 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4555 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4558 : Check if we are using GNU gcc and what its version is
4560 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4564 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4566 printf("%s\n", __VERSION__);
4568 printf("%s\n", "1");
4574 if $cc -o try $ccflags $ldflags try.c; then
4575 gccversion=`$run ./try`
4576 case "$gccversion" in
4577 '') echo "You are not using GNU cc." ;;
4578 *) echo "You are using GNU cc $gccversion."
4584 echo "*** WHOA THERE!!! ***" >&4
4585 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4586 case "$knowitall" in
4588 echo " You'd better start hunting for one and let me know about it." >&4
4594 case "$gccversion" in
4595 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4597 case "$gccversion" in
4598 '') gccosandvers='' ;;
4599 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4600 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4602 case "$gccosandvers" in
4603 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4604 $osname$osvers) ;; # looking good
4605 $osname*) cat <<EOM >&4
4607 *** WHOA THERE!!! ***
4609 Your gcc has not been compiled for the exact release of
4610 your operating system ($gccosandvers versus $osname$osvers).
4612 In general it is a good idea to keep gcc synchronized with
4613 the operating system because otherwise serious problems
4614 may ensue when trying to compile software, like Perl.
4616 I'm trying to be optimistic here, though, and will continue.
4617 If later during the configuration and build icky compilation
4618 problems appear (headerfile conflicts being the most common
4619 manifestation), I suggest reinstalling the gcc to match
4620 your operating system release.
4624 *) gccosandvers='' ;; # failed to parse, better be silent
4632 # gcc 3.* complain about adding -Idirectories that they already know about,
4633 # so we will take those off from locincpth.
4634 case "$gccversion" in
4636 echo "main(){}">try.c
4637 for incdir in $locincpth; do
4638 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4639 grep '^c[cp]p*[01]: warning: changing search order '`
4640 if test "X$warn" != X; then
4641 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4647 # gcc 4.9 by default does some optimizations that break perl.
4648 # see ticket 121505.
4650 # The -fwrapv disables those optimizations (and probably others,) so
4651 # for gcc 4.9 (and later, since the optimizations probably won't go
4652 # away), add -fwrapv unless the user requests -fno-wrapv, which
4653 # disables -fwrapv, or if the user requests -fsanitize=undefined,
4654 # which turns the overflows -fwrapv ignores into runtime errors.
4655 case "$gccversion" in
4656 4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
4658 *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
4659 *) ccflags="$ccflags -fwrapv" ;;
4663 : What should the include directory be ?
4664 : Use sysroot if set, so findhdr looks in the right place.
4666 $echo $n "Hmm... $c"
4667 dflt="$sysroot/usr/include"
4670 if $test -f /bin/mips && /bin/mips; then
4671 echo "Looks like a MIPS system..."
4672 $cat >usr.c <<'EOCP'
4673 #ifdef SYSTYPE_BSD43
4677 if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4678 dflt='/bsd43/usr/include'
4682 mips_type='System V'
4684 $rm -f usr.c usr.out
4685 echo "and you're compiling with the $mips_type compiler and libraries."
4689 echo "Doesn't look like a MIPS system."
4699 case "$xxx_prompt" in
4702 rp='Where are the include files you want to use?'
4710 : see how we invoke the C preprocessor
4712 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4713 cat <<'EOT' >testcpp.c
4719 if test ! -f cppstdin; then
4720 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4721 # AIX cc -E doesn't show the absolute headerfile
4722 # locations but we'll cheat by using the -M flag.
4723 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
4725 echo 'cat >.$$.c; '"$cc $cppflags"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4728 echo "Keeping your $hint cppstdin wrapper."
4731 wrapper=`pwd`/cppstdin
4735 if $test "X$cppstdin" != "X" && \
4736 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4737 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4739 echo "You used to use $cppstdin $cppminus so we'll use that again."
4741 '') echo "But let's see if we can live without a wrapper..." ;;
4743 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4744 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4746 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4749 echo "(However, $cpprun $cpplast does not work, let's see...)"
4757 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4764 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4765 $cc -E <testcpp.c >testcpp.out 2>&1; \
4766 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4767 echo "Yup, it does."
4768 x_cpp="$cc $cppflags -E"
4770 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4771 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4772 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4773 echo "Yup, it does."
4774 x_cpp="$cc $cppflags -E"
4776 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4777 $cc -P <testcpp.c >testcpp.out 2>&1; \
4778 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4779 echo "Yipee, that works!"
4780 x_cpp="$cc $cppflags -P"
4782 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4783 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4784 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4785 echo "At long last!"
4786 x_cpp="$cc $cppflags -P"
4788 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4789 $cpp <testcpp.c >testcpp.out 2>&1; \
4790 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4792 x_cpp="$cpp $cppflags"
4794 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4795 $cpp - <testcpp.c >testcpp.out 2>&1; \
4796 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4797 echo "Hooray, it works! I was beginning to wonder."
4798 x_cpp="$cpp $cppflags"
4800 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4801 $wrapper <testcpp.c >testcpp.out 2>&1; \
4802 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4808 rp="No dice. I can't find a C preprocessor. Name one:"
4812 $x_cpp <testcpp.c >testcpp.out 2>&1
4813 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4814 echo "OK, that will do." >&4
4816 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4831 echo "Perhaps can we force $cc -E using a wrapper..."
4832 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4833 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4839 echo "Nope, we'll have to live without it..."
4853 "$wrapper"|'cppstdin') ;;
4854 *) $rm -f $wrapper;;
4856 $rm -f testcpp.c testcpp.out
4858 : Adjust cppfilter for path component separator
4860 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4861 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4865 : Use gcc to determine libpth and incpth
4866 # If using gcc or clang, we can get better values for libpth, incpth
4867 # and usrinc directly from the compiler.
4868 # Note that ccname for clang is also gcc.
4871 $echo 'extern int foo;' > try.c
4872 set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
4874 if $test $# -gt 0; then
4876 incpth="`$echo $incpth|$sed 's/^ //'`"
4878 j="`$echo $i|$sed 's,/include$,/lib,'`"
4879 if $test -d $j; then
4883 libpth="`$echo $libpth|$sed 's/^ //'`"
4884 for xxx in $libpth $loclibpth $plibpth $glibpth; do
4885 if $test -d $xxx; then
4888 *) libpth="$libpth $xxx";;
4895 '') for i in $incpth; do
4896 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
4904 case "$usecrosscompile" in
4907 '') echo "Incpth not defined." >&4; croak=y ;;
4908 *) echo "Using incpth '$incpth'." >&4 ;;
4911 '') echo "Libpth not defined." >&4; croak=y ;;
4912 *) echo "Using libpth '$libpth'." >&4 ;;
4915 '') echo "Usrinc not defined." >&4; croak=y ;;
4916 *) echo "Using usrinc $usrinc." >&4 ;;
4920 if test "X$sysroot" = X; then
4921 echo "Cannot continue, aborting." >&4; exit 1
4923 echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
4932 : Default value for incpth is just usrinc
4934 '') incpth="$usrinc";;
4937 : Set private lib path
4940 plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
4945 '') dlist="$loclibpth $plibpth $glibpth";;
4946 *) dlist="$libpth";;
4949 : Now check and see which directories actually exist, avoiding duplicates
4952 if $test -d $xxx; then
4955 *) libpth="$libpth $xxx";;
4961 Some systems have incompatible or broken versions of libraries. Among
4962 the directories listed in the question below, please remove any you
4963 know not to be holding relevant libraries, and add any that are needed.
4964 Say "none" for none.
4968 if test "X$sysroot" != X; then
4970 You have set sysroot to $sysroot, please supply the directories excluding sysroot
4983 rp="Directories to use for library searches?"
4990 : compute shared library extension
4993 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
5003 On some systems, shared libraries may be available. Answer 'none' if
5004 you want to suppress searching of shared libraries for the remainder
5005 of this configuration.
5008 rp='What is the file extension used for shared libraries?'
5012 : Does target system insist that shared library basenames are unique
5015 Some dynamic loaders assume that the *basename* of shared library filenames
5016 are globally unique. We'll default this to undef as we assume your system
5017 is not this weird. Set to defined if you're on one of them.
5022 rp='Make shared library basenames unique?'
5025 y|Y) val="$define" ;;
5028 set d_libname_unique
5031 : Define several unixisms.
5032 : Hints files or command line option can be used to override them.
5033 : The convoluted testing is in case hints files set either the old
5036 '') case "$exe_ext" in
5038 *) _exe="$exe_ext" ;;
5043 '') case "$lib_ext" in
5050 '') case "$obj_ext" in
5057 '') case "$path_sep" in
5068 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
5070 : Which makefile gets called first. This is used by make depend.
5071 case "$firstmakefile" in
5072 '') firstmakefile='makefile';;
5075 : Check is we will use socks
5077 $define|true|[yY]*) dflt='y';;
5082 Perl can be built to use the SOCKS proxy protocol library. To do so,
5083 Configure must be run with -Dusesocks. If you use SOCKS you also need
5084 to use the PerlIO abstraction layer, this will be implicitly selected.
5086 If this doesn't make any sense to you, just accept the default '$dflt'.
5088 rp='Build Perl for SOCKS?'
5091 y|Y) val="$define" ;;
5097 : Check for uselongdouble support
5099 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5102 case "$uselongdouble" in
5103 $define|true|[yY]*) dflt='y';;
5108 Perl can be built to take advantage of long doubles which
5109 (if available) may give more accuracy and range for floating point numbers.
5111 If this doesn't make any sense to you, just accept the default '$dflt'.
5113 rp='Try to use long doubles if available?'
5116 y|Y) val="$define" ;;
5122 case "$uselongdouble" in
5123 true|[yY]*) uselongdouble="$define" ;;
5126 : Look for a hint-file generated 'call-back-unit'. If the
5127 : user has specified that long doubles should be used,
5128 : we may need to set or change some other defaults.
5129 if $test -f uselongdouble.cbu; then
5130 echo "Your platform has some specific hints regarding long doubles, using them..."
5131 . ./uselongdouble.cbu
5133 case "$uselongdouble" in
5136 (Your platform does not have any specific hints for long doubles.)
5142 : Looking for optional libraries
5144 echo "Checking for optional libraries..." >&4
5149 case "$libswanted" in
5150 '') libswanted='c_s';;
5153 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
5155 case "$usecbacktrace" in
5156 "$define") libswanted="$libswanted bfd" ;;
5162 for thisdir in $libpth $xlibpth; do
5163 test -d $thisdir && libspath="$libspath $thisdir"
5165 for thislib in $libswanted; do
5166 for thisdir in $libspath; do
5168 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
5169 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
5170 $test -f "$xxx" && eval $libscheck
5171 $test -f "$xxx" && libstyle=shared
5173 if test ! -f "$xxx"; then
5174 xxx=$thisdir/lib$thislib.$so
5175 $test -f "$xxx" && eval $libscheck
5176 $test -f "$xxx" && libstyle=shared
5178 if test ! -f "$xxx"; then
5179 xxx=$thisdir/lib$thislib$_a
5180 $test -f "$xxx" && eval $libscheck
5181 $test -f "$xxx" && libstyle=static
5183 if test ! -f "$xxx"; then
5184 xxx=$thisdir/$thislib$_a
5185 $test -f "$xxx" && eval $libscheck
5186 $test -f "$xxx" && libstyle=static
5188 if test ! -f "$xxx"; then
5189 xxx=$thisdir/lib${thislib}_s$_a
5190 $test -f "$xxx" && eval $libscheck
5191 $test -f "$xxx" && libstyle=static
5192 $test -f "$xxx" && thislib=${thislib}_s
5194 if test ! -f "$xxx"; then
5195 xxx=$thisdir/Slib$thislib$_a
5196 $test -f "$xxx" && eval $libscheck
5197 $test -f "$xxx" && libstyle=static
5199 if $test -f "$xxx"; then
5201 shared) echo "Found -l$thislib (shared)." ;;
5202 static) echo "Found -l$thislib." ;;
5203 *) echo "Found -l$thislib ($libstyle)." ;;
5207 *) dflt="$dflt -l$thislib"
5208 libsfound="$libsfound $xxx"
5210 libsfiles="$libsfiles $yyy"
5211 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5212 case " $libsdirs " in
5214 *) libsdirs="$libsdirs $yyy" ;;
5221 if $test ! -f "$xxx"; then
5222 echo "No -l$thislib."
5233 ' '|'') dflt='none';;
5238 In order to compile $package on your machine, a number of libraries
5239 are usually needed. Include any other special libraries here as well.
5240 Say "none" for none. The default list is almost always right.
5244 rp="What libraries to use?"
5251 : determine optimization, if desired, or use for debug flag also
5253 ' '|$undef) dflt='none';;
5255 *) dflt="$optimize";;
5259 By default, $package compiles with the -O flag to use the optimizer.
5260 Alternately, you might want to use the symbolic debugger, which uses
5261 the -g flag (on traditional Unix systems). Either flag can be
5262 specified here. To use neither flag, specify the word "none".
5265 rp="What optimizer/debugger flag should be used?"
5269 'none') optimize=" ";;
5272 : Check what DEBUGGING is required from the command line
5273 : -DEBUGGING or -DDEBUGGING or
5274 : -DEBUGGING=both = -g + -DDEBUGGING
5275 : -DEBUGGING=-g or -Doptimize=-g = -g
5276 : -DEBUGGING=none or -UDEBUGGING =
5277 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5280 *) DEBUGGING=$EBUGGING ;;
5283 case "$DEBUGGING" in
5287 *) optimize="$optimize -g" ;;
5291 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5299 case "$DEBUGGING" in
5300 both|$define) dflt='-DDEBUGGING'
5303 : argument order is deliberate, as the flag will start with - which set could
5304 : think is an option
5305 checkccflag='check=$1; flag=$2; callback=$3;
5307 echo "Checking if your compiler accepts $flag" 2>&1;
5308 [ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
5309 echo "int main(void) { return 0; }" > gcctest.c;
5310 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
5311 echo "Yes, it does." 2>&1;
5312 if $test -s gcctest.out ; then
5313 echo "But your platform does not like it:";
5318 echo "Leaving current flags $ccflags alone." 2>&1
5320 *) dflt="$dflt $flag";
5326 echo "Nope, it does not, but that is ok." 2>&1;
5330 : We will not override a previous value, but we might want to
5331 : augment a hint file
5333 default|recommended)
5334 case "$gccversion" in
5335 1*) dflt="$dflt -fpcc-struct-return" ;;
5337 case "$optimize:$DEBUGGING" in
5338 *-g*:old) dflt="$dflt -DDEBUGGING";;
5340 case "$gccversion" in
5341 2*) if $test -d /etc/conf/kconfig.d &&
5342 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5344 # Interactive Systems (ISC) POSIX mode.
5349 case "$gccversion" in
5352 ?*) set strict-aliasing -fno-strict-aliasing
5356 # For gcc, adding -pipe speeds up compilations for some, but apparently
5357 # some assemblers can't read from stdin. (It also slows down compilations
5358 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5359 case "$gccversion" in
5365 # on x86_64 (at least) we require an extra library (libssp) in the
5366 # link command line. This library is not named, so I infer that it is
5367 # an implementation detail that may change. Hence the safest approach
5368 # is to add the flag to the flags passed to the compiler at link time,
5369 # as that way the compiler can do the right implementation dependant
5371 case "$gccversion" in
5372 ?*) set stack-protector -fstack-protector
5379 case "$mips_type" in
5380 *BSD*|'') inclwanted="$locincpth $usrinc";;
5381 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5383 for thisincl in $inclwanted; do
5384 if $test -d $thisincl; then
5385 if $test x$thisincl != x$usrinc; then
5387 *" -I$thisincl "*);;
5388 *) dflt="$dflt -I$thisincl ";;
5394 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5396 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5404 *) dflt="$dflt -D$2";;
5408 set signal.h LANGUAGE_C; eval $inctest
5412 ccflags="$ccflags -DSOCKS"
5417 default|recommended) dflt="$ccflags $dflt" ;;
5418 *) dflt="$ccflags";;
5427 Your C compiler may want other flags. For this question you should include
5428 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5429 but you should NOT include libraries or ld flags like -lwhatever. If you
5430 want $package to honor its debug switch, you should include -DDEBUGGING here.
5431 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5433 To use no flags, specify the word "none".
5439 rp="Any additional cc flags?"
5446 : the following weeds options from ccflags that are of no interest to cpp
5448 '') cppflags="$ccflags" ;;
5449 *) cppflags="$cppflags $ccflags" ;;
5451 case "$gccversion" in
5452 1*) cppflags="$cppflags -D__GNUC__"
5454 case "$mips_type" in
5456 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5462 echo "Let me guess what the preprocessor flags are..." >&4
5476 *) ftry="$previous $flag";;
5478 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5479 >cpp1.out 2>/dev/null && \
5480 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5481 >cpp2.out 2>/dev/null && \
5482 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5483 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5485 cppflags="$cppflags $ftry"
5495 *-*) echo "They appear to be: $cppflags";;
5497 $rm -f cpp.c cpp?.out
5501 : flags used in final linking phase
5503 '') if ./venix; then
5509 *-posix*) dflt="$dflt -posix" ;;
5512 *) dflt="$ldflags";;
5514 # See note above about -fstack-protector
5516 *-fstack-protector*)
5518 *-fstack-protector*) ;; # Don't add it again
5519 *) dflt="$dflt -fstack-protector" ;;
5524 : Try to guess additional flags to pick up local libraries.
5525 for thislibdir in $libpth; do
5526 case " $loclibpth " in
5529 *"-L$thislibdir "*) ;;
5530 *) dflt="$dflt -L$thislibdir" ;;
5542 Your C linker may need flags. For this question you should
5543 include -L/whatever and any other flags used by the C linker, but you
5544 should NOT include libraries like -lwhatever.
5546 Make sure you include the appropriate -L/path flags if your C linker
5547 does not normally search all of the directories you specified above,
5550 To use no flags, specify the word "none".
5554 rp="Any additional ld flags (NOT including libraries)?"
5560 rmlist="$rmlist pdp11"
5564 echo "Checking your choice of C compiler and flags for coherency..." >&4
5565 $cat > try.c <<'EOF'
5567 int main() { printf("Ok\n"); return(0); }
5569 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5571 $cat >try.msg <<'EOM'
5572 I've tried to compile and run the following simple program:
5575 $cat try.c >> try.msg
5577 $cat >> try.msg <<EOM
5584 and I got the following output:
5588 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5589 if $sh -c "$run ./try " >>try.msg 2>&1; then
5593 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5596 echo "The program compiled OK, but exited with status $?." >>try.msg
5597 rp="You have a problem. Shall I abort Configure"
5601 echo "I can't compile the test program." >>try.msg
5602 rp="You have a BIG problem. Shall I abort Configure"
5608 case "$knowitall" in
5610 echo "(The supplied flags or libraries might be incorrect.)"
5618 *) echo "Ok. Stopping Configure." >&4
5623 n) echo "OK, that should do.";;
5625 $rm_try gcctest gcctest.out
5627 : define a shorthand compile call
5631 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5632 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5636 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5637 : define a shorthand compile call for compilations that should be ok.
5641 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5643 : determine filename position in cpp output
5645 echo "Computing filename position in cpp output for #include directives..." >&4
5647 vos) testaccess=-e ;;
5650 echo '#include <stdio.h>' > foo.c
5653 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5654 $grep '^[ ]*#.*stdio\.h' | \
5655 while read cline; do
5658 while $test \$# -gt 0; do
5659 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5664 pos=\`expr \$pos + 1\`
5676 *) pos="${fieldn}th";;
5678 echo "Your cpp writes the filename in the $pos field of the line."
5680 : locate header file
5685 for usrincdir in $incpth
5687 if test -f \$usrincdir/\$wanted; then
5688 echo "\$usrincdir/\$wanted"
5692 awkprg='{ print \$$fieldn }'
5693 echo "#include <\$wanted>" > foo\$\$.c
5694 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5695 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5696 while read cline; do
5697 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5699 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5700 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5705 # status = 0: grep returned 0 lines, case statement not executed
5706 # status = 1: headerfile found
5707 # status = 2: while loop executed, no headerfile found
5711 if test \$status -eq 1; then
5718 : define an alternate in-header-list? function
5719 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5720 cont=true; xxf="echo \"<\$1> found.\" >&4";
5721 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5722 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5724 case $# in 4) instead=instead;; *) instead="at last";; esac;
5725 while $test "$cont"; do
5727 var=$2; eval "was=\$$2";
5728 if $test "$xxx" && $test -r "$xxx";
5730 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5733 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5734 set $yyy; shift; shift; yyy=$@;
5735 case $# in 0) cont="";;
5736 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5737 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5738 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5739 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5743 do set $yyy; var=$2; eval "was=\$$2";
5744 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5745 set $yyy; shift; shift; yyy=$@;
5748 : see if stdlib is available
5749 set stdlib.h i_stdlib
5752 : check for lengths of integral types
5756 echo "Checking to see how big your integers are..." >&4
5765 printf("intsize=%d;\n", (int)sizeof(int));
5766 printf("longsize=%d;\n", (int)sizeof(long));
5767 printf("shortsize=%d;\n", (int)sizeof(short));
5772 if eval $compile_ok && $run ./try > /dev/null; then
5774 echo "Your integers are $intsize bytes long."
5775 echo "Your long integers are $longsize bytes long."
5776 echo "Your short integers are $shortsize bytes long."
5780 Help! I can't compile and run the intsize test program: please enlighten me!
5781 (This is probably a misconfiguration in your system or libraries, and
5782 you really ought to fix it. Still, I'll try anyway.)
5786 rp="What is the size of an integer (in bytes)?"
5790 rp="What is the size of a long integer (in bytes)?"
5794 rp="What is the size of a short integer (in bytes)?"
5802 : check for long long
5804 echo "Checking to see if you have long long..." >&4
5805 echo 'int main() { long long x = 7; return 0; }' > try.c
5807 if eval $compile; then
5809 echo "You have long long."
5812 echo "You do not have long long."
5818 : check for length of long long
5819 case "${d_longlong}${longlongsize}" in
5822 echo "Checking to see how big your long longs are..." >&4
5823 $cat >try.c <<'EOCP'
5827 printf("%d\n", (int)sizeof(long long));
5832 if eval $compile_ok; then
5833 longlongsize=`$run ./try`
5834 echo "Your long longs are $longlongsize bytes long."
5838 echo "(I can't seem to compile the test program. Guessing...)"
5839 rp="What is the size of a long long (in bytes)?"
5843 if $test "X$longsize" = "X$longlongsize"; then
5844 echo "(That isn't any different from an ordinary long.)"
5850 : see if inttypes.h is available
5851 : we want a real compile instead of Inhdr because some systems
5852 : have an inttypes.h which includes non-existent headers
5855 #include <inttypes.h>
5857 static int32_t foo32 = 0x12345678;
5861 if eval $compile; then
5862 echo "<inttypes.h> found." >&4
5865 echo "<inttypes.h> NOT found." >&4
5874 echo "Checking to see if you have int64_t..." >&4
5876 #include <sys/types.h>
5877 #$i_inttypes I_INTTYPES
5879 #include <inttypes.h>
5881 int main() { int64_t x = 7; }
5884 if eval $compile; then
5886 echo "You have int64_t."
5889 echo "You do not have int64_t."
5895 : Check if 64bit ints have a quad type
5897 echo "Checking which 64-bit integer type we could use..." >&4
5903 val='"unsigned int"'
5908 *) case "$longsize" in
5912 val='"unsigned long"'
5917 *) case "$d_longlong:$longlongsize" in
5922 val='"unsigned long long"'
5927 *) case "$d_int64_t" in
5946 '') echo "Alas, no 64-bit integer types in sight." >&4
5949 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5954 : Do we want 64bit support
5955 case "$uselonglong" in
5956 "$define"|true|[yY]*)
5959 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5961 use64bitint="$define"
5964 case "$use64bits" in
5965 "$define"|true|[yY]*)
5968 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5970 use64bitint="$define"
5973 case "$use64bitints" in
5974 "$define"|true|[yY]*)
5977 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5979 use64bitint="$define"
5982 case "$use64bitsint" in
5983 "$define"|true|[yY]*)
5986 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5988 use64bitint="$define"
5991 case "$uselonglongs" in
5992 "$define"|true|[yY]*)
5995 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5997 use64bitint="$define"
6000 case "$use64bitsall" in
6001 "$define"|true|[yY]*)
6004 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
6006 use64bitall="$define"
6011 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
6013 case "$use64bitall" in
6014 "$define"|true|[yY]*) use64bitint="$define" ;;
6020 You have natively 64-bit long integers.
6024 *) case "$use64bitint" in
6025 "$define"|true|[yY]*) dflt='y';;
6034 Perl can be built to take advantage of 64-bit integer types
6035 on some systems. To do so, Configure can be run with -Duse64bitint.
6036 Choosing this option will most probably introduce binary incompatibilities.
6038 If this doesn't make any sense to you, just accept the default '$dflt'.
6039 (The default has been chosen based on your configuration.)
6041 rp='Try to use 64-bit integers, if available?'
6044 [yY]*) val="$define" ;;
6052 case "$use64bitall" in
6053 "$define"|true|[yY]*) dflt='y' ;;
6054 *) case "$longsize" in
6062 You may also choose to try maximal 64-bitness. It means using as much
6063 64-bitness as possible on the platform. This in turn means even more
6064 binary incompatibilities. On the other hand, your platform may not
6065 have any more 64-bitness available than what you already have chosen.
6067 If this doesn't make any sense to you, just accept the default '$dflt'.
6068 (The default has been chosen based on your configuration.)
6070 rp='Try to use maximal 64-bit support, if available?'
6073 [yY]*) val="$define" ;;
6078 case "$use64bitall" in
6080 case "$use64bitint" in
6084 Since you have chosen a maximally 64-bit build, I'm also turning on
6085 the use of 64-bit integers.
6087 use64bitint="$define" ;;
6092 : Look for a hint-file generated 'call-back-unit'. If the
6093 : user has specified that a 64-bit perl is to be built,
6094 : we may need to set or change some other defaults.
6095 if $test -f use64bitint.cbu; then
6096 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
6099 case "$use64bitint" in
6100 "$define"|true|[yY]*)
6101 : This test was common to all the OpenBSD forks, and seems harmless for
6104 echo "Checking if your C library has broken 64-bit functions..." >&4
6107 typedef $uquadtype myULL;
6114 {4294967303.15, 4294967303ULL},
6115 {4294967294.2, 4294967294ULL},
6116 {4294967295.7, 4294967295ULL},
6119 for (p = test; p->u; p++) {
6120 myULL x = (myULL)p->d;
6131 if eval $compile_ok; then
6132 libcquad=`$run ./try`
6133 echo "Your C library's 64-bit functions are $libcquad."
6135 echo "(I can't seem to compile the test program.)"
6136 echo "Assuming that your C library's 64-bit functions are ok."
6145 *** You have a C library with broken 64-bit functions.
6146 *** 64-bit support does not work reliably in this configuration.
6147 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6148 *** Cannot continue, aborting.
6155 4) case "$archname64" in
6156 '') archname64=64int ;;
6163 : Look for a hint-file generated 'call-back-unit'. If the
6164 : user has specified that a maximally 64-bit perl is to be built,
6165 : we may need to set or change some other defaults.
6166 if $test -f use64bitall.cbu; then
6167 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
6170 case "$use64bitall" in
6171 "$define"|true|[yY]*)
6173 4) case "$archname64" in
6174 ''|64int) archname64=64all ;;
6181 case "$d_quad:$use64bitint" in
6185 *** You have chosen to use 64-bit integers,
6186 *** but none can be found.
6187 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
6188 *** Cannot continue, aborting.
6195 : check for length of double
6197 case "$doublesize" in
6199 echo "Checking to see how big your double precision numbers are..." >&4
6208 printf("%d\n", (int)sizeof(double));
6213 if eval $compile_ok; then
6214 doublesize=`$run ./try`
6215 echo "Your double is $doublesize bytes long."
6218 echo "(I can't seem to compile the test program. Guessing...)"
6219 rp="What is the size of a double precision number (in bytes)?"
6227 : check for long doubles
6229 echo "Checking to see if you have long double..." >&4
6230 echo 'int main() { long double x = 7.0; }' > try.c
6232 if eval $compile; then
6234 echo "You have long double."
6237 echo "You do not have long double."
6243 : check for length of long double
6244 case "${d_longdbl}${longdblsize}" in
6247 echo "Checking to see how big your long doubles are..." >&4
6248 $cat >try.c <<'EOCP'
6252 printf("%d\n", sizeof(long double));
6257 if eval $compile; then
6258 longdblsize=`$run ./try`
6259 echo "Your long doubles are $longdblsize bytes long."
6263 echo "(I can't seem to compile the test program. Guessing...)" >&4
6264 rp="What is the size of a long double (in bytes)?"
6268 if $test "X$doublesize" = "X$longdblsize"; then
6269 echo "That isn't any different from an ordinary double."
6270 echo "I'll keep your setting anyway, but you may see some"
6271 echo "harmless compilation warnings."
6277 : determine the architecture name
6279 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6280 tarch=`arch`"-$osname"
6281 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6282 if uname -m > tmparch 2>&1 ; then
6283 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6284 -e 's/$/'"-$osname/" tmparch`
6292 case "$myarchname" in
6295 echo "(Your architecture name used to be $myarchname.)"
6299 case "$targetarch" in
6301 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6306 *) dflt="$archname";;
6308 rp='What is your architecture name'
6312 : optionally add API version to the architecture for versioned archlibs
6313 case "$useversionedarchname" in
6314 $define|true|[yY]*) dflt='y';;
6317 rp='Add the Perl API version to your archname?'
6320 y|Y) useversionedarchname="$define" ;;
6321 *) useversionedarchname="$undef" ;;
6323 case "$useversionedarchname" in
6326 *-$api_versionstring)
6327 echo "...and architecture name already has -$api_versionstring" >&4
6330 archname="$archname-$api_versionstring"
6331 echo "...setting architecture name to $archname." >&4
6337 case "$usethreads" in
6339 echo "Threads selected." >&4
6341 *-thread*) echo "...and architecture name already has -thread." >&4
6343 *) archname="$archname-thread"
6344 echo "...setting architecture name to $archname." >&4
6349 case "$usemultiplicity" in
6351 echo "Multiplicity selected." >&4
6353 *-multi*) echo "...and architecture name already has -multi." >&4
6355 *) archname="$archname-multi"
6356 echo "...setting architecture name to $archname." >&4
6361 case "$use64bitint$use64bitall" in
6363 case "$archname64" in
6365 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6368 case "$use64bitint" in
6369 "$define") echo "64 bit integers selected." >&4 ;;
6371 case "$use64bitall" in
6372 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6375 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6377 *) archname="$archname-$archname64"
6378 echo "...setting architecture name to $archname." >&4
6384 case "$uselongdouble" in
6386 echo "Long doubles selected." >&4
6387 case "$longdblsize" in
6389 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6393 *-ld*) echo "...and architecture name already has -ld." >&4
6395 *) archname="$archname-ld"
6396 echo "...setting architecture name to $archname." >&4
6403 if $test -f archname.cbu; then
6404 echo "Your platform has some specific hints for architecture name, using them..."
6408 : set the prefixit variable, to compute a suitable default value
6409 prefixit='case "$3" in
6411 case "$oldprefix" in
6412 "") eval "$1=\"\$$2\"";;
6419 ""|" ") eval "$1=\"\$$2\"";;
6425 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6427 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6428 /*-$oldprefix/*|\~*-$oldprefix/*)
6429 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6430 *) eval "$1=\"\$$2\"";;
6434 : determine installation style
6435 : For now, try to deduce it from prefix unless it is already set.
6436 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6437 case "$installstyle" in
6438 '') case "$prefix" in
6439 *perl*) dflt='lib';;
6440 *) dflt='lib/perl5' ;;
6443 *) dflt="$installstyle" ;;
6445 : Probably not worth prompting for this since we prompt for all
6446 : the directories individually, and the prompt would be too long and
6450 : determine where public executables go
6455 rp='Pathname where the public executables will reside?'
6457 if $test "X$ansexp" != "X$binexp"; then
6461 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6462 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6463 : this via initialinstalllocation
6466 case "$userelocatableinc" in
6467 $define|true|[yY]*) dflt='y' ;;
6472 Would you like to build Perl so that the installation is relocatable, so that
6473 library paths in @INC are determined relative to the path of the perl binary?
6474 This is not advised for system Perl installs, or if you need to run setid
6475 scripts or scripts under taint mode.
6477 If this doesn't make any sense to you, just accept the default '$dflt'.
6479 rp='Use relocatable @INC?'
6482 y|Y) val="$define" ;;
6485 set userelocatableinc
6488 initialinstalllocation="$binexp"
6489 : Default prefix is now "up one level from where the binaries are"
6490 case "$userelocatableinc" in
6496 installprefixexp=".../.."
6500 : determine where private library files go
6501 : Usual default is /usr/local/lib/perl5/$version.
6502 : Also allow things like /opt/perl/lib/$version, since
6503 : /opt/perl/lib/perl5... would be redundant.
6504 : The default "style" setting is made in installstyle.U
6505 case "$installstyle" in
6506 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6507 *) set dflt privlib lib/$version ;;
6512 There are some auxiliary files for $package that need to be put into a
6513 private library directory that is accessible by everyone.
6518 rp='Pathname where the private library files will reside?'
6523 : set the prefixup variable, to restore leading tilda escape
6524 prefixup='case "$prefixexp" in
6526 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6529 : determine where public architecture dependent libraries go
6532 : privlib default is /usr/local/lib/$package/$version
6533 : archlib default is /usr/local/lib/$package/$version/$archname
6534 : privlib may have an optional trailing /share.
6535 tdflt=`echo $privlib | $sed 's,/share$,,'`
6536 tdflt=$tdflt/$archname
6545 $spackage contains architecture-dependent library files. If you are
6546 sharing libraries in a heterogeneous environment, you might store
6547 these files in a separate location. Otherwise, you can just include
6548 them with the rest of the public library files.
6553 rp='Where do you want to put the public architecture-dependent libraries?'
6557 if $test X"$archlib" = X"$privlib"; then
6563 : see if setuid scripts can be secure
6566 Some kernels have a bug that prevents setuid #! scripts from being
6567 secure. Some sites have disabled setuid #! scripts because of this.
6569 First let's decide if your kernel supports secure setuid #! scripts.
6570 (If setuid #! scripts would be secure but have been disabled anyway,
6571 don't say that they are secure if asked.)
6576 if $test -d /dev/fd; then
6577 echo "#!$ls" >reflect
6578 chmod +x,u+s reflect
6579 ./reflect >flect 2>&1
6580 if $contains "/dev/fd" flect >/dev/null; then
6581 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6585 If you are not sure if they are secure, I can check but I'll need a
6586 username and password different from the one you are using right now.
6587 If you don't have such a username or don't want me to test, simply
6591 rp='Other username to test security of setuid scripts with?'
6596 case "$d_suidsafe" in
6597 '') echo "I'll assume setuid scripts are *not* secure." >&4
6600 echo "Well, the $hint value is *not* secure." >&4
6602 *) echo "Well, the $hint value *is* secure." >&4
6607 $rm -f reflect flect
6608 echo "#!$ls" >reflect
6609 chmod +x,u+s reflect
6612 echo '"su" will (probably) prompt you for '"$ans's password."
6613 su $ans -c './reflect >flect'
6614 if $contains "/dev/fd" flect >/dev/null; then
6615 echo "Okay, it looks like setuid scripts are secure." >&4
6618 echo "I don't think setuid scripts are secure." >&4
6623 rp='Does your kernel have *secure* setuid scripts?'
6626 [yY]*) val="$define";;
6631 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6632 echo "(That's for file descriptors, not floppy disks.)"
6638 $rm -f reflect flect
6640 : now see if they want to do setuid emulation
6641 if $test $patchlevel -lt 11; then
6644 case "$d_suidsafe" in
6647 echo "No need to emulate SUID scripts since they are secure here." >&4
6651 Some systems have disabled setuid scripts, especially systems where
6652 setuid scripts cannot be secure. On systems where setuid scripts have
6653 been disabled, the setuid/setgid bits on scripts are currently
6654 useless. It is possible for $package to detect those bits and emulate
6655 setuid/setgid in a secure fashion. This emulation will only work if
6656 setuid scripts have been disabled in your kernel.
6660 "$define") dflt=y ;;
6663 rp="Do you want to do setuid/setgid emulation?"
6666 [yY]*) val="$define";;
6678 SUID emulation has been removed for 5.12
6679 Please re-run Configure without -Dd_dosuid
6688 : Find perl5.005 or later.
6689 echo "Looking for a previously installed perl5.005 or later... "
6691 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6692 : Check if this perl is recent and can load a simple module
6693 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6696 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6706 '') echo "None found. That's ok.";;
6707 *) echo "Using $perl5." ;;
6710 : Set the siteprefix variables
6713 After $package is installed, you may wish to install various
6714 add-on modules and utilities. Typically, these add-ons will
6715 be installed under $prefix with the rest
6716 of this package. However, you may wish to install such add-ons
6717 elsewhere under a different prefix.
6719 If you do not wish to put everything under a single prefix, that's
6720 ok. You will be prompted for the individual locations; this siteprefix
6721 is only used to suggest the defaults.
6723 The default should be fine for most people.
6727 rp='Installation prefix to use for add-on modules and utilities?'
6728 : XXX Here might be another good place for an installstyle setting.
6729 case "$siteprefix" in
6731 *) dflt=$siteprefix ;;
6734 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6736 case "$siteprefix" in
6740 *) oldsiteprefix="$prefix";;
6745 siteprefixexp="$ansexp"
6747 : determine where site specific libraries go.
6748 : Usual default is /usr/local/lib/perl5/site_perl/$version
6749 : The default "style" setting is made in installstyle.U
6750 : XXX No longer works with Prefixit stuff.
6751 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6753 '') case "$installstyle" in
6754 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6755 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6763 The installation process will create a directory for
6764 site-specific extensions and modules. Most users find it convenient
6765 to place all site-specific files in this directory rather than in the
6766 main distribution directory.
6770 rp='Pathname for the site-specific library files?'
6774 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6776 : Determine list of previous versions to include in @INC
6777 $cat > getverlist <<EOPL
6780 \$api_versionstring = "$api_versionstring";
6781 \$version = "$version";
6782 \$stem = "$sitelib_stem";
6783 \$archname = "$archname";
6785 $cat >> getverlist <<'EOPL'
6786 # The list found is store twice for each entry: the original name, and
6787 # the binary broken down version as pack "sss", so sorting is easy and
6788 # unambiguous. This will work for all versions that have a maximum of
6789 # three digit groups, separate by '.'s or '_'s. Names are extended with
6790 # ".0.0" to ensure at least three elements for the pack.
6791 # -- H.Merijn Brand (m)'06 23-10-2006
6793 # Can't have leading @ because metaconfig interprets it as a command!
6794 ;@inc_version_list=();
6795 # XXX Redo to do opendir/readdir?
6798 ;@candidates = map {
6799 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6800 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
6806 ($pversion, $aversion, $vsn5005) = map {
6807 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6808 foreach $d (@candidates) {
6809 if ($d->[1] lt $pversion) {
6810 if ($d->[1] ge $aversion) {
6811 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6813 elsif ($d->[1] ge $vsn5005) {
6814 unshift(@inc_version_list, grep { -d } $d->[0]);
6818 # Skip newer version. I.e. don't look in
6819 # 5.7.0 if we're installing 5.6.1.
6823 if (@inc_version_list) {
6824 print join(' ', @inc_version_list);
6827 # Blank space to preserve value for next Configure run.
6832 case "$inc_version_list" in
6833 '') if test -x "$perl5$exe_ext"; then
6834 dflt=`$perl5 getverlist`
6839 $undef) dflt='none' ;;
6840 *) eval dflt=\"$inc_version_list\" ;;
6843 ''|' ') dflt=none ;;
6850 In order to ease the process of upgrading, this version of perl
6851 can be configured to use modules built and installed with earlier
6852 versions of perl that were installed under $prefix. Specify here
6853 the list of earlier versions that this version of perl should check.
6854 If Configure detected no earlier versions of perl installed under
6855 $prefix, then the list will be empty. Answer 'none' to tell perl
6856 to not search earlier versions.
6858 The default should almost always be sensible, so if you're not sure,
6859 just accept the default.
6862 rp='List of earlier versions to include in @INC?'
6865 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6866 *) inc_version_list="$ans" ;;
6868 case "$inc_version_list" in
6870 inc_version_list_init='0'
6871 d_inc_version_list="$undef"
6873 *) inc_version_list_init=`echo $inc_version_list |
6874 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6875 d_inc_version_list="$define"
6880 : see if malloc/malloc.h has to be included
6881 set malloc/malloc.h i_mallocmalloc
6884 : see if this is a malloc.h system
6885 : we want a real compile instead of Inhdr because some systems have a
6886 : malloc.h that just gives a compile error saying to use stdlib.h instead
6891 #$i_mallocmalloc I_MALLOCMALLOC
6892 #ifdef I_MALLOCMALLOC
6893 # include <malloc/malloc.h>
6896 int main () { return 0; }
6899 if eval $compile; then
6900 echo "<malloc.h> found." >&4
6903 echo "<malloc.h> NOT found." >&4
6910 : check for length of pointer
6914 echo "Checking to see how big your pointers are..." >&4
6923 printf("%d\n", (int)sizeof(void *));
6928 if eval $compile_ok; then
6929 ptrsize=`$run ./try`
6930 echo "Your pointers are $ptrsize bytes long."
6933 echo "(I can't seem to compile the test program. Guessing...)" >&4
6934 rp="What is the size of a pointer (in bytes)?"
6941 case "$use64bitall" in
6942 "$define"|true|[yY]*)
6946 *** You have chosen a maximally 64-bit build,
6947 *** but your pointers are only 4 bytes wide.
6948 *** Please rerun Configure without -Duse64bitall.
6953 *** Since you have quads, you could possibly try with -Duse64bitint.
6958 *** Cannot continue, aborting.
6969 : determine whether to use malloc wrapping
6971 case "$usemallocwrap" in
6972 [yY]*|true|$define) dflt='y' ;;
6973 [nN]*|false|$undef) dflt='n' ;;
6974 *) case "$usedevel" in
6975 [yY]*|true|$define) dflt='y' ;;
6980 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6982 usemallocwrap="$ans"
6985 usemallocwrap="$define" ;;
6987 usemallocwrap="$undef" ;;
6990 : determine which malloc to compile in
6992 case "$usemymalloc" in
6993 [yY]*|true|$define) dflt='y' ;;
6994 [nN]*|false|$undef) dflt='n' ;;
6995 *) case "$ptrsize" in
6999 if test "$useithreads" = "$define"; then dflt='n'; fi
7002 rp="Do you wish to attempt to use the malloc that comes with $package?"
7008 mallocsrc='malloc.c'
7009 mallocobj="malloc$_o"
7010 d_mymalloc="$define"
7013 : Remove malloc from list of libraries to use
7014 echo "Removing unneeded -lmalloc from library list" >&4
7015 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
7018 echo "libs = $libs" >&4
7030 : compute the return types of malloc and free
7032 $cat >malloc.c <<END
7036 #include <sys/types.h>
7050 case "$malloctype" in
7052 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7059 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7063 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7070 echo "Your system uses $freetype free(), it would seem." >&4
7072 : determine where site specific architecture-dependent libraries go.
7073 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7074 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7075 : sitelib may have an optional trailing /share.
7077 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7078 dflt="$dflt/$archname"
7083 set sitearch sitearch none
7087 The installation process will also create a directory for
7088 architecture-dependent site-specific extensions and modules.
7092 rp='Pathname for the site-specific architecture-dependent library files?'
7096 if $test X"$sitearch" = X"$sitelib"; then
7099 d_sitearch="$define"
7102 : Set the vendorprefix variables
7105 The installation process will also create a directory for
7106 vendor-supplied add-ons. Vendors who supply perl with their system
7107 may find it convenient to place all vendor-supplied files in this
7108 directory rather than in the main distribution directory. This will
7109 ease upgrades between binary-compatible maintenance versions of perl.
7111 Of course you may also use these directories in whatever way you see
7112 fit. For example, you might use them to access modules shared over a
7113 company-wide network.
7115 The default answer should be fine for most people.
7116 This causes further questions about vendor add-ons to be skipped
7117 and no vendor-specific directories will be configured for perl.
7120 rp='Do you want to configure vendor-specific add-on directories?'
7121 case "$usevendorprefix" in
7122 define|true|[yY]*) dflt=y ;;
7123 *) : User may have set vendorprefix directly on Configure command line.
7124 case "$vendorprefix" in
7133 rp='Installation prefix to use for vendor-supplied add-ons?'
7134 case "$vendorprefix" in
7135 '') dflt="$prefix" ;;
7136 *) dflt=$vendorprefix ;;
7139 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7141 case "$vendorprefix" in
7145 *) oldvendorprefix="$prefix";;
7149 usevendorprefix="$define"
7151 vendorprefixexp="$ansexp"
7153 *) usevendorprefix="$undef"
7159 : Set the vendorlib variables
7160 case "$vendorprefix" in
7161 '') d_vendorlib="$undef"
7165 *) d_vendorlib="$define"
7166 : determine where vendor-supplied modules go.
7167 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7168 case "$vendorlib" in
7170 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7171 case "$installstyle" in
7172 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7173 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7176 *) dflt="$vendorlib"
7180 rp='Pathname for the vendor-supplied library files?'
7183 vendorlibexp="$ansexp"
7186 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7190 : Set the vendorarch variables
7191 case "$vendorprefix" in
7192 '') d_vendorarch="$undef"
7196 *) d_vendorarch="$define"
7197 : determine where vendor-supplied architecture-dependent libraries go.
7198 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7199 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7200 : vendorlib may have an optional trailing /share.
7201 case "$vendorarch" in
7202 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7203 dflt="$dflt/$archname"
7205 *) dflt="$vendorarch" ;;
7208 rp='Pathname for vendor-supplied architecture-dependent files?'
7211 vendorarchexp="$ansexp"
7214 prefixvar=vendorarch
7216 if $test X"$vendorarch" = X"$vendorlib"; then
7217 d_vendorarch="$undef"
7219 d_vendorarch="$define"
7222 : Final catch-all directories to search
7225 Lastly, you can have perl look in other directories for extensions and
7226 modules in addition to those already specified.
7227 These directories will be searched after
7231 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7232 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7234 case "$otherlibdirs" in
7235 ''|' ') dflt='none' ;;
7236 *) dflt="$otherlibdirs" ;;
7239 Enter a colon-separated set of extra paths to include in perl's @INC
7240 search path, or enter 'none' for no extra paths.
7244 rp='Colon-separated list of additional directories for perl to search?'
7247 ' '|''|none) otherlibdirs=' ' ;;
7248 *) otherlibdirs="$ans" ;;
7250 case "$otherlibdirs" in
7254 set d_perl_otherlibdirs
7257 : Cruising for prototypes
7259 echo "Checking out function prototypes..." >&4
7260 $cat >prototype.c <<EOCP
7265 int main(int argc, char *argv[]) {
7268 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7269 echo "Your C compiler appears to support function prototypes."
7272 echo "Your C compiler doesn't seem to understand function prototypes."
7279 : Check if ansi2knr is required
7280 case "$prototype" in
7282 *) ansi2knr='ansi2knr'
7287 This version of $package can only be compiled by a compiler that
7288 understands function prototypes. Unfortunately, your C compiler
7290 doesn't seem to understand them. Sorry about that.
7292 If GNU cc is available for your system, perhaps you could try that instead.
7294 Eventually, we hope to support building Perl with pre-ANSI compilers.
7295 If you would like to help in that effort, please contact <perlbug@perl.org>.
7297 Aborting Configure now.
7304 dflt_dtrace='/usr/sbin/dtrace'
7305 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
7309 Perl can be built to support DTrace on platforms that support it.
7310 DTrace is a diagnosis and performance analysis tool from Sun.
7312 If this doesn't make any sense to you, just accept the default '$dflt'.
7316 case "$usedtrace" in
7322 dflt_dtrace=$usedtrace
7329 rp='Support DTrace if available?'
7332 y|Y) val="$define" ;;
7338 test "X$usedtrace" != "X$define" && break
7341 rp='Where is the dtrace executable?'
7350 if $dtrace -h -s ../perldtrace.d \
7351 -o perldtrace.tmp >/dev/null 2>&1 \
7352 && rm -f perldtrace.tmp
7355 echo "Good: your $dtrace knows about the -h flag."
7359 *** $me: Fatal Error: $dtrace doesn't support -h flag
7361 *** Your installed dtrace doesn't support the -h switch to compile a D
7362 *** program into a C header. Can't continue.
7374 *** $me: Fatal Error: $dtrace not found.
7381 echo "*** $dtrace was not found."
7387 : See if we want extra modules installed
7394 Perl can be built with extra modules or bundles of modules which
7395 will be fetched from the CPAN and installed alongside Perl.
7397 Notice that you will need access to the CPAN; either via the Internet,
7398 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7399 be asked later to configure the CPAN.pm module which will in turn do
7400 the installation of the rest of the extra modules or bundles.)
7402 Notice also that if the modules require any external software such as
7403 libraries and headers (the libz library and the zlib.h header for the
7404 Compress::Zlib module, for example) you MUST have any such software
7405 already installed, this configuration process will NOT install such
7408 If this doesn't make any sense to you, just accept the default '$dflt'.
7410 rp='Install any extra modules (y or n)?'
7416 Please list any extra modules or bundles to be installed from CPAN,
7417 with spaces between the names. The names can be in any format the
7418 'install' command of CPAN.pm will understand. (Answer 'none',
7419 without the quotes, to install no extra modules or bundles.)
7429 $rm -f ../extras.lst
7431 *) echo "(Saving the list of extras for later...)"
7432 echo "$extras" > ../extras.lst
7440 : determine where html pages for programs go
7441 set html1dir html1dir none
7445 If you wish to install html files for programs in $spackage, indicate
7446 the appropriate directory here. To skip installing html files,
7450 ''|none|$undef|' ') dflt=none ;;
7451 *) dflt=$html1dir ;;
7454 rp="Directory for the main $spackage html pages?"
7458 : Use ' ' for none so value is preserved next time through Configure
7459 $test X"$html1dir" = "X" && html1dir=' '
7461 : determine where html pages for libraries and modules go
7462 set html3dir html3dir none
7466 If you wish to install html files for modules associated with $spackage,
7467 indicate the appropriate directory here. To skip installing html files,
7470 : There is no obvious default. If they have specified html1dir, then
7471 : try to key off that, possibly changing .../html1 into .../html3.
7473 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7474 *) dflt=$html3dir ;;
7477 rp="Directory for the $spackage module html pages?"
7481 : Use ' ' for none so value is preserved next time through Configure
7482 $test X"$html3dir" = "X" && html3dir=' '
7484 : determine whether to install perl also as /usr/bin/perl
7487 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7489 Many scripts expect perl to be installed as /usr/bin/perl.
7491 If you want to, I can install the perl you are about to compile
7492 as /usr/bin/perl (in addition to $bin/perl).
7494 if test -f /usr/bin/perl; then
7497 However, please note that because you already have a /usr/bin/perl,
7498 overwriting that with a new Perl would very probably cause problems.
7499 Therefore I'm assuming you don't want to do that (unless you insist).
7502 case "$installusrbinperl" in
7503 "$define"|[yY]*) dflt='y';;
7509 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7512 case "$installusrbinperl" in
7513 "$undef"|[nN]*) dflt='n';;
7517 rp="Do you want to install perl as /usr/bin/perl?"
7520 [yY]*) val="$define";;
7526 set installusrbinperl
7529 : Check if we are using the GNU C library
7531 echo "Checking for GNU C Library..." >&4
7533 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7534 alone are insufficient to distinguish different versions, such as
7535 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7536 libc version 2.1.0. A. Dougherty, June 3, 2002.
7542 # ifdef __GLIBC_MINOR__
7543 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7544 # include <gnu/libc-version.h>
7545 printf("%s\n", gnu_get_libc_version());
7547 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7550 printf("%d\n", __GLIBC__);
7559 if eval $compile_ok && $run ./try > glibc.ver; then
7561 gnulibc_version=`$cat glibc.ver`
7562 echo "You are using the GNU C Library version $gnulibc_version"
7566 echo "You are not using the GNU C Library"
7572 : see if nm is to be used to determine whether a symbol is defined or not
7576 case "$d_gnulibc" in
7579 echo "nm probably won't work on the GNU C Library." >&4
7585 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7587 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7588 echo "'nm' won't be sufficient on this system." >&4
7594 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7595 if $test $dflt -gt 20; then
7605 true|$define) dflt=y;;
7612 I can use $nm to extract the symbols from your C libraries. This
7613 is a time consuming task which may generate huge output on the disk (up
7614 to 3 megabytes) but that should make the symbols extraction faster. The
7615 alternative is to skip the 'nm' extraction part and to compile a small
7616 test program instead to determine whether each symbol is present. If
7617 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7618 this may be the best solution.
7620 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7623 rp="Shall I use $nm to extract C symbols from the libraries?"
7626 [Nn]*) usenm=false;;
7635 : nm options which may be necessary
7637 '') if $test -f /mach_boot; then
7639 elif $test -d /usr/ccs/lib; then
7640 nm_opt='-p' # Solaris (and SunOS?)
7641 elif $test -f /dgux; then
7643 elif $test -f /lib64/rld; then
7644 nm_opt='-p' # 64-bit Irix
7650 : nm options which may be necessary for shared libraries but illegal
7651 : for archive libraries. Thank you, Linux.
7652 case "$nm_so_opt" in
7653 '') case "$myuname" in
7655 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7656 nm_so_opt='--dynamic'
7663 : Figure out where the libc is located
7666 : get list of predefined functions in a handy place
7671 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7677 *) for thislib in $libs; do
7680 : Handle C library specially below.
7683 thislib=`echo $thislib | $sed -e 's/^-l//'`
7684 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7686 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7688 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7690 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7692 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7694 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7696 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7701 libnames="$libnames $try"
7703 *) libnames="$libnames $thislib" ;;
7712 for xxx in $libpth; do
7713 $test -r $1 || set $xxx/libc.$so
7714 : The messy sed command sorts on library version numbers.
7716 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7717 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7719 s/[0-9][0-9]*/0000&/g
7720 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7723 $sort | $sed -e 's/^.* //'`
7726 $test -r $1 || set $sysroot/usr/ccs/lib/libc.$so
7727 $test -r $1 || set $sysroot/lib/libsys_s$_a
7733 if $test -r "$1"; then
7734 echo "Your (shared) C library seems to be in $1."
7736 elif $test -r /lib/libc && $test -r /lib/clib; then
7737 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7739 libc='/lib/clib /lib/libc'
7740 if $test -r /lib/syslib; then
7741 echo "(Your math library is in /lib/syslib.)"
7742 libc="$libc /lib/syslib"
7744 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7745 echo "Your C library seems to be in $libc, as you said before."
7746 elif $test -r $incpath/usr/lib/libc$_a; then
7747 libc=$incpath/usr/lib/libc$_a;
7748 echo "Your C library seems to be in $libc. That's fine."
7749 elif $test -r /lib/libc$_a; then
7751 echo "Your C library seems to be in $libc. You're normal."
7753 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7755 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7756 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7757 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7759 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7761 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7764 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7766 if $test -r "$tans"; then
7767 echo "Your C library seems to be in $tans, of all places."
7773 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7777 If the guess above is wrong (which it might be if you're using a strange
7778 compiler, or your machine supports multiple models), you can override it here.
7783 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7785 I can't seem to find your C library. I've looked in the following places:
7788 $sed 's/^/ /' libpath
7791 None of these seems to contain your C library. I need to get its name...
7796 rp='Where is your C library?'
7801 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7802 set X `cat libnames`
7805 case $# in 1) xxx=file; esac
7806 echo "Extracting names from the following $xxx for later perusal:" >&4
7808 $sed 's/^/ /' libnames >&4
7810 $echo $n "This may take a while...$c" >&4
7814 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7815 *) $nm $nm_opt $file 2>/dev/null;;
7820 $grep fprintf libc.tmp > libc.ptf
7821 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7822 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7824 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7826 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7828 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7830 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7832 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7834 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7836 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7838 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7840 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7842 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7844 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7846 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7848 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7849 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7851 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7853 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7855 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7857 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7859 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7861 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7863 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7865 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7867 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7869 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7871 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7873 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7875 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7877 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7879 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7882 $nm -p $* 2>/dev/null >libc.tmp
7883 $grep fprintf libc.tmp > libc.ptf
7884 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7885 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7891 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7893 if $ar t $libc > libc.tmp && \
7894 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7896 for thisname in $libnames $libc; do
7897 $ar t $thisname >>libc.tmp
7899 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7901 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7902 for thisname in $libnames $libc; do
7903 $ar tv $thisname >>libc.tmp
7904 emximp -o tmp.imp $thisname \
7906 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7907 < tmp.imp >>libc.tmp
7910 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7913 echo "$ar didn't seem to work right." >&4
7914 echo "Maybe this is a Cray...trying bld instead..." >&4
7916 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7919 for thisname in $libnames; do
7921 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7922 $ar t $thisname >>libc.tmp
7926 echo "That didn't work either. Giving up." >&4
7936 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7937 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7939 *) if $test -f /lib/syscalls.exp; then
7941 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7942 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7943 /lib/syscalls.exp >>libc.list
7949 $rm -f libnames libpath
7951 : Check if we are using C++
7953 echo "Checking for C++..." >&4
7954 $cat >try.c <<'EOCP'
7966 if eval $compile_ok && $run ./try; then
7968 echo "You are using a C++ compiler."
7971 echo "You are not using a C++ compiler."
7977 : is a C symbol defined?
7980 -v) tf=libc.tmp; tdc="";;
7981 -a) tf=libc.tmp; tdc="[]";;
7982 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7984 case "$d_cplusplus" in
7985 $define) extern_C="extern \"C\"" ;;
7986 *) extern_C="extern" ;;
7989 case "$reuseval-$4" in
7991 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7996 if $test "$runnm" = true; then
7997 if $contains $tlook $tf >/dev/null 2>&1; then
7999 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
8000 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;
8001 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
8002 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
8006 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;
8007 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
8013 $define) tval=true;;
8020 : define an is-in-libc? function
8021 inlibc='echo " "; td=$define; tu=$undef;
8022 sym=$1; var=$2; eval "was=\$$2";
8024 case "$reuseval$was" in
8034 echo "$sym() found." >&4;
8035 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
8037 echo "$sym() NOT found." >&4;
8038 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
8042 $define) echo "$sym() found." >&4;;
8043 *) echo "$sym() NOT found." >&4;;
8047 : see if dlopen exists
8049 xxx_ccflags="$ccflags"
8051 : with g++ one needs -shared to get is-in-libc to work for dlopen
8052 case "$gccversion" in
8054 *) case "$d_cplusplus" in
8055 "$define") ccflags="$ccflags -shared" ;;
8062 ccflags="$xxx_ccflags"
8064 : see if this is a unistd.h system
8065 set unistd.h i_unistd
8068 : determine which dynamic loading, if any, to compile in
8070 dldir="ext/DynaLoader"
8083 $define) dflt='y' ;;
8085 : Does a dl_xxx.xs file exist for this operating system
8086 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
8089 rp="Do you wish to use dynamic loading?"
8096 '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
8097 dflt="$dldir/dl_${osname}.xs"
8098 elif $test "$d_dlopen" = "$define" ; then
8099 dflt="$dldir/dl_dlopen.xs"
8104 *) dflt="$dldir/$dlsrc"
8107 echo "The following dynamic loading files are available:"
8108 : Can not go over to $dldir because getfile has path hard-coded in.
8109 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
8110 rp="Source file to use for dynamic loading"
8116 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
8120 Some systems may require passing special flags to $cc -c to
8121 compile modules that will be used to create a shared library.
8122 To use no flags, say "none".
8125 case "$cccdlflags" in
8126 '') case "$gccversion" in
8127 '') case "$osname" in
8129 irix*) dflt='-KPIC' ;;
8130 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
8131 sunos) dflt='-pic' ;;
8135 *) case "$osname" in
8136 darwin) dflt='none' ;;
8137 *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8142 *) dflt="$cccdlflags" ;;
8149 # If -Dsysroot was specified, now's the time to add it
8151 if test "X$sysroot" != X; then
8152 case "$gccversion" in
8157 dflt="$dflt --sysroot=$sysroot" ;;
8167 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8170 none) cccdlflags=' ' ;;
8171 *) cccdlflags="$ans" ;;
8176 Some systems use ld to create libraries that can be dynamically loaded,
8177 while other systems (such as those using ELF) use $cc.
8181 : Determine if this is ELF
8183 /* Test for whether ELF binaries are produced */
8195 int i = open("a.out",O_RDONLY);
8198 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8199 exit(0); /* succeed (yes, it is ELF) */
8203 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8209 '') if $test $bin_ELF = "$define"; then
8211 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8215 echo "I'll use ld to build dynamic libraries."
8223 rp="What command should be used to create dynamic libraries?"
8229 Some systems may require passing special flags to $ld to create a
8230 library that can be dynamically loaded. If your ld flags include
8231 -L/other/path options to locate libraries outside your loader's normal
8232 search path, you may need to specify those -L options here as well. To
8233 use no flags, say "none".
8236 case "$lddlflags" in
8237 '') case "$osname" in
8238 haiku) dflt='-shared' ;;
8240 case "$gccversion" in
8241 '') dflt="$dflt +vnocompatwarnings" ;;
8244 *linux*|irix*|gnu*) dflt="-shared $optimize" ;;
8245 solaris) # See [perl #66604].
8246 # On Solaris 11, gcc -m64 on amd64
8247 # appears not to understand -G. gcc versions at
8248 # least as old as 3.4.3 support -shared, so just
8249 # use that with Solaris 11 and later, but keep
8250 # the old behavior for older Solaris versions.
8251 case "$gccversion" in
8253 *) case "$osvers" in
8254 2.?|2.10) dflt='-G' ;;
8255 *) dflt='-shared' ;;
8260 sunos) dflt='-assert nodefinitions' ;;
8261 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8265 *) dflt="$lddlflags" ;;
8268 : Only do this for gcc, since, for example, qcc has no concept
8270 if $test "X$sysroot" != X; then
8271 case "$gccversion" in
8273 *) dflt="$dflt --sysroot $sysroot" ;;
8277 : Try to guess additional flags to pick up local libraries.
8278 : Be careful not to append to a plain 'none'
8282 for thisflag in $ldflags; do
8287 *) dflt="$dflt $thisflag" ;;
8294 ''|' ') dflt='none' ;;
8298 *-fstack-protector*)
8300 *-fstack-protector*) ;; # Don't add it again
8301 *) dflt="$dflt -fstack-protector" ;;
8306 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8309 none) lddlflags=' ' ;;
8310 *) lddlflags="$ans" ;;
8315 Some systems may require passing special flags to $cc to indicate that
8316 the resulting executable will use dynamic linking. To use no flags,
8320 case "$ccdlflags" in
8321 '') case "$osname" in
8322 *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
8323 sunos) dflt='none' ;;
8327 *) dflt="$ccdlflags" ;;
8329 rp="Any special flags to pass to $cc to use dynamic linking?"
8332 none) ccdlflags=' ' ;;
8333 *) ccdlflags="$ans" ;;
8345 ld_can_script="$undef"
8346 case "$bin_ELF$usedl" in
8348 # Abuse try.h and a.out names for neat cleanup
8360 if $cc $cccdlflags $ccdlflags $ccflags \
8361 $ldflags $lddlflags -o a.out try.c \
8362 -Wl,--version-script=try.h >/dev/null 2>&1 \
8363 && $test -s a.out ; then
8364 echo "ld supports scripting" >&4
8365 ld_can_script="$define"
8367 echo "ld does not support scripting" >&4
8373 : Do we want a shared libperl?
8377 # No dynamic loading being used, so don't bother even to prompt.
8380 *) case "$useshrplib" in
8381 '') case "$osname" in
8382 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8384 also='Building a shared libperl is required for dynamic loading to work on your system.'
8398 The perl executable is normally obtained by linking perlmain.c with
8399 libperl${_a}, any static extensions (usually just DynaLoader), and
8400 any other libraries needed on this system (such as -lm, etc.). Since
8401 your system supports dynamic loading, it is probably possible to build
8402 a shared libperl.$so. If you will have more than one executable linked
8403 to libperl.$so, this will significantly reduce the size of each
8404 executable, but it may have a noticeable effect on performance. The
8405 default is probably sensible for your system.
8409 rp="Build a shared libperl.$so (y/n)"
8413 useshrplib='true' ;;
8414 *) useshrplib='false' ;;
8419 case "$useshrplib" in
8421 case "$userelocatableinc" in
8423 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8424 echo "See INSTALL for an explanation why that won't work." >&4
8430 # Figure out a good name for libperl.so. Since it gets stored in
8431 # a version-specific architecture-dependent library, the version
8432 # number isn't really that important, except for making cc/ld happy.
8434 # A name such as libperl.so.10.1
8435 majmin="libperl.$so.$patchlevel.$subversion"
8436 # A name such as libperl.so.100
8437 majonly=`echo $patchlevel $subversion |
8438 $awk '{printf "%d%02d", $1, $2}'`
8439 majonly=libperl.$so.$majonly
8440 # I'd prefer to keep the os-specific stuff here to a minimum, and
8441 # rely on figuring it out from the naming of libc.
8442 case "${osname}${osvers}" in
8443 *linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8446 cygwin*) # ld links now against the dll directly
8447 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8448 majonly=`echo $patchlevel $subversion |
8449 $awk '{printf "%03d%03d", $1, $2}'`
8450 majonly=cygperl5.$majonly.$so
8453 *) # Try to guess based on whether libc has major.minor.
8455 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8456 *libc.$so.[0-9]*) dflt=$majonly ;;
8457 *) dflt=libperl.$so ;;
8467 I need to select a good name for the shared libperl. If your system uses
8468 library names with major and minor numbers, then you might want something
8469 like $majmin. Alternatively, if your system uses a single version
8470 number for shared libraries, then you might want to use $majonly.
8471 Or, your system might be quite happy with a simple libperl.$so.
8473 Since the shared libperl will get installed into a version-specific
8474 architecture-dependent directory, the version number of the shared perl
8475 library probably isn't important, so the default should be o.k.
8478 rp='What name do you want to give to the shared libperl?'
8481 echo "Ok, I'll use $libperl"
8484 libperl="libperl${_a}"
8488 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8492 WARNING: Use of the shrpdir variable for the installation location of
8493 the shared $libperl is not supported. It was never documented and
8494 will not work in this version. Let me (perlbug@perl.org)
8495 know of any problems this may cause.
8501 But your current setting of $shrpdir is
8502 the default anyway, so it's harmless.
8507 Further, your current attempted setting of $shrpdir
8508 conflicts with the value of $archlibexp/CORE
8509 that installperl will use.
8516 # How will the perl executable find the installed shared $libperl?
8517 # Add $xxx to ccdlflags.
8518 # If we can't figure out a command-line option, use $shrpenv to
8519 # set env LD_RUN_PATH. The main perl makefile uses this.
8520 shrpdir=$archlibexp/CORE
8523 if "$useshrplib"; then
8526 # We'll set it in Makefile.SH...
8531 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8532 xxx="-Wl,-R$shrpdir"
8534 bsdos|linux|irix*|dec_osf|gnu*)
8535 xxx="-Wl,-rpath,$shrpdir"
8538 # Haiku doesn't like the default, either.
8541 # hpux doesn't like the default, either.
8542 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8545 # cygwin needs only ldlibpth
8548 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8554 # Only add $xxx if it isn't already in ccdlflags.
8555 case " $ccdlflags " in
8557 *) ccdlflags="$ccdlflags $xxx"
8560 Adding $xxx to the flags
8561 passed to $ld so that the perl executable will find the
8562 installed shared $libperl.
8570 # Fix ccdlflags in AIX for building external extensions.
8571 # (For building Perl itself bare -bE:perl.exp is needed,
8572 # Makefile.SH takes care of this.)
8574 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8576 # Respect a hint or command-line value.
8578 '') shrpenv="$tmp_shrpenv" ;;
8580 case "$ldlibpthname" in
8581 '') ldlibpthname=LD_LIBRARY_PATH ;;
8582 none) ldlibpthname='' ;;
8585 : determine where manual pages are on this system
8589 syspath='/usr/share/man/man1 /usr/man/man1'
8590 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8591 syspath="$syspath /usr/man/u_man/man1"
8592 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8593 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8594 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8595 sysman=`./loc . /usr/man/man1 $syspath`
8598 if $test -d "$sysman"; then
8599 echo "System manual is in $sysman." >&4
8601 echo "Could not find manual pages in source form." >&4
8604 : determine where manual pages go
8605 set man1dir man1dir none
8609 $spackage has manual pages available in source form.
8613 echo "However, you don't have nroff, so they're probably useless to you."
8615 '') man1dir="none";;
8618 echo "If you don't want the manual sources installed, answer 'none'."
8623 lookpath="$prefixexp/share/man/man1"
8624 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8625 lookpath="$lookpath $prefixexp/man/p_man/man1"
8626 lookpath="$lookpath $prefixexp/man/u_man/man1"
8627 lookpath="$lookpath $prefixexp/man/man.1"
8629 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8630 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8640 rp="Where do the main $spackage manual pages (source) go?"
8642 if $test "X$man1direxp" != "X$ansexp"; then
8653 : What suffix to use on installed man pages
8660 rp="What suffix should be used for the main $spackage man pages?"
8662 '') case "$man1dir" in
8676 *) dflt="$man1ext";;
8683 : see if we can have long filenames
8685 first=123456789abcdef
8687 if (echo hi >$first) 2>/dev/null; then
8688 if $test -f 123456789abcde; then
8689 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8692 echo 'You can have filenames longer than 14 characters.'>&4
8697 You can't have filenames longer than 14 chars.
8698 You can't even think about them!
8704 $rm -rf 123456789abcde*
8706 : determine where library module manual pages go
8707 set man3dir man3dir none
8711 $spackage has manual pages for many of the library modules.
8717 However, you don't have nroff, so they're probably useless to you.
8720 '') man3dir="none";;
8724 case "$d_flexfnam" in
8727 However, your system can't handle the long file names like File::Basename.3.
8730 '') man3dir="none";;
8734 echo "If you don't want the manual sources installed, answer 'none'."
8735 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8737 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8738 if $test -d "$privlib/man/man3"; then
8741 WARNING: Previous versions of perl installed man3 pages into
8742 $privlib/man/man3. This version will suggest a
8743 new default of $dflt.
8747 rp='Do you wish to preserve the old behavior?(y/n)'
8750 y*) dflt="$privlib/man/man3" ;;
8755 *) dflt="$man3dir" ;;
8762 rp="Where do the $package library man pages (source) go?"
8772 : What suffix to use on installed man pages
8778 rp="What suffix should be used for the $package library man pages?"
8780 '') case "$man3dir" in
8794 *) dflt="$man3ext";;
8801 : see if we have to deal with yellow pages, now NIS.
8802 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8808 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8816 rp='Are you getting the hosts file via yellow pages?'
8819 y*) hostcat='ypcat hosts';;
8820 *) hostcat='cat /etc/hosts';;
8826 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8829 '') test -f /etc/group && groupcat='cat /etc/group';;
8832 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8835 : now get the host name
8837 echo "Figuring out host name..." >&4
8838 case "$myhostname" in
8840 echo 'Maybe "hostname" will work...'
8841 if tans=`sh -c hostname 2>&1` ; then
8849 if $test "$cont"; then
8851 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8852 if tans=`cat /etc/systemid 2>&1` ; then
8854 phostname='cat /etc/systemid'
8855 echo "Whadyaknow. Xenix always was a bit strange..."
8858 elif $test -r /etc/systemid; then
8859 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8862 if $test "$cont"; then
8863 echo 'No, maybe "uuname -l" will work...'
8864 if tans=`sh -c 'uuname -l' 2>&1` ; then
8866 phostname='uuname -l'
8868 echo 'Strange. Maybe "uname -n" will work...'
8869 if tans=`sh -c 'uname -n' 2>&1` ; then
8871 phostname='uname -n'
8873 echo 'Oh well, maybe I can mine it out of whoami.h...'
8874 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8875 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8876 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8878 case "$myhostname" in
8879 '') echo "Does this machine have an identity crisis or something?"
8882 echo "Well, you said $myhostname before..."
8883 phostname='echo $myhostname';;
8889 case "$myhostname" in
8890 '') myhostname=noname ;;
8892 : you do not want to know about this
8897 if $test "$myhostname" ; then
8899 rp='Your host name appears to be "'$myhostname'".'" Right?"
8907 : bad guess or no guess
8908 while $test "X$myhostname" = X ; do
8910 rp="Please type the (one word) name of your host:"
8915 : translate upper to lower if necessary
8916 case "$myhostname" in
8918 echo "(Normalizing case in your host name)"
8919 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8923 case "$myhostname" in
8925 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8926 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8927 echo "(Trimming domain name from host name--host name is now $myhostname)"
8929 *) case "$mydomain" in
8932 test "X$hostcat" = "Xypcat hosts" &&
8933 ypmatch "$myhostname" hosts 2>/dev/null |\
8934 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8937 test "X$hostcat" != "X" &&
8938 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8939 /[ ]$myhostname[ . ]/p" > hosts
8942 if $test -f hosts; then
8943 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8944 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8945 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8946 hosts | $sort | $uniq | \
8947 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8948 case `$echo X$dflt` in
8949 X*\ *) echo "(Several hosts in the database matched hostname)"
8952 X.) echo "(You do not have fully-qualified names in the hosts database)"
8956 echo "(I cannot locate a hosts database anywhere)"
8961 tans=`./loc resolv.conf X /etc /usr/etc`
8962 if $test -f "$tans"; then
8963 echo "(Attempting domain name extraction from $tans)"
8964 dflt=.`$sed -n -e 's/ / /g' \
8965 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8968 .) dflt=.`$sed -n -e 's/ / /g' \
8969 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8977 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8978 dflt=.`sh -c domainname 2>/dev/null`
8981 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8985 case "$dflt$osname" in
8986 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8987 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8991 .) echo "(Lost all hope -- silly guess then)"
8997 *) dflt="$mydomain";;
9001 rp="What is your domain name?"
9011 : translate upper to lower if necessary
9014 echo "(Normalizing case in your domain name)"
9015 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
9019 : a little sanity check here
9020 case "$phostname" in
9023 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
9024 $myhostname$mydomain|$myhostname) ;;
9026 case "$phostname" in
9028 echo "(That doesn't agree with your whoami.h file, by the way.)"
9031 echo "(That doesn't agree with your $phostname command, by the way.)"
9039 : determine the e-mail address of the user who is running us
9042 I need to get your e-mail address in Internet format if possible, i.e.
9043 something like user@host.domain. Please answer accurately since I have
9044 no easy means to double check it. The default value provided below
9045 is most probably close to reality but may not be valid from outside
9046 your organization...
9050 while test "$cont"; do
9051 case "$MAILDOMAIN" in
9053 if $test -s /etc/mailname; then
9054 maildomain=`$cat /etc/mailname`
9056 maildomain="$myhostname$mydomain"
9059 *) maildomain="$MAILDOMAIN";;
9062 '') dflt="$cf_by@$maildomain";;
9063 *) dflt="$cf_email";;
9065 rp='What is your e-mail address?'
9071 rp='Address does not look like an Internet one. Use it anyway?'
9085 : Ask e-mail of administrator
9088 If you or somebody else will be maintaining perl at your site, please
9089 fill in the correct e-mail address here so that they may be contacted
9090 if necessary. Currently, the "perlbug" program included with perl
9091 will send mail to this address in addition to perlbug@perl.org. You may
9092 enter "none" for no administrator.
9095 case "$perladmin" in
9096 '') dflt="$cf_email";;
9097 *) dflt="$perladmin";;
9099 rp='Perl administrator e-mail address'
9103 : determine whether to only install version-specific parts.
9106 Do you want to install only the version-specific parts of the perl
9107 distribution? Usually you do *not* want to do this.
9109 case "$versiononly" in
9110 "$define"|[Yy]*|true) dflt='y' ;;
9113 rp="Do you want to install only the version-specific parts of perl?"
9116 [yY]*) val="$define";;
9122 case "$versiononly" in
9123 "$define") inc_version_list=''
9124 inc_version_list_init=0
9128 : figure out how to guarantee perl startup
9129 : XXX Note that this currently takes advantage of the bug that binexp ignores
9130 : the Configure -Dinstallprefix setting, which in turn means that under
9131 : relocatable @INC, initialinstalllocation is what binexp started as.
9132 case "$startperl" in
9134 case "$sharpbang" in
9138 I can use the #! construct to start perl on your system. This will
9139 make startup of perl scripts faster, but may cause problems if you
9140 want to share those scripts and perl is not in a standard place
9141 ($initialinstalllocation/perl) on all your platforms. The alternative
9142 is to force a shell by starting the script with a single ':' character.
9145 case "$versiononly" in
9146 "$define") dflt="$initialinstalllocation/perl$version";;
9147 *) dflt="$initialinstalllocation/perl";;
9149 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
9152 none) startperl=": # use perl";;
9153 *) startperl="#!$ans"
9154 if $test 30 -lt `echo "$ans" | wc -c`; then
9157 WARNING: Some systems limit the #! command to 32 characters.
9158 If you experience difficulty running Perl scripts with #!, try
9159 installing Perl in a directory with a shorter pathname.
9165 *) startperl=": # use perl"
9170 echo "I'll use $startperl to start perl scripts."
9172 : figure best path for perl in scripts
9175 case "$versiononly" in
9176 "$define") perlpath="$initialinstalllocation/perl$version";;
9177 *) perlpath="$initialinstalllocation/perl";;
9179 case "$startperl" in
9184 I will use the "eval 'exec'" idiom to start Perl on your system.
9185 I can use the full path of your Perl binary for this purpose, but
9186 doing so may cause problems if you want to share those scripts and
9187 Perl is not always in a standard place ($initialinstalllocation/perl).
9190 dflt="$initialinstalllocation/perl"
9191 rp="What path shall I use in \"eval 'exec'\"?"
9198 case "$startperl" in
9200 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9203 : determine where public executable scripts go
9204 set scriptdir scriptdir
9206 case "$scriptdir" in
9209 : guess some guesses
9210 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9211 $test -d /usr/share/bin && dflt=/usr/share/bin
9212 $test -d /usr/local/script && dflt=/usr/local/script
9213 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9214 $test -d $prefixexp/script && dflt=$prefixexp/script
9218 *) dflt="$scriptdir"
9223 Some installations have a separate directory just for executable scripts so
9224 that they can mount it across multiple architectures but keep the scripts in
9225 one spot. You might, for example, have a subdirectory of /usr/share for this.
9226 Or you might just lump your scripts in with all your other executables.
9230 rp='Where do you keep publicly executable scripts?'
9232 if $test "X$ansexp" != "X$scriptdirexp"; then
9238 : A little fix up for an irregularly named variable.
9239 installscript="$installscriptdir"
9241 : determine where add-on public executables go
9243 '') dflt=$siteprefix/bin ;;
9247 rp='Pathname where the add-on public executables should be installed?'
9252 : determine where add-on html pages go
9253 : There is no standard location, so try to copy the previously-selected
9254 : directory structure for the core html pages.
9255 case "$sitehtml1dir" in
9256 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9257 *) dflt=$sitehtml1dir ;;
9260 ''|' ') dflt=none ;;
9263 rp='Pathname where the site-specific html pages should be installed?'
9265 prefixvar=sitehtml1dir
9268 : determine where add-on library html pages go
9269 : There is no standard location, so try to copy the previously-selected
9270 : directory structure for the core html pages.
9271 case "$sitehtml3dir" in
9272 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9273 *) dflt=$sitehtml3dir ;;
9276 ''|' ') dflt=none ;;
9279 rp='Pathname where the site-specific library html pages should be installed?'
9281 prefixvar=sitehtml3dir
9284 : determine where add-on manual pages go
9285 case "$siteman1dir" in
9286 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9287 *) dflt=$siteman1dir ;;
9290 ''|' ') dflt=none ;;
9293 rp='Pathname where the site-specific manual pages should be installed?'
9295 prefixvar=siteman1dir
9298 : determine where add-on library man pages go
9299 case "$siteman3dir" in
9300 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9301 *) dflt=$siteman3dir ;;
9304 ''|' ') dflt=none ;;
9307 rp='Pathname where the site-specific library manual pages should be installed?'
9309 prefixvar=siteman3dir
9312 : determine where add-on public executable scripts go
9313 case "$sitescript" in
9314 '') dflt=$siteprefix/script
9315 $test -d $dflt || dflt=$sitebin ;;
9316 *) dflt="$sitescript" ;;
9319 rp='Pathname where add-on public executable scripts should be installed?'
9321 prefixvar=sitescript
9324 : see if backtrace exists
9325 set backtrace d_backtrace
9328 : add flags if using c backtrace
9329 case "$usecbacktrace" in
9330 "") usecbacktrace=$undef ;;
9332 case "$d_backtrace" in
9334 case " $ccflags " in
9335 *" -DUSE_C_BACKTRACE "*) ;; # Already there.
9336 *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
9340 echo "This system does not support backtrace" >&4
9341 usecbacktrace=$undef
9347 : Check if faststdio is requested and available
9348 case "$usefaststdio" in
9349 $define|true|[yY]*|'')
9350 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9360 Perl can be built to use 'fast stdio', which means using the stdio
9361 library but also directly manipulating the stdio buffers to enable
9362 faster I/O. Using stdio is better for backward compatibility (especially
9363 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9364 interface has been preferred instead of stdio.
9366 If this doesn't make any sense to you, just accept the default '$dflt'.
9368 rp='Use the "fast stdio" if available?'
9371 y|Y) val="$define" ;;
9378 : define an is-a-typedef? function
9379 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9381 "") inclist="sys/types.h";;
9383 eval "varval=\$$var";
9387 for inc in $inclist; do
9388 echo "#include <$inc>" >>temp.c;
9390 echo "#ifdef $type" >> temp.c;
9391 echo "printf(\"We have $type\");" >> temp.c;
9392 echo "#endif" >> temp.c;
9393 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9394 if $contains $type temp.E >/dev/null 2>&1; then
9400 *) eval "$var=\$varval";;
9403 : define an is-a-typedef? function that prompts if the type is not available.
9404 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9406 "") inclist="sys/types.h";;
9408 eval "varval=\$$var";
9412 for inc in $inclist; do
9413 echo "#include <$inc>" >>temp.c;
9415 echo "#ifdef $type" >> temp.c;
9416 echo "printf(\"We have $type\");" >> temp.c;
9417 echo "#endif" >> temp.c;
9418 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9420 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9421 if $contains $type temp.E >/dev/null 2>&1; then
9422 echo "$type found." >&4;
9425 echo "$type NOT found." >&4;
9431 *) eval "$var=\$varval";;
9434 : see what type lseek is declared as in the kernel
9435 rp="What is the type used for lseek's offset on this system?"
9436 set off_t lseektype long stdio.h sys/types.h
9440 echo "Checking to see how big your file offsets are..." >&4
9442 #include <sys/types.h>
9446 printf("%d\n", (int)sizeof($lseektype));
9451 if eval $compile_ok; then
9452 lseeksize=`$run ./try`
9453 echo "Your file offsets are $lseeksize bytes long."
9457 echo "(I can't seem to compile the test program. Guessing...)"
9458 rp="What is the size of your file offsets (in bytes)?"
9464 : see what type file positions are declared as in the library
9465 rp="What is the type for file position used by fsetpos()?"
9466 set fpos_t fpostype long stdio.h sys/types.h
9469 : Check size for Fpos_t
9472 *_t) zzz="$fpostype" ;;
9475 echo "Checking the size of $zzz..." >&4
9477 #include <sys/types.h>
9484 printf("%d\n", (int)sizeof($fpostype));
9489 if eval $compile_ok; then
9493 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9496 echo "Your $zzz is $fpossize bytes long."
9502 echo "(I can't compile the test program. Guessing...)" >&4
9503 rp="What is the size of your file positions (in bytes)?"
9508 : Check for large file support
9509 # Backward compatibility (uselfs is deprecated).
9511 "$define"|true|[yY]*)
9514 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9516 uselargefiles="$define"
9520 case "$lseeksize:$fpossize" in
9523 You can have files larger than 2 gigabytes.
9526 *) case "$uselargefiles" in
9527 "$undef"|false|[nN]*) dflt='n' ;;
9532 Perl can be built to understand large files (files larger than 2 gigabytes)
9533 on some systems. To do so, Configure can be run with -Duselargefiles.
9535 If this doesn't make any sense to you, just accept the default '$dflt'.
9537 rp='Try to understand large files, if available?'
9540 y|Y) val="$define" ;;
9547 : Look for a hint-file generated 'call-back-unit'. If the
9548 : user has specified that a large files perl is to be built,
9549 : we may need to set or change some other defaults.
9550 if $test -f uselargefiles.cbu; then
9551 echo "Your platform has some specific hints regarding large file builds, using them..."
9552 . ./uselargefiles.cbu
9554 case "$uselargefiles" in
9556 if $test -f uselargefiles.cbu; then
9558 echo "Rechecking to see how big your file offsets are..." >&4
9560 #include <sys/types.h>
9564 printf("%d\n", (int)sizeof($lseektype));
9569 if eval $compile_ok; then
9570 lseeksize=`$run ./try`
9571 $echo "Your file offsets are now $lseeksize bytes long."
9575 echo "(I can't seem to compile the test program. Guessing...)"
9576 rp="What is the size of your file offsets (in bytes)?"
9581 *_t) zzz="$fpostype" ;;
9584 $echo $n "Rechecking the size of $zzz...$c" >&4
9586 #include <sys/types.h>
9593 printf("%d\n", (int)sizeof($fpostype));
9598 if eval $compile_ok; then
9603 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9606 echo " $fpossize bytes." >&4
9612 echo "(I can't compile the test program. Guessing...)" >&4
9613 rp="What is the size of your file positions (in bytes)?"
9622 : Check if we want perlio
9625 : Set the vendorbin variables
9626 case "$vendorprefix" in
9627 '') d_vendorbin="$undef"
9631 *) d_vendorbin="$define"
9632 : determine where vendor-supplied executables go.
9633 case "$vendorbin" in
9634 '') dflt=$vendorprefix/bin ;;
9635 *) dflt="$vendorbin" ;;
9638 rp='Pathname for the vendor-supplied executables directory?'
9641 vendorbinexp="$ansexp"
9647 : Set the vendorhtml1dir variables
9648 case "$vendorprefix" in
9649 '') vendorhtml1dir=''
9650 vendorhtml1direxp=''
9652 *) : determine where vendor-supplied html pages go.
9653 : There is no standard location, so try to copy the previously-selected
9654 : directory structure for the core html pages.
9655 : XXX Better default suggestions would be welcome.
9656 case "$vendorhtml1dir" in
9657 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9658 *) dflt=$vendorhtml1dir ;;
9661 ''|' ') dflt=none ;;
9664 rp='Pathname for the vendor-supplied html pages?'
9666 vendorhtml1dir="$ans"
9667 vendorhtml1direxp="$ansexp"
9670 : Use ' ' for none so value is preserved next time through Configure
9671 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9672 prefixvar=vendorhtml1dir
9675 : Set the vendorhtml3dir variables
9676 case "$vendorprefix" in
9677 '') vendorhtml3dir=''
9678 vendorhtml3direxp=''
9680 *) : determine where vendor-supplied module html pages go.
9681 : There is no standard location, so try to copy the previously-selected
9682 : directory structure for the core html pages.
9683 : XXX Better default suggestions would be welcome.
9684 case "$vendorhtml3dir" in
9685 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9686 *) dflt=$vendorhtml3dir ;;
9689 ''|' ') dflt=none ;;
9692 rp='Pathname for the vendor-supplied html pages?'
9694 vendorhtml3dir="$ans"
9695 vendorhtml3direxp="$ansexp"
9698 : Use ' ' for none so value is preserved next time through Configure
9699 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9700 prefixvar=vendorhtml3dir
9703 : Set the vendorman1dir variables
9704 case "$vendorprefix" in
9705 '') vendorman1dir=''
9708 *) : determine where vendor-supplied manual pages go.
9709 case "$vendorman1dir" in
9710 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9711 *) dflt=$vendorman1dir ;;
9714 ''|' ') dflt=none ;;
9717 rp='Pathname for the vendor-supplied manual section 1 pages?'
9719 vendorman1dir="$ans"
9720 vendorman1direxp="$ansexp"
9723 : Use ' ' for none so value is preserved next time through Configure
9724 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9725 prefixvar=vendorman1dir
9728 : Set the vendorman3dir variables
9729 case "$vendorprefix" in
9730 '') vendorman3dir=''
9733 *) : determine where vendor-supplied module manual pages go.
9734 case "$vendorman3dir" in
9735 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9736 *) dflt=$vendorman3dir ;;
9739 ''|' ') dflt=none ;;
9742 rp='Pathname for the vendor-supplied manual section 3 pages?'
9744 vendorman3dir="$ans"
9745 vendorman3direxp="$ansexp"
9748 : Use ' ' for none so value is preserved next time through Configure
9749 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9750 prefixvar=vendorman3dir
9753 : Set the vendorscript variables
9754 case "$vendorprefix" in
9755 '') d_vendorscript="$undef"
9759 *) d_vendorscript="$define"
9760 : determine where vendor-supplied scripts go.
9761 case "$vendorscript" in
9762 '') dflt=$vendorprefix/script
9763 $test -d $dflt || dflt=$vendorbin ;;
9764 *) dflt="$vendorscript" ;;
9768 The installation process will create a directory for
9769 vendor-supplied scripts.
9773 rp='Pathname for the vendor-supplied scripts directory?'
9776 vendorscriptexp="$ansexp"
9779 prefixvar=vendorscript
9782 : script used to emit important warnings
9785 if test \$# -gt 0; then
9790 echo "*** WARNING:" >&4
9791 sed -e 's/^/*** /' <msg >&4
9793 cat msg >>config.msg
9794 echo " " >>config.msg
9800 : see which of string.h or strings.h is needed
9802 strings=`./findhdr string.h`
9803 if $test "$strings" && $test -r "$strings"; then
9804 echo "Using <string.h> instead of <strings.h>." >&4
9808 strings=`./findhdr strings.h`
9809 if $test "$strings" && $test -r "$strings"; then
9810 echo "Using <strings.h> instead of <string.h>." >&4
9812 ./warn "No string header found -- You'll surely have problems."
9818 "$undef") strings=`./findhdr strings.h`;;
9819 *) strings=`./findhdr string.h`;;
9822 : see if qgcvt exists
9826 : Check print/scan long double stuff
9829 if $test X"$d_longdbl" = X"$define"; then
9831 echo "Checking how to print long doubles..." >&4
9833 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9834 $cat >try.c <<'EOCP'
9835 #include <sys/types.h>
9839 printf("%.3f\n", d);
9843 if eval $compile; then
9847 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9848 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9849 echo "We will use %f."
9855 if $test X"$sPRIfldbl" = X; then
9856 $cat >try.c <<'EOCP'
9857 #include <sys/types.h>
9860 long double d = 123.456;
9861 printf("%.3Lf\n", d);
9865 if eval $compile; then
9869 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9870 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9871 echo "We will use %Lf."
9877 if $test X"$sPRIfldbl" = X; then
9878 $cat >try.c <<'EOCP'
9879 #include <sys/types.h>
9882 long double d = 123.456;
9883 printf("%.3llf\n", d);
9887 if eval $compile; then
9891 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9892 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9893 echo "We will use %llf."
9899 if $test X"$sPRIfldbl" = X; then
9900 $cat >try.c <<'EOCP'
9901 #include <sys/types.h>
9904 long double d = 123.456;
9905 printf("%.3lf\n", d);
9909 if eval $compile; then
9913 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9914 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9915 echo "We will use %lf."
9921 if $test X"$sPRIfldbl" = X; then
9922 echo "Cannot figure out how to print long doubles." >&4
9924 sSCNfldbl=$sPRIfldbl # expect consistency
9931 case "$sPRIfldbl" in
9932 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9933 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9934 d_SCNfldbl="$undef";
9936 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9937 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9938 d_SCNfldbl="$define";
9942 : Check how to convert floats to strings.
9944 if test "X$d_Gconvert" = X; then
9947 echo "Checking for an efficient way to convert floats to strings."
9949 case "$uselongdouble" in
9950 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9952 case "$d_longdbl" in
9953 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9955 case "$d_PRIgldbl" in
9956 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9960 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9961 char *myname = "gconvert";
9964 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9965 char *myname = "gcvt";
9968 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9969 char *myname = "qgcvt";
9970 #define DOUBLETYPE long double
9973 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9975 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9977 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9980 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9982 char *myname = "sprintf";
9986 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9987 #define DOUBLETYPE long double
9989 #define DOUBLETYPE double
10001 # include <string.h>
10003 # include <strings.h>
10006 int checkit(char *expect, char *got)
10008 if (strcmp(expect, got)) {
10009 printf("%s oddity: Expected %s, got %s\n",
10010 myname, expect, got);
10020 /* This must be 1st test on (which?) platform */
10021 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
10022 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
10023 checkit("0.1", buf);
10025 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
10026 checkit("0.01", buf);
10028 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
10029 checkit("0.001", buf);
10031 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
10032 checkit("0.0001", buf);
10034 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
10035 if (strlen(buf) > 5)
10036 checkit("9e-005", buf); /* for Microsoft ?? */
10038 checkit("9e-05", buf);
10040 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
10043 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
10044 checkit("1.1", buf);
10046 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
10047 checkit("1.01", buf);
10049 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
10050 checkit("1.001", buf);
10052 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
10053 checkit("1.0001", buf);
10055 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
10056 checkit("1.00001", buf);
10058 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
10059 checkit("1.000001", buf);
10061 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
10064 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
10065 checkit("-1", buf);
10067 /* Some Linux gcvt's give 1.e+5 here. */
10068 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
10069 checkit("100000", buf);
10071 /* Some Linux gcvt's give -1.e+5 here. */
10072 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
10073 checkit("-100000", buf);
10075 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
10076 checkit("123.456", buf);
10078 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
10079 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
10080 /* 34 should be enough to scare even long double
10081 * places into using the e notation. */
10082 if (strlen(buf) > 5)
10083 checkit("1e+034", buf); /* for Microsoft */
10085 checkit("1e+34", buf);
10087 /* For Perl, if you add additional tests here, also add them to
10088 * t/base/num.t for benefit of platforms not using Configure or
10089 * overriding d_Gconvert */
10094 : first add preferred functions to our list
10096 for xxx_convert in $gconvert_preference; do
10097 case $xxx_convert in
10098 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
10099 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
10102 : then add any others
10103 for xxx_convert in gconvert gcvt sprintf; do
10104 case "$xxx_list" in
10106 *) xxx_list="$xxx_list $xxx_convert" ;;
10110 case "$d_longdbl$uselongdouble" in
10112 : again, add preferred functions to our list first
10114 for xxx_convert in $gconvert_ld_preference; do
10115 case $xxx_convert in
10116 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10117 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
10120 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
10121 for xxx_convert in qgcvt sprintf $xxx_list; do
10122 case "$xxx_ld_list" in
10123 $xxx_convert*|*" $xxx_convert"*) ;;
10124 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
10127 : if sprintf cannot do long doubles, move it to the end
10128 if test "$d_PRIgldbl" != "$define"; then
10129 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
10131 : if no qgcvt, remove it
10132 if test "$d_qgcvt" != "$define"; then
10133 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
10136 xxx_list="$xxx_ld_list"
10140 for xxx_convert in $xxx_list; do
10141 echo "Trying $xxx_convert..."
10142 $rm -f try try$_o core
10143 set try -DTRY_$xxx_convert
10144 if eval $compile; then
10145 echo "$xxx_convert() found." >&4
10146 if $run ./try; then
10147 echo "I'll use $xxx_convert to convert floats into a string." >&4
10150 echo "...But $xxx_convert didn't work as I expected."
10154 echo "$xxx_convert NOT found." >&4
10158 if test X$xxx_convert = X; then
10159 echo "*** WHOA THERE!!! ***" >&4
10160 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
10161 xxx_convert=sprintf
10164 case "$xxx_convert" in
10165 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
10166 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
10167 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
10168 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
10169 "$define$define$define")
10170 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
10171 "$define$define$undef")
10172 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
10173 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
10181 : see if _fwalk exists
10185 : Initialize h_fcntl
10188 : Initialize h_sysfile
10191 : access call always available on UNIX
10192 set access d_access
10195 : locate the flags for 'access()'
10196 case "$d_access" in
10199 $cat >access.c <<EOCP
10200 #include <sys/types.h>
10205 #include <sys/file.h>
10208 #include <unistd.h>
10210 #$i_stdlib I_STDLIB
10212 #include <stdlib.h>
10218 : check sys/file.h first, no particular reason here
10219 if $test `./findhdr sys/file.h` && \
10220 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10222 echo "<sys/file.h> defines the *_OK access constants." >&4
10223 elif $test `./findhdr fcntl.h` && \
10224 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10226 echo "<fcntl.h> defines the *_OK access constants." >&4
10227 elif $test `./findhdr unistd.h` && \
10228 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10229 echo "<unistd.h> defines the *_OK access constants." >&4
10231 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10237 : see if accessx exists
10238 set accessx d_accessx
10241 : see if aintl exists
10245 : see if alarm exists
10249 : see if 64bit time functions exists
10251 set ctime64 d_ctime64
10254 set localtime64 d_localtime64
10257 set gmtime64 d_gmtime64
10260 set mktime64 d_mktime64
10263 set difftime64 d_difftime64
10266 set asctime64 d_asctime64
10269 : see if POSIX threads are available
10270 set pthread.h i_pthread
10273 : define a function to check prototypes
10274 $cat > protochk <<EOSH
10277 optimize="$optimize"
10279 prototype="$prototype"
10282 usethreads=$usethreads
10283 i_pthread=$i_pthread
10284 pthread_h_first=$pthread_h_first
10287 $cat >> protochk <<'EOSH'
10292 while test $# -ge 2; do
10294 $define) echo "#include <$2>" >> try.c ;;
10295 literal) echo "$2" >> try.c ;;
10297 # Extra magic for the benefit of systems that need pthread.h
10298 # to be included early to correctly detect threadsafe functions.
10299 # Such functions must guarantee themselves, though, that the usethreads
10300 # and i_pthread have been defined, before calling protochk.
10301 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10302 echo "#include <pthread.h>" >> try.c
10307 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10308 cat >> try.c <<'EOCP'
10309 #ifdef CAN_PROTOTYPE
10310 #define _(args) args
10315 echo "$foo" >> try.c
10316 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10317 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10323 $eunicefix protochk
10325 : Define hasproto macro for Configure internal use
10326 hasproto='varname=$1; func=$2; shift; shift;
10327 while $test $# -ge 2; do
10329 $define) echo "#include <$2>";;
10333 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10334 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10335 echo "$func() prototype found.";
10338 echo "$func() prototype NOT found.";
10345 : see if sys/types.h has to be included
10346 set sys/types.h i_systypes
10349 : see if sys/select.h has to be included
10350 set sys/select.h i_sysselct
10353 : Define hasfield macro for Configure internal use
10354 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10355 while $test $# -ge 2; do
10357 $define) echo "#include <$2>";;
10361 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10363 if eval $compile; then
10372 : see if we should include time.h, sys/time.h, or both
10374 if test "X$timeincl" = X; then
10375 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10376 $echo $n "I'm now running the test program...$c"
10378 #include <sys/types.h>
10383 #ifdef SYSTIMEKERNEL
10386 #include <sys/time.h>
10389 #include <sys/select.h>
10391 #$i_stdlib I_STDLIB
10393 #include <stdlib.h>
10399 struct timeval bar;
10402 struct timezone tzp;
10404 if (foo.tm_sec == foo.tm_sec)
10407 if (bar.tv_sec == bar.tv_sec)
10414 for s_timezone in '-DS_TIMEZONE' ''; do
10416 for s_timeval in '-DS_TIMEVAL' ''; do
10417 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10418 for i_time in '' '-DI_TIME'; do
10419 for i_systime in '-DI_SYSTIME' ''; do
10422 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10423 if eval $compile; then
10424 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10428 $echo $n "Succeeded with $flags$c"
10440 *SYSTIMEKERNEL*) i_systimek="$define"
10441 timeincl=`./findhdr sys/time.h`
10442 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10443 *) i_systimek="$undef";;
10446 *I_TIME*) i_time="$define"
10447 timeincl=`./findhdr time.h`" $timeincl"
10448 echo "We'll include <time.h>." >&4;;
10449 *) i_time="$undef";;
10452 *I_SYSTIME*) i_systime="$define"
10453 timeincl=`./findhdr sys/time.h`" $timeincl"
10454 echo "We'll include <sys/time.h>." >&4;;
10455 *) i_systime="$undef";;
10459 : see if struct tm knows about tm_zone
10460 case "$i_systime$i_time" in
10463 echo "Checking to see if your struct tm has tm_zone field..." >&4
10464 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10472 case "$d_tm_tm_zone" in
10473 "$define") echo "Yes, it does." ;;
10474 *) echo "No, it doesn't." ;;
10476 : see if struct tm knows about tm_gmtoff
10477 case "$i_systime$i_time" in
10480 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10481 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10489 case "$d_tm_tm_gmtoff" in
10490 "$define") echo "Yes, it does." ;;
10491 *) echo "No, it doesn't." ;;
10494 : see if asctime_r exists
10495 set asctime_r d_asctime_r
10497 case "$d_asctime_r" in
10499 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10500 case "$d_asctime_r_proto:$usethreads" in
10501 ":define") d_asctime_r_proto=define
10502 set d_asctime_r_proto asctime_r $hdrs
10506 case "$d_asctime_r_proto" in
10508 case "$asctime_r_proto" in
10509 ''|0) try='char* asctime_r(const struct tm*, char*);'
10510 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10512 case "$asctime_r_proto" in
10513 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10514 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10516 case "$asctime_r_proto" in
10517 ''|0) try='int asctime_r(const struct tm*, char*);'
10518 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10520 case "$asctime_r_proto" in
10521 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10522 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10524 case "$asctime_r_proto" in
10525 ''|0) d_asctime_r=undef
10527 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10528 * ) case "$asctime_r_proto" in
10529 REENTRANT_PROTO*) ;;
10530 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10532 echo "Prototype: $try" ;;
10535 *) case "$usethreads" in
10536 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10543 *) asctime_r_proto=0
10547 : see if atolf exists
10551 : see if atoll exists
10555 : Look for GCC-style attribute format
10556 case "$d_attribute_format" in
10559 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10560 $cat >attrib.c <<'EOCP'
10562 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10564 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10565 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10566 echo "Your C compiler doesn't support __attribute__((format))."
10569 echo "Your C compiler supports __attribute__((format))."
10573 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10577 *) val="$d_attribute_format" ;;
10579 set d_attribute_format
10583 : Look for GCC-style attribute format with null format allowed
10584 case "$d_printf_format_null" in
10585 '') case "$d_attribute_format" in
10588 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10589 $cat >attrib.c <<EOCP
10591 #$i_stdlib I_STDLIB
10593 #include <stdlib.h>
10595 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10596 int null_printf (char* pat,...) { return (int)pat; }
10597 int main () { exit(null_printf(NULL)); }
10599 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10600 : run the executable in case it produces a run-time warning
10601 if $run ./attrib >>attrib.out 2>&1; then
10602 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10603 echo "Your C compiler doesn't allow __printf__ format to be null."
10606 echo "Your C compiler allows __printf__ format to be null."
10610 echo "Your C compiler executable failed with __printf__ format null."
10614 echo "Your C compiler fails with __printf__ format null."
10621 *) val="$d_printf_format_null" ;;
10623 set d_printf_format_null
10627 : Look for GCC-style attribute malloc
10628 case "$d_attribute_malloc" in
10631 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10632 $cat >attrib.c <<'EOCP'
10634 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10636 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10637 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10638 echo "Your C compiler doesn't support __attribute__((malloc))."
10641 echo "Your C compiler supports __attribute__((malloc))."
10645 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10649 *) val="$d_attribute_malloc" ;;
10651 set d_attribute_malloc
10655 : Look for GCC-style attribute nonnull
10656 case "$d_attribute_nonnull" in
10659 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10660 $cat >attrib.c <<'EOCP'
10662 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10664 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10665 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10666 echo "Your C compiler doesn't support __attribute__((nonnull))."
10669 echo "Your C compiler supports __attribute__((nonnull))."
10673 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10677 *) val="$d_attribute_nonnull" ;;
10679 set d_attribute_nonnull
10683 : Look for GCC-style attribute noreturn
10684 case "$d_attribute_noreturn" in
10687 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10688 $cat >attrib.c <<'EOCP'
10690 void fall_over_dead( void ) __attribute__((noreturn));
10692 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10693 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10694 echo "Your C compiler doesn't support __attribute__((noreturn))."
10697 echo "Your C compiler supports __attribute__((noreturn))."
10701 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10705 *) val="$d_attribute_noreturn" ;;
10707 set d_attribute_noreturn
10711 : Look for GCC-style attribute pure
10712 case "$d_attribute_pure" in
10715 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10716 $cat >attrib.c <<'EOCP'
10718 int square( int n ) __attribute__((pure));
10720 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10721 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10722 echo "Your C compiler doesn't support __attribute__((pure))."
10725 echo "Your C compiler supports __attribute__((pure))."
10729 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10733 *) val="$d_attribute_pure" ;;
10735 set d_attribute_pure
10739 : Look for GCC-style attribute unused
10740 case "$d_attribute_unused" in
10743 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10744 $cat >attrib.c <<'EOCP'
10746 int do_something( int dummy __attribute__((unused)), int n );
10748 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10749 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10750 echo "Your C compiler doesn't support __attribute__((unused))."
10753 echo "Your C compiler supports __attribute__((unused))."
10757 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10761 *) val="$d_attribute_unused" ;;
10763 set d_attribute_unused
10767 : Look for GCC-style attribute deprecated
10768 case "$d_attribute_deprecated" in
10771 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10772 $cat >attrib.c <<'EOCP'
10774 int I_am_deprecated(void) __attribute__((deprecated));
10776 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10777 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10778 echo "Your C compiler doesn't support __attribute__((deprecated))."
10781 echo "Your C compiler supports __attribute__((deprecated))."
10785 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10789 *) val="$d_attribute_deprecated" ;;
10791 set d_attribute_deprecated
10795 : Look for GCC-style attribute warn_unused_result
10796 case "$d_attribute_warn_unused_result" in
10799 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10800 $cat >attrib.c <<'EOCP'
10802 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10804 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10805 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10806 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10809 echo "Your C compiler supports __attribute__((warn_unused_result))."
10813 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10817 *) val="$d_attribute_warn_unused_result" ;;
10819 set d_attribute_warn_unused_result
10823 : see if bcmp exists
10827 : see if bcopy exists
10831 : see if getpgrp exists
10832 set getpgrp d_getpgrp
10835 case "$d_getpgrp" in
10838 echo "Checking to see which flavor of getpgrp is in use..."
10840 #$i_unistd I_UNISTD
10841 #include <sys/types.h>
10843 # include <unistd.h>
10845 #$i_stdlib I_STDLIB
10847 #include <stdlib.h>
10851 if (getuid() == 0) {
10852 printf("(I see you are running Configure as super-user...)\n");
10855 #ifdef TRY_BSD_PGRP
10856 if (getpgrp(1) == 0)
10865 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10866 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10868 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10869 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10872 echo "I can't seem to compile and run the test program."
10874 xxx="a USG one, i.e. you use getpgrp()."
10876 # SVR4 systems can appear rather BSD-ish.
10877 case "$i_unistd" in
10879 xxx="a BSD one, i.e. you use getpgrp(pid)."
10883 xxx="probably a USG one, i.e. you use getpgrp()."
10888 echo "Assuming your getpgrp is $xxx" >&4
10897 : see if setpgrp exists
10898 set setpgrp d_setpgrp
10901 case "$d_setpgrp" in
10904 echo "Checking to see which flavor of setpgrp is in use..."
10906 #$i_unistd I_UNISTD
10907 #include <sys/types.h>
10909 # include <unistd.h>
10911 #$i_stdlib I_STDLIB
10913 #include <stdlib.h>
10917 if (getuid() == 0) {
10918 printf("(I see you are running Configure as super-user...)\n");
10921 #ifdef TRY_BSD_PGRP
10922 if (-1 == setpgrp(1, 1))
10925 if (setpgrp() != -1)
10931 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10932 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10934 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10935 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10938 echo "(I can't seem to compile and run the test program.)"
10940 xxx="a USG one, i.e. you use setpgrp()."
10942 # SVR4 systems can appear rather BSD-ish.
10943 case "$i_unistd" in
10945 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10949 xxx="probably a USG one, i.e. you use setpgrp()."
10954 echo "Assuming your setpgrp is $xxx" >&4
10963 : Look for GCC-style __builtin_choose_expr
10964 case "$d_builtin_choose_expr" in
10967 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10968 $cat >try.c <<'EOCP'
10969 #include <assert.h>
10970 #include <stdlib.h>
10973 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10976 assert( SYRINX(1) == 2112 );
10977 assert( SYRINX(1) != 5150 );
10978 assert( SYRINX(0) == 5150 );
10979 assert( SYRINX(0) != 2112 );
10980 puts( "All good!" );
10986 if eval $compile && $run ./try; then
10987 echo "Your C compiler supports __builtin_choose_expr."
10990 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10994 *) val="$d_builtin_choose_expr" ;;
10997 set d_builtin_choose_expr
11001 : Look for GCC-style __builtin_expect
11002 case "$d_builtin_expect" in
11005 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
11006 $cat >try.c <<'EOCP'
11009 if ( __builtin_expect(n, 0) ) n = 1;
11010 /* Remember shell exit code truth is 0, C truth is non-zero */
11015 if eval $compile && $run ./try; then
11016 echo "Your C compiler supports __builtin_expect."
11019 echo "Your C compiler doesn't seem to understand __builtin_expect."
11023 *) val="$d_builtin_expect" ;;
11026 set d_builtin_expect
11030 : see if bzero exists
11034 : see if stdarg is available
11036 if $test `./findhdr stdarg.h`; then
11037 echo "<stdarg.h> found." >&4
11040 echo "<stdarg.h> NOT found." >&4
11044 : see if varargs is available
11046 if $test `./findhdr varargs.h`; then
11047 echo "<varargs.h> found." >&4
11049 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
11052 : set up the varargs testing programs
11053 $cat > varargs.c <<EOP
11055 #include <stdarg.h>
11058 #include <varargs.h>
11062 int f(char *p, ...)
11076 p = va_arg(ap, char *);
11082 $cat > varargs <<EOP
11084 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
11093 : now check which varargs header should be included
11099 if `./varargs I_STDARG`; then
11101 elif `./varargs I_VARARGS`; then
11106 if `./varargs I_VARARGS`; then
11114 echo "*** WHOA THERE!!! ***" >&4
11115 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
11116 case "$knowitall" in
11118 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
11122 echo "I could not find the definition for va_dcl... You have problems..." >&4
11123 val="$undef"; set i_stdarg; eval $setvar
11124 val="$undef"; set i_varargs; eval $setvar
11129 case "$i_varhdr" in
11131 val="$define"; set i_stdarg; eval $setvar
11132 val="$undef"; set i_varargs; eval $setvar
11135 val="$undef"; set i_stdarg; eval $setvar
11136 val="$define"; set i_varargs; eval $setvar
11139 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
11143 : see if the Compiler supports C99 variadic macros
11144 case "$i_stdarg$i_stdlib" in
11146 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
11149 #include <stdarg.h>
11151 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
11155 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
11161 if eval $compile && $run ./try 2>&1 >/dev/null; then
11162 case "`$run ./try`" in
11164 echo "You have C99 variadic macros." >&4
11165 d_c99_variadic_macros="$define"
11168 echo "You don't have functional C99 variadic macros." >&4
11169 d_c99_variadic_macros="$undef"
11173 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
11174 d_c99_variadic_macros="$undef"
11179 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
11180 d_c99_variadic_macros="$undef"
11184 : see if signal is declared as pointer to function returning int or void
11186 xxx=`./findhdr signal.h`
11187 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
11188 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11189 echo "You have int (*signal())() instead of void." >&4
11191 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
11192 echo "You have void (*signal())()." >&4
11194 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
11195 echo "You have int (*signal())() instead of void." >&4
11197 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
11198 echo "You have void (*signal())()." >&4
11201 case "$d_voidsig" in
11203 echo "I can't determine whether signal handler returns void or int..." >&4
11205 rp="What type does your signal handler return?"
11208 v*) val="$define";;
11212 echo "As you already told me, signal handler returns void." >&4
11215 *) echo "As you already told me, signal handler returns int." >&4
11222 case "$d_voidsig" in
11223 "$define") signal_t="void";;
11224 *) signal_t="int";;
11228 : check for ability to cast large floats to 32-bit ints.
11230 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11231 if $test "$intsize" -ge 4; then
11238 #$i_stdlib I_STDLIB
11240 #include <stdlib.h>
11242 #include <sys/types.h>
11243 #include <signal.h>
11244 $signal_t blech(int s) { exit(3); }
11251 signal(SIGFPE, blech);
11253 /* Don't let compiler optimize the test away. Store the number
11254 in a writable string for gcc to pass to sscanf under HP-UX.
11256 sprintf(str, "2147483647");
11257 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11261 /* x86 processors will probably give 0x8000 0000, which is a
11262 sign change. We don't want that. We want to mimic SPARC
11263 behavior here, which is to preserve the sign and give
11266 if (i32 != ($xxx) f)
11272 if eval $compile_ok; then
11276 echo "(I can't seem to compile the test program--assuming it can't)"
11281 echo "Yup, it can."
11284 echo "Nope, it can't."
11291 : check for ability to cast negative floats to unsigned
11293 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11296 #$i_stdlib I_STDLIB
11298 #include <stdlib.h>
11300 #include <sys/types.h>
11301 #include <signal.h>
11302 $signal_t blech(int s) { exit(7); }
11303 $signal_t blech_in_list(int s) { exit(4); }
11304 unsigned long dummy_long(unsigned long p) { return p; }
11305 unsigned int dummy_int(unsigned int p) { return p; }
11306 unsigned short dummy_short(unsigned short p) { return p; }
11310 unsigned long along;
11312 unsigned short ashort;
11316 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11317 a direct f = -123. assignment. gcc-2.8.0 reportedly
11318 optimized the whole file away
11320 /* Store the number in a writable string for gcc to pass to
11321 sscanf under HP-UX.
11323 sprintf(str, "-123");
11324 sscanf(str, "%lf", &f); /* f = -123.; */
11326 signal(SIGFPE, blech);
11327 along = (unsigned long)f;
11328 aint = (unsigned int)f;
11329 ashort = (unsigned short)f;
11330 if (along != (unsigned long)-123)
11332 if (aint != (unsigned int)-123)
11334 if (ashort != (unsigned short)-123)
11336 sprintf(str, "1073741824.");
11337 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11340 along = (unsigned long)f;
11341 if (along != 0x80000000)
11345 along = (unsigned long)f;
11346 if (along != 0x7fffffff)
11350 along = (unsigned long)f;
11351 if (along != 0x80000001)
11355 signal(SIGFPE, blech_in_list);
11356 sprintf(str, "123.");
11357 sscanf(str, "%lf", &f); /* f = 123.; */
11358 along = dummy_long((unsigned long)f);
11359 aint = dummy_int((unsigned int)f);
11360 ashort = dummy_short((unsigned short)f);
11361 if (along != (unsigned long)123)
11363 if (aint != (unsigned int)123)
11365 if (ashort != (unsigned short)123)
11372 if eval $compile_ok; then
11376 echo "(I can't seem to compile the test program--assuming it can't)"
11379 case "$castflags" in
11381 echo "Yup, it can."
11384 echo "Nope, it can't."
11391 : see if vprintf exists
11393 if set vprintf val -f d_vprintf; eval $csym; $val; then
11394 echo 'vprintf() found.' >&4
11397 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11398 #$i_varargs I_VARARGS
11400 #$i_stdlib I_STDLIB
11401 #$i_unistd I_UNISTD
11404 # include <stdarg.h>
11405 #else /* I_VARARGS */
11406 # include <varargs.h>
11410 # include <unistd.h>
11414 # include <stdlib.h>
11417 #include <stdio.h> /* vsprintf prototype */
11420 void xxx(int n, ...)
11425 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11427 int main() { xxx(1, "foo"); }
11429 #else /* I_VARARGS */
11437 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11439 int main() { xxx("foo"); }
11445 if eval $compile_ok; then
11446 if $run ./try; then
11447 echo "Your vsprintf() returns (int)." >&4
11450 echo "Your vsprintf() returns (char*)." >&4
11454 echo 'I am unable to compile the vsprintf() test program.' >&4
11455 # We shouldn't get here. If we do, assume the standard signature,
11456 # not the old BSD one.
11457 echo 'Guessing that vsprintf() returns (int).' >&4
11461 echo 'vprintf() NOT found.' >&4
11472 : see if chown exists
11476 : see if chroot exists
11477 set chroot d_chroot
11480 : see if chsize exists
11481 set chsize d_chsize
11484 : see if class exists
11488 : see if clearenv exists
11489 set clearenv d_clearenv
11492 : Define hasstruct macro for Configure internal use
11493 hasstruct='varname=$1; struct=$2; shift; shift;
11494 while $test $# -ge 2; do
11496 $define) echo "#include <$2>";;
11500 echo "int main () { struct $struct foo; }" >> try.c;
11502 if eval $compile; then
11511 : see whether socket exists
11515 $echo $n "Hmm... $c" >&4
11516 if set socket val -f d_socket; eval $csym; $val; then
11517 echo "Looks like you have Berkeley networking support." >&4
11519 if set setsockopt val -f; eval $csym; $val; then
11522 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11523 d_oldsock="$define"
11526 if $contains socklib libc.list >/dev/null 2>&1; then
11527 echo "Looks like you have Berkeley networking support." >&4
11529 : we will have to assume that it supports the 4.2 BSD interface
11532 echo "You don't have Berkeley networking in libc$_a..." >&4
11533 if test "X$d_socket" = "X$define"; then
11534 echo "...but you seem to believe that you have sockets." >&4
11536 for net in net socket
11538 if test -f $sysroot/usr/lib/lib$net$_a; then
11539 ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) || \
11540 $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11541 if $contains socket libc.list >/dev/null 2>&1; then
11546 echo "...but the Wollongong group seems to have hacked it in." >&4
11547 sockethdr="-I$sysroot/usr/netinclude"
11550 echo "Found Berkeley sockets interface in lib$net." >&4
11551 if $contains setsockopt libc.list >/dev/null 2>&1; then
11554 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11555 d_oldsock="$define"
11561 if test "X$d_socket" != "X$define"; then
11562 echo "or anywhere else I see." >&4
11570 : see if socketpair exists
11571 set socketpair d_sockpair
11576 echo "Checking the availability sa_len in the sock struct ..." >&4
11578 #include <sys/types.h>
11579 #include <sys/socket.h>
11581 struct sockaddr sa;
11582 return (sa.sa_len);
11586 set try; if eval $compile; then
11589 set d_sockaddr_sa_len; eval $setvar
11593 echo "Checking the availability struct sockaddr_in6 ..." >&4
11595 #include <sys/types.h>
11596 #include <sys/socket.h>
11597 #include <netinet/in.h>
11599 struct sockaddr_in6 sin6;
11600 return (sin6.sin6_family);
11604 set try; if eval $compile; then
11607 set d_sockaddr_in6; eval $setvar
11611 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11613 #include <sys/types.h>
11614 #include <sys/socket.h>
11615 #include <netinet/in.h>
11617 struct sockaddr_in6 sin6;
11618 return (sin6.sin6_scope_id);
11622 set try; if eval $compile; then
11625 set d_sin6_scope_id; eval $setvar
11629 echo "Checking the availability struct ip_mreq ..." >&4
11631 #include <sys/types.h>
11632 #include <sys/socket.h>
11633 #include <netinet/in.h>
11635 struct ip_mreq mreq;
11636 return (mreq.imr_multiaddr.s_addr);
11640 set try; if eval $compile; then
11643 set d_ip_mreq; eval $setvar
11647 echo "Checking the availability struct ip_mreq_source ..." >&4
11649 #include <sys/types.h>
11650 #include <sys/socket.h>
11651 #include <netinet/in.h>
11653 struct ip_mreq_source mreq;
11654 return (mreq.imr_multiaddr.s_addr);
11658 set try; if eval $compile; then
11661 set d_ip_mreq_source; eval $setvar
11665 echo "Checking the availability struct ipv6_mreq ..." >&4
11667 #include <sys/types.h>
11668 #include <sys/socket.h>
11669 #include <netinet/in.h>
11671 struct ipv6_mreq mreq;
11672 return (mreq.ipv6mr_interface);
11676 set try; if eval $compile; then
11679 set d_ipv6_mreq; eval $setvar
11683 echo "Checking the availability struct ipv6_mreq_source ..." >&4
11685 #include <sys/types.h>
11686 #include <sys/socket.h>
11687 #include <netinet/in.h>
11689 struct ipv6_mreq_source mreq;
11690 return (mreq.imr_multiaddr.s_addr);
11694 set try; if eval $compile; then
11697 set d_ipv6_mreq_source; eval $setvar
11701 echo "Checking the availability of certain socket constants..." >&4
11702 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11703 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11705 #include <sys/types.h>
11706 #include <sys/socket.h>
11712 set try; if eval $compile; then
11715 set d_${enum}; eval $setvar
11719 : see if this is a sys/uio.h system
11720 set sys/uio.h i_sysuio
11723 : Check for cmsghdr support
11725 echo "Checking to see if your system supports struct cmsghdr..." >&4
11726 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11728 case "$d_cmsghdr_s" in
11729 "$define") echo "Yes, it does." ;;
11730 *) echo "No, it doesn't." ;;
11734 : check for const keyword
11736 echo 'Checking to see if your C compiler knows about "const"...' >&4
11737 $cat >const.c <<'EOCP'
11738 typedef struct spug { int drokk; } spug;
11742 const spug y = { 0 };
11745 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11747 echo "Yup, it does."
11750 echo "Nope, it doesn't."
11755 : see if copysignl exists
11756 set copysignl d_copysignl
11759 : see if crypt exists
11764 $define) cryptlib='' ;;
11765 *) if set crypt val -f d_crypt; eval $csym; $val; then
11766 echo 'crypt() found.' >&4
11770 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11771 if $test -z "$cryptlib"; then
11772 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11776 if $test -z "$cryptlib"; then
11777 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11781 if $test -z "$cryptlib"; then
11782 cryptlib=`./loc libcrypt$_a "" $libpth`
11786 if $test -z "$cryptlib"; then
11787 echo 'crypt() NOT found.' >&4
11798 : see if this is a crypt.h system
11799 set crypt.h i_crypt
11802 : see if crypt_r exists
11803 set crypt_r d_crypt_r
11805 case "$d_crypt_r" in
11807 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11808 case "$d_crypt_r_proto:$usethreads" in
11809 ":define") d_crypt_r_proto=define
11810 set d_crypt_r_proto crypt_r $hdrs
11814 case "$d_crypt_r_proto" in
11816 case "$crypt_r_proto" in
11817 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11818 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11820 case "$crypt_r_proto" in
11821 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11822 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11824 case "$crypt_r_proto" in
11825 ''|0) d_crypt_r=undef
11827 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11828 * ) case "$crypt_r_proto" in
11829 REENTRANT_PROTO*) ;;
11830 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11832 echo "Prototype: $try" ;;
11835 *) case "$usethreads" in
11836 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11847 : get csh whereabouts
11849 'csh') val="$undef" ;;
11850 *) val="$define" ;;
11854 : Respect a hint or command line value for full_csh.
11855 case "$full_csh" in
11856 '') full_csh=$csh ;;
11859 : see if ctermid exists
11860 set ctermid d_ctermid
11863 : see if ctermid_r exists
11864 set ctermid_r d_ctermid_r
11866 case "$d_ctermid_r" in
11868 hdrs="$i_systypes sys/types.h define stdio.h "
11869 case "$d_ctermid_r_proto:$usethreads" in
11870 ":define") d_ctermid_r_proto=define
11871 set d_ctermid_r_proto ctermid_r $hdrs
11875 case "$d_ctermid_r_proto" in
11877 case "$ctermid_r_proto" in
11878 ''|0) try='char* ctermid_r(char*);'
11879 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11881 case "$ctermid_r_proto" in
11882 ''|0) d_ctermid_r=undef
11884 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11885 * ) case "$ctermid_r_proto" in
11886 REENTRANT_PROTO*) ;;
11887 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11889 echo "Prototype: $try" ;;
11892 *) case "$usethreads" in
11893 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11900 *) ctermid_r_proto=0
11904 : see if ctime_r exists
11905 set ctime_r d_ctime_r
11907 case "$d_ctime_r" in
11909 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11910 case "$d_ctime_r_proto:$usethreads" in
11911 ":define") d_ctime_r_proto=define
11912 set d_ctime_r_proto ctime_r $hdrs
11916 case "$d_ctime_r_proto" in
11918 case "$ctime_r_proto" in
11919 ''|0) try='char* ctime_r(const time_t*, char*);'
11920 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11922 case "$ctime_r_proto" in
11923 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11924 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11926 case "$ctime_r_proto" in
11927 ''|0) try='int ctime_r(const time_t*, char*);'
11928 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11930 case "$ctime_r_proto" in
11931 ''|0) try='int ctime_r(const time_t*, char*, int);'
11932 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11934 case "$ctime_r_proto" in
11935 ''|0) d_ctime_r=undef
11937 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11938 * ) case "$ctime_r_proto" in
11939 REENTRANT_PROTO*) ;;
11940 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11942 echo "Prototype: $try" ;;
11945 *) case "$usethreads" in
11946 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11957 : see if cuserid exists
11958 set cuserid d_cuserid
11961 : see if this is a limits.h system
11962 set limits.h i_limits
11965 : see if this is a float.h system
11966 set float.h i_float
11969 : See if number of significant digits in a double precision number is known
11971 $cat >dbl_dig.c <<EOM
11972 #$i_limits I_LIMITS
11975 #include <limits.h>
11981 printf("Contains DBL_DIG");
11984 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11985 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11986 echo "DBL_DIG found." >&4
11989 echo "DBL_DIG NOT found." >&4
11996 : see if dbm.h is available
11997 : see if dbmclose exists
11998 set dbmclose d_dbmclose
12001 case "$d_dbmclose" in
12011 *) set rpcsvc/dbm.h i_rpcsvcdbm
12016 *) echo "We won't be including <dbm.h>"
12026 : see if prototype for dbminit is available
12028 set d_dbminitproto dbminit $i_dbm dbm.h
12031 : see if difftime exists
12032 set difftime d_difftime
12035 : see if this is a dirent system
12037 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
12039 echo "<dirent.h> found." >&4
12042 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
12043 echo "<sys/dir.h> found." >&4
12046 xinc=`./findhdr sys/ndir.h`
12048 echo "<dirent.h> NOT found." >&4
12053 : Look for type of directory structure.
12055 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12057 case "$direntrytype" in
12059 case "$i_dirent" in
12060 $define) guess1='struct dirent' ;;
12061 *) guess1='struct direct' ;;
12064 *) guess1="$direntrytype"
12069 'struct dirent') guess2='struct direct' ;;
12070 *) guess2='struct dirent' ;;
12073 if $contains "$guess1" try.c >/dev/null 2>&1; then
12074 direntrytype="$guess1"
12075 echo "Your directory entries are $direntrytype." >&4
12076 elif $contains "$guess2" try.c >/dev/null 2>&1; then
12077 direntrytype="$guess2"
12078 echo "Your directory entries seem to be $direntrytype." >&4
12080 echo "I don't recognize your system's directory entries." >&4
12081 rp="What type is used for directory entries on this system?"
12084 direntrytype="$ans"
12088 : see if the directory entry stores field length
12090 $cppstdin $cppflags $cppminus < "$xinc" > try.c
12091 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
12092 echo "Good, your directory entry keeps length information in d_namlen." >&4
12095 echo "Your directory entry does not know about the d_namlen field." >&4
12102 : Look for DIR.dd_fd
12103 case "$i_dirent" in
12105 echo "Checking to see if DIR has a dd_fd member variable" >&4
12107 #$i_stdlib I_STDLIB
12109 #include <stdlib.h>
12111 #include <dirent.h>
12121 if eval $compile; then
12122 echo "Yes, it does."
12125 echo "No, it does not."
12130 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
12138 : see if this is an sysdir system
12139 set sys/dir.h i_sysdir
12142 : see if this is an sysndir system
12143 set sys/ndir.h i_sysndir
12148 $cat >dirfd.c <<EOM
12150 #$i_stdlib I_STDLIB
12152 #include <stdlib.h>
12154 #$i_dirent I_DIRENT /**/
12155 #$i_sysdir I_SYS_DIR /**/
12156 #$i_sysndir I_SYS_NDIR /**/
12157 #$i_systypes I_SYS_TYPES /**/
12158 #if defined(I_SYS_TYPES)
12159 #include <sys/types.h>
12161 #if defined(I_DIRENT)
12162 #include <dirent.h>
12165 #include <sys/ndir.h>
12169 #include <ndir.h> /* may be wrong in the future */
12171 #include <sys/dir.h>
12177 DIR *dirp = opendir(".");
12178 if (dirfd(dirp) >= 0)
12186 if eval $compile; then
12190 $define) echo "dirfd() found." >&4 ;;
12191 *) echo "dirfd() NOT found." >&4 ;;
12197 : see if dladdr exists
12198 set dladdr d_dladdr
12201 : see if dlerror exists
12204 set dlerror d_dlerror
12208 : see if dlfcn is available
12209 set dlfcn.h i_dlfcn
12212 : Check what extension to use for shared libs
12217 On a few systems, the dynamically loaded modules that perl generates and uses
12218 will need a different extension than shared libs. The default will probably
12224 *) dflt="$dlext" ;;
12226 rp='What is the extension of dynamically loaded modules'
12235 : Check if dlsym need a leading underscore
12241 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
12242 $cat >dyna.c <<'EOM'
12249 #$i_stdlib I_STDLIB
12251 #include <stdlib.h>
12255 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
12257 #include <sys/types.h>
12262 extern int fred() ;
12271 int mode = RTLD_LAZY ;
12273 handle = dlopen("./dyna.$dlext", mode) ;
12274 if (handle == NULL) {
12279 symbol = dlsym(handle, "fred") ;
12280 if (symbol == NULL) {
12281 /* try putting a leading underscore */
12282 symbol = dlsym(handle, "_fred") ;
12283 if (symbol == NULL) {
12296 : Call the object file tmp-dyna.o in case dlext=o.
12297 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12298 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12299 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12300 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12303 1) echo "Test program failed using dlopen." >&4
12304 echo "Perhaps you should not use dynamic loading." >&4;;
12305 2) echo "Test program failed using dlsym." >&4
12306 echo "Perhaps you should not use dynamic loading." >&4;;
12307 3) echo "dlsym needs a leading underscore" >&4
12309 4) echo "dlsym doesn't need a leading underscore." >&4;;
12312 echo "I can't compile and run the test program." >&4
12313 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12318 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12323 : see if drand48_r exists
12324 set drand48_r d_drand48_r
12326 case "$d_drand48_r" in
12328 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12329 case "$d_drand48_r_proto:$usethreads" in
12330 ":define") d_drand48_r_proto=define
12331 set d_drand48_r_proto drand48_r $hdrs
12335 case "$d_drand48_r_proto" in
12337 case "$drand48_r_proto" in
12338 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12339 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12341 case "$drand48_r_proto" in
12342 ''|0) d_drand48_r=undef
12344 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12345 * ) case "$drand48_r_proto" in
12346 REENTRANT_PROTO*) ;;
12347 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12349 echo "Prototype: $try" ;;
12352 *) case "$usethreads" in
12353 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12360 *) drand48_r_proto=0
12364 : see if prototype for drand48 is available
12366 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12369 : see if dup2 exists
12373 : see if eaccess exists
12374 set eaccess d_eaccess
12377 : see if endgrent exists
12378 set endgrent d_endgrent
12381 : see if this is an grp system
12387 xxx=`./findhdr grp.h`
12388 $cppstdin $cppflags $cppminus < $xxx >$$.h
12390 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12402 set d_grpasswd; eval $setvar
12406 : see if endgrent_r exists
12407 set endgrent_r d_endgrent_r
12409 case "$d_endgrent_r" in
12411 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12412 case "$d_endgrent_r_proto:$usethreads" in
12413 ":define") d_endgrent_r_proto=define
12414 set d_endgrent_r_proto endgrent_r $hdrs
12418 case "$d_endgrent_r_proto" in
12420 case "$endgrent_r_proto" in
12421 ''|0) try='int endgrent_r(FILE**);'
12422 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12424 case "$endgrent_r_proto" in
12425 ''|0) try='void endgrent_r(FILE**);'
12426 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12428 case "$endgrent_r_proto" in
12429 ''|0) d_endgrent_r=undef
12431 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12432 * ) case "$endgrent_r_proto" in
12433 REENTRANT_PROTO*) ;;
12434 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12436 echo "Prototype: $try" ;;
12439 *) case "$usethreads" in
12440 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12447 *) endgrent_r_proto=0
12451 : see if endhostent exists
12452 set endhostent d_endhent
12455 : see if this is a netdb.h system
12456 set netdb.h i_netdb
12459 : see if endhostent_r exists
12460 set endhostent_r d_endhostent_r
12462 case "$d_endhostent_r" in
12464 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12465 case "$d_endhostent_r_proto:$usethreads" in
12466 ":define") d_endhostent_r_proto=define
12467 set d_endhostent_r_proto endhostent_r $hdrs
12471 case "$d_endhostent_r_proto" in
12473 case "$endhostent_r_proto" in
12474 ''|0) try='int endhostent_r(struct hostent_data*);'
12475 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12477 case "$endhostent_r_proto" in
12478 ''|0) try='void endhostent_r(struct hostent_data*);'
12479 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12481 case "$endhostent_r_proto" in
12482 ''|0) d_endhostent_r=undef
12483 endhostent_r_proto=0
12484 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12485 * ) case "$endhostent_r_proto" in
12486 REENTRANT_PROTO*) ;;
12487 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12489 echo "Prototype: $try" ;;
12492 *) case "$usethreads" in
12493 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12495 d_endhostent_r=undef
12496 endhostent_r_proto=0
12500 *) endhostent_r_proto=0
12504 : see if endnetent exists
12505 set endnetent d_endnent
12508 : see if endnetent_r exists
12509 set endnetent_r d_endnetent_r
12511 case "$d_endnetent_r" in
12513 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12514 case "$d_endnetent_r_proto:$usethreads" in
12515 ":define") d_endnetent_r_proto=define
12516 set d_endnetent_r_proto endnetent_r $hdrs
12520 case "$d_endnetent_r_proto" in
12522 case "$endnetent_r_proto" in
12523 ''|0) try='int endnetent_r(struct netent_data*);'
12524 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12526 case "$endnetent_r_proto" in
12527 ''|0) try='void endnetent_r(struct netent_data*);'
12528 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12530 case "$endnetent_r_proto" in
12531 ''|0) d_endnetent_r=undef
12532 endnetent_r_proto=0
12533 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12534 * ) case "$endnetent_r_proto" in
12535 REENTRANT_PROTO*) ;;
12536 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12538 echo "Prototype: $try" ;;
12541 *) case "$usethreads" in
12542 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12544 d_endnetent_r=undef
12545 endnetent_r_proto=0
12549 *) endnetent_r_proto=0
12553 : see if endprotoent exists
12554 set endprotoent d_endpent
12557 : see if endprotoent_r exists
12558 set endprotoent_r d_endprotoent_r
12560 case "$d_endprotoent_r" in
12562 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12563 case "$d_endprotoent_r_proto:$usethreads" in
12564 ":define") d_endprotoent_r_proto=define
12565 set d_endprotoent_r_proto endprotoent_r $hdrs
12569 case "$d_endprotoent_r_proto" in
12571 case "$endprotoent_r_proto" in
12572 ''|0) try='int endprotoent_r(struct protoent_data*);'
12573 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12575 case "$endprotoent_r_proto" in
12576 ''|0) try='void endprotoent_r(struct protoent_data*);'
12577 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12579 case "$endprotoent_r_proto" in
12580 ''|0) d_endprotoent_r=undef
12581 endprotoent_r_proto=0
12582 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12583 * ) case "$endprotoent_r_proto" in
12584 REENTRANT_PROTO*) ;;
12585 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12587 echo "Prototype: $try" ;;
12590 *) case "$usethreads" in
12591 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12593 d_endprotoent_r=undef
12594 endprotoent_r_proto=0
12598 *) endprotoent_r_proto=0
12602 : see if endpwent exists
12603 set endpwent d_endpwent
12606 : see if this is a pwd.h system
12612 xxx=`./findhdr pwd.h`
12613 $cppstdin $cppflags $cppminus < $xxx >$$.h
12615 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12623 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12631 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12639 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12647 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12655 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12663 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12671 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12683 set d_pwquota; eval $setvar
12684 set d_pwage; eval $setvar
12685 set d_pwchange; eval $setvar
12686 set d_pwclass; eval $setvar
12687 set d_pwexpire; eval $setvar
12688 set d_pwcomment; eval $setvar
12689 set d_pwgecos; eval $setvar
12690 set d_pwpasswd; eval $setvar
12694 : see if endpwent_r exists
12695 set endpwent_r d_endpwent_r
12697 case "$d_endpwent_r" in
12699 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12700 case "$d_endpwent_r_proto:$usethreads" in
12701 ":define") d_endpwent_r_proto=define
12702 set d_endpwent_r_proto endpwent_r $hdrs
12706 case "$d_endpwent_r_proto" in
12708 case "$endpwent_r_proto" in
12709 ''|0) try='int endpwent_r(FILE**);'
12710 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12712 case "$endpwent_r_proto" in
12713 ''|0) try='void endpwent_r(FILE**);'
12714 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12716 case "$endpwent_r_proto" in
12717 ''|0) d_endpwent_r=undef
12719 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12720 * ) case "$endpwent_r_proto" in
12721 REENTRANT_PROTO*) ;;
12722 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12724 echo "Prototype: $try" ;;
12727 *) case "$usethreads" in
12728 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12735 *) endpwent_r_proto=0
12739 : see if endservent exists
12740 set endservent d_endsent
12743 : see if endservent_r exists
12744 set endservent_r d_endservent_r
12746 case "$d_endservent_r" in
12748 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12749 case "$d_endservent_r_proto:$usethreads" in
12750 ":define") d_endservent_r_proto=define
12751 set d_endservent_r_proto endservent_r $hdrs
12755 case "$d_endservent_r_proto" in
12757 case "$endservent_r_proto" in
12758 ''|0) try='int endservent_r(struct servent_data*);'
12759 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12761 case "$endservent_r_proto" in
12762 ''|0) try='void endservent_r(struct servent_data*);'
12763 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12765 case "$endservent_r_proto" in
12766 ''|0) d_endservent_r=undef
12767 endservent_r_proto=0
12768 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12769 * ) case "$endservent_r_proto" in
12770 REENTRANT_PROTO*) ;;
12771 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12773 echo "Prototype: $try" ;;
12776 *) case "$usethreads" in
12777 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12779 d_endservent_r=undef
12780 endservent_r_proto=0
12784 *) endservent_r_proto=0
12788 : Locate the flags for 'open()'
12791 #include <sys/types.h>
12796 #include <sys/file.h>
12798 #$i_stdlib I_STDLIB
12800 #include <stdlib.h>
12811 : check sys/file.h first to get FREAD on Sun
12812 if $test `./findhdr sys/file.h` && \
12813 set try -DI_SYS_FILE && eval $compile; then
12815 echo "<sys/file.h> defines the O_* constants..." >&4
12816 if $run ./try; then
12817 echo "and you have the 3 argument form of open()." >&4
12820 echo "but not the 3 argument form of open(). Oh, well." >&4
12823 elif $test `./findhdr fcntl.h` && \
12824 set try -DI_FCNTL && eval $compile; then
12826 echo "<fcntl.h> defines the O_* constants..." >&4
12827 if $run ./try; then
12828 echo "and you have the 3 argument form of open()." >&4
12831 echo "but not the 3 argument form of open(). Oh, well." >&4
12836 echo "I can't find the O_* constant definitions! You got problems." >&4
12842 : see if this is a sys/file.h system
12847 : do we need to include sys/file.h ?
12851 if $h_sysfile; then
12853 echo "We'll be including <sys/file.h>." >&4
12856 echo "We won't be including <sys/file.h>." >&4
12866 : see if fcntl.h is there
12871 : see if we can include fcntl.h
12877 echo "We'll be including <fcntl.h>." >&4
12880 if $h_sysfile; then
12881 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12883 echo "We won't be including <fcntl.h>." >&4
12895 : see if fork exists
12899 : see if pipe exists
12903 : check for non-blocking I/O stuff
12904 case "$h_sysfile" in
12905 true) echo "#include <sys/file.h>" > head.c;;
12908 true) echo "#include <fcntl.h>" > head.c;;
12909 *) echo "#include <sys/fcntl.h>" > head.c;;
12914 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12915 case "$o_nonblock" in
12917 $cat head.c > try.c
12918 $cat >>try.c <<EOCP
12920 #$i_stdlib I_STDLIB
12922 #include <stdlib.h>
12930 printf("O_NONBLOCK\n");
12934 printf("O_NDELAY\n");
12938 printf("FNDELAY\n");
12945 if eval $compile_ok; then
12946 o_nonblock=`$run ./try`
12947 case "$o_nonblock" in
12948 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12949 *) echo "Seems like we can use $o_nonblock.";;
12952 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12955 *) echo "Using $hint value $o_nonblock.";;
12960 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12963 case "$d_fork:$d_pipe" in
12965 $cat head.c > try.c
12966 $cat >>try.c <<EOCP
12968 #include <sys/types.h>
12969 #include <signal.h>
12971 #$i_stdlib I_STDLIB
12973 #include <stdlib.h>
12979 #define MY_O_NONBLOCK $o_nonblock
12980 #ifndef errno /* XXX need better Configure test */
12983 #$i_unistd I_UNISTD
12985 #include <unistd.h>
12987 #$i_string I_STRING
12989 #include <string.h>
12991 #include <strings.h>
12993 $signal_t blech(int x) { exit(3); }
12995 $cat >> try.c <<'EOCP'
13004 ret = pipe(pd); /* Down: child -> parent */
13007 ret = pipe(pu); /* Up: parent -> child */
13011 close(pd[1]); /* Parent reads from pd[0] */
13012 close(pu[0]); /* Parent writes (blocking) to pu[1] */
13014 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
13019 signal(SIGALRM, blech);
13021 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
13023 sprintf(string, "%d\n", ret);
13024 ret = write(2, string, strlen(string));
13025 if (ret != strlen(string))
13029 if (errno == EAGAIN) {
13030 printf("EAGAIN\n");
13035 if (errno == EWOULDBLOCK)
13036 printf("EWOULDBLOCK\n");
13039 ret = write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
13042 sleep(2); /* Give it time to close our pipe */
13044 ret = read(pd[0], buf, 1); /* Should read EOF */
13046 sprintf(string, "%d\n", ret);
13047 ret = write(4, string, strlen(string));
13048 if (ret != strlen(string))
13053 close(pd[0]); /* We write to pd[1] */
13054 close(pu[1]); /* We read from pu[0] */
13055 ret = read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
13058 close(pd[1]); /* Pipe pd is now fully closed! */
13059 exit(0); /* Bye bye, thank you for playing! */
13063 if eval $compile_ok; then
13064 echo "$startsh" >mtry
13065 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
13067 $run ./mtry >/dev/null 2>&1
13069 0) eagain=`$cat try.out`;;
13070 1) echo "Could not perform non-blocking setting!";;
13071 2) echo "I did a successful read() for something that was not there!";;
13072 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
13073 4) echo "Could not find F_SETFL!";;
13074 *) echo "Something terribly wrong happened during testing.";;
13076 rd_nodata=`$cat try.ret`
13077 echo "A read() system call with no data present returns $rd_nodata."
13078 case "$rd_nodata" in
13081 echo "(That's peculiar, fixing that to be -1.)"
13087 echo "Forcing errno EAGAIN on read() with no data available."
13091 echo "Your read() sets errno to $eagain when no data is available."
13094 status=`$cat try.err`
13096 0) echo "And it correctly returns 0 to signal EOF.";;
13097 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
13098 *) echo "However, your read() returns '$status' on EOF??";;
13101 if test "$status" = "$rd_nodata"; then
13102 echo "WARNING: you can't distinguish between EOF and no data!"
13106 echo "I can't compile the test program--assuming errno EAGAIN will do."
13110 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
13119 echo "Using $hint value $eagain."
13120 echo "Your read() returns $rd_nodata when no data is present."
13121 case "$d_eofnblk" in
13122 "$define") echo "And you can see EOF because read() returns 0.";;
13123 "$undef") echo "But you can't see EOF status from read() returned value.";;
13125 echo "(Assuming you can't see EOF status from read anyway.)"
13131 $rm_try head.c mtry
13133 : see if _ptr and _cnt from stdio act std
13136 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
13137 echo "(Looks like you have stdio.h from BSD.)"
13138 case "$stdio_ptr" in
13139 '') stdio_ptr='((fp)->_p)'
13142 *) ptr_lval=$d_stdio_ptr_lval;;
13144 case "$stdio_cnt" in
13145 '') stdio_cnt='((fp)->_r)'
13148 *) cnt_lval=$d_stdio_cnt_lval;;
13150 case "$stdio_base" in
13151 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
13153 case "$stdio_bufsiz" in
13154 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
13156 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
13157 echo "(Looks like you have stdio.h from Linux.)"
13158 case "$stdio_ptr" in
13159 '') stdio_ptr='((fp)->_IO_read_ptr)'
13162 *) ptr_lval=$d_stdio_ptr_lval;;
13164 case "$stdio_cnt" in
13165 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
13168 *) cnt_lval=$d_stdio_cnt_lval;;
13170 case "$stdio_base" in
13171 '') stdio_base='((fp)->_IO_read_base)';;
13173 case "$stdio_bufsiz" in
13174 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
13177 case "$stdio_ptr" in
13178 '') stdio_ptr='((fp)->_ptr)'
13181 *) ptr_lval=$d_stdio_ptr_lval;;
13183 case "$stdio_cnt" in
13184 '') stdio_cnt='((fp)->_cnt)'
13187 *) cnt_lval=$d_stdio_cnt_lval;;
13189 case "$stdio_base" in
13190 '') stdio_base='((fp)->_base)';;
13192 case "$stdio_bufsiz" in
13193 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
13197 : test whether _ptr and _cnt really work
13198 echo "Checking how std your stdio is..." >&4
13201 #$i_stdlib I_STDLIB
13203 #include <stdlib.h>
13205 #define FILE_ptr(fp) $stdio_ptr
13206 #define FILE_cnt(fp) $stdio_cnt
13208 FILE *fp = fopen("try.c", "r");
13211 18 <= FILE_cnt(fp) &&
13212 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13220 if eval $compile && $to try.c; then
13221 if $run ./try; then
13222 echo "Your stdio acts pretty std."
13225 echo "Your stdio isn't very std."
13228 echo "Your stdio doesn't appear very std."
13232 # glibc 2.2.90 and above apparently change stdio streams so Perl's
13233 # direct buffer manipulation no longer works. The Configure tests
13234 # should be changed to correctly detect this, but until then,
13235 # the following check should at least let perl compile and run.
13236 # (This quick fix should be updated before 5.8.1.)
13237 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
13238 # A. Dougherty, June 3, 2002.
13239 case "$d_gnulibc" in
13241 case "$gnulibc_version" in
13245 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
13254 : Can _ptr be used as an lvalue?
13255 case "$d_stdstdio$ptr_lval" in
13256 $define$define) val=$define ;;
13259 set d_stdio_ptr_lval
13262 : Can _cnt be used as an lvalue?
13263 case "$d_stdstdio$cnt_lval" in
13264 $define$define) val=$define ;;
13267 set d_stdio_cnt_lval
13271 : test whether setting _ptr sets _cnt as a side effect
13272 d_stdio_ptr_lval_sets_cnt="$undef"
13273 d_stdio_ptr_lval_nochange_cnt="$undef"
13274 case "$d_stdio_ptr_lval$d_stdstdio" in
13276 echo "Checking to see what happens if we set the stdio ptr..." >&4
13279 /* Can we scream? */
13280 /* Eat dust sed :-) */
13281 /* In the buffer space, no one can hear you scream. */
13282 #$i_stdlib I_STDLIB
13284 #include <stdlib.h>
13286 #define FILE_ptr(fp) $stdio_ptr
13287 #define FILE_cnt(fp) $stdio_cnt
13288 #include <sys/types.h>
13290 FILE *fp = fopen("try.c", "r");
13295 puts("Fail even to read");
13298 c = getc(fp); /* Read away the first # */
13300 puts("Fail even to read");
13304 18 <= FILE_cnt(fp) &&
13305 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13307 puts("Fail even to read");
13310 ptr = (char*) FILE_ptr(fp);
13311 cnt = (size_t)FILE_cnt(fp);
13313 FILE_ptr(fp) += 42;
13315 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13316 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13319 if (FILE_cnt(fp) <= 20) {
13320 printf ("Fail (<20 chars to test)");
13323 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13324 puts("Fail compare");
13327 if (cnt == FILE_cnt(fp)) {
13328 puts("Pass_unchanged");
13331 if (FILE_cnt(fp) == (cnt - 42)) {
13332 puts("Pass_changed");
13335 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13341 if eval $compile && $to try.c; then
13342 case `$run ./try` in
13344 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13345 d_stdio_ptr_lval_sets_cnt="$define" ;;
13347 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13348 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13350 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13352 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13355 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13361 : see if _base is also standard
13363 case "$d_stdstdio" in
13367 #$i_stdlib I_STDLIB
13369 #include <stdlib.h>
13371 #define FILE_base(fp) $stdio_base
13372 #define FILE_bufsiz(fp) $stdio_bufsiz
13374 FILE *fp = fopen("try.c", "r");
13377 19 <= FILE_bufsiz(fp) &&
13378 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13385 if eval $compile && $to try.c; then
13386 if $run ./try; then
13387 echo "And its _base field acts std."
13390 echo "But its _base field isn't std."
13393 echo "However, it seems to be lacking the _base field."
13401 : see if fast_stdio exists
13403 case "$d_stdstdio:$d_stdio_ptr_lval" in
13405 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13407 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13418 : see if fchdir exists
13419 set fchdir d_fchdir
13422 : see if fchmod exists
13423 set fchmod d_fchmod
13426 : see if fchown exists
13427 set fchown d_fchown
13430 : see if this is an fcntl system
13434 : See if fcntl-based locking works.
13437 #$i_stdlib I_STDLIB
13439 #include <stdlib.h>
13441 #include <unistd.h>
13443 #include <signal.h>
13444 $signal_t blech(int x) { exit(3); }
13446 #if defined(F_SETLK) && defined(F_SETLKW)
13447 struct flock flock;
13449 fd = open("try.c", O_RDONLY);
13450 flock.l_type = F_RDLCK;
13451 flock.l_whence = SEEK_SET;
13452 flock.l_start = flock.l_len = 0;
13453 signal(SIGALRM, blech);
13455 retval = fcntl(fd, F_SETLK, &flock);
13457 (retval < 0 ? exit(2) : exit(0));
13463 echo "Checking if fcntl-based file locking works... "
13467 if eval $compile_ok; then
13468 if $run ./try; then
13469 echo "Yes, it seems to work."
13472 echo "Nope, it didn't work."
13477 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13478 *** This is (almost) impossible.
13479 *** If your NFS lock daemons are not feeling well, something like
13480 *** this may happen, please investigate. Cannot continue, aborting.
13488 echo "I'm unable to compile the test program, so I'll assume not."
13493 echo "Nope, since you don't even have fcntl()."
13496 set d_fcntl_can_lock
13500 : check for fd_set items
13503 Checking to see how well your C compiler handles fd_set and friends ...
13506 #$i_stdlib I_STDLIB
13508 #include <stdlib.h>
13510 #$i_systime I_SYS_TIME
13511 #$i_sysselct I_SYS_SELECT
13512 #$d_socket HAS_SOCKET
13513 #include <sys/types.h>
13515 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13518 #include <sys/time.h>
13520 #ifdef I_SYS_SELECT
13521 #include <sys/select.h>
13530 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13538 if eval $compile; then
13539 d_fds_bits="$define"
13541 echo "Well, your system knows about the normal fd_set typedef..." >&4
13542 if $run ./try; then
13543 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13544 d_fd_macros="$define"
13547 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13549 d_fd_macros="$undef"
13553 Hmm, your compiler has some difficulty with fd_set. Checking further...
13556 if eval $compile; then
13557 d_fds_bits="$undef"
13559 echo "Well, your system has some sort of fd_set available..." >&4
13560 if $run ./try; then
13561 echo "and you have the normal fd_set macros." >&4
13562 d_fd_macros="$define"
13565 but not the normal fd_set macros! Gross! More work for me...
13567 d_fd_macros="$undef"
13570 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13572 d_fds_bits="$undef"
13573 d_fd_macros="$undef"
13578 : see if fgetpos exists
13579 set fgetpos d_fgetpos
13582 : see if finite exists
13583 set finite d_finite
13586 : see if finitel exists
13587 set finitel d_finitel
13590 : see if flock exists
13594 : see if prototype for flock is available
13596 set d_flockproto flock $i_sysfile sys/file.h
13599 : see if fp_class exists
13600 set fp_class d_fp_class
13603 : see if pathconf exists
13604 set pathconf d_pathconf
13607 : see if fpathconf exists
13608 set fpathconf d_fpathconf
13611 : see if fpclass exists
13612 set fpclass d_fpclass
13615 : see if fpclassify exists
13616 set fpclassify d_fpclassify
13619 : see if fpclassl exists
13620 set fpclassl d_fpclassl
13623 : check for fpos64_t
13625 echo "Checking to see if you have fpos64_t..." >&4
13628 int main() { fpos64_t x = 7; }
13631 if eval $compile; then
13633 echo "You have fpos64_t."
13636 echo "You do not have fpos64_t."
13637 case "$fpossize" in
13638 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13645 : see if frexpl exists
13646 set frexpl d_frexpl
13649 : see if this is a sys/param system
13650 set sys/param.h i_sysparam
13653 : see if this is a sys/mount.h system
13654 set sys/mount.h i_sysmount
13657 : Check for fs_data_s
13659 echo "Checking to see if your system supports struct fs_data..." >&4
13660 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13662 case "$d_fs_data_s" in
13663 "$define") echo "Yes, it does." ;;
13664 *) echo "No, it doesn't." ;;
13667 : see if fseeko exists
13668 set fseeko d_fseeko
13670 case "$longsize" in
13671 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13674 : see if fsetpos exists
13675 set fsetpos d_fsetpos
13678 : see if fstatfs exists
13679 set fstatfs d_fstatfs
13682 : see if statvfs exists
13683 set statvfs d_statvfs
13686 : see if fstatvfs exists
13687 set fstatvfs d_fstatvfs
13691 : see if fsync exists
13695 : see if ftello exists
13696 set ftello d_ftello
13698 case "$longsize" in
13699 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13702 : check for a working futimes
13705 echo "Checking if you have a working futimes()" >&4
13708 #include <sys/time.h>
13715 fd = open ("try.c", O_RDWR);
13716 if (-1 == fd) exit (1);
13717 rv = futimes (fd, NULL);
13718 exit (rv == -1 ? errno : 0);
13722 if eval $compile; then
13726 0) echo "Yes, you have" >&4
13727 d_futimes="$define"
13729 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13733 echo "No, it does not (probably harmless)" >&4
13737 : see if ndbm.h is available
13740 : Compatibility location for RedHat 7.1
13741 set gdbm/ndbm.h i_gdbmndbm
13743 : Compatibility location for Debian 4.0
13744 set gdbm-ndbm.h i_gdbm_ndbm
13748 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13749 : see if dbm_open exists
13750 set dbm_open d_dbm_open
13752 case "$d_dbm_open" in
13755 i_gdbmndbm="$undef"
13756 i_gdbm_ndbm="$undef"
13757 echo "We won't be including <ndbm.h>"
13767 ndbm_hdr_protochk='name=$1; hdr=$2;
13768 eval "ihdr=\$""i_$name";
13770 if $test "$ihdr" = "$define"; then
13771 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13772 case "$d_cplusplus" in
13773 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13774 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13777 $define) $echo "Your <$hdr> seems to have prototypes";;
13778 *) $echo "Your <$hdr> does not seem to have prototypes";;
13781 set "d_${name}_h_uses_prototypes";
13785 eval $ndbm_hdr_protochk
13786 set gdbmndbm gdbm/ndbm.h
13787 eval $ndbm_hdr_protochk
13788 set gdbm_ndbm gdbm-ndbm.h
13789 eval $ndbm_hdr_protochk
13791 : see if getaddrinfo exists
13792 set getaddrinfo d_getaddrinfo
13795 : see if getcwd exists
13796 set getcwd d_getcwd
13799 : see if getespwnam exists
13800 set getespwnam d_getespwnam
13803 : see if getfsstat exists
13804 set getfsstat d_getfsstat
13807 : see if getgrent exists
13808 set getgrent d_getgrent
13811 : see if getgrent_r exists
13812 set getgrent_r d_getgrent_r
13814 case "$d_getgrent_r" in
13816 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13817 case "$d_getgrent_r_proto:$usethreads" in
13818 ":define") d_getgrent_r_proto=define
13819 set d_getgrent_r_proto getgrent_r $hdrs
13823 case "$d_getgrent_r_proto" in
13825 case "$getgrent_r_proto" in
13826 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13827 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13829 case "$getgrent_r_proto" in
13830 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13831 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13833 case "$getgrent_r_proto" in
13834 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13835 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13837 case "$getgrent_r_proto" in
13838 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13839 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13841 case "$getgrent_r_proto" in
13842 ''|0) try='int getgrent_r(struct group*, char*, int);'
13843 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13845 case "$getgrent_r_proto" in
13846 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13847 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13849 case "$getgrent_r_proto" in
13850 ''|0) d_getgrent_r=undef
13852 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13853 * ) case "$getgrent_r_proto" in
13854 REENTRANT_PROTO*) ;;
13855 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13857 echo "Prototype: $try" ;;
13860 *) case "$usethreads" in
13861 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13868 *) getgrent_r_proto=0
13872 : see if getgrgid_r exists
13873 set getgrgid_r d_getgrgid_r
13875 case "$d_getgrgid_r" in
13877 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13878 case "$d_getgrgid_r_proto:$usethreads" in
13879 ":define") d_getgrgid_r_proto=define
13880 set d_getgrgid_r_proto getgrgid_r $hdrs
13884 case "$d_getgrgid_r_proto" in
13886 case "$getgrgid_r_proto" in
13887 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13888 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13890 case "$getgrgid_r_proto" in
13891 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13892 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13894 case "$getgrgid_r_proto" in
13895 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13896 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13898 case "$getgrgid_r_proto" in
13899 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13900 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13902 case "$getgrgid_r_proto" in
13903 ''|0) d_getgrgid_r=undef
13905 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13906 * ) case "$getgrgid_r_proto" in
13907 REENTRANT_PROTO*) ;;
13908 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13910 echo "Prototype: $try" ;;
13913 *) case "$usethreads" in
13914 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13921 *) getgrgid_r_proto=0
13925 : see if getgrnam_r exists
13926 set getgrnam_r d_getgrnam_r
13928 case "$d_getgrnam_r" in
13930 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13931 case "$d_getgrnam_r_proto:$usethreads" in
13932 ":define") d_getgrnam_r_proto=define
13933 set d_getgrnam_r_proto getgrnam_r $hdrs
13937 case "$d_getgrnam_r_proto" in
13939 case "$getgrnam_r_proto" in
13940 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13941 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13943 case "$getgrnam_r_proto" in
13944 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13945 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13947 case "$getgrnam_r_proto" in
13948 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13949 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13951 case "$getgrnam_r_proto" in
13952 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13953 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13955 case "$getgrnam_r_proto" in
13956 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13957 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13959 case "$getgrnam_r_proto" in
13960 ''|0) d_getgrnam_r=undef
13962 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13963 * ) case "$getgrnam_r_proto" in
13964 REENTRANT_PROTO*) ;;
13965 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13967 echo "Prototype: $try" ;;
13970 *) case "$usethreads" in
13971 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13978 *) getgrnam_r_proto=0
13982 : see if gethostbyaddr exists
13983 set gethostbyaddr d_gethbyaddr
13986 : see if gethostbyname exists
13987 set gethostbyname d_gethbyname
13990 : see if gethostent exists
13991 set gethostent d_gethent
13994 : see how we will look up host name
13997 if set gethostname val -f d_gethname; eval $csym; $val; then
13998 echo 'gethostname() found.' >&4
13999 d_gethname="$define"
14002 if set uname val -f d_uname; eval $csym; $val; then
14005 uname() was found, but you're running xenix, and older versions of xenix
14006 have a broken uname(). If you don't really know whether your xenix is old
14007 enough to have a broken system call, use the default answer.
14012 "$define") dflt=n;;
14014 rp='Is your uname() broken?'
14017 n*) d_uname="$define"; call=uname;;
14020 echo 'uname() found.' >&4
14027 case "$d_gethname" in
14028 '') d_gethname="$undef";;
14031 '') d_uname="$undef";;
14033 case "$d_uname$d_gethname" in
14038 Every now and then someone has a $call() that lies about the hostname
14039 but can't be fixed for political or economic reasons. If you wish, I can
14040 pretend $call() isn't there and maybe compute hostname at run-time
14041 thanks to the '$phostname' command.
14044 rp="Shall I ignore $call() from now on?"
14047 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
14050 case "$phostname" in
14051 '') aphostname='';;
14052 *) case "$aphostname" in
14054 *) set X $phostname
14058 file=`./loc $file $file $pth`
14059 aphostname=`echo $file $*`
14064 case "$d_uname$d_gethname" in
14067 case "$phostname" in
14069 echo "There will be no way for $package to get your hostname." >&4;;
14071 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
14075 case "$d_phostname" in
14076 '') d_phostname="$undef";;
14079 : see if gethostbyaddr_r exists
14080 set gethostbyaddr_r d_gethostbyaddr_r
14082 case "$d_gethostbyaddr_r" in
14084 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14085 case "$d_gethostbyaddr_r_proto:$usethreads" in
14086 ":define") d_gethostbyaddr_r_proto=define
14087 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
14091 case "$d_gethostbyaddr_r_proto" in
14093 case "$gethostbyaddr_r_proto" in
14094 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14095 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
14097 case "$gethostbyaddr_r_proto" in
14098 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
14099 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
14101 case "$gethostbyaddr_r_proto" in
14102 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
14103 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
14105 case "$gethostbyaddr_r_proto" in
14106 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
14107 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
14109 case "$gethostbyaddr_r_proto" in
14110 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
14111 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
14113 case "$gethostbyaddr_r_proto" in
14114 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
14115 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
14117 case "$gethostbyaddr_r_proto" in
14118 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
14119 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
14121 case "$gethostbyaddr_r_proto" in
14122 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
14123 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
14125 case "$gethostbyaddr_r_proto" in
14126 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
14127 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
14129 case "$gethostbyaddr_r_proto" in
14130 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
14131 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
14133 case "$gethostbyaddr_r_proto" in
14134 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
14135 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
14137 case "$gethostbyaddr_r_proto" in
14138 ''|0) d_gethostbyaddr_r=undef
14139 gethostbyaddr_r_proto=0
14140 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
14141 * ) case "$gethostbyaddr_r_proto" in
14142 REENTRANT_PROTO*) ;;
14143 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
14145 echo "Prototype: $try" ;;
14148 *) case "$usethreads" in
14149 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
14151 d_gethostbyaddr_r=undef
14152 gethostbyaddr_r_proto=0
14156 *) gethostbyaddr_r_proto=0
14160 : see if gethostbyname_r exists
14161 set gethostbyname_r d_gethostbyname_r
14163 case "$d_gethostbyname_r" in
14165 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14166 case "$d_gethostbyname_r_proto:$usethreads" in
14167 ":define") d_gethostbyname_r_proto=define
14168 set d_gethostbyname_r_proto gethostbyname_r $hdrs
14172 case "$d_gethostbyname_r_proto" in
14174 case "$gethostbyname_r_proto" in
14175 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
14176 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
14178 case "$gethostbyname_r_proto" in
14179 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
14180 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
14182 case "$gethostbyname_r_proto" in
14183 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
14184 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
14186 case "$gethostbyname_r_proto" in
14187 ''|0) d_gethostbyname_r=undef
14188 gethostbyname_r_proto=0
14189 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
14190 * ) case "$gethostbyname_r_proto" in
14191 REENTRANT_PROTO*) ;;
14192 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
14194 echo "Prototype: $try" ;;
14197 *) case "$usethreads" in
14198 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
14200 d_gethostbyname_r=undef
14201 gethostbyname_r_proto=0
14205 *) gethostbyname_r_proto=0
14209 : see if gethostent_r exists
14210 set gethostent_r d_gethostent_r
14212 case "$d_gethostent_r" in
14214 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14215 case "$d_gethostent_r_proto:$usethreads" in
14216 ":define") d_gethostent_r_proto=define
14217 set d_gethostent_r_proto gethostent_r $hdrs
14221 case "$d_gethostent_r_proto" in
14223 case "$gethostent_r_proto" in
14224 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
14225 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
14227 case "$gethostent_r_proto" in
14228 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
14229 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
14231 case "$gethostent_r_proto" in
14232 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
14233 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
14235 case "$gethostent_r_proto" in
14236 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
14237 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
14239 case "$gethostent_r_proto" in
14240 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
14241 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
14243 case "$gethostent_r_proto" in
14244 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
14245 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
14247 case "$gethostent_r_proto" in
14248 ''|0) d_gethostent_r=undef
14249 gethostent_r_proto=0
14250 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
14251 * ) case "$gethostent_r_proto" in
14252 REENTRANT_PROTO*) ;;
14253 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
14255 echo "Prototype: $try" ;;
14258 *) case "$usethreads" in
14259 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
14261 d_gethostent_r=undef
14262 gethostent_r_proto=0
14266 *) gethostent_r_proto=0
14270 : see if prototypes for various gethostxxx netdb.h functions are available
14272 set d_gethostprotos gethostent $i_netdb netdb.h
14275 : see if getitimer exists
14276 set getitimer d_getitimer
14279 : see if getlogin exists
14280 set getlogin d_getlogin
14283 : see if getlogin_r exists
14284 set getlogin_r d_getlogin_r
14286 case "$d_getlogin_r" in
14288 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14289 case "$d_getlogin_r_proto:$usethreads" in
14290 ":define") d_getlogin_r_proto=define
14291 set d_getlogin_r_proto getlogin_r $hdrs
14295 case "$d_getlogin_r_proto" in
14297 case "$getlogin_r_proto" in
14298 ''|0) try='int getlogin_r(char*, size_t);'
14299 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14301 case "$getlogin_r_proto" in
14302 ''|0) try='int getlogin_r(char*, int);'
14303 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14305 case "$getlogin_r_proto" in
14306 ''|0) try='char* getlogin_r(char*, size_t);'
14307 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14309 case "$getlogin_r_proto" in
14310 ''|0) try='char* getlogin_r(char*, int);'
14311 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14313 case "$getlogin_r_proto" in
14314 ''|0) d_getlogin_r=undef
14316 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14317 * ) case "$getlogin_r_proto" in
14318 REENTRANT_PROTO*) ;;
14319 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14321 echo "Prototype: $try" ;;
14324 *) case "$usethreads" in
14325 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14332 *) getlogin_r_proto=0
14336 : see if getmnt exists
14337 set getmnt d_getmnt
14340 : see if getmntent exists
14341 set getmntent d_getmntent
14344 : see if getnameinfo exists
14345 set getnameinfo d_getnameinfo
14348 : see if getnetbyaddr exists
14349 set getnetbyaddr d_getnbyaddr
14352 : see if getnetbyname exists
14353 set getnetbyname d_getnbyname
14356 : see if getnetent exists
14357 set getnetent d_getnent
14360 : see if getnetbyaddr_r exists
14361 set getnetbyaddr_r d_getnetbyaddr_r
14363 case "$d_getnetbyaddr_r" in
14365 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14366 case "$d_getnetbyaddr_r_proto:$usethreads" in
14367 ":define") d_getnetbyaddr_r_proto=define
14368 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14372 case "$d_getnetbyaddr_r_proto" in
14374 case "$getnetbyaddr_r_proto" in
14375 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14376 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14378 case "$getnetbyaddr_r_proto" in
14379 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14380 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14382 case "$getnetbyaddr_r_proto" in
14383 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14384 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14386 case "$getnetbyaddr_r_proto" in
14387 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14388 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14390 case "$getnetbyaddr_r_proto" in
14391 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14392 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14394 case "$getnetbyaddr_r_proto" in
14395 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14396 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14398 case "$getnetbyaddr_r_proto" in
14399 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14400 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14402 case "$getnetbyaddr_r_proto" in
14403 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14404 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14406 case "$getnetbyaddr_r_proto" in
14407 ''|0) d_getnetbyaddr_r=undef
14408 getnetbyaddr_r_proto=0
14409 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14410 * ) case "$getnetbyaddr_r_proto" in
14411 REENTRANT_PROTO*) ;;
14412 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14414 echo "Prototype: $try" ;;
14417 *) case "$usethreads" in
14418 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14420 d_getnetbyaddr_r=undef
14421 getnetbyaddr_r_proto=0
14425 *) getnetbyaddr_r_proto=0
14429 : see if getnetbyname_r exists
14430 set getnetbyname_r d_getnetbyname_r
14432 case "$d_getnetbyname_r" in
14434 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14435 case "$d_getnetbyname_r_proto:$usethreads" in
14436 ":define") d_getnetbyname_r_proto=define
14437 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14441 case "$d_getnetbyname_r_proto" in
14443 case "$getnetbyname_r_proto" in
14444 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14445 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14447 case "$getnetbyname_r_proto" in
14448 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14449 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14451 case "$getnetbyname_r_proto" in
14452 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14453 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14455 case "$getnetbyname_r_proto" in
14456 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14457 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14459 case "$getnetbyname_r_proto" in
14460 ''|0) d_getnetbyname_r=undef
14461 getnetbyname_r_proto=0
14462 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14463 * ) case "$getnetbyname_r_proto" in
14464 REENTRANT_PROTO*) ;;
14465 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14467 echo "Prototype: $try" ;;
14470 *) case "$usethreads" in
14471 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14473 d_getnetbyname_r=undef
14474 getnetbyname_r_proto=0
14478 *) getnetbyname_r_proto=0
14482 : see if getnetent_r exists
14483 set getnetent_r d_getnetent_r
14485 case "$d_getnetent_r" in
14487 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14488 case "$d_getnetent_r_proto:$usethreads" in
14489 ":define") d_getnetent_r_proto=define
14490 set d_getnetent_r_proto getnetent_r $hdrs
14494 case "$d_getnetent_r_proto" in
14496 case "$getnetent_r_proto" in
14497 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14498 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14500 case "$getnetent_r_proto" in
14501 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14502 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14504 case "$getnetent_r_proto" in
14505 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14506 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14508 case "$getnetent_r_proto" in
14509 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14510 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14512 case "$getnetent_r_proto" in
14513 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14514 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14516 case "$getnetent_r_proto" in
14517 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14518 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14520 case "$getnetent_r_proto" in
14521 ''|0) d_getnetent_r=undef
14522 getnetent_r_proto=0
14523 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14524 * ) case "$getnetent_r_proto" in
14525 REENTRANT_PROTO*) ;;
14526 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14528 echo "Prototype: $try" ;;
14531 *) case "$usethreads" in
14532 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14534 d_getnetent_r=undef
14535 getnetent_r_proto=0
14539 *) getnetent_r_proto=0
14543 : see if prototypes for various getnetxxx netdb.h functions are available
14545 set d_getnetprotos getnetent $i_netdb netdb.h
14548 : see if getpagesize exists
14549 set getpagesize d_getpagsz
14552 : Optional checks for getprotobyname and getprotobynumber
14554 : see if getprotobyname exists
14555 set getprotobyname d_getpbyname
14558 : see if getprotobynumber exists
14559 set getprotobynumber d_getpbynumber
14562 : see if getprotoent exists
14563 set getprotoent d_getpent
14566 : see if getpgid exists
14567 set getpgid d_getpgid
14570 : see if getpgrp2 exists
14571 set getpgrp2 d_getpgrp2
14574 : see if getppid exists
14575 set getppid d_getppid
14578 : see if getpriority exists
14579 set getpriority d_getprior
14582 : see if getprotobyname_r exists
14583 set getprotobyname_r d_getprotobyname_r
14585 case "$d_getprotobyname_r" in
14587 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14588 case "$d_getprotobyname_r_proto:$usethreads" in
14589 ":define") d_getprotobyname_r_proto=define
14590 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14594 case "$d_getprotobyname_r_proto" in
14596 case "$getprotobyname_r_proto" in
14597 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14598 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14600 case "$getprotobyname_r_proto" in
14601 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14602 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14604 case "$getprotobyname_r_proto" in
14605 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14606 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14608 case "$getprotobyname_r_proto" in
14609 ''|0) d_getprotobyname_r=undef
14610 getprotobyname_r_proto=0
14611 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14612 * ) case "$getprotobyname_r_proto" in
14613 REENTRANT_PROTO*) ;;
14614 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14616 echo "Prototype: $try" ;;
14619 *) case "$usethreads" in
14620 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14622 d_getprotobyname_r=undef
14623 getprotobyname_r_proto=0
14627 *) getprotobyname_r_proto=0
14631 : see if getprotobynumber_r exists
14632 set getprotobynumber_r d_getprotobynumber_r
14634 case "$d_getprotobynumber_r" in
14636 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14637 case "$d_getprotobynumber_r_proto:$usethreads" in
14638 ":define") d_getprotobynumber_r_proto=define
14639 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14643 case "$d_getprotobynumber_r_proto" in
14645 case "$getprotobynumber_r_proto" in
14646 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14647 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14649 case "$getprotobynumber_r_proto" in
14650 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14651 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14653 case "$getprotobynumber_r_proto" in
14654 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14655 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14657 case "$getprotobynumber_r_proto" in
14658 ''|0) d_getprotobynumber_r=undef
14659 getprotobynumber_r_proto=0
14660 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14661 * ) case "$getprotobynumber_r_proto" in
14662 REENTRANT_PROTO*) ;;
14663 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14665 echo "Prototype: $try" ;;
14668 *) case "$usethreads" in
14669 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14671 d_getprotobynumber_r=undef
14672 getprotobynumber_r_proto=0
14676 *) getprotobynumber_r_proto=0
14680 : see if getprotoent_r exists
14681 set getprotoent_r d_getprotoent_r
14683 case "$d_getprotoent_r" in
14685 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14686 case "$d_getprotoent_r_proto:$usethreads" in
14687 ":define") d_getprotoent_r_proto=define
14688 set d_getprotoent_r_proto getprotoent_r $hdrs
14692 case "$d_getprotoent_r_proto" in
14694 case "$getprotoent_r_proto" in
14695 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14696 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14698 case "$getprotoent_r_proto" in
14699 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14700 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14702 case "$getprotoent_r_proto" in
14703 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14704 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14706 case "$getprotoent_r_proto" in
14707 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14708 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14710 case "$getprotoent_r_proto" in
14711 ''|0) d_getprotoent_r=undef
14712 getprotoent_r_proto=0
14713 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14714 * ) case "$getprotoent_r_proto" in
14715 REENTRANT_PROTO*) ;;
14716 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14718 echo "Prototype: $try" ;;
14721 *) case "$usethreads" in
14722 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14724 d_getprotoent_r=undef
14725 getprotoent_r_proto=0
14729 *) getprotoent_r_proto=0
14733 : see if prototypes for various getprotoxxx netdb.h functions are available
14735 set d_getprotoprotos getprotoent $i_netdb netdb.h
14738 : see if getprpwnam exists
14739 set getprpwnam d_getprpwnam
14742 : see if getpwent exists
14743 set getpwent d_getpwent
14746 : see if getpwent_r exists
14747 set getpwent_r d_getpwent_r
14749 case "$d_getpwent_r" in
14751 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14752 case "$d_getpwent_r_proto:$usethreads" in
14753 ":define") d_getpwent_r_proto=define
14754 set d_getpwent_r_proto getpwent_r $hdrs
14758 case "$d_getpwent_r_proto" in
14760 case "$getpwent_r_proto" in
14761 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14762 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14764 case "$getpwent_r_proto" in
14765 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14766 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14768 case "$getpwent_r_proto" in
14769 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14770 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14772 case "$getpwent_r_proto" in
14773 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14774 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14776 case "$getpwent_r_proto" in
14777 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14778 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14780 case "$getpwent_r_proto" in
14781 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14782 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14784 case "$getpwent_r_proto" in
14785 ''|0) d_getpwent_r=undef
14787 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14788 * ) case "$getpwent_r_proto" in
14789 REENTRANT_PROTO*) ;;
14790 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14792 echo "Prototype: $try" ;;
14795 *) case "$usethreads" in
14796 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14803 *) getpwent_r_proto=0
14807 : see if getpwnam_r exists
14808 set getpwnam_r d_getpwnam_r
14810 case "$d_getpwnam_r" in
14812 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14813 case "$d_getpwnam_r_proto:$usethreads" in
14814 ":define") d_getpwnam_r_proto=define
14815 set d_getpwnam_r_proto getpwnam_r $hdrs
14819 case "$d_getpwnam_r_proto" in
14821 case "$getpwnam_r_proto" in
14822 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14823 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14825 case "$getpwnam_r_proto" in
14826 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14827 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14829 case "$getpwnam_r_proto" in
14830 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14831 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14833 case "$getpwnam_r_proto" in
14834 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14835 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14837 case "$getpwnam_r_proto" in
14838 ''|0) d_getpwnam_r=undef
14840 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14841 * ) case "$getpwnam_r_proto" in
14842 REENTRANT_PROTO*) ;;
14843 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14845 echo "Prototype: $try" ;;
14848 *) case "$usethreads" in
14849 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14856 *) getpwnam_r_proto=0
14860 : see if getpwuid_r exists
14861 set getpwuid_r d_getpwuid_r
14863 case "$d_getpwuid_r" in
14865 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14866 case "$d_getpwuid_r_proto:$usethreads" in
14867 ":define") d_getpwuid_r_proto=define
14868 set d_getpwuid_r_proto getpwuid_r $hdrs
14872 case "$d_getpwuid_r_proto" in
14874 case "$getpwuid_r_proto" in
14875 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14876 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14878 case "$getpwuid_r_proto" in
14879 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14880 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14882 case "$getpwuid_r_proto" in
14883 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14884 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14886 case "$getpwuid_r_proto" in
14887 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14888 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14890 case "$getpwuid_r_proto" in
14891 ''|0) d_getpwuid_r=undef
14893 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14894 * ) case "$getpwuid_r_proto" in
14895 REENTRANT_PROTO*) ;;
14896 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14898 echo "Prototype: $try" ;;
14901 *) case "$usethreads" in
14902 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14909 *) getpwuid_r_proto=0
14913 : Optional checks for getsbyname and getsbyport
14915 : see if getservbyname exists
14916 set getservbyname d_getsbyname
14919 : see if getservbyport exists
14920 set getservbyport d_getsbyport
14923 : see if getservent exists
14924 set getservent d_getsent
14927 : see if getservbyname_r exists
14928 set getservbyname_r d_getservbyname_r
14930 case "$d_getservbyname_r" in
14932 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14933 case "$d_getservbyname_r_proto:$usethreads" in
14934 ":define") d_getservbyname_r_proto=define
14935 set d_getservbyname_r_proto getservbyname_r $hdrs
14939 case "$d_getservbyname_r_proto" in
14941 case "$getservbyname_r_proto" in
14942 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14943 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14945 case "$getservbyname_r_proto" in
14946 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14947 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14949 case "$getservbyname_r_proto" in
14950 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14951 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14953 case "$getservbyname_r_proto" in
14954 ''|0) d_getservbyname_r=undef
14955 getservbyname_r_proto=0
14956 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14957 * ) case "$getservbyname_r_proto" in
14958 REENTRANT_PROTO*) ;;
14959 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14961 echo "Prototype: $try" ;;
14964 *) case "$usethreads" in
14965 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14967 d_getservbyname_r=undef
14968 getservbyname_r_proto=0
14972 *) getservbyname_r_proto=0
14976 : see if getservbyport_r exists
14977 set getservbyport_r d_getservbyport_r
14979 case "$d_getservbyport_r" in
14981 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14982 case "$d_getservbyport_r_proto:$usethreads" in
14983 ":define") d_getservbyport_r_proto=define
14984 set d_getservbyport_r_proto getservbyport_r $hdrs
14988 case "$d_getservbyport_r_proto" in
14990 case "$getservbyport_r_proto" in
14991 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14992 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14994 case "$getservbyport_r_proto" in
14995 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14996 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14998 case "$getservbyport_r_proto" in
14999 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
15000 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
15002 case "$getservbyport_r_proto" in
15003 ''|0) d_getservbyport_r=undef
15004 getservbyport_r_proto=0
15005 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
15006 * ) case "$getservbyport_r_proto" in
15007 REENTRANT_PROTO*) ;;
15008 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
15010 echo "Prototype: $try" ;;
15013 *) case "$usethreads" in
15014 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
15016 d_getservbyport_r=undef
15017 getservbyport_r_proto=0
15021 *) getservbyport_r_proto=0
15025 : see if getservent_r exists
15026 set getservent_r d_getservent_r
15028 case "$d_getservent_r" in
15030 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15031 case "$d_getservent_r_proto:$usethreads" in
15032 ":define") d_getservent_r_proto=define
15033 set d_getservent_r_proto getservent_r $hdrs
15037 case "$d_getservent_r_proto" in
15039 case "$getservent_r_proto" in
15040 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
15041 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
15043 case "$getservent_r_proto" in
15044 ''|0) try='int getservent_r(struct servent*, char*, int);'
15045 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
15047 case "$getservent_r_proto" in
15048 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
15049 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
15051 case "$getservent_r_proto" in
15052 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
15053 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
15055 case "$getservent_r_proto" in
15056 ''|0) d_getservent_r=undef
15057 getservent_r_proto=0
15058 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
15059 * ) case "$getservent_r_proto" in
15060 REENTRANT_PROTO*) ;;
15061 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
15063 echo "Prototype: $try" ;;
15066 *) case "$usethreads" in
15067 define) echo "getservent_r has no prototype, not using it." >&4 ;;
15069 d_getservent_r=undef
15070 getservent_r_proto=0
15074 *) getservent_r_proto=0
15078 : see if prototypes for various getservxxx netdb.h functions are available
15080 set d_getservprotos getservent $i_netdb netdb.h
15083 : see if getspnam exists
15084 set getspnam d_getspnam
15087 : see if this is a shadow.h system
15088 set shadow.h i_shadow
15091 : see if getspnam_r exists
15092 set getspnam_r d_getspnam_r
15094 case "$d_getspnam_r" in
15096 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
15097 case "$d_getspnam_r_proto:$usethreads" in
15098 ":define") d_getspnam_r_proto=define
15099 set d_getspnam_r_proto getspnam_r $hdrs
15103 case "$d_getspnam_r_proto" in
15105 case "$getspnam_r_proto" in
15106 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
15107 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
15109 case "$getspnam_r_proto" in
15110 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
15111 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
15113 case "$getspnam_r_proto" in
15114 ''|0) d_getspnam_r=undef
15116 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
15117 * ) case "$getspnam_r_proto" in
15118 REENTRANT_PROTO*) ;;
15119 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
15121 echo "Prototype: $try" ;;
15124 *) case "$usethreads" in
15125 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
15132 *) getspnam_r_proto=0
15136 : see if gettimeofday or ftime exists
15137 set gettimeofday d_gettimeod
15139 case "$d_gettimeod" in
15145 val="$undef"; set d_ftime; eval $setvar
15148 case "$d_gettimeod$d_ftime" in
15151 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
15155 : see if gmtime_r exists
15156 set gmtime_r d_gmtime_r
15158 case "$d_gmtime_r" in
15160 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15161 case "$d_gmtime_r_proto:$usethreads" in
15162 ":define") d_gmtime_r_proto=define
15163 set d_gmtime_r_proto gmtime_r $hdrs
15167 case "$d_gmtime_r_proto" in
15169 case "$gmtime_r_proto" in
15170 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
15171 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
15173 case "$gmtime_r_proto" in
15174 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
15175 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
15177 case "$gmtime_r_proto" in
15178 ''|0) d_gmtime_r=undef
15180 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
15181 * ) case "$gmtime_r_proto" in
15182 REENTRANT_PROTO*) ;;
15183 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
15185 echo "Prototype: $try" ;;
15188 *) case "$usethreads" in
15189 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
15196 *) gmtime_r_proto=0
15200 : see if hasmntopt exists
15201 set hasmntopt d_hasmntopt
15204 : see if this is a netinet/in.h or sys/in.h system
15205 set netinet/in.h i_niin sys/in.h i_sysin
15208 : see if arpa/inet.h has to be included
15209 set arpa/inet.h i_arpainet
15212 : see if htonl --and friends-- exists
15217 : Maybe they are macros.
15220 $cat >htonl.c <<EOM
15222 #include <sys/types.h>
15223 #$i_niin I_NETINET_IN
15225 #$i_arpainet I_ARPA_INET
15226 #ifdef I_NETINET_IN
15227 #include <netinet/in.h>
15230 #include <sys/in.h>
15233 #include <arpa/inet.h>
15236 printf("Defined as a macro.");
15239 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
15240 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
15242 echo "But it seems to be defined as a macro." >&4
15250 : see if ilogbl exists
15251 set ilogbl d_ilogbl
15256 if set index val -f; eval $csym; $val; then
15257 if set strchr val -f d_strchr; eval $csym; $val; then
15258 if $contains strchr "$strings" >/dev/null 2>&1 ; then
15261 echo "strchr() found." >&4
15265 echo "index() found." >&4
15270 echo "index() found." >&4
15273 if set strchr val -f d_strchr; eval $csym; $val; then
15276 echo "strchr() found." >&4
15278 echo "No index() or strchr() found!" >&4
15283 set d_strchr; eval $setvar
15285 set d_index; eval $setvar
15287 : check whether inet_aton exists
15288 set inet_aton d_inetaton
15291 : see if inet_ntop exists
15292 set inet_ntop d_inetntop
15295 : see if inet_pton exists
15296 set inet_pton d_inetpton
15301 $cat >isascii.c <<EOCP
15304 #$i_stdlib I_STDLIB
15306 #include <stdlib.h>
15317 if eval $compile; then
15318 echo "isascii() found." >&4
15321 echo "isascii() NOT found." >&4
15330 $cat >isblank.c <<'EOCP'
15341 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15342 echo "isblank() found." >&4
15345 echo "isblank() NOT found." >&4
15352 : see if isfinite exists
15353 set isfinite d_isfinite
15356 : see if isinf exists
15360 : see if isnan exists
15364 : see if isnanl exists
15365 set isnanl d_isnanl
15368 : see if killpg exists
15369 set killpg d_killpg
15372 : see if lchown exists
15374 $cat > try.c <<'EOCP'
15375 /* System header to define __stub macros and hopefully few prototypes,
15376 which can conflict with char lchown(); below. */
15377 #include <assert.h>
15378 /* Override any gcc2 internal prototype to avoid an error. */
15379 /* We use char because int might match the return type of a gcc2
15380 builtin and then its argument prototype would still apply. */
15383 /* The GNU C library defines this for functions which it implements
15384 to always fail with ENOSYS. Some functions are actually named
15385 something starting with __ and the normal name is an alias. */
15386 #if defined (__stub_lchown) || defined (__stub___lchown)
15394 if eval $compile; then
15395 $echo "lchown() found." >&4
15398 $echo "lchown() NOT found." >&4
15404 : See if number of significant digits in a double precision number is known
15406 $cat >ldbl_dig.c <<EOM
15407 #$i_limits I_LIMITS
15410 #include <limits.h>
15416 printf("Contains LDBL_DIG");
15419 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15420 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15421 echo "LDBL_DIG found." >&4
15424 echo "LDBL_DIG NOT found." >&4
15431 : see if ldexpl exists
15432 set ldexpl d_ldexpl
15435 : see if this is a math.h system
15439 : check to see if math.h defines _LIB_VERSION
15440 d_libm_lib_version="$undef"
15444 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15446 #include <unistd.h>
15448 int main (int argc, char *argv[])
15450 printf ("%d\n", _LIB_VERSION);
15455 if eval $compile; then
15457 echo "Yes, it does ($foo)" >&4
15458 d_libm_lib_version="$define"
15460 echo "No, it does not (probably harmless)" >&4
15467 : see if link exists
15471 : see if localtime_r exists
15472 set localtime_r d_localtime_r
15474 case "$d_localtime_r" in
15476 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15477 case "$d_localtime_r_proto:$usethreads" in
15478 ":define") d_localtime_r_proto=define
15479 set d_localtime_r_proto localtime_r $hdrs
15483 case "$d_localtime_r_proto" in
15485 case "$localtime_r_proto" in
15486 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15487 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15489 case "$localtime_r_proto" in
15490 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15491 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15493 case "$localtime_r_proto" in
15494 ''|0) d_localtime_r=undef
15495 localtime_r_proto=0
15496 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15497 * ) case "$localtime_r_proto" in
15498 REENTRANT_PROTO*) ;;
15499 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15501 echo "Prototype: $try" ;;
15504 *) case "$usethreads" in
15505 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15507 d_localtime_r=undef
15508 localtime_r_proto=0
15512 *) localtime_r_proto=0
15516 : see if localtime_r calls tzset
15517 case "$localtime_r_proto" in
15520 /* Does our libc's localtime_r call tzset ?
15521 * return 0 if so, 1 otherwise.
15523 #$i_systypes I_SYS_TYPES
15524 #$i_unistd I_UNISTD
15526 #$i_stdlib I_STDLIB
15527 #$i_string I_STRING
15528 #$i_malloc I_MALLOC
15530 # include <sys/types.h>
15533 # include <unistd.h>
15539 #include <stdlib.h>
15542 # include <string.h>
15544 # include <strings.h>
15547 # include <malloc.h>
15551 time_t t = time(0L);
15552 char w_tz[]="TZ" "=GMT+5",
15553 e_tz[]="TZ" "=GMT-5",
15554 *tz_e = (char*)malloc(16),
15555 *tz_w = (char*)malloc(16);
15556 struct tm tm_e, tm_w;
15557 memset(&tm_e,'\0',sizeof(struct tm));
15558 memset(&tm_w,'\0',sizeof(struct tm));
15563 localtime_r(&t, &tm_e);
15566 localtime_r(&t, &tm_w);
15568 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15574 if eval $compile; then
15575 if $run ./try; then
15576 d_localtime_r_needs_tzset=undef;
15578 d_localtime_r_needs_tzset=define;
15581 d_localtime_r_needs_tzset=undef;
15585 d_localtime_r_needs_tzset=undef;
15590 : see if localeconv exists
15591 set localeconv d_locconv
15594 : see if lockf exists
15598 : see if prototype for lseek is available
15600 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15603 : see if lstat exists
15607 : see if madvise exists
15608 set madvise d_madvise
15611 : see if malloc_size exists
15612 set malloc_size d_malloc_size
15615 : see if malloc_size_good exists
15616 set malloc_good_size d_malloc_good_size
15619 : see if mblen exists
15623 : see if mbstowcs exists
15624 set mbstowcs d_mbstowcs
15627 : see if mbtowc exists
15628 set mbtowc d_mbtowc
15631 : see if memchr exists
15632 set memchr d_memchr
15635 : see if memcmp exists
15636 set memcmp d_memcmp
15639 : see if memcpy exists
15640 set memcpy d_memcpy
15643 : see if memmove exists
15644 set memmove d_memmove
15647 : see if memset exists
15648 set memset d_memset
15651 : see if mkdir exists
15655 : see if mkdtemp exists
15656 set mkdtemp d_mkdtemp
15659 : see if mkfifo exists
15660 set mkfifo d_mkfifo
15663 : see if mkstemp exists
15664 set mkstemp d_mkstemp
15667 : see if mkstemps exists
15668 set mkstemps d_mkstemps
15671 : see if mktime exists
15672 set mktime d_mktime
15675 : see if this is a sys/mman.h system
15676 set sys/mman.h i_sysmman
15679 : see if mmap exists
15682 : see what shmat returns
15683 : default to something harmless
15685 case "$i_sysmman$d_mmap" in
15687 $cat >mmap.c <<'END'
15688 #include <sys/mman.h>
15691 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15696 echo "and it returns ($mmaptype)." >&4
15702 : see if sqrtl exists
15706 : see if scalbnl exists
15707 set scalbnl d_scalbnl
15710 : see if modfl exists
15714 : see if prototype for modfl is available
15716 set d_modflproto modfl $i_math math.h
15719 d_modfl_pow32_bug="$undef"
15721 case "$d_longdbl$d_modfl" in
15724 Checking to see whether your modfl() is okay for large values...
15730 if $test "X$d_modflproto" != "X$define"; then
15731 $cat >>try.c <<EOCP
15732 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15733 long double modfl (long double, long double *);
15736 $cat >>try.c <<EOCP
15738 long double nv = 4294967303.15;
15744 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15748 case "$osname:$gccversion" in
15749 aix:) saveccflags="$ccflags"
15750 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15753 if eval $compile; then
15756 *" 4294967303.150000 1.150000 4294967302.000000")
15757 echo >&4 "Your modfl() is broken for large values."
15758 d_modfl_pow32_bug="$define"
15760 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15764 *" 4294967303.150000 0.150000 4294967303.000000")
15765 echo >&4 "Your modfl() seems okay for large values."
15767 *) echo >&4 "I don't understand your modfl() at all."
15773 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15776 case "$osname:$gccversion" in
15777 aix:) ccflags="$saveccflags" ;; # restore
15782 if $test "$uselongdouble" = "$define"; then
15784 if $test "$d_sqrtl" != "$define"; then
15785 message="$message sqrtl"
15787 if $test "$d_modfl" != "$define"; then
15788 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15789 echo "You have both aintl and copysignl, so I can emulate modfl."
15791 message="$message modfl"
15794 if $test "$d_frexpl" != "$define"; then
15795 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15796 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15798 message="$message frexpl"
15801 if $test "$d_ldexpl" != "$define"; then
15802 message="$message ldexpl"
15805 if $test "$message" != ""; then
15808 *** You requested the use of long doubles but you do not seem to have
15809 *** the following mathematical functions needed for long double support:
15811 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15812 *** Cannot continue, aborting.
15820 : see if mprotect exists
15821 set mprotect d_mprotect
15824 : see if msgctl exists
15825 set msgctl d_msgctl
15828 : see if msgget exists
15829 set msgget d_msgget
15832 : see if msgsnd exists
15833 set msgsnd d_msgsnd
15836 : see if msgrcv exists
15837 set msgrcv d_msgrcv
15840 : see how much of the 'msg*(2)' library is present.
15843 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15844 *"$undef"*) h_msg=false;;
15848 case "`ipcs 2>&1`" in
15849 "SVID messages"*"not configured"*)
15850 echo "Your $osname does not have the msg*(2) configured." >&4
15853 set msgctl d_msgctl
15855 set msgget d_msgget
15857 set msgsnd d_msgsnd
15859 set msgrcv d_msgrcv
15865 : we could also check for sys/ipc.h ...
15866 if $h_msg && $test `./findhdr sys/msg.h`; then
15867 echo "You have the full msg*(2) library." >&4
15870 echo "You don't have the full msg*(2) library." >&4
15876 : Check for msghdr_s
15878 echo "Checking to see if your system supports struct msghdr..." >&4
15879 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15881 case "$d_msghdr_s" in
15882 "$define") echo "Yes, it does." ;;
15883 *) echo "No, it doesn't." ;;
15887 : see if msync exists
15891 : see if munmap exists
15892 set munmap d_munmap
15895 : see if nice exists
15899 : see if this is a langinfo.h system
15900 set langinfo.h i_langinfo
15903 : see if nl_langinfo exists
15904 set nl_langinfo d_nl_langinfo
15907 : check for volatile keyword
15909 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15910 $cat >try.c <<'EOCP'
15913 typedef struct _goo_struct goo_struct;
15914 goo_struct * volatile goo = ((goo_struct *)0);
15915 struct _goo_struct {
15920 typedef unsigned short foo_t;
15921 char *volatile foo;
15923 volatile foo_t blech;
15927 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15929 echo "Yup, it does."
15932 echo "Nope, it doesn't."
15938 : Check basic sizes
15940 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15942 case "$use64bitint:$d_quad:$quadtype" in
15945 uvtype="$uquadtype"
15950 uvtype="unsigned long"
15956 case "$uselongdouble:$d_longdbl" in
15958 nvtype="long double"
15959 nvsize=$longdblsize
15966 $echo "(IV will be "$ivtype", $ivsize bytes)"
15967 $echo "(UV will be "$uvtype", $uvsize bytes)"
15968 $echo "(NV will be "$nvtype", $nvsize bytes)"
15970 $echo "Checking the kind of long doubles you have..." >&4
15971 : volatile so that the compiler has to store it out to memory.
15972 if test X"$d_volatile" = X"$define"; then
15975 case "$d_longdbl" in
15979 #$i_stdlib I_STDLIB
15980 #define LONGDBLSIZE $longdblsize
15985 #include <stdlib.h>
15988 static const long double d = -0.1L;
15990 unsigned const char* b = (unsigned const char*)(&d);
15991 #if LDBL_MANT_DIG == 113 && LONGDBLSIZE == 16
15992 if (b[0] == 0x9A && b[1] == 0x99 && b[15] == 0xBF) {
15993 /* IEEE 754 128-bit little-endian */
15997 if (b[0] == 0xBF && b[14] == 0x99 && b[15] == 0x9A) {
15998 /* IEEE 128-bit big-endian, e.g. solaris sparc */
16003 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
16004 if (b[0] == 0xCD && b[9] == 0xBF && b[10] == 0x00) {
16005 /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
16006 * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
16007 * Also known as "extended precision". */
16011 if (b[LONGDBLSIZE - 11] == 0x00 && b[LONGDBLSIZE - 10] == 0xBF &&
16012 b[LONGDBLSIZE - 1] == 0xCD) {
16013 /* is there ever big-endian 80-bit, really? */
16018 #if LDBL_MANT_DIG == 106 && LONGDBLSIZE == 16
16019 /* software "double double", the 106 is 53+53 */
16020 if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
16021 /* double double 128-bit little-endian,
16022 * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
16026 if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
16027 /* double double 128-bit big-endian, e.g. PPC/Power and MIPS:
16028 * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
16033 printf("-1\n"); /* unknown */
16038 if eval $compile; then
16039 longdblkind=`$run ./try`
16044 *) longdblkind=0 ;;
16046 case "$longdblkind" in
16047 0) echo "Your long doubles are doubles." >&4 ;;
16048 1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
16049 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
16050 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
16051 *) echo "Cannot figure out your long double." >&4 ;;
16056 #$i_inttypes I_INTTYPES
16058 #include <inttypes.h>
16063 int8_t i = INT8_MAX;
16064 uint8_t u = UINT8_MAX;
16065 printf("int8_t\n");
16068 int16_t i = INT16_MAX;
16069 uint16_t u = UINT16_MAX;
16070 printf("int16_t\n");
16073 int32_t i = INT32_MAX;
16074 uint32_t u = UINT32_MAX;
16075 printf("int32_t\n");
16080 i8type="signed char"
16081 u8type="unsigned char"
16086 '') case "$shortsize" in
16088 u16type="unsigned short"
16096 '') set try -DINT16
16097 if eval $compile; then
16098 case "`$run ./try`" in
16110 '') if $test $shortsize -ge 2; then
16112 u16type="unsigned short"
16120 '') case "$longsize" in
16122 u32type="unsigned long"
16126 *) case "$intsize" in
16128 u32type="unsigned int"
16138 '') set try -DINT32
16139 if eval $compile; then
16140 case "`$run ./try`" in
16152 '') if $test $intsize -ge 4; then
16154 u32type="unsigned int"
16162 '') case "$d_quad:$quadtype" in
16164 i64type="$quadtype"
16165 u64type="$uquadtype"
16173 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
16174 : volatile so that the compiler has to store it out to memory.
16175 if test X"$d_volatile" = X"$define"; then
16180 #$i_stdlib I_STDLIB
16182 #include <stdlib.h>
16184 #include <sys/types.h>
16185 #include <signal.h>
16187 $volatile int bletched = 0;
16188 $signal_t blech(int s) { bletched = 1; }
16193 int n = 8 * $uvsize;
16196 signal(SIGFPE, blech);
16199 for (i = 0; i < n; i++) {
16200 u = u << 1 | ($uvtype)1;
16202 if (($uvtype)d != u)
16206 d = ($nvtype)(u - 1);
16207 if (($uvtype)d != (u - 1))
16214 printf("%d\n", ((i == n) ? -n : i));
16220 d_nv_preserves_uv="$undef"
16221 if eval $compile; then
16222 nv_preserves_uv_bits="`$run ./try`"
16224 case "$nv_preserves_uv_bits" in
16226 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
16227 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
16228 d_nv_preserves_uv="$define"
16230 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
16231 d_nv_preserves_uv="$undef" ;;
16232 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
16233 nv_preserves_uv_bits="0" ;;
16237 $echo "Checking to find the largest integer value your NVs can hold..." >&4
16238 : volatile so that the compiler has to store it out to memory.
16239 if test X"$d_volatile" = X"$define"; then
16245 typedef $nvtype NV;
16252 while(count < 256) {
16253 $volatile NV up = value + 1.0;
16254 $volatile NV negated = -value;
16255 $volatile NV down = negated - 1.0;
16256 $volatile NV got_up = up - value;
16257 int up_good = got_up == 1.0;
16258 int got_down = down - negated;
16259 int down_good = got_down == -1.0;
16261 if (down_good != up_good) {
16263 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
16264 up_good, (double) got_up, down_good, (double) got_down,
16265 count, (double) value);
16272 fputs("256.0", stdout);
16275 fputs("2.0", stdout);
16281 fputs("*", stdout);
16287 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
16288 count, (double) value);
16294 nv_overflows_integers_at='0'
16295 if eval $compile; then
16301 The largest integer your NVs can preserve is equal to $xxx
16303 nv_overflows_integers_at="$xxx"
16306 Cannot determine the largest integer value your NVs can hold, unexpected output
16313 Cannot determine the largest integer value your NVs can hold
16320 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
16321 : volatile so that the compiler has to store it out to memory.
16322 if test X"$d_volatile" = X"$define"; then
16327 #$i_stdlib I_STDLIB
16329 #include <stdlib.h>
16331 #$i_string I_STRING
16333 # include <string.h>
16335 # include <strings.h>
16337 #include <sys/types.h>
16338 #include <signal.h>
16340 $volatile int bletched = 0;
16341 $signal_t blech(int s) { bletched = 1; }
16344 int checkit($nvtype d, char *where) {
16345 unsigned char *p = (char *)&d;
16346 unsigned char *end = p + sizeof(d);
16356 printf("No - %s: 0x", where);
16358 printf ("%02X", *p++);
16363 int main(int argc, char **argv) {
16366 fail += checkit(d, "0.0");
16368 /* The compiler shouldn't be assuming that bletched is 0 */
16371 fail += checkit(d, "bleched");
16374 signal(SIGFPE, blech);
16377 /* Paranoia - the compiler should have no way of knowing that ANSI says
16378 that argv[argc] will always be NULL. Actually, if it did assume this it
16379 would be buggy, as this is C and main() can be called from elsewhere in
16381 d = argv[argc] ? 1 : 0;
16384 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16387 fail += checkit(d, "ternary");
16389 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16392 printf("No - memset doesn't give 0.0\n");
16393 /* This might just blow up: */
16394 printf("(gives %g)\n", d);
16400 printf("No - something bleched\n");
16405 printf("No - %d fail(s)\n", fail);
16414 d_nv_zero_is_allbits_zero="$undef"
16415 if eval $compile; then
16421 0.0 is represented as all bits zero in memory
16423 d_nv_zero_is_allbits_zero="$define"
16426 0.0 is not represented as all bits zero in memory
16428 d_nv_zero_is_allbits_zero="$undef"
16433 0.0 is not represented as all bits zero in memory
16435 d_nv_zero_is_allbits_zero="$undef"
16441 : check for off64_t
16443 echo "Checking to see if you have off64_t..." >&4
16445 #include <sys/types.h>
16446 #include <unistd.h>
16447 int main() { off64_t x = 7; }
16450 if eval $compile; then
16452 echo "You have off64_t."
16455 echo "You do not have off64_t."
16456 case "$lseeksize" in
16457 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16464 : how to create joinable pthreads
16465 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16467 echo "Checking what constant to use for creating joinable pthreads..." >&4
16468 $cat >try.c <<'EOCP'
16469 #include <pthread.h>
16471 int detachstate = JOINABLE;
16474 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16475 if eval $compile; then
16476 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16477 val="$undef" # Yes, undef.
16478 set d_old_pthread_create_joinable
16481 set old_pthread_create_joinable
16484 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16485 if eval $compile; then
16486 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16488 set d_old_pthread_create_joinable
16490 val=PTHREAD_CREATE_UNDETACHED
16491 set old_pthread_create_joinable
16494 set try -DJOINABLE=__UNDETACHED
16495 if eval $compile; then
16496 echo "You seem to use __UNDETACHED." >&4
16498 set d_old_pthread_create_joinable
16501 set old_pthread_create_joinable
16504 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16506 set d_old_pthread_create_joinable
16509 set old_pthread_create_joinable
16516 d_old_pthread_create_joinable="$undef"
16517 old_pthread_create_joinable=""
16520 : see if pause exists
16524 : see if poll exists
16528 : see if prctl exists
16532 : see if prctl supports PR_SET_NAME
16533 d_prctl_set_name=$undef
16537 #include <sys/prctl.h>
16539 int main (int argc, char *argv[])
16541 return (prctl (PR_SET_NAME, "Test"));
16545 if eval $compile_ok && $run ./try; then
16546 echo "Your prctl (PR_SET_NAME, ...) works"
16547 d_prctl_set_name=$define
16553 : see if readlink exists
16554 set readlink d_readlink
16557 : Check if exe is symlink to abs path of executing program
16561 case "$d_readlink" in
16563 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
16564 : more tidy to avoid an extra level of symlink
16565 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16566 while test $# -gt 0; do
16569 if $issymlink $try; then
16570 $ls -l $try > reflect
16571 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16572 echo "You have $type-like $try."
16573 procselfexe='"'$try'"'
16575 : This will break out of the loop
16586 : backward compatibility for d_hvfork
16587 if test X$d_hvfork != X; then
16588 d_vfork="$d_hvfork"
16591 : see if there is a vfork
16596 d_pseudofork=$undef
16598 : Ok, but do we want to use it. vfork is reportedly unreliable in
16599 : perl on Solaris 2.x, and probably elsewhere.
16603 case "$usevfork" in
16609 Perl can only use a vfork() that doesn't suffer from strict
16610 restrictions on calling functions or modifying global data in
16611 the child. For example, glibc-2.1 contains such a vfork()
16612 that is unsuitable. If your system provides a proper fork()
16613 call, chances are that you do NOT want perl to use vfork().
16616 rp="Do you still want to use vfork()?"
16621 echo "Ok, we won't use vfork()."
16630 $define) usevfork='true';;
16631 *) usevfork='false';;
16634 : see whether the pthread_atfork exists
16636 #include <pthread.h>
16639 #ifdef PTHREAD_ATFORK
16640 pthread_atfork(NULL,NULL,NULL);
16645 : see if pthread_atfork exists
16646 set try -DPTHREAD_ATFORK
16647 if eval $compile; then
16652 case "$usethreads" in
16655 $define) echo 'pthread_atfork found.' >&4 ;;
16656 *) echo 'pthread_atfork NOT found.' >&4 ;;
16659 set d_pthread_atfork
16662 : see if pthread_attr_setscope exists
16663 set pthread_attr_setscope d_pthread_attr_setscope
16666 : see whether the various POSIXish _yields exist
16668 #include <pthread.h>
16674 #ifdef PTHREAD_YIELD
16677 #ifdef PTHREAD_YIELD_NULL
16678 pthread_yield(NULL);
16684 : see if sched_yield exists
16685 set try -DSCHED_YIELD
16686 if eval $compile; then
16688 sched_yield='sched_yield()'
16692 case "$usethreads" in
16695 $define) echo 'sched_yield() found.' >&4 ;;
16696 *) echo 'sched_yield() NOT found.' >&4 ;;
16702 : see if pthread_yield exists
16703 set try -DPTHREAD_YIELD
16704 if eval $compile; then
16706 case "$sched_yield" in
16707 '') sched_yield='pthread_yield()' ;;
16710 set try -DPTHREAD_YIELD_NULL
16711 if eval $compile; then
16713 case "$sched_yield" in
16714 '') sched_yield='pthread_yield(NULL)' ;;
16720 case "$usethreads" in
16723 $define) echo 'pthread_yield() found.' >&4 ;;
16724 *) echo 'pthread_yield() NOT found.' >&4 ;;
16728 set d_pthread_yield
16730 case "$sched_yield" in
16731 '') sched_yield=undef ;;
16735 : check for ptrdiff_t
16737 echo "Checking to see if you have ptrdiff_t..." >&4
16739 #include <stddef.h>
16740 int main() { ptrdiff_t x = 7; }
16743 if eval $compile; then
16745 echo "You have ptrdiff_t."
16748 echo "You do not have ptrdiff_t."
16754 : see if random_r exists
16755 set random_r d_random_r
16757 case "$d_random_r" in
16759 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16760 case "$d_random_r_proto:$usethreads" in
16761 ":define") d_random_r_proto=define
16762 set d_random_r_proto random_r $hdrs
16766 case "$d_random_r_proto" in
16768 case "$random_r_proto" in
16769 ''|0) try='int random_r(int*, struct random_data*);'
16770 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16772 case "$random_r_proto" in
16773 ''|0) try='int random_r(long*, struct random_data*);'
16774 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16776 case "$random_r_proto" in
16777 ''|0) try='int random_r(struct random_data*, int32_t*);'
16778 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16780 case "$random_r_proto" in
16781 ''|0) d_random_r=undef
16783 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16784 * ) case "$random_r_proto" in
16785 REENTRANT_PROTO*) ;;
16786 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16788 echo "Prototype: $try" ;;
16791 *) case "$usethreads" in
16792 define) echo "random_r has no prototype, not using it." >&4 ;;
16799 *) random_r_proto=0
16803 : see if readdir and friends exist
16804 set readdir d_readdir
16806 set seekdir d_seekdir
16808 set telldir d_telldir
16810 set rewinddir d_rewinddir
16813 : see if readdir64_r exists
16814 set readdir64_r d_readdir64_r
16816 case "$d_readdir64_r" in
16818 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16819 case "$d_readdir64_r_proto:$usethreads" in
16820 ":define") d_readdir64_r_proto=define
16821 set d_readdir64_r_proto readdir64_r $hdrs
16825 case "$d_readdir64_r_proto" in
16827 case "$readdir64_r_proto" in
16828 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16829 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16831 case "$readdir64_r_proto" in
16832 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16833 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16835 case "$readdir64_r_proto" in
16836 ''|0) d_readdir64_r=undef
16837 readdir64_r_proto=0
16838 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16839 * ) case "$readdir64_r_proto" in
16840 REENTRANT_PROTO*) ;;
16841 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16843 echo "Prototype: $try" ;;
16846 *) case "$usethreads" in
16847 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16849 d_readdir64_r=undef
16850 readdir64_r_proto=0
16854 *) readdir64_r_proto=0
16858 : see if readdir_r exists
16859 set readdir_r d_readdir_r
16861 case "$d_readdir_r" in
16863 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16864 case "$d_readdir_r_proto:$usethreads" in
16865 ":define") d_readdir_r_proto=define
16866 set d_readdir_r_proto readdir_r $hdrs
16870 case "$d_readdir_r_proto" in
16872 case "$readdir_r_proto" in
16873 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16874 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16876 case "$readdir_r_proto" in
16877 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16878 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16880 case "$readdir_r_proto" in
16881 ''|0) d_readdir_r=undef
16883 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16884 * ) case "$readdir_r_proto" in
16885 REENTRANT_PROTO*) ;;
16886 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16888 echo "Prototype: $try" ;;
16891 *) case "$usethreads" in
16892 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16899 *) readdir_r_proto=0
16903 : see if readv exists
16907 : see if recvmsg exists
16908 set recvmsg d_recvmsg
16911 : see if rename exists
16912 set rename d_rename
16915 : see if rmdir exists
16919 : see if memory.h is available.
16924 : See if it conflicts with string.h
16930 $cppstdin $cppflags $cppminus < $strings > mem.h
16931 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16933 echo "We won't be including <memory.h>."
16943 : can bcopy handle overlapping blocks?
16946 case "$d_memmove" in
16947 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16948 *) case "$d_bcopy" in
16950 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16952 #$i_memory I_MEMORY
16953 #$i_stdlib I_STDLIB
16954 #$i_string I_STRING
16955 #$i_unistd I_UNISTD
16957 $cat >>try.c <<'EOCP'
16960 # include <memory.h>
16963 # include <stdlib.h>
16966 # include <string.h>
16968 # include <strings.h>
16971 # include <unistd.h> /* Needed for NetBSD */
16975 char buf[128], abc[128];
16981 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16982 try to store the string in read-only memory. */
16983 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16985 for (align = 7; align >= 0; align--) {
16986 for (len = 36; len; len--) {
16988 bcopy(abc, b, len);
16989 for (off = 1; off <= len; off++) {
16990 bcopy(b, b+off, len);
16991 bcopy(b+off, b, len);
16992 if (bcmp(b, abc, len))
17001 if eval $compile_ok; then
17002 if $run ./try 2>/dev/null; then
17003 echo "Yes, it can."
17006 echo "It can't, sorry."
17009 echo "(I can't compile the test program, so we'll assume not...)"
17019 : can memcpy handle overlapping blocks?
17022 case "$d_memmove" in
17023 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
17024 *) case "$d_memcpy" in
17026 echo "Checking to see if memcpy() can do overlapping copies..." >&4
17028 #$i_memory I_MEMORY
17029 #$i_stdlib I_STDLIB
17030 #$i_string I_STRING
17031 #$i_unistd I_UNISTD
17033 $cat >>try.c <<'EOCP'
17036 # include <memory.h>
17039 # include <stdlib.h>
17042 # include <string.h>
17044 # include <strings.h>
17047 # include <unistd.h> /* Needed for NetBSD */
17051 char buf[128], abc[128];
17057 /* Copy "abcde..." string to char abc[] so that gcc doesn't
17058 try to store the string in read-only memory. */
17059 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
17061 for (align = 7; align >= 0; align--) {
17062 for (len = 36; len; len--) {
17064 memcpy(b, abc, len);
17065 for (off = 1; off <= len; off++) {
17066 memcpy(b+off, b, len);
17067 memcpy(b, b+off, len);
17068 if (memcmp(b, abc, len))
17077 if eval $compile_ok; then
17078 if $run ./try 2>/dev/null; then
17079 echo "Yes, it can."
17082 echo "It can't, sorry."
17085 echo "(I can't compile the test program, so we'll assume not...)"
17095 : can memcmp be trusted to compare relative magnitude?
17097 case "$d_memcmp" in
17100 echo "Checking if your memcmp() can compare relative magnitude..." >&4
17102 #$i_memory I_MEMORY
17103 #$i_stdlib I_STDLIB
17104 #$i_string I_STRING
17105 #$i_unistd I_UNISTD
17107 $cat >>try.c <<'EOCP'
17110 # include <memory.h>
17113 # include <stdlib.h>
17116 # include <string.h>
17118 # include <strings.h>
17121 # include <unistd.h> /* Needed for NetBSD */
17127 if ((a < b) && memcmp(&a, &b, 1) < 0)
17133 if eval $compile_ok; then
17134 if $run ./try 2>/dev/null; then
17135 echo "Yes, it can."
17138 echo "No, it can't (it uses signed chars)."
17141 echo "(I can't compile the test program, so we'll assume not...)"
17149 : see if prototype for sbrk is available
17151 set d_sbrkproto sbrk $i_unistd unistd.h
17154 : see if select exists
17155 set select d_select
17158 : see if semctl exists
17159 set semctl d_semctl
17162 : see if semget exists
17163 set semget d_semget
17166 : see if semop exists
17170 : see how much of the 'sem*(2)' library is present.
17173 case "$d_semctl$d_semget$d_semop" in
17174 *"$undef"*) h_sem=false;;
17178 case "`ipcs 2>&1`" in
17179 "SVID messages"*"not configured"*)
17180 echo "Your $osname does not have the sem*(2) configured." >&4
17183 set semctl d_semctl
17185 set semget d_semget
17193 : we could also check for sys/ipc.h ...
17194 if $h_sem && $test `./findhdr sys/sem.h`; then
17195 echo "You have the full sem*(2) library." >&4
17198 echo "You don't have the full sem*(2) library." >&4
17204 : see whether sys/sem.h defines union semun
17206 $cat > try.c <<'END'
17207 #include <sys/types.h>
17208 #include <sys/ipc.h>
17209 #include <sys/sem.h>
17210 int main () { union semun semun; semun.buf = 0; }
17213 if eval $compile; then
17214 echo "You have union semun in <sys/sem.h>." >&4
17217 echo "You do not have union semun in <sys/sem.h>." >&4
17224 : see how to do semctl IPC_STAT
17228 $cat > tryh.h <<END
17231 # define S_IRUSR S_IREAD
17232 # define S_IWUSR S_IWRITE
17233 # define S_IXUSR S_IEXEC
17235 # define S_IRUSR 0400
17236 # define S_IWUSR 0200
17237 # define S_IXUSR 0100
17239 # define S_IRGRP (S_IRUSR>>3)
17240 # define S_IWGRP (S_IWUSR>>3)
17241 # define S_IXGRP (S_IXUSR>>3)
17242 # define S_IROTH (S_IRUSR>>6)
17243 # define S_IWOTH (S_IWUSR>>6)
17244 # define S_IXOTH (S_IXUSR>>6)
17247 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
17248 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
17249 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
17252 : see whether semctl IPC_STAT can use union semun
17253 case "$d_semctl_semun" in
17257 #include <sys/types.h>
17258 #include <sys/ipc.h>
17259 #include <sys/sem.h>
17260 #include <sys/stat.h>
17267 #$d_union_semun HAS_UNION_SEMUN
17270 #ifndef HAS_UNION_SEMUN
17273 struct semid_ds *buf;
17274 unsigned short *array;
17280 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17281 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17283 struct semid_ds argbuf;
17286 st = semctl(sem, 0, IPC_STAT, arg);
17290 # endif /* IPC_STAT */
17291 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17293 if (semctl(sem, 0, IPC_RMID, arg) != 0)
17294 # endif /* IPC_RMID */
17295 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17297 #endif /* IPC_PRIVATE && ... */
17298 printf("semget failed: errno = %d\n", errno);
17303 if eval $compile; then
17306 semun) val="$define" ;;
17314 case "$d_semctl_semun" in
17316 echo "You can use union semun for semctl IPC_STAT." >&4
17319 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
17324 : see whether semctl IPC_STAT can use struct semid_ds pointer
17325 case "$d_semctl_semid_ds" in
17328 $cat > try.c <<'END'
17329 #include <sys/types.h>
17330 #include <sys/ipc.h>
17331 #include <sys/sem.h>
17332 #include <sys/stat.h>
17340 struct semid_ds arg;
17343 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
17344 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
17347 st = semctl(sem, 0, IPC_STAT, &arg);
17349 printf("semid_ds\n");
17351 # endif /* IPC_STAT */
17352 printf("semctl IPC_STAT failed: errno = %d\n", errno);
17354 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
17355 # endif /* IPC_RMID */
17356 printf("semctl IPC_RMID failed: errno = %d\n", errno);
17358 #endif /* IPC_PRIVATE && ... */
17359 printf("semget failed: errno = %d\n", errno);
17365 if eval $compile; then
17368 semid_ds) val="$define" ;;
17372 set d_semctl_semid_ds
17376 case "$d_semctl_semid_ds" in
17378 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
17380 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17386 # We do not have the full sem*(2) library, so assume we can not
17392 set d_semctl_semid_ds
17398 : see if sendmsg exists
17399 set sendmsg d_sendmsg
17402 : see if setegid exists
17403 set setegid d_setegid
17406 : see if seteuid exists
17407 set seteuid d_seteuid
17410 : see if setgrent exists
17411 set setgrent d_setgrent
17414 : see if setgrent_r exists
17415 set setgrent_r d_setgrent_r
17417 case "$d_setgrent_r" in
17419 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17420 case "$d_setgrent_r_proto:$usethreads" in
17421 ":define") d_setgrent_r_proto=define
17422 set d_setgrent_r_proto setgrent_r $hdrs
17426 case "$d_setgrent_r_proto" in
17428 case "$setgrent_r_proto" in
17429 ''|0) try='int setgrent_r(FILE**);'
17430 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17432 case "$setgrent_r_proto" in
17433 ''|0) try='void setgrent_r(FILE**);'
17434 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17436 case "$setgrent_r_proto" in
17437 ''|0) d_setgrent_r=undef
17439 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17440 * ) case "$setgrent_r_proto" in
17441 REENTRANT_PROTO*) ;;
17442 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17444 echo "Prototype: $try" ;;
17447 *) case "$usethreads" in
17448 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17455 *) setgrent_r_proto=0
17459 : see if sethostent exists
17460 set sethostent d_sethent
17463 : see if sethostent_r exists
17464 set sethostent_r d_sethostent_r
17466 case "$d_sethostent_r" in
17468 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17469 case "$d_sethostent_r_proto:$usethreads" in
17470 ":define") d_sethostent_r_proto=define
17471 set d_sethostent_r_proto sethostent_r $hdrs
17475 case "$d_sethostent_r_proto" in
17477 case "$sethostent_r_proto" in
17478 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17479 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17481 case "$sethostent_r_proto" in
17482 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17483 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17485 case "$sethostent_r_proto" in
17486 ''|0) d_sethostent_r=undef
17487 sethostent_r_proto=0
17488 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17489 * ) case "$sethostent_r_proto" in
17490 REENTRANT_PROTO*) ;;
17491 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17493 echo "Prototype: $try" ;;
17496 *) case "$usethreads" in
17497 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17499 d_sethostent_r=undef
17500 sethostent_r_proto=0
17504 *) sethostent_r_proto=0
17508 : see if setitimer exists
17509 set setitimer d_setitimer
17512 : see if setlinebuf exists
17513 set setlinebuf d_setlinebuf
17516 : see if setlocale exists
17517 set setlocale d_setlocale
17520 : see if locale.h is available
17521 set locale.h i_locale
17524 : see if setlocale_r exists
17525 set setlocale_r d_setlocale_r
17527 case "$d_setlocale_r" in
17529 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17530 case "$d_setlocale_r_proto:$usethreads" in
17531 ":define") d_setlocale_r_proto=define
17532 set d_setlocale_r_proto setlocale_r $hdrs
17536 case "$d_setlocale_r_proto" in
17538 case "$setlocale_r_proto" in
17539 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17540 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17542 case "$setlocale_r_proto" in
17543 ''|0) d_setlocale_r=undef
17544 setlocale_r_proto=0
17545 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17546 * ) case "$setlocale_r_proto" in
17547 REENTRANT_PROTO*) ;;
17548 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17550 echo "Prototype: $try" ;;
17553 *) case "$usethreads" in
17554 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17556 d_setlocale_r=undef
17557 setlocale_r_proto=0
17561 *) setlocale_r_proto=0
17565 : see if setnetent exists
17566 set setnetent d_setnent
17569 : see if setnetent_r exists
17570 set setnetent_r d_setnetent_r
17572 case "$d_setnetent_r" in
17574 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17575 case "$d_setnetent_r_proto:$usethreads" in
17576 ":define") d_setnetent_r_proto=define
17577 set d_setnetent_r_proto setnetent_r $hdrs
17581 case "$d_setnetent_r_proto" in
17583 case "$setnetent_r_proto" in
17584 ''|0) try='int setnetent_r(int, struct netent_data*);'
17585 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17587 case "$setnetent_r_proto" in
17588 ''|0) try='void setnetent_r(int, struct netent_data*);'
17589 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17591 case "$setnetent_r_proto" in
17592 ''|0) d_setnetent_r=undef
17593 setnetent_r_proto=0
17594 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17595 * ) case "$setnetent_r_proto" in
17596 REENTRANT_PROTO*) ;;
17597 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17599 echo "Prototype: $try" ;;
17602 *) case "$usethreads" in
17603 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17605 d_setnetent_r=undef
17606 setnetent_r_proto=0
17610 *) setnetent_r_proto=0
17614 : see if setprotoent exists
17615 set setprotoent d_setpent
17618 : see if setpgid exists
17619 set setpgid d_setpgid
17622 : see if setpgrp2 exists
17623 set setpgrp2 d_setpgrp2
17626 : see if setpriority exists
17627 set setpriority d_setprior
17630 : see if setproctitle exists
17631 set setproctitle d_setproctitle
17634 : see if setprotoent_r exists
17635 set setprotoent_r d_setprotoent_r
17637 case "$d_setprotoent_r" in
17639 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17640 case "$d_setprotoent_r_proto:$usethreads" in
17641 ":define") d_setprotoent_r_proto=define
17642 set d_setprotoent_r_proto setprotoent_r $hdrs
17646 case "$d_setprotoent_r_proto" in
17648 case "$setprotoent_r_proto" in
17649 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17650 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17652 case "$setprotoent_r_proto" in
17653 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17654 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17656 case "$setprotoent_r_proto" in
17657 ''|0) d_setprotoent_r=undef
17658 setprotoent_r_proto=0
17659 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17660 * ) case "$setprotoent_r_proto" in
17661 REENTRANT_PROTO*) ;;
17662 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17664 echo "Prototype: $try" ;;
17667 *) case "$usethreads" in
17668 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17670 d_setprotoent_r=undef
17671 setprotoent_r_proto=0
17675 *) setprotoent_r_proto=0
17679 : see if setpwent exists
17680 set setpwent d_setpwent
17683 : see if setpwent_r exists
17684 set setpwent_r d_setpwent_r
17686 case "$d_setpwent_r" in
17688 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17689 case "$d_setpwent_r_proto:$usethreads" in
17690 ":define") d_setpwent_r_proto=define
17691 set d_setpwent_r_proto setpwent_r $hdrs
17695 case "$d_setpwent_r_proto" in
17697 case "$setpwent_r_proto" in
17698 ''|0) try='int setpwent_r(FILE**);'
17699 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17701 case "$setpwent_r_proto" in
17702 ''|0) try='void setpwent_r(FILE**);'
17703 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17705 case "$setpwent_r_proto" in
17706 ''|0) d_setpwent_r=undef
17708 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17709 * ) case "$setpwent_r_proto" in
17710 REENTRANT_PROTO*) ;;
17711 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17713 echo "Prototype: $try" ;;
17716 *) case "$usethreads" in
17717 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17724 *) setpwent_r_proto=0
17728 : see if setregid exists
17729 set setregid d_setregid
17731 set setresgid d_setresgid
17734 : see if setreuid exists
17735 set setreuid d_setreuid
17737 set setresuid d_setresuid
17740 : see if setrgid exists
17741 set setrgid d_setrgid
17744 : see if setruid exists
17745 set setruid d_setruid
17748 : see if setservent exists
17749 set setservent d_setsent
17752 : see if setservent_r exists
17753 set setservent_r d_setservent_r
17755 case "$d_setservent_r" in
17757 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17758 case "$d_setservent_r_proto:$usethreads" in
17759 ":define") d_setservent_r_proto=define
17760 set d_setservent_r_proto setservent_r $hdrs
17764 case "$d_setservent_r_proto" in
17766 case "$setservent_r_proto" in
17767 ''|0) try='int setservent_r(int, struct servent_data*);'
17768 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17770 case "$setservent_r_proto" in
17771 ''|0) try='void setservent_r(int, struct servent_data*);'
17772 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17774 case "$setservent_r_proto" in
17775 ''|0) d_setservent_r=undef
17776 setservent_r_proto=0
17777 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17778 * ) case "$setservent_r_proto" in
17779 REENTRANT_PROTO*) ;;
17780 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17782 echo "Prototype: $try" ;;
17785 *) case "$usethreads" in
17786 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17788 d_setservent_r=undef
17789 setservent_r_proto=0
17793 *) setservent_r_proto=0
17797 : see if setsid exists
17798 set setsid d_setsid
17801 : see if setvbuf exists
17802 set setvbuf d_setvbuf
17805 : see if shmctl exists
17806 set shmctl d_shmctl
17809 : see if shmget exists
17810 set shmget d_shmget
17813 : see if shmat exists
17816 : see what shmat returns
17819 $cat >shmat.c <<'END'
17820 #include <sys/shm.h>
17823 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17828 echo "and it returns ($shmattype)." >&4
17829 : see if a prototype for shmat is available
17830 xxx=`./findhdr sys/shm.h`
17831 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17832 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17843 set d_shmatprototype
17846 : see if shmdt exists
17850 : see how much of the 'shm*(2)' library is present.
17853 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17854 *"$undef"*) h_shm=false;;
17858 case "`ipcs 2>&1`" in
17859 "SVID shared memory"*"not configured"*)
17860 echo "Your $osname does not have the shm*(2) configured." >&4
17863 set shmctl d_shmctl
17865 set shmget d_shmget
17875 : we could also check for sys/ipc.h ...
17876 if $h_shm && $test `./findhdr sys/shm.h`; then
17877 echo "You have the full shm*(2) library." >&4
17880 echo "You don't have the full shm*(2) library." >&4
17886 : see if we have sigaction
17888 if set sigaction val -f d_sigaction; eval $csym; $val; then
17889 echo 'sigaction() found.' >&4
17892 #include <sys/types.h>
17893 #include <signal.h>
17894 #$i_stdlib I_STDLIB
17896 #include <stdlib.h>
17900 struct sigaction act, oact;
17902 oact.sa_handler = 0;
17903 /* so that act and oact are used */
17904 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17908 if eval $compile_ok; then
17911 echo "But you don't seem to have a usable struct sigaction." >&4
17915 echo 'sigaction NOT found.' >&4
17918 set d_sigaction; eval $setvar
17921 : see if this is a sunmath.h system
17922 set sunmath.h i_sunmath
17925 : see if signbit exists
17926 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17929 #$i_sunmath I_SUNMATH
17933 #ifdef I_SUNMATH /* Solaris special math library */
17934 # include <sunmath.h>
17937 int main(int argc, char **argv)
17941 if ((signbit(x) == 0) && (signbit(y) != 0))
17949 if eval $compile; then
17950 if $run ./try; then
17954 $echo "Signbit seems to be available, but doesn't work as I expected."
17955 $echo "I won't use it." >&4
17966 : see if sigprocmask exists
17967 set sigprocmask d_sigprocmask
17970 : see if sigsetjmp exists
17972 case "$d_sigsetjmp" in
17975 #include <setjmp.h>
17976 #$i_stdlib I_STDLIB
17978 #include <stdlib.h>
17984 if (sigsetjmp(env,1))
17987 siglongjmp(env, 1);
17992 if eval $compile; then
17993 if $run ./try >/dev/null 2>&1; then
17994 echo "POSIX sigsetjmp found." >&4
17998 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
18004 echo "sigsetjmp not found." >&4
18008 *) val="$d_sigsetjmp"
18009 case "$d_sigsetjmp" in
18010 $define) echo "POSIX sigsetjmp found." >&4;;
18011 $undef) echo "sigsetjmp not found." >&4;;
18019 : see if snprintf exists
18020 set snprintf d_snprintf
18023 : see if vsnprintf exists
18024 set vsnprintf d_vsnprintf
18027 case "$d_snprintf-$d_vsnprintf" in
18030 Checking whether your snprintf() and vsnprintf() work okay...
18032 $cat >try.c <<'EOCP'
18033 /* v?snprintf testing logic courtesy of Russ Allbery.
18034 * According to C99:
18035 * - if the buffer is too short it still must be \0-terminated
18036 * - if the buffer is too short the potentially required length
18037 * must be returned and not -1
18038 * - if the buffer is NULL the potentially required length
18039 * must be returned and not -1 or core dump
18042 #include <stdarg.h>
18046 int test (char *format, ...)
18051 va_start (args, format);
18052 count = vsnprintf (buf, sizeof buf, format, args);
18059 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
18060 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
18064 if eval $compile; then
18067 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
18069 Your snprintf() and snprintf() don't seem to be working okay.
18071 d_snprintf="$undef"
18072 d_vsnprintf="$undef"
18076 echo "(I can't seem to compile the test program--assuming they don't)"
18077 d_snprintf="$undef"
18078 d_vsnprintf="$undef"
18084 : see if sockatmark exists
18085 set sockatmark d_sockatmark
18088 : see if prototype for sockatmark is available
18090 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
18093 : see if socks5_init exists
18094 set socks5_init d_socks5_init
18097 : see if sprintf returns the length of the string in the buffer as per ANSI
18098 $echo "Checking whether sprintf returns the length of the string..." >&4
18101 #$i_stdlib I_STDLIB
18103 #include <stdlib.h>
18105 #$i_string I_STRING
18107 # include <string.h>
18109 # include <strings.h>
18118 int check (size_t expect, int test) {
18119 size_t got = strlen(buffer);
18123 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
18128 int main(int argc, char **argv) {
18131 check(sprintf(buffer, ""), ++test);
18132 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
18133 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
18140 if eval $compile; then
18144 sprintf returns the length of the string (as ANSI says it should)
18146 d_sprintf_returns_strlen="$define"
18149 sprintf does not return the length of the string (how old is this system?)
18151 d_sprintf_returns_strlen="$undef"
18155 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
18156 d_sprintf_returns_strlen="$undef"
18160 : see if srand48_r exists
18161 set srand48_r d_srand48_r
18163 case "$d_srand48_r" in
18165 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18166 case "$d_srand48_r_proto:$usethreads" in
18167 ":define") d_srand48_r_proto=define
18168 set d_srand48_r_proto srand48_r $hdrs
18172 case "$d_srand48_r_proto" in
18174 case "$srand48_r_proto" in
18175 ''|0) try='int srand48_r(long, struct drand48_data*);'
18176 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
18178 case "$srand48_r_proto" in
18179 ''|0) d_srand48_r=undef
18181 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
18182 * ) case "$srand48_r_proto" in
18183 REENTRANT_PROTO*) ;;
18184 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
18186 echo "Prototype: $try" ;;
18189 *) case "$usethreads" in
18190 define) echo "srand48_r has no prototype, not using it." >&4 ;;
18197 *) srand48_r_proto=0
18201 : see if srandom_r exists
18202 set srandom_r d_srandom_r
18204 case "$d_srandom_r" in
18206 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
18207 case "$d_srandom_r_proto:$usethreads" in
18208 ":define") d_srandom_r_proto=define
18209 set d_srandom_r_proto srandom_r $hdrs
18213 case "$d_srandom_r_proto" in
18215 case "$srandom_r_proto" in
18216 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
18217 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
18219 case "$srandom_r_proto" in
18220 ''|0) d_srandom_r=undef
18222 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
18223 * ) case "$srandom_r_proto" in
18224 REENTRANT_PROTO*) ;;
18225 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
18227 echo "Prototype: $try" ;;
18230 *) case "$usethreads" in
18231 define) echo "srandom_r has no prototype, not using it." >&4 ;;
18238 *) srandom_r_proto=0
18242 : see if prototype for setresgid is available
18244 set d_sresgproto setresgid $i_unistd unistd.h
18247 : see if prototype for setresuid is available
18249 set d_sresuproto setresuid $i_unistd unistd.h
18252 : see if sys/stat.h is available
18253 set sys/stat.h i_sysstat
18256 : see if stat knows about block sizes
18258 echo "Checking to see if your struct stat has st_blocks field..." >&4
18259 set d_statblks stat st_blocks $i_sysstat sys/stat.h
18262 : see if this is a sys/vfs.h system
18263 set sys/vfs.h i_sysvfs
18266 : see if this is a sys/statfs.h system
18267 set sys/statfs.h i_sysstatfs
18270 : Check for statfs_s
18272 echo "Checking to see if your system supports struct statfs..." >&4
18273 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
18275 case "$d_statfs_s" in
18276 "$define") echo "Yes, it does." ;;
18277 *) echo "No, it doesn't." ;;
18281 : see if struct statfs knows about f_flags
18282 case "$d_statfs_s" in
18285 echo "Checking to see if your struct statfs has f_flags field..." >&4
18286 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
18290 set d_statfs_f_flags
18294 case "$d_statfs_f_flags" in
18295 "$define") echo "Yes, it does." ;;
18296 *) echo "No, it doesn't." ;;
18299 : see what flavor, if any, of static inline is supported
18301 echo "Checking to see if your system supports static inline..."
18302 $cat > try.c <<'EOCP'
18303 #include <stdlib.h>
18304 extern int f_via_a(int x);
18305 extern int f_via_b(int x);
18306 int main(int argc, char **argv)
18315 return EXIT_SUCCESS;
18318 return EXIT_FAILURE;
18322 $cat > a.c <<'EOCP'
18323 static INLINE int f(int x) {
18334 $cat > b.c <<'EOCP'
18335 extern int f(int x);
18343 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18344 case "$perl_static_inline" in
18345 '') # Check the various possibilities, and break out on success.
18346 # For gcc, prefer __inline__, which will still permit
18347 # cflags.SH to add in -ansi.
18348 case "$gccversion" in
18349 '') xxx="inline __inline__ __inline _inline";;
18350 *) xxx="__inline__ inline __inline _inline";;
18352 for inline in $xxx; do
18353 set try -DINLINE=$inline a.c
18354 if eval $compile && $run ./try; then
18355 # Now make sure there is no external linkage of static
18357 set try -DINLINE=$inline -DUSE_B a.c b.c
18358 if eval $compile && $run ./try; then
18359 $echo "Your compiler supports static $inline, " >&4
18360 $echo "but it also creates an external definition," >&4
18361 $echo "so I won't use it." >&4
18364 $echo "Your compiler supports static $inline." >&4
18366 perl_static_inline="static $inline";
18370 $echo "Your compiler does NOT support static $inline." >&4
18375 *inline*) # Some variant of inline exists.
18376 echo "Keeping your $hint value of $perl_static_inline."
18379 static) # No inline capabilities
18380 echo "Keeping your $hint value of $perl_static_inline."
18383 *) # Unrecognized previous value -- blindly trust the supplied
18384 # value and hope it makes sense. Use old value for
18385 # d_static_inline, if there is one.
18386 echo "Keeping your $hint value of $perl_static_inline."
18387 case "$d_static_inline" in
18389 *) val=$d_static_inline ;;
18393 # Fallback to plain 'static' if nothing worked.
18394 case "$perl_static_inline" in
18396 perl_static_inline="static"
18400 set d_static_inline
18402 $rm -f a.[co] b.[co]
18405 : Check stream access
18407 Checking how to access stdio streams by file descriptor number...
18409 case "$stdio_stream_array" in
18410 '') $cat >try.c <<EOCP
18413 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18417 for s in _iob __iob __sF
18419 set try -DSTDIO_STREAM_ARRAY=$s
18420 if eval $compile; then
18421 case "`$run ./try`" in
18422 yes) stdio_stream_array=$s; break ;;
18428 case "$stdio_stream_array" in
18430 I can't figure out how to access stdio streams by file descriptor number.
18432 d_stdio_stream_array="$undef"
18435 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18437 d_stdio_stream_array="$define"
18441 : see if strcoll exists
18442 set strcoll d_strcoll
18445 : check for structure copying
18447 echo "Checking to see if your C compiler can copy structs..." >&4
18448 $cat >try.c <<'EOCP'
18458 if $cc -c try.c >/dev/null 2>&1 ; then
18460 echo "Yup, it can."
18463 echo "Nope, it can't."
18469 : see if strerror and/or sys_errlist[] exist
18471 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18472 if set strerror val -f d_strerror; eval $csym; $val; then
18473 echo 'strerror() found.' >&4
18474 d_strerror="$define"
18475 d_strerrm='strerror(e)'
18476 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18477 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18478 d_syserrlst="$define"
18480 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
18481 d_syserrlst="$undef"
18483 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18484 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18485 echo 'strerror() found in string header.' >&4
18486 d_strerror="$define"
18487 d_strerrm='strerror(e)'
18488 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18489 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18490 d_syserrlst="$define"
18492 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18493 d_syserrlst="$undef"
18495 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18496 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18497 d_strerror="$undef"
18498 d_syserrlst="$define"
18499 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18501 echo 'strerror() and sys_errlist[] NOT found.' >&4
18502 d_strerror="$undef"
18503 d_syserrlst="$undef"
18504 d_strerrm='"unknown"'
18508 : see if strerror_r exists
18509 set strerror_r d_strerror_r
18511 case "$d_strerror_r" in
18513 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18514 case "$d_strerror_r_proto:$usethreads" in
18515 ":define") d_strerror_r_proto=define
18516 set d_strerror_r_proto strerror_r $hdrs
18520 case "$d_strerror_r_proto" in
18522 case "$strerror_r_proto" in
18523 ''|0) try='int strerror_r(int, char*, size_t);'
18524 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18526 case "$strerror_r_proto" in
18527 ''|0) try='int strerror_r(int, char*, int);'
18528 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18530 case "$strerror_r_proto" in
18531 ''|0) try='char* strerror_r(int, char*, size_t);'
18532 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18534 case "$strerror_r_proto" in
18535 ''|0) d_strerror_r=undef
18537 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18538 * ) case "$strerror_r_proto" in
18539 REENTRANT_PROTO*) ;;
18540 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18542 echo "Prototype: $try" ;;
18545 *) case "$usethreads" in
18546 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18553 *) strerror_r_proto=0
18557 : see if strftime exists
18558 set strftime d_strftime
18561 : see if strlcat exists
18562 set strlcat d_strlcat
18565 : see if strlcpy exists
18566 set strlcpy d_strlcpy
18569 : see if strtod exists
18570 set strtod d_strtod
18573 : see if strtol exists
18574 set strtol d_strtol
18577 : see if strtold exists
18578 set strtold d_strtold
18581 : see if strtoll exists
18582 set strtoll d_strtoll
18585 case "$d_longlong-$d_strtoll" in
18588 Checking whether your strtoll() works okay...
18590 $cat >try.c <<'EOCP'
18593 #define strtoll __strtoll
18596 #define strtoll _strtoll
18599 extern long long int strtoll(char *s, char **, int);
18600 static int bad = 0;
18601 int check(char *s, long long ell, int een) {
18604 gll = strtoll(s, 0, 10);
18605 if (!((gll == ell) && (errno == een)))
18609 check(" 1", 1LL, 0);
18610 check(" 0", 0LL, 0);
18611 check("-1", -1LL, 0);
18612 check("-9223372036854775808", -9223372036854775808LL, 0);
18613 check("-9223372036854775808", -9223372036854775808LL, 0);
18614 check(" 9223372036854775807", 9223372036854775807LL, 0);
18615 check("-9223372036854775808", -9223372036854775808LL, 0);
18616 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18617 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18623 if eval $compile; then
18626 ok) echo "Your strtoll() seems to be working okay." ;;
18628 Your strtoll() doesn't seem to be working okay.
18634 echo "(I can't seem to compile the test program--assuming it doesn't)"
18640 : see if strtoq exists
18641 set strtoq d_strtoq
18644 : see if strtoul exists
18645 set strtoul d_strtoul
18648 case "$d_strtoul" in
18651 Checking whether your strtoul() works okay...
18653 $cat >try.c <<'EOCP'
18656 extern unsigned long int strtoul(char *s, char **, int);
18657 static int bad = 0;
18658 void check(char *s, unsigned long eul, int een) {
18661 gul = strtoul(s, 0, 10);
18662 if (!((gul == eul) && (errno == een)))
18666 check(" 1", 1L, 0);
18667 check(" 0", 0L, 0);
18669 case "$longsize" in
18671 $cat >>try.c <<'EOCP'
18672 check("18446744073709551615", 18446744073709551615UL, 0);
18673 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18674 #if 0 /* strtoul() for /^-/ strings is undefined. */
18675 check("-1", 18446744073709551615UL, 0);
18676 check("-18446744073709551614", 2, 0);
18677 check("-18446744073709551615", 1, 0);
18678 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18679 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18684 $cat >>try.c <<'EOCP'
18685 check("4294967295", 4294967295UL, 0);
18686 check("4294967296", 4294967295UL, ERANGE);
18687 #if 0 /* strtoul() for /^-/ strings is undefined. */
18688 check("-1", 4294967295UL, 0);
18689 check("-4294967294", 2, 0);
18690 check("-4294967295", 1, 0);
18691 check("-4294967296", 4294967295UL, ERANGE);
18692 check("-4294967297", 4294967295UL, ERANGE);
18697 : Should we write these tests to be more portable by sprintf-ing
18698 : ~0 and then manipulating that char string as input for strtol?
18701 $cat >>try.c <<'EOCP'
18708 if eval $compile; then
18709 case "`$run ./try`" in
18710 ok) echo "Your strtoul() seems to be working okay." ;;
18712 Your strtoul() doesn't seem to be working okay.
18718 echo "(I can't seem to compile the test program--assuming it doesn't)"
18724 : see if strtoull exists
18725 set strtoull d_strtoull
18728 case "$d_longlong-$d_strtoull" in
18731 Checking whether your strtoull() works okay...
18733 $cat >try.c <<'EOCP'
18736 #define strtoull __strtoull
18739 extern unsigned long long int strtoull(char *s, char **, int);
18740 static int bad = 0;
18741 int check(char *s, long long eull, int een) {
18744 gull = strtoull(s, 0, 10);
18745 if (!((gull == eull) && (errno == een)))
18749 check(" 1", 1LL, 0);
18750 check(" 0", 0LL, 0);
18751 check("18446744073709551615", 18446744073709551615ULL, 0);
18752 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18753 #if 0 /* strtoull() for /^-/ strings is undefined. */
18754 check("-1", 18446744073709551615ULL, 0);
18755 check("-18446744073709551614", 2LL, 0);
18756 check("-18446744073709551615", 1LL, 0);
18757 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18758 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18765 if eval $compile; then
18766 case "`$run ./try`" in
18767 ok) echo "Your strtoull() seems to be working okay." ;;
18769 Your strtoull() doesn't seem to be working okay.
18771 d_strtoull="$undef"
18775 echo "(I can't seem to compile the test program--assuming it doesn't)"
18776 d_strtoull="$undef"
18781 : see if strtouq exists
18782 set strtouq d_strtouq
18785 case "$d_strtouq" in
18788 Checking whether your strtouq() works okay...
18790 $cat >try.c <<'EOCP'
18793 extern unsigned long long int strtouq(char *s, char **, int);
18794 static int bad = 0;
18795 void check(char *s, unsigned long long eull, int een) {
18796 unsigned long long gull;
18798 gull = strtouq(s, 0, 10);
18799 if (!((gull == eull) && (errno == een)))
18803 check(" 1", 1LL, 0);
18804 check(" 0", 0LL, 0);
18805 check("18446744073709551615", 18446744073709551615ULL, 0);
18806 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18807 #if 0 /* strtouq() for /^-/ strings is undefined. */
18808 check("-1", 18446744073709551615ULL, 0);
18809 check("-18446744073709551614", 2LL, 0);
18810 check("-18446744073709551615", 1LL, 0);
18811 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18812 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18820 if eval $compile; then
18821 case "`$run ./try`" in
18822 ok) echo "Your strtouq() seems to be working okay." ;;
18824 Your strtouq() doesn't seem to be working okay.
18830 echo "(I can't seem to compile the test program--assuming it doesn't)"
18836 : see if strxfrm exists
18837 set strxfrm d_strxfrm
18840 : see if symlink exists
18841 set symlink d_symlink
18844 : see if syscall exists
18845 set syscall d_syscall
18848 : see if prototype for syscall is available
18850 set d_syscallproto syscall $i_unistd unistd.h
18853 : see if sysconf exists
18854 set sysconf d_sysconf
18857 : see if system exists
18858 set system d_system
18861 : see if tcgetpgrp exists
18862 set tcgetpgrp d_tcgetpgrp
18865 : see if tcsetpgrp exists
18866 set tcsetpgrp d_tcsetpgrp
18869 : see if prototype for telldir is available
18871 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18874 : see if time exists
18876 if test "X$d_time" = X -o X"$timetype" = X; then
18877 if set time val -f d_time; eval $csym; $val; then
18878 echo 'time() found.' >&4
18880 rp="What is the type returned by time() on this system?"
18881 set time_t timetype long stdio.h sys/types.h
18884 echo 'time() not found, hope that will do.' >&4
18892 : see if timegm exists
18893 set timegm d_timegm
18896 : see if this is a sys/times.h system
18897 set sys/times.h i_systimes
18900 : see if times exists
18902 if set times val -f d_times; eval $csym; $val; then
18903 echo 'times() found.' >&4
18906 case "$i_systimes" in
18907 "$define") inc='sys/times.h';;
18909 rp="What is the type returned by times() on this system?"
18910 set clock_t clocktype long stdio.h sys/types.h $inc
18913 echo 'times() NOT found, hope that will do.' >&4
18918 : see if tmpnam_r exists
18919 set tmpnam_r d_tmpnam_r
18921 case "$d_tmpnam_r" in
18923 hdrs="$i_systypes sys/types.h define stdio.h "
18924 case "$d_tmpnam_r_proto:$usethreads" in
18925 ":define") d_tmpnam_r_proto=define
18926 set d_tmpnam_r_proto tmpnam_r $hdrs
18930 case "$d_tmpnam_r_proto" in
18932 case "$tmpnam_r_proto" in
18933 ''|0) try='char* tmpnam_r(char*);'
18934 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18936 case "$tmpnam_r_proto" in
18937 ''|0) d_tmpnam_r=undef
18939 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18940 * ) case "$tmpnam_r_proto" in
18941 REENTRANT_PROTO*) ;;
18942 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18944 echo "Prototype: $try" ;;
18947 *) case "$usethreads" in
18948 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18955 *) tmpnam_r_proto=0
18959 : see if truncate exists
18960 set truncate d_truncate
18963 : see if ttyname_r exists
18964 set ttyname_r d_ttyname_r
18966 case "$d_ttyname_r" in
18968 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18969 case "$d_ttyname_r_proto:$usethreads" in
18970 ":define") d_ttyname_r_proto=define
18971 set d_ttyname_r_proto ttyname_r $hdrs
18975 case "$d_ttyname_r_proto" in
18977 case "$ttyname_r_proto" in
18978 ''|0) try='int ttyname_r(int, char*, size_t);'
18979 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18981 case "$ttyname_r_proto" in
18982 ''|0) try='int ttyname_r(int, char*, int);'
18983 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18985 case "$ttyname_r_proto" in
18986 ''|0) try='char* ttyname_r(int, char*, int);'
18987 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18989 case "$ttyname_r_proto" in
18990 ''|0) d_ttyname_r=undef
18992 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18993 * ) case "$ttyname_r_proto" in
18994 REENTRANT_PROTO*) ;;
18995 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18997 echo "Prototype: $try" ;;
19000 *) case "$usethreads" in
19001 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
19008 *) ttyname_r_proto=0
19012 : see if tzname[] exists
19014 if set tzname val -a d_tzname; eval $csym; $val; then
19016 echo 'tzname[] found.' >&4
19019 echo 'tzname[] NOT found.' >&4
19024 : Check if is a multiplatform env
19026 darwin) multiarch="$define" ;;
19028 case "$multiarch" in
19029 ''|[nN]*) multiarch="$undef" ;;
19032 : check for ordering of bytes in a UV
19034 case "$multiarch" in
19037 You seem to be doing a multiarchitecture build,
19038 skipping the byteorder check.
19044 case "$byteorder" in
19047 In the following, larger digits indicate more significance. A big-endian
19048 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
19049 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
19050 machines may have weird orders like 3412. A Cray will report 87654321,
19051 an Alpha will report 12345678. If the test program works the default is
19053 I'm now running the test program...
19057 #$i_stdlib I_STDLIB
19059 #include <stdlib.h>
19061 #include <sys/types.h>
19062 typedef $uvtype UV;
19072 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
19074 u.l = (UV)0x04030201;
19075 for (i = 0; i < $uvsize; i++)
19076 printf("%c", u.c[i]+'0');
19083 if eval $compile && $run ./try > /dev/null; then
19086 [1-4][1-4][1-4][1-4]|12345678|87654321)
19087 echo "(The test program ran ok.)"
19088 echo "byteorder=$dflt"
19091 ????|????????) echo "(The test program ran ok.)" ;;
19092 *) echo "(The test program didn't run right for some reason.)" ;;
19097 (I can't seem to compile the test program. Guessing big-endian...)
19100 case "$xxx_prompt" in
19102 rp="What is the order of bytes in $uvtype?"
19115 : Checking 32bit alignedness
19118 Checking to see whether you can access character data unalignedly...
19120 case "$d_u32align" in
19121 '') $cat >try.c <<EOCP
19123 #$i_stdlib I_STDLIB
19125 #include <stdlib.h>
19127 #define U32 $u32type
19128 #define BYTEORDER 0x$byteorder
19130 #include <signal.h>
19132 $signal_t bletch(int s) { exit(4); }
19135 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
19136 volatile U8 buf[8];
19140 if (sizeof(U32) != 4) {
19141 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
19148 signal(SIGBUS, bletch);
19160 for (i = 0; i < 4; i++) {
19161 up = (U32*)(buf + i);
19162 if (! ((*up == 1 << (8*i)) || /* big-endian */
19163 (*up == 1 << (8*(3-i))) /* little-endian */
19167 printf("read failed (%x)\n", *up);
19173 for (i = 0; i < 4; i++) {
19174 up = (U32*)(buf + i);
19176 if (*up != 0xBeef) {
19177 printf("write failed (%x)\n", *up);
19191 if eval $compile_ok; then
19192 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
19193 $run ./try 2>&1 >/dev/null
19196 You can access character data pretty unalignedly.
19198 d_u32align="$undef"
19201 It seems that you must access character data in an aligned manner.
19203 d_u32align="$define"
19207 rp='Can you access character data at unaligned addresses?'
19211 [yY]*) d_u32align="$undef" ;;
19212 *) d_u32align="$define" ;;
19219 : see if ualarm exists
19220 set ualarm d_ualarm
19223 : see if umask exists
19227 : see if unordered exists
19228 set unordered d_unordered
19231 : see if unsetenv exists
19232 set unsetenv d_unsetenv
19235 : see if usleep exists
19236 set usleep d_usleep
19239 : see if prototype for usleep is available
19241 set d_usleepproto usleep $i_unistd unistd.h
19244 : see if ustat exists
19248 : see if closedir exists
19249 set closedir d_closedir
19252 case "$d_closedir" in
19255 echo "Checking whether closedir() returns a status..." >&4
19257 #$i_dirent I_DIRENT /**/
19258 #$i_sysdir I_SYS_DIR /**/
19259 #$i_sysndir I_SYS_NDIR /**/
19260 #$i_systypes I_SYS_TYPES /**/
19262 #if defined(I_SYS_TYPES)
19263 #include <sys/types.h>
19265 #if defined(I_DIRENT)
19266 #include <dirent.h>
19269 #include <sys/ndir.h>
19273 #include <ndir.h> /* may be wrong in the future */
19275 #include <sys/dir.h>
19280 int main() { return closedir(opendir(".")); }
19283 if eval $compile_ok; then
19284 if $run ./try > /dev/null 2>&1 ; then
19285 echo "Yes, it does."
19288 echo "No, it doesn't."
19292 echo "(I can't seem to compile the test program--assuming it doesn't)"
19300 set d_void_closedir
19304 : see if there is a wait4
19308 : see if waitpid exists
19309 set waitpid d_waitpid
19314 $cat >try.c <<'EOCP'
19320 return (wcscmp (s, s) ? 1 : 0);
19325 if eval $compile; then
19328 0) echo "A working wcscmp() found." >&4
19330 *) echo "wcscmp() found, but it doesn't work" >&4
19334 echo "wcscmp() NOT found." >&4
19340 : see if wcstombs exists
19341 set wcstombs d_wcstombs
19346 $cat >try.c <<'EOCP'
19351 wchar_t dst[4], *src = L" ";
19353 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
19358 if eval $compile; then
19361 0) echo "A working wcsxfrm() found." >&4
19363 *) echo "wcsxfrm() found, but it doesn't work" >&4
19367 echo "wcsxfrm() NOT found." >&4
19373 : see if wctomb exists
19374 set wctomb d_wctomb
19377 : see if writev exists
19378 set writev d_writev
19381 : check for alignment requirements
19383 case "$alignbytes" in
19384 '') echo "Checking alignment constraints..." >&4
19385 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
19386 $cat >try.c <<'EOCP'
19387 typedef long double NV;
19390 $cat >try.c <<'EOCP'
19394 $cat >>try.c <<'EOCP'
19402 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19407 if eval $compile_ok; then
19411 echo "(I can't seem to compile the test program...)"
19413 case "$multiarch" in
19415 : The usual safe value is 8, but Darwin with -Duselongdouble
19416 : needs 16. Hence, we will take 8 as a minimum, but allow
19417 : Configure to pick a larger value if needed.
19418 if $test "$dflt" -lt 8; then
19420 echo "Setting alignment to 8 for multiarch support.">&4
19425 *) dflt="$alignbytes"
19428 rp="Doubles must be aligned on a how-many-byte boundary?"
19433 : set the base revision
19436 : length of character in bytes. Is always 1, otherwise it is not C
19437 : This used to be a test using sizeof
19440 : Check for the number of bits in a character
19441 case "$charbits" in
19442 '') echo "Checking how long a character is (in bits)..." >&4
19449 for (c = 1, n = 0; c; c <<= 1, n++) ;
19450 printf ("%d\n", n);
19455 if eval $compile_ok; then
19459 echo "(I can't seem to compile the test program. Guessing...)"
19466 rp="What is the length of a character (in bits)?"
19470 case "$charbits" in
19473 Your system has an unsigned character size of $charbits bits, which
19474 is rather unusual (normally it is 8 bits). Perl likely will not work
19475 correctly on your system, with subtle bugs in various places.
19477 rp='Do you really want to continue?'
19481 [yY]) echo >&4 "Okay, continuing." ;;
19486 : how do we concatenate cpp tokens here?
19488 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19489 $cat >cpp_stuff.c <<'EOCP'
19490 #define RCAT(a,b)a/**/b
19491 #define ACAT(a,b)a ## b
19495 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19496 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19497 echo "Oh! Smells like ANSI's been here." >&4
19498 echo "We can catify or stringify, separately or together!"
19500 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19501 echo "Ah, yes! The good old days!" >&4
19502 echo "However, in the good old days we don't know how to stringify and"
19503 echo "catify at the same time."
19507 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19508 You're going to have to edit the values of CAT[2-5] in config.h...
19510 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19514 : see if this is a db.h system
19520 : Check db version.
19522 echo "Checking Berkeley DB version ..." >&4
19528 #include <sys/types.h>
19530 #$i_stdlib I_STDLIB
19532 #include <stdlib.h>
19535 int main(int argc, char *argv[])
19537 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19538 int Major, Minor, Patch ;
19539 unsigned long Version ;
19540 (void)db_version(&Major, &Minor, &Patch) ;
19542 printf("%d %d %d %d %d %d\n",
19543 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19544 Major, Minor, Patch);
19547 printf("You have Berkeley DB Version 2 or greater.\n");
19549 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19550 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19551 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19552 Major, Minor, Patch) ;
19554 /* check that db.h & libdb are compatible */
19555 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19556 printf("db.h and libdb are incompatible.\n") ;
19560 printf("db.h and libdb are compatible.\n") ;
19562 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19563 + DB_VERSION_PATCH ;
19565 /* needs to be >= 2.3.4 */
19566 if (Version < 2003004) {
19567 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19568 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19574 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19579 printf("You have Berkeley DB Version 1.\n");
19580 exit(0); /* DB version < 2: the coast is clear. */
19582 exit(1); /* <db.h> not Berkeley DB? */
19588 if eval $compile_ok && $run ./try; then
19589 echo 'Looks OK.' >&4
19591 db_version_major=$1
19592 db_version_minor=$2
19593 db_version_patch=$3
19595 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19599 : Remove db from list of libraries to use
19600 echo "Removing unusable -ldb from library list" >&4
19601 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19604 echo "libs = $libs" >&4
19614 : Check the return type needed for hash
19616 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19622 #include <sys/types.h>
19625 #ifndef DB_VERSION_MAJOR
19626 u_int32_t hash_cb (const void* ptr, size_t size)
19632 info.hash = hash_cb;
19636 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19637 if $contains warning try.out >>/dev/null 2>&1 ; then
19640 db_hashtype='u_int32_t'
19643 : XXX Maybe we should just give up here.
19644 db_hashtype=u_int32_t
19646 echo "Help: I can't seem to compile the db test program." >&4
19647 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19650 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19652 *) db_hashtype=u_int32_t
19657 : Check the return type needed for prefix
19659 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19665 #include <sys/types.h>
19668 #ifndef DB_VERSION_MAJOR
19669 size_t prefix_cb (const DBT *key1, const DBT *key2)
19675 info.prefix = prefix_cb;
19679 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19680 if $contains warning try.out >>/dev/null 2>&1 ; then
19681 db_prefixtype='int'
19683 db_prefixtype='size_t'
19686 db_prefixtype='size_t'
19687 : XXX Maybe we should just give up here.
19689 echo "Help: I can't seem to compile the db test program." >&4
19690 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19693 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19695 *) db_prefixtype='size_t'
19699 : How can we generate normalized random numbers ?
19701 echo "Using our internal random number implementation..." >&4
19704 *-Dmy_rand=*|*-Dmy_srand=*)
19705 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19706 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19707 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19708 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19712 randfunc=Perl_drand48
19713 drand01="Perl_drand48()"
19714 seedfunc="Perl_drand48_init"
19718 : Determine if this is an EBCDIC system
19720 echo "Determining whether or not we are on an EBCDIC system..." >&4
19721 $cat >try.c <<'EOM'
19724 if ('M'==0xd4) return 0;
19731 if eval $compile_ok; then
19732 if $run ./try; then
19733 echo "You seem to speak EBCDIC." >&4
19736 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19739 echo "I'm unable to compile the test program." >&4
19740 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19746 : Check how to flush
19749 Checking how to flush all pending stdio output...
19751 # I only know how to find the first 32 possibly open files on SunOS.
19752 # See also hints/sunos_4_1.sh and util.c --AD
19754 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19756 $cat >>try.c <<EOCP
19758 #$i_stdlib I_STDLIB
19760 #include <stdlib.h>
19762 #$i_unistd I_UNISTD
19764 # include <unistd.h>
19766 #$d_sysconf HAS_SYSCONF
19767 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19768 #ifdef HAS_STDIO_STREAM_ARRAY
19769 # define STDIO_STREAM_ARRAY $stdio_stream_array
19774 p = fopen("try.out", "w");
19778 # ifdef TRY_FPRINTF
19782 #ifdef TRY_FFLUSH_NULL
19785 #ifdef TRY_FFLUSH_ALL
19787 long open_max = -1;
19788 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19789 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19791 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19792 open_max = sysconf(_SC_OPEN_MAX);
19795 open_max = FOPEN_MAX;
19798 open_max = OPEN_MAX;
19807 # ifdef HAS_STDIO_STREAM_ARRAY
19808 if (open_max > 0) {
19810 for (i = 0; i < open_max; i++)
19811 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19812 STDIO_STREAM_ARRAY[i]._file < open_max &&
19813 STDIO_STREAM_ARRAY[i]._flag)
19814 fflush(&STDIO_STREAM_ARRAY[i]);
19822 : first we have to find out how _not_ to flush
19824 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19826 set try -DTRY_FPUTC
19827 if eval $compile; then
19828 $run ./try 2>/dev/null
19831 if $test ! -s try.out -a "X$code" = X42; then
19837 set try -DTRY_FPRINTF
19838 if eval $compile; then
19839 $run ./try 2>/dev/null
19842 if $test ! -s try.out -a "X$code" = X42; then
19843 output=-DTRY_FPRINTF
19849 : check for fflush NULL behavior
19850 case "$fflushNULL" in
19851 '') set try -DTRY_FFLUSH_NULL $output
19852 if eval $compile; then
19853 $run ./try 2>/dev/null
19856 if $test -s try.out -a "X$code" = X42; then
19857 fflushNULL="`$cat try.out`"
19859 if $test "X$code" != X42; then
19861 (If this test failed, don't worry, we'll try another method shortly.)
19866 $rm -f core try.core core.try.*
19867 case "$fflushNULL" in
19869 Your fflush(NULL) works okay for output streams.
19870 Let's see if it clobbers input pipes...
19872 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19873 # bug that improperly flushes the input end of pipes. So we avoid the
19874 # autoflush on fork/system/exec support for now. :-(
19875 $cat >tryp.c <<EOCP
19878 main(int argc, char **argv)
19884 while ((i = getc(stdin)) != -1
19885 && (*bp++ = i) != '\n'
19886 && bp < &buf[1024])
19889 fprintf(stdout, "%s", buf);
19897 fflushNULL="$define"
19899 if eval $compile; then
19901 # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
19902 if $test "X$targethost" != X; then
19905 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
19907 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19909 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19911 fflush(NULL) seems to behave okay with input streams.
19913 fflushNULL="$define"
19916 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19918 fflushNULL="$undef"
19921 $rm -f core tryp.c tryp.core core.tryp.*
19924 Your fflush(NULL) isn't working (contrary to ANSI C).
19926 fflushNULL="$undef"
19929 Cannot figure out whether your fflush(NULL) works or not.
19930 I'm assuming it doesn't (contrary to ANSI C).
19932 fflushNULL="$undef"
19936 $define|true|[yY]*)
19937 fflushNULL="$define"
19940 fflushNULL="$undef"
19943 : check explicit looping only if NULL did not work, and if the pipe
19944 : bug does not show up on an explicit flush too
19945 case "$fflushNULL" in
19947 $cat >tryp.c <<EOCP
19950 main(int argc, char **argv)
19956 while ((i = getc(stdin)) != -1
19957 && (*bp++ = i) != '\n'
19958 && bp < &buf[1024])
19961 fprintf(stdout, "%s", buf);
19970 if eval $compile; then
19972 if $test "X$targethost" != X; then
19975 $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
19977 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19979 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19981 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19983 : now check for fflushall behaviour
19984 case "$fflushall" in
19985 '') set try -DTRY_FFLUSH_ALL $output
19986 if eval $compile; then
19988 (Now testing the other method--but note that this also may fail.)
19990 $run ./try 2>/dev/null
19993 if $test -s try.out -a "X$code" = X42; then
19994 fflushall="`$cat try.out`"
19998 case "$fflushall" in
20000 Whew. Flushing explicitly all the stdio streams works.
20002 fflushall="$define"
20005 Sigh. Flushing explicitly all the stdio streams doesn't work.
20010 Cannot figure out whether flushing stdio streams explicitly works or not.
20011 I'm assuming it doesn't.
20017 "$define"|true|[yY]*)
20018 fflushall="$define"
20026 All is futile. Even fflush(stdin) clobbers input pipes!
20033 $rm -f core tryp.c tryp.core core.tryp.*
20035 *) fflushall="$undef"
20039 case "$fflushNULL$fflushall" in
20042 OK, I give up. I cannot figure out how to flush pending stdio output.
20043 We won't be flushing handles at all before fork/exec/popen.
20049 : Store the full pathname to the ar program for use in the C program
20050 : Respect a hint or command line value for full_ar.
20055 : Store the full pathname to the sed program for use in the C program
20058 : see what type gids are declared as in the kernel
20060 echo "Looking for the type for group ids returned by getgid()."
20061 set gid_t gidtype xxx stdio.h sys/types.h
20065 xxx=`./findhdr sys/user.h`
20066 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
20068 unsigned) dflt="$1 $2" ;;
20072 *) dflt="$gidtype";;
20075 gid_t) echo "gid_t found." ;;
20076 *) rp="What is the type for group ids returned by getgid()?"
20082 : Check the size of GID
20085 *_t) zzz="$gidtype" ;;
20088 echo "Checking the size of $zzz..." >&4
20090 #include <sys/types.h>
20092 #$i_stdlib I_STDLIB
20094 #include <stdlib.h>
20097 printf("%d\n", (int)sizeof($gidtype));
20102 if eval $compile_ok; then
20106 echo "(I can't execute the test program--guessing $gidsize.)" >&4
20109 echo "Your $zzz is $gidsize bytes long."
20114 echo "(I can't compile the test program--guessing $gidsize.)" >&4
20118 : Check if GID is signed
20121 *_t) zzz="$gidtype" ;;
20124 echo "Checking the sign of $zzz..." >&4
20126 #include <sys/types.h>
20137 if eval $compile; then
20141 echo "(I can't execute the test program--guessing unsigned.)" >&4
20145 1) echo "Your $zzz is unsigned." ;;
20146 -1) echo "Your $zzz is signed." ;;
20152 echo "(I can't compile the test program--guessing unsigned.)" >&4
20156 : Check 64bit sizes
20159 if $test X"$quadtype" != X; then
20161 echo "Checking how to print 64-bit integers..." >&4
20163 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
20164 $cat >try.c <<'EOCP'
20165 #include <sys/types.h>
20168 int q = 12345678901;
20169 printf("%ld\n", q);
20173 if eval $compile; then
20177 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
20178 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
20179 echo "We will use %d."
20185 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
20186 $cat >try.c <<'EOCP'
20187 #include <sys/types.h>
20190 long q = 12345678901;
20191 printf("%ld\n", q);
20195 if eval $compile; then
20199 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
20200 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
20201 echo "We will use %ld."
20207 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
20208 $cat >try.c <<'EOCP'
20209 #include <sys/types.h>
20210 #include <inttypes.h>
20213 int64_t q = 12345678901;
20214 printf("%" PRId64 "\n", q);
20218 if eval $compile; then
20222 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
20223 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
20224 echo "We will use the C9X style."
20230 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20232 #include <sys/types.h>
20235 $quadtype q = 12345678901;
20236 printf("%Ld\n", q);
20240 if eval $compile; then
20244 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
20245 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
20246 echo "We will use %Ld."
20252 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
20253 $cat >try.c <<'EOCP'
20254 #include <sys/types.h>
20257 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
20258 printf("%lld\n", q);
20262 if eval $compile; then
20266 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
20267 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
20268 echo "We will use the %lld style."
20274 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
20276 #include <sys/types.h>
20279 $quadtype q = 12345678901;
20280 printf("%qd\n", q);
20284 if eval $compile; then
20288 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
20289 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
20290 echo "We will use %qd."
20296 if $test X"$sPRId64" = X; then
20297 echo "Cannot figure out how to print 64-bit integers." >&4
20304 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
20305 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
20307 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
20308 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
20312 : Check format strings for internal types
20314 $echo "Checking the format strings to be used for Perl's internal types..." >&4
20316 if $test X"$ivsize" = X8; then
20317 ivdformat="$sPRId64"
20318 uvuformat="$sPRIu64"
20319 uvoformat="$sPRIo64"
20320 uvxformat="$sPRIx64"
20321 uvXUformat="$sPRIXU64"
20323 if $test X"$ivsize" = X"$longsize"; then
20330 if $test X"$ivsize" = X"$intsize"; then
20338 if $test X"$ivsize" = X"$shortsize"; then
20349 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
20350 nveformat="$sPRIeldbl"
20351 nvfformat="$sPRIfldbl"
20352 nvgformat="$sPRIgldbl"
20353 nvEUformat="$sPRIEUldbl"
20354 nvFUformat="$sPRIFUldbl"
20355 nvGUformat="$sPRIGUldbl"
20365 case "$ivdformat" in
20366 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
20371 : Check format string for GID
20374 $echo "Checking the format string to be used for gids..." >&4
20377 -1) if $test X"$gidsize" = X"$ivsize"; then
20378 gidformat="$ivdformat"
20380 if $test X"$gidsize" = X"$longsize"; then
20383 if $test X"$gidsize" = X"$intsize"; then
20386 if $test X"$gidsize" = X"$shortsize"; then
20393 *) if $test X"$gidsize" = X"$uvsize"; then
20394 gidformat="$uvuformat"
20396 if $test X"$gidsize" = X"$longsize"; then
20399 if $test X"$gidsize" = X"$intsize"; then
20402 if $test X"$gidsize" = X"$shortsize"; then
20411 : see if getgroups exists
20412 set getgroups d_getgrps
20415 : see if setgroups exists
20416 set setgroups d_setgrps
20419 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
20421 case "$d_getgrps$d_setgrps" in
20423 case "$groupstype" in
20424 '') dflt="$gidtype" ;;
20425 *) dflt="$groupstype" ;;
20428 What type of pointer is the second argument to getgroups() and setgroups()?
20429 Usually this is the same as group ids, $gidtype, but not always.
20432 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20436 *) groupstype="$gidtype";;
20439 : check whether make sets MAKE
20441 echo "Checking if your $make program sets \$(MAKE)..." >&4
20442 case "$make_set_make" in
20444 $sed 's/^X //' > testmake.mak << 'EOF'
20446 X @echo 'maketemp="$(MAKE)"'
20448 case "`$make -f testmake.mak 2>/dev/null`" in
20449 *maketemp=*) make_set_make='#' ;;
20450 *) make_set_make="MAKE=$make" ;;
20452 $rm -f testmake.mak
20455 case "$make_set_make" in
20456 '#') echo "Yup, it does.";;
20457 *) echo "Nope, it doesn't.";;
20460 : see what type is used for mode_t
20461 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20462 set mode_t modetype int stdio.h sys/types.h
20465 : see if we need va_copy
20467 case "$i_stdarg" in
20470 #include <stdarg.h>
20472 #$i_stdlib I_STDLIB
20474 #include <stdlib.h>
20476 #include <signal.h>
20479 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20481 return vfprintf(f, fmt, *valp);
20485 myvfprintf(FILE *f, const char *fmt, va_list val)
20487 return ivfprintf(f, fmt, &val);
20491 myprintf(char *fmt, ...)
20494 va_start(val, fmt);
20495 return myvfprintf(stdout, fmt, val);
20499 main(int ac, char **av)
20501 signal(SIGSEGV, exit);
20503 myprintf("%s%cs all right, then\n", "that", '\'');
20508 if eval $compile && $run ./try 2>&1 >/dev/null; then
20509 case "`$run ./try`" in
20510 "that's all right, then")
20516 yes) echo "It seems that you don't need va_copy()." >&4
20517 need_va_copy="$undef"
20519 *) echo "It seems that va_copy() or similar will be needed." >&4
20520 need_va_copy="$define"
20525 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20526 need_va_copy="$undef"
20530 : see what type is used for size_t
20531 rp="What is the type used for the length parameter for string functions?"
20532 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20535 : check for type of arguments to gethostbyaddr.
20536 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20537 case "$d_gethbyaddr" in
20541 Checking to see what type of arguments are accepted by gethostbyaddr().
20543 hdrs="$define sys/types.h
20544 $d_socket sys/socket.h
20545 $i_niin netinet/in.h
20547 $i_unistd unistd.h"
20548 : The first arg can 'char *' or 'void *'
20549 : The second arg is some of integral type
20550 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20551 for yyy in size_t long int; do
20552 case "$netdb_host_type" in
20553 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20554 if ./protochk "$try" $hdrs; then
20555 echo "Your system accepts $xxx for the first arg."
20556 echo "...and $yyy for the second arg."
20557 netdb_host_type="$xxx"
20558 netdb_hlen_type="$yyy"
20564 : In case none of those worked, prompt the user.
20565 case "$netdb_host_type" in
20566 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20569 netdb_host_type=$ans
20570 rp='What is the type for the 2nd argument to gethostbyaddr?'
20573 netdb_hlen_type=$ans
20577 *) : no gethostbyaddr, so pick harmless defaults
20578 netdb_host_type='char *'
20579 netdb_hlen_type="$sizetype"
20582 # Remove the "const" if needed. -- but then we'll have a
20584 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20587 : check for type of argument to gethostbyname.
20588 if test "X$netdb_name_type" = X ; then
20589 case "$d_gethbyname" in
20593 Checking to see what type of argument is accepted by gethostbyname().
20595 hdrs="$define sys/types.h
20596 $d_socket sys/socket.h
20597 $i_niin netinet/in.h
20599 $i_unistd unistd.h"
20600 for xxx in "const char *" "char *"; do
20601 case "$netdb_name_type" in
20602 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20603 if ./protochk "$try" $hdrs; then
20604 echo "Your system accepts $xxx."
20605 netdb_name_type="$xxx"
20610 : In case none of those worked, prompt the user.
20611 case "$netdb_name_type" in
20612 '') rp='What is the type for the 1st argument to gethostbyname?'
20615 netdb_name_type=$ans
20619 *) : no gethostbyname, so pick harmless default
20620 netdb_name_type='char *'
20625 : check for type of 1st argument to getnetbyaddr.
20626 if test "X$netdb_net_type" = X ; then
20627 case "$d_getnbyaddr" in
20631 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20633 hdrs="$define sys/types.h
20634 $d_socket sys/socket.h
20635 $i_niin netinet/in.h
20637 $i_unistd unistd.h"
20638 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20639 case "$netdb_net_type" in
20640 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20641 if ./protochk "$try" $hdrs; then
20642 echo "Your system accepts $xxx."
20643 netdb_net_type="$xxx"
20648 : In case none of those worked, prompt the user.
20649 case "$netdb_net_type" in
20650 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20653 netdb_net_type=$ans
20657 *) : no getnetbyaddr, so pick harmless default
20658 netdb_net_type='long'
20662 : locate the preferred pager for this system
20669 [a-zA-Z]:/*) dflt=$pg;;
20673 [a-zA-Z]:/*) dflt=$more;;
20677 [a-zA-Z]:/*) dflt=$less;;
20680 '') dflt=/usr/ucb/more;;
20688 rp='What pager is used on your system?'
20692 : see what type pids are declared as in the kernel
20693 rp="What is the type of process ids on this system?"
20694 set pid_t pidtype int stdio.h sys/types.h
20697 : see if ar generates random libraries by itself
20699 echo "Checking how to generate random libraries on your machine..." >&4
20700 echo 'int bar1() { return bar2(); }' > bar1.c
20701 echo 'int bar2() { return 2; }' > bar2.c
20703 #$i_stdlib I_STDLIB
20705 #include <stdlib.h>
20707 int main() { printf("%d\n", bar1()); exit(0); }
20709 $cc $ccflags -c bar1.c >/dev/null 2>&1
20710 $cc $ccflags -c bar2.c >/dev/null 2>&1
20711 $cc $ccflags -c foo.c >/dev/null 2>&1
20712 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20713 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20714 $run ./foobar >/dev/null 2>&1; then
20715 echo "$ar appears to generate random libraries itself."
20717 if [ "X$ranlib" = "X" ]; then
20720 elif $ar s bar$_a >/dev/null 2>&1 &&
20721 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20722 $run ./foobar >/dev/null 2>&1; then
20723 echo "a table of contents needs to be added with '$ar s'."
20726 elif $ar ts bar$_a >/dev/null 2>&1 &&
20727 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20728 $run ./foobar >/dev/null 2>&1; then
20729 echo "a table of contents needs to be added with '$ar ts'."
20736 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20737 $test -f $ranlib || ranlib=''
20740 if $test -n "$ranlib"; then
20741 echo "your system has '$ranlib'; we'll use that."
20744 echo "your system doesn't seem to support random libraries"
20745 echo "so we'll use lorder and tsort to order the libraries."
20752 : see if this is a values.h system
20753 set values.h i_values
20756 : Check the max offset that gmtime and localtime accept
20757 echo "Checking max offsets that gmtime () accepts"
20760 define) yyy="#include <values.h>" ;;
20764 case "$sGMTIME_min/$sGMTIME_max" in
20767 #include <sys/types.h>
20776 void gm_check (time_t t, int min_year, int max_year)
20779 if ( tmp == NULL ||
20780 /* Check tm_year overflow */
20781 tmp->tm_year < min_year || tmp->tm_year > max_year)
20792 gm_check (MAXLONG, 69, 0x7fffffff);
20794 if (tmp == NULL || tmp->tm_year < 0) {
20795 for (i = 63; i >= 0; i--) {
20796 time_t x = pt | ((time_t)1 << i);
20797 if (x < 0 || x < pt) continue;
20798 gm_check (x, 69, 0x7fffffff);
20801 printf ("sGMTIME_max=%ld\n", pt);
20810 gm_check (MINLONG, -1900, 70);
20813 for (i = 36; i >= 0; i--) {
20814 time_t x = pt - ((time_t)1 << i);
20815 if (x > 0) continue;
20816 gm_check (x, -1900, 70);
20819 printf ("sGMTIME_min=%ld\n", pt);
20823 int main (int argc, char *argv[])
20825 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20832 if eval $compile; then
20835 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20841 echo "Checking max offsets that localtime () accepts"
20843 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20846 #include <sys/types.h>
20855 void local_check (time_t t, int min_year, int max_year)
20857 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20860 tmp = localtime (&t);
20861 if ( tmp == NULL ||
20862 /* Check tm_year overflow */
20863 tmp->tm_year < min_year || tmp->tm_year > max_year)
20867 } /* local_check */
20874 local_check (MAXLONG, 69, 0x7fffffff);
20876 if (tmp == NULL || tmp->tm_year < 0) {
20877 for (i = 63; i >= 0; i--) {
20878 time_t x = pt | ((time_t)1 << i);
20879 if (x < 0 || x < pt) continue;
20880 local_check (x, 69, 0x7fffffff);
20883 printf ("sLOCALTIME_max=%ld\n", pt);
20892 local_check (MINLONG, -1900, 70);
20895 for (i = 36; i >= 0; i--) {
20896 time_t x = pt - ((time_t)1 << i);
20897 if (x > 0) continue;
20898 local_check (x, -1900, 70);
20901 printf ("sLOCALTIME_min=%ld\n", pt);
20905 int main (int argc, char *argv[])
20913 if eval $compile; then
20916 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20922 : check for type of arguments to select.
20923 case "$selecttype" in
20924 '') case "$d_select" in
20928 Checking to see what type of arguments are accepted by select().
20930 hdrs="$define sys/types.h
20931 $i_systime sys/time.h
20932 $i_sysselct sys/select.h
20933 $d_socket sys/socket.h"
20934 : The first arg can be int, unsigned, or size_t
20935 : The last arg may or may not be 'const'
20937 : void pointer has been seen but using that
20938 : breaks the selectminbits test
20939 for xxx in 'fd_set *' 'int *'; do
20940 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20941 for tmo in 'struct timeval *' 'const struct timeval *'; do
20943 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20944 if ./protochk "$try" $hdrs; then
20945 echo "Your system accepts $xxx."
20954 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20955 case "$d_fd_set" in
20956 $define) dflt="fd_set *" ;;
20965 *) : no select, so pick a harmless default
20972 : check for the select 'width'
20973 case "$selectminbits" in
20974 '') safebits=`expr $ptrsize \* 8`
20975 case "$d_select" in
20979 Checking to see on how many bits at a time your select() operates...
20982 #include <sys/types.h>
20984 #$i_systime I_SYS_TIME
20985 #$i_systimek I_SYS_TIME_KERNEL
20990 # ifdef I_SYS_TIME_KERNEL
20993 # include <sys/time.h>
20994 # ifdef I_SYS_TIME_KERNEL
20998 #$i_sysselct I_SYS_SELECT
20999 #ifdef I_SYS_SELECT
21000 #include <sys/select.h>
21002 #$d_socket HAS_SOCKET
21004 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
21007 #$i_stdlib I_STDLIB
21009 #include <stdlib.h>
21012 #define S sizeof(*(b))
21014 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
21015 #define NBITS (NBYTES * 8)
21017 char *s = (char *)malloc(NBYTES);
21026 fp = fopen("try.c", "r");
21032 b = ($selecttype)s;
21033 for (i = 0; i < NBITS; i++)
21037 select(fd + 1, b, 0, 0, &t);
21038 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
21040 printf("%d\n", i + 1);
21045 if eval $compile_ok; then
21046 selectminbits=`$run ./try`
21047 case "$selectminbits" in
21049 Cannot figure out on how many bits at a time your select() operates.
21050 I'll play safe and guess it is $safebits bits.
21052 selectminbits=$safebits
21053 bits="$safebits bits"
21056 *) bits="$selectminbits bits" ;;
21058 echo "Your select() operates on $bits at a time." >&4
21060 rp='What is the minimum number of bits your select() operates on?'
21061 case "$byteorder" in
21062 12345678) dflt=64 ;;
21068 selectminbits="$val"
21072 *) : no select, so pick a harmless default
21073 selectminbits=$safebits
21079 : Trace out the files included by signal.h, then look for SIGxxx names.
21080 if [ "X$fieldn" = X ]; then
21081 : Just make some guesses. We check them later.
21082 xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
21084 xxx=`echo '#include <signal.h>' |
21085 $cppstdin $cppminus $cppflags 2>/dev/null |
21086 $grep '^[ ]*#.*include' |
21087 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
21088 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
21091 for xx in $xxx /dev/null ; do
21092 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
21094 case "$xxxfiles" in
21095 '') xxxfiles=`./findhdr signal.h` ;;
21098 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
21099 print substr($2, 4, 20)
21101 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
21102 print substr($3, 4, 20)
21104 : Append some common names just in case the awk scan failed.
21105 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
21106 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
21107 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
21108 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
21109 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
21111 : generate a few handy files for later
21112 $cat > signal.c <<EOCP
21113 #include <sys/types.h>
21114 #include <signal.h>
21115 #$i_stdlib I_STDLIB
21117 #include <stdlib.h>
21122 /* Strange style to avoid deeply-nested #if/#else/#endif */
21125 # define NSIG (_NSIG)
21131 # define NSIG (SIGMAX+1)
21137 # define NSIG (SIG_MAX+1)
21143 # define NSIG (_SIG_MAX+1)
21149 # define NSIG (MAXSIG+1)
21155 # define NSIG (MAX_SIG+1)
21160 # ifdef SIGARRAYSIZE
21161 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
21167 # define NSIG (_sys_nsig) /* Solaris 2.5 */
21171 /* Default to some arbitrary number that's big enough to get most
21172 of the common signals.
21178 printf("NSIG %d\n", NSIG);
21184 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
21186 printf "#ifdef SIG"; printf $1; printf "\n"
21187 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
21188 printf $1; printf ");\n"
21192 printf "#endif /* JUST_NSIG */\n";
21193 printf "exit(0);\n}\n";
21196 $cat >signal.awk <<'EOP'
21197 BEGIN { ndups = 0 }
21198 $1 ~ /^NSIG$/ { nsig = $2 }
21199 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
21200 if ($2 > maxsig) { maxsig = $2 }
21201 if (sig_name[$2]) {
21202 dup_name[ndups] = $1
21203 dup_num[ndups] = $2
21215 printf("NSIG %d\n", nsig);
21216 for (n = 1; n < nsig; n++) {
21218 printf("%s %d\n", sig_name[n], sig_num[n])
21221 printf("NUM%d %d\n", n, n)
21224 for (n = 0; n < ndups; n++) {
21225 printf("%s %d\n", dup_name[n], dup_num[n])
21229 $cat >signal_cmd <<EOS
21231 if $test -s signal.lst; then
21232 echo "Using your existing signal.lst file"
21237 $cat >>signal_cmd <<'EOS'
21240 if eval $compile_ok; then
21241 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
21242 $uniq | $awk -f signal.awk >signal.lst
21244 echo "(I can't seem be able to compile the whole test program)" >&4
21245 echo "(I'll try it in little pieces.)" >&4
21246 set signal -DJUST_NSIG
21247 if eval $compile_ok; then
21248 $run ./signal$_exe > signal.nsg
21251 echo "I can't seem to figure out how many signals you have." >&4
21252 echo "Guessing 50." >&4
21253 echo 'NSIG 50' > signal.nsg
21255 : Now look at all the signal names, one at a time.
21256 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
21257 $cat > signal.c <<EOCP
21258 #include <sys/types.h>
21259 #include <signal.h>
21262 printf("$xx %d\n", SIG${xx});
21267 if eval $compile; then
21268 echo "SIG${xx} found."
21269 $run ./signal$_exe >> signal.ls1
21271 echo "SIG${xx} NOT found."
21274 if $test -s signal.ls1; then
21275 $cat signal.nsg signal.ls1 |
21276 $sort -n | $uniq | $awk -f signal.awk >signal.lst
21280 if $test -s signal.lst; then
21283 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
21284 echo 'kill -l' >signal
21285 set X `csh -f <signal`
21289 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
21291 echo $@ | $tr ' ' $trnl | \
21292 $awk '{ printf "%s %d\n", $1, ++s; }
21293 END { printf "NSIG %d\n", ++s }' >signal.lst
21295 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
21297 chmod a+x signal_cmd
21298 $eunicefix signal_cmd
21300 : generate list of signal names
21302 case "$sig_name_init" in
21304 *) case "$sig_num_init" in
21305 ''|*,*) doinit=yes ;;
21310 echo "Generating a list of signal names and numbers..." >&4
21312 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
21313 sig_name=`$awk 'BEGIN { printf "ZERO " }
21314 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
21315 sig_num=`$awk 'BEGIN { printf "0 " }
21316 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
21317 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
21318 !/^NSIG/ { printf "\"%s\", ", $1 }
21319 END { printf "0\n" }' signal.lst`
21320 sig_num_init=`$awk 'BEGIN { printf "0, " }
21321 !/^NSIG/ { printf "%d, ", $2}
21322 END { printf "0\n"}' signal.lst`
21325 echo "The following $sig_count signals are available:"
21327 echo $sig_name | $awk \
21328 'BEGIN { linelen = 0 }
21330 for (i = 1; i <= NF; i++) {
21331 name = "SIG" $i " "
21332 linelen = linelen + length(name)
21333 if (linelen > 70) {
21335 linelen = length(name)
21341 sig_size=`echo $sig_name | awk '{print NF}'`
21342 $rm -f signal signal.c signal.awk signal.lst signal_cmd
21344 : Check size of size
21346 case "$sizetype" in
21347 *_t) zzz="$sizetype" ;;
21348 *) zzz="filesize" ;;
21350 echo "Checking the size of $zzz..." >&4
21352 #include <sys/types.h>
21354 #$i_stdlib I_STDLIB
21356 #include <stdlib.h>
21359 printf("%d\n", (int)sizeof($sizetype));
21364 if eval $compile_ok; then
21368 echo "(I can't execute the test program--guessing $sizesize.)" >&4
21371 echo "Your $zzz size is $sizesize bytes."
21376 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21380 : check for socklen_t
21382 echo "Checking to see if you have socklen_t..." >&4
21384 #include <sys/types.h>
21385 #$d_socket HAS_SOCKET
21387 #include <sys/socket.h>
21389 int main() { socklen_t x = 16; }
21392 if eval $compile; then
21394 echo "You have socklen_t."
21397 echo "You do not have socklen_t."
21398 case "$sizetype" in
21399 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21406 : see if this is a socks.h system
21407 set socks.h i_socks
21410 : check for type of the size argument to socket calls
21411 case "$d_socket" in
21415 Checking to see what type is the last argument of accept().
21418 case "$d_socklen_t" in
21419 "$define") yyy="$yyy socklen_t"
21421 yyy="$yyy $sizetype int long unsigned"
21422 for xxx in $yyy; do
21423 case "$socksizetype" in
21424 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21425 case "$usesocks" in
21427 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21428 echo "Your system accepts '$xxx *' for the last argument of accept()."
21429 socksizetype="$xxx"
21432 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21433 echo "Your system accepts '$xxx *' for the last argument of accept()."
21434 socksizetype="$xxx"
21441 : In case none of those worked, prompt the user.
21442 case "$socksizetype" in
21443 '') rp='What is the type for socket address structure sizes?'
21450 *) : no sockets, so pick relatively harmless default
21455 : see what type is used for signed size_t
21456 set ssize_t ssizetype int stdio.h sys/types.h
21461 #$i_stdlib I_STDLIB
21463 #include <stdlib.h>
21465 #include <sys/types.h>
21466 #define Size_t $sizetype
21467 #define SSize_t $dflt
21470 if (sizeof(Size_t) == sizeof(SSize_t))
21472 else if (sizeof(Size_t) == sizeof(int))
21481 if eval $compile_ok && $run ./try > /dev/null; then
21482 ssizetype=`$run ./try`
21483 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21486 Help! I can't compile and run the ssize_t test program: please enlighten me!
21487 (This is probably a misconfiguration in your system or libraries, and
21488 you really ought to fix it. Still, I'll try anyway.)
21490 I need a type that is the same size as $sizetype, but is guaranteed to
21491 be signed. Common values are ssize_t, int and long.
21494 rp="What signed type is the same size as $sizetype?"
21500 : Check the size of st_ino
21502 $echo "Checking the size of st_ino..." >&4
21503 $cat > try.c <<EOCP
21504 #include <sys/stat.h>
21506 #$i_stdlib I_STDLIB
21508 #include <stdlib.h>
21512 printf("%d\n", (int)sizeof(st.st_ino));
21517 if eval $compile_ok; then
21521 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
21523 *) st_ino_size=$val
21524 $echo "Your st_ino is $st_ino_size bytes long."
21529 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
21533 : Check if st_ino is signed
21535 $echo "Checking the sign of st_ino..." >&4
21536 $cat > try.c <<EOCP
21537 #include <sys/stat.h>
21542 if (foo.st_ino < 0)
21549 if eval $compile; then
21553 $echo "(I can't execute the test program--guessing unsigned.)" >&4
21555 *) st_ino_sign=$val
21556 case "$st_ino_sign" in
21557 1) $echo "Your st_ino is unsigned." ;;
21558 -1) $echo "Your st_ino is signed." ;;
21564 $echo "(I can't compile the test program--guessing unsigned.)" >&4
21568 : see what type of char stdio uses.
21570 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21571 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21572 echo "Your stdio uses unsigned chars." >&4
21573 stdchar="unsigned char"
21575 echo "Your stdio uses signed chars." >&4
21580 : see what type uids are declared as in the kernel
21582 echo "Looking for the type for user ids returned by getuid()."
21583 set uid_t uidtype xxx stdio.h sys/types.h
21587 xxx=`./findhdr sys/user.h`
21588 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21590 unsigned) dflt="$1 $2" ;;
21594 *) dflt="$uidtype";;
21597 uid_t) echo "uid_t found." ;;
21598 *) rp="What is the type for user ids returned by getuid()?"
21604 : Check size of UID
21607 *_t) zzz="$uidtype" ;;
21610 echo "Checking the size of $zzz..." >&4
21612 #include <sys/types.h>
21614 #$i_stdlib I_STDLIB
21616 #include <stdlib.h>
21619 printf("%d\n", (int)sizeof($uidtype));
21624 if eval $compile_ok; then
21628 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21631 echo "Your $zzz is $uidsize bytes long."
21636 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21639 : Check if UID is signed
21642 *_t) zzz="$uidtype" ;;
21645 echo "Checking the sign of $zzz..." >&4
21647 #include <sys/types.h>
21658 if eval $compile; then
21662 echo "(I can't execute the test program--guessing unsigned.)" >&4
21666 1) echo "Your $zzz is unsigned." ;;
21667 -1) echo "Your $zzz is signed." ;;
21673 echo "(I can't compile the test program--guessing unsigned.)" >&4
21677 : Check format string for UID
21679 $echo "Checking the format string to be used for uids..." >&4
21682 -1) if $test X"$uidsize" = X"$ivsize"; then
21683 uidformat="$ivdformat"
21685 if $test X"$uidsize" = X"$longsize"; then
21688 if $test X"$uidsize" = X"$intsize"; then
21691 if $test X"$uidsize" = X"$shortsize"; then
21698 *) if $test X"$uidsize" = X"$uvsize"; then
21699 uidformat="$uvuformat"
21701 if $test X"$uidsize" = X"$longsize"; then
21704 if $test X"$uidsize" = X"$intsize"; then
21707 if $test X"$uidsize" = X"$shortsize"; then
21716 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
21718 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
21719 $cat >try.c <<'EOM'
21720 /* Intentionally a long probe as I'd like to sanity check that the exact
21721 approach is going to work, as thinking it will work, but only having it
21722 part working at runtime is worse than not having it. */
21724 #include <sys/types.h>
21725 #include <sys/sysctl.h>
21726 #include <sys/param.h>
21728 #include <string.h>
21729 #include <stdlib.h>
21730 #include <unistd.h>
21733 main(int argc, char **argv) {
21735 char *argv_leaf = strrchr(argv[0], '/');
21741 mib[1] = KERN_PROC;
21742 mib[2] = KERN_PROC_PATHNAME;
21746 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21750 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
21755 if (size < strlen(argv_leaf) + 1) {
21756 fprintf(stderr, "size %lu is too short for a path\n",
21757 (unsigned long) size);
21761 if (size > MAXPATHLEN * MAXPATHLEN) {
21762 fprintf(stderr, "size %lu is too long for a path\n",
21763 (unsigned long) size);
21767 buffer = malloc(size);
21773 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
21778 if (strlen(buffer) + 1 != size) {
21779 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
21780 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
21785 if (*buffer != '/') {
21786 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
21790 if (strstr(buffer, "/./")) {
21791 fprintf(stderr, "Contains /./: '%s'\n", buffer);
21795 if (strstr(buffer, "/../")) {
21796 fprintf(stderr, "Contains /../: '%s'\n", buffer);
21800 buffer_leaf = strrchr(buffer, '/');
21801 if (strcmp(buffer_leaf, argv_leaf) != 0) {
21802 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
21814 if eval $compile; then
21815 if $run ./try; then
21816 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
21819 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
21823 echo "I'm unable to compile the test program." >&4
21824 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
21828 set usekernprocpathname
21831 : Determine if we can use _NSGetExecutablePath to find executing program
21833 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
21834 $cat >try.c <<'EOM'
21835 /* Intentionally a long probe as I'd like to sanity check that the exact
21836 approach is going to work, as thinking it will work, but only having it
21837 part working at runtime is worse than not having it. */
21838 #include <mach-o/dyld.h>
21840 #include <stdlib.h>
21841 #include <sys/param.h>
21842 #include <string.h>
21845 main(int argc, char **argv) {
21847 uint32_t size = sizeof(buf);
21851 char *argv_leaf = strrchr(argv[0], '/');
21855 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21859 _NSGetExecutablePath(buf, &size);
21860 if (size > MAXPATHLEN * MAXPATHLEN) {
21861 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
21862 (unsigned int) size);
21866 buffer = malloc(size);
21872 result = _NSGetExecutablePath(buffer, &size);
21874 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
21875 result, (unsigned int) size);
21879 tidied = realpath(buffer, NULL);
21881 perror("realpath");
21887 if (*tidied != '/') {
21888 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
21892 if (strstr(tidied, "/./")) {
21893 fprintf(stderr, "Contains /./: '%s'\n", tidied);
21897 if (strstr(tidied, "/../")) {
21898 fprintf(stderr, "Contains /../: '%s'\n", tidied);
21902 tidied_leaf = strrchr(tidied, '/');
21903 if (strcmp(tidied_leaf, argv_leaf) != 0) {
21904 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
21916 if eval $compile; then
21917 if $run ./try; then
21918 echo "You can use _NSGetExecutablePath to find the executing program." >&4
21921 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
21924 echo "I'm unable to compile the test program." >&4
21925 echo "I'll assume no _NSGetExecutablePath here." >&4
21928 set usensgetexecutablepath
21931 : Check if site customization support was requested
21932 case "$usesitecustomize" in
21933 $define|true|[Yy]*)
21934 usesitecustomize="$define"
21937 usesitecustomize="$undef"
21941 : see if prototypes support variable argument declarations
21943 case "$prototype$i_stdarg" in
21945 echo "It appears we'll be able to prototype varargs functions." >&4
21949 echo "Too bad... We won't be using prototyped varargs functions..." >&4
21956 : determine compiler compiler
21965 if $test -f "$byacc$_exe"; then
21967 comp="byacc or $comp"
21969 if $test -f "$bison$_exe"; then
21970 comp="$comp or bison -y"
21972 rp="Which compiler compiler ($comp) shall I use?"
21981 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
21987 : see if this is a assert.h system
21988 set assert.h i_assert
21991 : see if this is a bfd.h system
21995 : see if this is an execinfo.h system
21996 set execinfo.h i_execinfo
21999 : see if this is a fp.h system
22003 : see if this is a fp_class.h system
22004 set fp_class.h i_fp_class
22007 : see if gdbm.h is available
22012 : see if gdbm_open exists
22013 set gdbm_open d_gdbm_open
22015 case "$d_gdbm_open" in
22018 echo "We won't be including <gdbm.h>"
22027 : see if this is a ieeefp.h system
22028 case "$i_ieeefp" in
22029 '' ) set ieeefp.h i_ieeefp
22034 : see if this is a libutil.h system
22035 set libutil.h i_libutil
22038 : see if mach cthreads are available
22039 if test "X$usethreads" = "X$define"; then
22040 set mach/cthreads.h i_machcthr
22043 i_machcthr="$undef"
22046 : see if this is a mntent.h system
22047 set mntent.h i_mntent
22050 : see if net/errno.h is available
22052 set net/errno.h val
22055 : Unfortunately, it causes problems on some systems. Arrgh.
22058 cat > try.c <<'EOM'
22061 #include <net/errno.h>
22067 if $cc $ccflags -c try.c >/dev/null 2>&1; then
22068 echo "We'll be including <net/errno.h>." >&4
22070 echo "We won't be including <net/errno.h>." >&4
22079 : see if netinet/tcp.h is available
22080 set netinet/tcp.h i_netinettcp
22083 : see if this is a poll.h system
22087 : see if this is a prot.h system
22091 : Preprocessor symbols
22093 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
22094 $cat <<'EOSH' > Cppsym.know
22095 a29k aarch64 ABI64 aegis AES_SOURCE AIX AIX32 AIX370 AIX41 AIX42
22096 AIX43 aixpc AIX_SOURCE alliant ALL_SOURCE alpha AM29000 am29000
22097 AMD64 amd64 amiga AMIGAOS AMIX ansi ANSI_C_SOURCE apollo arch_ppc
22098 arch_pwr ardent ARM ARM32 atarist att386 att3b
22099 BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
22100 BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
22101 byteorder byte_order
22102 c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
22103 convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
22104 DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
22105 ELF encore EPI EXTENSIONS
22106 FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
22107 GCC_NEW_VARARGS gcos gcx gimpel GLIBC GLIBC_MINOR GNUC GNUC_MINOR
22108 GNU_LIBRARY GNU_SOURCE GO32 gould GOULD_PN
22109 H3050R H3050RX hbullx20 hcx host_mips hp200 hp300 HP700 hp700
22110 hp800 hp9000 hp9000s200 hp9000s300 hp9000s400 hp9000s500
22111 hp9000s700 hp9000s800 hp9k8 hppa hpux HPUX_SOURCE hp_osf
22112 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960 IA32 IA64
22113 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
22114 INLINE_INTRINSICS INT64 INTEL interdata INTRINSICS is68k itanium
22116 LANGUAGE_C LARGEFILE64_SOURCE LARGEFILE_SOURCE LARGE_FILE_API
22117 LFS64_LARGEFILE LFS_LARGEFILE LIBCATAMOUNT Linux LITTLE_ENDIAN
22118 LONG64 LONGDOUBLE LONGLONG LONG_DOUBLE LONG_LONG LP64 luna
22120 M68000 m68k m88100 m88k M88KBCS_TARGET MACH machine MachTen
22121 MATH_HAS_NO_SIDE_EFFECTS mc300 mc500 mc68000 mc68010 mc68020
22122 mc68030 mc68040 mc68060 mc68k mc68k32 mc700 mc88000 mc88100
22123 merlin mert MiNT mips MIPSEB MIPSEL MIPS_FPSET MIPS_ISA MIPS_SIM
22124 MIPS_SZINT MIPS_SZLONG MIPS_SZPTR MODERN_C motorola mpeix MSDOS
22125 MTXINU MULTIMAX MVS mvs M_AMD64 M_ARM M_ARMT M_COFF M_I186 M_I286
22126 M_I386 M_I8086 M_I86 M_I86SM M_IA64 M_IX86 M_PPC M_SYS3 M_SYS5
22127 M_SYSIII M_SYSV M_UNIX M_X86 M_XENIX
22128 n16 ncl_el ncl_mr NetBSD news1500 news1700 news1800 news1900
22129 news3700 news700 news800 news900 NeXT NLS nonstopux ns16000
22130 ns32000 ns32016 ns32332 ns32k nsc32000
22131 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
22132 PARAGON parisc pa_risc PA_RISC1_1 PA_RISC2_0 pc532 pdp11 PGC PIC
22133 plexus PORTAR posix POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
22134 POSIX_C_SOURCE POSIX_SOURCE POWER powerpc ppc PROTOTYPES PWB pyr
22136 R3000 REENTRANT RES Rhapsody RISC6000 riscix riscos RT
22137 S390 S390x SA110 SCO scs sequent sgi SGI_SOURCE SH SH3 sinix
22138 SIZE_INT SIZE_LONG SIZE_PTR SOCKETS_SOURCE SOCKET_SOURCE sony
22139 sonyrisc sony_news sparc sparclite sparcv8 sparcv9 spectrum
22140 stardent stdc STDC_EXT stratos sun sun3 sun386 Sun386i svr3 svr4
22141 SVR4_2 SVR4_SOURCE svr5 SX system SYSTYPE_BSD SYSTYPE_BSD43
22142 SYSTYPE_BSD44 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3
22143 SYSV4 SYSV5 sysV68 sysV88
22144 Tek4132 Tek4300 thumb thw_370 thw_intel thw_rs6000 titan TM3200
22145 TM5400 TM5600 tower tower32 tower32_200 tower32_600 tower32_700
22146 tower32_800 tower32_850 tss
22147 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5 ultrix UMAXV UnicomPBB
22148 UnicomPBD UNICOS UNICOSMK unix UNIX95 UNIX99 unixpc unos USE_BSD
22149 USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE
22150 USE_LARGEFILE64 USE_MISC USE_POSIX USE_POSIX199309
22151 USE_POSIX199506 USE_POSIX2 USE_REENTRANT USE_SVID USE_UNIX98
22152 USE_XOPEN USE_XOPEN_EXTENDED USGr4 USGr4_2 UTek Utek UTS UWIN
22154 vax venix VMESA vms
22155 x86_64 xenix Xenix286 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2
22156 XPG2_EXTENDED XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
22159 # Maybe put other stuff here too.
22160 ./tr '-' '_' <<EOSH >>Cppsym.know
22163 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
22164 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
22165 $cat Cppsym.know > Cppsym.c
22166 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
22167 $rm -f Cppsym.a Cppsym.b Cppsym.c
22168 cat <<EOSH > Cppsym
22170 if $test \$# -gt 0; then
22171 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
22172 if $test -s Cppsym.got; then
22179 $tr " " "$trnl" | ./Cppsym.try
22185 cat <<EOSH > Cppsym.try
22187 cat <<'EOCP' > try.c
22190 #define STRINGIFY(a) "a"
22192 #if cpp_stuff == 42
22193 #define StGiFy(a) #a
22194 #define STRINGIFY(a) StGiFy(a)
22196 #if $cpp_stuff != 1 && $cpp_stuff != 42
22197 # include "Bletch: How does this C preprocessor stringify macros?"
22203 cat <<'EOSH' >> Cppsym.try
22205 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
22206 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
22207 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
22208 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
22210 echo 'return 0;}' >> try.c
22212 cat <<EOSH >> Cppsym.try
22214 case "$osname-$gccversion" in
22215 irix-) ccflags="\$ccflags -woff 1178" ;;
22216 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
22218 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
22220 chmod +x Cppsym.try
22221 $eunicefix Cppsym.try
22222 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
22223 : Add in any Linux cpp "predefined macros":
22224 case "$osname::$gccversion" in
22225 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
22227 rm -f $tHdrH'.h' $tHdrH
22229 # Filter out macro arguments, such as Linux's __INT8_C(c)
22230 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
22231 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
22232 if [ -s $tHdrH'_cppsym.real' ]; then
22233 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
22236 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
22239 : now check the C compiler for additional symbols
22240 postprocess_cc_v=''
22242 aix) postprocess_cc_v="|$tr , ' '" ;;
22249 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
22252 -D*) echo "\$i" | $sed 's/^-D//';;
22253 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
22258 postprocess_cc_v=''
22261 ./ccsym > ccsym1.raw
22262 if $test -s ccsym1.raw; then
22263 $sort ccsym1.raw | $uniq >ccsym.raw
22265 mv ccsym1.raw ccsym.raw
22268 $awk '/\=/ { print $0; next }
22269 { print $0"=1" }' ccsym.raw >ccsym.list
22270 $comm -13 Cppsym.true ccsym.list >ccsym.own
22271 $comm -12 Cppsym.true ccsym.list >ccsym.com
22272 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
22274 if $test -z ccsym.raw; then
22275 echo "Your C compiler doesn't seem to define any symbols!" >&4
22277 echo "However, your C preprocessor defines the following symbols:"
22280 cppsymbols=`$cat Cppsym.true`
22281 cppsymbols=`echo $cppsymbols`
22282 cppccsymbols="$cppsymbols"
22284 if $test -s ccsym.com; then
22285 echo "Your C compiler and pre-processor define these symbols:"
22286 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
22289 cppccsymbols=`$cat ccsym.com`
22290 cppccsymbols=`echo $cppccsymbols`
22291 $test "$silent" || sleep 1
22293 if $test -s ccsym.cpp; then
22294 $test "$also" && echo " "
22295 echo "Your C pre-processor ${also}defines the following symbols:"
22296 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
22298 cppsymbols=`$cat ccsym.cpp`
22299 cppsymbols=`echo $cppsymbols`
22300 $test "$silent" || sleep 1
22302 if $test -s ccsym.own; then
22303 $test "$also" && echo " "
22304 echo "Your C compiler ${also}defines the following cpp symbols:"
22305 $sed -e 's/\(..*\)=1/\1/' ccsym.own
22306 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
22307 ccsymbols=`$cat ccsym.own`
22308 ccsymbols=`echo $ccsymbols`
22309 $test "$silent" || sleep 1
22313 : add -D_FORTIFY_SOURCE if feasible and not already there
22314 case "$gccversion" in
22315 4.*) case "$optimize$ccflags" in
22316 *-O*) case "$ccflags$cppsymbols" in
22317 *_FORTIFY_SOURCE=*) # Don't add it again.
22318 echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
22320 *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4
22321 ccflags="$ccflags -D_FORTIFY_SOURCE=2"
22325 *) echo "You have gcc 4.* but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
22329 *) echo "You seem not to have gcc 4.*, not adding -D_FORTIFY_SOURCE." >&4
22333 : see if this is a termio system
22337 if $test `./findhdr termios.h`; then
22338 set tcsetattr i_termios
22344 "$define") echo "You have POSIX termios.h... good!" >&4;;
22345 *) if ./Cppsym pyr; then
22346 case "`$run /bin/universe`" in
22347 ucb) if $test `./findhdr sgtty.h`; then
22349 echo "<sgtty.h> found." >&4
22351 echo "System is pyramid with BSD universe."
22352 ./warn "<sgtty.h> not found--you could have problems."
22354 *) if $test `./findhdr termio.h`; then
22356 echo "<termio.h> found." >&4
22358 echo "System is pyramid with USG universe."
22359 ./warn "<termio.h> not found--you could have problems."
22363 if $test `./findhdr termio.h`; then
22364 echo "<termio.h> found." >&4
22366 elif $test `./findhdr sgtty.h`; then
22367 echo "<sgtty.h> found." >&4
22370 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
22373 if $test `./findhdr sgtty.h`; then
22374 echo "<sgtty.h> found." >&4
22376 elif $test `./findhdr termio.h`; then
22377 echo "<termio.h> found." >&4
22380 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
22384 set i_termio; eval $setvar
22385 val=$val2; set i_sgtty; eval $setvar
22386 val=$val3; set i_termios; eval $setvar
22388 : see if stdbool is available
22389 : we want a real compile instead of Inhdr because some Solaris systems
22390 : have stdbool.h, but it can only be used if the compiler indicates it
22391 : is sufficiently c99-compliant.
22395 #include <stdbool.h>
22400 int main(int argc, char **argv)
22406 if eval $compile; then
22407 echo "<stdbool.h> found." >&4
22410 echo "<stdbool.h> NOT found." >&4
22417 : see if stddef is available
22418 set stddef.h i_stddef
22421 : see if sys/access.h is available
22422 set sys/access.h i_sysaccess
22425 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
22426 set sys/filio.h i_sysfilio
22429 if $test `./findhdr sys/ioctl.h`; then
22431 echo '<sys/ioctl.h> found.' >&4
22434 if $test $i_sysfilio = "$define"; then
22435 echo '<sys/ioctl.h> NOT found.' >&4
22437 $test $i_sgtty = "$define" && xxx="sgtty.h"
22438 $test $i_termio = "$define" && xxx="termio.h"
22439 $test $i_termios = "$define" && xxx="termios.h"
22440 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
22446 : see if socket ioctl defs are in sys/sockio.h
22448 xxx=`./findhdr sys/sockio.h`
22449 if $test "$xxx"; then
22450 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
22452 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
22455 echo "No socket ioctls found in <sys/sockio.h>." >&4
22460 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
22466 : see if this is a syslog.h system
22467 set syslog.h i_syslog
22470 : see if this is a sys/mode.h system
22471 set sys/mode.h i_sysmode
22474 : see if there is a sys/poll.h file
22475 set sys/poll.h i_syspoll
22478 : see if sys/resource.h has to be included
22479 set sys/resource.h i_sysresrc
22482 : see if sys/security.h is available
22483 set sys/security.h i_syssecrt
22486 : see if this is a sys/statvfs.h system
22487 set sys/statvfs.h i_sysstatvfs
22490 : see if this is a sys/un.h system
22491 set sys/un.h i_sysun
22494 : see if this is a sys/utsname.h system
22495 set sys/utsname.h i_sysutsname
22498 : see if this is a syswait system
22499 set sys/wait.h i_syswait
22502 : see if this is a ustat.h system
22503 set ustat.h i_ustat
22506 : see if this is an utime system
22507 set utime.h i_utime
22510 : see if this is a vfork system
22513 set vfork.h i_vfork
22523 echo "Looking for extensions..." >&4
22524 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
22525 : contain old or inaccurate or duplicate values.
22526 nonxs_extensions=''
22528 : We do not use find because it might not be available.
22529 : We do not just use MANIFEST because the user may have dropped
22530 : some additional extensions into the source tree and expect them
22533 : Function to recursively find available extensions, ignoring DynaLoader
22534 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
22535 : In 5.10.1 and later, extensions are stored in directories
22536 : like File-Glob instead of the older File/Glob/.
22540 DynaLoader|dynaload) ;;
22542 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
22543 case "$this_ext" in
22544 Scalar/List/Utils) this_ext="List/Util" ;;
22545 PathTools) this_ext="Cwd" ;;
22547 echo " $xs_extensions $nonxs_extensions" > $tdir/$$.tmp;
22548 if $contains " $this_ext " $tdir/$$.tmp; then
22550 echo "Duplicate directories detected for extension $xxx" >&4;
22551 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
22552 case "$knowitall" in
22560 echo "Ok. Stopping Configure." >&4;
22561 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
22564 echo "Ok. You will need to correct config.sh before running make." >&4;
22566 $ls -1 $xxx > $tdir/$$.tmp;
22567 if $contains "\.xs$" $tdir/$$.tmp > /dev/null 2>&1; then
22568 xs_extensions="$xs_extensions $this_ext";
22569 elif $contains "\.c$" $tdir/$$.tmp > /dev/null 2>&1; then
22570 xs_extensions="$xs_extensions $this_ext";
22571 elif $test -d $xxx; then
22572 nonxs_extensions="$nonxs_extensions $this_ext";
22574 $rm -f $tdir/$$.tmp;
22582 eval $find_extensions
22586 eval $find_extensions
22590 eval $find_extensions
22591 set X $xs_extensions
22593 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22594 set X $nonxs_extensions
22596 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22598 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
22600 : Now see which are supported on this system.
22602 for xxx in $xs_extensions ; do
22606 $define) avail_ext="$avail_ext $xxx" ;;
22609 GDBM_File|gdbm_fil)
22611 $define) avail_ext="$avail_ext $xxx" ;;
22614 I18N/Langinfo|i18n_lan)
22615 case "$i_langinfo$d_nl_langinfo" in
22616 $define$define) avail_ext="$avail_ext $xxx" ;;
22620 : XXX Do we need a useipcsysv variable here
22621 case "${d_msg}${d_sem}${d_shm}" in
22622 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
22625 NDBM_File|ndbm_fil)
22628 case "$osname-$use64bitint" in
22631 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
22634 *) avail_ext="$avail_ext $xxx" ;;
22639 ODBM_File|odbm_fil)
22640 case "${i_dbm}${i_rpcsvcdbm}" in
22642 case "$d_cplusplus" in
22643 define) ;; # delete as a function name will not work
22644 *) case "$osname-$use64bitint" in
22647 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
22650 *) avail_ext="$avail_ext $xxx" ;;
22658 case "$useopcode" in
22659 true|define|y) avail_ext="$avail_ext $xxx" ;;
22663 case "$useposix" in
22664 true|define|y) avail_ext="$avail_ext $xxx" ;;
22668 case "$d_socket" in
22669 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22672 Sys/Syslog|sys/syslog)
22673 : XXX syslog requires socket
22674 case "$d_socket" in
22675 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22679 case "$usethreads" in
22681 case "$use5005threads" in
22682 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
22686 threads|threads/shared)
22687 # threads and threads::shared are special cases.
22688 # To stop people from asking "Perl 5.8.0 was supposed
22689 # to have this new fancy threads implementation but my
22690 # perl doesn't have it" and from people trying to
22691 # (re)install the threads module using CPAN.pm and
22692 # CPAN.pm then offering to reinstall Perl 5.8.0,
22693 # the threads.pm and threads/shared.pm will always be
22694 # there, croaking informatively ("you need to rebuild
22695 # all of Perl with threads, sorry") when threads haven't
22696 # been compiled in.
22698 avail_ext="$avail_ext $xxx"
22704 cygwin) avail_ext="$avail_ext $xxx" ;;
22707 XS/APItest|xs/apitest)
22708 # This is just for testing. Skip it unless we have dynamic loading.
22711 $define) avail_ext="$avail_ext $xxx" ;;
22714 XS/Typemap|xs/typemap)
22715 # This is just for testing. Skip it unless we have dynamic loading.
22717 $define) avail_ext="$avail_ext $xxx" ;;
22720 *) avail_ext="$avail_ext $xxx"
22729 case "$onlyextensions" in
22731 *) keepextensions=''
22732 echo "You have requested that only certain extensions be included..." >&4
22733 for i in $onlyextensions; do
22734 case " $avail_ext " in
22736 echo "Keeping extension $i."
22737 keepextensions="$keepextensions $i"
22739 *) echo "Ignoring extension $i." ;;
22742 avail_ext="$keepextensions"
22746 case "$noextensions" in
22748 *) keepextensions=''
22749 echo "You have requested that certain extensions be ignored..." >&4
22750 for i in $avail_ext; do
22751 case " $noextensions " in
22752 *" $i "*) echo "Ignoring extension $i." ;;
22753 *) echo "Keeping extension $i.";
22754 keepextensions="$keepextensions $i"
22758 avail_ext="$keepextensions"
22762 : Now see which nonxs extensions are supported on this system.
22763 : For now assume all are.
22765 for xxx in $nonxs_extensions ; do
22769 *) nonxs_ext="$nonxs_ext $xxx"
22781 A number of extensions are supplied with $package. You may choose to
22782 compile these extensions for dynamic loading (the default), compile
22783 them into the $package executable (static loading), or not include
22784 them at all. Answer "none" to include no extensions.
22785 Note that DynaLoader is always built and need not be mentioned here.
22788 case "$dynamic_ext" in
22790 : Exclude those listed in static_ext
22792 for xxx in $avail_ext; do
22793 case " $static_ext " in
22795 *) dflt="$dflt $xxx" ;;
22802 *) dflt="$dynamic_ext"
22803 # Perhaps we are reusing an old out-of-date config.sh.
22806 if test X"$dynamic_ext" != X"$avail_ext"; then
22808 NOTICE: Your previous config.sh list may be incorrect.
22809 The extensions now available to you are
22811 but the default list from your previous config.sh is
22823 rp="What extensions do you wish to load dynamically?"
22826 none) dynamic_ext=' ' ;;
22827 *) dynamic_ext="$ans" ;;
22830 case "$static_ext" in
22832 : Exclude those already listed in dynamic linking
22834 for xxx in $avail_ext; do
22835 case " $dynamic_ext " in
22837 *) dflt="$dflt $xxx" ;;
22844 *) dflt="$static_ext"
22851 rp="What extensions do you wish to load statically?"
22854 none) static_ext=' ' ;;
22855 *) static_ext="$ans" ;;
22860 A number of extensions are supplied with $package. Answer "none"
22861 to include no extensions.
22862 Note that DynaLoader is always built and need not be mentioned here.
22865 case "$static_ext" in
22866 '') dflt="$avail_ext" ;;
22867 *) dflt="$static_ext"
22868 # Perhaps we are reusing an old out-of-date config.sh.
22871 if test X"$static_ext" != X"$avail_ext"; then
22873 NOTICE: Your previous config.sh list may be incorrect.
22874 The extensions now available to you are
22876 but the default list from your previous config.sh is
22885 : Exclude those that are not xs extensions
22889 rp="What extensions do you wish to include?"
22892 none) static_ext=' ' ;;
22893 *) static_ext="$ans" ;;
22898 # Encode is a special case. If we are building Encode as a static
22899 # extension, we need to explicitly list its subextensions as well.
22900 # For other nested extensions, this is handled automatically by
22901 # the appropriate Makefile.PL.
22902 case " $static_ext " in
22903 *" Encode "*) # Add the subextensions of Encode
22905 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22906 static_ext="$static_ext Encode/$xxx"
22907 known_extensions="$known_extensions Encode/$xxx"
22913 set X $dynamic_ext $static_ext $nonxs_ext
22917 # Sanity check: We require an extension suitable for use with
22918 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22919 # should show up as failures in the test suite, but it's helpful to
22920 # catch them now.) The 'extensions' list is normally sorted
22921 # alphabetically, so we need to accept either
22922 # DB_File ... Fcntl ... IO ....
22923 # or something like
22924 # Fcntl ... NDBM_File ... IO ....
22925 case " $extensions" in
22926 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22927 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22928 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22929 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22930 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22934 : Remove libraries needed only for extensions
22935 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22936 : The exception is SunOS 4.x, which needs them.
22937 case "${osname}X${osvers}" in
22941 *) case "$usedl" in
22942 $define|true|[yY]*)
22943 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22947 *) perllibs="$libs"
22953 : Remove build directory name from cppstdin so it can be used from
22954 : either the present location or the final installed location.
22956 : Get out of the UU directory to get correct path name.
22958 case "$cppstdin" in
22960 echo "Stripping down cppstdin path name"
22966 : end of configuration questions
22968 echo "End of configuration questions."
22971 : back to where it started
22972 if test -d ../UU; then
22976 : configuration may be unconditionally patched via a 'config.arch' file
22977 if $test -f config.arch; then
22978 echo "I see a config.arch file, loading it." >&4
22982 : configuration may be patched via a 'config.over' file
22983 if $test -f config.over; then
22986 rp='I see a config.over file. Do you wish to load it?'
22989 n*) echo "OK, I'll ignore it.";;
22991 echo "Configuration override changes have been loaded."
22996 : in case they want portability, strip down executable paths
22997 case "$d_portable" in
23000 echo "Stripping down executable paths..." >&4
23001 for file in $loclist $trylist; do
23003 eval $file=`basename $temp`
23008 : create config.sh file
23010 echo "Creating config.sh..." >&4
23011 $spitshell <<EOT >config.sh
23014 # This file was produced by running the Configure script. It holds all the
23015 # definitions figured out by Configure. Should you modify one of these values,
23016 # do not forget to propagate your changes by running "Configure -der". You may
23017 # instead choose to run each of the .SH files by yourself, or "Configure -S".
23020 # Package name : $package
23021 # Source directory : $src
23022 # Configuration time: $cf_time
23023 # Configured by : $cf_by
23024 # Target system : $myuname
23027 : Add in command line options if available
23028 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23030 $spitshell <<EOT >>config.sh
23039 Revision='$Revision'
23047 alignbytes='$alignbytes'
23048 ansi2knr='$ansi2knr'
23049 aphostname='$aphostname'
23050 api_revision='$api_revision'
23051 api_subversion='$api_subversion'
23052 api_version='$api_version'
23053 api_versionstring='$api_versionstring'
23056 archlibexp='$archlibexp'
23057 archname64='$archname64'
23058 archname='$archname'
23059 archobjs='$archobjs'
23060 asctime_r_proto='$asctime_r_proto'
23069 byteorder='$byteorder'
23071 castflags='$castflags'
23074 cccdlflags='$cccdlflags'
23075 ccdlflags='$ccdlflags'
23077 ccflags_uselargefiles='$ccflags_uselargefiles'
23079 ccsymbols='$ccsymbols'
23080 ccversion='$ccversion'
23082 cf_email='$cf_email'
23084 charbits='$charbits'
23085 charsize='$charsize'
23089 clocktype='$clocktype'
23091 compress='$compress'
23092 contains='$contains'
23096 cpp_stuff='$cpp_stuff'
23097 cppccsymbols='$cppccsymbols'
23098 cppflags='$cppflags'
23100 cppminus='$cppminus'
23102 cppstdin='$cppstdin'
23103 cppsymbols='$cppsymbols'
23104 crypt_r_proto='$crypt_r_proto'
23105 cryptlib='$cryptlib'
23107 ctermid_r_proto='$ctermid_r_proto'
23108 ctime_r_proto='$ctime_r_proto'
23109 d_Gconvert='$d_Gconvert'
23110 d_PRIEUldbl='$d_PRIEUldbl'
23111 d_PRIFUldbl='$d_PRIFUldbl'
23112 d_PRIGUldbl='$d_PRIGUldbl'
23113 d_PRIXU64='$d_PRIXU64'
23114 d_PRId64='$d_PRId64'
23115 d_PRIeldbl='$d_PRIeldbl'
23116 d_PRIfldbl='$d_PRIfldbl'
23117 d_PRIgldbl='$d_PRIgldbl'
23118 d_PRIi64='$d_PRIi64'
23119 d_PRIo64='$d_PRIo64'
23120 d_PRIu64='$d_PRIu64'
23121 d_PRIx64='$d_PRIx64'
23122 d_SCNfldbl='$d_SCNfldbl'
23123 d__fwalk='$d__fwalk'
23124 d_access='$d_access'
23125 d_accessx='$d_accessx'
23128 d_archlib='$d_archlib'
23129 d_asctime64='$d_asctime64'
23130 d_asctime_r='$d_asctime_r'
23133 d_attribute_deprecated='$d_attribute_deprecated'
23134 d_attribute_format='$d_attribute_format'
23135 d_attribute_malloc='$d_attribute_malloc'
23136 d_attribute_nonnull='$d_attribute_nonnull'
23137 d_attribute_noreturn='$d_attribute_noreturn'
23138 d_attribute_pure='$d_attribute_pure'
23139 d_attribute_unused='$d_attribute_unused'
23140 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
23141 d_backtrace='$d_backtrace'
23145 d_bsdgetpgrp='$d_bsdgetpgrp'
23146 d_bsdsetpgrp='$d_bsdsetpgrp'
23147 d_builtin_choose_expr='$d_builtin_choose_expr'
23148 d_builtin_expect='$d_builtin_expect'
23150 d_c99_variadic_macros='$d_c99_variadic_macros'
23151 d_casti32='$d_casti32'
23152 d_castneg='$d_castneg'
23153 d_charvspr='$d_charvspr'
23155 d_chroot='$d_chroot'
23156 d_chsize='$d_chsize'
23158 d_clearenv='$d_clearenv'
23159 d_closedir='$d_closedir'
23160 d_cmsghdr_s='$d_cmsghdr_s'
23162 d_copysignl='$d_copysignl'
23163 d_cplusplus='$d_cplusplus'
23165 d_crypt_r='$d_crypt_r'
23167 d_ctermid='$d_ctermid'
23168 d_ctermid_r='$d_ctermid_r'
23169 d_ctime64='$d_ctime64'
23170 d_ctime_r='$d_ctime_r'
23171 d_cuserid='$d_cuserid'
23172 d_dbl_dig='$d_dbl_dig'
23173 d_dbminitproto='$d_dbminitproto'
23174 d_difftime64='$d_difftime64'
23175 d_difftime='$d_difftime'
23176 d_dir_dd_fd='$d_dir_dd_fd'
23178 d_dirnamlen='$d_dirnamlen'
23179 d_dladdr='$d_dladdr'
23180 d_dlerror='$d_dlerror'
23181 d_dlopen='$d_dlopen'
23182 d_dlsymun='$d_dlsymun'
23183 d_dosuid='$d_dosuid'
23184 d_drand48_r='$d_drand48_r'
23185 d_drand48proto='$d_drand48proto'
23187 d_eaccess='$d_eaccess'
23188 d_endgrent='$d_endgrent'
23189 d_endgrent_r='$d_endgrent_r'
23190 d_endhent='$d_endhent'
23191 d_endhostent_r='$d_endhostent_r'
23192 d_endnent='$d_endnent'
23193 d_endnetent_r='$d_endnetent_r'
23194 d_endpent='$d_endpent'
23195 d_endprotoent_r='$d_endprotoent_r'
23196 d_endpwent='$d_endpwent'
23197 d_endpwent_r='$d_endpwent_r'
23198 d_endsent='$d_endsent'
23199 d_endservent_r='$d_endservent_r'
23200 d_eofnblk='$d_eofnblk'
23201 d_eunice='$d_eunice'
23202 d_faststdio='$d_faststdio'
23203 d_fchdir='$d_fchdir'
23204 d_fchmod='$d_fchmod'
23205 d_fchown='$d_fchown'
23207 d_fcntl_can_lock='$d_fcntl_can_lock'
23208 d_fd_macros='$d_fd_macros'
23209 d_fd_set='$d_fd_set'
23210 d_fds_bits='$d_fds_bits'
23211 d_fgetpos='$d_fgetpos'
23212 d_finite='$d_finite'
23213 d_finitel='$d_finitel'
23214 d_flexfnam='$d_flexfnam'
23216 d_flockproto='$d_flockproto'
23218 d_fp_class='$d_fp_class'
23219 d_fpathconf='$d_fpathconf'
23220 d_fpclass='$d_fpclass'
23221 d_fpclassify='$d_fpclassify'
23222 d_fpclassl='$d_fpclassl'
23223 d_fpos64_t='$d_fpos64_t'
23224 d_frexpl='$d_frexpl'
23225 d_fs_data_s='$d_fs_data_s'
23226 d_fseeko='$d_fseeko'
23227 d_fsetpos='$d_fsetpos'
23228 d_fstatfs='$d_fstatfs'
23229 d_fstatvfs='$d_fstatvfs'
23231 d_ftello='$d_ftello'
23233 d_futimes='$d_futimes'
23234 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
23235 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
23236 d_getaddrinfo='$d_getaddrinfo'
23237 d_getcwd='$d_getcwd'
23238 d_getespwnam='$d_getespwnam'
23239 d_getfsstat='$d_getfsstat'
23240 d_getgrent='$d_getgrent'
23241 d_getgrent_r='$d_getgrent_r'
23242 d_getgrgid_r='$d_getgrgid_r'
23243 d_getgrnam_r='$d_getgrnam_r'
23244 d_getgrps='$d_getgrps'
23245 d_gethbyaddr='$d_gethbyaddr'
23246 d_gethbyname='$d_gethbyname'
23247 d_gethent='$d_gethent'
23248 d_gethname='$d_gethname'
23249 d_gethostbyaddr_r='$d_gethostbyaddr_r'
23250 d_gethostbyname_r='$d_gethostbyname_r'
23251 d_gethostent_r='$d_gethostent_r'
23252 d_gethostprotos='$d_gethostprotos'
23253 d_getitimer='$d_getitimer'
23254 d_getlogin='$d_getlogin'
23255 d_getlogin_r='$d_getlogin_r'
23256 d_getmnt='$d_getmnt'
23257 d_getmntent='$d_getmntent'
23258 d_getnameinfo='$d_getnameinfo'
23259 d_getnbyaddr='$d_getnbyaddr'
23260 d_getnbyname='$d_getnbyname'
23261 d_getnent='$d_getnent'
23262 d_getnetbyaddr_r='$d_getnetbyaddr_r'
23263 d_getnetbyname_r='$d_getnetbyname_r'
23264 d_getnetent_r='$d_getnetent_r'
23265 d_getnetprotos='$d_getnetprotos'
23266 d_getpagsz='$d_getpagsz'
23267 d_getpbyname='$d_getpbyname'
23268 d_getpbynumber='$d_getpbynumber'
23269 d_getpent='$d_getpent'
23270 d_getpgid='$d_getpgid'
23271 d_getpgrp2='$d_getpgrp2'
23272 d_getpgrp='$d_getpgrp'
23273 d_getppid='$d_getppid'
23274 d_getprior='$d_getprior'
23275 d_getprotobyname_r='$d_getprotobyname_r'
23276 d_getprotobynumber_r='$d_getprotobynumber_r'
23277 d_getprotoent_r='$d_getprotoent_r'
23278 d_getprotoprotos='$d_getprotoprotos'
23279 d_getprpwnam='$d_getprpwnam'
23280 d_getpwent='$d_getpwent'
23281 d_getpwent_r='$d_getpwent_r'
23282 d_getpwnam_r='$d_getpwnam_r'
23283 d_getpwuid_r='$d_getpwuid_r'
23284 d_getsbyname='$d_getsbyname'
23285 d_getsbyport='$d_getsbyport'
23286 d_getsent='$d_getsent'
23287 d_getservbyname_r='$d_getservbyname_r'
23288 d_getservbyport_r='$d_getservbyport_r'
23289 d_getservent_r='$d_getservent_r'
23290 d_getservprotos='$d_getservprotos'
23291 d_getspnam='$d_getspnam'
23292 d_getspnam_r='$d_getspnam_r'
23293 d_gettimeod='$d_gettimeod'
23294 d_gmtime64='$d_gmtime64'
23295 d_gmtime_r='$d_gmtime_r'
23296 d_gnulibc='$d_gnulibc'
23297 d_grpasswd='$d_grpasswd'
23298 d_hasmntopt='$d_hasmntopt'
23300 d_ilogbl='$d_ilogbl'
23301 d_inc_version_list='$d_inc_version_list'
23303 d_inetaton='$d_inetaton'
23304 d_inetntop='$d_inetntop'
23305 d_inetpton='$d_inetpton'
23306 d_int64_t='$d_int64_t'
23307 d_ip_mreq='$d_ip_mreq'
23308 d_ip_mreq_source='$d_ip_mreq_source'
23309 d_ipv6_mreq='$d_ipv6_mreq'
23310 d_ipv6_mreq_source='$d_ipv6_mreq_source'
23311 d_isascii='$d_isascii'
23312 d_isblank='$d_isblank'
23313 d_isfinite='$d_isfinite'
23316 d_isnanl='$d_isnanl'
23317 d_killpg='$d_killpg'
23318 d_lchown='$d_lchown'
23319 d_ldbl_dig='$d_ldbl_dig'
23320 d_ldexpl='$d_ldexpl'
23321 d_libm_lib_version='$d_libm_lib_version'
23322 d_libname_unique='$d_libname_unique'
23324 d_localtime64='$d_localtime64'
23325 d_localtime_r='$d_localtime_r'
23326 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
23327 d_locconv='$d_locconv'
23329 d_longdbl='$d_longdbl'
23330 d_longlong='$d_longlong'
23331 d_lseekproto='$d_lseekproto'
23333 d_madvise='$d_madvise'
23334 d_malloc_good_size='$d_malloc_good_size'
23335 d_malloc_size='$d_malloc_size'
23337 d_mbstowcs='$d_mbstowcs'
23338 d_mbtowc='$d_mbtowc'
23339 d_memchr='$d_memchr'
23340 d_memcmp='$d_memcmp'
23341 d_memcpy='$d_memcpy'
23342 d_memmove='$d_memmove'
23343 d_memset='$d_memset'
23345 d_mkdtemp='$d_mkdtemp'
23346 d_mkfifo='$d_mkfifo'
23347 d_mkstemp='$d_mkstemp'
23348 d_mkstemps='$d_mkstemps'
23349 d_mktime64='$d_mktime64'
23350 d_mktime='$d_mktime'
23353 d_modfl_pow32_bug='$d_modfl_pow32_bug'
23354 d_modflproto='$d_modflproto'
23355 d_mprotect='$d_mprotect'
23357 d_msg_ctrunc='$d_msg_ctrunc'
23358 d_msg_dontroute='$d_msg_dontroute'
23359 d_msg_oob='$d_msg_oob'
23360 d_msg_peek='$d_msg_peek'
23361 d_msg_proxy='$d_msg_proxy'
23362 d_msgctl='$d_msgctl'
23363 d_msgget='$d_msgget'
23364 d_msghdr_s='$d_msghdr_s'
23365 d_msgrcv='$d_msgrcv'
23366 d_msgsnd='$d_msgsnd'
23368 d_munmap='$d_munmap'
23369 d_mymalloc='$d_mymalloc'
23371 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
23373 d_nl_langinfo='$d_nl_langinfo'
23374 d_nv_preserves_uv='$d_nv_preserves_uv'
23375 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
23376 d_off64_t='$d_off64_t'
23377 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
23378 d_oldpthreads='$d_oldpthreads'
23379 d_oldsock='$d_oldsock'
23381 d_pathconf='$d_pathconf'
23383 d_perl_otherlibdirs='$d_perl_otherlibdirs'
23384 d_phostname='$d_phostname'
23387 d_portable='$d_portable'
23389 d_prctl_set_name='$d_prctl_set_name'
23390 d_printf_format_null='$d_printf_format_null'
23391 d_procselfexe='$d_procselfexe'
23392 d_pseudofork='$d_pseudofork'
23393 d_pthread_atfork='$d_pthread_atfork'
23394 d_pthread_attr_setscope='$d_pthread_attr_setscope'
23395 d_pthread_yield='$d_pthread_yield'
23396 d_ptrdiff_t='$d_ptrdiff_t'
23398 d_pwchange='$d_pwchange'
23399 d_pwclass='$d_pwclass'
23400 d_pwcomment='$d_pwcomment'
23401 d_pwexpire='$d_pwexpire'
23402 d_pwgecos='$d_pwgecos'
23403 d_pwpasswd='$d_pwpasswd'
23404 d_pwquota='$d_pwquota'
23407 d_random_r='$d_random_r'
23408 d_readdir64_r='$d_readdir64_r'
23409 d_readdir='$d_readdir'
23410 d_readdir_r='$d_readdir_r'
23411 d_readlink='$d_readlink'
23413 d_recvmsg='$d_recvmsg'
23414 d_rename='$d_rename'
23415 d_rewinddir='$d_rewinddir'
23417 d_safebcpy='$d_safebcpy'
23418 d_safemcpy='$d_safemcpy'
23419 d_sanemcmp='$d_sanemcmp'
23420 d_sbrkproto='$d_sbrkproto'
23421 d_scalbnl='$d_scalbnl'
23422 d_sched_yield='$d_sched_yield'
23423 d_scm_rights='$d_scm_rights'
23424 d_seekdir='$d_seekdir'
23425 d_select='$d_select'
23427 d_semctl='$d_semctl'
23428 d_semctl_semid_ds='$d_semctl_semid_ds'
23429 d_semctl_semun='$d_semctl_semun'
23430 d_semget='$d_semget'
23432 d_sendmsg='$d_sendmsg'
23433 d_setegid='$d_setegid'
23434 d_seteuid='$d_seteuid'
23435 d_setgrent='$d_setgrent'
23436 d_setgrent_r='$d_setgrent_r'
23437 d_setgrps='$d_setgrps'
23438 d_sethent='$d_sethent'
23439 d_sethostent_r='$d_sethostent_r'
23440 d_setitimer='$d_setitimer'
23441 d_setlinebuf='$d_setlinebuf'
23442 d_setlocale='$d_setlocale'
23443 d_setlocale_r='$d_setlocale_r'
23444 d_setnent='$d_setnent'
23445 d_setnetent_r='$d_setnetent_r'
23446 d_setpent='$d_setpent'
23447 d_setpgid='$d_setpgid'
23448 d_setpgrp2='$d_setpgrp2'
23449 d_setpgrp='$d_setpgrp'
23450 d_setprior='$d_setprior'
23451 d_setproctitle='$d_setproctitle'
23452 d_setprotoent_r='$d_setprotoent_r'
23453 d_setpwent='$d_setpwent'
23454 d_setpwent_r='$d_setpwent_r'
23455 d_setregid='$d_setregid'
23456 d_setresgid='$d_setresgid'
23457 d_setresuid='$d_setresuid'
23458 d_setreuid='$d_setreuid'
23459 d_setrgid='$d_setrgid'
23460 d_setruid='$d_setruid'
23461 d_setsent='$d_setsent'
23462 d_setservent_r='$d_setservent_r'
23463 d_setsid='$d_setsid'
23464 d_setvbuf='$d_setvbuf'
23467 d_shmatprototype='$d_shmatprototype'
23468 d_shmctl='$d_shmctl'
23470 d_shmget='$d_shmget'
23471 d_sigaction='$d_sigaction'
23472 d_signbit='$d_signbit'
23473 d_sigprocmask='$d_sigprocmask'
23474 d_sigsetjmp='$d_sigsetjmp'
23475 d_sin6_scope_id='$d_sin6_scope_id'
23476 d_sitearch='$d_sitearch'
23477 d_snprintf='$d_snprintf'
23478 d_sockaddr_in6='$d_sockaddr_in6'
23479 d_sockaddr_sa_len='$d_sockaddr_sa_len'
23480 d_sockatmark='$d_sockatmark'
23481 d_sockatmarkproto='$d_sockatmarkproto'
23482 d_socket='$d_socket'
23483 d_socklen_t='$d_socklen_t'
23484 d_sockpair='$d_sockpair'
23485 d_socks5_init='$d_socks5_init'
23486 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
23488 d_srand48_r='$d_srand48_r'
23489 d_srandom_r='$d_srandom_r'
23490 d_sresgproto='$d_sresgproto'
23491 d_sresuproto='$d_sresuproto'
23492 d_statblks='$d_statblks'
23493 d_statfs_f_flags='$d_statfs_f_flags'
23494 d_statfs_s='$d_statfs_s'
23495 d_static_inline='$d_static_inline'
23496 d_statvfs='$d_statvfs'
23497 d_stdio_cnt_lval='$d_stdio_cnt_lval'
23498 d_stdio_ptr_lval='$d_stdio_ptr_lval'
23499 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
23500 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
23501 d_stdio_stream_array='$d_stdio_stream_array'
23502 d_stdiobase='$d_stdiobase'
23503 d_stdstdio='$d_stdstdio'
23504 d_strchr='$d_strchr'
23505 d_strcoll='$d_strcoll'
23506 d_strctcpy='$d_strctcpy'
23507 d_strerrm='$d_strerrm'
23508 d_strerror='$d_strerror'
23509 d_strerror_r='$d_strerror_r'
23510 d_strftime='$d_strftime'
23511 d_strlcat='$d_strlcat'
23512 d_strlcpy='$d_strlcpy'
23513 d_strtod='$d_strtod'
23514 d_strtol='$d_strtol'
23515 d_strtold='$d_strtold'
23516 d_strtoll='$d_strtoll'
23517 d_strtoq='$d_strtoq'
23518 d_strtoul='$d_strtoul'
23519 d_strtoull='$d_strtoull'
23520 d_strtouq='$d_strtouq'
23521 d_strxfrm='$d_strxfrm'
23522 d_suidsafe='$d_suidsafe'
23523 d_symlink='$d_symlink'
23524 d_syscall='$d_syscall'
23525 d_syscallproto='$d_syscallproto'
23526 d_sysconf='$d_sysconf'
23527 d_sysernlst='$d_sysernlst'
23528 d_syserrlst='$d_syserrlst'
23529 d_system='$d_system'
23530 d_tcgetpgrp='$d_tcgetpgrp'
23531 d_tcsetpgrp='$d_tcsetpgrp'
23532 d_telldir='$d_telldir'
23533 d_telldirproto='$d_telldirproto'
23535 d_timegm='$d_timegm'
23537 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
23538 d_tm_tm_zone='$d_tm_tm_zone'
23539 d_tmpnam_r='$d_tmpnam_r'
23540 d_truncate='$d_truncate'
23541 d_ttyname_r='$d_ttyname_r'
23542 d_tzname='$d_tzname'
23543 d_u32align='$d_u32align'
23544 d_ualarm='$d_ualarm'
23547 d_union_semun='$d_union_semun'
23548 d_unordered='$d_unordered'
23549 d_unsetenv='$d_unsetenv'
23550 d_usleep='$d_usleep'
23551 d_usleepproto='$d_usleepproto'
23553 d_vendorarch='$d_vendorarch'
23554 d_vendorbin='$d_vendorbin'
23555 d_vendorlib='$d_vendorlib'
23556 d_vendorscript='$d_vendorscript'
23558 d_void_closedir='$d_void_closedir'
23559 d_voidsig='$d_voidsig'
23560 d_voidtty='$d_voidtty'
23561 d_volatile='$d_volatile'
23562 d_vprintf='$d_vprintf'
23563 d_vsnprintf='$d_vsnprintf'
23565 d_waitpid='$d_waitpid'
23566 d_wcscmp='$d_wcscmp'
23567 d_wcstombs='$d_wcstombs'
23568 d_wcsxfrm='$d_wcsxfrm'
23569 d_wctomb='$d_wctomb'
23570 d_writev='$d_writev'
23573 db_hashtype='$db_hashtype'
23574 db_prefixtype='$db_prefixtype'
23575 db_version_major='$db_version_major'
23576 db_version_minor='$db_version_minor'
23577 db_version_patch='$db_version_patch'
23578 direntrytype='$direntrytype'
23581 doublesize='$doublesize'
23583 drand48_r_proto='$drand48_r_proto'
23585 dynamic_ext='$dynamic_ext'
23591 endgrent_r_proto='$endgrent_r_proto'
23592 endhostent_r_proto='$endhostent_r_proto'
23593 endnetent_r_proto='$endnetent_r_proto'
23594 endprotoent_r_proto='$endprotoent_r_proto'
23595 endpwent_r_proto='$endpwent_r_proto'
23596 endservent_r_proto='$endservent_r_proto'
23597 eunicefix='$eunicefix'
23600 extensions='$extensions'
23601 extern_C='$extern_C'
23603 fflushNULL='$fflushNULL'
23604 fflushall='$fflushall'
23606 firstmakefile='$firstmakefile'
23608 fpossize='$fpossize'
23609 fpostype='$fpostype'
23610 freetype='$freetype'
23613 full_csh='$full_csh'
23614 full_sed='$full_sed'
23615 gccansipedantic='$gccansipedantic'
23616 gccosandvers='$gccosandvers'
23617 gccversion='$gccversion'
23618 getgrent_r_proto='$getgrent_r_proto'
23619 getgrgid_r_proto='$getgrgid_r_proto'
23620 getgrnam_r_proto='$getgrnam_r_proto'
23621 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
23622 gethostbyname_r_proto='$gethostbyname_r_proto'
23623 gethostent_r_proto='$gethostent_r_proto'
23624 getlogin_r_proto='$getlogin_r_proto'
23625 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
23626 getnetbyname_r_proto='$getnetbyname_r_proto'
23627 getnetent_r_proto='$getnetent_r_proto'
23628 getprotobyname_r_proto='$getprotobyname_r_proto'
23629 getprotobynumber_r_proto='$getprotobynumber_r_proto'
23630 getprotoent_r_proto='$getprotoent_r_proto'
23631 getpwent_r_proto='$getpwent_r_proto'
23632 getpwnam_r_proto='$getpwnam_r_proto'
23633 getpwuid_r_proto='$getpwuid_r_proto'
23634 getservbyname_r_proto='$getservbyname_r_proto'
23635 getservbyport_r_proto='$getservbyport_r_proto'
23636 getservent_r_proto='$getservent_r_proto'
23637 getspnam_r_proto='$getspnam_r_proto'
23638 gidformat='$gidformat'
23644 gmtime_r_proto='$gmtime_r_proto'
23645 gnulibc_version='$gnulibc_version'
23647 groupcat='$groupcat'
23648 groupstype='$groupstype'
23651 h_sysfile='$h_sysfile'
23654 hostgenerate='$hostgenerate'
23655 hostosname='$hostosname'
23656 hostperl='$hostperl'
23657 html1dir='$html1dir'
23658 html1direxp='$html1direxp'
23659 html3dir='$html3dir'
23660 html3direxp='$html3direxp'
23669 i_arpainet='$i_arpainet'
23670 i_assert='$i_assert'
23672 i_bsdioctl='$i_bsdioctl'
23676 i_dirent='$i_dirent'
23678 i_execinfo='$i_execinfo'
23682 i_fp_class='$i_fp_class'
23684 i_gdbm_ndbm='$i_gdbm_ndbm'
23685 i_gdbmndbm='$i_gdbmndbm'
23687 i_ieeefp='$i_ieeefp'
23688 i_inttypes='$i_inttypes'
23689 i_langinfo='$i_langinfo'
23690 i_libutil='$i_libutil'
23691 i_limits='$i_limits'
23692 i_locale='$i_locale'
23693 i_machcthr='$i_machcthr'
23694 i_malloc='$i_malloc'
23695 i_mallocmalloc='$i_mallocmalloc'
23697 i_memory='$i_memory'
23698 i_mntent='$i_mntent'
23701 i_neterrno='$i_neterrno'
23702 i_netinettcp='$i_netinettcp'
23706 i_pthread='$i_pthread'
23708 i_rpcsvcdbm='$i_rpcsvcdbm'
23710 i_shadow='$i_shadow'
23712 i_stdarg='$i_stdarg'
23713 i_stdbool='$i_stdbool'
23714 i_stddef='$i_stddef'
23715 i_stdlib='$i_stdlib'
23716 i_string='$i_string'
23717 i_sunmath='$i_sunmath'
23718 i_sysaccess='$i_sysaccess'
23719 i_sysdir='$i_sysdir'
23720 i_sysfile='$i_sysfile'
23721 i_sysfilio='$i_sysfilio'
23723 i_sysioctl='$i_sysioctl'
23724 i_syslog='$i_syslog'
23725 i_sysmman='$i_sysmman'
23726 i_sysmode='$i_sysmode'
23727 i_sysmount='$i_sysmount'
23728 i_sysndir='$i_sysndir'
23729 i_sysparam='$i_sysparam'
23730 i_syspoll='$i_syspoll'
23731 i_sysresrc='$i_sysresrc'
23732 i_syssecrt='$i_syssecrt'
23733 i_sysselct='$i_sysselct'
23734 i_syssockio='$i_syssockio'
23735 i_sysstat='$i_sysstat'
23736 i_sysstatfs='$i_sysstatfs'
23737 i_sysstatvfs='$i_sysstatvfs'
23738 i_systime='$i_systime'
23739 i_systimek='$i_systimek'
23740 i_systimes='$i_systimes'
23741 i_systypes='$i_systypes'
23742 i_sysuio='$i_sysuio'
23744 i_sysutsname='$i_sysutsname'
23745 i_sysvfs='$i_sysvfs'
23746 i_syswait='$i_syswait'
23747 i_termio='$i_termio'
23748 i_termios='$i_termios'
23750 i_unistd='$i_unistd'
23753 i_values='$i_values'
23754 i_varargs='$i_varargs'
23755 i_varhdr='$i_varhdr'
23757 ignore_versioned_solibs='$ignore_versioned_solibs'
23758 inc_version_list='$inc_version_list'
23759 inc_version_list_init='$inc_version_list_init'
23763 initialinstalllocation='$initialinstalllocation'
23764 installarchlib='$installarchlib'
23765 installbin='$installbin'
23766 installhtml1dir='$installhtml1dir'
23767 installhtml3dir='$installhtml3dir'
23768 installman1dir='$installman1dir'
23769 installman3dir='$installman3dir'
23770 installprefix='$installprefix'
23771 installprefixexp='$installprefixexp'
23772 installprivlib='$installprivlib'
23773 installscript='$installscript'
23774 installsitearch='$installsitearch'
23775 installsitebin='$installsitebin'
23776 installsitehtml1dir='$installsitehtml1dir'
23777 installsitehtml3dir='$installsitehtml3dir'
23778 installsitelib='$installsitelib'
23779 installsiteman1dir='$installsiteman1dir'
23780 installsiteman3dir='$installsiteman3dir'
23781 installsitescript='$installsitescript'
23782 installstyle='$installstyle'
23783 installusrbinperl='$installusrbinperl'
23784 installvendorarch='$installvendorarch'
23785 installvendorbin='$installvendorbin'
23786 installvendorhtml1dir='$installvendorhtml1dir'
23787 installvendorhtml3dir='$installvendorhtml3dir'
23788 installvendorlib='$installvendorlib'
23789 installvendorman1dir='$installvendorman1dir'
23790 installvendorman3dir='$installvendorman3dir'
23791 installvendorscript='$installvendorscript'
23793 issymlink='$issymlink'
23794 ivdformat='$ivdformat'
23797 known_extensions='$known_extensions'
23800 ld_can_script='$ld_can_script'
23801 lddlflags='$lddlflags'
23803 ldflags_uselargefiles='$ldflags_uselargefiles'
23804 ldlibpthname='$ldlibpthname'
23811 libsdirs='$libsdirs'
23812 libsfiles='$libsfiles'
23813 libsfound='$libsfound'
23814 libspath='$libspath'
23815 libswanted='$libswanted'
23816 libswanted_uselargefiles='$libswanted_uselargefiles'
23822 localtime_r_proto='$localtime_r_proto'
23823 locincpth='$locincpth'
23824 loclibpth='$loclibpth'
23825 longdblkind='$longdblkind'
23826 longdblsize='$longdblsize'
23827 longlongsize='$longlongsize'
23828 longsize='$longsize'
23832 lseeksize='$lseeksize'
23833 lseektype='$lseektype'
23837 make_set_make='$make_set_make'
23838 mallocobj='$mallocobj'
23839 mallocsrc='$mallocsrc'
23840 malloctype='$malloctype'
23842 man1direxp='$man1direxp'
23845 man3direxp='$man3direxp'
23847 mips_type='$mips_type'
23848 mistrustnm='$mistrustnm'
23850 mmaptype='$mmaptype'
23851 modetype='$modetype'
23853 multiarch='$multiarch'
23855 myarchname='$myarchname'
23856 mydomain='$mydomain'
23857 myhostname='$myhostname'
23860 need_va_copy='$need_va_copy'
23861 netdb_hlen_type='$netdb_hlen_type'
23862 netdb_host_type='$netdb_host_type'
23863 netdb_name_type='$netdb_name_type'
23864 netdb_net_type='$netdb_net_type'
23867 nm_so_opt='$nm_so_opt'
23868 nonxs_ext='$nonxs_ext'
23870 nvEUformat='$nvEUformat'
23871 nvFUformat='$nvFUformat'
23872 nvGUformat='$nvGUformat'
23873 nv_overflows_integers_at='$nv_overflows_integers_at'
23874 nv_preserves_uv_bits='$nv_preserves_uv_bits'
23875 nveformat='$nveformat'
23876 nvfformat='$nvfformat'
23877 nvgformat='$nvgformat'
23880 o_nonblock='$o_nonblock'
23882 old_pthread_create_joinable='$old_pthread_create_joinable'
23883 optimize='$optimize'
23884 orderlib='$orderlib'
23887 otherlibdirs='$otherlibdirs'
23891 patchlevel='$patchlevel'
23892 path_sep='$path_sep'
23895 perl_patchlevel='$perl_patchlevel'
23896 perl_static_inline='$perl_static_inline'
23897 perladmin='$perladmin'
23898 perllibs='$perllibs'
23899 perlpath='$perlpath'
23901 phostname='$phostname'
23907 prefixexp='$prefixexp'
23909 privlibexp='$privlibexp'
23910 procselfexe='$procselfexe'
23911 prototype='$prototype'
23913 quadkind='$quadkind'
23914 quadtype='$quadtype'
23915 randbits='$randbits'
23916 randfunc='$randfunc'
23917 random_r_proto='$random_r_proto'
23918 randseedtype='$randseedtype'
23920 rd_nodata='$rd_nodata'
23921 readdir64_r_proto='$readdir64_r_proto'
23922 readdir_r_proto='$readdir_r_proto'
23923 revision='$revision'
23929 sGMTIME_max='$sGMTIME_max'
23930 sGMTIME_min='$sGMTIME_min'
23931 sLOCALTIME_max='$sLOCALTIME_max'
23932 sLOCALTIME_min='$sLOCALTIME_min'
23933 sPRIEUldbl='$sPRIEUldbl'
23934 sPRIFUldbl='$sPRIFUldbl'
23935 sPRIGUldbl='$sPRIGUldbl'
23936 sPRIXU64='$sPRIXU64'
23938 sPRIeldbl='$sPRIeldbl'
23939 sPRIfldbl='$sPRIfldbl'
23940 sPRIgldbl='$sPRIgldbl'
23945 sSCNfldbl='$sSCNfldbl'
23946 sched_yield='$sched_yield'
23947 scriptdir='$scriptdir'
23948 scriptdirexp='$scriptdirexp'
23950 seedfunc='$seedfunc'
23951 selectminbits='$selectminbits'
23952 selecttype='$selecttype'
23953 sendmail='$sendmail'
23954 setgrent_r_proto='$setgrent_r_proto'
23955 sethostent_r_proto='$sethostent_r_proto'
23956 setlocale_r_proto='$setlocale_r_proto'
23957 setnetent_r_proto='$setnetent_r_proto'
23958 setprotoent_r_proto='$setprotoent_r_proto'
23959 setpwent_r_proto='$setpwent_r_proto'
23960 setservent_r_proto='$setservent_r_proto'
23963 sharpbang='$sharpbang'
23964 shmattype='$shmattype'
23965 shortsize='$shortsize'
23968 sig_count='$sig_count'
23969 sig_name='$sig_name'
23970 sig_name_init='$sig_name_init'
23972 sig_num_init='$sig_num_init'
23973 sig_size='$sig_size'
23974 signal_t='$signal_t'
23975 sitearch='$sitearch'
23976 sitearchexp='$sitearchexp'
23978 sitebinexp='$sitebinexp'
23979 sitehtml1dir='$sitehtml1dir'
23980 sitehtml1direxp='$sitehtml1direxp'
23981 sitehtml3dir='$sitehtml3dir'
23982 sitehtml3direxp='$sitehtml3direxp'
23984 sitelib_stem='$sitelib_stem'
23985 sitelibexp='$sitelibexp'
23986 siteman1dir='$siteman1dir'
23987 siteman1direxp='$siteman1direxp'
23988 siteman3dir='$siteman3dir'
23989 siteman3direxp='$siteman3direxp'
23990 siteprefix='$siteprefix'
23991 siteprefixexp='$siteprefixexp'
23992 sitescript='$sitescript'
23993 sitescriptexp='$sitescriptexp'
23994 sizesize='$sizesize'
23995 sizetype='$sizetype'
23999 sockethdr='$sockethdr'
24000 socketlib='$socketlib'
24001 socksizetype='$socksizetype'
24003 spackage='$spackage'
24004 spitshell='$spitshell'
24005 srand48_r_proto='$srand48_r_proto'
24006 srandom_r_proto='$srandom_r_proto'
24008 ssizetype='$ssizetype'
24009 st_ino_sign='$st_ino_sign'
24010 st_ino_size='$st_ino_size'
24011 startperl='$startperl'
24013 static_ext='$static_ext'
24015 stdio_base='$stdio_base'
24016 stdio_bufsiz='$stdio_bufsiz'
24017 stdio_cnt='$stdio_cnt'
24018 stdio_filbuf='$stdio_filbuf'
24019 stdio_ptr='$stdio_ptr'
24020 stdio_stream_array='$stdio_stream_array'
24021 strerror_r_proto='$strerror_r_proto'
24024 subversion='$subversion'
24029 targetarch='$targetarch'
24030 targetdir='$targetdir'
24031 targetenv='$targetenv'
24032 targethost='$targethost'
24033 targetmkdir='$targetmkdir'
24034 targetport='$targetport'
24035 targetsh='$targetsh'
24039 timeincl='$timeincl'
24040 timetype='$timetype'
24041 tmpnam_r_proto='$tmpnam_r_proto'
24047 ttyname_r_proto='$ttyname_r_proto'
24056 uidformat='$uidformat'
24062 uquadtype='$uquadtype'
24063 use5005threads='$use5005threads'
24064 use64bitall='$use64bitall'
24065 use64bitint='$use64bitint'
24066 usecbacktrace='$usecbacktrace'
24067 usecrosscompile='$usecrosscompile'
24068 usedevel='$usedevel'
24070 usedtrace='$usedtrace'
24071 usefaststdio='$usefaststdio'
24072 useithreads='$useithreads'
24073 usekernprocpathname='$usekernprocpathname'
24074 uselargefiles='$uselargefiles'
24075 uselongdouble='$uselongdouble'
24076 usemallocwrap='$usemallocwrap'
24077 usemorebits='$usemorebits'
24078 usemultiplicity='$usemultiplicity'
24079 usemymalloc='$usemymalloc'
24081 usensgetexecutablepath='$usensgetexecutablepath'
24082 useopcode='$useopcode'
24083 useperlio='$useperlio'
24084 useposix='$useposix'
24085 usereentrant='$usereentrant'
24086 userelocatableinc='$userelocatableinc'
24087 useshrplib='$useshrplib'
24088 usesitecustomize='$usesitecustomize'
24089 usesocks='$usesocks'
24090 usethreads='$usethreads'
24091 usevendorprefix='$usevendorprefix'
24092 useversionedarchname='$useversionedarchname'
24093 usevfork='$usevfork'
24096 uvXUformat='$uvXUformat'
24097 uvoformat='$uvoformat'
24100 uvuformat='$uvuformat'
24101 uvxformat='$uvxformat'
24103 vendorarch='$vendorarch'
24104 vendorarchexp='$vendorarchexp'
24105 vendorbin='$vendorbin'
24106 vendorbinexp='$vendorbinexp'
24107 vendorhtml1dir='$vendorhtml1dir'
24108 vendorhtml1direxp='$vendorhtml1direxp'
24109 vendorhtml3dir='$vendorhtml3dir'
24110 vendorhtml3direxp='$vendorhtml3direxp'
24111 vendorlib='$vendorlib'
24112 vendorlib_stem='$vendorlib_stem'
24113 vendorlibexp='$vendorlibexp'
24114 vendorman1dir='$vendorman1dir'
24115 vendorman1direxp='$vendorman1direxp'
24116 vendorman3dir='$vendorman3dir'
24117 vendorman3direxp='$vendorman3direxp'
24118 vendorprefix='$vendorprefix'
24119 vendorprefixexp='$vendorprefixexp'
24120 vendorscript='$vendorscript'
24121 vendorscriptexp='$vendorscriptexp'
24123 version_patchlevel_string='$version_patchlevel_string'
24124 versiononly='$versiononly'
24128 yaccflags='$yaccflags'
24133 : add special variables
24134 $test -f $src/patchlevel.h && \
24135 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
24136 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
24137 echo "PERL_CONFIG_SH=true" >>config.sh
24139 : propagate old symbols
24140 if $test -f UU/config.sh; then
24141 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
24142 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
24143 config.sh config.sh UU/oldconfig.sh |\
24144 $sort | $uniq -u >UU/oldsyms
24145 set X `$cat UU/oldsyms`
24151 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
24153 echo ": Variables propagated from previous config.sh file." >>config.sh
24154 for sym in `$cat UU/oldsyms`; do
24155 echo " Propagating $hint variable "'$'"$sym..."
24156 eval 'tmp="$'"${sym}"'"'
24158 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
24164 : preserve RCS keywords in files with variable substitution, grrr
24167 : Finish up by extracting the .SH files
24171 echo "Extraction done."
24181 If you'd like to make any changes to the config.sh file before I begin
24182 to configure things, do it as a shell escape now (e.g. !vi config.sh).
24185 rp="Press return or use a shell escape to edit config.sh:"
24190 *) : in case they cannot read
24191 sh 1>&4 -c "$ans";;
24196 : if this fails, just run all the .SH files by hand
24205 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
24212 Now you need to generate make dependencies by running "$make depend".
24213 You might prefer to run it in background: "$make depend > makedepend.out &"
24214 It can take a while, so you might not want to run it right now.
24219 rp="Run $make depend now?"
24223 $make depend && echo "Now you must run '$make'."
24226 echo "You must run '$make depend' then '$make'."
24229 elif test -f [Mm]akefile; then
24231 echo "Now you must run a $make."
24233 echo "Configure done."
24236 if $test -f Policy.sh; then
24239 If you compile $package on a different machine or from a different object
24240 directory, copy the Policy.sh file from this object directory to the
24241 new one before you run Configure -- this will help you with most of
24242 the policy defaults.
24246 if $test -f config.msg; then
24247 echo "Hmm. I also noted the following information while running:"
24249 $cat config.msg >&4
24252 $rm -f kit*isdone ark*isdone