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 on Tue Sep 17 10:34:33 CEST 2013 [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 >/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
335 useversionedarchname=''
341 initialinstalllocation=''
370 d_attribute_deprecated=''
371 d_attribute_format=''
372 d_attribute_malloc=''
373 d_attribute_nonnull=''
374 d_attribute_noreturn=''
376 d_attribute_unused=''
377 d_attribute_warn_unused_result=''
378 d_printf_format_null=''
381 d_builtin_choose_expr=''
384 d_c99_variadic_macros=''
431 endhostent_r_proto=''
437 endprotoent_r_proto=''
443 endservent_r_proto=''
496 gethostbyaddr_r_proto=''
498 gethostbyname_r_proto=''
500 gethostent_r_proto=''
513 getnetbyaddr_r_proto=''
515 getnetbyname_r_proto=''
529 d_getprotobyname_r=''
530 getprotobyname_r_proto=''
531 d_getprotobynumber_r=''
532 getprotobynumber_r_proto=''
534 getprotoent_r_proto=''
546 getservbyname_r_proto=''
548 getservbyport_r_proto=''
550 getservent_r_proto=''
577 d_libm_lib_version=''
580 d_localtime_r_needs_tzset=''
591 d_malloc_good_size=''
635 d_old_pthread_create_joinable=''
636 old_pthread_create_joinable=''
638 d_pthread_attr_setscope=''
677 sethostent_r_proto=''
694 setprotoent_r_proto=''
706 setservent_r_proto=''
728 d_ipv6_mreq_source=''
745 d_sprintf_returns_strlen=''
757 perl_static_inline=''
762 d_stdio_ptr_lval_nochange_cnt=''
763 d_stdio_ptr_lval_sets_cnt=''
908 d_gdbm_ndbm_h_uses_prototypes=''
909 d_gdbmndbm_h_uses_prototypes=''
911 d_ndbm_h_uses_prototypes=''
985 d_inc_version_list=''
987 inc_version_list_init=''
1006 ignore_versioned_solibs=''
1070 d_perl_otherlibdirs=''
1078 api_versionstring=''
1084 version_patchlevel_string=''
1088 d_nv_preserves_uv=''
1089 d_nv_zero_is_allbits_zero=''
1100 nv_overflows_integers_at=''
1101 nv_preserves_uv_bits=''
1173 installsitehtml1dir=''
1176 installsitehtml3dir=''
1183 installsiteman1dir=''
1186 installsiteman3dir=''
1191 installsitescript=''
1208 d_stdio_stream_array=''
1209 stdio_stream_array=''
1226 usekernprocpathname=''
1227 ccflags_uselargefiles=''
1228 ldflags_uselargefiles=''
1229 libswanted_uselargefiles=''
1238 usensgetexecutablepath=''
1251 installvendorarch=''
1258 installvendorhtml1dir=''
1260 vendorhtml1direxp=''
1261 installvendorhtml3dir=''
1263 vendorhtml3direxp=''
1269 installvendorman1dir=''
1272 installvendorman3dir=''
1279 installvendorscript=''
1290 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1293 : We must find out about Eunice early
1295 if test -f /etc/unixtovms; then
1296 eunicefix=/etc/unixtovms
1298 if test -f /etc/unixtovms.exe; then
1299 eunicefix=/etc/unixtovms.exe
1302 : Set executable suffix now -- needed before hints available
1303 if test -f "/libs/version.library"; then
1306 elif test -f "/system/gnu_library/bin/ar.pm"; then
1309 elif test -n "$DJGPP"; then
1312 elif test -f /kern/cookiejar; then
1315 elif test -d c:/. -o -n "$is_os2" ; then
1322 : Trailing extension. Override this in a hint file, if needed.
1323 : Extra object files, if any, needed on this platform.
1326 : Possible local include directories to search.
1327 : Set locincpth to "" in a hint file to defeat local include searches.
1328 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1329 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1331 : no include file wanted by default
1334 : Enable -DEBUGGING and -DDEBUGGING from the command line
1339 : change the next line if compiling for Xenix/286 on Xenix/386
1340 xlibpth='/usr/lib/386 /lib/386'
1341 : Possible local library directories to search.
1342 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1343 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1345 : general looking path for locating libraries
1346 glibpth="/lib /usr/lib $xlibpth"
1347 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1348 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1349 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1350 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1352 : Private path used by Configure to find libraries. Its value
1353 : is prepended to libpth. This variable takes care of special
1354 : machines, like the mips. Usually, it should be empty.
1357 : default library list
1359 : some systems want to use only the non-versioned libso:s
1360 ignore_versioned_solibs=''
1361 : set usethreads on the Configure command line to enable threads.
1362 usereentrant='undef'
1366 : set useposix=false in your hint file to disable the POSIX extension.
1368 : set useopcode=false in your hint file to disable the Opcode extension.
1371 ccflags_uselargefiles=''
1372 ldflags_uselargefiles=''
1373 libswanted_uselargefiles=''
1374 : set usemultiplicity on the Configure command line to enable multiplicity.
1375 : set usesocks on the Configure command line to enable socks.
1376 : List of libraries we want.
1377 : If anyone needs extra -lxxx, put those in a hint file.
1378 libswanted="socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld sun"
1379 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1380 : We probably want to search /usr/shlib before most other libraries.
1381 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1382 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1383 glibpth="/usr/shlib $glibpth"
1384 : Do not use vfork unless overridden by a hint file.
1387 : Find the basic shell for Bourne shell scripts
1391 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1394 if test -f "$xxx"; then
1397 : Build up a list and do a single loop so we can 'break' out.
1398 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1399 for xxx in sh bash ksh pdksh ash; do
1401 try="$try ${p}/${xxx}"
1405 if test -f "$xxx"; then
1408 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1411 elif test -f "$xxx.exe"; then
1422 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1424 Usually it's in /bin/sh. How did you even get this far?
1425 Please contact me (Perl Maintainers) at perlbug@perl.org and
1426 we'll try to straighten this all out.
1432 : see if sh knows # comments
1433 if `$sh -c '#' >/dev/null 2>&1`; then
1437 test -f $xcat$_exe || xcat=/usr/bin/cat
1438 if test ! -f $xcat$_exe; then
1439 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1440 if test -f $p/cat$_exe; then
1445 if test ! -f $xcat$_exe; then
1446 echo "Can't find cat anywhere!"
1450 echo "#!$xcat" >sharp
1453 ./sharp > today 2>/dev/null
1454 if test -s today; then
1457 echo "#! $xcat" > sharp
1460 ./sharp > today 2>/dev/null
1461 if test -s today; then
1469 echo "Your $sh doesn't grok # comments--I will strip them later on."
1472 echo "exec grep -v '^[ ]*#'" >spitshell
1474 $eunicefix spitshell
1475 spitshell=`pwd`/spitshell
1477 echo "I presume that if # doesn't work, #! won't work either!"
1482 : figure out how to guarantee sh startup
1484 '') startsh=${sharpbang}${sh} ;;
1496 : echo "Yup, it does."
1498 echo "Hmm... '$startsh' does not guarantee sh startup..."
1499 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1503 : Save command line options in file UU/cmdline.opt for later use in
1504 : generating config.sh.
1505 cat > cmdline.opt <<EOSH
1506 : Configure command line arguments.
1515 cat >>cmdline.opt <<EOSH
1516 config_arg$argn='$arg'
1518 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1521 arg_exp=`cat cmdl.opt`
1522 args_exp="$args_exp$args_sep'$arg_exp'"
1523 argn=`expr $argn + 1`
1528 : produce awk script to parse command line options
1529 cat >options.awk <<'EOF'
1531 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1533 len = length(optstr);
1534 for (i = 1; i <= len; i++) {
1535 c = substr(optstr, i, 1);
1536 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1547 if (substr(str, 1, 1) != "-") {
1548 printf("'%s'\n", str);
1552 for (i = 2; i <= len; i++) {
1553 c = substr(str, i, 1);
1555 printf("-%s\n", substr(str, i));
1561 printf("'%s'\n", substr(str, i + 1));
1574 : process the command line options
1575 set X `for arg in "$@"; do echo "X$arg"; done |
1576 sed -e s/X// | awk -f options.awk`
1581 : set up default values
1591 rm -f optdef.sh posthint.sh
1592 cat >optdef.sh <<EOS
1598 while test $# -gt 0; do
1600 -d) shift; fastread=yes;;
1601 -e) shift; alldone=cont;;
1605 if test -r "$1"; then
1608 echo "$me: cannot read config file $1." >&2
1614 -h) shift; error=true;;
1615 -r) shift; reuseval=true;;
1616 -s) shift; silent=true; realsilent=true;;
1617 -E) shift; alldone=exit;;
1618 -K) shift; knowitall=true;;
1619 -O) shift; override=true;;
1620 -S) shift; silent=true; extractsh=true;;
1625 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1626 echo "$me: ignoring -D $1" >&2
1629 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1630 *) echo "$1='define'" >> optdef.sh;;
1637 *=) echo "$1" >> optdef.sh;;
1639 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1640 echo "$me: ignoring -U $1" >&2
1642 *) echo "$1='undef'" >> optdef.sh;;
1653 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1657 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1658 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1664 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1665 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1666 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1667 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1668 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1669 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1675 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1677 echo "$yyy=''" >> posthint.sh ;;
1682 echo "$yyy='$zzz'" >> posthint.sh ;;
1684 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1686 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1691 echo "$yyy=$zzz" >> posthint.sh ;;
1692 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1696 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1699 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1707 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1708 [-U symbol] [-U symbol=] [-A command:symbol...]
1709 -d : use defaults for all answers.
1710 -e : go on without questioning past the production of config.sh.
1711 -f : specify an alternate default configuration file.
1712 -h : print this help message and exit (with an error status).
1713 -r : reuse C symbols value if possible (skips costly nm extraction).
1714 -s : silent mode, only echoes questions and essential information.
1715 -D : define symbol to have some value:
1716 -D symbol symbol gets the value 'define'
1717 -D symbol=value symbol gets the value 'value'
1718 common used examples (see INSTALL for more info):
1719 -Duse64bitint use 64bit integers
1720 -Duse64bitall use 64bit integers and pointers
1721 -Dusethreads use thread support
1722 -Dinc_version_list=none do not include older perl trees in @INC
1723 -DEBUGGING=none DEBUGGING options
1724 -Dcc=gcc choose your compiler
1725 -Dprefix=/opt/perl5 choose your destination
1726 -E : stop at the end of questions, after having produced config.sh.
1727 -K : do not use unless you know what you are doing.
1728 -O : let -D and -U override definitions from loaded configuration file.
1729 -S : perform variable substitutions on all .SH files (can mix with -f)
1730 -U : undefine symbol:
1731 -U symbol symbol gets the value 'undef'
1732 -U symbol= symbol gets completely empty
1734 -A : manipulate symbol after the platform specific hints have been applied:
1735 -A append:symbol=value append value to symbol
1736 -A symbol=value like append:, but with a separating space
1737 -A define:symbol=value define symbol to have value
1738 -A clear:symbol define symbol to be ''
1739 -A define:symbol define symbol to be 'define'
1740 -A eval:symbol=value define symbol to be eval of value
1741 -A prepend:symbol=value prepend value to symbol
1742 -A undef:symbol define symbol to be 'undef'
1743 -A undef:symbol= define symbol to be ''
1744 e.g.: -A prepend:libswanted='cl pthread '
1745 -A ccflags=-DSOME_MACRO
1746 -V : print version number and exit (with a zero status).
1753 case "$fastread$alldone" in
1756 case "$extractsh" in
1759 if test ! -t 0; then
1760 echo "Say 'sh Configure', not 'sh <Configure'"
1770 true) exec 1>/dev/null;;
1773 : run the defines and the undefines, if any, but leave the file out there...
1776 : create the posthint manipulation script and leave the file out there...
1781 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1782 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1783 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1784 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1785 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1788 : Some greps do not return status, grrr.
1789 echo "grimblepritz" >grimble
1790 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1792 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1798 : the following should work in any shell
1802 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1803 cat >contains <<'EOSS'
1804 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1809 : Find the path to the source tree
1812 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1816 *) src=`cd ../$src && pwd` ;;
1829 if test -f $rsrc/Configure && \
1830 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1832 : found it, so we are ok.
1835 for src in . .. ../.. ../../.. ../../../..; do
1836 if test -f ../$src/Configure && \
1837 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1848 Sorry, I can't seem to locate the source dir for $package. Please start
1849 Configure with an explicit path -- i.e. /some/path/Configure.
1857 echo "Sources for $package found in \"$src\"." >&4
1861 : script used to extract .SH files with variable substitutions
1862 cat >extract <<'EOS'
1864 echo "Doing variable substitutions on .SH files..."
1865 if test -f MANIFEST; then
1866 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1868 echo "(Looking for .SH files under the source directory.)"
1869 set x `(cd "$src"; find . -name "*.SH" -print)`
1873 0) set x `(cd "$src"; echo *.SH)`; shift;;
1875 if test ! -f "$src/$1"; then
1881 while test $name; do
1882 if test ! -d "$name"; then
1883 create="$name $create";
1884 name=`echo $name | sed -e "s|^[^/]*$||"`;
1885 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1890 for file in $create; do
1899 dir=`expr X$file : 'X\(.*\)/'`
1900 file=`expr X$file : 'X.*/\(.*\)'`
1901 (cd "$dir" && . ./$file)
1911 dir=`expr X$file : 'X\(.*\)/'`
1912 file=`expr X$file : 'X.*/\(.*\)'`
1913 (set x $dir; shift; eval $mkdir_p)
1914 sh <"$src/$dir/$file"
1923 if test -f "$src/config_h.SH"; then
1924 if test ! -f config.h; then
1925 : oops, they left it out of MANIFEST, probably, so do it anyway.
1926 . "$src/config_h.SH"
1931 : extract files and exit if asked to do so
1932 case "$extractsh" in
1934 case "$realsilent" in
1938 case "$config_sh" in
1939 '') config_sh='config.sh';;
1942 echo "Fetching answers from $config_sh..."
1945 test "$override" && . ./optdef.sh
1949 echo "Extraction done."
1954 : Eunice requires " " instead of "", can you believe it
1957 echo "Beginning of configuration questions for $package."
1959 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1961 : first determine how to suppress newline on echo command
1963 echo "Checking echo to see how to suppress newlines..."
1964 (echo "hi there\c" ; echo " ") >.echotmp
1965 if $contains c .echotmp >/dev/null 2>&1 ; then
1976 echo $n "The star should be here-->$c"
1980 : Now test for existence of everything in MANIFEST
1982 if test -f "$rsrc/MANIFEST"; then
1983 echo "First let's make sure your kit is complete. Checking..." >&4
1984 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1985 (split -l 50 2>/dev/null || split -50)
1988 for filelist in x??; do
1989 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1990 >/dev/null 2>>"$tmppwd/missing")
1992 if test -s missing; then
1996 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1998 You have the option of continuing the configuration process, despite the
1999 distinct possibility that your kit is damaged, by typing 'y'es. If you
2000 do, don't blame me if something goes wrong. I advise you to type 'n'o
2001 and contact the author (perlbug@perl.org).
2004 echo $n "Continue? [n] $c" >&4
2008 echo "Continuing..." >&4
2012 echo "ABORTING..." >&4
2017 echo "Looks good..."
2020 echo "There is no MANIFEST file. I hope your kit is complete !"
2024 : Find the appropriate value for a newline for tr
2026 if test -n "$DJGPP"; then
2029 if test X"$trnl" = X; then
2030 case "`echo foo|tr '\n' x 2>/dev/null`" in
2034 if test X"$trnl" = X; then
2035 case "`echo foo|tr '\012' x 2>/dev/null`" in
2036 foox) trnl='\012' ;;
2039 if test X"$trnl" = X; then
2040 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2041 fooxy) trnl='\n\r' ;;
2044 if test X"$trnl" = X; then
2047 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2053 : compute the number of columns on the terminal for proper question formatting
2058 : set up the echo used in my read
2059 myecho="case \"\$xxxm\" in
2060 '') echo $n \"\$rp $c\" >&4;;
2062 '') echo $n \"[\$xxxm] $c\";;
2064 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2066 echo $n \"[\$xxxm] $c\" >&4
2068 echo $n \"\$rp [\$xxxm] $c\" >&4
2074 : now set up to do reads with possible shell escape and default assignment
2080 case "\$fastread" in
2081 yes) case "\$dflt" in
2084 case "\$silent-\$rp" in
2089 *) case "\$silent" in
2090 true) case "\$rp" in
2095 while expr "X\$ans" : "X!" >/dev/null; do
2099 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2107 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2116 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2121 echo "(OK, I'll run with -d after this question.)" >&4
2124 echo "*** Sorry, \$1 not supported yet." >&4
2134 echo "*** Substitution done -- please confirm."
2136 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2141 echo "*** Error -- try again."
2148 case "\$ans\$xxxm\$nostick" in
2160 : create .config dir to save info across Configure sessions
2161 test -d ../.config || mkdir ../.config
2162 cat >../.config/README <<EOF
2163 This directory created by Configure to save information that should
2164 persist across sessions for $package.
2166 You may safely delete it if you wish.
2169 : See if we are using a devel version and want that
2170 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2173 usedevel="$define" ;;
2174 *) case "$xversion" in
2177 *** WHOA THERE!!! ***
2179 This is an UNSTABLE DEVELOPMENT release.
2180 The version of this $package distribution is $xversion, that is, odd,
2181 (as opposed to even) and that signifies a development release.
2182 If you want a maintenance release, you want an even-numbered version.
2184 Do ***NOT*** install this into production use.
2185 Data corruption and crashes are possible.
2187 It is most seriously suggested that you do not continue any further
2188 unless you want to help in developing and debugging Perl.
2190 If you *still* want to build perl, you can answer 'y' now,
2191 or pass -Dusedevel to Configure.
2194 rp='Do you really want to continue?'
2198 [yY]) echo >&4 "Okay, continuing."
2199 usedevel="$define" ;;
2200 *) echo >&4 "Okay, bye."
2211 case "$versiononly" in
2212 '') versiononly="$define" ;;
2214 case "$installusrbinperl" in
2215 '') installusrbinperl="$undef" ;;
2220 : general instructions
2223 user=`(logname) 2>/dev/null`
2225 '') user=`whoami 2>&1`;;
2227 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2230 rp='Would you like to see the instructions?'
2241 This installation shell script will examine your system and ask you questions
2242 to determine how the perl5 package should be installed. If you get
2243 stuck on a question, you may use a ! shell escape to start a subshell or
2244 execute a command. Many of the questions will have default answers in square
2245 brackets; typing carriage return will give you the default.
2247 On some of the questions which ask for file or directory names you are allowed
2248 to use the ~name construct to specify the login directory belonging to "name",
2249 even if you don't have a shell which knows about that. Questions where this is
2250 allowed will be marked "(~name ok)".
2254 dflt='Type carriage return to continue'
2258 The prompter used in this script allows you to use shell variables and
2259 backticks in your answers. You may use $1, $2, etc... to refer to the words
2260 in the default answer, as if the default line was a set of arguments given to a
2261 script shell. This means you may also use $* to repeat the whole default line,
2262 so you do not have to re-type everything to add something to the default.
2264 Every time there is a substitution, you will have to confirm. If there is an
2265 error (e.g. an unmatched backtick), the default answer will remain unchanged
2266 and you will be prompted again.
2268 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2269 the questions and use the computed defaults (or the previous answers if there
2270 was already a config.sh file). Type 'Configure -h' for a list of options.
2271 You may also start interactively and then answer '& -d' at any prompt to turn
2272 on the non-interactive behaviour for the remainder of the execution.
2278 Much effort has been expended to ensure that this shell script will run on any
2279 Unix system. If despite that it blows up on yours, your best bet is to edit
2280 Configure and run it again. If you can't run Configure for some reason,
2281 you'll have to generate a config.sh file by hand. Whatever problems you
2282 have, let me (perlbug@perl.org) know how I blew it.
2284 This installation script affects things in two ways:
2286 1) it may do direct variable substitutions on some of the files included
2288 2) it builds a config.h file for inclusion in C programs. You may edit
2289 any of these files as the need arises after running this script.
2291 If you make a mistake on a question, there is no easy way to back up to it
2292 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2293 files. Configure will offer to let you do this before it runs the SH files.
2296 dflt='Type carriage return to continue'
2298 case "$firsttime" in
2299 true) echo $user >>../.config/instruct;;
2303 : find out where common programs are
2305 echo "Locating common programs..." >&4
2318 if test -d \$dir/\$thing; then
2324 for thisthing in \$dir/\$thing; do
2325 : just loop through to pick last item
2327 if test -f \$thisthing; then
2330 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2333 elif test -f \$dir/\$thing.exe; then
2334 if test -n "$DJGPP"; then
2335 echo \$dir/\$thing.exe
2336 elif test "$eunicefix" != ":"; then
2337 : on Eunice apparently
2390 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2391 pth="$pth /lib /usr/lib"
2392 for file in $loclist; do
2396 if test -f "$xxx"; then
2399 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2400 xxx=`./loc $file $file $pth`
2403 '') xxx=`./loc $file $file $pth`;;
2404 *) xxx=`./loc $xxx $xxx $pth`;;
2406 eval $file=$xxx$_exe
2410 echo $file is in $xxx.
2413 echo $file is in $xxx.
2416 echo "I don't know where '$file' is, and my life depends on it." >&4
2417 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2423 echo "Don't worry if any of the following aren't found..."
2425 for file in $trylist; do
2429 if test -f "$xxx"; then
2432 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2433 xxx=`./loc $file $file $pth`
2436 '') xxx=`./loc $file $file $pth`;;
2437 *) xxx=`./loc $xxx $xxx $pth`;;
2439 eval $file=$xxx$_exe
2443 echo $file is in $xxx.
2446 echo $file is in $xxx.
2449 echo "I don't see $file out there, $say."
2456 echo "Substituting grep for egrep."
2463 *) if $less -R </dev/null >/dev/null; then
2464 echo "Substituting less -R for less."
2472 echo "Substituting cp for ln."
2481 echo "I can't find make or gmake, and my life depends on it." >&4
2482 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2490 *) # We can't have osname yet.
2491 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2492 # Assume that gmake, if found, is definitely GNU make
2493 # and prefer it over the system make.
2494 echo "Substituting gmake for make."
2502 echo "Hopefully test is built into your sh."
2505 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2506 echo "Using the test built into your sh."
2514 echo "Hopefully echo is built into your sh."
2519 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2520 $echo $n "hi there$c" >foo1
2521 echo $n "hi there$c" >foo2
2522 if cmp foo1 foo2 >/dev/null 2>&1; then
2523 echo "They are compatible. In fact, they may be identical."
2530 They are not compatible! You are probably running ksh on a non-USG system.
2531 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2532 have echo built in and we may have to run some Bourne shell scripts. That
2533 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2536 $echo $n "The star should be here-->$c"
2543 # This question was auctioned at YAPC::Europe-2007 in Vienna
2544 # I never promised you could answer it. I only auctioned the question.
2546 The following message is sponsored by
2548 Dresden.pm<--The stars should be here.
2550 Dear Perl user, system administrator or package
2551 maintainer, the Perl community sends greetings to
2552 you. Do you (emblematical) greet back [Y/n]? n
2556 : Check what type of C compiler we use
2560 cat <<'EOSC' >>trygcc
2565 int main(int argc, char *argv[]) {
2569 if $cc -o try $ccflags $ldflags try.c; then
2572 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2578 # Skip this test because it gives a false match on output like:
2579 # ./trygcc: line 23: cc: command not found
2580 # case "`$cc -v -c try.c 2>&1`" in
2581 # *gcc*) trygcc=no ;;
2583 if $test X"$trygcc" = Xyes; then
2584 if gcc -o try -c try.c; then
2586 echo "You seem to have a working gcc, though." >&4
2587 # Switching compilers may undo the work of hints files.
2588 # The most common problem is -D_REENTRANT for threads.
2589 # This heuristic catches that case, but gets false positives
2590 # if -Dusethreads was not actually specified. Better to
2591 # bail out here with a useful message than fail
2592 # mysteriously later. Should we perhaps just try to
2593 # re-invoke Configure -Dcc=gcc config_args ?
2594 if $test -f usethreads.cbu; then
2597 *** However, any setting of the C compiler flags (e.g. for thread support)
2598 *** will be lost. It may be necessary for you to restart Configure and
2599 *** add -Dcc=gcc to your Configure command line.
2602 rp="Would you like to go ahead and try gcc anyway?"
2605 rp="Would you like to use it?"
2608 if $test -f myread; then
2611 if $test -f UU/myread; then
2614 echo "Cannot find myread, sorry. Aborting." >&2
2619 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2632 cat <<'EOSC' >>checkcc
2637 int main(int argc, char *argv[]) {
2641 if $cc -o try $ccflags $ldflags try.c; then
2644 if $test X"$despair" = Xyes; then
2645 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2648 You need to find a working C compiler.
2649 Either (purchase and) install the C compiler supplied by your OS vendor,
2650 or for a free C compiler try http://gcc.gnu.org/
2651 I cannot continue any further, aborting.
2660 : determine whether symbolic links are supported
2663 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2664 echo "Symbolic links are supported." >&4
2667 echo "Symbolic links are NOT supported." >&4
2672 : determine whether symbolic links are supported
2676 echo "Checking how to test for symbolic links..." >&4
2678 if $test "X$issymlink" = X; then
2680 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2681 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2683 if test $? = 0; then
2686 echo "Your builtin 'test -h' may be broken." >&4
2689 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2692 if test -f "$p/$test"; then
2701 echo "Trying external '$test -h'." >&4
2702 issymlink="$test -h"
2703 if $test ! -h sym >/dev/null 2>&1; then
2704 echo "External '$test -h' is broken, too." >&4
2712 if $test "X$issymlink" = X; then
2713 if $test -L sym 2>/dev/null; then
2714 issymlink="$test -L"
2715 echo "The builtin '$test -L' worked." >&4
2718 if $test "X$issymlink" != X; then
2719 echo "You can test for symbolic links with '$issymlink'." >&4
2721 echo "I do not know how you can test for symbolic links." >&4
2725 *) echo "No symbolic links, so not testing for their testing..." >&4
2730 : Make symlinks util
2731 case "$mksymlinks" in
2734 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2737 *) case "$lns:$issymlink" in
2738 *"ln"*" -s:"*"test -"?)
2739 echo "Creating the symbolic links..." >&4
2740 echo "(First creating the subdirectories...)" >&4
2742 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2744 test -z "$directory" && break
2748 if test ! -d t/base; then
2749 echo "Failed to create the subdirectories. Aborting." >&4
2752 echo "(Then creating the symlinks...)" >&4
2753 awk '{print $1}' $src/MANIFEST | while true; do
2755 test -z "$filename" && break
2756 if test -f $filename; then
2757 if $issymlink $filename; then
2761 if test -f $filename; then
2762 echo "$filename already exists, not symlinking."
2764 ln -s $src/$filename $filename
2768 if test ! -f t/base/lex.t; then
2769 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2774 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2782 : Check for Cross-Compilation
2783 case "$usecrosscompile" in
2785 $echo "Cross-compiling..."
2788 *-*-gcc) # A cross-compiling gcc, probably.
2789 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2791 # leave out ld, choosing it is more complex
2793 ranlib=$targetarch-ranlib
2794 $echo 'extern int foo;' > try.c
2795 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2797 if $test $# -gt 0; then
2799 incpth="`$echo $incpth|$sed 's/^ //'`"
2800 echo "Guessing incpth '$incpth'." >&4
2802 j="`$echo $i|$sed 's,/include$,/lib,'`"
2803 if $test -d $j; then
2807 libpth="`$echo $libpth|$sed 's/^ //'`"
2808 echo "Guessing libpth '$libpth'." >&4
2813 case "$targetarch" in
2814 '') echo "Targetarch not defined." >&4; croak=y ;;
2815 *) echo "Using targetarch $targetarch." >&4 ;;
2818 '') echo "Incpth not defined." >&4; croak=y ;;
2819 *) echo "Using incpth '$incpth'." >&4 ;;
2822 '') echo "Libpth not defined." >&4; croak=y ;;
2823 *) echo "Using libpth '$libpth'." >&4 ;;
2826 '') for i in $incpth; do
2827 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2829 echo "Guessing usrinc $usrinc." >&4
2834 '') echo "Usrinc not defined." >&4; croak=y ;;
2837 *) echo "Using usrinc $usrinc." >&4 ;;
2839 case "$targethost" in
2840 '') echo "Targethost not defined." >&4; croak=y ;;
2841 *) echo "Using targethost $targethost." >&4
2846 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2849 /*) run=$src/Cross/run
2850 targetmkdir=$src/Cross/mkdir
2852 from=$src/Cross/from
2854 *) pwd=`$test -f ../Configure & cd ..; pwd`
2856 targetmkdir=$pwd/Cross/mkdir
2858 from=$pwd/Cross/from
2861 case "$targetrun" in
2862 '') targetrun=ssh ;;
2867 case "$targetfrom" in
2868 '') targetfrom=scp ;;
2872 from=$from-$targetfrom
2873 case "$targetdir" in
2875 echo "Guessing targetdir $targetdir." >&4
2878 case "$targetuser" in
2880 echo "Guessing targetuser $targetuser." >&4
2883 case "$targetfrom" in
2887 case "$targetrun" in
2899 '') cwd=$targetdir ;;
2903 if $test ! -f \$exe.xok; then
2907 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2910 *) echo "Unknown targetrun '$targetrun'" >&4
2914 case "$targetmkdir" in
2916 cat >$targetmkdir <<EOF
2918 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2920 $chmod a+rx $targetmkdir
2922 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2934 $targetmkdir \`dirname \$f\`
2935 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2938 $targetmkdir $targetdir/\`dirname \$f\`
2939 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2952 $mkdir -p $targetdir/\`dirname \$f\`
2953 $cp \$f $targetdir/\$f || exit 1
2956 $targetmkdir $targetdir/\`dirname \$f\`
2957 $cp \$f $targetdir/\$f || exit 1
2964 *) echo "Unknown targetto '$targetto'" >&4
2968 case "$targetfrom" in
2975 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2980 cp) cat >$from <<EOF
2985 cp $targetdir/\$f . || exit 1
2990 *) echo "Unknown targetfrom '$targetfrom'" >&4
2994 if $test ! -f $run; then
2995 echo "Target 'run' script '$run' not found." >&4
2999 if $test ! -f $to; then
3000 echo "Target 'to' script '$to' not found." >&4
3004 if $test ! -f $from; then
3005 echo "Target 'from' script '$from' not found." >&4
3009 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3013 Using '$run' for remote execution,
3014 and '$from' and '$to'
3015 for remote file transfer.
3021 usecrosscompile='undef'
3026 : see whether [:lower:] and [:upper:] are supported character classes
3028 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3030 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3034 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3035 # (0xd9 and 0xe2), therefore that is a nice testing point.
3036 if test "X$up" = X -o "X$low" = X; then
3037 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3043 if test "X$up" = X -o "X$low" = X; then
3044 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3050 if test "X$up" = X -o "X$low" = X; then
3051 case "`echo RS | od -x 2>/dev/null`" in
3053 echo "Hey, this might be EBCDIC." >&4
3054 if test "X$up" = X -o "X$low" = X; then
3055 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3056 rs) up='[A-IJ-RS-Z]'
3061 if test "X$up" = X -o "X$low" = X; then
3062 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3072 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3074 echo "Using $up and $low to convert case." >&4
3077 echo "I don't know how to translate letters from upper to lower case." >&4
3078 echo "Your tr is not acting any way I know of." >&4
3082 : set up the translation script tr, must be called with ./tr of course
3086 '[A-Z][a-z]') exec $tr '$up' '$low';;
3087 '[a-z][A-Z]') exec $tr '$low' '$up';;
3094 : Try to determine whether config.sh was made on this system
3095 case "$config_sh" in
3097 myuname=`$uname -a 2>/dev/null`
3098 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3099 # Downcase everything to avoid ambiguity.
3100 # Remove slashes and single quotes so we can use parts of this in
3101 # directory and file names.
3102 # Remove newlines so myuname is sane to use elsewhere.
3103 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3104 # because the A-Z/a-z are not consecutive.
3105 myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3106 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3107 newmyuname="$myuname"
3109 case "$knowitall" in
3111 if test -f ../config.sh; then
3112 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3113 eval "`grep myuname= ../config.sh`"
3115 if test "X$myuname" = "X$newmyuname"; then
3123 : Get old answers from old config file if Configure was run on the
3124 : same system, otherwise use the hints.
3127 if test -f config.sh; then
3129 rp="I see a config.sh file. Shall I use it to set the defaults?"
3132 n*|N*) echo "OK, I'll ignore it."
3133 mv config.sh config.sh.old
3134 myuname="$newmyuname"
3136 *) echo "Fetching default answers from your old config.sh file..." >&4
3144 : Older versions did not always set $sh. Catch re-use of such
3154 if test ! -f config.sh; then
3157 First time through, eh? I have some defaults handy for some systems
3158 that need some extra help getting the Configure answers right:
3161 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3163 : Half the following guesses are probably wrong... If you have better
3164 : tests or hints, please send them to perlbug@perl.org
3165 : The metaconfig authors would also appreciate a copy...
3166 $test -f /irix && osname=irix
3167 $test -f /xenix && osname=sco_xenix
3168 $test -f /dynix && osname=dynix
3169 $test -f /dnix && osname=dnix
3170 $test -f /lynx.os && osname=lynxos
3171 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3172 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3173 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3174 $test -f /bin/mips && /bin/mips && osname=mips
3175 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3176 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3177 $test -d /usr/apollo/bin && osname=apollo
3178 $test -f /etc/saf/_sactab && osname=svr4
3179 $test -d /usr/include/minix && osname=minix
3180 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3181 if $test -d /MachTen -o -d /MachTen_Folder; then
3183 if $test -x /sbin/version; then
3184 osvers=`/sbin/version | $awk '{print $2}' |
3185 $sed -e 's/[A-Za-z]$//'`
3186 elif $test -x /usr/etc/version; then
3187 osvers=`/usr/etc/version | $awk '{print $2}' |
3188 $sed -e 's/[A-Za-z]$//'`
3194 $test -f /sys/posix.dll &&
3195 $test -f /usr/bin/what &&
3196 set X `/usr/bin/what /sys/posix.dll` &&
3197 $test "$3" = UWIN &&
3201 if $test -f $uname; then
3209 umips) osname=umips ;;
3212 [23]100) osname=mips ;;
3213 next*) osname=next ;;
3215 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3216 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3219 elif $test -f /etc/kconfig; then
3221 if test "$lns" = "$ln -s"; then
3223 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3225 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3232 if test -n "$DJGPP"; then
3241 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3243 # oslevel can fail with:
3244 # oslevel: Unable to acquire lock.
3245 *not\ found) osvers="$4"."$3" ;;
3246 '<3240'|'<>3240') osvers=3.2.0 ;;
3247 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3248 '=3250'|'>3250') osvers=3.2.5 ;;
3252 bitrig) osname=bitrig
3255 bsd386) osname=bsd386
3258 cygwin*) osname=cygwin
3261 *dc.osx) osname=dcosx
3267 domainos) osname=apollo
3273 dragonfly) osname=dragonfly
3276 dynixptx*) osname=dynixptx
3277 osvers=`echo "$4"|sed 's/^v//'`
3279 freebsd) osname=freebsd
3281 genix) osname=genix ;;
3285 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3301 netbsd*) osname=netbsd
3304 news-os) osvers="$3"
3306 4*) osname=newsos4 ;;
3310 next*) osname=next ;;
3311 nonstop-ux) osname=nonstopux ;;
3312 openbsd) osname=openbsd
3318 POSIX-BC | posix-bc ) osname=posix-bc
3321 powerux | power_ux | powermax_os | powermaxos | \
3322 powerunix | power_unix) osname=powerux
3328 solaris) osname=solaris
3330 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3337 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3341 titanos) osname=titanos
3350 ultrix) osname=ultrix
3353 osf1|mls+) case "$5" in
3356 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3359 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3362 hp*) osname=hp_osf1 ;;
3363 mips) osname=mips_osf1 ;;
3366 # UnixWare 7.1.2 is known as Open UNIX 8
3367 openunix|unixware) osname=svr5
3375 $2) case "$osname" in
3379 : svr4.x or possibly later
3389 if test -f /stand/boot ; then
3390 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3391 if test -n "$INITPROG" -a -f "$INITPROG"; then
3392 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3393 if test -n "$isesix"; then
3401 *) if test -f /etc/systemid; then
3403 set `echo $3 | $sed 's/\./ /g'` $4
3404 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3406 elif $test -f $src/hints/sco_$1_$2.sh; then
3408 elif $test -f $src/hints/sco_$1.sh; then
3413 '') : Still unknown. Probably a generic Sys V.
3422 *) case "$osname" in
3423 '') : Still unknown. Probably a generic BSD.
3431 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3432 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3433 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3436 $rm -f UU/kernel.what
3437 elif test -d c:/. -o -n "$is_os2" ; then
3444 case "$targetarch" in
3447 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3452 : Now look for a hint file osname_osvers, unless one has been
3453 : specified already.
3456 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3457 : Also try without trailing minor version numbers.
3458 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3459 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3460 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3461 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3464 *) case "$osvers" in
3467 *) if $test -f $src/hints/$file.sh ; then
3469 elif $test -f $src/hints/$xfile.sh ; then
3471 elif $test -f $src/hints/$xxfile.sh ; then
3473 elif $test -f $src/hints/$xxxfile.sh ; then
3475 elif $test -f $src/hints/$xxxxfile.sh ; then
3477 elif $test -f "$src/hints/${osname}.sh" ; then
3486 if $test -f Policy.sh ; then
3489 none) dflt="Policy" ;;
3490 *) dflt="Policy $dflt" ;;
3495 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3499 if $test -f Policy.sh ; then
3502 There's also a Policy hint file available, which should make the
3503 site-specific (policy) questions easier to answer.
3510 You may give one or more space-separated answers, or "none" if appropriate.
3511 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3512 previous run of Configure, you may specify it as well as or instead of
3513 OS-specific hints. If hints are provided for your OS, you should use them:
3514 although Perl can probably be built without hints on many platforms, using
3515 hints often improve performance and may enable features that Configure can't
3516 set up on its own. If there are no hints that match your OS, specify "none";
3517 DO NOT give a wrong version or a wrong OS.
3521 rp="Which of these apply, if any?"
3524 for file in $tans; do
3525 if $test X$file = XPolicy -a -f Policy.sh; then
3527 $cat Policy.sh >> UU/config.sh
3528 elif $test -f $src/hints/$file.sh; then
3529 . $src/hints/$file.sh
3530 $cat $src/hints/$file.sh >> UU/config.sh
3531 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3534 : Give one chance to correct a possible typo.
3535 echo "$file.sh does not exist"
3537 rp="hint to use instead?"
3539 for file in $ans; do
3540 if $test -f "$src/hints/$file.sh"; then
3541 . $src/hints/$file.sh
3542 $cat $src/hints/$file.sh >> UU/config.sh
3543 elif $test X$ans = X -o X$ans = Xnone ; then
3546 echo "$file.sh does not exist -- ignored."
3553 : Remember our hint file for later.
3554 if $test -f "$src/hints/$file.sh" ; then
3564 echo "Fetching default answers from $config_sh..." >&4
3568 cp $config_sh config.sh 2>/dev/null
3578 test "$override" && . ./optdef.sh
3580 : Restore computed paths
3581 for file in $loclist $trylist; do
3582 eval $file="\$_$file"
3587 Configure uses the operating system name and version to set some defaults.
3588 The default value is probably right if the name rings a bell. Otherwise,
3589 since spelling matters for me, either accept the default or answer "none"
3596 ''|' '|none) dflt=none ;;
3597 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3600 *) dflt="$osname" ;;
3602 rp="Operating system name?"
3606 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3612 ''|' '|none) dflt=none ;;
3613 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3614 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3616 ''|' ') dflt=none ;;
3621 *) dflt="$osvers" ;;
3623 rp="Operating system version?"
3633 : who configured the system
3634 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3637 cf_by=`(logname) 2>/dev/null`
3640 cf_by=`(whoami) 2>/dev/null`
3642 "") cf_by=unknown ;;
3647 : decide how portable to be. Allow command line overrides.
3648 case "$d_portable" in
3650 *) d_portable="$define" ;;
3653 : set up shell script to do ~ expansion
3659 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3662 if $test -f /bin/csh; then
3663 /bin/csh -f -c "glob \$1"
3668 name=\`$expr x\$1 : '..\([^/]*\)'\`
3669 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3670 if $test ! -d "\$dir"; then
3672 echo "\$me: can't locate home directory for: \$name" >&2
3677 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3693 : now set up to get a file name
3697 cat <<'EOSC' >>getfile
3713 : getfile will accept an answer from the comma-separated list
3714 : enclosed in parentheses even if it does not meet other criteria.
3715 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3716 fn=`echo $fn | sed 's/(.*)//'`
3722 loc_file=`expr $fn : '.*:\(.*\)'`
3723 fn=`expr $fn : '\(.*\):.*'`
3731 */*) fullpath=true;;
3740 *e*) exp_file=true;;
3743 *p*) nopath_ok=true;;
3748 *d*) type='Directory';;
3749 *l*) type='Locate';;
3754 Locate) what='File';;
3759 case "$d_portable" in
3767 while test "$type"; do
3772 true) rp="$rp (~name ok)";;
3775 if test -f UU/getfile.ok && \
3776 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3795 value=`UU/filexp $ans`
3798 if test "$ans" != "$value"; then
3799 echo "(That expands to $value on this system.)"
3813 /*) value="$ansexp" ;;
3814 [a-zA-Z]:/*) value="$ansexp" ;;
3819 echo "I shall only accept a full path name, as in /bin/ls." >&4
3820 echo "Use a ! shell escape if you wish to check pathnames." >&4
3823 echo "Please give a full path name, starting with slash." >&4
3826 echo "Note that using ~name is ok provided it expands well." >&4
3839 for fp in $gfpth; do
3840 if test "X$fp" = X.; then
3845 if test -f "$pf"; then
3847 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3849 echo "($value is not a plain file, but that's ok.)"
3852 if test X"$type" = X; then
3859 for fp in $gfpth; do
3860 if test "X$fp" = X.; then
3865 direxp="$fp/$ansexp"
3867 if test -d "$direxp"; then
3875 if test -d "$ansexp"; then
3876 echo "(Looking for $loc_file in directory $value.)"
3877 value="$value/$loc_file"
3878 ansexp="$ansexp/$loc_file"
3880 if test -f "$ansexp"; then
3883 case "$nopath_ok" in
3884 true) case "$value" in
3886 *) echo "Assuming $value will be in people's path."
3902 if test "$fastread" = yes; then
3907 rp="$what $value doesn't exist. Use that name anyway?"
3926 test "X$gfpthkeep" != Xy && gfpth=""
3929 : determine root of directory hierarchy where package will be installed.
3932 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3935 dflt=`echo "$prefix" | sed 's/.$//'`
3943 By default, $package will be installed in $dflt/bin, manual pages
3944 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3945 installation directories. Typically this is something like /usr/local.
3946 If you wish to have binaries under /usr/bin but other parts of the
3947 installation under /usr/local, that's ok: you will be prompted
3948 separately for each of the installation directories, the prefix being
3949 only used to set the defaults.
3953 rp='Installation prefix to use?'
3961 *) oldprefix="$prefix";;
3968 : allow them to override the AFS root
3971 *) afsroot=$afsroot ;;
3977 $define|true) afs=true ;;
3978 $undef|false) afs=false ;;
3979 *) if $test -d $afsroot; then
3987 echo "AFS may be running... I'll be extra cautious then..." >&4
3989 echo "AFS does not seem to be running..." >&4
3992 : determine installation prefix for where package is to be installed.
3996 Since you are running AFS, I need to distinguish the directory in which
3997 files will reside from the directory in which they are installed (and from
3998 which they are presumably copied to the former directory by occult means).
4001 case "$installprefix" in
4002 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
4003 *) dflt="$installprefix";;
4008 In some special cases, particularly when building $package for distribution,
4009 it is convenient to distinguish the directory in which files should be
4010 installed from the directory ($prefix) in which they will
4011 eventually reside. For most users, these two directories are the same.
4014 case "$installprefix" in
4016 *) dflt=$installprefix;;
4020 rp='What installation prefix should I use for installing files?'
4022 installprefix="$ans"
4023 installprefixexp="$ansexp"
4025 : Perform the prefixexp/installprefixexp correction if necessary
4026 cat <<EOS >installprefix
4029 cat <<'EOSC' >>installprefix
4030 : Change installation prefix, if necessary.
4031 if $test X"$prefix" != X"$installprefix"; then
4032 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4034 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4037 chmod +x installprefix
4038 $eunicefix installprefix
4040 : Set variables such as privlib and privlibexp from the output of ./getfile
4041 : performing the prefixexp/installprefixexp correction if necessary.
4042 cat <<EOS >setprefixvar
4045 cat <<'EOSC' >>setprefixvar
4046 eval "${prefixvar}=\"\$ans\""
4047 eval "${prefixvar}exp=\"\$ansexp\""
4050 chmod +x setprefixvar
4051 $eunicefix setprefixvar
4053 : set up the script used to warn in case of inconsistency
4062 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4064 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4065 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4070 echo "*** WHOA THERE!!! ***" >&4
4071 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4074 rp=" Keep the $hint value?"
4077 y) td=$was; tu=$was;;
4081 : function used to set '$1' to '$val'
4082 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4084 $define$undef) . ./whoa; eval "$var=\$td";;
4085 $undef$define) . ./whoa; eval "$var=\$tu";;
4086 *) eval "$var=$val";;
4089 : get the patchlevel
4091 echo "Getting the current patchlevel..." >&4
4092 if $test -r $rsrc/patchlevel.h;then
4093 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4094 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4095 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4096 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4097 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4098 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4099 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4108 $echo "(You do not have patchlevel.h. Eek.)"
4110 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4111 version_patchlevel_string="version $patchlevel subversion $subversion"
4112 case "$perl_patchlevel" in
4114 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4115 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4119 $echo "(You have $package $version_patchlevel_string.)"
4123 : XXX Should be a Configure test for double-dots in filenames.
4124 version=`echo $revision $patchlevel $subversion | \
4125 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4126 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4127 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4130 version=`echo $revision $patchlevel $subversion | \
4131 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4132 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4133 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4136 : Special case the 5.005_xx maintenance series, which used 5.005
4137 : without any subversion label as a subdirectory in $sitelib
4138 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4139 api_versionstring='5.005'
4142 : Do we want threads support and if so, what type
4143 case "$usethreads" in
4144 $define|true|[yY]*) dflt='y';;
4145 *) # Catch case where user specified ithreads or 5005threads but
4146 # forgot -Dusethreads (A.D. 4/2002)
4147 case "$useithreads$use5005threads" in
4148 *$define*) dflt='y';;
4155 Perl can be built to offer a form of threading support on some systems
4156 To do so, Configure can be run with -Dusethreads.
4158 Note that Perl built with threading support runs slightly slower
4159 and uses slightly more memory than plain Perl.
4161 If this doesn't make any sense to you, just accept the default '$dflt'.
4163 rp='Build a threading Perl?'
4166 y|Y) val="$define" ;;
4172 if $test $patchlevel -lt 9; then
4173 case "$usethreads" in
4175 : Default to ithreads unless overridden on command line or with
4178 case "$use5005threads" in
4180 echo "5.005 threads are no longer supported"
4184 case "$useithreads" in
4185 $undef|false|[nN]*) dflt='n';;
4187 rp='Use the newer interpreter-based ithreads?'
4190 y|Y) val="$define" ;;
4195 : Now set use5005threads to the opposite value.
4196 case "$useithreads" in
4197 $define) val="$undef" ;;
4204 useithreads="$undef"
4205 use5005threads="$undef"
4209 case "$useithreads$use5005threads" in
4213 You cannot have both the ithreads and the 5.005 threads enabled
4214 at the same time. Disabling the 5.005 threads since they are
4215 much less stable than the ithreads.
4218 use5005threads="$undef"
4223 : perl-5.9.x and later
4225 if test X"$usethreads" = "X$define"; then
4226 case "$use5005threads" in
4230 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4237 use5005threads="$undef"
4238 useithreads="$usethreads"
4241 case "$d_oldpthreads" in
4242 '') : Configure tests would be welcome here. For now, assume undef.
4244 *) val="$d_oldpthreads" ;;
4250 : Look for a hint-file generated 'call-back-unit'. If the
4251 : user has specified that a threading perl is to be built,
4252 : we may need to set or change some other defaults.
4253 if $test -f usethreads.cbu; then
4254 echo "Your platform has some specific hints regarding threaded builds, using them..."
4257 case "$usethreads" in
4258 "$define"|true|[yY]*)
4260 (Your platform does not have any specific hints for threaded builds.
4261 Assuming POSIX threads, then.)
4267 : Check if multiplicity is required
4270 Perl can be built so that multiple Perl interpreters can coexist
4271 within the same Perl executable.
4274 case "$useithreads" in
4277 This multiple interpreter support is required for interpreter-based threads.
4281 *) case "$usemultiplicity" in
4282 $define|true|[yY]*) dflt='y';;
4286 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4287 rp='Build Perl for multiplicity?'
4290 y|Y) val="$define" ;;
4298 : Check if morebits is requested
4299 case "$usemorebits" in
4300 "$define"|true|[yY]*)
4301 use64bitint="$define"
4302 uselongdouble="$define"
4303 usemorebits="$define"
4305 *) usemorebits="$undef"
4309 : Determine the C compiler to be used
4315 rp="Use which C compiler?"
4319 : See whether they have no cc but they do have gcc
4321 if $test -f cc.cbu; then
4326 : make some quick guesses about what we are up against
4328 $echo $n "Hmm... $c"
4338 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4339 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4341 echo "Looks kind of like an OSF/1 system, but we'll see..."
4343 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4344 xxx=`./loc addbib blurfl $pth`
4345 if $test -f $xxx; then
4346 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4350 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4351 echo "Looks kind of like an extended USG system, but we'll see..."
4353 echo "Looks kind of like a USG system, but we'll see..."
4357 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4358 echo "Looks kind of like a BSD system, but we'll see..."
4362 echo "Looks kind of like a Version 7 system, but we'll see..."
4365 case "$eunicefix" in
4368 There is, however, a strange, musty smell in the air that reminds me of
4369 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4373 : it so happens the Eunice I know will not run shell scripts in Unix format
4377 echo "Congratulations. You aren't running Eunice."
4381 : Detect OS2. The p_ variable is set above in the Head.U unit.
4382 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4383 : semicolon as a patch separator
4388 I have the feeling something is not exactly right, however...don't tell me...
4389 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4390 (Or you may be running DOS with DJGPP.)
4395 if test -f /xenix; then
4396 echo "Actually, this looks more like a XENIX system..."
4401 echo "It's not Xenix..."
4406 if test -f /venix; then
4407 echo "Actually, this looks more like a VENIX system..."
4414 echo "Nor is it Venix..."
4417 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4418 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4421 : Check if we are using GNU gcc and what its version is
4423 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4427 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4429 printf("%s\n", __VERSION__);
4431 printf("%s\n", "1");
4437 if $cc -o try $ccflags $ldflags try.c; then
4438 gccversion=`$run ./try`
4439 case "$gccversion" in
4440 '') echo "You are not using GNU cc." ;;
4441 *) echo "You are using GNU cc $gccversion."
4447 echo "*** WHOA THERE!!! ***" >&4
4448 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4449 case "$knowitall" in
4451 echo " You'd better start hunting for one and let me know about it." >&4
4457 case "$gccversion" in
4458 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4460 case "$gccversion" in
4461 '') gccosandvers='' ;;
4462 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4463 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4465 case "$gccosandvers" in
4466 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4467 $osname$osvers) ;; # looking good
4468 $osname*) cat <<EOM >&4
4470 *** WHOA THERE!!! ***
4472 Your gcc has not been compiled for the exact release of
4473 your operating system ($gccosandvers versus $osname$osvers).
4475 In general it is a good idea to keep gcc synchronized with
4476 the operating system because otherwise serious problems
4477 may ensue when trying to compile software, like Perl.
4479 I'm trying to be optimistic here, though, and will continue.
4480 If later during the configuration and build icky compilation
4481 problems appear (headerfile conflicts being the most common
4482 manifestation), I suggest reinstalling the gcc to match
4483 your operating system release.
4487 *) gccosandvers='' ;; # failed to parse, better be silent
4495 # gcc 3.* complain about adding -Idirectories that they already know about,
4496 # so we will take those off from locincpth.
4497 case "$gccversion" in
4499 echo "main(){}">try.c
4500 for incdir in $locincpth; do
4501 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4502 grep '^c[cp]p*[01]: warning: changing search order '`
4503 if test "X$warn" != X; then
4504 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4510 : What should the include directory be ?
4512 $echo $n "Hmm... $c"
4516 if $test -f /bin/mips && /bin/mips; then
4517 echo "Looks like a MIPS system..."
4518 $cat >usr.c <<'EOCP'
4519 #ifdef SYSTYPE_BSD43
4523 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4524 dflt='/bsd43/usr/include'
4528 mips_type='System V'
4530 $rm -f usr.c usr.out
4531 echo "and you're compiling with the $mips_type compiler and libraries."
4535 echo "Doesn't look like a MIPS system."
4545 case "$xxx_prompt" in
4548 rp='Where are the include files you want to use?'
4556 : see how we invoke the C preprocessor
4558 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4559 cat <<'EOT' >testcpp.c
4565 if test ! -f cppstdin; then
4566 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4567 # AIX cc -E doesn't show the absolute headerfile
4568 # locations but we'll cheat by using the -M flag.
4569 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
4571 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4574 echo "Keeping your $hint cppstdin wrapper."
4577 wrapper=`pwd`/cppstdin
4581 if $test "X$cppstdin" != "X" && \
4582 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4583 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4585 echo "You used to use $cppstdin $cppminus so we'll use that again."
4587 '') echo "But let's see if we can live without a wrapper..." ;;
4589 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4590 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4592 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4595 echo "(However, $cpprun $cpplast does not work, let's see...)"
4603 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4610 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4611 $cc -E <testcpp.c >testcpp.out 2>&1; \
4612 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4613 echo "Yup, it does."
4616 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4617 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4618 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4619 echo "Yup, it does."
4622 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4623 $cc -P <testcpp.c >testcpp.out 2>&1; \
4624 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4625 echo "Yipee, that works!"
4628 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4629 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4630 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4631 echo "At long last!"
4634 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4635 $cpp <testcpp.c >testcpp.out 2>&1; \
4636 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4640 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4641 $cpp - <testcpp.c >testcpp.out 2>&1; \
4642 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4643 echo "Hooray, it works! I was beginning to wonder."
4646 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4647 $wrapper <testcpp.c >testcpp.out 2>&1; \
4648 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4654 rp="No dice. I can't find a C preprocessor. Name one:"
4658 $x_cpp <testcpp.c >testcpp.out 2>&1
4659 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4660 echo "OK, that will do." >&4
4662 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4677 echo "Perhaps can we force $cc -E using a wrapper..."
4678 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4679 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4685 echo "Nope, we'll have to live without it..."
4699 "$wrapper"|'cppstdin') ;;
4700 *) $rm -f $wrapper;;
4702 $rm -f testcpp.c testcpp.out
4704 : Set private lib path
4707 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4712 '') dlist="$loclibpth $plibpth $glibpth";;
4713 *) dlist="$libpth";;
4716 : Now check and see which directories actually exist, avoiding duplicates
4720 if $test -d $xxx; then
4723 *) libpth="$libpth $xxx";;
4729 Some systems have incompatible or broken versions of libraries. Among
4730 the directories listed in the question below, please remove any you
4731 know not to be holding relevant libraries, and add any that are needed.
4732 Say "none" for none.
4743 rp="Directories to use for library searches?"
4750 : compute shared library extension
4753 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4763 On some systems, shared libraries may be available. Answer 'none' if
4764 you want to suppress searching of shared libraries for the remainder
4765 of this configuration.
4768 rp='What is the file extension used for shared libraries?'
4772 : Define several unixisms.
4773 : Hints files or command line option can be used to override them.
4774 : The convoluted testing is in case hints files set either the old
4777 '') case "$exe_ext" in
4779 *) _exe="$exe_ext" ;;
4784 '') case "$lib_ext" in
4791 '') case "$obj_ext" in
4798 '') case "$path_sep" in
4809 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4811 : Which makefile gets called first. This is used by make depend.
4812 case "$firstmakefile" in
4813 '') firstmakefile='makefile';;
4816 : Check is we will use socks
4818 $define|true|[yY]*) dflt='y';;
4823 Perl can be built to use the SOCKS proxy protocol library. To do so,
4824 Configure must be run with -Dusesocks. If you use SOCKS you also need
4825 to use the PerlIO abstraction layer, this will be implicitly selected.
4827 If this doesn't make any sense to you, just accept the default '$dflt'.
4829 rp='Build Perl for SOCKS?'
4832 y|Y) val="$define" ;;
4838 : Check for uselongdouble support
4840 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4843 case "$uselongdouble" in
4844 $define|true|[yY]*) dflt='y';;
4849 Perl can be built to take advantage of long doubles which
4850 (if available) may give more accuracy and range for floating point numbers.
4852 If this doesn't make any sense to you, just accept the default '$dflt'.
4854 rp='Try to use long doubles if available?'
4857 y|Y) val="$define" ;;
4863 case "$uselongdouble" in
4864 true|[yY]*) uselongdouble="$define" ;;
4867 : Look for a hint-file generated 'call-back-unit'. If the
4868 : user has specified that long doubles should be used,
4869 : we may need to set or change some other defaults.
4870 if $test -f uselongdouble.cbu; then
4871 echo "Your platform has some specific hints regarding long doubles, using them..."
4872 . ./uselongdouble.cbu
4874 case "$uselongdouble" in
4877 (Your platform does not have any specific hints for long doubles.)
4883 : Looking for optional libraries
4885 echo "Checking for optional libraries..." >&4
4890 case "$libswanted" in
4891 '') libswanted='c_s';;
4894 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4900 for thisdir in $libpth $xlibpth; do
4901 test -d $thisdir && libspath="$libspath $thisdir"
4903 for thislib in $libswanted; do
4904 for thisdir in $libspath; do
4906 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4907 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4908 $test -f "$xxx" && eval $libscheck
4909 $test -f "$xxx" && libstyle=shared
4911 if test ! -f "$xxx"; then
4912 xxx=$thisdir/lib$thislib.$so
4913 $test -f "$xxx" && eval $libscheck
4914 $test -f "$xxx" && libstyle=shared
4916 if test ! -f "$xxx"; then
4917 xxx=$thisdir/lib$thislib$_a
4918 $test -f "$xxx" && eval $libscheck
4919 $test -f "$xxx" && libstyle=static
4921 if test ! -f "$xxx"; then
4922 xxx=$thisdir/$thislib$_a
4923 $test -f "$xxx" && eval $libscheck
4924 $test -f "$xxx" && libstyle=static
4926 if test ! -f "$xxx"; then
4927 xxx=$thisdir/lib${thislib}_s$_a
4928 $test -f "$xxx" && eval $libscheck
4929 $test -f "$xxx" && libstyle=static
4930 $test -f "$xxx" && thislib=${thislib}_s
4932 if test ! -f "$xxx"; then
4933 xxx=$thisdir/Slib$thislib$_a
4934 $test -f "$xxx" && eval $libscheck
4935 $test -f "$xxx" && libstyle=static
4937 if $test -f "$xxx"; then
4939 shared) echo "Found -l$thislib (shared)." ;;
4940 static) echo "Found -l$thislib." ;;
4941 *) echo "Found -l$thislib ($libstyle)." ;;
4945 *) dflt="$dflt -l$thislib"
4946 libsfound="$libsfound $xxx"
4948 libsfiles="$libsfiles $yyy"
4949 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4950 case " $libsdirs " in
4952 *) libsdirs="$libsdirs $yyy" ;;
4959 if $test ! -f "$xxx"; then
4960 echo "No -l$thislib."
4971 ' '|'') dflt='none';;
4976 In order to compile $package on your machine, a number of libraries
4977 are usually needed. Include any other special libraries here as well.
4978 Say "none" for none. The default list is almost always right.
4982 rp="What libraries to use?"
4989 : determine optimization, if desired, or use for debug flag also
4991 ' '|$undef) dflt='none';;
4993 *) dflt="$optimize";;
4997 By default, $package compiles with the -O flag to use the optimizer.
4998 Alternately, you might want to use the symbolic debugger, which uses
4999 the -g flag (on traditional Unix systems). Either flag can be
5000 specified here. To use neither flag, specify the word "none".
5003 rp="What optimizer/debugger flag should be used?"
5007 'none') optimize=" ";;
5010 : Check what DEBUGGING is required from the command line
5011 : -DEBUGGING or -DDEBUGGING or
5012 : -DEBUGGING=both = -g + -DDEBUGGING
5013 : -DEBUGGING=-g or -Doptimize=-g = -g
5014 : -DEBUGGING=none or -UDEBUGGING =
5015 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5018 *) DEBUGGING=$EBUGGING ;;
5021 case "$DEBUGGING" in
5025 *) optimize="$optimize -g" ;;
5029 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5037 case "$DEBUGGING" in
5038 both|$define) dflt='-DDEBUGGING'
5041 : argument order is deliberate, as the flag will start with - which set could
5042 : think is an option
5043 checkccflag='check=$1; flag=$2; callback=$3;
5045 echo "Checking if your compiler accepts $flag" 2>&1;
5046 echo "int main(void) { return 0; }" > gcctest.c;
5047 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5048 echo "Yes, it does." 2>&1;
5049 if $test -s gcctest.out ; then
5050 echo "But your platform does not like it:";
5055 echo "Leaving current flags $ccflags alone." 2>&1
5057 *) dflt="$dflt $flag";
5063 echo "Nope, it does not, but that is ok." 2>&1;
5067 : We will not override a previous value, but we might want to
5068 : augment a hint file
5070 default|recommended)
5071 case "$gccversion" in
5072 1*) dflt="$dflt -fpcc-struct-return" ;;
5074 case "$optimize:$DEBUGGING" in
5075 *-g*:old) dflt="$dflt -DDEBUGGING";;
5077 case "$gccversion" in
5078 2*) if $test -d /etc/conf/kconfig.d &&
5079 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5081 # Interactive Systems (ISC) POSIX mode.
5086 case "$gccversion" in
5089 ?*) set strict-aliasing -fno-strict-aliasing
5093 # For gcc, adding -pipe speeds up compilations for some, but apparently
5094 # some assemblers can't read from stdin. (It also slows down compilations
5095 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5096 case "$gccversion" in
5102 # on x86_64 (at least) we require an extra library (libssp) in the
5103 # link command line. This library is not named, so I infer that it is
5104 # an implementation detail that may change. Hence the safest approach
5105 # is to add the flag to the flags passed to the compiler at link time,
5106 # as that way the compiler can do the right implementation dependant
5108 case "$gccversion" in
5109 ?*) set stack-protector -fstack-protector
5116 case "$mips_type" in
5117 *BSD*|'') inclwanted="$locincpth $usrinc";;
5118 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5120 for thisincl in $inclwanted; do
5121 if $test -d $thisincl; then
5122 if $test x$thisincl != x$usrinc; then
5124 *" -I$thisincl "*);;
5125 *) dflt="$dflt -I$thisincl ";;
5131 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5133 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5141 *) dflt="$dflt -D$2";;
5145 set signal.h LANGUAGE_C; eval $inctest
5149 ccflags="$ccflags -DSOCKS"
5154 default|recommended) dflt="$ccflags $dflt" ;;
5155 *) dflt="$ccflags";;
5164 Your C compiler may want other flags. For this question you should include
5165 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5166 but you should NOT include libraries or ld flags like -lwhatever. If you
5167 want $package to honor its debug switch, you should include -DDEBUGGING here.
5168 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5170 To use no flags, specify the word "none".
5176 rp="Any additional cc flags?"
5183 : the following weeds options from ccflags that are of no interest to cpp
5185 '') cppflags="$ccflags" ;;
5186 *) cppflags="$cppflags $ccflags" ;;
5188 case "$gccversion" in
5189 1*) cppflags="$cppflags -D__GNUC__"
5191 case "$mips_type" in
5193 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5199 echo "Let me guess what the preprocessor flags are..." >&4
5213 *) ftry="$previous $flag";;
5215 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5216 >cpp1.out 2>/dev/null && \
5217 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5218 >cpp2.out 2>/dev/null && \
5219 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5220 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5222 cppflags="$cppflags $ftry"
5232 *-*) echo "They appear to be: $cppflags";;
5234 $rm -f cpp.c cpp?.out
5238 : flags used in final linking phase
5240 '') if ./venix; then
5246 *-posix*) dflt="$dflt -posix" ;;
5249 *) dflt="$ldflags";;
5251 # See note above about -fstack-protector
5253 *-fstack-protector*)
5255 *-fstack-protector*) ;; # Don't add it again
5256 *) dflt="$dflt -fstack-protector" ;;
5261 : Try to guess additional flags to pick up local libraries.
5262 for thislibdir in $libpth; do
5263 case " $loclibpth " in
5266 *"-L$thislibdir "*) ;;
5267 *) dflt="$dflt -L$thislibdir" ;;
5279 Your C linker may need flags. For this question you should
5280 include -L/whatever and any other flags used by the C linker, but you
5281 should NOT include libraries like -lwhatever.
5283 Make sure you include the appropriate -L/path flags if your C linker
5284 does not normally search all of the directories you specified above,
5287 To use no flags, specify the word "none".
5291 rp="Any additional ld flags (NOT including libraries)?"
5297 rmlist="$rmlist pdp11"
5301 echo "Checking your choice of C compiler and flags for coherency..." >&4
5302 $cat > try.c <<'EOF'
5304 int main() { printf("Ok\n"); return(0); }
5306 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5308 $cat >try.msg <<'EOM'
5309 I've tried to compile and run the following simple program:
5312 $cat try.c >> try.msg
5314 $cat >> try.msg <<EOM
5321 and I got the following output:
5325 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5326 if $sh -c "$run ./try " >>try.msg 2>&1; then
5330 *) echo 'The program compiled OK, but produced no output.' >> try.msg ;;
5333 echo "The program compiled OK, but exited with status $?." >>try.msg
5334 rp="You have a problem. Shall I abort Configure"
5338 echo "I can't compile the test program." >>try.msg
5339 rp="You have a BIG problem. Shall I abort Configure"
5345 case "$knowitall" in
5347 echo "(The supplied flags or libraries might be incorrect.)"
5355 *) echo "Ok. Stopping Configure." >&4
5360 n) echo "OK, that should do.";;
5362 $rm_try gcctest gcctest.out
5364 : define a shorthand compile call
5368 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5369 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5373 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5374 : define a shorthand compile call for compilations that should be ok.
5378 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5380 : determine filename position in cpp output
5382 echo "Computing filename position in cpp output for #include directives..." >&4
5384 vos) testaccess=-e ;;
5387 echo '#include <stdio.h>' > foo.c
5390 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5391 $grep '^[ ]*#.*stdio\.h' | \
5392 while read cline; do
5395 while $test \$# -gt 0; do
5396 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5401 pos=\`expr \$pos + 1\`
5413 *) pos="${fieldn}th";;
5415 echo "Your cpp writes the filename in the $pos field of the line."
5418 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5419 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5422 : locate header file
5427 for usrincdir in $usrinc
5429 if test -f \$usrincdir/\$wanted; then
5430 echo "\$usrincdir/\$wanted"
5434 awkprg='{ print \$$fieldn }'
5435 echo "#include <\$wanted>" > foo\$\$.c
5436 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5437 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5438 while read cline; do
5439 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5441 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5442 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5447 # status = 0: grep returned 0 lines, case statement not executed
5448 # status = 1: headerfile found
5449 # status = 2: while loop executed, no headerfile found
5453 if test \$status -eq 1; then
5460 : define an alternate in-header-list? function
5461 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5462 cont=true; xxf="echo \"<\$1> found.\" >&4";
5463 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5464 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5466 case $# in 4) instead=instead;; *) instead="at last";; esac;
5467 while $test "$cont"; do
5469 var=$2; eval "was=\$$2";
5470 if $test "$xxx" && $test -r "$xxx";
5472 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5475 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5476 set $yyy; shift; shift; yyy=$@;
5477 case $# in 0) cont="";;
5478 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5479 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5480 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5481 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5485 do set $yyy; var=$2; eval "was=\$$2";
5486 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5487 set $yyy; shift; shift; yyy=$@;
5490 : see if stdlib is available
5491 set stdlib.h i_stdlib
5494 : check for lengths of integral types
5498 echo "Checking to see how big your integers are..." >&4
5507 printf("intsize=%d;\n", (int)sizeof(int));
5508 printf("longsize=%d;\n", (int)sizeof(long));
5509 printf("shortsize=%d;\n", (int)sizeof(short));
5514 if eval $compile_ok && $run ./try > /dev/null; then
5516 echo "Your integers are $intsize bytes long."
5517 echo "Your long integers are $longsize bytes long."
5518 echo "Your short integers are $shortsize bytes long."
5522 Help! I can't compile and run the intsize test program: please enlighten me!
5523 (This is probably a misconfiguration in your system or libraries, and
5524 you really ought to fix it. Still, I'll try anyway.)
5528 rp="What is the size of an integer (in bytes)?"
5532 rp="What is the size of a long integer (in bytes)?"
5536 rp="What is the size of a short integer (in bytes)?"
5544 : check for long long
5546 echo "Checking to see if you have long long..." >&4
5547 echo 'int main() { long long x = 7; return 0; }' > try.c
5549 if eval $compile; then
5551 echo "You have long long."
5554 echo "You do not have long long."
5560 : check for length of long long
5561 case "${d_longlong}${longlongsize}" in
5564 echo "Checking to see how big your long longs are..." >&4
5565 $cat >try.c <<'EOCP'
5569 printf("%d\n", (int)sizeof(long long));
5574 if eval $compile_ok; then
5575 longlongsize=`$run ./try`
5576 echo "Your long longs are $longlongsize bytes long."
5580 echo "(I can't seem to compile the test program. Guessing...)"
5581 rp="What is the size of a long long (in bytes)?"
5585 if $test "X$longsize" = "X$longlongsize"; then
5586 echo "(That isn't any different from an ordinary long.)"
5592 : see if inttypes.h is available
5593 : we want a real compile instead of Inhdr because some systems
5594 : have an inttypes.h which includes non-existent headers
5597 #include <inttypes.h>
5599 static int32_t foo32 = 0x12345678;
5603 if eval $compile; then
5604 echo "<inttypes.h> found." >&4
5607 echo "<inttypes.h> NOT found." >&4
5616 echo "Checking to see if you have int64_t..." >&4
5618 #include <sys/types.h>
5619 #$i_inttypes I_INTTYPES
5621 #include <inttypes.h>
5623 int main() { int64_t x = 7; }
5626 if eval $compile; then
5628 echo "You have int64_t."
5631 echo "You do not have int64_t."
5637 : Check if 64bit ints have a quad type
5639 echo "Checking which 64-bit integer type we could use..." >&4
5645 val='"unsigned int"'
5650 *) case "$longsize" in
5654 val='"unsigned long"'
5659 *) case "$d_longlong:$longlongsize" in
5664 val='"unsigned long long"'
5669 *) case "$d_int64_t" in
5688 '') echo "Alas, no 64-bit integer types in sight." >&4
5691 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5696 : Do we want 64bit support
5697 case "$uselonglong" in
5698 "$define"|true|[yY]*)
5701 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5703 use64bitint="$define"
5706 case "$use64bits" in
5707 "$define"|true|[yY]*)
5710 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5712 use64bitint="$define"
5715 case "$use64bitints" in
5716 "$define"|true|[yY]*)
5719 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5721 use64bitint="$define"
5724 case "$use64bitsint" in
5725 "$define"|true|[yY]*)
5728 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5730 use64bitint="$define"
5733 case "$uselonglongs" in
5734 "$define"|true|[yY]*)
5737 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5739 use64bitint="$define"
5742 case "$use64bitsall" in
5743 "$define"|true|[yY]*)
5746 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5748 use64bitall="$define"
5753 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5755 case "$use64bitall" in
5756 "$define"|true|[yY]*) use64bitint="$define" ;;
5762 You have natively 64-bit long integers.
5766 *) case "$use64bitint" in
5767 "$define"|true|[yY]*) dflt='y';;
5776 Perl can be built to take advantage of 64-bit integer types
5777 on some systems. To do so, Configure can be run with -Duse64bitint.
5778 Choosing this option will most probably introduce binary incompatibilities.
5780 If this doesn't make any sense to you, just accept the default '$dflt'.
5781 (The default has been chosen based on your configuration.)
5783 rp='Try to use 64-bit integers, if available?'
5786 [yY]*) val="$define" ;;
5794 case "$use64bitall" in
5795 "$define"|true|[yY]*) dflt='y' ;;
5796 *) case "$longsize" in
5804 You may also choose to try maximal 64-bitness. It means using as much
5805 64-bitness as possible on the platform. This in turn means even more
5806 binary incompatibilities. On the other hand, your platform may not
5807 have any more 64-bitness available than what you already have chosen.
5809 If this doesn't make any sense to you, just accept the default '$dflt'.
5810 (The default has been chosen based on your configuration.)
5812 rp='Try to use maximal 64-bit support, if available?'
5815 [yY]*) val="$define" ;;
5820 case "$use64bitall" in
5822 case "$use64bitint" in
5826 Since you have chosen a maximally 64-bit build, I'm also turning on
5827 the use of 64-bit integers.
5829 use64bitint="$define" ;;
5834 : Look for a hint-file generated 'call-back-unit'. If the
5835 : user has specified that a 64-bit perl is to be built,
5836 : we may need to set or change some other defaults.
5837 if $test -f use64bitint.cbu; then
5838 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5841 case "$use64bitint" in
5842 "$define"|true|[yY]*)
5843 : This test was common to all the OpenBSD forks, and seems harmless for
5846 echo "Checking if your C library has broken 64-bit functions..." >&4
5849 typedef $uquadtype myULL;
5856 {4294967303.15, 4294967303ULL},
5857 {4294967294.2, 4294967294ULL},
5858 {4294967295.7, 4294967295ULL},
5861 for (p = test; p->u; p++) {
5862 myULL x = (myULL)p->d;
5873 if eval $compile_ok; then
5875 echo "Your C library's 64-bit functions are $libcquad."
5877 echo "(I can't seem to compile the test program.)"
5878 echo "Assuming that your C library's 64-bit functions are ok."
5887 *** You have a C library with broken 64-bit functions.
5888 *** 64-bit support does not work reliably in this configuration.
5889 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5890 *** Cannot continue, aborting.
5897 4) case "$archname64" in
5898 '') archname64=64int ;;
5905 : Look for a hint-file generated 'call-back-unit'. If the
5906 : user has specified that a maximally 64-bit perl is to be built,
5907 : we may need to set or change some other defaults.
5908 if $test -f use64bitall.cbu; then
5909 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5912 case "$use64bitall" in
5913 "$define"|true|[yY]*)
5915 4) case "$archname64" in
5916 ''|64int) archname64=64all ;;
5923 case "$d_quad:$use64bitint" in
5927 *** You have chosen to use 64-bit integers,
5928 *** but none can be found.
5929 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5930 *** Cannot continue, aborting.
5937 : check for length of double
5939 case "$doublesize" in
5941 echo "Checking to see how big your double precision numbers are..." >&4
5950 printf("%d\n", (int)sizeof(double));
5955 if eval $compile_ok; then
5956 doublesize=`$run ./try`
5957 echo "Your double is $doublesize bytes long."
5960 echo "(I can't seem to compile the test program. Guessing...)"
5961 rp="What is the size of a double precision number (in bytes)?"
5969 : check for long doubles
5971 echo "Checking to see if you have long double..." >&4
5972 echo 'int main() { long double x = 7.0; }' > try.c
5974 if eval $compile; then
5976 echo "You have long double."
5979 echo "You do not have long double."
5985 : check for length of long double
5986 case "${d_longdbl}${longdblsize}" in
5989 echo "Checking to see how big your long doubles are..." >&4
5990 $cat >try.c <<'EOCP'
5994 printf("%d\n", sizeof(long double));
5999 if eval $compile; then
6000 longdblsize=`$run ./try`
6001 echo "Your long doubles are $longdblsize bytes long."
6005 echo "(I can't seem to compile the test program. Guessing...)" >&4
6006 rp="What is the size of a long double (in bytes)?"
6010 if $test "X$doublesize" = "X$longdblsize"; then
6011 echo "That isn't any different from an ordinary double."
6012 echo "I'll keep your setting anyway, but you may see some"
6013 echo "harmless compilation warnings."
6019 : determine the architecture name
6021 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6022 tarch=`arch`"-$osname"
6023 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6024 if uname -m > tmparch 2>&1 ; then
6025 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6026 -e 's/$/'"-$osname/" tmparch`
6034 case "$myarchname" in
6037 echo "(Your architecture name used to be $myarchname.)"
6041 case "$targetarch" in
6043 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6048 *) dflt="$archname";;
6050 rp='What is your architecture name'
6054 : optionally add API version to the architecture for versioned archlibs
6055 case "$useversionedarchname" in
6056 $define|true|[yY]*) dflt='y';;
6059 rp='Add the Perl API version to your archname?'
6062 y|Y) useversionedarchname="$define" ;;
6063 *) useversionedarchname="$undef" ;;
6065 case "$useversionedarchname" in
6068 *-$api_versionstring)
6069 echo "...and architecture name already has -$api_versionstring" >&4
6072 archname="$archname-$api_versionstring"
6073 echo "...setting architecture name to $archname." >&4
6079 case "$usethreads" in
6081 echo "Threads selected." >&4
6083 *-thread*) echo "...and architecture name already has -thread." >&4
6085 *) archname="$archname-thread"
6086 echo "...setting architecture name to $archname." >&4
6091 case "$usemultiplicity" in
6093 echo "Multiplicity selected." >&4
6095 *-multi*) echo "...and architecture name already has -multi." >&4
6097 *) archname="$archname-multi"
6098 echo "...setting architecture name to $archname." >&4
6103 case "$use64bitint$use64bitall" in
6105 case "$archname64" in
6107 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6110 case "$use64bitint" in
6111 "$define") echo "64 bit integers selected." >&4 ;;
6113 case "$use64bitall" in
6114 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6117 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6119 *) archname="$archname-$archname64"
6120 echo "...setting architecture name to $archname." >&4
6126 case "$uselongdouble" in
6128 echo "Long doubles selected." >&4
6129 case "$longdblsize" in
6131 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6135 *-ld*) echo "...and architecture name already has -ld." >&4
6137 *) archname="$archname-ld"
6138 echo "...setting architecture name to $archname." >&4
6145 if $test -f archname.cbu; then
6146 echo "Your platform has some specific hints for architecture name, using them..."
6150 : set the prefixit variable, to compute a suitable default value
6151 prefixit='case "$3" in
6153 case "$oldprefix" in
6154 "") eval "$1=\"\$$2\"";;
6161 ""|" ") eval "$1=\"\$$2\"";;
6167 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6169 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6170 /*-$oldprefix/*|\~*-$oldprefix/*)
6171 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6172 *) eval "$1=\"\$$2\"";;
6176 : determine installation style
6177 : For now, try to deduce it from prefix unless it is already set.
6178 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6179 case "$installstyle" in
6180 '') case "$prefix" in
6181 *perl*) dflt='lib';;
6182 *) dflt='lib/perl5' ;;
6185 *) dflt="$installstyle" ;;
6187 : Probably not worth prompting for this since we prompt for all
6188 : the directories individually, and the prompt would be too long and
6192 : determine where public executables go
6197 rp='Pathname where the public executables will reside?'
6199 if $test "X$ansexp" != "X$binexp"; then
6203 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6204 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6205 : this via initialinstalllocation
6208 case "$userelocatableinc" in
6209 $define|true|[yY]*) dflt='y' ;;
6214 Would you like to build Perl so that the installation is relocatable, so that
6215 library paths in @INC are determined relative to the path of the perl binary?
6216 This is not advised for system Perl installs, or if you need to run setid
6217 scripts or scripts under taint mode.
6219 If this doesn't make any sense to you, just accept the default '$dflt'.
6221 rp='Use relocatable @INC?'
6224 y|Y) val="$define" ;;
6227 set userelocatableinc
6230 initialinstalllocation="$binexp"
6231 : Default prefix is now "up one level from where the binaries are"
6232 case "$userelocatableinc" in
6238 installprefixexp=".../.."
6242 : determine where private library files go
6243 : Usual default is /usr/local/lib/perl5/$version.
6244 : Also allow things like /opt/perl/lib/$version, since
6245 : /opt/perl/lib/perl5... would be redundant.
6246 : The default "style" setting is made in installstyle.U
6247 case "$installstyle" in
6248 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6249 *) set dflt privlib lib/$version ;;
6254 There are some auxiliary files for $package that need to be put into a
6255 private library directory that is accessible by everyone.
6260 rp='Pathname where the private library files will reside?'
6265 : set the prefixup variable, to restore leading tilda escape
6266 prefixup='case "$prefixexp" in
6268 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6271 : determine where public architecture dependent libraries go
6274 : privlib default is /usr/local/lib/$package/$version
6275 : archlib default is /usr/local/lib/$package/$version/$archname
6276 : privlib may have an optional trailing /share.
6277 tdflt=`echo $privlib | $sed 's,/share$,,'`
6278 tdflt=$tdflt/$archname
6287 $spackage contains architecture-dependent library files. If you are
6288 sharing libraries in a heterogeneous environment, you might store
6289 these files in a separate location. Otherwise, you can just include
6290 them with the rest of the public library files.
6295 rp='Where do you want to put the public architecture-dependent libraries?'
6299 if $test X"$archlib" = X"$privlib"; then
6305 : see if setuid scripts can be secure
6308 Some kernels have a bug that prevents setuid #! scripts from being
6309 secure. Some sites have disabled setuid #! scripts because of this.
6311 First let's decide if your kernel supports secure setuid #! scripts.
6312 (If setuid #! scripts would be secure but have been disabled anyway,
6313 don't say that they are secure if asked.)
6318 if $test -d /dev/fd; then
6319 echo "#!$ls" >reflect
6320 chmod +x,u+s reflect
6321 ./reflect >flect 2>&1
6322 if $contains "/dev/fd" flect >/dev/null; then
6323 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6327 If you are not sure if they are secure, I can check but I'll need a
6328 username and password different from the one you are using right now.
6329 If you don't have such a username or don't want me to test, simply
6333 rp='Other username to test security of setuid scripts with?'
6338 case "$d_suidsafe" in
6339 '') echo "I'll assume setuid scripts are *not* secure." >&4
6342 echo "Well, the $hint value is *not* secure." >&4
6344 *) echo "Well, the $hint value *is* secure." >&4
6349 $rm -f reflect flect
6350 echo "#!$ls" >reflect
6351 chmod +x,u+s reflect
6354 echo '"su" will (probably) prompt you for '"$ans's password."
6355 su $ans -c './reflect >flect'
6356 if $contains "/dev/fd" flect >/dev/null; then
6357 echo "Okay, it looks like setuid scripts are secure." >&4
6360 echo "I don't think setuid scripts are secure." >&4
6365 rp='Does your kernel have *secure* setuid scripts?'
6368 [yY]*) val="$define";;
6373 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6374 echo "(That's for file descriptors, not floppy disks.)"
6380 $rm -f reflect flect
6382 : now see if they want to do setuid emulation
6383 if $test $patchlevel -lt 11; then
6386 case "$d_suidsafe" in
6389 echo "No need to emulate SUID scripts since they are secure here." >&4
6393 Some systems have disabled setuid scripts, especially systems where
6394 setuid scripts cannot be secure. On systems where setuid scripts have
6395 been disabled, the setuid/setgid bits on scripts are currently
6396 useless. It is possible for $package to detect those bits and emulate
6397 setuid/setgid in a secure fashion. This emulation will only work if
6398 setuid scripts have been disabled in your kernel.
6402 "$define") dflt=y ;;
6405 rp="Do you want to do setuid/setgid emulation?"
6408 [yY]*) val="$define";;
6420 SUID emulation has been removed for 5.12
6421 Please re-run Configure without -Dd_dosuid
6430 : Find perl5.005 or later.
6431 echo "Looking for a previously installed perl5.005 or later... "
6433 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6434 : Check if this perl is recent and can load a simple module
6435 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6438 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6448 '') echo "None found. That's ok.";;
6449 *) echo "Using $perl5." ;;
6452 : Set the siteprefix variables
6455 After $package is installed, you may wish to install various
6456 add-on modules and utilities. Typically, these add-ons will
6457 be installed under $prefix with the rest
6458 of this package. However, you may wish to install such add-ons
6459 elsewhere under a different prefix.
6461 If you do not wish to put everything under a single prefix, that's
6462 ok. You will be prompted for the individual locations; this siteprefix
6463 is only used to suggest the defaults.
6465 The default should be fine for most people.
6469 rp='Installation prefix to use for add-on modules and utilities?'
6470 : XXX Here might be another good place for an installstyle setting.
6471 case "$siteprefix" in
6473 *) dflt=$siteprefix ;;
6476 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6478 case "$siteprefix" in
6482 *) oldsiteprefix="$prefix";;
6487 siteprefixexp="$ansexp"
6489 : determine where site specific libraries go.
6490 : Usual default is /usr/local/lib/perl5/site_perl/$version
6491 : The default "style" setting is made in installstyle.U
6492 : XXX No longer works with Prefixit stuff.
6493 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6495 '') case "$installstyle" in
6496 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6497 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6505 The installation process will create a directory for
6506 site-specific extensions and modules. Most users find it convenient
6507 to place all site-specific files in this directory rather than in the
6508 main distribution directory.
6512 rp='Pathname for the site-specific library files?'
6516 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6518 : Determine list of previous versions to include in @INC
6519 $cat > getverlist <<EOPL
6522 \$api_versionstring = "$api_versionstring";
6523 \$version = "$version";
6524 \$stem = "$sitelib_stem";
6525 \$archname = "$archname";
6527 $cat >> getverlist <<'EOPL'
6528 # The list found is store twice for each entry: the original name, and
6529 # the binary broken down version as pack "sss", so sorting is easy and
6530 # unambiguous. This will work for all versions that have a maximum of
6531 # three digit groups, separate by '.'s or '_'s. Names are extended with
6532 # ".0.0" to ensure at least three elements for the pack.
6533 # -- H.Merijn Brand (m)'06 23-10-2006
6535 # Can't have leading @ because metaconfig interprets it as a command!
6536 ;@inc_version_list=();
6537 # XXX Redo to do opendir/readdir?
6540 ;@candidates = map {
6541 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6542 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
6548 ($pversion, $aversion, $vsn5005) = map {
6549 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6550 foreach $d (@candidates) {
6551 if ($d->[1] lt $pversion) {
6552 if ($d->[1] ge $aversion) {
6553 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6555 elsif ($d->[1] ge $vsn5005) {
6556 unshift(@inc_version_list, grep { -d } $d->[0]);
6560 # Skip newer version. I.e. don't look in
6561 # 5.7.0 if we're installing 5.6.1.
6565 if (@inc_version_list) {
6566 print join(' ', @inc_version_list);
6569 # Blank space to preserve value for next Configure run.
6574 case "$inc_version_list" in
6575 '') if test -x "$perl5$exe_ext"; then
6576 dflt=`$perl5 getverlist`
6581 $undef) dflt='none' ;;
6582 *) eval dflt=\"$inc_version_list\" ;;
6585 ''|' ') dflt=none ;;
6592 In order to ease the process of upgrading, this version of perl
6593 can be configured to use modules built and installed with earlier
6594 versions of perl that were installed under $prefix. Specify here
6595 the list of earlier versions that this version of perl should check.
6596 If Configure detected no earlier versions of perl installed under
6597 $prefix, then the list will be empty. Answer 'none' to tell perl
6598 to not search earlier versions.
6600 The default should almost always be sensible, so if you're not sure,
6601 just accept the default.
6604 rp='List of earlier versions to include in @INC?'
6607 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6608 *) inc_version_list="$ans" ;;
6610 case "$inc_version_list" in
6612 inc_version_list_init='0'
6613 d_inc_version_list="$undef"
6615 *) inc_version_list_init=`echo $inc_version_list |
6616 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6617 d_inc_version_list="$define"
6622 : see if malloc/malloc.h has to be included
6623 set malloc/malloc.h i_mallocmalloc
6626 : see if this is a malloc.h system
6627 : we want a real compile instead of Inhdr because some systems have a
6628 : malloc.h that just gives a compile error saying to use stdlib.h instead
6633 #$i_mallocmalloc I_MALLOCMALLOC
6634 #ifdef I_MALLOCMALLOC
6635 # include <malloc/malloc.h>
6638 int main () { return 0; }
6641 if eval $compile; then
6642 echo "<malloc.h> found." >&4
6645 echo "<malloc.h> NOT found." >&4
6652 : check for length of pointer
6656 echo "Checking to see how big your pointers are..." >&4
6665 printf("%d\n", (int)sizeof(void *));
6670 if eval $compile_ok; then
6671 ptrsize=`$run ./try`
6672 echo "Your pointers are $ptrsize bytes long."
6675 echo "(I can't seem to compile the test program. Guessing...)" >&4
6676 rp="What is the size of a pointer (in bytes)?"
6683 case "$use64bitall" in
6684 "$define"|true|[yY]*)
6688 *** You have chosen a maximally 64-bit build,
6689 *** but your pointers are only 4 bytes wide.
6690 *** Please rerun Configure without -Duse64bitall.
6695 *** Since you have quads, you could possibly try with -Duse64bitint.
6700 *** Cannot continue, aborting.
6711 : determine whether to use malloc wrapping
6713 case "$usemallocwrap" in
6714 [yY]*|true|$define) dflt='y' ;;
6715 [nN]*|false|$undef) dflt='n' ;;
6716 *) case "$usedevel" in
6717 [yY]*|true|$define) dflt='y' ;;
6722 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6724 usemallocwrap="$ans"
6727 usemallocwrap="$define" ;;
6729 usemallocwrap="$undef" ;;
6732 : determine which malloc to compile in
6734 case "$usemymalloc" in
6735 [yY]*|true|$define) dflt='y' ;;
6736 [nN]*|false|$undef) dflt='n' ;;
6737 *) case "$ptrsize" in
6741 if test "$useithreads" = "$define"; then dflt='n'; fi
6744 rp="Do you wish to attempt to use the malloc that comes with $package?"
6750 mallocsrc='malloc.c'
6751 mallocobj="malloc$_o"
6752 d_mymalloc="$define"
6755 : Remove malloc from list of libraries to use
6756 echo "Removing unneeded -lmalloc from library list" >&4
6757 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6760 echo "libs = $libs" >&4
6772 : compute the return types of malloc and free
6774 $cat >malloc.c <<END
6778 #include <sys/types.h>
6792 case "$malloctype" in
6794 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6801 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6805 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6812 echo "Your system uses $freetype free(), it would seem." >&4
6814 : determine where site specific architecture-dependent libraries go.
6815 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6816 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6817 : sitelib may have an optional trailing /share.
6819 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6820 dflt="$dflt/$archname"
6825 set sitearch sitearch none
6829 The installation process will also create a directory for
6830 architecture-dependent site-specific extensions and modules.
6834 rp='Pathname for the site-specific architecture-dependent library files?'
6838 if $test X"$sitearch" = X"$sitelib"; then
6841 d_sitearch="$define"
6844 : Set the vendorprefix variables
6847 The installation process will also create a directory for
6848 vendor-supplied add-ons. Vendors who supply perl with their system
6849 may find it convenient to place all vendor-supplied files in this
6850 directory rather than in the main distribution directory. This will
6851 ease upgrades between binary-compatible maintenance versions of perl.
6853 Of course you may also use these directories in whatever way you see
6854 fit. For example, you might use them to access modules shared over a
6855 company-wide network.
6857 The default answer should be fine for most people.
6858 This causes further questions about vendor add-ons to be skipped
6859 and no vendor-specific directories will be configured for perl.
6862 rp='Do you want to configure vendor-specific add-on directories?'
6863 case "$usevendorprefix" in
6864 define|true|[yY]*) dflt=y ;;
6865 *) : User may have set vendorprefix directly on Configure command line.
6866 case "$vendorprefix" in
6875 rp='Installation prefix to use for vendor-supplied add-ons?'
6876 case "$vendorprefix" in
6877 '') dflt="$prefix" ;;
6878 *) dflt=$vendorprefix ;;
6881 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6883 case "$vendorprefix" in
6887 *) oldvendorprefix="$prefix";;
6891 usevendorprefix="$define"
6893 vendorprefixexp="$ansexp"
6895 *) usevendorprefix="$undef"
6901 : Set the vendorlib variables
6902 case "$vendorprefix" in
6903 '') d_vendorlib="$undef"
6907 *) d_vendorlib="$define"
6908 : determine where vendor-supplied modules go.
6909 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6910 case "$vendorlib" in
6912 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6913 case "$installstyle" in
6914 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6915 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6918 *) dflt="$vendorlib"
6922 rp='Pathname for the vendor-supplied library files?'
6925 vendorlibexp="$ansexp"
6928 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6932 : Set the vendorarch variables
6933 case "$vendorprefix" in
6934 '') d_vendorarch="$undef"
6938 *) d_vendorarch="$define"
6939 : determine where vendor-supplied architecture-dependent libraries go.
6940 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6941 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6942 : vendorlib may have an optional trailing /share.
6943 case "$vendorarch" in
6944 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6945 dflt="$dflt/$archname"
6947 *) dflt="$vendorarch" ;;
6950 rp='Pathname for vendor-supplied architecture-dependent files?'
6953 vendorarchexp="$ansexp"
6956 prefixvar=vendorarch
6958 if $test X"$vendorarch" = X"$vendorlib"; then
6959 d_vendorarch="$undef"
6961 d_vendorarch="$define"
6964 : Final catch-all directories to search
6967 Lastly, you can have perl look in other directories for extensions and
6968 modules in addition to those already specified.
6969 These directories will be searched after
6973 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6974 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6976 case "$otherlibdirs" in
6977 ''|' ') dflt='none' ;;
6978 *) dflt="$otherlibdirs" ;;
6981 Enter a colon-separated set of extra paths to include in perl's @INC
6982 search path, or enter 'none' for no extra paths.
6986 rp='Colon-separated list of additional directories for perl to search?'
6989 ' '|''|none) otherlibdirs=' ' ;;
6990 *) otherlibdirs="$ans" ;;
6992 case "$otherlibdirs" in
6996 set d_perl_otherlibdirs
6999 : Cruising for prototypes
7001 echo "Checking out function prototypes..." >&4
7002 $cat >prototype.c <<EOCP
7007 int main(int argc, char *argv[]) {
7010 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7011 echo "Your C compiler appears to support function prototypes."
7014 echo "Your C compiler doesn't seem to understand function prototypes."
7021 : Check if ansi2knr is required
7022 case "$prototype" in
7024 *) ansi2knr='ansi2knr'
7029 This version of $package can only be compiled by a compiler that
7030 understands function prototypes. Unfortunately, your C compiler
7032 doesn't seem to understand them. Sorry about that.
7034 If GNU cc is available for your system, perhaps you could try that instead.
7036 Eventually, we hope to support building Perl with pre-ANSI compilers.
7037 If you would like to help in that effort, please contact <perlbug@perl.org>.
7039 Aborting Configure now.
7046 dflt_dtrace='/usr/sbin/dtrace'
7047 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
7051 Perl can be built to support DTrace on platforms that support it.
7052 DTrace is a diagnosis and performance analysis tool from Sun.
7054 If this doesn't make any sense to you, just accept the default '$dflt'.
7058 case "$usedtrace" in
7064 dflt_dtrace=$usedtrace
7071 rp='Support DTrace if available?'
7074 y|Y) val="$define" ;;
7080 test "X$usedtrace" != "X$define" && break
7083 rp='Where is the dtrace executable?'
7092 if $dtrace -h -s ../perldtrace.d \
7093 -o perldtrace.tmp >/dev/null 2>&1 \
7094 && rm -f perldtrace.tmp
7097 echo "Good: your $dtrace knows about the -h flag."
7101 *** $me: Fatal Error: $dtrace doesn't support -h flag
7103 *** Your installed dtrace doesn't support the -h switch to compile a D
7104 *** program into a C header. Can't continue.
7116 *** $me: Fatal Error: $dtrace not found.
7123 echo "*** $dtrace was not found."
7129 : See if we want extra modules installed
7136 Perl can be built with extra modules or bundles of modules which
7137 will be fetched from the CPAN and installed alongside Perl.
7139 Notice that you will need access to the CPAN; either via the Internet,
7140 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7141 be asked later to configure the CPAN.pm module which will in turn do
7142 the installation of the rest of the extra modules or bundles.)
7144 Notice also that if the modules require any external software such as
7145 libraries and headers (the libz library and the zlib.h header for the
7146 Compress::Zlib module, for example) you MUST have any such software
7147 already installed, this configuration process will NOT install such
7150 If this doesn't make any sense to you, just accept the default '$dflt'.
7152 rp='Install any extra modules (y or n)?'
7158 Please list any extra modules or bundles to be installed from CPAN,
7159 with spaces between the names. The names can be in any format the
7160 'install' command of CPAN.pm will understand. (Answer 'none',
7161 without the quotes, to install no extra modules or bundles.)
7171 $rm -f ../extras.lst
7173 *) echo "(Saving the list of extras for later...)"
7174 echo "$extras" > ../extras.lst
7182 : determine where html pages for programs go
7183 set html1dir html1dir none
7187 If you wish to install html files for programs in $spackage, indicate
7188 the appropriate directory here. To skip installing html files,
7192 ''|none|$undef|' ') dflt=none ;;
7193 *) dflt=$html1dir ;;
7196 rp="Directory for the main $spackage html pages?"
7200 : Use ' ' for none so value is preserved next time through Configure
7201 $test X"$html1dir" = "X" && html1dir=' '
7203 : determine where html pages for libraries and modules go
7204 set html3dir html3dir none
7208 If you wish to install html files for modules associated with $spackage,
7209 indicate the appropriate directory here. To skip installing html files,
7212 : There is no obvious default. If they have specified html1dir, then
7213 : try to key off that, possibly changing .../html1 into .../html3.
7215 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7216 *) dflt=$html3dir ;;
7219 rp="Directory for the $spackage module html pages?"
7223 : Use ' ' for none so value is preserved next time through Configure
7224 $test X"$html3dir" = "X" && html3dir=' '
7226 : determine whether to install perl also as /usr/bin/perl
7229 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7231 Many scripts expect perl to be installed as /usr/bin/perl.
7233 If you want to, I can install the perl you are about to compile
7234 as /usr/bin/perl (in addition to $bin/perl).
7236 if test -f /usr/bin/perl; then
7239 However, please note that because you already have a /usr/bin/perl,
7240 overwriting that with a new Perl would very probably cause problems.
7241 Therefore I'm assuming you don't want to do that (unless you insist).
7244 case "$installusrbinperl" in
7245 "$define"|[yY]*) dflt='y';;
7251 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7254 case "$installusrbinperl" in
7255 "$undef"|[nN]*) dflt='n';;
7259 rp="Do you want to install perl as /usr/bin/perl?"
7262 [yY]*) val="$define";;
7268 set installusrbinperl
7271 : Check if we are using the GNU C library
7273 echo "Checking for GNU C Library..." >&4
7275 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7276 alone are insufficient to distinguish different versions, such as
7277 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7278 libc version 2.1.0. A. Dougherty, June 3, 2002.
7284 # ifdef __GLIBC_MINOR__
7285 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7286 # include <gnu/libc-version.h>
7287 printf("%s\n", gnu_get_libc_version());
7289 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7292 printf("%d\n", __GLIBC__);
7301 if eval $compile_ok && $run ./try > glibc.ver; then
7303 gnulibc_version=`$cat glibc.ver`
7304 echo "You are using the GNU C Library version $gnulibc_version"
7308 echo "You are not using the GNU C Library"
7314 : see if nm is to be used to determine whether a symbol is defined or not
7318 case "$d_gnulibc" in
7321 echo "nm probably won't work on the GNU C Library." >&4
7327 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7329 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7330 echo "'nm' won't be sufficient on this system." >&4
7336 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7337 if $test $dflt -gt 20; then
7347 true|$define) dflt=y;;
7354 I can use $nm to extract the symbols from your C libraries. This
7355 is a time consuming task which may generate huge output on the disk (up
7356 to 3 megabytes) but that should make the symbols extraction faster. The
7357 alternative is to skip the 'nm' extraction part and to compile a small
7358 test program instead to determine whether each symbol is present. If
7359 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7360 this may be the best solution.
7362 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7365 rp="Shall I use $nm to extract C symbols from the libraries?"
7368 [Nn]*) usenm=false;;
7377 : nm options which may be necessary
7379 '') if $test -f /mach_boot; then
7381 elif $test -d /usr/ccs/lib; then
7382 nm_opt='-p' # Solaris (and SunOS?)
7383 elif $test -f /dgux; then
7385 elif $test -f /lib64/rld; then
7386 nm_opt='-p' # 64-bit Irix
7392 : nm options which may be necessary for shared libraries but illegal
7393 : for archive libraries. Thank you, Linux.
7394 case "$nm_so_opt" in
7395 '') case "$myuname" in
7397 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7398 nm_so_opt='--dynamic'
7405 : Figure out where the libc is located
7408 : get list of predefined functions in a handy place
7413 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7419 *) for thislib in $libs; do
7422 : Handle C library specially below.
7425 thislib=`echo $thislib | $sed -e 's/^-l//'`
7426 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7428 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7430 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7432 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7434 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7436 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7438 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7443 libnames="$libnames $try"
7445 *) libnames="$libnames $thislib" ;;
7454 for xxx in $libpth; do
7455 $test -r $1 || set $xxx/libc.$so
7456 : The messy sed command sorts on library version numbers.
7458 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7459 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7461 s/[0-9][0-9]*/0000&/g
7462 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7465 $sort | $sed -e 's/^.* //'`
7468 $test -r $1 || set /usr/ccs/lib/libc.$so
7469 $test -r $1 || set /lib/libsys_s$_a
7475 if $test -r "$1"; then
7476 echo "Your (shared) C library seems to be in $1."
7478 elif $test -r /lib/libc && $test -r /lib/clib; then
7479 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7481 libc='/lib/clib /lib/libc'
7482 if $test -r /lib/syslib; then
7483 echo "(Your math library is in /lib/syslib.)"
7484 libc="$libc /lib/syslib"
7486 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7487 echo "Your C library seems to be in $libc, as you said before."
7488 elif $test -r $incpath/usr/lib/libc$_a; then
7489 libc=$incpath/usr/lib/libc$_a;
7490 echo "Your C library seems to be in $libc. That's fine."
7491 elif $test -r /lib/libc$_a; then
7493 echo "Your C library seems to be in $libc. You're normal."
7495 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7497 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7498 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7499 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7501 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7503 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7506 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7508 if $test -r "$tans"; then
7509 echo "Your C library seems to be in $tans, of all places."
7515 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7519 If the guess above is wrong (which it might be if you're using a strange
7520 compiler, or your machine supports multiple models), you can override it here.
7525 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7527 I can't seem to find your C library. I've looked in the following places:
7530 $sed 's/^/ /' libpath
7533 None of these seems to contain your C library. I need to get its name...
7538 rp='Where is your C library?'
7543 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7544 set X `cat libnames`
7547 case $# in 1) xxx=file; esac
7548 echo "Extracting names from the following $xxx for later perusal:" >&4
7550 $sed 's/^/ /' libnames >&4
7552 $echo $n "This may take a while...$c" >&4
7556 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7557 *) $nm $nm_opt $file 2>/dev/null;;
7562 $grep fprintf libc.tmp > libc.ptf
7563 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7564 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7566 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7568 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7570 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7572 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7574 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7576 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7578 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7580 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7582 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7584 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7586 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7588 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7590 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7591 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7593 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7595 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7597 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7599 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7601 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7603 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7605 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7607 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7609 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7611 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7613 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7615 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7617 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7619 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7621 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7624 $nm -p $* 2>/dev/null >libc.tmp
7625 $grep fprintf libc.tmp > libc.ptf
7626 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7627 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7633 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7635 if $ar t $libc > libc.tmp && \
7636 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7638 for thisname in $libnames $libc; do
7639 $ar t $thisname >>libc.tmp
7641 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7643 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7644 for thisname in $libnames $libc; do
7645 $ar tv $thisname >>libc.tmp
7646 emximp -o tmp.imp $thisname \
7648 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7649 < tmp.imp >>libc.tmp
7652 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7655 echo "$ar didn't seem to work right." >&4
7656 echo "Maybe this is a Cray...trying bld instead..." >&4
7658 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7661 for thisname in $libnames; do
7663 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7664 $ar t $thisname >>libc.tmp
7668 echo "That didn't work either. Giving up." >&4
7678 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7679 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7681 *) if $test -f /lib/syscalls.exp; then
7683 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7684 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7685 /lib/syscalls.exp >>libc.list
7691 $rm -f libnames libpath
7693 : Check if we are using C++
7695 echo "Checking for C++..." >&4
7696 $cat >try.c <<'EOCP'
7708 if eval $compile_ok && $run ./try; then
7710 echo "You are using a C++ compiler."
7713 echo "You are not using a C++ compiler."
7719 : is a C symbol defined?
7722 -v) tf=libc.tmp; tdc="";;
7723 -a) tf=libc.tmp; tdc="[]";;
7724 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7726 case "$d_cplusplus" in
7727 $define) extern_C="extern \"C\"" ;;
7728 *) extern_C="extern" ;;
7731 case "$reuseval-$4" in
7733 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7738 if $test "$runnm" = true; then
7739 if $contains $tlook $tf >/dev/null 2>&1; then
7741 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7742 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7743 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7744 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7748 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7749 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7755 $define) tval=true;;
7762 : define an is-in-libc? function
7763 inlibc='echo " "; td=$define; tu=$undef;
7764 sym=$1; var=$2; eval "was=\$$2";
7766 case "$reuseval$was" in
7776 echo "$sym() found." >&4;
7777 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7779 echo "$sym() NOT found." >&4;
7780 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7784 $define) echo "$sym() found." >&4;;
7785 *) echo "$sym() NOT found." >&4;;
7789 : see if dlopen exists
7791 xxx_ccflags="$ccflags"
7793 : with g++ one needs -shared to get is-in-libc to work for dlopen
7794 case "$gccversion" in
7796 *) case "$d_cplusplus" in
7797 "$define") ccflags="$ccflags -shared" ;;
7804 ccflags="$xxx_ccflags"
7806 : see if this is a unistd.h system
7807 set unistd.h i_unistd
7810 : determine which dynamic loading, if any, to compile in
7812 dldir="ext/DynaLoader"
7825 $define) dflt='y' ;;
7827 : Does a dl_xxx.xs file exist for this operating system
7828 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7831 rp="Do you wish to use dynamic loading?"
7839 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7840 dflt="$dldir/dl_${osname}.xs"
7841 elif $test "$d_dlopen" = "$define" ; then
7842 dflt="$dldir/dl_dlopen.xs"
7847 *) dflt="$dldir/$dlsrc"
7850 echo "The following dynamic loading files are available:"
7851 : Can not go over to $dldir because getfile has path hard-coded in.
7852 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7853 rp="Source file to use for dynamic loading"
7859 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7863 Some systems may require passing special flags to $cc -c to
7864 compile modules that will be used to create a shared library.
7865 To use no flags, say "none".
7868 case "$cccdlflags" in
7869 '') case "$gccversion" in
7870 '') case "$osname" in
7872 next) dflt='none' ;;
7873 irix*) dflt='-KPIC' ;;
7874 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7875 sunos) dflt='-pic' ;;
7879 *) case "$osname" in
7880 darwin) dflt='none' ;;
7881 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7886 *) dflt="$cccdlflags" ;;
7888 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7891 none) cccdlflags=' ' ;;
7892 *) cccdlflags="$ans" ;;
7897 Some systems use ld to create libraries that can be dynamically loaded,
7898 while other systems (such as those using ELF) use $cc.
7902 : Determine if this is ELF
7904 /* Test for whether ELF binaries are produced */
7916 int i = open("a.out",O_RDONLY);
7919 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7920 exit(0); /* succeed (yes, it is ELF) */
7925 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7931 '') if $test $bin_ELF = "$define"; then
7933 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7937 echo "I'll use ld to build dynamic libraries."
7945 rp="What command should be used to create dynamic libraries?"
7951 Some systems may require passing special flags to $ld to create a
7952 library that can be dynamically loaded. If your ld flags include
7953 -L/other/path options to locate libraries outside your loader's normal
7954 search path, you may need to specify those -L options here as well. To
7955 use no flags, say "none".
7958 case "$lddlflags" in
7959 '') case "$osname" in
7960 haiku) dflt='-shared' ;;
7962 case "$gccversion" in
7963 '') dflt="$dflt +vnocompatwarnings" ;;
7966 linux|irix*|gnu*) dflt="-shared $optimize" ;;
7967 next) dflt='none' ;;
7968 solaris) # See [perl #66604].
7969 # On Solaris 11, gcc -m64 on amd64
7970 # appears not to understand -G. gcc versions at
7971 # least as old as 3.4.3 support -shared, so just
7972 # use that with Solaris 11 and later, but keep
7973 # the old behavior for older Solaris versions.
7974 case "$gccversion" in
7976 *) case "$osvers" in
7977 2.?|2.10) dflt='-G' ;;
7978 *) dflt='-shared' ;;
7983 sunos) dflt='-assert nodefinitions' ;;
7984 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7988 *) dflt="$lddlflags" ;;
7991 : Try to guess additional flags to pick up local libraries.
7992 : Be careful not to append to a plain 'none'
7996 for thisflag in $ldflags; do
8001 *) dflt="$dflt $thisflag" ;;
8008 ''|' ') dflt='none' ;;
8012 *-fstack-protector*)
8014 *-fstack-protector*) ;; # Don't add it again
8015 *) dflt="$dflt -fstack-protector" ;;
8021 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8024 none) lddlflags=' ' ;;
8025 *) lddlflags="$ans" ;;
8030 Some systems may require passing special flags to $cc to indicate that
8031 the resulting executable will use dynamic linking. To use no flags,
8035 case "$ccdlflags" in
8036 '') case "$osname" in
8037 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8038 next|sunos) dflt='none' ;;
8042 *) dflt="$ccdlflags" ;;
8044 rp="Any special flags to pass to $cc to use dynamic linking?"
8047 none) ccdlflags=' ' ;;
8048 *) ccdlflags="$ans" ;;
8059 ld_can_script="$undef"
8060 case "$bin_ELF$usedl" in
8062 # Abuse try.h and a.out names for neat cleanup
8074 if $cc $cccdlflags $ccdlflags $ccflags \
8075 $ldflags $lddlflags -o a.out try.c \
8076 -Wl,--version-script=try.h >/dev/null 2>&1 \
8077 && $test -s a.out ; then
8078 echo "ld supports scripting" >&4
8079 ld_can_script="$define"
8081 echo "ld does not support scripting" >&4
8087 : Do we want a shared libperl?
8091 # No dynamic loading being used, so don't bother even to prompt.
8094 *) case "$useshrplib" in
8095 '') case "$osname" in
8096 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8098 also='Building a shared libperl is required for dynamic loading to work on your system.'
8103 also='Building a shared libperl is needed for MAB support.'
8121 The perl executable is normally obtained by linking perlmain.c with
8122 libperl${_a}, any static extensions (usually just DynaLoader), and
8123 any other libraries needed on this system (such as -lm, etc.). Since
8124 your system supports dynamic loading, it is probably possible to build
8125 a shared libperl.$so. If you will have more than one executable linked
8126 to libperl.$so, this will significantly reduce the size of each
8127 executable, but it may have a noticeable effect on performance. The
8128 default is probably sensible for your system.
8132 rp="Build a shared libperl.$so (y/n)"
8136 useshrplib='true' ;;
8137 *) useshrplib='false' ;;
8142 case "$useshrplib" in
8144 case "$userelocatableinc" in
8146 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8147 echo "See INSTALL for an explanation why that won't work." >&4
8153 # Figure out a good name for libperl.so. Since it gets stored in
8154 # a version-specific architecture-dependent library, the version
8155 # number isn't really that important, except for making cc/ld happy.
8157 # A name such as libperl.so.10.1
8158 majmin="libperl.$so.$patchlevel.$subversion"
8159 # A name such as libperl.so.100
8160 majonly=`echo $patchlevel $subversion |
8161 $awk '{printf "%d%02d", $1, $2}'`
8162 majonly=libperl.$so.$majonly
8163 # I'd prefer to keep the os-specific stuff here to a minimum, and
8164 # rely on figuring it out from the naming of libc.
8165 case "${osname}${osvers}" in
8168 # XXX How handle the --version stuff for MAB?
8170 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8173 cygwin*) # ld links now against the dll directly
8174 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8175 majonly=`echo $patchlevel $subversion |
8176 $awk '{printf "%03d%03d", $1, $2}'`
8177 majonly=cygperl5.$majonly.$so
8180 *) # Try to guess based on whether libc has major.minor.
8182 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8183 *libc.$so.[0-9]*) dflt=$majonly ;;
8184 *) dflt=libperl.$so ;;
8194 I need to select a good name for the shared libperl. If your system uses
8195 library names with major and minor numbers, then you might want something
8196 like $majmin. Alternatively, if your system uses a single version
8197 number for shared libraries, then you might want to use $majonly.
8198 Or, your system might be quite happy with a simple libperl.$so.
8200 Since the shared libperl will get installed into a version-specific
8201 architecture-dependent directory, the version number of the shared perl
8202 library probably isn't important, so the default should be o.k.
8205 rp='What name do you want to give to the shared libperl?'
8208 echo "Ok, I'll use $libperl"
8211 libperl="libperl${_a}"
8215 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8219 WARNING: Use of the shrpdir variable for the installation location of
8220 the shared $libperl is not supported. It was never documented and
8221 will not work in this version. Let me (perlbug@perl.org)
8222 know of any problems this may cause.
8228 But your current setting of $shrpdir is
8229 the default anyway, so it's harmless.
8234 Further, your current attempted setting of $shrpdir
8235 conflicts with the value of $archlibexp/CORE
8236 that installperl will use.
8243 # How will the perl executable find the installed shared $libperl?
8244 # Add $xxx to ccdlflags.
8245 # If we can't figure out a command-line option, use $shrpenv to
8246 # set env LD_RUN_PATH. The main perl makefile uses this.
8247 shrpdir=$archlibexp/CORE
8250 if "$useshrplib"; then
8253 # We'll set it in Makefile.SH...
8258 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8259 xxx="-Wl,-R$shrpdir"
8261 bsdos|linux|irix*|dec_osf|gnu*)
8262 xxx="-Wl,-rpath,$shrpdir"
8265 # next doesn't like the default...
8268 # Haiku doesn't like the default, either.
8271 # hpux doesn't like the default, either.
8272 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8275 # cygwin needs only ldlibpth
8278 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8284 # Only add $xxx if it isn't already in ccdlflags.
8285 case " $ccdlflags " in
8287 *) ccdlflags="$ccdlflags $xxx"
8290 Adding $xxx to the flags
8291 passed to $ld so that the perl executable will find the
8292 installed shared $libperl.
8300 # Fix ccdlflags in AIX for building external extensions.
8301 # (For building Perl itself bare -bE:perl.exp is needed,
8302 # Makefile.SH takes care of this.)
8304 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8306 # Respect a hint or command-line value.
8308 '') shrpenv="$tmp_shrpenv" ;;
8310 case "$ldlibpthname" in
8311 '') ldlibpthname=LD_LIBRARY_PATH ;;
8312 none) ldlibpthname='' ;;
8315 : determine where manual pages are on this system
8319 syspath='/usr/share/man/man1 /usr/man/man1'
8320 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8321 syspath="$syspath /usr/man/u_man/man1"
8322 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8323 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8324 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8325 sysman=`./loc . /usr/man/man1 $syspath`
8328 if $test -d "$sysman"; then
8329 echo "System manual is in $sysman." >&4
8331 echo "Could not find manual pages in source form." >&4
8334 : determine where manual pages go
8335 set man1dir man1dir none
8339 $spackage has manual pages available in source form.
8343 echo "However, you don't have nroff, so they're probably useless to you."
8345 '') man1dir="none";;
8348 echo "If you don't want the manual sources installed, answer 'none'."
8353 lookpath="$prefixexp/share/man/man1"
8354 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8355 lookpath="$lookpath $prefixexp/man/p_man/man1"
8356 lookpath="$lookpath $prefixexp/man/u_man/man1"
8357 lookpath="$lookpath $prefixexp/man/man.1"
8359 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8360 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8370 rp="Where do the main $spackage manual pages (source) go?"
8372 if $test "X$man1direxp" != "X$ansexp"; then
8383 : What suffix to use on installed man pages
8390 rp="What suffix should be used for the main $spackage man pages?"
8392 '') case "$man1dir" in
8406 *) dflt="$man1ext";;
8413 : see if we can have long filenames
8415 first=123456789abcdef
8417 if (echo hi >$first) 2>/dev/null; then
8418 if $test -f 123456789abcde; then
8419 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8422 echo 'You can have filenames longer than 14 characters.'>&4
8427 You can't have filenames longer than 14 chars.
8428 You can't even think about them!
8434 $rm -rf 123456789abcde*
8436 : determine where library module manual pages go
8437 set man3dir man3dir none
8441 $spackage has manual pages for many of the library modules.
8447 However, you don't have nroff, so they're probably useless to you.
8450 '') man3dir="none";;
8454 case "$d_flexfnam" in
8457 However, your system can't handle the long file names like File::Basename.3.
8460 '') man3dir="none";;
8464 echo "If you don't want the manual sources installed, answer 'none'."
8465 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8467 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8468 if $test -d "$privlib/man/man3"; then
8471 WARNING: Previous versions of perl installed man3 pages into
8472 $privlib/man/man3. This version will suggest a
8473 new default of $dflt.
8477 rp='Do you wish to preserve the old behavior?(y/n)'
8480 y*) dflt="$privlib/man/man3" ;;
8485 *) dflt="$man3dir" ;;
8492 rp="Where do the $package library man pages (source) go?"
8502 : What suffix to use on installed man pages
8508 rp="What suffix should be used for the $package library man pages?"
8510 '') case "$man3dir" in
8524 *) dflt="$man3ext";;
8531 : see if we have to deal with yellow pages, now NIS.
8532 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8533 if $test -f /usr/etc/nibindd; then
8535 echo "I'm fairly confident you're on a NeXT."
8537 rp='Do you get the hosts file via NetInfo?'
8546 y*) hostcat='nidump hosts .';;
8547 *) case "$hostcat" in
8548 nidump*) hostcat='';;
8558 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8566 rp='Are you getting the hosts file via yellow pages?'
8569 y*) hostcat='ypcat hosts';;
8570 *) hostcat='cat /etc/hosts';;
8576 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8579 '') test -f /etc/group && groupcat='cat /etc/group';;
8582 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8585 : now get the host name
8587 echo "Figuring out host name..." >&4
8588 case "$myhostname" in
8590 echo 'Maybe "hostname" will work...'
8591 if tans=`sh -c hostname 2>&1` ; then
8599 if $test "$cont"; then
8601 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8602 if tans=`cat /etc/systemid 2>&1` ; then
8604 phostname='cat /etc/systemid'
8605 echo "Whadyaknow. Xenix always was a bit strange..."
8608 elif $test -r /etc/systemid; then
8609 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8612 if $test "$cont"; then
8613 echo 'No, maybe "uuname -l" will work...'
8614 if tans=`sh -c 'uuname -l' 2>&1` ; then
8616 phostname='uuname -l'
8618 echo 'Strange. Maybe "uname -n" will work...'
8619 if tans=`sh -c 'uname -n' 2>&1` ; then
8621 phostname='uname -n'
8623 echo 'Oh well, maybe I can mine it out of whoami.h...'
8624 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8625 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8626 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8628 case "$myhostname" in
8629 '') echo "Does this machine have an identity crisis or something?"
8632 echo "Well, you said $myhostname before..."
8633 phostname='echo $myhostname';;
8639 case "$myhostname" in
8640 '') myhostname=noname ;;
8642 : you do not want to know about this
8647 if $test "$myhostname" ; then
8649 rp='Your host name appears to be "'$myhostname'".'" Right?"
8657 : bad guess or no guess
8658 while $test "X$myhostname" = X ; do
8660 rp="Please type the (one word) name of your host:"
8665 : translate upper to lower if necessary
8666 case "$myhostname" in
8668 echo "(Normalizing case in your host name)"
8669 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8673 case "$myhostname" in
8675 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8676 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8677 echo "(Trimming domain name from host name--host name is now $myhostname)"
8679 *) case "$mydomain" in
8682 test "X$hostcat" = "Xypcat hosts" &&
8683 ypmatch "$myhostname" hosts 2>/dev/null |\
8684 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8687 test "X$hostcat" != "X" &&
8688 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8689 /[ ]$myhostname[ . ]/p" > hosts
8692 if $test -f hosts; then
8693 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8694 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8695 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8696 hosts | $sort | $uniq | \
8697 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8698 case `$echo X$dflt` in
8699 X*\ *) echo "(Several hosts in the database matched hostname)"
8702 X.) echo "(You do not have fully-qualified names in the hosts database)"
8706 echo "(I cannot locate a hosts database anywhere)"
8711 tans=`./loc resolv.conf X /etc /usr/etc`
8712 if $test -f "$tans"; then
8713 echo "(Attempting domain name extraction from $tans)"
8714 dflt=.`$sed -n -e 's/ / /g' \
8715 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8718 .) dflt=.`$sed -n -e 's/ / /g' \
8719 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8727 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8728 dflt=.`sh -c domainname 2>/dev/null`
8731 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8735 case "$dflt$osname" in
8736 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8737 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8741 .) echo "(Lost all hope -- silly guess then)"
8747 *) dflt="$mydomain";;
8751 rp="What is your domain name?"
8761 : translate upper to lower if necessary
8764 echo "(Normalizing case in your domain name)"
8765 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8769 : a little sanity check here
8770 case "$phostname" in
8773 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8774 $myhostname$mydomain|$myhostname) ;;
8776 case "$phostname" in
8778 echo "(That doesn't agree with your whoami.h file, by the way.)"
8781 echo "(That doesn't agree with your $phostname command, by the way.)"
8789 : determine the e-mail address of the user who is running us
8792 I need to get your e-mail address in Internet format if possible, i.e.
8793 something like user@host.domain. Please answer accurately since I have
8794 no easy means to double check it. The default value provided below
8795 is most probably close to reality but may not be valid from outside
8796 your organization...
8800 while test "$cont"; do
8801 case "$MAILDOMAIN" in
8803 if $test -s /etc/mailname; then
8804 maildomain=`$cat /etc/mailname`
8806 maildomain="$myhostname$mydomain"
8809 *) maildomain="$MAILDOMAIN";;
8812 '') dflt="$cf_by@$maildomain";;
8813 *) dflt="$cf_email";;
8815 rp='What is your e-mail address?'
8821 rp='Address does not look like an Internet one. Use it anyway?'
8835 : Ask e-mail of administrator
8838 If you or somebody else will be maintaining perl at your site, please
8839 fill in the correct e-mail address here so that they may be contacted
8840 if necessary. Currently, the "perlbug" program included with perl
8841 will send mail to this address in addition to perlbug@perl.org. You may
8842 enter "none" for no administrator.
8845 case "$perladmin" in
8846 '') dflt="$cf_email";;
8847 *) dflt="$perladmin";;
8849 rp='Perl administrator e-mail address'
8853 : determine whether to only install version-specific parts.
8856 Do you want to install only the version-specific parts of the perl
8857 distribution? Usually you do *not* want to do this.
8859 case "$versiononly" in
8860 "$define"|[Yy]*|true) dflt='y' ;;
8863 rp="Do you want to install only the version-specific parts of perl?"
8866 [yY]*) val="$define";;
8872 case "$versiononly" in
8873 "$define") inc_version_list=''
8874 inc_version_list_init=0
8878 : figure out how to guarantee perl startup
8879 : XXX Note that this currently takes advantage of the bug that binexp ignores
8880 : the Configure -Dinstallprefix setting, which in turn means that under
8881 : relocatable @INC, initialinstalllocation is what binexp started as.
8882 case "$startperl" in
8884 case "$sharpbang" in
8888 I can use the #! construct to start perl on your system. This will
8889 make startup of perl scripts faster, but may cause problems if you
8890 want to share those scripts and perl is not in a standard place
8891 ($initialinstalllocation/perl) on all your platforms. The alternative
8892 is to force a shell by starting the script with a single ':' character.
8895 case "$versiononly" in
8896 "$define") dflt="$initialinstalllocation/perl$version";;
8897 *) dflt="$initialinstalllocation/perl";;
8899 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8902 none) startperl=": # use perl";;
8903 *) startperl="#!$ans"
8904 if $test 30 -lt `echo "$ans" | wc -c`; then
8907 WARNING: Some systems limit the #! command to 32 characters.
8908 If you experience difficulty running Perl scripts with #!, try
8909 installing Perl in a directory with a shorter pathname.
8915 *) startperl=": # use perl"
8920 echo "I'll use $startperl to start perl scripts."
8922 : figure best path for perl in scripts
8925 case "$versiononly" in
8926 "$define") perlpath="$initialinstalllocation/perl$version";;
8927 *) perlpath="$initialinstalllocation/perl";;
8929 case "$startperl" in
8934 I will use the "eval 'exec'" idiom to start Perl on your system.
8935 I can use the full path of your Perl binary for this purpose, but
8936 doing so may cause problems if you want to share those scripts and
8937 Perl is not always in a standard place ($initialinstalllocation/perl).
8940 dflt="$initialinstalllocation/perl"
8941 rp="What path shall I use in \"eval 'exec'\"?"
8948 case "$startperl" in
8950 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8953 : determine where public executable scripts go
8954 set scriptdir scriptdir
8956 case "$scriptdir" in
8959 : guess some guesses
8960 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8961 $test -d /usr/share/bin && dflt=/usr/share/bin
8962 $test -d /usr/local/script && dflt=/usr/local/script
8963 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8964 $test -d $prefixexp/script && dflt=$prefixexp/script
8968 *) dflt="$scriptdir"
8973 Some installations have a separate directory just for executable scripts so
8974 that they can mount it across multiple architectures but keep the scripts in
8975 one spot. You might, for example, have a subdirectory of /usr/share for this.
8976 Or you might just lump your scripts in with all your other executables.
8980 rp='Where do you keep publicly executable scripts?'
8982 if $test "X$ansexp" != "X$scriptdirexp"; then
8988 : A little fix up for an irregularly named variable.
8989 installscript="$installscriptdir"
8991 : determine where add-on public executables go
8993 '') dflt=$siteprefix/bin ;;
8997 rp='Pathname where the add-on public executables should be installed?'
9002 : determine where add-on html pages go
9003 : There is no standard location, so try to copy the previously-selected
9004 : directory structure for the core html pages.
9005 case "$sitehtml1dir" in
9006 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9007 *) dflt=$sitehtml1dir ;;
9010 ''|' ') dflt=none ;;
9013 rp='Pathname where the site-specific html pages should be installed?'
9015 prefixvar=sitehtml1dir
9018 : determine where add-on library html pages go
9019 : There is no standard location, so try to copy the previously-selected
9020 : directory structure for the core html pages.
9021 case "$sitehtml3dir" in
9022 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9023 *) dflt=$sitehtml3dir ;;
9026 ''|' ') dflt=none ;;
9029 rp='Pathname where the site-specific library html pages should be installed?'
9031 prefixvar=sitehtml3dir
9034 : determine where add-on manual pages go
9035 case "$siteman1dir" in
9036 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9037 *) dflt=$siteman1dir ;;
9040 ''|' ') dflt=none ;;
9043 rp='Pathname where the site-specific manual pages should be installed?'
9045 prefixvar=siteman1dir
9048 : determine where add-on library man pages go
9049 case "$siteman3dir" in
9050 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9051 *) dflt=$siteman3dir ;;
9054 ''|' ') dflt=none ;;
9057 rp='Pathname where the site-specific library manual pages should be installed?'
9059 prefixvar=siteman3dir
9062 : determine where add-on public executable scripts go
9063 case "$sitescript" in
9064 '') dflt=$siteprefix/script
9065 $test -d $dflt || dflt=$sitebin ;;
9066 *) dflt="$sitescript" ;;
9069 rp='Pathname where add-on public executable scripts should be installed?'
9071 prefixvar=sitescript
9074 : Check if faststdio is requested and available
9075 case "$usefaststdio" in
9076 $define|true|[yY]*|'')
9077 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9087 Perl can be built to use 'fast stdio', which means using the stdio
9088 library but also directly manipulating the stdio buffers to enable
9089 faster I/O. Using stdio is better for backward compatibility (especially
9090 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9091 interface has been preferred instead of stdio.
9093 If this doesn't make any sense to you, just accept the default '$dflt'.
9095 rp='Use the "fast stdio" if available?'
9098 y|Y) val="$define" ;;
9105 : define an is-a-typedef? function
9106 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9108 "") inclist="sys/types.h";;
9110 eval "varval=\$$var";
9114 for inc in $inclist; do
9115 echo "#include <$inc>" >>temp.c;
9117 echo "#ifdef $type" >> temp.c;
9118 echo "printf(\"We have $type\");" >> temp.c;
9119 echo "#endif" >> temp.c;
9120 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9121 if $contains $type temp.E >/dev/null 2>&1; then
9127 *) eval "$var=\$varval";;
9130 : define an is-a-typedef? function that prompts if the type is not available.
9131 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9133 "") inclist="sys/types.h";;
9135 eval "varval=\$$var";
9139 for inc in $inclist; do
9140 echo "#include <$inc>" >>temp.c;
9142 echo "#ifdef $type" >> temp.c;
9143 echo "printf(\"We have $type\");" >> temp.c;
9144 echo "#endif" >> temp.c;
9145 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9147 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9148 if $contains $type temp.E >/dev/null 2>&1; then
9149 echo "$type found." >&4;
9152 echo "$type NOT found." >&4;
9158 *) eval "$var=\$varval";;
9161 : see what type lseek is declared as in the kernel
9162 rp="What is the type used for lseek's offset on this system?"
9163 set off_t lseektype long stdio.h sys/types.h
9167 echo "Checking to see how big your file offsets are..." >&4
9169 #include <sys/types.h>
9173 printf("%d\n", (int)sizeof($lseektype));
9178 if eval $compile_ok; then
9179 lseeksize=`$run ./try`
9180 echo "Your file offsets are $lseeksize bytes long."
9184 echo "(I can't seem to compile the test program. Guessing...)"
9185 rp="What is the size of your file offsets (in bytes)?"
9191 : see what type file positions are declared as in the library
9192 rp="What is the type for file position used by fsetpos()?"
9193 set fpos_t fpostype long stdio.h sys/types.h
9196 : Check size for Fpos_t
9199 *_t) zzz="$fpostype" ;;
9202 echo "Checking the size of $zzz..." >&4
9204 #include <sys/types.h>
9211 printf("%d\n", (int)sizeof($fpostype));
9216 if eval $compile_ok; then
9220 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9223 echo "Your $zzz is $fpossize bytes long."
9229 echo "(I can't compile the test program. Guessing...)" >&4
9230 rp="What is the size of your file positions (in bytes)?"
9235 : Check for large file support
9236 # Backward compatibility (uselfs is deprecated).
9238 "$define"|true|[yY]*)
9241 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9243 uselargefiles="$define"
9247 case "$lseeksize:$fpossize" in
9250 You can have files larger than 2 gigabytes.
9253 *) case "$uselargefiles" in
9254 "$undef"|false|[nN]*) dflt='n' ;;
9259 Perl can be built to understand large files (files larger than 2 gigabytes)
9260 on some systems. To do so, Configure can be run with -Duselargefiles.
9262 If this doesn't make any sense to you, just accept the default '$dflt'.
9264 rp='Try to understand large files, if available?'
9267 y|Y) val="$define" ;;
9274 : Look for a hint-file generated 'call-back-unit'. If the
9275 : user has specified that a large files perl is to be built,
9276 : we may need to set or change some other defaults.
9277 if $test -f uselargefiles.cbu; then
9278 echo "Your platform has some specific hints regarding large file builds, using them..."
9279 . ./uselargefiles.cbu
9281 case "$uselargefiles" in
9283 if $test -f uselargefiles.cbu; then
9285 echo "Rechecking to see how big your file offsets are..." >&4
9287 #include <sys/types.h>
9291 printf("%d\n", (int)sizeof($lseektype));
9296 if eval $compile_ok; then
9297 lseeksize=`$run ./try`
9298 $echo "Your file offsets are now $lseeksize bytes long."
9302 echo "(I can't seem to compile the test program. Guessing...)"
9303 rp="What is the size of your file offsets (in bytes)?"
9308 *_t) zzz="$fpostype" ;;
9311 $echo $n "Rechecking the size of $zzz...$c" >&4
9313 #include <sys/types.h>
9320 printf("%d\n", (int)sizeof($fpostype));
9325 if eval $compile_ok; then
9330 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9333 echo " $fpossize bytes." >&4
9339 echo "(I can't compile the test program. Guessing...)" >&4
9340 rp="What is the size of your file positions (in bytes)?"
9349 : Check if we want perlio
9352 : Set the vendorbin variables
9353 case "$vendorprefix" in
9354 '') d_vendorbin="$undef"
9358 *) d_vendorbin="$define"
9359 : determine where vendor-supplied executables go.
9360 case "$vendorbin" in
9361 '') dflt=$vendorprefix/bin ;;
9362 *) dflt="$vendorbin" ;;
9365 rp='Pathname for the vendor-supplied executables directory?'
9368 vendorbinexp="$ansexp"
9374 : Set the vendorhtml1dir variables
9375 case "$vendorprefix" in
9376 '') vendorhtml1dir=''
9377 vendorhtml1direxp=''
9379 *) : determine where vendor-supplied html pages go.
9380 : There is no standard location, so try to copy the previously-selected
9381 : directory structure for the core html pages.
9382 : XXX Better default suggestions would be welcome.
9383 case "$vendorhtml1dir" in
9384 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9385 *) dflt=$vendorhtml1dir ;;
9388 ''|' ') dflt=none ;;
9391 rp='Pathname for the vendor-supplied html pages?'
9393 vendorhtml1dir="$ans"
9394 vendorhtml1direxp="$ansexp"
9397 : Use ' ' for none so value is preserved next time through Configure
9398 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9399 prefixvar=vendorhtml1dir
9402 : Set the vendorhtml3dir variables
9403 case "$vendorprefix" in
9404 '') vendorhtml3dir=''
9405 vendorhtml3direxp=''
9407 *) : determine where vendor-supplied module html pages go.
9408 : There is no standard location, so try to copy the previously-selected
9409 : directory structure for the core html pages.
9410 : XXX Better default suggestions would be welcome.
9411 case "$vendorhtml3dir" in
9412 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9413 *) dflt=$vendorhtml3dir ;;
9416 ''|' ') dflt=none ;;
9419 rp='Pathname for the vendor-supplied html pages?'
9421 vendorhtml3dir="$ans"
9422 vendorhtml3direxp="$ansexp"
9425 : Use ' ' for none so value is preserved next time through Configure
9426 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9427 prefixvar=vendorhtml3dir
9430 : Set the vendorman1dir variables
9431 case "$vendorprefix" in
9432 '') vendorman1dir=''
9435 *) : determine where vendor-supplied manual pages go.
9436 case "$vendorman1dir" in
9437 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9438 *) dflt=$vendorman1dir ;;
9441 ''|' ') dflt=none ;;
9444 rp='Pathname for the vendor-supplied manual section 1 pages?'
9446 vendorman1dir="$ans"
9447 vendorman1direxp="$ansexp"
9450 : Use ' ' for none so value is preserved next time through Configure
9451 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9452 prefixvar=vendorman1dir
9455 : Set the vendorman3dir variables
9456 case "$vendorprefix" in
9457 '') vendorman3dir=''
9460 *) : determine where vendor-supplied module manual pages go.
9461 case "$vendorman3dir" in
9462 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9463 *) dflt=$vendorman3dir ;;
9466 ''|' ') dflt=none ;;
9469 rp='Pathname for the vendor-supplied manual section 3 pages?'
9471 vendorman3dir="$ans"
9472 vendorman3direxp="$ansexp"
9475 : Use ' ' for none so value is preserved next time through Configure
9476 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9477 prefixvar=vendorman3dir
9480 : Set the vendorscript variables
9481 case "$vendorprefix" in
9482 '') d_vendorscript="$undef"
9486 *) d_vendorscript="$define"
9487 : determine where vendor-supplied scripts go.
9488 case "$vendorscript" in
9489 '') dflt=$vendorprefix/script
9490 $test -d $dflt || dflt=$vendorbin ;;
9491 *) dflt="$vendorscript" ;;
9495 The installation process will create a directory for
9496 vendor-supplied scripts.
9500 rp='Pathname for the vendor-supplied scripts directory?'
9503 vendorscriptexp="$ansexp"
9506 prefixvar=vendorscript
9509 : script used to emit important warnings
9512 if test \$# -gt 0; then
9517 echo "*** WARNING:" >&4
9518 sed -e 's/^/*** /' <msg >&4
9520 cat msg >>config.msg
9521 echo " " >>config.msg
9527 : see which of string.h or strings.h is needed
9529 strings=`./findhdr string.h`
9530 if $test "$strings" && $test -r "$strings"; then
9531 echo "Using <string.h> instead of <strings.h>." >&4
9535 strings=`./findhdr strings.h`
9536 if $test "$strings" && $test -r "$strings"; then
9537 echo "Using <strings.h> instead of <string.h>." >&4
9539 ./warn "No string header found -- You'll surely have problems."
9545 "$undef") strings=`./findhdr strings.h`;;
9546 *) strings=`./findhdr string.h`;;
9549 : see if qgcvt exists
9553 : Check print/scan long double stuff
9556 if $test X"$d_longdbl" = X"$define"; then
9558 echo "Checking how to print long doubles..." >&4
9560 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9561 $cat >try.c <<'EOCP'
9562 #include <sys/types.h>
9566 printf("%.3f\n", d);
9570 if eval $compile; then
9574 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9575 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9576 echo "We will use %f."
9582 if $test X"$sPRIfldbl" = X; then
9583 $cat >try.c <<'EOCP'
9584 #include <sys/types.h>
9587 long double d = 123.456;
9588 printf("%.3Lf\n", d);
9592 if eval $compile; then
9596 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9597 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9598 echo "We will use %Lf."
9604 if $test X"$sPRIfldbl" = X; then
9605 $cat >try.c <<'EOCP'
9606 #include <sys/types.h>
9609 long double d = 123.456;
9610 printf("%.3llf\n", d);
9614 if eval $compile; then
9618 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9619 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9620 echo "We will use %llf."
9626 if $test X"$sPRIfldbl" = X; then
9627 $cat >try.c <<'EOCP'
9628 #include <sys/types.h>
9631 long double d = 123.456;
9632 printf("%.3lf\n", d);
9636 if eval $compile; then
9640 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9641 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9642 echo "We will use %lf."
9648 if $test X"$sPRIfldbl" = X; then
9649 echo "Cannot figure out how to print long doubles." >&4
9651 sSCNfldbl=$sPRIfldbl # expect consistency
9658 case "$sPRIfldbl" in
9659 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9660 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9661 d_SCNfldbl="$undef";
9663 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9664 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9665 d_SCNfldbl="$define";
9669 : Check how to convert floats to strings.
9671 if test "X$d_Gconvert" = X; then
9674 echo "Checking for an efficient way to convert floats to strings."
9676 case "$uselongdouble" in
9677 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9679 case "$d_longdbl" in
9680 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9682 case "$d_PRIgldbl" in
9683 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9687 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9688 char *myname = "gconvert";
9691 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9692 char *myname = "gcvt";
9695 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9696 char *myname = "qgcvt";
9697 #define DOUBLETYPE long double
9700 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9702 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9704 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9707 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9709 char *myname = "sprintf";
9713 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9714 #define DOUBLETYPE long double
9716 #define DOUBLETYPE double
9728 # include <string.h>
9730 # include <strings.h>
9733 int checkit(char *expect, char *got)
9735 if (strcmp(expect, got)) {
9736 printf("%s oddity: Expected %s, got %s\n",
9737 myname, expect, got);
9747 /* This must be 1st test on (which?) platform */
9748 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9749 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9750 checkit("0.1", buf);
9752 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9753 checkit("0.01", buf);
9755 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9756 checkit("0.001", buf);
9758 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9759 checkit("0.0001", buf);
9761 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9762 if (strlen(buf) > 5)
9763 checkit("9e-005", buf); /* for Microsoft ?? */
9765 checkit("9e-05", buf);
9767 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9770 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9771 checkit("1.1", buf);
9773 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9774 checkit("1.01", buf);
9776 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9777 checkit("1.001", buf);
9779 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9780 checkit("1.0001", buf);
9782 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9783 checkit("1.00001", buf);
9785 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9786 checkit("1.000001", buf);
9788 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9791 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9794 /* Some Linux gcvt's give 1.e+5 here. */
9795 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9796 checkit("100000", buf);
9798 /* Some Linux gcvt's give -1.e+5 here. */
9799 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9800 checkit("-100000", buf);
9802 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9803 checkit("123.456", buf);
9805 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9806 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9807 /* 34 should be enough to scare even long double
9808 * places into using the e notation. */
9809 if (strlen(buf) > 5)
9810 checkit("1e+034", buf); /* for Microsoft */
9812 checkit("1e+34", buf);
9814 /* For Perl, if you add additional tests here, also add them to
9815 * t/base/num.t for benefit of platforms not using Configure or
9816 * overriding d_Gconvert */
9821 : first add preferred functions to our list
9823 for xxx_convert in $gconvert_preference; do
9824 case $xxx_convert in
9825 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9826 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9829 : then add any others
9830 for xxx_convert in gconvert gcvt sprintf; do
9833 *) xxx_list="$xxx_list $xxx_convert" ;;
9837 case "$d_longdbl$uselongdouble" in
9839 : again, add preferred functions to our list first
9841 for xxx_convert in $gconvert_ld_preference; do
9842 case $xxx_convert in
9843 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9844 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9847 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9848 for xxx_convert in qgcvt sprintf $xxx_list; do
9849 case "$xxx_ld_list" in
9850 $xxx_convert*|*" $xxx_convert"*) ;;
9851 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9854 : if sprintf cannot do long doubles, move it to the end
9855 if test "$d_PRIgldbl" != "$define"; then
9856 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9858 : if no qgcvt, remove it
9859 if test "$d_qgcvt" != "$define"; then
9860 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9863 xxx_list="$xxx_ld_list"
9867 for xxx_convert in $xxx_list; do
9868 echo "Trying $xxx_convert..."
9869 $rm -f try try$_o core
9870 set try -DTRY_$xxx_convert
9871 if eval $compile; then
9872 echo "$xxx_convert() found." >&4
9874 echo "I'll use $xxx_convert to convert floats into a string." >&4
9877 echo "...But $xxx_convert didn't work as I expected."
9881 echo "$xxx_convert NOT found." >&4
9885 if test X$xxx_convert = X; then
9886 echo "*** WHOA THERE!!! ***" >&4
9887 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9891 case "$xxx_convert" in
9892 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9893 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9894 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9895 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9896 "$define$define$define")
9897 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9898 "$define$define$undef")
9899 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9900 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9908 : see if _fwalk exists
9912 : Initialize h_fcntl
9915 : Initialize h_sysfile
9918 : access call always available on UNIX
9922 : locate the flags for 'access()'
9926 $cat >access.c <<EOCP
9927 #include <sys/types.h>
9932 #include <sys/file.h>
9945 : check sys/file.h first, no particular reason here
9946 if $test `./findhdr sys/file.h` && \
9947 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9949 echo "<sys/file.h> defines the *_OK access constants." >&4
9950 elif $test `./findhdr fcntl.h` && \
9951 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9953 echo "<fcntl.h> defines the *_OK access constants." >&4
9954 elif $test `./findhdr unistd.h` && \
9955 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9956 echo "<unistd.h> defines the *_OK access constants." >&4
9958 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9964 : see if accessx exists
9965 set accessx d_accessx
9968 : see if aintl exists
9972 : see if alarm exists
9976 : see if 64bit time functions exists
9978 set ctime64 d_ctime64
9981 set localtime64 d_localtime64
9984 set gmtime64 d_gmtime64
9987 set mktime64 d_mktime64
9990 set difftime64 d_difftime64
9993 set asctime64 d_asctime64
9996 : see if POSIX threads are available
9997 set pthread.h i_pthread
10000 : define a function to check prototypes
10001 $cat > protochk <<EOSH
10004 optimize="$optimize"
10006 prototype="$prototype"
10009 usethreads=$usethreads
10010 i_pthread=$i_pthread
10011 pthread_h_first=$pthread_h_first
10014 $cat >> protochk <<'EOSH'
10019 while test $# -ge 2; do
10021 $define) echo "#include <$2>" >> try.c ;;
10022 literal) echo "$2" >> try.c ;;
10024 # Extra magic for the benefit of systems that need pthread.h
10025 # to be included early to correctly detect threadsafe functions.
10026 # Such functions must guarantee themselves, though, that the usethreads
10027 # and i_pthread have been defined, before calling protochk.
10028 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10029 echo "#include <pthread.h>" >> try.c
10034 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10035 cat >> try.c <<'EOCP'
10036 #ifdef CAN_PROTOTYPE
10037 #define _(args) args
10042 echo "$foo" >> try.c
10043 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10044 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10050 $eunicefix protochk
10052 : Define hasproto macro for Configure internal use
10053 hasproto='varname=$1; func=$2; shift; shift;
10054 while $test $# -ge 2; do
10056 $define) echo "#include <$2>";;
10060 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10061 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10062 echo "$func() prototype found.";
10065 echo "$func() prototype NOT found.";
10072 : see if sys/types.h has to be included
10073 set sys/types.h i_systypes
10076 : see if sys/select.h has to be included
10077 set sys/select.h i_sysselct
10080 : Define hasfield macro for Configure internal use
10081 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10082 while $test $# -ge 2; do
10084 $define) echo "#include <$2>";;
10088 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10090 if eval $compile; then
10099 : see if we should include time.h, sys/time.h, or both
10101 if test "X$timeincl" = X; then
10102 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10103 $echo $n "I'm now running the test program...$c"
10105 #include <sys/types.h>
10110 #ifdef SYSTIMEKERNEL
10113 #include <sys/time.h>
10116 #include <sys/select.h>
10118 #$i_stdlib I_STDLIB
10120 #include <stdlib.h>
10126 struct timeval bar;
10129 struct timezone tzp;
10131 if (foo.tm_sec == foo.tm_sec)
10134 if (bar.tv_sec == bar.tv_sec)
10141 for s_timezone in '-DS_TIMEZONE' ''; do
10143 for s_timeval in '-DS_TIMEVAL' ''; do
10144 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10145 for i_time in '' '-DI_TIME'; do
10146 for i_systime in '-DI_SYSTIME' ''; do
10149 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10150 if eval $compile; then
10151 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10155 $echo $n "Succeeded with $flags$c"
10167 *SYSTIMEKERNEL*) i_systimek="$define"
10168 timeincl=`./findhdr sys/time.h`
10169 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10170 *) i_systimek="$undef";;
10173 *I_TIME*) i_time="$define"
10174 timeincl=`./findhdr time.h`" $timeincl"
10175 echo "We'll include <time.h>." >&4;;
10176 *) i_time="$undef";;
10179 *I_SYSTIME*) i_systime="$define"
10180 timeincl=`./findhdr sys/time.h`" $timeincl"
10181 echo "We'll include <sys/time.h>." >&4;;
10182 *) i_systime="$undef";;
10186 : see if struct tm knows about tm_zone
10187 case "$i_systime$i_time" in
10190 echo "Checking to see if your struct tm has tm_zone field..." >&4
10191 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10199 case "$d_tm_tm_zone" in
10200 "$define") echo "Yes, it does." ;;
10201 *) echo "No, it doesn't." ;;
10203 : see if struct tm knows about tm_gmtoff
10204 case "$i_systime$i_time" in
10207 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10208 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10216 case "$d_tm_tm_gmtoff" in
10217 "$define") echo "Yes, it does." ;;
10218 *) echo "No, it doesn't." ;;
10221 : see if asctime_r exists
10222 set asctime_r d_asctime_r
10224 case "$d_asctime_r" in
10226 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10227 case "$d_asctime_r_proto:$usethreads" in
10228 ":define") d_asctime_r_proto=define
10229 set d_asctime_r_proto asctime_r $hdrs
10233 case "$d_asctime_r_proto" in
10235 case "$asctime_r_proto" in
10236 ''|0) try='char* asctime_r(const struct tm*, char*);'
10237 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10239 case "$asctime_r_proto" in
10240 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10241 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10243 case "$asctime_r_proto" in
10244 ''|0) try='int asctime_r(const struct tm*, char*);'
10245 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10247 case "$asctime_r_proto" in
10248 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10249 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10251 case "$asctime_r_proto" in
10252 ''|0) d_asctime_r=undef
10254 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10255 * ) case "$asctime_r_proto" in
10256 REENTRANT_PROTO*) ;;
10257 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10259 echo "Prototype: $try" ;;
10262 *) case "$usethreads" in
10263 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10270 *) asctime_r_proto=0
10274 : see if atolf exists
10278 : see if atoll exists
10282 : Look for GCC-style attribute format
10283 case "$d_attribute_format" in
10286 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10287 $cat >attrib.c <<'EOCP'
10289 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10291 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10292 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10293 echo "Your C compiler doesn't support __attribute__((format))."
10296 echo "Your C compiler supports __attribute__((format))."
10300 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10304 *) val="$d_attribute_format" ;;
10306 set d_attribute_format
10310 : Look for GCC-style attribute format with null format allowed
10311 case "$d_printf_format_null" in
10312 '') case "$d_attribute_format" in
10315 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10316 $cat >attrib.c <<EOCP
10318 #$i_stdlib I_STDLIB
10320 #include <stdlib.h>
10322 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10323 int null_printf (char* pat,...) { return (int)pat; }
10324 int main () { exit(null_printf(NULL)); }
10326 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10327 : run the executable in case it produces a run-time warning
10328 if $run ./attrib >>attrib.out 2>&1; then
10329 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10330 echo "Your C compiler doesn't allow __printf__ format to be null."
10333 echo "Your C compiler allows __printf__ format to be null."
10337 echo "Your C compiler executable failed with __printf__ format null."
10341 echo "Your C compiler fails with __printf__ format null."
10348 *) val="$d_printf_format_null" ;;
10350 set d_printf_format_null
10354 : Look for GCC-style attribute malloc
10355 case "$d_attribute_malloc" in
10358 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10359 $cat >attrib.c <<'EOCP'
10361 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10363 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10364 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10365 echo "Your C compiler doesn't support __attribute__((malloc))."
10368 echo "Your C compiler supports __attribute__((malloc))."
10372 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10376 *) val="$d_attribute_malloc" ;;
10378 set d_attribute_malloc
10382 : Look for GCC-style attribute nonnull
10383 case "$d_attribute_nonnull" in
10386 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10387 $cat >attrib.c <<'EOCP'
10389 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10391 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10392 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10393 echo "Your C compiler doesn't support __attribute__((nonnull))."
10396 echo "Your C compiler supports __attribute__((nonnull))."
10400 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10404 *) val="$d_attribute_nonnull" ;;
10406 set d_attribute_nonnull
10410 : Look for GCC-style attribute noreturn
10411 case "$d_attribute_noreturn" in
10414 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10415 $cat >attrib.c <<'EOCP'
10417 void fall_over_dead( void ) __attribute__((noreturn));
10419 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10420 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10421 echo "Your C compiler doesn't support __attribute__((noreturn))."
10424 echo "Your C compiler supports __attribute__((noreturn))."
10428 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10432 *) val="$d_attribute_noreturn" ;;
10434 set d_attribute_noreturn
10438 : Look for GCC-style attribute pure
10439 case "$d_attribute_pure" in
10442 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10443 $cat >attrib.c <<'EOCP'
10445 int square( int n ) __attribute__((pure));
10447 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10448 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10449 echo "Your C compiler doesn't support __attribute__((pure))."
10452 echo "Your C compiler supports __attribute__((pure))."
10456 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10460 *) val="$d_attribute_pure" ;;
10462 set d_attribute_pure
10466 : Look for GCC-style attribute unused
10467 case "$d_attribute_unused" in
10470 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10471 $cat >attrib.c <<'EOCP'
10473 int do_something( int dummy __attribute__((unused)), int n );
10475 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10476 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10477 echo "Your C compiler doesn't support __attribute__((unused))."
10480 echo "Your C compiler supports __attribute__((unused))."
10484 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10488 *) val="$d_attribute_unused" ;;
10490 set d_attribute_unused
10494 : Look for GCC-style attribute deprecated
10495 case "$d_attribute_deprecated" in
10498 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10499 $cat >attrib.c <<'EOCP'
10501 int I_am_deprecated(void) __attribute__((deprecated));
10503 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10504 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10505 echo "Your C compiler doesn't support __attribute__((deprecated))."
10508 echo "Your C compiler supports __attribute__((deprecated))."
10512 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10516 *) val="$d_attribute_deprecated" ;;
10518 set d_attribute_deprecated
10522 : Look for GCC-style attribute warn_unused_result
10523 case "$d_attribute_warn_unused_result" in
10526 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10527 $cat >attrib.c <<'EOCP'
10529 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10531 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10532 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10533 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10536 echo "Your C compiler supports __attribute__((warn_unused_result))."
10540 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10544 *) val="$d_attribute_warn_unused_result" ;;
10546 set d_attribute_warn_unused_result
10550 : see if bcmp exists
10554 : see if bcopy exists
10558 : see if getpgrp exists
10559 set getpgrp d_getpgrp
10562 case "$d_getpgrp" in
10565 echo "Checking to see which flavor of getpgrp is in use..."
10567 #$i_unistd I_UNISTD
10568 #include <sys/types.h>
10570 # include <unistd.h>
10572 #$i_stdlib I_STDLIB
10574 #include <stdlib.h>
10578 if (getuid() == 0) {
10579 printf("(I see you are running Configure as super-user...)\n");
10582 #ifdef TRY_BSD_PGRP
10583 if (getpgrp(1) == 0)
10592 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10593 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10595 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10596 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10599 echo "I can't seem to compile and run the test program."
10601 xxx="a USG one, i.e. you use getpgrp()."
10603 # SVR4 systems can appear rather BSD-ish.
10604 case "$i_unistd" in
10606 xxx="a BSD one, i.e. you use getpgrp(pid)."
10610 xxx="probably a USG one, i.e. you use getpgrp()."
10615 echo "Assuming your getpgrp is $xxx" >&4
10624 : see if setpgrp exists
10625 set setpgrp d_setpgrp
10628 case "$d_setpgrp" in
10631 echo "Checking to see which flavor of setpgrp is in use..."
10633 #$i_unistd I_UNISTD
10634 #include <sys/types.h>
10636 # include <unistd.h>
10638 #$i_stdlib I_STDLIB
10640 #include <stdlib.h>
10644 if (getuid() == 0) {
10645 printf("(I see you are running Configure as super-user...)\n");
10648 #ifdef TRY_BSD_PGRP
10649 if (-1 == setpgrp(1, 1))
10652 if (setpgrp() != -1)
10658 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10659 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10661 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10662 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10665 echo "(I can't seem to compile and run the test program.)"
10667 xxx="a USG one, i.e. you use setpgrp()."
10669 # SVR4 systems can appear rather BSD-ish.
10670 case "$i_unistd" in
10672 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10676 xxx="probably a USG one, i.e. you use setpgrp()."
10681 echo "Assuming your setpgrp is $xxx" >&4
10690 : Look for GCC-style __builtin_choose_expr
10691 case "$d_builtin_choose_expr" in
10694 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10695 $cat >try.c <<'EOCP'
10696 #include <assert.h>
10697 #include <stdlib.h>
10700 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10703 assert( SYRINX(1) == 2112 );
10704 assert( SYRINX(1) != 5150 );
10705 assert( SYRINX(0) == 5150 );
10706 assert( SYRINX(0) != 2112 );
10707 puts( "All good!" );
10713 if eval $compile && $run ./try; then
10714 echo "Your C compiler supports __builtin_choose_expr."
10717 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10721 *) val="$d_builtin_choose_expr" ;;
10724 set d_builtin_choose_expr
10728 : Look for GCC-style __builtin_expect
10729 case "$d_builtin_expect" in
10732 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10733 $cat >try.c <<'EOCP'
10736 if ( __builtin_expect(n, 0) ) n = 1;
10737 /* Remember shell exit code truth is 0, C truth is non-zero */
10742 if eval $compile && $run ./try; then
10743 echo "Your C compiler supports __builtin_expect."
10746 echo "Your C compiler doesn't seem to understand __builtin_expect."
10750 *) val="$d_builtin_expect" ;;
10753 set d_builtin_expect
10757 : see if bzero exists
10761 : see if stdarg is available
10763 if $test `./findhdr stdarg.h`; then
10764 echo "<stdarg.h> found." >&4
10767 echo "<stdarg.h> NOT found." >&4
10771 : see if varargs is available
10773 if $test `./findhdr varargs.h`; then
10774 echo "<varargs.h> found." >&4
10776 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10779 : set up the varargs testing programs
10780 $cat > varargs.c <<EOP
10782 #include <stdarg.h>
10785 #include <varargs.h>
10789 int f(char *p, ...)
10803 p = va_arg(ap, char *);
10809 $cat > varargs <<EOP
10811 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10820 : now check which varargs header should be included
10826 if `./varargs I_STDARG`; then
10828 elif `./varargs I_VARARGS`; then
10833 if `./varargs I_VARARGS`; then
10841 echo "*** WHOA THERE!!! ***" >&4
10842 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
10843 case "$knowitall" in
10845 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
10849 echo "I could not find the definition for va_dcl... You have problems..." >&4
10850 val="$undef"; set i_stdarg; eval $setvar
10851 val="$undef"; set i_varargs; eval $setvar
10856 case "$i_varhdr" in
10858 val="$define"; set i_stdarg; eval $setvar
10859 val="$undef"; set i_varargs; eval $setvar
10862 val="$undef"; set i_stdarg; eval $setvar
10863 val="$define"; set i_varargs; eval $setvar
10866 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10870 : see if the Compiler supports C99 variadic macros
10871 case "$i_stdarg$i_stdlib" in
10873 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10876 #include <stdarg.h>
10878 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10882 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10888 if eval $compile && $run ./try 2>&1 >/dev/null; then
10889 case "`$run ./try`" in
10891 echo "You have C99 variadic macros." >&4
10892 d_c99_variadic_macros="$define"
10895 echo "You don't have functional C99 variadic macros." >&4
10896 d_c99_variadic_macros="$undef"
10900 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10901 d_c99_variadic_macros="$undef"
10906 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10907 d_c99_variadic_macros="$undef"
10911 : see if signal is declared as pointer to function returning int or void
10913 xxx=`./findhdr signal.h`
10914 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10915 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10916 echo "You have int (*signal())() instead of void." >&4
10918 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10919 echo "You have void (*signal())()." >&4
10921 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10922 echo "You have int (*signal())() instead of void." >&4
10924 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10925 echo "You have void (*signal())()." >&4
10928 case "$d_voidsig" in
10930 echo "I can't determine whether signal handler returns void or int..." >&4
10932 rp="What type does your signal handler return?"
10935 v*) val="$define";;
10939 echo "As you already told me, signal handler returns void." >&4
10942 *) echo "As you already told me, signal handler returns int." >&4
10949 case "$d_voidsig" in
10950 "$define") signal_t="void";;
10951 *) signal_t="int";;
10955 : check for ability to cast large floats to 32-bit ints.
10957 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10958 if $test "$intsize" -ge 4; then
10965 #$i_stdlib I_STDLIB
10967 #include <stdlib.h>
10969 #include <sys/types.h>
10970 #include <signal.h>
10971 $signal_t blech(int s) { exit(3); }
10978 signal(SIGFPE, blech);
10980 /* Don't let compiler optimize the test away. Store the number
10981 in a writable string for gcc to pass to sscanf under HP-UX.
10983 sprintf(str, "2147483647");
10984 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10988 /* x86 processors will probably give 0x8000 0000, which is a
10989 sign change. We don't want that. We want to mimic SPARC
10990 behavior here, which is to preserve the sign and give
10993 if (i32 != ($xxx) f)
10999 if eval $compile_ok; then
11003 echo "(I can't seem to compile the test program--assuming it can't)"
11008 echo "Yup, it can."
11011 echo "Nope, it can't."
11018 : check for ability to cast negative floats to unsigned
11020 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11023 #$i_stdlib I_STDLIB
11025 #include <stdlib.h>
11027 #include <sys/types.h>
11028 #include <signal.h>
11029 $signal_t blech(int s) { exit(7); }
11030 $signal_t blech_in_list(int s) { exit(4); }
11031 unsigned long dummy_long(unsigned long p) { return p; }
11032 unsigned int dummy_int(unsigned int p) { return p; }
11033 unsigned short dummy_short(unsigned short p) { return p; }
11037 unsigned long along;
11039 unsigned short ashort;
11043 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11044 a direct f = -123. assignment. gcc-2.8.0 reportedly
11045 optimized the whole file away
11047 /* Store the number in a writable string for gcc to pass to
11048 sscanf under HP-UX.
11050 sprintf(str, "-123");
11051 sscanf(str, "%lf", &f); /* f = -123.; */
11053 signal(SIGFPE, blech);
11054 along = (unsigned long)f;
11055 aint = (unsigned int)f;
11056 ashort = (unsigned short)f;
11057 if (along != (unsigned long)-123)
11059 if (aint != (unsigned int)-123)
11061 if (ashort != (unsigned short)-123)
11063 sprintf(str, "1073741824.");
11064 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11067 along = (unsigned long)f;
11068 if (along != 0x80000000)
11072 along = (unsigned long)f;
11073 if (along != 0x7fffffff)
11077 along = (unsigned long)f;
11078 if (along != 0x80000001)
11082 signal(SIGFPE, blech_in_list);
11083 sprintf(str, "123.");
11084 sscanf(str, "%lf", &f); /* f = 123.; */
11085 along = dummy_long((unsigned long)f);
11086 aint = dummy_int((unsigned int)f);
11087 ashort = dummy_short((unsigned short)f);
11088 if (along != (unsigned long)123)
11090 if (aint != (unsigned int)123)
11092 if (ashort != (unsigned short)123)
11099 if eval $compile_ok; then
11103 echo "(I can't seem to compile the test program--assuming it can't)"
11106 case "$castflags" in
11108 echo "Yup, it can."
11111 echo "Nope, it can't."
11118 : see if vprintf exists
11120 if set vprintf val -f d_vprintf; eval $csym; $val; then
11121 echo 'vprintf() found.' >&4
11124 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11125 #$i_varargs I_VARARGS
11127 #$i_stdlib I_STDLIB
11128 #$i_unistd I_UNISTD
11131 # include <stdarg.h>
11132 #else /* I_VARARGS */
11133 # include <varargs.h>
11137 # include <unistd.h>
11141 # include <stdlib.h>
11144 #include <stdio.h> /* vsprintf prototype */
11147 void xxx(int n, ...)
11152 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11154 int main() { xxx(1, "foo"); }
11156 #else /* I_VARARGS */
11164 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11166 int main() { xxx("foo"); }
11172 if eval $compile_ok; then
11173 if $run ./try; then
11174 echo "Your vsprintf() returns (int)." >&4
11177 echo "Your vsprintf() returns (char*)." >&4
11181 echo 'I am unable to compile the vsprintf() test program.' >&4
11182 # We shouldn't get here. If we do, assume the standard signature,
11183 # not the old BSD one.
11184 echo 'Guessing that vsprintf() returns (int).' >&4
11188 echo 'vprintf() NOT found.' >&4
11199 : see if chown exists
11203 : see if chroot exists
11204 set chroot d_chroot
11207 : see if chsize exists
11208 set chsize d_chsize
11211 : see if class exists
11215 : see if clearenv exists
11216 set clearenv d_clearenv
11219 : Define hasstruct macro for Configure internal use
11220 hasstruct='varname=$1; struct=$2; shift; shift;
11221 while $test $# -ge 2; do
11223 $define) echo "#include <$2>";;
11227 echo "int main () { struct $struct foo; }" >> try.c;
11229 if eval $compile; then
11238 : see whether socket exists
11242 $echo $n "Hmm... $c" >&4
11243 if set socket val -f d_socket; eval $csym; $val; then
11244 echo "Looks like you have Berkeley networking support." >&4
11246 if set setsockopt val -f; eval $csym; $val; then
11249 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11250 d_oldsock="$define"
11253 if $contains socklib libc.list >/dev/null 2>&1; then
11254 echo "Looks like you have Berkeley networking support." >&4
11256 : we will have to assume that it supports the 4.2 BSD interface
11259 echo "You don't have Berkeley networking in libc$_a..." >&4
11260 if test "X$d_socket" = "X$define"; then
11261 echo "...but you seem to believe that you have sockets." >&4
11263 for net in net socket
11265 if test -f /usr/lib/lib$net$_a; then
11266 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11267 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11268 if $contains socket libc.list >/dev/null 2>&1; then
11273 echo "...but the Wollongong group seems to have hacked it in." >&4
11274 sockethdr="-I/usr/netinclude"
11277 echo "Found Berkeley sockets interface in lib$net." >&4
11278 if $contains setsockopt libc.list >/dev/null 2>&1; then
11281 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11282 d_oldsock="$define"
11288 if test "X$d_socket" != "X$define"; then
11289 echo "or anywhere else I see." >&4
11297 : see if socketpair exists
11298 set socketpair d_sockpair
11303 echo "Checking the availability sa_len in the sock struct ..." >&4
11305 #include <sys/types.h>
11306 #include <sys/socket.h>
11308 struct sockaddr sa;
11309 return (sa.sa_len);
11313 set try; if eval $compile; then
11316 set d_sockaddr_sa_len; eval $setvar
11320 echo "Checking the availability struct sockaddr_in6 ..." >&4
11322 #include <sys/types.h>
11323 #include <sys/socket.h>
11324 #include <netinet/in.h>
11326 struct sockaddr_in6 sin6;
11327 return (sin6.sin6_family);
11331 set try; if eval $compile; then
11334 set d_sockaddr_in6; eval $setvar
11338 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11340 #include <sys/types.h>
11341 #include <sys/socket.h>
11342 #include <netinet/in.h>
11344 struct sockaddr_in6 sin6;
11345 return (sin6.sin6_scope_id);
11349 set try; if eval $compile; then
11352 set d_sin6_scope_id; eval $setvar
11356 echo "Checking the availability struct ip_mreq ..." >&4
11358 #include <sys/types.h>
11359 #include <sys/socket.h>
11360 #include <netinet/in.h>
11362 struct ip_mreq mreq;
11363 return (mreq.imr_multiaddr.s_addr);
11367 set try; if eval $compile; then
11370 set d_ip_mreq; eval $setvar
11374 echo "Checking the availability struct ip_mreq_source ..." >&4
11376 #include <sys/types.h>
11377 #include <sys/socket.h>
11378 #include <netinet/in.h>
11380 struct ip_mreq_source mreq;
11381 return (mreq.imr_multiaddr.s_addr);
11385 set try; if eval $compile; then
11388 set d_ip_mreq_source; eval $setvar
11392 echo "Checking the availability struct ipv6_mreq ..." >&4
11394 #include <sys/types.h>
11395 #include <sys/socket.h>
11396 #include <netinet/in.h>
11398 struct ipv6_mreq mreq;
11399 return (mreq.ipv6mr_interface);
11403 set try; if eval $compile; then
11406 set d_ipv6_mreq; eval $setvar
11410 echo "Checking the availability struct ipv6_mreq_source ..." >&4
11412 #include <sys/types.h>
11413 #include <sys/socket.h>
11414 #include <netinet/in.h>
11416 struct ipv6_mreq_source mreq;
11417 return (mreq.imr_multiaddr.s_addr);
11421 set try; if eval $compile; then
11424 set d_ipv6_mreq_source; eval $setvar
11428 echo "Checking the availability of certain socket constants..." >&4
11429 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11430 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11432 #include <sys/types.h>
11433 #include <sys/socket.h>
11439 set try; if eval $compile; then
11442 set d_${enum}; eval $setvar
11446 : see if this is a sys/uio.h system
11447 set sys/uio.h i_sysuio
11450 : Check for cmsghdr support
11452 echo "Checking to see if your system supports struct cmsghdr..." >&4
11453 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11455 case "$d_cmsghdr_s" in
11456 "$define") echo "Yes, it does." ;;
11457 *) echo "No, it doesn't." ;;
11461 : check for const keyword
11463 echo 'Checking to see if your C compiler knows about "const"...' >&4
11464 $cat >const.c <<'EOCP'
11465 typedef struct spug { int drokk; } spug;
11469 const spug y = { 0 };
11472 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11474 echo "Yup, it does."
11477 echo "Nope, it doesn't."
11482 : see if copysignl exists
11483 set copysignl d_copysignl
11486 : see if crypt exists
11491 $define) cryptlib='' ;;
11492 *) if set crypt val -f d_crypt; eval $csym; $val; then
11493 echo 'crypt() found.' >&4
11497 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11498 if $test -z "$cryptlib"; then
11499 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11503 if $test -z "$cryptlib"; then
11504 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11508 if $test -z "$cryptlib"; then
11509 cryptlib=`./loc libcrypt$_a "" $libpth`
11513 if $test -z "$cryptlib"; then
11514 echo 'crypt() NOT found.' >&4
11525 : see if this is a crypt.h system
11526 set crypt.h i_crypt
11529 : see if crypt_r exists
11530 set crypt_r d_crypt_r
11532 case "$d_crypt_r" in
11534 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11535 case "$d_crypt_r_proto:$usethreads" in
11536 ":define") d_crypt_r_proto=define
11537 set d_crypt_r_proto crypt_r $hdrs
11541 case "$d_crypt_r_proto" in
11543 case "$crypt_r_proto" in
11544 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11545 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11547 case "$crypt_r_proto" in
11548 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11549 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11551 case "$crypt_r_proto" in
11552 ''|0) d_crypt_r=undef
11554 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11555 * ) case "$crypt_r_proto" in
11556 REENTRANT_PROTO*) ;;
11557 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11559 echo "Prototype: $try" ;;
11562 *) case "$usethreads" in
11563 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11574 : get csh whereabouts
11576 'csh') val="$undef" ;;
11577 *) val="$define" ;;
11581 : Respect a hint or command line value for full_csh.
11582 case "$full_csh" in
11583 '') full_csh=$csh ;;
11586 : see if ctermid exists
11587 set ctermid d_ctermid
11590 : see if ctermid_r exists
11591 set ctermid_r d_ctermid_r
11593 case "$d_ctermid_r" in
11595 hdrs="$i_systypes sys/types.h define stdio.h "
11596 case "$d_ctermid_r_proto:$usethreads" in
11597 ":define") d_ctermid_r_proto=define
11598 set d_ctermid_r_proto ctermid_r $hdrs
11602 case "$d_ctermid_r_proto" in
11604 case "$ctermid_r_proto" in
11605 ''|0) try='char* ctermid_r(char*);'
11606 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11608 case "$ctermid_r_proto" in
11609 ''|0) d_ctermid_r=undef
11611 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11612 * ) case "$ctermid_r_proto" in
11613 REENTRANT_PROTO*) ;;
11614 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11616 echo "Prototype: $try" ;;
11619 *) case "$usethreads" in
11620 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11627 *) ctermid_r_proto=0
11631 : see if ctime_r exists
11632 set ctime_r d_ctime_r
11634 case "$d_ctime_r" in
11636 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11637 case "$d_ctime_r_proto:$usethreads" in
11638 ":define") d_ctime_r_proto=define
11639 set d_ctime_r_proto ctime_r $hdrs
11643 case "$d_ctime_r_proto" in
11645 case "$ctime_r_proto" in
11646 ''|0) try='char* ctime_r(const time_t*, char*);'
11647 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11649 case "$ctime_r_proto" in
11650 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11651 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11653 case "$ctime_r_proto" in
11654 ''|0) try='int ctime_r(const time_t*, char*);'
11655 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11657 case "$ctime_r_proto" in
11658 ''|0) try='int ctime_r(const time_t*, char*, int);'
11659 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11661 case "$ctime_r_proto" in
11662 ''|0) d_ctime_r=undef
11664 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11665 * ) case "$ctime_r_proto" in
11666 REENTRANT_PROTO*) ;;
11667 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11669 echo "Prototype: $try" ;;
11672 *) case "$usethreads" in
11673 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11684 : see if cuserid exists
11685 set cuserid d_cuserid
11688 : see if this is a limits.h system
11689 set limits.h i_limits
11692 : see if this is a float.h system
11693 set float.h i_float
11696 : See if number of significant digits in a double precision number is known
11698 $cat >dbl_dig.c <<EOM
11699 #$i_limits I_LIMITS
11702 #include <limits.h>
11708 printf("Contains DBL_DIG");
11711 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11712 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11713 echo "DBL_DIG found." >&4
11716 echo "DBL_DIG NOT found." >&4
11723 : see if dbm.h is available
11724 : see if dbmclose exists
11725 set dbmclose d_dbmclose
11728 case "$d_dbmclose" in
11738 *) set rpcsvc/dbm.h i_rpcsvcdbm
11743 *) echo "We won't be including <dbm.h>"
11753 : see if prototype for dbminit is available
11755 set d_dbminitproto dbminit $i_dbm dbm.h
11758 : see if difftime exists
11759 set difftime d_difftime
11762 : see if this is a dirent system
11764 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11766 echo "<dirent.h> found." >&4
11769 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11770 echo "<sys/dir.h> found." >&4
11773 xinc=`./findhdr sys/ndir.h`
11775 echo "<dirent.h> NOT found." >&4
11780 : Look for type of directory structure.
11782 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11784 case "$direntrytype" in
11786 case "$i_dirent" in
11787 $define) guess1='struct dirent' ;;
11788 *) guess1='struct direct' ;;
11791 *) guess1="$direntrytype"
11796 'struct dirent') guess2='struct direct' ;;
11797 *) guess2='struct dirent' ;;
11800 if $contains "$guess1" try.c >/dev/null 2>&1; then
11801 direntrytype="$guess1"
11802 echo "Your directory entries are $direntrytype." >&4
11803 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11804 direntrytype="$guess2"
11805 echo "Your directory entries seem to be $direntrytype." >&4
11807 echo "I don't recognize your system's directory entries." >&4
11808 rp="What type is used for directory entries on this system?"
11811 direntrytype="$ans"
11815 : see if the directory entry stores field length
11817 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11818 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11819 echo "Good, your directory entry keeps length information in d_namlen." >&4
11822 echo "Your directory entry does not know about the d_namlen field." >&4
11829 : Look for DIR.dd_fd
11830 case "$i_dirent" in
11832 echo "Checking to see if DIR has a dd_fd member variable" >&4
11834 #$i_stdlib I_STDLIB
11836 #include <stdlib.h>
11838 #include <dirent.h>
11848 if eval $compile; then
11849 echo "Yes, it does."
11852 echo "No, it does not."
11857 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11865 : see if this is an sysdir system
11866 set sys/dir.h i_sysdir
11869 : see if this is an sysndir system
11870 set sys/ndir.h i_sysndir
11875 $cat >dirfd.c <<EOM
11877 #$i_stdlib I_STDLIB
11879 #include <stdlib.h>
11881 #$i_dirent I_DIRENT /**/
11882 #$i_sysdir I_SYS_DIR /**/
11883 #$i_sysndir I_SYS_NDIR /**/
11884 #$i_systypes I_SYS_TYPES /**/
11885 #if defined(I_SYS_TYPES)
11886 #include <sys/types.h>
11888 #if defined(I_DIRENT)
11889 #include <dirent.h>
11890 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11891 #include <sys/dir.h>
11895 #include <sys/ndir.h>
11899 #include <ndir.h> /* may be wrong in the future */
11901 #include <sys/dir.h>
11907 DIR *dirp = opendir(".");
11908 if (dirfd(dirp) >= 0)
11916 if eval $compile; then
11920 $define) echo "dirfd() found." >&4 ;;
11921 *) echo "dirfd() NOT found." >&4 ;;
11927 : see if dlerror exists
11930 set dlerror d_dlerror
11934 : see if dlfcn is available
11935 set dlfcn.h i_dlfcn
11938 : Check what extension to use for shared libs
11943 On a few systems, the dynamically loaded modules that perl generates and uses
11944 will need a different extension than shared libs. The default will probably
11950 *) dflt="$dlext" ;;
11952 rp='What is the extension of dynamically loaded modules'
11961 : Check if dlsym need a leading underscore
11967 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11968 $cat >dyna.c <<'EOM'
11975 #$i_stdlib I_STDLIB
11977 #include <stdlib.h>
11981 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11983 #include <sys/types.h>
11988 extern int fred() ;
11997 int mode = RTLD_LAZY ;
11999 handle = dlopen("./dyna.$dlext", mode) ;
12000 if (handle == NULL) {
12005 symbol = dlsym(handle, "fred") ;
12006 if (symbol == NULL) {
12007 /* try putting a leading underscore */
12008 symbol = dlsym(handle, "_fred") ;
12009 if (symbol == NULL) {
12022 : Call the object file tmp-dyna.o in case dlext=o.
12023 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12024 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12025 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12026 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12029 1) echo "Test program failed using dlopen." >&4
12030 echo "Perhaps you should not use dynamic loading." >&4;;
12031 2) echo "Test program failed using dlsym." >&4
12032 echo "Perhaps you should not use dynamic loading." >&4;;
12033 3) echo "dlsym needs a leading underscore" >&4
12035 4) echo "dlsym doesn't need a leading underscore." >&4;;
12038 echo "I can't compile and run the test program." >&4
12039 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12044 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12049 : see if drand48_r exists
12050 set drand48_r d_drand48_r
12052 case "$d_drand48_r" in
12054 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12055 case "$d_drand48_r_proto:$usethreads" in
12056 ":define") d_drand48_r_proto=define
12057 set d_drand48_r_proto drand48_r $hdrs
12061 case "$d_drand48_r_proto" in
12063 case "$drand48_r_proto" in
12064 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12065 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12067 case "$drand48_r_proto" in
12068 ''|0) d_drand48_r=undef
12070 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12071 * ) case "$drand48_r_proto" in
12072 REENTRANT_PROTO*) ;;
12073 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12075 echo "Prototype: $try" ;;
12078 *) case "$usethreads" in
12079 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12086 *) drand48_r_proto=0
12090 : see if prototype for drand48 is available
12092 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12095 : see if dup2 exists
12099 : see if eaccess exists
12100 set eaccess d_eaccess
12103 : see if endgrent exists
12104 set endgrent d_endgrent
12107 : see if this is an grp system
12113 xxx=`./findhdr grp.h`
12114 $cppstdin $cppflags $cppminus < $xxx >$$.h
12116 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12128 set d_grpasswd; eval $setvar
12132 : see if endgrent_r exists
12133 set endgrent_r d_endgrent_r
12135 case "$d_endgrent_r" in
12137 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12138 case "$d_endgrent_r_proto:$usethreads" in
12139 ":define") d_endgrent_r_proto=define
12140 set d_endgrent_r_proto endgrent_r $hdrs
12144 case "$d_endgrent_r_proto" in
12146 case "$endgrent_r_proto" in
12147 ''|0) try='int endgrent_r(FILE**);'
12148 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12150 case "$endgrent_r_proto" in
12151 ''|0) try='void endgrent_r(FILE**);'
12152 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12154 case "$endgrent_r_proto" in
12155 ''|0) d_endgrent_r=undef
12157 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12158 * ) case "$endgrent_r_proto" in
12159 REENTRANT_PROTO*) ;;
12160 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12162 echo "Prototype: $try" ;;
12165 *) case "$usethreads" in
12166 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12173 *) endgrent_r_proto=0
12177 : see if endhostent exists
12178 set endhostent d_endhent
12181 : see if this is a netdb.h system
12182 set netdb.h i_netdb
12185 : see if endhostent_r exists
12186 set endhostent_r d_endhostent_r
12188 case "$d_endhostent_r" in
12190 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12191 case "$d_endhostent_r_proto:$usethreads" in
12192 ":define") d_endhostent_r_proto=define
12193 set d_endhostent_r_proto endhostent_r $hdrs
12197 case "$d_endhostent_r_proto" in
12199 case "$endhostent_r_proto" in
12200 ''|0) try='int endhostent_r(struct hostent_data*);'
12201 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12203 case "$endhostent_r_proto" in
12204 ''|0) try='void endhostent_r(struct hostent_data*);'
12205 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12207 case "$endhostent_r_proto" in
12208 ''|0) d_endhostent_r=undef
12209 endhostent_r_proto=0
12210 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12211 * ) case "$endhostent_r_proto" in
12212 REENTRANT_PROTO*) ;;
12213 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12215 echo "Prototype: $try" ;;
12218 *) case "$usethreads" in
12219 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12221 d_endhostent_r=undef
12222 endhostent_r_proto=0
12226 *) endhostent_r_proto=0
12230 : see if endnetent exists
12231 set endnetent d_endnent
12234 : see if endnetent_r exists
12235 set endnetent_r d_endnetent_r
12237 case "$d_endnetent_r" in
12239 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12240 case "$d_endnetent_r_proto:$usethreads" in
12241 ":define") d_endnetent_r_proto=define
12242 set d_endnetent_r_proto endnetent_r $hdrs
12246 case "$d_endnetent_r_proto" in
12248 case "$endnetent_r_proto" in
12249 ''|0) try='int endnetent_r(struct netent_data*);'
12250 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12252 case "$endnetent_r_proto" in
12253 ''|0) try='void endnetent_r(struct netent_data*);'
12254 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12256 case "$endnetent_r_proto" in
12257 ''|0) d_endnetent_r=undef
12258 endnetent_r_proto=0
12259 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12260 * ) case "$endnetent_r_proto" in
12261 REENTRANT_PROTO*) ;;
12262 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12264 echo "Prototype: $try" ;;
12267 *) case "$usethreads" in
12268 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12270 d_endnetent_r=undef
12271 endnetent_r_proto=0
12275 *) endnetent_r_proto=0
12279 : see if endprotoent exists
12280 set endprotoent d_endpent
12283 : see if endprotoent_r exists
12284 set endprotoent_r d_endprotoent_r
12286 case "$d_endprotoent_r" in
12288 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12289 case "$d_endprotoent_r_proto:$usethreads" in
12290 ":define") d_endprotoent_r_proto=define
12291 set d_endprotoent_r_proto endprotoent_r $hdrs
12295 case "$d_endprotoent_r_proto" in
12297 case "$endprotoent_r_proto" in
12298 ''|0) try='int endprotoent_r(struct protoent_data*);'
12299 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12301 case "$endprotoent_r_proto" in
12302 ''|0) try='void endprotoent_r(struct protoent_data*);'
12303 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12305 case "$endprotoent_r_proto" in
12306 ''|0) d_endprotoent_r=undef
12307 endprotoent_r_proto=0
12308 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12309 * ) case "$endprotoent_r_proto" in
12310 REENTRANT_PROTO*) ;;
12311 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12313 echo "Prototype: $try" ;;
12316 *) case "$usethreads" in
12317 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12319 d_endprotoent_r=undef
12320 endprotoent_r_proto=0
12324 *) endprotoent_r_proto=0
12328 : see if endpwent exists
12329 set endpwent d_endpwent
12332 : see if this is a pwd.h system
12338 xxx=`./findhdr pwd.h`
12339 $cppstdin $cppflags $cppminus < $xxx >$$.h
12341 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12349 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12357 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12365 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12373 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12381 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12389 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12397 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12409 set d_pwquota; eval $setvar
12410 set d_pwage; eval $setvar
12411 set d_pwchange; eval $setvar
12412 set d_pwclass; eval $setvar
12413 set d_pwexpire; eval $setvar
12414 set d_pwcomment; eval $setvar
12415 set d_pwgecos; eval $setvar
12416 set d_pwpasswd; eval $setvar
12420 : see if endpwent_r exists
12421 set endpwent_r d_endpwent_r
12423 case "$d_endpwent_r" in
12425 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12426 case "$d_endpwent_r_proto:$usethreads" in
12427 ":define") d_endpwent_r_proto=define
12428 set d_endpwent_r_proto endpwent_r $hdrs
12432 case "$d_endpwent_r_proto" in
12434 case "$endpwent_r_proto" in
12435 ''|0) try='int endpwent_r(FILE**);'
12436 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12438 case "$endpwent_r_proto" in
12439 ''|0) try='void endpwent_r(FILE**);'
12440 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12442 case "$endpwent_r_proto" in
12443 ''|0) d_endpwent_r=undef
12445 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12446 * ) case "$endpwent_r_proto" in
12447 REENTRANT_PROTO*) ;;
12448 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12450 echo "Prototype: $try" ;;
12453 *) case "$usethreads" in
12454 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12461 *) endpwent_r_proto=0
12465 : see if endservent exists
12466 set endservent d_endsent
12469 : see if endservent_r exists
12470 set endservent_r d_endservent_r
12472 case "$d_endservent_r" in
12474 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12475 case "$d_endservent_r_proto:$usethreads" in
12476 ":define") d_endservent_r_proto=define
12477 set d_endservent_r_proto endservent_r $hdrs
12481 case "$d_endservent_r_proto" in
12483 case "$endservent_r_proto" in
12484 ''|0) try='int endservent_r(struct servent_data*);'
12485 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12487 case "$endservent_r_proto" in
12488 ''|0) try='void endservent_r(struct servent_data*);'
12489 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12491 case "$endservent_r_proto" in
12492 ''|0) d_endservent_r=undef
12493 endservent_r_proto=0
12494 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12495 * ) case "$endservent_r_proto" in
12496 REENTRANT_PROTO*) ;;
12497 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12499 echo "Prototype: $try" ;;
12502 *) case "$usethreads" in
12503 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12505 d_endservent_r=undef
12506 endservent_r_proto=0
12510 *) endservent_r_proto=0
12514 : Locate the flags for 'open()'
12517 #include <sys/types.h>
12522 #include <sys/file.h>
12524 #$i_stdlib I_STDLIB
12526 #include <stdlib.h>
12537 : check sys/file.h first to get FREAD on Sun
12538 if $test `./findhdr sys/file.h` && \
12539 set try -DI_SYS_FILE && eval $compile; then
12541 echo "<sys/file.h> defines the O_* constants..." >&4
12542 if $run ./try; then
12543 echo "and you have the 3 argument form of open()." >&4
12546 echo "but not the 3 argument form of open(). Oh, well." >&4
12549 elif $test `./findhdr fcntl.h` && \
12550 set try -DI_FCNTL && eval $compile; then
12552 echo "<fcntl.h> defines the O_* constants..." >&4
12553 if $run ./try; then
12554 echo "and you have the 3 argument form of open()." >&4
12557 echo "but not the 3 argument form of open(). Oh, well." >&4
12562 echo "I can't find the O_* constant definitions! You got problems." >&4
12568 : see if this is a sys/file.h system
12573 : do we need to include sys/file.h ?
12577 if $h_sysfile; then
12579 echo "We'll be including <sys/file.h>." >&4
12582 echo "We won't be including <sys/file.h>." >&4
12592 : see if fcntl.h is there
12597 : see if we can include fcntl.h
12603 echo "We'll be including <fcntl.h>." >&4
12606 if $h_sysfile; then
12607 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12609 echo "We won't be including <fcntl.h>." >&4
12621 : see if fork exists
12625 : see if pipe exists
12629 : check for non-blocking I/O stuff
12630 case "$h_sysfile" in
12631 true) echo "#include <sys/file.h>" > head.c;;
12634 true) echo "#include <fcntl.h>" > head.c;;
12635 *) echo "#include <sys/fcntl.h>" > head.c;;
12640 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12641 case "$o_nonblock" in
12643 $cat head.c > try.c
12644 $cat >>try.c <<EOCP
12646 #$i_stdlib I_STDLIB
12648 #include <stdlib.h>
12656 printf("O_NONBLOCK\n");
12660 printf("O_NDELAY\n");
12664 printf("FNDELAY\n");
12671 if eval $compile_ok; then
12672 o_nonblock=`$run ./try`
12673 case "$o_nonblock" in
12674 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12675 *) echo "Seems like we can use $o_nonblock.";;
12678 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12681 *) echo "Using $hint value $o_nonblock.";;
12686 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12689 case "$d_fork:$d_pipe" in
12691 $cat head.c > try.c
12692 $cat >>try.c <<EOCP
12694 #include <sys/types.h>
12695 #include <signal.h>
12697 #$i_stdlib I_STDLIB
12699 #include <stdlib.h>
12705 #define MY_O_NONBLOCK $o_nonblock
12706 #ifndef errno /* XXX need better Configure test */
12709 #$i_unistd I_UNISTD
12711 #include <unistd.h>
12713 #$i_string I_STRING
12715 #include <string.h>
12717 #include <strings.h>
12719 $signal_t blech(int x) { exit(3); }
12721 $cat >> try.c <<'EOCP'
12729 pipe(pd); /* Down: child -> parent */
12730 pipe(pu); /* Up: parent -> child */
12733 close(pd[1]); /* Parent reads from pd[0] */
12734 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12736 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12741 signal(SIGALRM, blech);
12743 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12745 sprintf(string, "%d\n", ret);
12746 write(2, string, strlen(string));
12749 if (errno == EAGAIN) {
12750 printf("EAGAIN\n");
12755 if (errno == EWOULDBLOCK)
12756 printf("EWOULDBLOCK\n");
12759 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12760 sleep(2); /* Give it time to close our pipe */
12762 ret = read(pd[0], buf, 1); /* Should read EOF */
12764 sprintf(string, "%d\n", ret);
12765 write(4, string, strlen(string));
12769 close(pd[0]); /* We write to pd[1] */
12770 close(pu[1]); /* We read from pu[0] */
12771 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12772 close(pd[1]); /* Pipe pd is now fully closed! */
12773 exit(0); /* Bye bye, thank you for playing! */
12777 if eval $compile_ok; then
12778 echo "$startsh" >mtry
12779 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12781 ./mtry >/dev/null 2>&1
12783 0) eagain=`$cat try.out`;;
12784 1) echo "Could not perform non-blocking setting!";;
12785 2) echo "I did a successful read() for something that was not there!";;
12786 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12787 4) echo "Could not find F_SETFL!";;
12788 *) echo "Something terribly wrong happened during testing.";;
12790 rd_nodata=`$cat try.ret`
12791 echo "A read() system call with no data present returns $rd_nodata."
12792 case "$rd_nodata" in
12795 echo "(That's peculiar, fixing that to be -1.)"
12801 echo "Forcing errno EAGAIN on read() with no data available."
12805 echo "Your read() sets errno to $eagain when no data is available."
12808 status=`$cat try.err`
12810 0) echo "And it correctly returns 0 to signal EOF.";;
12811 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12812 *) echo "However, your read() returns '$status' on EOF??";;
12815 if test "$status" = "$rd_nodata"; then
12816 echo "WARNING: you can't distinguish between EOF and no data!"
12820 echo "I can't compile the test program--assuming errno EAGAIN will do."
12824 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12833 echo "Using $hint value $eagain."
12834 echo "Your read() returns $rd_nodata when no data is present."
12835 case "$d_eofnblk" in
12836 "$define") echo "And you can see EOF because read() returns 0.";;
12837 "$undef") echo "But you can't see EOF status from read() returned value.";;
12839 echo "(Assuming you can't see EOF status from read anyway.)"
12845 $rm_try head.c mtry
12847 : see if _ptr and _cnt from stdio act std
12850 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12851 echo "(Looks like you have stdio.h from BSD.)"
12852 case "$stdio_ptr" in
12853 '') stdio_ptr='((fp)->_p)'
12856 *) ptr_lval=$d_stdio_ptr_lval;;
12858 case "$stdio_cnt" in
12859 '') stdio_cnt='((fp)->_r)'
12862 *) cnt_lval=$d_stdio_cnt_lval;;
12864 case "$stdio_base" in
12865 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12867 case "$stdio_bufsiz" in
12868 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12870 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12871 echo "(Looks like you have stdio.h from Linux.)"
12872 case "$stdio_ptr" in
12873 '') stdio_ptr='((fp)->_IO_read_ptr)'
12876 *) ptr_lval=$d_stdio_ptr_lval;;
12878 case "$stdio_cnt" in
12879 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12882 *) cnt_lval=$d_stdio_cnt_lval;;
12884 case "$stdio_base" in
12885 '') stdio_base='((fp)->_IO_read_base)';;
12887 case "$stdio_bufsiz" in
12888 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12891 case "$stdio_ptr" in
12892 '') stdio_ptr='((fp)->_ptr)'
12895 *) ptr_lval=$d_stdio_ptr_lval;;
12897 case "$stdio_cnt" in
12898 '') stdio_cnt='((fp)->_cnt)'
12901 *) cnt_lval=$d_stdio_cnt_lval;;
12903 case "$stdio_base" in
12904 '') stdio_base='((fp)->_base)';;
12906 case "$stdio_bufsiz" in
12907 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12911 : test whether _ptr and _cnt really work
12912 echo "Checking how std your stdio is..." >&4
12915 #$i_stdlib I_STDLIB
12917 #include <stdlib.h>
12919 #define FILE_ptr(fp) $stdio_ptr
12920 #define FILE_cnt(fp) $stdio_cnt
12922 FILE *fp = fopen("try.c", "r");
12925 18 <= FILE_cnt(fp) &&
12926 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12934 if eval $compile && $to try.c; then
12935 if $run ./try; then
12936 echo "Your stdio acts pretty std."
12939 echo "Your stdio isn't very std."
12942 echo "Your stdio doesn't appear very std."
12946 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12947 # direct buffer manipulation no longer works. The Configure tests
12948 # should be changed to correctly detect this, but until then,
12949 # the following check should at least let perl compile and run.
12950 # (This quick fix should be updated before 5.8.1.)
12951 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12952 # A. Dougherty, June 3, 2002.
12953 case "$d_gnulibc" in
12955 case "$gnulibc_version" in
12959 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12968 : Can _ptr be used as an lvalue?
12969 case "$d_stdstdio$ptr_lval" in
12970 $define$define) val=$define ;;
12973 set d_stdio_ptr_lval
12976 : Can _cnt be used as an lvalue?
12977 case "$d_stdstdio$cnt_lval" in
12978 $define$define) val=$define ;;
12981 set d_stdio_cnt_lval
12985 : test whether setting _ptr sets _cnt as a side effect
12986 d_stdio_ptr_lval_sets_cnt="$undef"
12987 d_stdio_ptr_lval_nochange_cnt="$undef"
12988 case "$d_stdio_ptr_lval$d_stdstdio" in
12990 echo "Checking to see what happens if we set the stdio ptr..." >&4
12993 /* Can we scream? */
12994 /* Eat dust sed :-) */
12995 /* In the buffer space, no one can hear you scream. */
12996 #$i_stdlib I_STDLIB
12998 #include <stdlib.h>
13000 #define FILE_ptr(fp) $stdio_ptr
13001 #define FILE_cnt(fp) $stdio_cnt
13002 #include <sys/types.h>
13004 FILE *fp = fopen("try.c", "r");
13009 puts("Fail even to read");
13012 c = getc(fp); /* Read away the first # */
13014 puts("Fail even to read");
13018 18 <= FILE_cnt(fp) &&
13019 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13021 puts("Fail even to read");
13024 ptr = (char*) FILE_ptr(fp);
13025 cnt = (size_t)FILE_cnt(fp);
13027 FILE_ptr(fp) += 42;
13029 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13030 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13033 if (FILE_cnt(fp) <= 20) {
13034 printf ("Fail (<20 chars to test)");
13037 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13038 puts("Fail compare");
13041 if (cnt == FILE_cnt(fp)) {
13042 puts("Pass_unchanged");
13045 if (FILE_cnt(fp) == (cnt - 42)) {
13046 puts("Pass_changed");
13049 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13055 if eval $compile && $to try.c; then
13056 case `$run ./try` in
13058 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13059 d_stdio_ptr_lval_sets_cnt="$define" ;;
13061 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13062 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13064 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13066 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13069 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13075 : see if _base is also standard
13077 case "$d_stdstdio" in
13081 #$i_stdlib I_STDLIB
13083 #include <stdlib.h>
13085 #define FILE_base(fp) $stdio_base
13086 #define FILE_bufsiz(fp) $stdio_bufsiz
13088 FILE *fp = fopen("try.c", "r");
13091 19 <= FILE_bufsiz(fp) &&
13092 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13099 if eval $compile && $to try.c; then
13100 if $run ./try; then
13101 echo "And its _base field acts std."
13104 echo "But its _base field isn't std."
13107 echo "However, it seems to be lacking the _base field."
13115 : see if fast_stdio exists
13117 case "$d_stdstdio:$d_stdio_ptr_lval" in
13119 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13121 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13132 : see if fchdir exists
13133 set fchdir d_fchdir
13136 : see if fchmod exists
13137 set fchmod d_fchmod
13140 : see if fchown exists
13141 set fchown d_fchown
13144 : see if this is an fcntl system
13148 : See if fcntl-based locking works.
13151 #$i_stdlib I_STDLIB
13153 #include <stdlib.h>
13155 #include <unistd.h>
13157 #include <signal.h>
13158 $signal_t blech(int x) { exit(3); }
13160 #if defined(F_SETLK) && defined(F_SETLKW)
13161 struct flock flock;
13163 fd = open("try.c", O_RDONLY);
13164 flock.l_type = F_RDLCK;
13165 flock.l_whence = SEEK_SET;
13166 flock.l_start = flock.l_len = 0;
13167 signal(SIGALRM, blech);
13169 retval = fcntl(fd, F_SETLK, &flock);
13171 (retval < 0 ? exit(2) : exit(0));
13177 echo "Checking if fcntl-based file locking works... "
13181 if eval $compile_ok; then
13182 if $run ./try; then
13183 echo "Yes, it seems to work."
13186 echo "Nope, it didn't work."
13191 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13192 *** This is (almost) impossible.
13193 *** If your NFS lock daemons are not feeling well, something like
13194 *** this may happen, please investigate. Cannot continue, aborting.
13202 echo "I'm unable to compile the test program, so I'll assume not."
13207 echo "Nope, since you don't even have fcntl()."
13210 set d_fcntl_can_lock
13214 : check for fd_set items
13217 Checking to see how well your C compiler handles fd_set and friends ...
13220 #$i_stdlib I_STDLIB
13222 #include <stdlib.h>
13224 #$i_systime I_SYS_TIME
13225 #$i_sysselct I_SYS_SELECT
13226 #$d_socket HAS_SOCKET
13227 #include <sys/types.h>
13229 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13232 #include <sys/time.h>
13234 #ifdef I_SYS_SELECT
13235 #include <sys/select.h>
13244 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13252 if eval $compile; then
13253 d_fds_bits="$define"
13255 echo "Well, your system knows about the normal fd_set typedef..." >&4
13256 if $run ./try; then
13257 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13258 d_fd_macros="$define"
13261 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13263 d_fd_macros="$undef"
13267 Hmm, your compiler has some difficulty with fd_set. Checking further...
13270 if eval $compile; then
13271 d_fds_bits="$undef"
13273 echo "Well, your system has some sort of fd_set available..." >&4
13274 if $run ./try; then
13275 echo "and you have the normal fd_set macros." >&4
13276 d_fd_macros="$define"
13279 but not the normal fd_set macros! Gross! More work for me...
13281 d_fd_macros="$undef"
13284 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13286 d_fds_bits="$undef"
13287 d_fd_macros="$undef"
13292 : see if fgetpos exists
13293 set fgetpos d_fgetpos
13296 : see if finite exists
13297 set finite d_finite
13300 : see if finitel exists
13301 set finitel d_finitel
13304 : see if flock exists
13308 : see if prototype for flock is available
13310 set d_flockproto flock $i_sysfile sys/file.h
13313 : see if fp_class exists
13314 set fp_class d_fp_class
13317 : see if pathconf exists
13318 set pathconf d_pathconf
13321 : see if fpathconf exists
13322 set fpathconf d_fpathconf
13325 : see if fpclass exists
13326 set fpclass d_fpclass
13329 : see if fpclassify exists
13330 set fpclassify d_fpclassify
13333 : see if fpclassl exists
13334 set fpclassl d_fpclassl
13337 : check for fpos64_t
13339 echo "Checking to see if you have fpos64_t..." >&4
13342 int main() { fpos64_t x = 7; }
13345 if eval $compile; then
13347 echo "You have fpos64_t."
13350 echo "You do not have fpos64_t."
13351 case "$fpossize" in
13352 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13359 : see if frexpl exists
13360 set frexpl d_frexpl
13363 : see if this is a sys/param system
13364 set sys/param.h i_sysparam
13367 : see if this is a sys/mount.h system
13368 set sys/mount.h i_sysmount
13371 : Check for fs_data_s
13373 echo "Checking to see if your system supports struct fs_data..." >&4
13374 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13376 case "$d_fs_data_s" in
13377 "$define") echo "Yes, it does." ;;
13378 *) echo "No, it doesn't." ;;
13381 : see if fseeko exists
13382 set fseeko d_fseeko
13384 case "$longsize" in
13385 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13388 : see if fsetpos exists
13389 set fsetpos d_fsetpos
13392 : see if fstatfs exists
13393 set fstatfs d_fstatfs
13396 : see if statvfs exists
13397 set statvfs d_statvfs
13400 : see if fstatvfs exists
13401 set fstatvfs d_fstatvfs
13405 : see if fsync exists
13409 : see if ftello exists
13410 set ftello d_ftello
13412 case "$longsize" in
13413 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13416 : check for a working futimes
13419 echo "Checking if you have a working futimes()" >&4
13422 #include <sys/time.h>
13429 fd = open ("try.c", O_RDWR);
13430 if (-1 == fd) exit (1);
13431 rv = futimes (fd, NULL);
13432 exit (rv == -1 ? errno : 0);
13436 if eval $compile; then
13440 0) echo "Yes, you have" >&4
13441 d_futimes="$define"
13443 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13447 echo "No, it does not (probably harmless)" >&4
13451 : see if ndbm.h is available
13454 : Compatibility location for RedHat 7.1
13455 set gdbm/ndbm.h i_gdbmndbm
13457 : Compatibility location for Debian 4.0
13458 set gdbm-ndbm.h i_gdbm_ndbm
13462 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13463 : see if dbm_open exists
13464 set dbm_open d_dbm_open
13466 case "$d_dbm_open" in
13469 i_gdbmndbm="$undef"
13470 i_gdbm_ndbm="$undef"
13471 echo "We won't be including <ndbm.h>"
13481 ndbm_hdr_protochk='name=$1; hdr=$2;
13482 eval "ihdr=\$""i_$name";
13484 if $test "$ihdr" = "$define"; then
13485 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13486 case "$d_cplusplus" in
13487 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13488 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13491 $define) $echo "Your <$hdr> seems to have prototypes";;
13492 *) $echo "Your <$hdr> does not seem to have prototypes";;
13495 set "d_${name}_h_uses_prototypes";
13499 eval $ndbm_hdr_protochk
13500 set gdbmndbm gdbm/ndbm.h
13501 eval $ndbm_hdr_protochk
13502 set gdbm_ndbm gdbm-ndbm.h
13503 eval $ndbm_hdr_protochk
13505 : see if getaddrinfo exists
13506 set getaddrinfo d_getaddrinfo
13509 : see if getcwd exists
13510 set getcwd d_getcwd
13513 : see if getespwnam exists
13514 set getespwnam d_getespwnam
13517 : see if getfsstat exists
13518 set getfsstat d_getfsstat
13521 : see if getgrent exists
13522 set getgrent d_getgrent
13525 : see if getgrent_r exists
13526 set getgrent_r d_getgrent_r
13528 case "$d_getgrent_r" in
13530 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13531 case "$d_getgrent_r_proto:$usethreads" in
13532 ":define") d_getgrent_r_proto=define
13533 set d_getgrent_r_proto getgrent_r $hdrs
13537 case "$d_getgrent_r_proto" in
13539 case "$getgrent_r_proto" in
13540 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13541 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13543 case "$getgrent_r_proto" in
13544 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13545 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13547 case "$getgrent_r_proto" in
13548 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13549 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13551 case "$getgrent_r_proto" in
13552 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13553 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13555 case "$getgrent_r_proto" in
13556 ''|0) try='int getgrent_r(struct group*, char*, int);'
13557 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13559 case "$getgrent_r_proto" in
13560 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13561 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13563 case "$getgrent_r_proto" in
13564 ''|0) d_getgrent_r=undef
13566 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13567 * ) case "$getgrent_r_proto" in
13568 REENTRANT_PROTO*) ;;
13569 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13571 echo "Prototype: $try" ;;
13574 *) case "$usethreads" in
13575 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13582 *) getgrent_r_proto=0
13586 : see if getgrgid_r exists
13587 set getgrgid_r d_getgrgid_r
13589 case "$d_getgrgid_r" in
13591 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13592 case "$d_getgrgid_r_proto:$usethreads" in
13593 ":define") d_getgrgid_r_proto=define
13594 set d_getgrgid_r_proto getgrgid_r $hdrs
13598 case "$d_getgrgid_r_proto" in
13600 case "$getgrgid_r_proto" in
13601 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13602 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13604 case "$getgrgid_r_proto" in
13605 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13606 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13608 case "$getgrgid_r_proto" in
13609 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13610 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13612 case "$getgrgid_r_proto" in
13613 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13614 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13616 case "$getgrgid_r_proto" in
13617 ''|0) d_getgrgid_r=undef
13619 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13620 * ) case "$getgrgid_r_proto" in
13621 REENTRANT_PROTO*) ;;
13622 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13624 echo "Prototype: $try" ;;
13627 *) case "$usethreads" in
13628 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13635 *) getgrgid_r_proto=0
13639 : see if getgrnam_r exists
13640 set getgrnam_r d_getgrnam_r
13642 case "$d_getgrnam_r" in
13644 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13645 case "$d_getgrnam_r_proto:$usethreads" in
13646 ":define") d_getgrnam_r_proto=define
13647 set d_getgrnam_r_proto getgrnam_r $hdrs
13651 case "$d_getgrnam_r_proto" in
13653 case "$getgrnam_r_proto" in
13654 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13655 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13657 case "$getgrnam_r_proto" in
13658 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13659 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13661 case "$getgrnam_r_proto" in
13662 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13663 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13665 case "$getgrnam_r_proto" in
13666 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13667 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13669 case "$getgrnam_r_proto" in
13670 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13671 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13673 case "$getgrnam_r_proto" in
13674 ''|0) d_getgrnam_r=undef
13676 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13677 * ) case "$getgrnam_r_proto" in
13678 REENTRANT_PROTO*) ;;
13679 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13681 echo "Prototype: $try" ;;
13684 *) case "$usethreads" in
13685 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13692 *) getgrnam_r_proto=0
13696 : see if gethostbyaddr exists
13697 set gethostbyaddr d_gethbyaddr
13700 : see if gethostbyname exists
13701 set gethostbyname d_gethbyname
13704 : see if gethostent exists
13705 set gethostent d_gethent
13708 : see how we will look up host name
13711 if set gethostname val -f d_gethname; eval $csym; $val; then
13712 echo 'gethostname() found.' >&4
13713 d_gethname="$define"
13716 if set uname val -f d_uname; eval $csym; $val; then
13719 uname() was found, but you're running xenix, and older versions of xenix
13720 have a broken uname(). If you don't really know whether your xenix is old
13721 enough to have a broken system call, use the default answer.
13726 "$define") dflt=n;;
13728 rp='Is your uname() broken?'
13731 n*) d_uname="$define"; call=uname;;
13734 echo 'uname() found.' >&4
13741 case "$d_gethname" in
13742 '') d_gethname="$undef";;
13745 '') d_uname="$undef";;
13747 case "$d_uname$d_gethname" in
13752 Every now and then someone has a $call() that lies about the hostname
13753 but can't be fixed for political or economic reasons. If you wish, I can
13754 pretend $call() isn't there and maybe compute hostname at run-time
13755 thanks to the '$phostname' command.
13758 rp="Shall I ignore $call() from now on?"
13761 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13764 case "$phostname" in
13765 '') aphostname='';;
13766 *) case "$aphostname" in
13768 *) set X $phostname
13772 file=`./loc $file $file $pth`
13773 aphostname=`echo $file $*`
13778 case "$d_uname$d_gethname" in
13781 case "$phostname" in
13783 echo "There will be no way for $package to get your hostname." >&4;;
13785 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13789 case "$d_phostname" in
13790 '') d_phostname="$undef";;
13793 : see if gethostbyaddr_r exists
13794 set gethostbyaddr_r d_gethostbyaddr_r
13796 case "$d_gethostbyaddr_r" in
13798 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13799 case "$d_gethostbyaddr_r_proto:$usethreads" in
13800 ":define") d_gethostbyaddr_r_proto=define
13801 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13805 case "$d_gethostbyaddr_r_proto" in
13807 case "$gethostbyaddr_r_proto" in
13808 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13809 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13811 case "$gethostbyaddr_r_proto" in
13812 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13813 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13815 case "$gethostbyaddr_r_proto" in
13816 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13817 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13819 case "$gethostbyaddr_r_proto" in
13820 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13821 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13823 case "$gethostbyaddr_r_proto" in
13824 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13825 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13827 case "$gethostbyaddr_r_proto" in
13828 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13829 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13831 case "$gethostbyaddr_r_proto" in
13832 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13833 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13835 case "$gethostbyaddr_r_proto" in
13836 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13837 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13839 case "$gethostbyaddr_r_proto" in
13840 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13841 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13843 case "$gethostbyaddr_r_proto" in
13844 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13845 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13847 case "$gethostbyaddr_r_proto" in
13848 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13849 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13851 case "$gethostbyaddr_r_proto" in
13852 ''|0) d_gethostbyaddr_r=undef
13853 gethostbyaddr_r_proto=0
13854 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13855 * ) case "$gethostbyaddr_r_proto" in
13856 REENTRANT_PROTO*) ;;
13857 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13859 echo "Prototype: $try" ;;
13862 *) case "$usethreads" in
13863 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13865 d_gethostbyaddr_r=undef
13866 gethostbyaddr_r_proto=0
13870 *) gethostbyaddr_r_proto=0
13874 : see if gethostbyname_r exists
13875 set gethostbyname_r d_gethostbyname_r
13877 case "$d_gethostbyname_r" in
13879 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13880 case "$d_gethostbyname_r_proto:$usethreads" in
13881 ":define") d_gethostbyname_r_proto=define
13882 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13886 case "$d_gethostbyname_r_proto" in
13888 case "$gethostbyname_r_proto" in
13889 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13890 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13892 case "$gethostbyname_r_proto" in
13893 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13894 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13896 case "$gethostbyname_r_proto" in
13897 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13898 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13900 case "$gethostbyname_r_proto" in
13901 ''|0) d_gethostbyname_r=undef
13902 gethostbyname_r_proto=0
13903 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13904 * ) case "$gethostbyname_r_proto" in
13905 REENTRANT_PROTO*) ;;
13906 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13908 echo "Prototype: $try" ;;
13911 *) case "$usethreads" in
13912 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13914 d_gethostbyname_r=undef
13915 gethostbyname_r_proto=0
13919 *) gethostbyname_r_proto=0
13923 : see if gethostent_r exists
13924 set gethostent_r d_gethostent_r
13926 case "$d_gethostent_r" in
13928 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13929 case "$d_gethostent_r_proto:$usethreads" in
13930 ":define") d_gethostent_r_proto=define
13931 set d_gethostent_r_proto gethostent_r $hdrs
13935 case "$d_gethostent_r_proto" in
13937 case "$gethostent_r_proto" in
13938 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13939 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13941 case "$gethostent_r_proto" in
13942 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13943 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13945 case "$gethostent_r_proto" in
13946 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13947 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13949 case "$gethostent_r_proto" in
13950 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13951 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
13953 case "$gethostent_r_proto" in
13954 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13955 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
13957 case "$gethostent_r_proto" in
13958 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13959 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
13961 case "$gethostent_r_proto" in
13962 ''|0) d_gethostent_r=undef
13963 gethostent_r_proto=0
13964 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13965 * ) case "$gethostent_r_proto" in
13966 REENTRANT_PROTO*) ;;
13967 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13969 echo "Prototype: $try" ;;
13972 *) case "$usethreads" in
13973 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13975 d_gethostent_r=undef
13976 gethostent_r_proto=0
13980 *) gethostent_r_proto=0
13984 : see if prototypes for various gethostxxx netdb.h functions are available
13986 set d_gethostprotos gethostent $i_netdb netdb.h
13989 : see if getitimer exists
13990 set getitimer d_getitimer
13993 : see if getlogin exists
13994 set getlogin d_getlogin
13997 : see if getlogin_r exists
13998 set getlogin_r d_getlogin_r
14000 case "$d_getlogin_r" in
14002 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14003 case "$d_getlogin_r_proto:$usethreads" in
14004 ":define") d_getlogin_r_proto=define
14005 set d_getlogin_r_proto getlogin_r $hdrs
14009 case "$d_getlogin_r_proto" in
14011 case "$getlogin_r_proto" in
14012 ''|0) try='int getlogin_r(char*, size_t);'
14013 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14015 case "$getlogin_r_proto" in
14016 ''|0) try='int getlogin_r(char*, int);'
14017 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14019 case "$getlogin_r_proto" in
14020 ''|0) try='char* getlogin_r(char*, size_t);'
14021 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14023 case "$getlogin_r_proto" in
14024 ''|0) try='char* getlogin_r(char*, int);'
14025 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14027 case "$getlogin_r_proto" in
14028 ''|0) d_getlogin_r=undef
14030 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14031 * ) case "$getlogin_r_proto" in
14032 REENTRANT_PROTO*) ;;
14033 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14035 echo "Prototype: $try" ;;
14038 *) case "$usethreads" in
14039 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14046 *) getlogin_r_proto=0
14050 : see if getmnt exists
14051 set getmnt d_getmnt
14054 : see if getmntent exists
14055 set getmntent d_getmntent
14058 : see if getnameinfo exists
14059 set getnameinfo d_getnameinfo
14062 : see if getnetbyaddr exists
14063 set getnetbyaddr d_getnbyaddr
14066 : see if getnetbyname exists
14067 set getnetbyname d_getnbyname
14070 : see if getnetent exists
14071 set getnetent d_getnent
14074 : see if getnetbyaddr_r exists
14075 set getnetbyaddr_r d_getnetbyaddr_r
14077 case "$d_getnetbyaddr_r" in
14079 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14080 case "$d_getnetbyaddr_r_proto:$usethreads" in
14081 ":define") d_getnetbyaddr_r_proto=define
14082 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14086 case "$d_getnetbyaddr_r_proto" in
14088 case "$getnetbyaddr_r_proto" in
14089 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14090 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14092 case "$getnetbyaddr_r_proto" in
14093 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14094 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14096 case "$getnetbyaddr_r_proto" in
14097 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14098 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14100 case "$getnetbyaddr_r_proto" in
14101 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14102 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14104 case "$getnetbyaddr_r_proto" in
14105 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14106 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14108 case "$getnetbyaddr_r_proto" in
14109 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14110 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14112 case "$getnetbyaddr_r_proto" in
14113 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14114 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14116 case "$getnetbyaddr_r_proto" in
14117 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14118 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14120 case "$getnetbyaddr_r_proto" in
14121 ''|0) d_getnetbyaddr_r=undef
14122 getnetbyaddr_r_proto=0
14123 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14124 * ) case "$getnetbyaddr_r_proto" in
14125 REENTRANT_PROTO*) ;;
14126 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14128 echo "Prototype: $try" ;;
14131 *) case "$usethreads" in
14132 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14134 d_getnetbyaddr_r=undef
14135 getnetbyaddr_r_proto=0
14139 *) getnetbyaddr_r_proto=0
14143 : see if getnetbyname_r exists
14144 set getnetbyname_r d_getnetbyname_r
14146 case "$d_getnetbyname_r" in
14148 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14149 case "$d_getnetbyname_r_proto:$usethreads" in
14150 ":define") d_getnetbyname_r_proto=define
14151 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14155 case "$d_getnetbyname_r_proto" in
14157 case "$getnetbyname_r_proto" in
14158 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14159 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14161 case "$getnetbyname_r_proto" in
14162 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14163 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14165 case "$getnetbyname_r_proto" in
14166 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14167 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14169 case "$getnetbyname_r_proto" in
14170 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14171 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14173 case "$getnetbyname_r_proto" in
14174 ''|0) d_getnetbyname_r=undef
14175 getnetbyname_r_proto=0
14176 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14177 * ) case "$getnetbyname_r_proto" in
14178 REENTRANT_PROTO*) ;;
14179 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14181 echo "Prototype: $try" ;;
14184 *) case "$usethreads" in
14185 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14187 d_getnetbyname_r=undef
14188 getnetbyname_r_proto=0
14192 *) getnetbyname_r_proto=0
14196 : see if getnetent_r exists
14197 set getnetent_r d_getnetent_r
14199 case "$d_getnetent_r" in
14201 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14202 case "$d_getnetent_r_proto:$usethreads" in
14203 ":define") d_getnetent_r_proto=define
14204 set d_getnetent_r_proto getnetent_r $hdrs
14208 case "$d_getnetent_r_proto" in
14210 case "$getnetent_r_proto" in
14211 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14212 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14214 case "$getnetent_r_proto" in
14215 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14216 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14218 case "$getnetent_r_proto" in
14219 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14220 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14222 case "$getnetent_r_proto" in
14223 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14224 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14226 case "$getnetent_r_proto" in
14227 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14228 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14230 case "$getnetent_r_proto" in
14231 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14232 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14234 case "$getnetent_r_proto" in
14235 ''|0) d_getnetent_r=undef
14236 getnetent_r_proto=0
14237 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14238 * ) case "$getnetent_r_proto" in
14239 REENTRANT_PROTO*) ;;
14240 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14242 echo "Prototype: $try" ;;
14245 *) case "$usethreads" in
14246 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14248 d_getnetent_r=undef
14249 getnetent_r_proto=0
14253 *) getnetent_r_proto=0
14257 : see if prototypes for various getnetxxx netdb.h functions are available
14259 set d_getnetprotos getnetent $i_netdb netdb.h
14262 : see if getpagesize exists
14263 set getpagesize d_getpagsz
14266 : Optional checks for getprotobyname and getprotobynumber
14268 : see if getprotobyname exists
14269 set getprotobyname d_getpbyname
14272 : see if getprotobynumber exists
14273 set getprotobynumber d_getpbynumber
14276 : see if getprotoent exists
14277 set getprotoent d_getpent
14280 : see if getpgid exists
14281 set getpgid d_getpgid
14284 : see if getpgrp2 exists
14285 set getpgrp2 d_getpgrp2
14288 : see if getppid exists
14289 set getppid d_getppid
14292 : see if getpriority exists
14293 set getpriority d_getprior
14296 : see if getprotobyname_r exists
14297 set getprotobyname_r d_getprotobyname_r
14299 case "$d_getprotobyname_r" in
14301 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14302 case "$d_getprotobyname_r_proto:$usethreads" in
14303 ":define") d_getprotobyname_r_proto=define
14304 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14308 case "$d_getprotobyname_r_proto" in
14310 case "$getprotobyname_r_proto" in
14311 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14312 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14314 case "$getprotobyname_r_proto" in
14315 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14316 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14318 case "$getprotobyname_r_proto" in
14319 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14320 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14322 case "$getprotobyname_r_proto" in
14323 ''|0) d_getprotobyname_r=undef
14324 getprotobyname_r_proto=0
14325 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14326 * ) case "$getprotobyname_r_proto" in
14327 REENTRANT_PROTO*) ;;
14328 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14330 echo "Prototype: $try" ;;
14333 *) case "$usethreads" in
14334 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14336 d_getprotobyname_r=undef
14337 getprotobyname_r_proto=0
14341 *) getprotobyname_r_proto=0
14345 : see if getprotobynumber_r exists
14346 set getprotobynumber_r d_getprotobynumber_r
14348 case "$d_getprotobynumber_r" in
14350 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14351 case "$d_getprotobynumber_r_proto:$usethreads" in
14352 ":define") d_getprotobynumber_r_proto=define
14353 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14357 case "$d_getprotobynumber_r_proto" in
14359 case "$getprotobynumber_r_proto" in
14360 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14361 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14363 case "$getprotobynumber_r_proto" in
14364 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14365 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14367 case "$getprotobynumber_r_proto" in
14368 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14369 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14371 case "$getprotobynumber_r_proto" in
14372 ''|0) d_getprotobynumber_r=undef
14373 getprotobynumber_r_proto=0
14374 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14375 * ) case "$getprotobynumber_r_proto" in
14376 REENTRANT_PROTO*) ;;
14377 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14379 echo "Prototype: $try" ;;
14382 *) case "$usethreads" in
14383 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14385 d_getprotobynumber_r=undef
14386 getprotobynumber_r_proto=0
14390 *) getprotobynumber_r_proto=0
14394 : see if getprotoent_r exists
14395 set getprotoent_r d_getprotoent_r
14397 case "$d_getprotoent_r" in
14399 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14400 case "$d_getprotoent_r_proto:$usethreads" in
14401 ":define") d_getprotoent_r_proto=define
14402 set d_getprotoent_r_proto getprotoent_r $hdrs
14406 case "$d_getprotoent_r_proto" in
14408 case "$getprotoent_r_proto" in
14409 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14410 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14412 case "$getprotoent_r_proto" in
14413 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14414 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14416 case "$getprotoent_r_proto" in
14417 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14418 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14420 case "$getprotoent_r_proto" in
14421 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14422 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14424 case "$getprotoent_r_proto" in
14425 ''|0) d_getprotoent_r=undef
14426 getprotoent_r_proto=0
14427 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14428 * ) case "$getprotoent_r_proto" in
14429 REENTRANT_PROTO*) ;;
14430 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14432 echo "Prototype: $try" ;;
14435 *) case "$usethreads" in
14436 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14438 d_getprotoent_r=undef
14439 getprotoent_r_proto=0
14443 *) getprotoent_r_proto=0
14447 : see if prototypes for various getprotoxxx netdb.h functions are available
14449 set d_getprotoprotos getprotoent $i_netdb netdb.h
14452 : see if getprpwnam exists
14453 set getprpwnam d_getprpwnam
14456 : see if getpwent exists
14457 set getpwent d_getpwent
14460 : see if getpwent_r exists
14461 set getpwent_r d_getpwent_r
14463 case "$d_getpwent_r" in
14465 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14466 case "$d_getpwent_r_proto:$usethreads" in
14467 ":define") d_getpwent_r_proto=define
14468 set d_getpwent_r_proto getpwent_r $hdrs
14472 case "$d_getpwent_r_proto" in
14474 case "$getpwent_r_proto" in
14475 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14476 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14478 case "$getpwent_r_proto" in
14479 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14480 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14482 case "$getpwent_r_proto" in
14483 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14484 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14486 case "$getpwent_r_proto" in
14487 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14488 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14490 case "$getpwent_r_proto" in
14491 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14492 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14494 case "$getpwent_r_proto" in
14495 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14496 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14498 case "$getpwent_r_proto" in
14499 ''|0) d_getpwent_r=undef
14501 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14502 * ) case "$getpwent_r_proto" in
14503 REENTRANT_PROTO*) ;;
14504 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14506 echo "Prototype: $try" ;;
14509 *) case "$usethreads" in
14510 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14517 *) getpwent_r_proto=0
14521 : see if getpwnam_r exists
14522 set getpwnam_r d_getpwnam_r
14524 case "$d_getpwnam_r" in
14526 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14527 case "$d_getpwnam_r_proto:$usethreads" in
14528 ":define") d_getpwnam_r_proto=define
14529 set d_getpwnam_r_proto getpwnam_r $hdrs
14533 case "$d_getpwnam_r_proto" in
14535 case "$getpwnam_r_proto" in
14536 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14537 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14539 case "$getpwnam_r_proto" in
14540 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14541 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14543 case "$getpwnam_r_proto" in
14544 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14545 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14547 case "$getpwnam_r_proto" in
14548 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14549 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14551 case "$getpwnam_r_proto" in
14552 ''|0) d_getpwnam_r=undef
14554 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14555 * ) case "$getpwnam_r_proto" in
14556 REENTRANT_PROTO*) ;;
14557 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14559 echo "Prototype: $try" ;;
14562 *) case "$usethreads" in
14563 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14570 *) getpwnam_r_proto=0
14574 : see if getpwuid_r exists
14575 set getpwuid_r d_getpwuid_r
14577 case "$d_getpwuid_r" in
14579 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14580 case "$d_getpwuid_r_proto:$usethreads" in
14581 ":define") d_getpwuid_r_proto=define
14582 set d_getpwuid_r_proto getpwuid_r $hdrs
14586 case "$d_getpwuid_r_proto" in
14588 case "$getpwuid_r_proto" in
14589 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14590 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14592 case "$getpwuid_r_proto" in
14593 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14594 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14596 case "$getpwuid_r_proto" in
14597 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14598 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14600 case "$getpwuid_r_proto" in
14601 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14602 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14604 case "$getpwuid_r_proto" in
14605 ''|0) d_getpwuid_r=undef
14607 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14608 * ) case "$getpwuid_r_proto" in
14609 REENTRANT_PROTO*) ;;
14610 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14612 echo "Prototype: $try" ;;
14615 *) case "$usethreads" in
14616 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14623 *) getpwuid_r_proto=0
14627 : Optional checks for getsbyname and getsbyport
14629 : see if getservbyname exists
14630 set getservbyname d_getsbyname
14633 : see if getservbyport exists
14634 set getservbyport d_getsbyport
14637 : see if getservent exists
14638 set getservent d_getsent
14641 : see if getservbyname_r exists
14642 set getservbyname_r d_getservbyname_r
14644 case "$d_getservbyname_r" in
14646 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14647 case "$d_getservbyname_r_proto:$usethreads" in
14648 ":define") d_getservbyname_r_proto=define
14649 set d_getservbyname_r_proto getservbyname_r $hdrs
14653 case "$d_getservbyname_r_proto" in
14655 case "$getservbyname_r_proto" in
14656 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14657 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14659 case "$getservbyname_r_proto" in
14660 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14661 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14663 case "$getservbyname_r_proto" in
14664 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14665 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14667 case "$getservbyname_r_proto" in
14668 ''|0) d_getservbyname_r=undef
14669 getservbyname_r_proto=0
14670 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14671 * ) case "$getservbyname_r_proto" in
14672 REENTRANT_PROTO*) ;;
14673 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14675 echo "Prototype: $try" ;;
14678 *) case "$usethreads" in
14679 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14681 d_getservbyname_r=undef
14682 getservbyname_r_proto=0
14686 *) getservbyname_r_proto=0
14690 : see if getservbyport_r exists
14691 set getservbyport_r d_getservbyport_r
14693 case "$d_getservbyport_r" in
14695 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14696 case "$d_getservbyport_r_proto:$usethreads" in
14697 ":define") d_getservbyport_r_proto=define
14698 set d_getservbyport_r_proto getservbyport_r $hdrs
14702 case "$d_getservbyport_r_proto" in
14704 case "$getservbyport_r_proto" in
14705 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14706 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14708 case "$getservbyport_r_proto" in
14709 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14710 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14712 case "$getservbyport_r_proto" in
14713 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14714 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14716 case "$getservbyport_r_proto" in
14717 ''|0) d_getservbyport_r=undef
14718 getservbyport_r_proto=0
14719 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14720 * ) case "$getservbyport_r_proto" in
14721 REENTRANT_PROTO*) ;;
14722 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14724 echo "Prototype: $try" ;;
14727 *) case "$usethreads" in
14728 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14730 d_getservbyport_r=undef
14731 getservbyport_r_proto=0
14735 *) getservbyport_r_proto=0
14739 : see if getservent_r exists
14740 set getservent_r d_getservent_r
14742 case "$d_getservent_r" in
14744 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14745 case "$d_getservent_r_proto:$usethreads" in
14746 ":define") d_getservent_r_proto=define
14747 set d_getservent_r_proto getservent_r $hdrs
14751 case "$d_getservent_r_proto" in
14753 case "$getservent_r_proto" in
14754 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14755 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14757 case "$getservent_r_proto" in
14758 ''|0) try='int getservent_r(struct servent*, char*, int);'
14759 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14761 case "$getservent_r_proto" in
14762 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14763 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14765 case "$getservent_r_proto" in
14766 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14767 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14769 case "$getservent_r_proto" in
14770 ''|0) d_getservent_r=undef
14771 getservent_r_proto=0
14772 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14773 * ) case "$getservent_r_proto" in
14774 REENTRANT_PROTO*) ;;
14775 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14777 echo "Prototype: $try" ;;
14780 *) case "$usethreads" in
14781 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14783 d_getservent_r=undef
14784 getservent_r_proto=0
14788 *) getservent_r_proto=0
14792 : see if prototypes for various getservxxx netdb.h functions are available
14794 set d_getservprotos getservent $i_netdb netdb.h
14797 : see if getspnam exists
14798 set getspnam d_getspnam
14801 : see if this is a shadow.h system
14802 set shadow.h i_shadow
14805 : see if getspnam_r exists
14806 set getspnam_r d_getspnam_r
14808 case "$d_getspnam_r" in
14810 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14811 case "$d_getspnam_r_proto:$usethreads" in
14812 ":define") d_getspnam_r_proto=define
14813 set d_getspnam_r_proto getspnam_r $hdrs
14817 case "$d_getspnam_r_proto" in
14819 case "$getspnam_r_proto" in
14820 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14821 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14823 case "$getspnam_r_proto" in
14824 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14825 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14827 case "$getspnam_r_proto" in
14828 ''|0) d_getspnam_r=undef
14830 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14831 * ) case "$getspnam_r_proto" in
14832 REENTRANT_PROTO*) ;;
14833 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14835 echo "Prototype: $try" ;;
14838 *) case "$usethreads" in
14839 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14846 *) getspnam_r_proto=0
14850 : see if gettimeofday or ftime exists
14851 set gettimeofday d_gettimeod
14853 case "$d_gettimeod" in
14859 val="$undef"; set d_ftime; eval $setvar
14862 case "$d_gettimeod$d_ftime" in
14865 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14869 : see if gmtime_r exists
14870 set gmtime_r d_gmtime_r
14872 case "$d_gmtime_r" in
14874 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14875 case "$d_gmtime_r_proto:$usethreads" in
14876 ":define") d_gmtime_r_proto=define
14877 set d_gmtime_r_proto gmtime_r $hdrs
14881 case "$d_gmtime_r_proto" in
14883 case "$gmtime_r_proto" in
14884 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14885 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
14887 case "$gmtime_r_proto" in
14888 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14889 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
14891 case "$gmtime_r_proto" in
14892 ''|0) d_gmtime_r=undef
14894 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14895 * ) case "$gmtime_r_proto" in
14896 REENTRANT_PROTO*) ;;
14897 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14899 echo "Prototype: $try" ;;
14902 *) case "$usethreads" in
14903 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14910 *) gmtime_r_proto=0
14914 : see if hasmntopt exists
14915 set hasmntopt d_hasmntopt
14918 : see if this is a netinet/in.h or sys/in.h system
14919 set netinet/in.h i_niin sys/in.h i_sysin
14922 : see if arpa/inet.h has to be included
14923 set arpa/inet.h i_arpainet
14926 : see if htonl --and friends-- exists
14931 : Maybe they are macros.
14934 $cat >htonl.c <<EOM
14936 #include <sys/types.h>
14937 #$i_niin I_NETINET_IN
14939 #$i_arpainet I_ARPA_INET
14940 #ifdef I_NETINET_IN
14941 #include <netinet/in.h>
14944 #include <sys/in.h>
14947 #include <arpa/inet.h>
14950 printf("Defined as a macro.");
14953 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14954 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14956 echo "But it seems to be defined as a macro." >&4
14964 : see if ilogbl exists
14965 set ilogbl d_ilogbl
14970 if set index val -f; eval $csym; $val; then
14971 if set strchr val -f d_strchr; eval $csym; $val; then
14972 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14975 echo "strchr() found." >&4
14979 echo "index() found." >&4
14984 echo "index() found." >&4
14987 if set strchr val -f d_strchr; eval $csym; $val; then
14990 echo "strchr() found." >&4
14992 echo "No index() or strchr() found!" >&4
14997 set d_strchr; eval $setvar
14999 set d_index; eval $setvar
15001 : check whether inet_aton exists
15002 set inet_aton d_inetaton
15005 : see if inet_ntop exists
15006 set inet_ntop d_inetntop
15009 : see if inet_pton exists
15010 set inet_pton d_inetpton
15015 $cat >isascii.c <<EOCP
15018 #$i_stdlib I_STDLIB
15020 #include <stdlib.h>
15031 if eval $compile; then
15032 echo "isascii() found." >&4
15035 echo "isascii() NOT found." >&4
15044 $cat >isblank.c <<'EOCP'
15055 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15056 echo "isblank() found." >&4
15059 echo "isblank() NOT found." >&4
15066 : see if isfinite exists
15067 set isfinite d_isfinite
15070 : see if isinf exists
15074 : see if isnan exists
15078 : see if isnanl exists
15079 set isnanl d_isnanl
15082 : see if killpg exists
15083 set killpg d_killpg
15086 : see if lchown exists
15088 $cat > try.c <<'EOCP'
15089 /* System header to define __stub macros and hopefully few prototypes,
15090 which can conflict with char lchown(); below. */
15091 #include <assert.h>
15092 /* Override any gcc2 internal prototype to avoid an error. */
15093 /* We use char because int might match the return type of a gcc2
15094 builtin and then its argument prototype would still apply. */
15097 /* The GNU C library defines this for functions which it implements
15098 to always fail with ENOSYS. Some functions are actually named
15099 something starting with __ and the normal name is an alias. */
15100 #if defined (__stub_lchown) || defined (__stub___lchown)
15108 if eval $compile; then
15109 $echo "lchown() found." >&4
15112 $echo "lchown() NOT found." >&4
15118 : See if number of significant digits in a double precision number is known
15120 $cat >ldbl_dig.c <<EOM
15121 #$i_limits I_LIMITS
15124 #include <limits.h>
15130 printf("Contains LDBL_DIG");
15133 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15134 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15135 echo "LDBL_DIG found." >&4
15138 echo "LDBL_DIG NOT found." >&4
15145 : see if this is a math.h system
15149 : check to see if math.h defines _LIB_VERSION
15150 d_libm_lib_version="$undef"
15154 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15156 #include <unistd.h>
15158 int main (int argc, char *argv[])
15160 printf ("%d\n", _LIB_VERSION);
15165 if eval $compile; then
15167 echo "Yes, it does ($foo)" >&4
15168 d_libm_lib_version="$define"
15170 echo "No, it does not (probably harmless)" >&4
15177 : see if link exists
15181 : see if localtime_r exists
15182 set localtime_r d_localtime_r
15184 case "$d_localtime_r" in
15186 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15187 case "$d_localtime_r_proto:$usethreads" in
15188 ":define") d_localtime_r_proto=define
15189 set d_localtime_r_proto localtime_r $hdrs
15193 case "$d_localtime_r_proto" in
15195 case "$localtime_r_proto" in
15196 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15197 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15199 case "$localtime_r_proto" in
15200 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15201 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15203 case "$localtime_r_proto" in
15204 ''|0) d_localtime_r=undef
15205 localtime_r_proto=0
15206 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15207 * ) case "$localtime_r_proto" in
15208 REENTRANT_PROTO*) ;;
15209 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15211 echo "Prototype: $try" ;;
15214 *) case "$usethreads" in
15215 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15217 d_localtime_r=undef
15218 localtime_r_proto=0
15222 *) localtime_r_proto=0
15226 : see if localtime_r calls tzset
15227 case "$localtime_r_proto" in
15230 /* Does our libc's localtime_r call tzset ?
15231 * return 0 if so, 1 otherwise.
15233 #$i_systypes I_SYS_TYPES
15234 #$i_unistd I_UNISTD
15236 #$i_stdlib I_STDLIB
15237 #$i_string I_STRING
15238 #$i_malloc I_MALLOC
15240 # include <sys/types.h>
15243 # include <unistd.h>
15249 #include <stdlib.h>
15252 # include <string.h>
15254 # include <strings.h>
15257 # include <malloc.h>
15261 time_t t = time(0L);
15262 char w_tz[]="TZ" "=GMT+5",
15263 e_tz[]="TZ" "=GMT-5",
15264 *tz_e = (char*)malloc(16),
15265 *tz_w = (char*)malloc(16);
15266 struct tm tm_e, tm_w;
15267 memset(&tm_e,'\0',sizeof(struct tm));
15268 memset(&tm_w,'\0',sizeof(struct tm));
15273 localtime_r(&t, &tm_e);
15276 localtime_r(&t, &tm_w);
15278 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15284 if eval $compile; then
15285 if $run ./try; then
15286 d_localtime_r_needs_tzset=undef;
15288 d_localtime_r_needs_tzset=define;
15291 d_localtime_r_needs_tzset=undef;
15295 d_localtime_r_needs_tzset=undef;
15300 : see if localeconv exists
15301 set localeconv d_locconv
15304 : see if lockf exists
15308 : see if prototype for lseek is available
15310 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15313 : see if lstat exists
15317 : see if madvise exists
15318 set madvise d_madvise
15321 : see if malloc_size exists
15322 set malloc_size d_malloc_size
15325 : see if malloc_size_good exists
15326 set malloc_good_size d_malloc_good_size
15329 : see if mblen exists
15333 : see if mbstowcs exists
15334 set mbstowcs d_mbstowcs
15337 : see if mbtowc exists
15338 set mbtowc d_mbtowc
15341 : see if memchr exists
15342 set memchr d_memchr
15345 : see if memcmp exists
15346 set memcmp d_memcmp
15349 : see if memcpy exists
15350 set memcpy d_memcpy
15353 : see if memmove exists
15354 set memmove d_memmove
15357 : see if memset exists
15358 set memset d_memset
15361 : see if mkdir exists
15365 : see if mkdtemp exists
15366 set mkdtemp d_mkdtemp
15369 : see if mkfifo exists
15370 set mkfifo d_mkfifo
15373 : see if mkstemp exists
15374 set mkstemp d_mkstemp
15377 : see if mkstemps exists
15378 set mkstemps d_mkstemps
15381 : see if mktime exists
15382 set mktime d_mktime
15385 : see if this is a sys/mman.h system
15386 set sys/mman.h i_sysmman
15389 : see if mmap exists
15392 : see what shmat returns
15393 : default to something harmless
15395 case "$i_sysmman$d_mmap" in
15397 $cat >mmap.c <<'END'
15398 #include <sys/mman.h>
15401 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15406 echo "and it returns ($mmaptype)." >&4
15412 : see if sqrtl exists
15416 : see if scalbnl exists
15417 set scalbnl d_scalbnl
15420 : see if modfl exists
15424 : see if prototype for modfl is available
15426 set d_modflproto modfl $i_math math.h
15429 d_modfl_pow32_bug="$undef"
15431 case "$d_longdbl$d_modfl" in
15434 Checking to see whether your modfl() is okay for large values...
15440 if $test "X$d_modflproto" != "X$define"; then
15441 $cat >>try.c <<EOCP
15442 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15443 long double modfl (long double, long double *);
15446 $cat >>try.c <<EOCP
15448 long double nv = 4294967303.15;
15454 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15458 case "$osname:$gccversion" in
15459 aix:) saveccflags="$ccflags"
15460 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15463 if eval $compile; then
15466 *" 4294967303.150000 1.150000 4294967302.000000")
15467 echo >&4 "Your modfl() is broken for large values."
15468 d_modfl_pow32_bug="$define"
15470 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15474 *" 4294967303.150000 0.150000 4294967303.000000")
15475 echo >&4 "Your modfl() seems okay for large values."
15477 *) echo >&4 "I don't understand your modfl() at all."
15483 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15486 case "$osname:$gccversion" in
15487 aix:) ccflags="$saveccflags" ;; # restore
15492 if $test "$uselongdouble" = "$define"; then
15494 if $test "$d_sqrtl" != "$define"; then
15495 message="$message sqrtl"
15497 if $test "$d_modfl" != "$define"; then
15498 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15499 echo "You have both aintl and copysignl, so I can emulate modfl."
15501 message="$message modfl"
15504 if $test "$d_frexpl" != "$define"; then
15505 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15506 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15508 message="$message frexpl"
15512 if $test "$message" != ""; then
15515 *** You requested the use of long doubles but you do not seem to have
15516 *** the following mathematical functions needed for long double support:
15518 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15519 *** Cannot continue, aborting.
15527 : see if mprotect exists
15528 set mprotect d_mprotect
15531 : see if msgctl exists
15532 set msgctl d_msgctl
15535 : see if msgget exists
15536 set msgget d_msgget
15539 : see if msgsnd exists
15540 set msgsnd d_msgsnd
15543 : see if msgrcv exists
15544 set msgrcv d_msgrcv
15547 : see how much of the 'msg*(2)' library is present.
15550 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15551 *"$undef"*) h_msg=false;;
15555 case "`ipcs 2>&1`" in
15556 "SVID messages"*"not configured"*)
15557 echo "Your $osname does not have the msg*(2) configured." >&4
15560 set msgctl d_msgctl
15562 set msgget d_msgget
15564 set msgsnd d_msgsnd
15566 set msgrcv d_msgrcv
15572 : we could also check for sys/ipc.h ...
15573 if $h_msg && $test `./findhdr sys/msg.h`; then
15574 echo "You have the full msg*(2) library." >&4
15577 echo "You don't have the full msg*(2) library." >&4
15583 : Check for msghdr_s
15585 echo "Checking to see if your system supports struct msghdr..." >&4
15586 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15588 case "$d_msghdr_s" in
15589 "$define") echo "Yes, it does." ;;
15590 *) echo "No, it doesn't." ;;
15594 : see if msync exists
15598 : see if munmap exists
15599 set munmap d_munmap
15602 : see if nice exists
15606 : see if this is a langinfo.h system
15607 set langinfo.h i_langinfo
15610 : see if nl_langinfo exists
15611 set nl_langinfo d_nl_langinfo
15614 : check for volatile keyword
15616 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15617 $cat >try.c <<'EOCP'
15620 typedef struct _goo_struct goo_struct;
15621 goo_struct * volatile goo = ((goo_struct *)0);
15622 struct _goo_struct {
15627 typedef unsigned short foo_t;
15628 char *volatile foo;
15630 volatile foo_t blech;
15634 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15636 echo "Yup, it does."
15639 echo "Nope, it doesn't."
15645 : Check basic sizes
15647 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15649 case "$use64bitint:$d_quad:$quadtype" in
15652 uvtype="$uquadtype"
15657 uvtype="unsigned long"
15663 case "$uselongdouble:$d_longdbl" in
15665 nvtype="long double"
15666 nvsize=$longdblsize
15673 $echo "(IV will be "$ivtype", $ivsize bytes)"
15674 $echo "(UV will be "$uvtype", $uvsize bytes)"
15675 $echo "(NV will be "$nvtype", $nvsize bytes)"
15678 #$i_inttypes I_INTTYPES
15680 #include <inttypes.h>
15685 int8_t i = INT8_MAX;
15686 uint8_t u = UINT8_MAX;
15687 printf("int8_t\n");
15690 int16_t i = INT16_MAX;
15691 uint16_t u = UINT16_MAX;
15692 printf("int16_t\n");
15695 int32_t i = INT32_MAX;
15696 uint32_t u = UINT32_MAX;
15697 printf("int32_t\n");
15702 i8type="signed char"
15703 u8type="unsigned char"
15708 '') case "$shortsize" in
15710 u16type="unsigned short"
15718 '') set try -DINT16
15719 if eval $compile; then
15720 case "`$run ./try`" in
15732 '') if $test $shortsize -ge 2; then
15734 u16type="unsigned short"
15742 '') case "$longsize" in
15744 u32type="unsigned long"
15748 *) case "$intsize" in
15750 u32type="unsigned int"
15760 '') set try -DINT32
15761 if eval $compile; then
15762 case "`$run ./try`" in
15774 '') if $test $intsize -ge 4; then
15776 u32type="unsigned int"
15784 '') case "$d_quad:$quadtype" in
15786 i64type="$quadtype"
15787 u64type="$uquadtype"
15795 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15796 : volatile so that the compiler has to store it out to memory.
15797 if test X"$d_volatile" = X"$define"; then
15802 #$i_stdlib I_STDLIB
15804 #include <stdlib.h>
15806 #include <sys/types.h>
15807 #include <signal.h>
15809 $volatile int bletched = 0;
15810 $signal_t blech(int s) { bletched = 1; }
15815 int n = 8 * $uvsize;
15818 signal(SIGFPE, blech);
15821 for (i = 0; i < n; i++) {
15822 u = u << 1 | ($uvtype)1;
15824 if (($uvtype)d != u)
15828 d = ($nvtype)(u - 1);
15829 if (($uvtype)d != (u - 1))
15836 printf("%d\n", ((i == n) ? -n : i));
15842 d_nv_preserves_uv="$undef"
15843 if eval $compile; then
15844 nv_preserves_uv_bits="`$run ./try`"
15846 case "$nv_preserves_uv_bits" in
15848 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15849 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15850 d_nv_preserves_uv="$define"
15852 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15853 d_nv_preserves_uv="$undef" ;;
15854 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15855 nv_preserves_uv_bits="0" ;;
15859 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15860 : volatile so that the compiler has to store it out to memory.
15861 if test X"$d_volatile" = X"$define"; then
15867 typedef $nvtype NV;
15874 while(count < 256) {
15875 $volatile NV up = value + 1.0;
15876 $volatile NV negated = -value;
15877 $volatile NV down = negated - 1.0;
15878 $volatile NV got_up = up - value;
15879 int up_good = got_up == 1.0;
15880 int got_down = down - negated;
15881 int down_good = got_down == -1.0;
15883 if (down_good != up_good) {
15885 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15886 up_good, (double) got_up, down_good, (double) got_down,
15887 count, (double) value);
15894 fputs("256.0", stdout);
15897 fputs("2.0", stdout);
15903 fputs("*", stdout);
15909 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15910 count, (double) value);
15916 nv_overflows_integers_at='0'
15917 if eval $compile; then
15923 The largest integer your NVs can preserve is equal to $xxx
15925 nv_overflows_integers_at="$xxx"
15928 Cannot determine the largest integer value your NVs can hold, unexpected output
15935 Cannot determine the largest integer value your NVs can hold
15942 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15943 : volatile so that the compiler has to store it out to memory.
15944 if test X"$d_volatile" = X"$define"; then
15949 #$i_stdlib I_STDLIB
15951 #include <stdlib.h>
15953 #$i_string I_STRING
15955 # include <string.h>
15957 # include <strings.h>
15959 #include <sys/types.h>
15960 #include <signal.h>
15962 $volatile int bletched = 0;
15963 $signal_t blech(int s) { bletched = 1; }
15966 int checkit($nvtype d, char *where) {
15967 unsigned char *p = (char *)&d;
15968 unsigned char *end = p + sizeof(d);
15978 printf("No - %s: 0x", where);
15980 printf ("%02X", *p++);
15985 int main(int argc, char **argv) {
15988 fail += checkit(d, "0.0");
15990 /* The compiler shouldn't be assuming that bletched is 0 */
15993 fail += checkit(d, "bleched");
15996 signal(SIGFPE, blech);
15999 /* Paranoia - the compiler should have no way of knowing that ANSI says
16000 that argv[argc] will always be NULL. Actually, if it did assume this it
16001 would be buggy, as this is C and main() can be called from elsewhere in
16003 d = argv[argc] ? 1 : 0;
16006 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16009 fail += checkit(d, "ternary");
16011 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16014 printf("No - memset doesn't give 0.0\n");
16015 /* This might just blow up: */
16016 printf("(gives %g)\n", d);
16022 printf("No - something bleched\n");
16027 printf("No - %d fail(s)\n", fail);
16036 d_nv_zero_is_allbits_zero="$undef"
16037 if eval $compile; then
16043 0.0 is represented as all bits zero in memory
16045 d_nv_zero_is_allbits_zero="$define"
16048 0.0 is not represented as all bits zero in memory
16050 d_nv_zero_is_allbits_zero="$undef"
16055 0.0 is not represented as all bits zero in memory
16057 d_nv_zero_is_allbits_zero="$undef"
16063 : check for off64_t
16065 echo "Checking to see if you have off64_t..." >&4
16067 #include <sys/types.h>
16068 #include <unistd.h>
16069 int main() { off64_t x = 7; }
16072 if eval $compile; then
16074 echo "You have off64_t."
16077 echo "You do not have off64_t."
16078 case "$lseeksize" in
16079 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16086 : how to create joinable pthreads
16087 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16089 echo "Checking what constant to use for creating joinable pthreads..." >&4
16090 $cat >try.c <<'EOCP'
16091 #include <pthread.h>
16093 int detachstate = JOINABLE;
16096 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16097 if eval $compile; then
16098 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16099 val="$undef" # Yes, undef.
16100 set d_old_pthread_create_joinable
16103 set old_pthread_create_joinable
16106 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16107 if eval $compile; then
16108 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16110 set d_old_pthread_create_joinable
16112 val=PTHREAD_CREATE_UNDETACHED
16113 set old_pthread_create_joinable
16116 set try -DJOINABLE=__UNDETACHED
16117 if eval $compile; then
16118 echo "You seem to use __UNDETACHED." >&4
16120 set d_old_pthread_create_joinable
16123 set old_pthread_create_joinable
16126 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16128 set d_old_pthread_create_joinable
16131 set old_pthread_create_joinable
16138 d_old_pthread_create_joinable="$undef"
16139 old_pthread_create_joinable=""
16142 : see if pause exists
16146 : see if poll exists
16150 : see if prctl exists
16154 : see if prctl supports PR_SET_NAME
16155 d_prctl_set_name=$undef
16159 #include <sys/prctl.h>
16161 int main (int argc, char *argv[])
16163 return (prctl (PR_SET_NAME, "Test"));
16167 if eval $compile_ok && $run ./try; then
16168 echo "Your prctl (PR_SET_NAME, ...) works"
16169 d_prctl_set_name=$define
16175 : see if readlink exists
16176 set readlink d_readlink
16179 : Check if exe is symlink to abs path of executing program
16183 case "$d_readlink" in
16185 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
16186 : more tidy to avoid an extra level of symlink
16187 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16188 while test $# -gt 0; do
16191 if $issymlink $try; then
16192 $ls -l $try > reflect
16193 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16194 echo "You have $type-like $try."
16195 procselfexe='"'$try'"'
16197 : This will break out of the loop
16208 : backward compatibility for d_hvfork
16209 if test X$d_hvfork != X; then
16210 d_vfork="$d_hvfork"
16213 : see if there is a vfork
16218 d_pseudofork=$undef
16220 : Ok, but do we want to use it. vfork is reportedly unreliable in
16221 : perl on Solaris 2.x, and probably elsewhere.
16225 case "$usevfork" in
16231 Perl can only use a vfork() that doesn't suffer from strict
16232 restrictions on calling functions or modifying global data in
16233 the child. For example, glibc-2.1 contains such a vfork()
16234 that is unsuitable. If your system provides a proper fork()
16235 call, chances are that you do NOT want perl to use vfork().
16238 rp="Do you still want to use vfork()?"
16243 echo "Ok, we won't use vfork()."
16252 $define) usevfork='true';;
16253 *) usevfork='false';;
16256 : see whether the pthread_atfork exists
16258 #include <pthread.h>
16261 #ifdef PTHREAD_ATFORK
16262 pthread_atfork(NULL,NULL,NULL);
16267 : see if pthread_atfork exists
16268 set try -DPTHREAD_ATFORK
16269 if eval $compile; then
16274 case "$usethreads" in
16277 $define) echo 'pthread_atfork found.' >&4 ;;
16278 *) echo 'pthread_atfork NOT found.' >&4 ;;
16281 set d_pthread_atfork
16284 : see if pthread_attr_setscope exists
16285 set pthread_attr_setscope d_pthread_attr_setscope
16288 : see whether the various POSIXish _yields exist
16290 #include <pthread.h>
16296 #ifdef PTHREAD_YIELD
16299 #ifdef PTHREAD_YIELD_NULL
16300 pthread_yield(NULL);
16306 : see if sched_yield exists
16307 set try -DSCHED_YIELD
16308 if eval $compile; then
16310 sched_yield='sched_yield()'
16314 case "$usethreads" in
16317 $define) echo 'sched_yield() found.' >&4 ;;
16318 *) echo 'sched_yield() NOT found.' >&4 ;;
16324 : see if pthread_yield exists
16325 set try -DPTHREAD_YIELD
16326 if eval $compile; then
16328 case "$sched_yield" in
16329 '') sched_yield='pthread_yield()' ;;
16332 set try -DPTHREAD_YIELD_NULL
16333 if eval $compile; then
16335 case "$sched_yield" in
16336 '') sched_yield='pthread_yield(NULL)' ;;
16342 case "$usethreads" in
16345 $define) echo 'pthread_yield() found.' >&4 ;;
16346 *) echo 'pthread_yield() NOT found.' >&4 ;;
16350 set d_pthread_yield
16352 case "$sched_yield" in
16353 '') sched_yield=undef ;;
16357 : see if random_r exists
16358 set random_r d_random_r
16360 case "$d_random_r" in
16362 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16363 case "$d_random_r_proto:$usethreads" in
16364 ":define") d_random_r_proto=define
16365 set d_random_r_proto random_r $hdrs
16369 case "$d_random_r_proto" in
16371 case "$random_r_proto" in
16372 ''|0) try='int random_r(int*, struct random_data*);'
16373 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16375 case "$random_r_proto" in
16376 ''|0) try='int random_r(long*, struct random_data*);'
16377 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16379 case "$random_r_proto" in
16380 ''|0) try='int random_r(struct random_data*, int32_t*);'
16381 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16383 case "$random_r_proto" in
16384 ''|0) d_random_r=undef
16386 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16387 * ) case "$random_r_proto" in
16388 REENTRANT_PROTO*) ;;
16389 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16391 echo "Prototype: $try" ;;
16394 *) case "$usethreads" in
16395 define) echo "random_r has no prototype, not using it." >&4 ;;
16402 *) random_r_proto=0
16406 : see if readdir and friends exist
16407 set readdir d_readdir
16409 set seekdir d_seekdir
16411 set telldir d_telldir
16413 set rewinddir d_rewinddir
16416 : see if readdir64_r exists
16417 set readdir64_r d_readdir64_r
16419 case "$d_readdir64_r" in
16421 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16422 case "$d_readdir64_r_proto:$usethreads" in
16423 ":define") d_readdir64_r_proto=define
16424 set d_readdir64_r_proto readdir64_r $hdrs
16428 case "$d_readdir64_r_proto" in
16430 case "$readdir64_r_proto" in
16431 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16432 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16434 case "$readdir64_r_proto" in
16435 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16436 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16438 case "$readdir64_r_proto" in
16439 ''|0) d_readdir64_r=undef
16440 readdir64_r_proto=0
16441 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16442 * ) case "$readdir64_r_proto" in
16443 REENTRANT_PROTO*) ;;
16444 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16446 echo "Prototype: $try" ;;
16449 *) case "$usethreads" in
16450 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16452 d_readdir64_r=undef
16453 readdir64_r_proto=0
16457 *) readdir64_r_proto=0
16461 : see if readdir_r exists
16462 set readdir_r d_readdir_r
16464 case "$d_readdir_r" in
16466 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16467 case "$d_readdir_r_proto:$usethreads" in
16468 ":define") d_readdir_r_proto=define
16469 set d_readdir_r_proto readdir_r $hdrs
16473 case "$d_readdir_r_proto" in
16475 case "$readdir_r_proto" in
16476 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16477 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16479 case "$readdir_r_proto" in
16480 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16481 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16483 case "$readdir_r_proto" in
16484 ''|0) d_readdir_r=undef
16486 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16487 * ) case "$readdir_r_proto" in
16488 REENTRANT_PROTO*) ;;
16489 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16491 echo "Prototype: $try" ;;
16494 *) case "$usethreads" in
16495 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16502 *) readdir_r_proto=0
16506 : see if readv exists
16510 : see if recvmsg exists
16511 set recvmsg d_recvmsg
16514 : see if rename exists
16515 set rename d_rename
16518 : see if rmdir exists
16522 : see if memory.h is available.
16527 : See if it conflicts with string.h
16533 $cppstdin $cppflags $cppminus < $strings > mem.h
16534 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16536 echo "We won't be including <memory.h>."
16546 : can bcopy handle overlapping blocks?
16549 case "$d_memmove" in
16550 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16551 *) case "$d_bcopy" in
16553 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16555 #$i_memory I_MEMORY
16556 #$i_stdlib I_STDLIB
16557 #$i_string I_STRING
16558 #$i_unistd I_UNISTD
16560 $cat >>try.c <<'EOCP'
16563 # include <memory.h>
16566 # include <stdlib.h>
16569 # include <string.h>
16571 # include <strings.h>
16574 # include <unistd.h> /* Needed for NetBSD */
16578 char buf[128], abc[128];
16584 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16585 try to store the string in read-only memory. */
16586 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16588 for (align = 7; align >= 0; align--) {
16589 for (len = 36; len; len--) {
16591 bcopy(abc, b, len);
16592 for (off = 1; off <= len; off++) {
16593 bcopy(b, b+off, len);
16594 bcopy(b+off, b, len);
16595 if (bcmp(b, abc, len))
16604 if eval $compile_ok; then
16605 if $run ./try 2>/dev/null; then
16606 echo "Yes, it can."
16609 echo "It can't, sorry."
16612 echo "(I can't compile the test program, so we'll assume not...)"
16622 : can memcpy handle overlapping blocks?
16625 case "$d_memmove" in
16626 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16627 *) case "$d_memcpy" in
16629 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16631 #$i_memory I_MEMORY
16632 #$i_stdlib I_STDLIB
16633 #$i_string I_STRING
16634 #$i_unistd I_UNISTD
16636 $cat >>try.c <<'EOCP'
16639 # include <memory.h>
16642 # include <stdlib.h>
16645 # include <string.h>
16647 # include <strings.h>
16650 # include <unistd.h> /* Needed for NetBSD */
16654 char buf[128], abc[128];
16660 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16661 try to store the string in read-only memory. */
16662 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16664 for (align = 7; align >= 0; align--) {
16665 for (len = 36; len; len--) {
16667 memcpy(b, abc, len);
16668 for (off = 1; off <= len; off++) {
16669 memcpy(b+off, b, len);
16670 memcpy(b, b+off, len);
16671 if (memcmp(b, abc, len))
16680 if eval $compile_ok; then
16681 if $run ./try 2>/dev/null; then
16682 echo "Yes, it can."
16685 echo "It can't, sorry."
16688 echo "(I can't compile the test program, so we'll assume not...)"
16698 : can memcmp be trusted to compare relative magnitude?
16700 case "$d_memcmp" in
16703 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16705 #$i_memory I_MEMORY
16706 #$i_stdlib I_STDLIB
16707 #$i_string I_STRING
16708 #$i_unistd I_UNISTD
16710 $cat >>try.c <<'EOCP'
16713 # include <memory.h>
16716 # include <stdlib.h>
16719 # include <string.h>
16721 # include <strings.h>
16724 # include <unistd.h> /* Needed for NetBSD */
16730 if ((a < b) && memcmp(&a, &b, 1) < 0)
16736 if eval $compile_ok; then
16737 if $run ./try 2>/dev/null; then
16738 echo "Yes, it can."
16741 echo "No, it can't (it uses signed chars)."
16744 echo "(I can't compile the test program, so we'll assume not...)"
16752 : see if prototype for sbrk is available
16754 set d_sbrkproto sbrk $i_unistd unistd.h
16757 : see if select exists
16758 set select d_select
16761 : see if semctl exists
16762 set semctl d_semctl
16765 : see if semget exists
16766 set semget d_semget
16769 : see if semop exists
16773 : see how much of the 'sem*(2)' library is present.
16776 case "$d_semctl$d_semget$d_semop" in
16777 *"$undef"*) h_sem=false;;
16781 case "`ipcs 2>&1`" in
16782 "SVID messages"*"not configured"*)
16783 echo "Your $osname does not have the sem*(2) configured." >&4
16786 set semctl d_semctl
16788 set semget d_semget
16796 : we could also check for sys/ipc.h ...
16797 if $h_sem && $test `./findhdr sys/sem.h`; then
16798 echo "You have the full sem*(2) library." >&4
16801 echo "You don't have the full sem*(2) library." >&4
16807 : see whether sys/sem.h defines union semun
16809 $cat > try.c <<'END'
16810 #include <sys/types.h>
16811 #include <sys/ipc.h>
16812 #include <sys/sem.h>
16813 int main () { union semun semun; semun.buf = 0; }
16816 if eval $compile; then
16817 echo "You have union semun in <sys/sem.h>." >&4
16820 echo "You do not have union semun in <sys/sem.h>." >&4
16827 : see how to do semctl IPC_STAT
16831 $cat > tryh.h <<END
16834 # define S_IRUSR S_IREAD
16835 # define S_IWUSR S_IWRITE
16836 # define S_IXUSR S_IEXEC
16838 # define S_IRUSR 0400
16839 # define S_IWUSR 0200
16840 # define S_IXUSR 0100
16842 # define S_IRGRP (S_IRUSR>>3)
16843 # define S_IWGRP (S_IWUSR>>3)
16844 # define S_IXGRP (S_IXUSR>>3)
16845 # define S_IROTH (S_IRUSR>>6)
16846 # define S_IWOTH (S_IWUSR>>6)
16847 # define S_IXOTH (S_IXUSR>>6)
16850 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16851 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16852 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16855 : see whether semctl IPC_STAT can use union semun
16856 case "$d_semctl_semun" in
16860 #include <sys/types.h>
16861 #include <sys/ipc.h>
16862 #include <sys/sem.h>
16863 #include <sys/stat.h>
16870 #$d_union_semun HAS_UNION_SEMUN
16873 #ifndef HAS_UNION_SEMUN
16876 struct semid_ds *buf;
16877 unsigned short *array;
16883 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16884 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16886 struct semid_ds argbuf;
16889 st = semctl(sem, 0, IPC_STAT, arg);
16893 # endif /* IPC_STAT */
16894 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16896 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16897 # endif /* IPC_RMID */
16898 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16900 #endif /* IPC_PRIVATE && ... */
16901 printf("semget failed: errno = %d\n", errno);
16906 if eval $compile; then
16909 semun) val="$define" ;;
16917 case "$d_semctl_semun" in
16919 echo "You can use union semun for semctl IPC_STAT." >&4
16922 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16927 : see whether semctl IPC_STAT can use struct semid_ds pointer
16928 case "$d_semctl_semid_ds" in
16931 $cat > try.c <<'END'
16932 #include <sys/types.h>
16933 #include <sys/ipc.h>
16934 #include <sys/sem.h>
16935 #include <sys/stat.h>
16943 struct semid_ds arg;
16946 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16947 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16950 st = semctl(sem, 0, IPC_STAT, &arg);
16952 printf("semid_ds\n");
16954 # endif /* IPC_STAT */
16955 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16957 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16958 # endif /* IPC_RMID */
16959 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16961 #endif /* IPC_PRIVATE && ... */
16962 printf("semget failed: errno = %d\n", errno);
16968 if eval $compile; then
16971 semid_ds) val="$define" ;;
16975 set d_semctl_semid_ds
16979 case "$d_semctl_semid_ds" in
16981 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16983 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16989 # We do not have the full sem*(2) library, so assume we can not
16995 set d_semctl_semid_ds
17001 : see if sendmsg exists
17002 set sendmsg d_sendmsg
17005 : see if setegid exists
17006 set setegid d_setegid
17009 : see if seteuid exists
17010 set seteuid d_seteuid
17013 : see if setgrent exists
17014 set setgrent d_setgrent
17017 : see if setgrent_r exists
17018 set setgrent_r d_setgrent_r
17020 case "$d_setgrent_r" in
17022 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17023 case "$d_setgrent_r_proto:$usethreads" in
17024 ":define") d_setgrent_r_proto=define
17025 set d_setgrent_r_proto setgrent_r $hdrs
17029 case "$d_setgrent_r_proto" in
17031 case "$setgrent_r_proto" in
17032 ''|0) try='int setgrent_r(FILE**);'
17033 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17035 case "$setgrent_r_proto" in
17036 ''|0) try='void setgrent_r(FILE**);'
17037 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17039 case "$setgrent_r_proto" in
17040 ''|0) d_setgrent_r=undef
17042 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17043 * ) case "$setgrent_r_proto" in
17044 REENTRANT_PROTO*) ;;
17045 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17047 echo "Prototype: $try" ;;
17050 *) case "$usethreads" in
17051 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17058 *) setgrent_r_proto=0
17062 : see if sethostent exists
17063 set sethostent d_sethent
17066 : see if sethostent_r exists
17067 set sethostent_r d_sethostent_r
17069 case "$d_sethostent_r" in
17071 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17072 case "$d_sethostent_r_proto:$usethreads" in
17073 ":define") d_sethostent_r_proto=define
17074 set d_sethostent_r_proto sethostent_r $hdrs
17078 case "$d_sethostent_r_proto" in
17080 case "$sethostent_r_proto" in
17081 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17082 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17084 case "$sethostent_r_proto" in
17085 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17086 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17088 case "$sethostent_r_proto" in
17089 ''|0) d_sethostent_r=undef
17090 sethostent_r_proto=0
17091 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17092 * ) case "$sethostent_r_proto" in
17093 REENTRANT_PROTO*) ;;
17094 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17096 echo "Prototype: $try" ;;
17099 *) case "$usethreads" in
17100 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17102 d_sethostent_r=undef
17103 sethostent_r_proto=0
17107 *) sethostent_r_proto=0
17111 : see if setitimer exists
17112 set setitimer d_setitimer
17115 : see if setlinebuf exists
17116 set setlinebuf d_setlinebuf
17119 : see if setlocale exists
17120 set setlocale d_setlocale
17123 : see if locale.h is available
17124 set locale.h i_locale
17127 : see if setlocale_r exists
17128 set setlocale_r d_setlocale_r
17130 case "$d_setlocale_r" in
17132 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17133 case "$d_setlocale_r_proto:$usethreads" in
17134 ":define") d_setlocale_r_proto=define
17135 set d_setlocale_r_proto setlocale_r $hdrs
17139 case "$d_setlocale_r_proto" in
17141 case "$setlocale_r_proto" in
17142 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17143 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17145 case "$setlocale_r_proto" in
17146 ''|0) d_setlocale_r=undef
17147 setlocale_r_proto=0
17148 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17149 * ) case "$setlocale_r_proto" in
17150 REENTRANT_PROTO*) ;;
17151 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17153 echo "Prototype: $try" ;;
17156 *) case "$usethreads" in
17157 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17159 d_setlocale_r=undef
17160 setlocale_r_proto=0
17164 *) setlocale_r_proto=0
17168 : see if setnetent exists
17169 set setnetent d_setnent
17172 : see if setnetent_r exists
17173 set setnetent_r d_setnetent_r
17175 case "$d_setnetent_r" in
17177 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17178 case "$d_setnetent_r_proto:$usethreads" in
17179 ":define") d_setnetent_r_proto=define
17180 set d_setnetent_r_proto setnetent_r $hdrs
17184 case "$d_setnetent_r_proto" in
17186 case "$setnetent_r_proto" in
17187 ''|0) try='int setnetent_r(int, struct netent_data*);'
17188 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17190 case "$setnetent_r_proto" in
17191 ''|0) try='void setnetent_r(int, struct netent_data*);'
17192 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17194 case "$setnetent_r_proto" in
17195 ''|0) d_setnetent_r=undef
17196 setnetent_r_proto=0
17197 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17198 * ) case "$setnetent_r_proto" in
17199 REENTRANT_PROTO*) ;;
17200 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17202 echo "Prototype: $try" ;;
17205 *) case "$usethreads" in
17206 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17208 d_setnetent_r=undef
17209 setnetent_r_proto=0
17213 *) setnetent_r_proto=0
17217 : see if setprotoent exists
17218 set setprotoent d_setpent
17221 : see if setpgid exists
17222 set setpgid d_setpgid
17225 : see if setpgrp2 exists
17226 set setpgrp2 d_setpgrp2
17229 : see if setpriority exists
17230 set setpriority d_setprior
17233 : see if setproctitle exists
17234 set setproctitle d_setproctitle
17237 : see if setprotoent_r exists
17238 set setprotoent_r d_setprotoent_r
17240 case "$d_setprotoent_r" in
17242 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17243 case "$d_setprotoent_r_proto:$usethreads" in
17244 ":define") d_setprotoent_r_proto=define
17245 set d_setprotoent_r_proto setprotoent_r $hdrs
17249 case "$d_setprotoent_r_proto" in
17251 case "$setprotoent_r_proto" in
17252 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17253 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17255 case "$setprotoent_r_proto" in
17256 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17257 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17259 case "$setprotoent_r_proto" in
17260 ''|0) d_setprotoent_r=undef
17261 setprotoent_r_proto=0
17262 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17263 * ) case "$setprotoent_r_proto" in
17264 REENTRANT_PROTO*) ;;
17265 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17267 echo "Prototype: $try" ;;
17270 *) case "$usethreads" in
17271 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17273 d_setprotoent_r=undef
17274 setprotoent_r_proto=0
17278 *) setprotoent_r_proto=0
17282 : see if setpwent exists
17283 set setpwent d_setpwent
17286 : see if setpwent_r exists
17287 set setpwent_r d_setpwent_r
17289 case "$d_setpwent_r" in
17291 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17292 case "$d_setpwent_r_proto:$usethreads" in
17293 ":define") d_setpwent_r_proto=define
17294 set d_setpwent_r_proto setpwent_r $hdrs
17298 case "$d_setpwent_r_proto" in
17300 case "$setpwent_r_proto" in
17301 ''|0) try='int setpwent_r(FILE**);'
17302 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17304 case "$setpwent_r_proto" in
17305 ''|0) try='void setpwent_r(FILE**);'
17306 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17308 case "$setpwent_r_proto" in
17309 ''|0) d_setpwent_r=undef
17311 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17312 * ) case "$setpwent_r_proto" in
17313 REENTRANT_PROTO*) ;;
17314 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17316 echo "Prototype: $try" ;;
17319 *) case "$usethreads" in
17320 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17327 *) setpwent_r_proto=0
17331 : see if setregid exists
17332 set setregid d_setregid
17334 set setresgid d_setresgid
17337 : see if setreuid exists
17338 set setreuid d_setreuid
17340 set setresuid d_setresuid
17343 : see if setrgid exists
17344 set setrgid d_setrgid
17347 : see if setruid exists
17348 set setruid d_setruid
17351 : see if setservent exists
17352 set setservent d_setsent
17355 : see if setservent_r exists
17356 set setservent_r d_setservent_r
17358 case "$d_setservent_r" in
17360 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17361 case "$d_setservent_r_proto:$usethreads" in
17362 ":define") d_setservent_r_proto=define
17363 set d_setservent_r_proto setservent_r $hdrs
17367 case "$d_setservent_r_proto" in
17369 case "$setservent_r_proto" in
17370 ''|0) try='int setservent_r(int, struct servent_data*);'
17371 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17373 case "$setservent_r_proto" in
17374 ''|0) try='void setservent_r(int, struct servent_data*);'
17375 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17377 case "$setservent_r_proto" in
17378 ''|0) d_setservent_r=undef
17379 setservent_r_proto=0
17380 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17381 * ) case "$setservent_r_proto" in
17382 REENTRANT_PROTO*) ;;
17383 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17385 echo "Prototype: $try" ;;
17388 *) case "$usethreads" in
17389 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17391 d_setservent_r=undef
17392 setservent_r_proto=0
17396 *) setservent_r_proto=0
17400 : see if setsid exists
17401 set setsid d_setsid
17404 : see if setvbuf exists
17405 set setvbuf d_setvbuf
17410 : see if shmctl exists
17411 set shmctl d_shmctl
17414 : see if shmget exists
17415 set shmget d_shmget
17418 : see if shmat exists
17421 : see what shmat returns
17424 $cat >shmat.c <<'END'
17425 #include <sys/shm.h>
17428 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17433 echo "and it returns ($shmattype)." >&4
17434 : see if a prototype for shmat is available
17435 xxx=`./findhdr sys/shm.h`
17436 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17437 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17448 set d_shmatprototype
17451 : see if shmdt exists
17455 : see how much of the 'shm*(2)' library is present.
17458 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17459 *"$undef"*) h_shm=false;;
17463 case "`ipcs 2>&1`" in
17464 "SVID shared memory"*"not configured"*)
17465 echo "Your $osname does not have the shm*(2) configured." >&4
17468 set shmctl d_shmctl
17470 set shmget d_shmget
17480 : we could also check for sys/ipc.h ...
17481 if $h_shm && $test `./findhdr sys/shm.h`; then
17482 echo "You have the full shm*(2) library." >&4
17485 echo "You don't have the full shm*(2) library." >&4
17491 : see if we have sigaction
17493 if set sigaction val -f d_sigaction; eval $csym; $val; then
17494 echo 'sigaction() found.' >&4
17497 #include <sys/types.h>
17498 #include <signal.h>
17499 #$i_stdlib I_STDLIB
17501 #include <stdlib.h>
17505 struct sigaction act, oact;
17507 oact.sa_handler = 0;
17508 /* so that act and oact are used */
17509 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17513 if eval $compile_ok; then
17516 echo "But you don't seem to have a usable struct sigaction." >&4
17520 echo 'sigaction NOT found.' >&4
17523 set d_sigaction; eval $setvar
17526 : see if this is a sunmath.h system
17527 set sunmath.h i_sunmath
17530 : see if signbit exists
17531 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17534 #$i_sunmath I_SUNMATH
17538 #ifdef I_SUNMATH /* Solaris special math library */
17539 # include <sunmath.h>
17542 int main(int argc, char **argv)
17546 if ((signbit(x) == 0) && (signbit(y) != 0))
17554 if eval $compile; then
17555 if $run ./try; then
17559 $echo "Signbit seems to be available, but doesn't work as I expected."
17560 $echo "I won't use it." >&4
17571 : see if sigprocmask exists
17572 set sigprocmask d_sigprocmask
17575 : see if sigsetjmp exists
17577 case "$d_sigsetjmp" in
17580 #include <setjmp.h>
17581 #$i_stdlib I_STDLIB
17583 #include <stdlib.h>
17589 if (sigsetjmp(env,1))
17592 siglongjmp(env, 1);
17597 if eval $compile; then
17598 if $run ./try >/dev/null 2>&1; then
17599 echo "POSIX sigsetjmp found." >&4
17603 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17609 echo "sigsetjmp not found." >&4
17613 *) val="$d_sigsetjmp"
17614 case "$d_sigsetjmp" in
17615 $define) echo "POSIX sigsetjmp found." >&4;;
17616 $undef) echo "sigsetjmp not found." >&4;;
17624 : see if snprintf exists
17625 set snprintf d_snprintf
17628 : see if vsnprintf exists
17629 set vsnprintf d_vsnprintf
17632 case "$d_snprintf-$d_vsnprintf" in
17635 Checking whether your snprintf() and vsnprintf() work okay...
17637 $cat >try.c <<'EOCP'
17638 /* v?snprintf testing logic courtesy of Russ Allbery.
17639 * According to C99:
17640 * - if the buffer is too short it still must be \0-terminated
17641 * - if the buffer is too short the potentially required length
17642 * must be returned and not -1
17643 * - if the buffer is NULL the potentially required length
17644 * must be returned and not -1 or core dump
17647 #include <stdarg.h>
17651 int test (char *format, ...)
17656 va_start (args, format);
17657 count = vsnprintf (buf, sizeof buf, format, args);
17664 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17665 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17669 if eval $compile; then
17672 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17674 Your snprintf() and snprintf() don't seem to be working okay.
17676 d_snprintf="$undef"
17677 d_vsnprintf="$undef"
17681 echo "(I can't seem to compile the test program--assuming they don't)"
17682 d_snprintf="$undef"
17683 d_vsnprintf="$undef"
17689 : see if sockatmark exists
17690 set sockatmark d_sockatmark
17693 : see if prototype for sockatmark is available
17695 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17698 : see if socks5_init exists
17699 set socks5_init d_socks5_init
17702 : see if sprintf returns the length of the string in the buffer as per ANSI
17703 $echo "Checking whether sprintf returns the length of the string..." >&4
17706 #$i_stdlib I_STDLIB
17708 #include <stdlib.h>
17710 #$i_string I_STRING
17712 # include <string.h>
17714 # include <strings.h>
17723 int check (size_t expect, int test) {
17724 size_t got = strlen(buffer);
17728 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17733 int main(int argc, char **argv) {
17736 check(sprintf(buffer, ""), ++test);
17737 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17738 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17745 if eval $compile; then
17749 sprintf returns the length of the string (as ANSI says it should)
17751 d_sprintf_returns_strlen="$define"
17754 sprintf does not return the length of the string (how old is this system?)
17756 d_sprintf_returns_strlen="$undef"
17760 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17761 d_sprintf_returns_strlen="$undef"
17765 : see if srand48_r exists
17766 set srand48_r d_srand48_r
17768 case "$d_srand48_r" in
17770 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17771 case "$d_srand48_r_proto:$usethreads" in
17772 ":define") d_srand48_r_proto=define
17773 set d_srand48_r_proto srand48_r $hdrs
17777 case "$d_srand48_r_proto" in
17779 case "$srand48_r_proto" in
17780 ''|0) try='int srand48_r(long, struct drand48_data*);'
17781 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17783 case "$srand48_r_proto" in
17784 ''|0) d_srand48_r=undef
17786 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17787 * ) case "$srand48_r_proto" in
17788 REENTRANT_PROTO*) ;;
17789 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17791 echo "Prototype: $try" ;;
17794 *) case "$usethreads" in
17795 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17802 *) srand48_r_proto=0
17806 : see if srandom_r exists
17807 set srandom_r d_srandom_r
17809 case "$d_srandom_r" in
17811 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17812 case "$d_srandom_r_proto:$usethreads" in
17813 ":define") d_srandom_r_proto=define
17814 set d_srandom_r_proto srandom_r $hdrs
17818 case "$d_srandom_r_proto" in
17820 case "$srandom_r_proto" in
17821 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17822 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
17824 case "$srandom_r_proto" in
17825 ''|0) d_srandom_r=undef
17827 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17828 * ) case "$srandom_r_proto" in
17829 REENTRANT_PROTO*) ;;
17830 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17832 echo "Prototype: $try" ;;
17835 *) case "$usethreads" in
17836 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17843 *) srandom_r_proto=0
17847 : see if prototype for setresgid is available
17849 set d_sresgproto setresgid $i_unistd unistd.h
17852 : see if prototype for setresuid is available
17854 set d_sresuproto setresuid $i_unistd unistd.h
17857 : see if sys/stat.h is available
17858 set sys/stat.h i_sysstat
17861 : see if stat knows about block sizes
17863 echo "Checking to see if your struct stat has st_blocks field..." >&4
17864 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17867 : see if this is a sys/vfs.h system
17868 set sys/vfs.h i_sysvfs
17871 : see if this is a sys/statfs.h system
17872 set sys/statfs.h i_sysstatfs
17875 : Check for statfs_s
17877 echo "Checking to see if your system supports struct statfs..." >&4
17878 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
17880 case "$d_statfs_s" in
17881 "$define") echo "Yes, it does." ;;
17882 *) echo "No, it doesn't." ;;
17886 : see if struct statfs knows about f_flags
17887 case "$d_statfs_s" in
17890 echo "Checking to see if your struct statfs has f_flags field..." >&4
17891 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
17895 set d_statfs_f_flags
17899 case "$d_statfs_f_flags" in
17900 "$define") echo "Yes, it does." ;;
17901 *) echo "No, it doesn't." ;;
17904 : see what flavor, if any, of static inline is supported
17906 echo "Checking to see if your system supports static inline..."
17907 $cat > try.c <<'EOCP'
17908 #include <stdlib.h>
17909 extern int f_via_a(int x);
17910 extern int f_via_b(int x);
17911 int main(int argc, char **argv)
17920 return EXIT_SUCCESS;
17923 return EXIT_FAILURE;
17927 $cat > a.c <<'EOCP'
17928 static INLINE int f(int x) {
17939 $cat > b.c <<'EOCP'
17940 extern int f(int x);
17948 # Respect a hint (or previous) value for perl_static_inline, if there is one.
17949 case "$perl_static_inline" in
17950 '') # Check the various possibilities, and break out on success.
17951 # For gcc, prefer __inline__, which will still permit
17952 # cflags.SH to add in -ansi.
17953 case "$gccversion" in
17954 '') xxx="inline __inline__ __inline _inline";;
17955 *) xxx="__inline__ inline __inline _inline";;
17957 for inline in $xxx; do
17958 set try -DINLINE=$inline a.c
17959 if eval $compile && $run ./try; then
17960 # Now make sure there is no external linkage of static
17962 set try -DINLINE=$inline -DUSE_B a.c b.c
17963 if eval $compile && $run ./try; then
17964 $echo "Your compiler supports static $inline, " >&4
17965 $echo "but it also creates an external definition," >&4
17966 $echo "so I won't use it." >&4
17969 $echo "Your compiler supports static $inline." >&4
17971 perl_static_inline="static $inline";
17975 $echo "Your compiler does NOT support static $inline." >&4
17980 *inline*) # Some variant of inline exists.
17981 echo "Keeping your $hint value of $perl_static_inline."
17984 static) # No inline capabilities
17985 echo "Keeping your $hint value of $perl_static_inline."
17988 *) # Unrecognized previous value -- blindly trust the supplied
17989 # value and hope it makes sense. Use old value for
17990 # d_static_inline, if there is one.
17991 echo "Keeping your $hint value of $perl_static_inline."
17992 case "$d_static_inline" in
17994 *) val=$d_static_inline ;;
17998 # Fallback to plain 'static' if nothing worked.
17999 case "$perl_static_inline" in
18001 perl_static_inline="static"
18005 set d_static_inline
18007 $rm -f a.[co] b.[co]
18010 : Check stream access
18012 Checking how to access stdio streams by file descriptor number...
18014 case "$stdio_stream_array" in
18015 '') $cat >try.c <<EOCP
18018 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18022 for s in _iob __iob __sF
18024 set try -DSTDIO_STREAM_ARRAY=$s
18025 if eval $compile; then
18026 case "`$run ./try`" in
18027 yes) stdio_stream_array=$s; break ;;
18033 case "$stdio_stream_array" in
18035 I can't figure out how to access stdio streams by file descriptor number.
18037 d_stdio_stream_array="$undef"
18040 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18042 d_stdio_stream_array="$define"
18046 : see if strcoll exists
18047 set strcoll d_strcoll
18050 : check for structure copying
18052 echo "Checking to see if your C compiler can copy structs..." >&4
18053 $cat >try.c <<'EOCP'
18063 if $cc -c try.c >/dev/null 2>&1 ; then
18065 echo "Yup, it can."
18068 echo "Nope, it can't."
18074 : see if strerror and/or sys_errlist[] exist
18076 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18077 if set strerror val -f d_strerror; eval $csym; $val; then
18078 echo 'strerror() found.' >&4
18079 d_strerror="$define"
18080 d_strerrm='strerror(e)'
18081 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18082 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18083 d_syserrlst="$define"
18085 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
18086 d_syserrlst="$undef"
18088 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18089 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18090 echo 'strerror() found in string header.' >&4
18091 d_strerror="$define"
18092 d_strerrm='strerror(e)'
18093 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18094 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18095 d_syserrlst="$define"
18097 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18098 d_syserrlst="$undef"
18100 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18101 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18102 d_strerror="$undef"
18103 d_syserrlst="$define"
18104 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18106 echo 'strerror() and sys_errlist[] NOT found.' >&4
18107 d_strerror="$undef"
18108 d_syserrlst="$undef"
18109 d_strerrm='"unknown"'
18113 : see if strerror_r exists
18114 set strerror_r d_strerror_r
18116 case "$d_strerror_r" in
18118 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18119 case "$d_strerror_r_proto:$usethreads" in
18120 ":define") d_strerror_r_proto=define
18121 set d_strerror_r_proto strerror_r $hdrs
18125 case "$d_strerror_r_proto" in
18127 case "$strerror_r_proto" in
18128 ''|0) try='int strerror_r(int, char*, size_t);'
18129 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18131 case "$strerror_r_proto" in
18132 ''|0) try='int strerror_r(int, char*, int);'
18133 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18135 case "$strerror_r_proto" in
18136 ''|0) try='char* strerror_r(int, char*, size_t);'
18137 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18139 case "$strerror_r_proto" in
18140 ''|0) d_strerror_r=undef
18142 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18143 * ) case "$strerror_r_proto" in
18144 REENTRANT_PROTO*) ;;
18145 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18147 echo "Prototype: $try" ;;
18150 *) case "$usethreads" in
18151 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18158 *) strerror_r_proto=0
18162 : see if strftime exists
18163 set strftime d_strftime
18166 : see if strlcat exists
18167 set strlcat d_strlcat
18170 : see if strlcpy exists
18171 set strlcpy d_strlcpy
18174 : see if strtod exists
18175 set strtod d_strtod
18178 : see if strtol exists
18179 set strtol d_strtol
18182 : see if strtold exists
18183 set strtold d_strtold
18186 : see if strtoll exists
18187 set strtoll d_strtoll
18190 case "$d_longlong-$d_strtoll" in
18193 Checking whether your strtoll() works okay...
18195 $cat >try.c <<'EOCP'
18198 #define strtoll __strtoll
18201 #define strtoll _strtoll
18204 extern long long int strtoll(char *s, char **, int);
18205 static int bad = 0;
18206 int check(char *s, long long ell, int een) {
18209 gll = strtoll(s, 0, 10);
18210 if (!((gll == ell) && (errno == een)))
18214 check(" 1", 1LL, 0);
18215 check(" 0", 0LL, 0);
18216 check("-1", -1LL, 0);
18217 check("-9223372036854775808", -9223372036854775808LL, 0);
18218 check("-9223372036854775808", -9223372036854775808LL, 0);
18219 check(" 9223372036854775807", 9223372036854775807LL, 0);
18220 check("-9223372036854775808", -9223372036854775808LL, 0);
18221 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18222 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18228 if eval $compile; then
18231 ok) echo "Your strtoll() seems to be working okay." ;;
18233 Your strtoll() doesn't seem to be working okay.
18239 echo "(I can't seem to compile the test program--assuming it doesn't)"
18245 : see if strtoq exists
18246 set strtoq d_strtoq
18249 : see if strtoul exists
18250 set strtoul d_strtoul
18253 case "$d_strtoul" in
18256 Checking whether your strtoul() works okay...
18258 $cat >try.c <<'EOCP'
18261 extern unsigned long int strtoul(char *s, char **, int);
18262 static int bad = 0;
18263 void check(char *s, unsigned long eul, int een) {
18266 gul = strtoul(s, 0, 10);
18267 if (!((gul == eul) && (errno == een)))
18271 check(" 1", 1L, 0);
18272 check(" 0", 0L, 0);
18274 case "$longsize" in
18276 $cat >>try.c <<'EOCP'
18277 check("18446744073709551615", 18446744073709551615UL, 0);
18278 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18279 #if 0 /* strtoul() for /^-/ strings is undefined. */
18280 check("-1", 18446744073709551615UL, 0);
18281 check("-18446744073709551614", 2, 0);
18282 check("-18446744073709551615", 1, 0);
18283 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18284 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18289 $cat >>try.c <<'EOCP'
18290 check("4294967295", 4294967295UL, 0);
18291 check("4294967296", 4294967295UL, ERANGE);
18292 #if 0 /* strtoul() for /^-/ strings is undefined. */
18293 check("-1", 4294967295UL, 0);
18294 check("-4294967294", 2, 0);
18295 check("-4294967295", 1, 0);
18296 check("-4294967296", 4294967295UL, ERANGE);
18297 check("-4294967297", 4294967295UL, ERANGE);
18302 : Should we write these tests to be more portable by sprintf-ing
18303 : ~0 and then manipulating that char string as input for strtol?
18306 $cat >>try.c <<'EOCP'
18313 if eval $compile; then
18314 case "`$run ./try`" in
18315 ok) echo "Your strtoul() seems to be working okay." ;;
18317 Your strtoul() doesn't seem to be working okay.
18323 echo "(I can't seem to compile the test program--assuming it doesn't)"
18329 : see if strtoull exists
18330 set strtoull d_strtoull
18333 case "$d_longlong-$d_strtoull" in
18336 Checking whether your strtoull() works okay...
18338 $cat >try.c <<'EOCP'
18341 #define strtoull __strtoull
18344 extern unsigned long long int strtoull(char *s, char **, int);
18345 static int bad = 0;
18346 int check(char *s, long long eull, int een) {
18349 gull = strtoull(s, 0, 10);
18350 if (!((gull == eull) && (errno == een)))
18354 check(" 1", 1LL, 0);
18355 check(" 0", 0LL, 0);
18356 check("18446744073709551615", 18446744073709551615ULL, 0);
18357 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18358 #if 0 /* strtoull() for /^-/ strings is undefined. */
18359 check("-1", 18446744073709551615ULL, 0);
18360 check("-18446744073709551614", 2LL, 0);
18361 check("-18446744073709551615", 1LL, 0);
18362 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18363 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18370 if eval $compile; then
18371 case "`$run ./try`" in
18372 ok) echo "Your strtoull() seems to be working okay." ;;
18374 Your strtoull() doesn't seem to be working okay.
18376 d_strtoull="$undef"
18380 echo "(I can't seem to compile the test program--assuming it doesn't)"
18381 d_strtoull="$undef"
18386 : see if strtouq exists
18387 set strtouq d_strtouq
18390 case "$d_strtouq" in
18393 Checking whether your strtouq() works okay...
18395 $cat >try.c <<'EOCP'
18398 extern unsigned long long int strtouq(char *s, char **, int);
18399 static int bad = 0;
18400 void check(char *s, unsigned long long eull, int een) {
18401 unsigned long long gull;
18403 gull = strtouq(s, 0, 10);
18404 if (!((gull == eull) && (errno == een)))
18408 check(" 1", 1LL, 0);
18409 check(" 0", 0LL, 0);
18410 check("18446744073709551615", 18446744073709551615ULL, 0);
18411 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18412 #if 0 /* strtouq() for /^-/ strings is undefined. */
18413 check("-1", 18446744073709551615ULL, 0);
18414 check("-18446744073709551614", 2LL, 0);
18415 check("-18446744073709551615", 1LL, 0);
18416 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18417 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18425 if eval $compile; then
18426 case "`$run ./try`" in
18427 ok) echo "Your strtouq() seems to be working okay." ;;
18429 Your strtouq() doesn't seem to be working okay.
18435 echo "(I can't seem to compile the test program--assuming it doesn't)"
18441 : see if strxfrm exists
18442 set strxfrm d_strxfrm
18445 : see if symlink exists
18446 set symlink d_symlink
18449 : see if syscall exists
18450 set syscall d_syscall
18453 : see if prototype for syscall is available
18455 set d_syscallproto syscall $i_unistd unistd.h
18458 : see if sysconf exists
18459 set sysconf d_sysconf
18462 : see if system exists
18463 set system d_system
18466 : see if tcgetpgrp exists
18467 set tcgetpgrp d_tcgetpgrp
18470 : see if tcsetpgrp exists
18471 set tcsetpgrp d_tcsetpgrp
18474 : see if prototype for telldir is available
18476 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18479 : see if time exists
18481 if test "X$d_time" = X -o X"$timetype" = X; then
18482 if set time val -f d_time; eval $csym; $val; then
18483 echo 'time() found.' >&4
18485 rp="What is the type returned by time() on this system?"
18486 set time_t timetype long stdio.h sys/types.h
18489 echo 'time() not found, hope that will do.' >&4
18497 : see if timegm exists
18498 set timegm d_timegm
18501 : see if this is a sys/times.h system
18502 set sys/times.h i_systimes
18505 : see if times exists
18507 if set times val -f d_times; eval $csym; $val; then
18508 echo 'times() found.' >&4
18511 case "$i_systimes" in
18512 "$define") inc='sys/times.h';;
18514 rp="What is the type returned by times() on this system?"
18515 set clock_t clocktype long stdio.h sys/types.h $inc
18518 echo 'times() NOT found, hope that will do.' >&4
18523 : see if tmpnam_r exists
18524 set tmpnam_r d_tmpnam_r
18526 case "$d_tmpnam_r" in
18528 hdrs="$i_systypes sys/types.h define stdio.h "
18529 case "$d_tmpnam_r_proto:$usethreads" in
18530 ":define") d_tmpnam_r_proto=define
18531 set d_tmpnam_r_proto tmpnam_r $hdrs
18535 case "$d_tmpnam_r_proto" in
18537 case "$tmpnam_r_proto" in
18538 ''|0) try='char* tmpnam_r(char*);'
18539 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18541 case "$tmpnam_r_proto" in
18542 ''|0) d_tmpnam_r=undef
18544 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18545 * ) case "$tmpnam_r_proto" in
18546 REENTRANT_PROTO*) ;;
18547 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18549 echo "Prototype: $try" ;;
18552 *) case "$usethreads" in
18553 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18560 *) tmpnam_r_proto=0
18564 : see if truncate exists
18565 set truncate d_truncate
18568 : see if ttyname_r exists
18569 set ttyname_r d_ttyname_r
18571 case "$d_ttyname_r" in
18573 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18574 case "$d_ttyname_r_proto:$usethreads" in
18575 ":define") d_ttyname_r_proto=define
18576 set d_ttyname_r_proto ttyname_r $hdrs
18580 case "$d_ttyname_r_proto" in
18582 case "$ttyname_r_proto" in
18583 ''|0) try='int ttyname_r(int, char*, size_t);'
18584 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18586 case "$ttyname_r_proto" in
18587 ''|0) try='int ttyname_r(int, char*, int);'
18588 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18590 case "$ttyname_r_proto" in
18591 ''|0) try='char* ttyname_r(int, char*, int);'
18592 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18594 case "$ttyname_r_proto" in
18595 ''|0) d_ttyname_r=undef
18597 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18598 * ) case "$ttyname_r_proto" in
18599 REENTRANT_PROTO*) ;;
18600 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18602 echo "Prototype: $try" ;;
18605 *) case "$usethreads" in
18606 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18613 *) ttyname_r_proto=0
18617 : see if tzname[] exists
18619 if set tzname val -a d_tzname; eval $csym; $val; then
18621 echo 'tzname[] found.' >&4
18624 echo 'tzname[] NOT found.' >&4
18629 : Check if is a multiplatform env
18631 next|darwin) multiarch="$define" ;;
18633 case "$multiarch" in
18634 ''|[nN]*) multiarch="$undef" ;;
18637 : check for ordering of bytes in a UV
18639 case "$usecrosscompile$multiarch" in
18642 You seem to be either cross-compiling or doing a multiarchitecture build,
18643 skipping the byteorder check.
18649 case "$byteorder" in
18652 In the following, larger digits indicate more significance. A big-endian
18653 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18654 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18655 machines may have weird orders like 3412. A Cray will report 87654321,
18656 an Alpha will report 12345678. If the test program works the default is
18658 I'm now running the test program...
18662 #$i_stdlib I_STDLIB
18664 #include <stdlib.h>
18666 #include <sys/types.h>
18667 typedef $uvtype UV;
18677 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18679 u.l = (UV)0x04030201;
18680 for (i = 0; i < $uvsize; i++)
18681 printf("%c", u.c[i]+'0');
18688 if eval $compile && $run ./try > /dev/null; then
18691 [1-4][1-4][1-4][1-4]|12345678|87654321)
18692 echo "(The test program ran ok.)"
18693 echo "byteorder=$dflt"
18696 ????|????????) echo "(The test program ran ok.)" ;;
18697 *) echo "(The test program didn't run right for some reason.)" ;;
18702 (I can't seem to compile the test program. Guessing big-endian...)
18705 case "$xxx_prompt" in
18707 rp="What is the order of bytes in $uvtype?"
18720 : Checking 32bit alignedness
18723 Checking to see whether you can access character data unalignedly...
18725 case "$d_u32align" in
18726 '') $cat >try.c <<EOCP
18728 #$i_stdlib I_STDLIB
18730 #include <stdlib.h>
18732 #define U32 $u32type
18733 #define BYTEORDER 0x$byteorder
18735 #include <signal.h>
18737 $signal_t bletch(int s) { exit(4); }
18740 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18741 volatile U8 buf[8];
18745 if (sizeof(U32) != 4) {
18746 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18753 signal(SIGBUS, bletch);
18765 for (i = 0; i < 4; i++) {
18766 up = (U32*)(buf + i);
18767 if (! ((*up == 1 << (8*i)) || /* big-endian */
18768 (*up == 1 << (8*(3-i))) /* little-endian */
18772 printf("read failed (%x)\n", *up);
18778 for (i = 0; i < 4; i++) {
18779 up = (U32*)(buf + i);
18781 if (*up != 0xBeef) {
18782 printf("write failed (%x)\n", *up);
18796 if eval $compile_ok; then
18797 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18798 $run ./try 2>&1 >/dev/null
18801 You can access character data pretty unalignedly.
18803 d_u32align="$undef"
18806 It seems that you must access character data in an aligned manner.
18808 d_u32align="$define"
18812 rp='Can you access character data at unaligned addresses?'
18816 [yY]*) d_u32align="$undef" ;;
18817 *) d_u32align="$define" ;;
18824 : see if ualarm exists
18825 set ualarm d_ualarm
18828 : see if umask exists
18832 : see if unordered exists
18833 set unordered d_unordered
18836 : see if unsetenv exists
18837 set unsetenv d_unsetenv
18840 : see if usleep exists
18841 set usleep d_usleep
18844 : see if prototype for usleep is available
18846 set d_usleepproto usleep $i_unistd unistd.h
18849 : see if ustat exists
18853 : see if closedir exists
18854 set closedir d_closedir
18857 case "$d_closedir" in
18860 echo "Checking whether closedir() returns a status..." >&4
18862 #$i_dirent I_DIRENT /**/
18863 #$i_sysdir I_SYS_DIR /**/
18864 #$i_sysndir I_SYS_NDIR /**/
18865 #$i_systypes I_SYS_TYPES /**/
18867 #if defined(I_SYS_TYPES)
18868 #include <sys/types.h>
18870 #if defined(I_DIRENT)
18871 #include <dirent.h>
18872 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18873 #include <sys/dir.h>
18877 #include <sys/ndir.h>
18881 #include <ndir.h> /* may be wrong in the future */
18883 #include <sys/dir.h>
18888 int main() { return closedir(opendir(".")); }
18891 if eval $compile_ok; then
18892 if $run ./try > /dev/null 2>&1 ; then
18893 echo "Yes, it does."
18896 echo "No, it doesn't."
18900 echo "(I can't seem to compile the test program--assuming it doesn't)"
18908 set d_void_closedir
18912 : see if there is a wait4
18916 : see if waitpid exists
18917 set waitpid d_waitpid
18920 : see if wcstombs exists
18921 set wcstombs d_wcstombs
18924 : see if wctomb exists
18925 set wctomb d_wctomb
18928 : see if writev exists
18929 set writev d_writev
18932 : preserve RCS keywords in files with variable substitution, grrr
18937 Revision='$Revision'
18939 : check for alignment requirements
18941 case "$usecrosscompile" in
18944 You seem to be cross-compiling. Skipping the memory alignment check.
18947 case "$alignbytes" in
18948 '') alignbytes=8 ;;
18952 case "$alignbytes" in
18953 '') echo "Checking alignment constraints..." >&4
18954 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18955 $cat >try.c <<'EOCP'
18956 typedef long double NV;
18959 $cat >try.c <<'EOCP'
18963 $cat >>try.c <<'EOCP'
18971 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18976 if eval $compile_ok; then
18980 echo "(I can't seem to compile the test program...)"
18982 case "$multiarch" in
18984 : The usual safe value is 8, but Darwin with -Duselongdouble
18985 : needs 16. Hence, we will take 8 as a minimum, but allow
18986 : Configure to pick a larger value if needed.
18987 if $test "$dflt" -lt 8; then
18989 echo "Setting alignment to 8 for multiarch support.">&4
18994 *) dflt="$alignbytes"
18997 rp="Doubles must be aligned on a how-many-byte boundary?"
19005 : set the base revision
19008 : Determine if this is an EBCDIC system
19010 echo "Determining whether or not we are on an EBCDIC system..." >&4
19011 $cat >try.c <<'EOM'
19014 if ('M'==0xd4) return 0;
19019 case "$BOOTSTRAP_CHARSET" in
19020 Y|y|define) bootstrap_charset=$define ;;
19021 *) bootstrap_charset=$undef ;;
19026 if eval $compile_ok; then
19027 if $run ./try; then
19028 echo "You seem to speak EBCDIC." >&4
19031 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19034 echo "I'm unable to compile the test program." >&4
19035 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19041 : length of character in bytes. Is always 1, otherwise it is not C
19042 : This used to be a test using sizeof
19045 : Check for the number of bits in a character
19046 case "$charbits" in
19047 '') echo "Checking how long a character is (in bits)..." >&4
19054 for (c = 1, n = 0; c; c <<= 1, n++) ;
19055 printf ("%d\n", n);
19060 if eval $compile_ok; then
19064 echo "(I can't seem to compile the test program. Guessing...)"
19071 rp="What is the length of a character (in bits)?"
19075 case "$charbits" in
19078 Your system has an unsigned character size of $charbits bits, which
19079 is rather unusual (normally it is 8 bits). Perl likely will not work
19080 correctly on your system, with subtle bugs in various places.
19082 rp='Do you really want to continue?'
19086 [yY]) echo >&4 "Okay, continuing." ;;
19091 : how do we concatenate cpp tokens here?
19093 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19094 $cat >cpp_stuff.c <<'EOCP'
19095 #define RCAT(a,b)a/**/b
19096 #define ACAT(a,b)a ## b
19100 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19101 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19102 echo "Oh! Smells like ANSI's been here." >&4
19103 echo "We can catify or stringify, separately or together!"
19105 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19106 echo "Ah, yes! The good old days!" >&4
19107 echo "However, in the good old days we don't know how to stringify and"
19108 echo "catify at the same time."
19112 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19113 You're going to have to edit the values of CAT[2-5] in config.h...
19115 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19119 : see if this is a db.h system
19125 : Check db version.
19127 echo "Checking Berkeley DB version ..." >&4
19133 #include <sys/types.h>
19135 #$i_stdlib I_STDLIB
19137 #include <stdlib.h>
19140 int main(int argc, char *argv[])
19142 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19143 int Major, Minor, Patch ;
19144 unsigned long Version ;
19145 (void)db_version(&Major, &Minor, &Patch) ;
19147 printf("%d %d %d %d %d %d\n",
19148 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19149 Major, Minor, Patch);
19152 printf("You have Berkeley DB Version 2 or greater.\n");
19154 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19155 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19156 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19157 Major, Minor, Patch) ;
19159 /* check that db.h & libdb are compatible */
19160 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19161 printf("db.h and libdb are incompatible.\n") ;
19165 printf("db.h and libdb are compatible.\n") ;
19167 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19168 + DB_VERSION_PATCH ;
19170 /* needs to be >= 2.3.4 */
19171 if (Version < 2003004) {
19172 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19173 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19179 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19184 printf("You have Berkeley DB Version 1.\n");
19185 exit(0); /* DB version < 2: the coast is clear. */
19187 exit(1); /* <db.h> not Berkeley DB? */
19193 if eval $compile_ok && $run ./try; then
19194 echo 'Looks OK.' >&4
19196 db_version_major=$1
19197 db_version_minor=$2
19198 db_version_patch=$3
19200 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19204 : Remove db from list of libraries to use
19205 echo "Removing unusable -ldb from library list" >&4
19206 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19209 echo "libs = $libs" >&4
19219 : Check the return type needed for hash
19221 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19227 #include <sys/types.h>
19230 #ifndef DB_VERSION_MAJOR
19231 u_int32_t hash_cb (ptr, size)
19239 info.hash = hash_cb;
19243 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19244 if $contains warning try.out >>/dev/null 2>&1 ; then
19247 db_hashtype='u_int32_t'
19250 : XXX Maybe we should just give up here.
19251 db_hashtype=u_int32_t
19253 echo "Help: I can't seem to compile the db test program." >&4
19254 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19257 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19259 *) db_hashtype=u_int32_t
19264 : Check the return type needed for prefix
19266 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19272 #include <sys/types.h>
19275 #ifndef DB_VERSION_MAJOR
19276 size_t prefix_cb (key1, key2)
19284 info.prefix = prefix_cb;
19288 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19289 if $contains warning try.out >>/dev/null 2>&1 ; then
19290 db_prefixtype='int'
19292 db_prefixtype='size_t'
19295 db_prefixtype='size_t'
19296 : XXX Maybe we should just give up here.
19298 echo "Help: I can't seem to compile the db test program." >&4
19299 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19302 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19304 *) db_prefixtype='size_t'
19308 : How can we generate normalized random numbers ?
19310 echo "Using our internal random number implementation..." >&4
19313 *-Dmy_rand=*|*-Dmy_srand=*)
19314 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19315 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19316 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19317 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19321 randfunc=Perl_drand48
19322 drand01="Perl_drand48()"
19323 seedfunc="Perl_drand48_init"
19327 : Check how to flush
19330 Checking how to flush all pending stdio output...
19332 # I only know how to find the first 32 possibly open files on SunOS.
19333 # See also hints/sunos_4_1.sh and util.c --AD
19335 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19337 $cat >>try.c <<EOCP
19339 #$i_stdlib I_STDLIB
19341 #include <stdlib.h>
19343 #$i_unistd I_UNISTD
19345 # include <unistd.h>
19347 #$d_sysconf HAS_SYSCONF
19348 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19349 #ifdef HAS_STDIO_STREAM_ARRAY
19350 # define STDIO_STREAM_ARRAY $stdio_stream_array
19355 p = fopen("try.out", "w");
19359 # ifdef TRY_FPRINTF
19363 #ifdef TRY_FFLUSH_NULL
19366 #ifdef TRY_FFLUSH_ALL
19368 long open_max = -1;
19369 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19370 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19372 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19373 open_max = sysconf(_SC_OPEN_MAX);
19376 open_max = FOPEN_MAX;
19379 open_max = OPEN_MAX;
19388 # ifdef HAS_STDIO_STREAM_ARRAY
19389 if (open_max > 0) {
19391 for (i = 0; i < open_max; i++)
19392 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19393 STDIO_STREAM_ARRAY[i]._file < open_max &&
19394 STDIO_STREAM_ARRAY[i]._flag)
19395 fflush(&STDIO_STREAM_ARRAY[i]);
19403 : first we have to find out how _not_ to flush
19405 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19407 set try -DTRY_FPUTC
19408 if eval $compile; then
19409 $run ./try 2>/dev/null
19412 if $test ! -s try.out -a "X$code" = X42; then
19418 set try -DTRY_FPRINTF
19419 if eval $compile; then
19420 $run ./try 2>/dev/null
19423 if $test ! -s try.out -a "X$code" = X42; then
19424 output=-DTRY_FPRINTF
19430 : check for fflush NULL behavior
19431 case "$fflushNULL" in
19432 '') set try -DTRY_FFLUSH_NULL $output
19433 if eval $compile; then
19434 $run ./try 2>/dev/null
19437 if $test -s try.out -a "X$code" = X42; then
19438 fflushNULL="`$cat try.out`"
19440 if $test "X$code" != X42; then
19442 (If this test failed, don't worry, we'll try another method shortly.)
19447 $rm -f core try.core core.try.*
19448 case "$fflushNULL" in
19450 Your fflush(NULL) works okay for output streams.
19451 Let's see if it clobbers input pipes...
19453 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19454 # bug that improperly flushes the input end of pipes. So we avoid the
19455 # autoflush on fork/system/exec support for now. :-(
19456 $cat >tryp.c <<EOCP
19459 main(int argc, char **argv)
19465 while ((i = getc(stdin)) != -1
19466 && (*bp++ = i) != '\n'
19467 && bp < &buf[1024])
19470 fprintf(stdout, "%s", buf);
19478 fflushNULL="$define"
19480 if eval $compile; then
19482 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19483 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19485 fflush(NULL) seems to behave okay with input streams.
19487 fflushNULL="$define"
19490 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19492 fflushNULL="$undef"
19495 $rm -f core tryp.c tryp.core core.tryp.*
19498 Your fflush(NULL) isn't working (contrary to ANSI C).
19500 fflushNULL="$undef"
19503 Cannot figure out whether your fflush(NULL) works or not.
19504 I'm assuming it doesn't (contrary to ANSI C).
19506 fflushNULL="$undef"
19510 $define|true|[yY]*)
19511 fflushNULL="$define"
19514 fflushNULL="$undef"
19517 : check explicit looping only if NULL did not work, and if the pipe
19518 : bug does not show up on an explicit flush too
19519 case "$fflushNULL" in
19521 $cat >tryp.c <<EOCP
19524 main(int argc, char **argv)
19530 while ((i = getc(stdin)) != -1
19531 && (*bp++ = i) != '\n'
19532 && bp < &buf[1024])
19535 fprintf(stdout, "%s", buf);
19544 if eval $compile; then
19546 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19547 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19549 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19551 : now check for fflushall behaviour
19552 case "$fflushall" in
19553 '') set try -DTRY_FFLUSH_ALL $output
19554 if eval $compile; then
19556 (Now testing the other method--but note that this also may fail.)
19558 $run ./try 2>/dev/null
19561 if $test -s try.out -a "X$code" = X42; then
19562 fflushall="`$cat try.out`"
19566 case "$fflushall" in
19568 Whew. Flushing explicitly all the stdio streams works.
19570 fflushall="$define"
19573 Sigh. Flushing explicitly all the stdio streams doesn't work.
19578 Cannot figure out whether flushing stdio streams explicitly works or not.
19579 I'm assuming it doesn't.
19585 "$define"|true|[yY]*)
19586 fflushall="$define"
19594 All is futile. Even fflush(stdin) clobbers input pipes!
19601 $rm -f core tryp.c tryp.core core.tryp.*
19603 *) fflushall="$undef"
19607 case "$fflushNULL$fflushall" in
19610 OK, I give up. I cannot figure out how to flush pending stdio output.
19611 We won't be flushing handles at all before fork/exec/popen.
19617 : Store the full pathname to the ar program for use in the C program
19618 : Respect a hint or command line value for full_ar.
19623 : Store the full pathname to the sed program for use in the C program
19626 : see what type gids are declared as in the kernel
19628 echo "Looking for the type for group ids returned by getgid()."
19629 set gid_t gidtype xxx stdio.h sys/types.h
19633 xxx=`./findhdr sys/user.h`
19634 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19636 unsigned) dflt="$1 $2" ;;
19640 *) dflt="$gidtype";;
19643 gid_t) echo "gid_t found." ;;
19644 *) rp="What is the type for group ids returned by getgid()?"
19650 : Check the size of GID
19653 *_t) zzz="$gidtype" ;;
19656 echo "Checking the size of $zzz..." >&4
19658 #include <sys/types.h>
19660 #$i_stdlib I_STDLIB
19662 #include <stdlib.h>
19665 printf("%d\n", (int)sizeof($gidtype));
19670 if eval $compile_ok; then
19674 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19677 echo "Your $zzz is $gidsize bytes long."
19682 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19686 : Check if GID is signed
19689 *_t) zzz="$gidtype" ;;
19692 echo "Checking the sign of $zzz..." >&4
19694 #include <sys/types.h>
19705 if eval $compile; then
19709 echo "(I can't execute the test program--guessing unsigned.)" >&4
19713 1) echo "Your $zzz is unsigned." ;;
19714 -1) echo "Your $zzz is signed." ;;
19720 echo "(I can't compile the test program--guessing unsigned.)" >&4
19724 : Check 64bit sizes
19727 if $test X"$quadtype" != X; then
19729 echo "Checking how to print 64-bit integers..." >&4
19731 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19732 $cat >try.c <<'EOCP'
19733 #include <sys/types.h>
19736 int q = 12345678901;
19737 printf("%ld\n", q);
19741 if eval $compile; then
19745 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19746 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19747 echo "We will use %d."
19753 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19754 $cat >try.c <<'EOCP'
19755 #include <sys/types.h>
19758 long q = 12345678901;
19759 printf("%ld\n", q);
19763 if eval $compile; then
19767 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19768 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19769 echo "We will use %ld."
19775 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19776 $cat >try.c <<'EOCP'
19777 #include <sys/types.h>
19778 #include <inttypes.h>
19781 int64_t q = 12345678901;
19782 printf("%" PRId64 "\n", q);
19786 if eval $compile; then
19790 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19791 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19792 echo "We will use the C9X style."
19798 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19800 #include <sys/types.h>
19803 $quadtype q = 12345678901;
19804 printf("%Ld\n", q);
19808 if eval $compile; then
19812 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19813 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19814 echo "We will use %Ld."
19820 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19821 $cat >try.c <<'EOCP'
19822 #include <sys/types.h>
19825 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19826 printf("%lld\n", q);
19830 if eval $compile; then
19834 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19835 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19836 echo "We will use the %lld style."
19842 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19844 #include <sys/types.h>
19847 $quadtype q = 12345678901;
19848 printf("%qd\n", q);
19852 if eval $compile; then
19856 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19857 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19858 echo "We will use %qd."
19864 if $test X"$sPRId64" = X; then
19865 echo "Cannot figure out how to print 64-bit integers." >&4
19872 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19873 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19875 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19876 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19880 : Check format strings for internal types
19882 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19884 if $test X"$ivsize" = X8; then
19885 ivdformat="$sPRId64"
19886 uvuformat="$sPRIu64"
19887 uvoformat="$sPRIo64"
19888 uvxformat="$sPRIx64"
19889 uvXUformat="$sPRIXU64"
19891 if $test X"$ivsize" = X"$longsize"; then
19898 if $test X"$ivsize" = X"$intsize"; then
19906 if $test X"$ivsize" = X"$shortsize"; then
19917 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19918 nveformat="$sPRIeldbl"
19919 nvfformat="$sPRIfldbl"
19920 nvgformat="$sPRIgldbl"
19921 nvEUformat="$sPRIEUldbl"
19922 nvFUformat="$sPRIFUldbl"
19923 nvGUformat="$sPRIGUldbl"
19933 case "$ivdformat" in
19934 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19939 : Check format string for GID
19942 $echo "Checking the format string to be used for gids..." >&4
19945 -1) if $test X"$gidsize" = X"$ivsize"; then
19946 gidformat="$ivdformat"
19948 if $test X"$gidsize" = X"$longsize"; then
19951 if $test X"$gidsize" = X"$intsize"; then
19954 if $test X"$gidsize" = X"$shortsize"; then
19961 *) if $test X"$gidsize" = X"$uvsize"; then
19962 gidformat="$uvuformat"
19964 if $test X"$gidsize" = X"$longsize"; then
19967 if $test X"$gidsize" = X"$intsize"; then
19970 if $test X"$gidsize" = X"$shortsize"; then
19979 : see if getgroups exists
19980 set getgroups d_getgrps
19983 : see if setgroups exists
19984 set setgroups d_setgrps
19987 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19989 case "$d_getgrps$d_setgrps" in
19991 case "$groupstype" in
19992 '') dflt="$gidtype" ;;
19993 *) dflt="$groupstype" ;;
19996 What type of pointer is the second argument to getgroups() and setgroups()?
19997 Usually this is the same as group ids, $gidtype, but not always.
20000 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20004 *) groupstype="$gidtype";;
20007 : MAD = Misc Attribute Definition
20009 if $test $patchlevel -lt 9; then
20010 : MAD is not available in 5.8.x or earlier.
20014 $define|true|[yY]*) dflt='y' ;;
20019 Would you like to build with Misc Attribute Decoration? This is development
20020 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
20021 overhead on the interpreter.
20023 If this doesn't make any sense to you, just accept the default '$dflt'.
20025 rp='Build Perl with MAD?'
20030 madlyh='madly.h madly.act madly.tab'
20032 madlyobj="madly$_o" ;;
20041 : check whether make sets MAKE
20043 echo "Checking if your $make program sets \$(MAKE)..." >&4
20044 case "$make_set_make" in
20046 $sed 's/^X //' > testmake.mak << 'EOF'
20048 X @echo 'maketemp="$(MAKE)"'
20050 case "`$make -f testmake.mak 2>/dev/null`" in
20051 *maketemp=*) make_set_make='#' ;;
20052 *) make_set_make="MAKE=$make" ;;
20054 $rm -f testmake.mak
20057 case "$make_set_make" in
20058 '#') echo "Yup, it does.";;
20059 *) echo "Nope, it doesn't.";;
20062 : see what type is used for mode_t
20063 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20064 set mode_t modetype int stdio.h sys/types.h
20067 : see if we need va_copy
20069 case "$i_stdarg" in
20072 #include <stdarg.h>
20074 #$i_stdlib I_STDLIB
20076 #include <stdlib.h>
20078 #include <signal.h>
20081 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20083 return vfprintf(f, fmt, *valp);
20087 myvfprintf(FILE *f, const char *fmt, va_list val)
20089 return ivfprintf(f, fmt, &val);
20093 myprintf(char *fmt, ...)
20096 va_start(val, fmt);
20097 return myvfprintf(stdout, fmt, val);
20101 main(int ac, char **av)
20103 signal(SIGSEGV, exit);
20105 myprintf("%s%cs all right, then\n", "that", '\'');
20110 if eval $compile && $run ./try 2>&1 >/dev/null; then
20111 case "`$run ./try`" in
20112 "that's all right, then")
20118 yes) echo "It seems that you don't need va_copy()." >&4
20119 need_va_copy="$undef"
20121 *) echo "It seems that va_copy() or similar will be needed." >&4
20122 need_va_copy="$define"
20127 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20128 need_va_copy="$undef"
20132 : see what type is used for size_t
20133 rp="What is the type used for the length parameter for string functions?"
20134 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20137 : check for type of arguments to gethostbyaddr.
20138 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20139 case "$d_gethbyaddr" in
20143 Checking to see what type of arguments are accepted by gethostbyaddr().
20145 hdrs="$define sys/types.h
20146 $d_socket sys/socket.h
20147 $i_niin netinet/in.h
20149 $i_unistd unistd.h"
20150 : The first arg can 'char *' or 'void *'
20151 : The second arg is some of integral type
20152 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20153 for yyy in size_t long int; do
20154 case "$netdb_host_type" in
20155 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20156 if ./protochk "$try" $hdrs; then
20157 echo "Your system accepts $xxx for the first arg."
20158 echo "...and $yyy for the second arg."
20159 netdb_host_type="$xxx"
20160 netdb_hlen_type="$yyy"
20166 : In case none of those worked, prompt the user.
20167 case "$netdb_host_type" in
20168 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20171 netdb_host_type=$ans
20172 rp='What is the type for the 2nd argument to gethostbyaddr?'
20175 netdb_hlen_type=$ans
20179 *) : no gethostbyaddr, so pick harmless defaults
20180 netdb_host_type='char *'
20181 netdb_hlen_type="$sizetype"
20184 # Remove the "const" if needed. -- but then we'll have a
20186 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20189 : check for type of argument to gethostbyname.
20190 if test "X$netdb_name_type" = X ; then
20191 case "$d_gethbyname" in
20195 Checking to see what type of argument is accepted by gethostbyname().
20197 hdrs="$define sys/types.h
20198 $d_socket sys/socket.h
20199 $i_niin netinet/in.h
20201 $i_unistd unistd.h"
20202 for xxx in "const char *" "char *"; do
20203 case "$netdb_name_type" in
20204 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20205 if ./protochk "$try" $hdrs; then
20206 echo "Your system accepts $xxx."
20207 netdb_name_type="$xxx"
20212 : In case none of those worked, prompt the user.
20213 case "$netdb_name_type" in
20214 '') rp='What is the type for the 1st argument to gethostbyname?'
20217 netdb_name_type=$ans
20221 *) : no gethostbyname, so pick harmless default
20222 netdb_name_type='char *'
20227 : check for type of 1st argument to getnetbyaddr.
20228 if test "X$netdb_net_type" = X ; then
20229 case "$d_getnbyaddr" in
20233 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20235 hdrs="$define sys/types.h
20236 $d_socket sys/socket.h
20237 $i_niin netinet/in.h
20239 $i_unistd unistd.h"
20240 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20241 case "$netdb_net_type" in
20242 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20243 if ./protochk "$try" $hdrs; then
20244 echo "Your system accepts $xxx."
20245 netdb_net_type="$xxx"
20250 : In case none of those worked, prompt the user.
20251 case "$netdb_net_type" in
20252 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20255 netdb_net_type=$ans
20259 *) : no getnetbyaddr, so pick harmless default
20260 netdb_net_type='long'
20264 : locate the preferred pager for this system
20271 [a-zA-Z]:/*) dflt=$pg;;
20275 [a-zA-Z]:/*) dflt=$more;;
20279 [a-zA-Z]:/*) dflt=$less;;
20282 '') dflt=/usr/ucb/more;;
20290 rp='What pager is used on your system?'
20294 : see what type pids are declared as in the kernel
20295 rp="What is the type of process ids on this system?"
20296 set pid_t pidtype int stdio.h sys/types.h
20299 : see if ar generates random libraries by itself
20301 echo "Checking how to generate random libraries on your machine..." >&4
20302 echo 'int bar1() { return bar2(); }' > bar1.c
20303 echo 'int bar2() { return 2; }' > bar2.c
20305 #$i_stdlib I_STDLIB
20307 #include <stdlib.h>
20309 int main() { printf("%d\n", bar1()); exit(0); }
20311 $cc $ccflags -c bar1.c >/dev/null 2>&1
20312 $cc $ccflags -c bar2.c >/dev/null 2>&1
20313 $cc $ccflags -c foo.c >/dev/null 2>&1
20314 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20315 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20316 $run ./foobar >/dev/null 2>&1; then
20317 echo "$ar appears to generate random libraries itself."
20319 if [ "X$ranlib" = "X" ]; then
20322 elif $ar s bar$_a >/dev/null 2>&1 &&
20323 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20324 $run ./foobar >/dev/null 2>&1; then
20325 echo "a table of contents needs to be added with '$ar s'."
20328 elif $ar ts bar$_a >/dev/null 2>&1 &&
20329 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20330 $run ./foobar >/dev/null 2>&1; then
20331 echo "a table of contents needs to be added with '$ar ts'."
20338 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20339 $test -f $ranlib || ranlib=''
20342 if $test -n "$ranlib"; then
20343 echo "your system has '$ranlib'; we'll use that."
20346 echo "your system doesn't seem to support random libraries"
20347 echo "so we'll use lorder and tsort to order the libraries."
20354 : see if this is a values.h system
20355 set values.h i_values
20358 : Check the max offset that gmtime and localtime accept
20359 echo "Checking max offsets that gmtime () accepts"
20362 define) yyy="#include <values.h>" ;;
20366 case "$sGMTIME_min/$sGMTIME_max" in
20369 #include <sys/types.h>
20378 void gm_check (time_t t, int min_year, int max_year)
20381 if ( tmp == NULL ||
20382 /* Check tm_year overflow */
20383 tmp->tm_year < min_year || tmp->tm_year > max_year)
20394 gm_check (MAXLONG, 69, 0x7fffffff);
20396 if (tmp == NULL || tmp->tm_year < 0) {
20397 for (i = 63; i >= 0; i--) {
20398 time_t x = pt | ((time_t)1 << i);
20399 if (x < 0 || x < pt) continue;
20400 gm_check (x, 69, 0x7fffffff);
20403 printf ("sGMTIME_max=%ld\n", pt);
20412 gm_check (MINLONG, -1900, 70);
20415 for (i = 36; i >= 0; i--) {
20416 time_t x = pt - ((time_t)1 << i);
20417 if (x > 0) continue;
20418 gm_check (x, -1900, 70);
20421 printf ("sGMTIME_min=%ld\n", pt);
20425 int main (int argc, char *argv[])
20427 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20434 if eval $compile; then
20437 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20443 echo "Checking max offsets that localtime () accepts"
20445 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20448 #include <sys/types.h>
20457 void local_check (time_t t, int min_year, int max_year)
20459 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20462 tmp = localtime (&t);
20463 if ( tmp == NULL ||
20464 /* Check tm_year overflow */
20465 tmp->tm_year < min_year || tmp->tm_year > max_year)
20469 } /* local_check */
20476 local_check (MAXLONG, 69, 0x7fffffff);
20478 if (tmp == NULL || tmp->tm_year < 0) {
20479 for (i = 63; i >= 0; i--) {
20480 time_t x = pt | ((time_t)1 << i);
20481 if (x < 0 || x < pt) continue;
20482 local_check (x, 69, 0x7fffffff);
20485 printf ("sLOCALTIME_max=%ld\n", pt);
20494 local_check (MINLONG, -1900, 70);
20497 for (i = 36; i >= 0; i--) {
20498 time_t x = pt - ((time_t)1 << i);
20499 if (x > 0) continue;
20500 local_check (x, -1900, 70);
20503 printf ("sLOCALTIME_min=%ld\n", pt);
20507 int main (int argc, char *argv[])
20515 if eval $compile; then
20518 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20524 : check for type of arguments to select.
20525 case "$selecttype" in
20526 '') case "$d_select" in
20530 Checking to see what type of arguments are accepted by select().
20532 hdrs="$define sys/types.h
20533 $i_systime sys/time.h
20534 $i_sysselct sys/select.h
20535 $d_socket sys/socket.h"
20536 : The first arg can be int, unsigned, or size_t
20537 : The last arg may or may not be 'const'
20539 : void pointer has been seen but using that
20540 : breaks the selectminbits test
20541 for xxx in 'fd_set *' 'int *'; do
20542 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20543 for tmo in 'struct timeval *' 'const struct timeval *'; do
20545 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20546 if ./protochk "$try" $hdrs; then
20547 echo "Your system accepts $xxx."
20556 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20557 case "$d_fd_set" in
20558 $define) dflt="fd_set *" ;;
20567 *) : no select, so pick a harmless default
20574 : check for the select 'width'
20575 case "$selectminbits" in
20576 '') safebits=`expr $ptrsize \* 8`
20577 case "$d_select" in
20581 Checking to see on how many bits at a time your select() operates...
20584 #include <sys/types.h>
20586 #$i_systime I_SYS_TIME
20587 #$i_systimek I_SYS_TIME_KERNEL
20592 # ifdef I_SYS_TIME_KERNEL
20595 # include <sys/time.h>
20596 # ifdef I_SYS_TIME_KERNEL
20600 #$i_sysselct I_SYS_SELECT
20601 #ifdef I_SYS_SELECT
20602 #include <sys/select.h>
20604 #$d_socket HAS_SOCKET
20606 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20609 #$i_stdlib I_STDLIB
20611 #include <stdlib.h>
20614 #define S sizeof(*(b))
20616 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20617 #define NBITS (NBYTES * 8)
20619 char *s = (char *)malloc(NBYTES);
20628 fp = fopen("try.c", "r");
20634 b = ($selecttype)s;
20635 for (i = 0; i < NBITS; i++)
20639 select(fd + 1, b, 0, 0, &t);
20640 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20642 printf("%d\n", i + 1);
20647 if eval $compile_ok; then
20648 selectminbits=`$run ./try`
20649 case "$selectminbits" in
20651 Cannot figure out on how many bits at a time your select() operates.
20652 I'll play safe and guess it is $safebits bits.
20654 selectminbits=$safebits
20655 bits="$safebits bits"
20658 *) bits="$selectminbits bits" ;;
20660 echo "Your select() operates on $bits at a time." >&4
20662 rp='What is the minimum number of bits your select() operates on?'
20663 case "$byteorder" in
20664 12345678) dflt=64 ;;
20670 selectminbits="$val"
20674 *) : no select, so pick a harmless default
20675 selectminbits=$safebits
20681 : Trace out the files included by signal.h, then look for SIGxxx names.
20682 if [ "X$fieldn" = X ]; then
20683 : Just make some guesses. We check them later.
20684 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20686 xxx=`echo '#include <signal.h>' |
20687 $cppstdin $cppminus $cppflags 2>/dev/null |
20688 $grep '^[ ]*#.*include' |
20689 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20690 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20693 for xx in $xxx /dev/null ; do
20694 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20696 case "$xxxfiles" in
20697 '') xxxfiles=`./findhdr signal.h` ;;
20700 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20701 print substr($2, 4, 20)
20703 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20704 print substr($3, 4, 20)
20706 : Append some common names just in case the awk scan failed.
20707 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20708 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20709 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20710 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20711 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20713 : generate a few handy files for later
20714 $cat > signal.c <<EOCP
20715 #include <sys/types.h>
20716 #include <signal.h>
20717 #$i_stdlib I_STDLIB
20719 #include <stdlib.h>
20724 /* Strange style to avoid deeply-nested #if/#else/#endif */
20727 # define NSIG (_NSIG)
20733 # define NSIG (SIGMAX+1)
20739 # define NSIG (SIG_MAX+1)
20745 # define NSIG (_SIG_MAX+1)
20751 # define NSIG (MAXSIG+1)
20757 # define NSIG (MAX_SIG+1)
20762 # ifdef SIGARRAYSIZE
20763 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20769 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20773 /* Default to some arbitrary number that's big enough to get most
20774 of the common signals.
20780 printf("NSIG %d\n", NSIG);
20786 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20788 printf "#ifdef SIG"; printf $1; printf "\n"
20789 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20790 printf $1; printf ");\n"
20794 printf "#endif /* JUST_NSIG */\n";
20795 printf "exit(0);\n}\n";
20798 $cat >signal.awk <<'EOP'
20799 BEGIN { ndups = 0 }
20800 $1 ~ /^NSIG$/ { nsig = $2 }
20801 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20802 if ($2 > maxsig) { maxsig = $2 }
20803 if (sig_name[$2]) {
20804 dup_name[ndups] = $1
20805 dup_num[ndups] = $2
20817 printf("NSIG %d\n", nsig);
20818 for (n = 1; n < nsig; n++) {
20820 printf("%s %d\n", sig_name[n], sig_num[n])
20823 printf("NUM%d %d\n", n, n)
20826 for (n = 0; n < ndups; n++) {
20827 printf("%s %d\n", dup_name[n], dup_num[n])
20831 $cat >signal_cmd <<EOS
20833 if $test -s signal.lst; then
20834 echo "Using your existing signal.lst file"
20839 $cat >>signal_cmd <<'EOS'
20842 if eval $compile_ok; then
20843 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20844 $uniq | $awk -f signal.awk >signal.lst
20846 echo "(I can't seem be able to compile the whole test program)" >&4
20847 echo "(I'll try it in little pieces.)" >&4
20848 set signal -DJUST_NSIG
20849 if eval $compile_ok; then
20850 $run ./signal$_exe > signal.nsg
20853 echo "I can't seem to figure out how many signals you have." >&4
20854 echo "Guessing 50." >&4
20855 echo 'NSIG 50' > signal.nsg
20857 : Now look at all the signal names, one at a time.
20858 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20859 $cat > signal.c <<EOCP
20860 #include <sys/types.h>
20861 #include <signal.h>
20864 printf("$xx %d\n", SIG${xx});
20869 if eval $compile; then
20870 echo "SIG${xx} found."
20871 $run ./signal$_exe >> signal.ls1
20873 echo "SIG${xx} NOT found."
20876 if $test -s signal.ls1; then
20877 $cat signal.nsg signal.ls1 |
20878 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20882 if $test -s signal.lst; then
20885 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20886 echo 'kill -l' >signal
20887 set X `csh -f <signal`
20891 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20893 echo $@ | $tr ' ' $trnl | \
20894 $awk '{ printf "%s %d\n", $1, ++s; }
20895 END { printf "NSIG %d\n", ++s }' >signal.lst
20897 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20899 chmod a+x signal_cmd
20900 $eunicefix signal_cmd
20902 : generate list of signal names
20904 case "$sig_name_init" in
20906 *) case "$sig_num_init" in
20907 ''|*,*) doinit=yes ;;
20912 echo "Generating a list of signal names and numbers..." >&4
20914 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20915 sig_name=`$awk 'BEGIN { printf "ZERO " }
20916 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20917 sig_num=`$awk 'BEGIN { printf "0 " }
20918 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20919 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20920 !/^NSIG/ { printf "\"%s\", ", $1 }
20921 END { printf "0\n" }' signal.lst`
20922 sig_num_init=`$awk 'BEGIN { printf "0, " }
20923 !/^NSIG/ { printf "%d, ", $2}
20924 END { printf "0\n"}' signal.lst`
20927 echo "The following $sig_count signals are available:"
20929 echo $sig_name | $awk \
20930 'BEGIN { linelen = 0 }
20932 for (i = 1; i <= NF; i++) {
20933 name = "SIG" $i " "
20934 linelen = linelen + length(name)
20935 if (linelen > 70) {
20937 linelen = length(name)
20943 sig_size=`echo $sig_name | awk '{print NF}'`
20944 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20946 : Check size of size
20948 case "$sizetype" in
20949 *_t) zzz="$sizetype" ;;
20950 *) zzz="filesize" ;;
20952 echo "Checking the size of $zzz..." >&4
20954 #include <sys/types.h>
20956 #$i_stdlib I_STDLIB
20958 #include <stdlib.h>
20961 printf("%d\n", (int)sizeof($sizetype));
20966 if eval $compile_ok; then
20970 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20973 echo "Your $zzz size is $sizesize bytes."
20978 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20982 : check for socklen_t
20984 echo "Checking to see if you have socklen_t..." >&4
20986 #include <sys/types.h>
20987 #$d_socket HAS_SOCKET
20989 #include <sys/socket.h>
20991 int main() { socklen_t x = 16; }
20994 if eval $compile; then
20996 echo "You have socklen_t."
20999 echo "You do not have socklen_t."
21000 case "$sizetype" in
21001 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21008 : see if this is a socks.h system
21009 set socks.h i_socks
21012 : check for type of the size argument to socket calls
21013 case "$d_socket" in
21017 Checking to see what type is the last argument of accept().
21020 case "$d_socklen_t" in
21021 "$define") yyy="$yyy socklen_t"
21023 yyy="$yyy $sizetype int long unsigned"
21024 for xxx in $yyy; do
21025 case "$socksizetype" in
21026 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21027 case "$usesocks" in
21029 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21030 echo "Your system accepts '$xxx *' for the last argument of accept()."
21031 socksizetype="$xxx"
21034 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21035 echo "Your system accepts '$xxx *' for the last argument of accept()."
21036 socksizetype="$xxx"
21043 : In case none of those worked, prompt the user.
21044 case "$socksizetype" in
21045 '') rp='What is the type for socket address structure sizes?'
21052 *) : no sockets, so pick relatively harmless default
21057 : see what type is used for signed size_t
21058 set ssize_t ssizetype int stdio.h sys/types.h
21063 #$i_stdlib I_STDLIB
21065 #include <stdlib.h>
21067 #include <sys/types.h>
21068 #define Size_t $sizetype
21069 #define SSize_t $dflt
21072 if (sizeof(Size_t) == sizeof(SSize_t))
21074 else if (sizeof(Size_t) == sizeof(int))
21083 if eval $compile_ok && $run ./try > /dev/null; then
21084 ssizetype=`$run ./try`
21085 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21088 Help! I can't compile and run the ssize_t test program: please enlighten me!
21089 (This is probably a misconfiguration in your system or libraries, and
21090 you really ought to fix it. Still, I'll try anyway.)
21092 I need a type that is the same size as $sizetype, but is guaranteed to
21093 be signed. Common values are ssize_t, int and long.
21096 rp="What signed type is the same size as $sizetype?"
21102 : Check the size of st_ino
21104 $echo "Checking the size of st_ino..." >&4
21105 $cat > try.c <<EOCP
21106 #include <sys/stat.h>
21108 #$i_stdlib I_STDLIB
21110 #include <stdlib.h>
21114 printf("%d\n", (int)sizeof(st.st_ino));
21119 if eval $compile_ok; then
21123 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
21125 *) st_ino_size=$val
21126 $echo "Your st_ino is $st_ino_size bytes long."
21131 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
21135 : Check if st_ino is signed
21137 $echo "Checking the sign of st_ino..." >&4
21138 $cat > try.c <<EOCP
21139 #include <sys/stat.h>
21144 if (foo.st_ino < 0)
21151 if eval $compile; then
21155 $echo "(I can't execute the test program--guessing unsigned.)" >&4
21157 *) st_ino_sign=$val
21158 case "$st_ino_sign" in
21159 1) $echo "Your st_ino is unsigned." ;;
21160 -1) $echo "Your st_ino is signed." ;;
21166 $echo "(I can't compile the test program--guessing unsigned.)" >&4
21170 : see what type of char stdio uses.
21172 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21173 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21174 echo "Your stdio uses unsigned chars." >&4
21175 stdchar="unsigned char"
21177 echo "Your stdio uses signed chars." >&4
21182 : see what type uids are declared as in the kernel
21184 echo "Looking for the type for user ids returned by getuid()."
21185 set uid_t uidtype xxx stdio.h sys/types.h
21189 xxx=`./findhdr sys/user.h`
21190 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21192 unsigned) dflt="$1 $2" ;;
21196 *) dflt="$uidtype";;
21199 uid_t) echo "uid_t found." ;;
21200 *) rp="What is the type for user ids returned by getuid()?"
21206 : Check size of UID
21209 *_t) zzz="$uidtype" ;;
21212 echo "Checking the size of $zzz..." >&4
21214 #include <sys/types.h>
21216 #$i_stdlib I_STDLIB
21218 #include <stdlib.h>
21221 printf("%d\n", (int)sizeof($uidtype));
21226 if eval $compile_ok; then
21230 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21233 echo "Your $zzz is $uidsize bytes long."
21238 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21241 : Check if UID is signed
21244 *_t) zzz="$uidtype" ;;
21247 echo "Checking the sign of $zzz..." >&4
21249 #include <sys/types.h>
21260 if eval $compile; then
21264 echo "(I can't execute the test program--guessing unsigned.)" >&4
21268 1) echo "Your $zzz is unsigned." ;;
21269 -1) echo "Your $zzz is signed." ;;
21275 echo "(I can't compile the test program--guessing unsigned.)" >&4
21279 : Check format string for UID
21281 $echo "Checking the format string to be used for uids..." >&4
21284 -1) if $test X"$uidsize" = X"$ivsize"; then
21285 uidformat="$ivdformat"
21287 if $test X"$uidsize" = X"$longsize"; then
21290 if $test X"$uidsize" = X"$intsize"; then
21293 if $test X"$uidsize" = X"$shortsize"; then
21300 *) if $test X"$uidsize" = X"$uvsize"; then
21301 uidformat="$uvuformat"
21303 if $test X"$uidsize" = X"$longsize"; then
21306 if $test X"$uidsize" = X"$intsize"; then
21309 if $test X"$uidsize" = X"$shortsize"; then
21318 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
21320 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
21321 $cat >try.c <<'EOM'
21322 /* Intentionally a long probe as I'd like to sanity check that the exact
21323 approach is going to work, as thinking it will work, but only having it
21324 part working at runtime is worse than not having it. */
21326 #include <sys/types.h>
21327 #include <sys/sysctl.h>
21328 #include <sys/param.h>
21330 #include <string.h>
21331 #include <stdlib.h>
21332 #include <unistd.h>
21335 main(int argc, char **argv) {
21337 char *argv_leaf = strrchr(argv[0], '/');
21343 mib[1] = KERN_PROC;
21344 mib[2] = KERN_PROC_PATHNAME;
21348 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21352 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
21357 if (size < strlen(argv_leaf) + 1) {
21358 fprintf(stderr, "size %lu is too short for a path\n",
21359 (unsigned long) size);
21363 if (size > MAXPATHLEN * MAXPATHLEN) {
21364 fprintf(stderr, "size %lu is too long for a path\n",
21365 (unsigned long) size);
21369 buffer = malloc(size);
21375 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
21380 if (strlen(buffer) + 1 != size) {
21381 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
21382 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
21387 if (*buffer != '/') {
21388 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
21392 if (strstr(buffer, "/./")) {
21393 fprintf(stderr, "Contains /./: '%s'\n", buffer);
21397 if (strstr(buffer, "/../")) {
21398 fprintf(stderr, "Contains /../: '%s'\n", buffer);
21402 buffer_leaf = strrchr(buffer, '/');
21403 if (strcmp(buffer_leaf, argv_leaf) != 0) {
21404 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
21416 if eval $compile; then
21417 if $run ./try; then
21418 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
21421 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
21425 echo "I'm unable to compile the test program." >&4
21426 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
21430 set usekernprocpathname
21433 : Determine if we can use _NSGetExecutablePath to find executing program
21435 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
21436 $cat >try.c <<'EOM'
21437 /* Intentionally a long probe as I'd like to sanity check that the exact
21438 approach is going to work, as thinking it will work, but only having it
21439 part working at runtime is worse than not having it. */
21440 #include <mach-o/dyld.h>
21442 #include <stdlib.h>
21443 #include <sys/param.h>
21444 #include <string.h>
21447 main(int argc, char **argv) {
21449 uint32_t size = sizeof(buf);
21453 char *argv_leaf = strrchr(argv[0], '/');
21457 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21461 _NSGetExecutablePath(buf, &size);
21462 if (size > MAXPATHLEN * MAXPATHLEN) {
21463 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
21464 (unsigned int) size);
21468 buffer = malloc(size);
21474 result = _NSGetExecutablePath(buffer, &size);
21476 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
21477 result, (unsigned int) size);
21481 tidied = realpath(buffer, NULL);
21483 perror("realpath");
21489 if (*tidied != '/') {
21490 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
21494 if (strstr(tidied, "/./")) {
21495 fprintf(stderr, "Contains /./: '%s'\n", tidied);
21499 if (strstr(tidied, "/../")) {
21500 fprintf(stderr, "Contains /../: '%s'\n", tidied);
21504 tidied_leaf = strrchr(tidied, '/');
21505 if (strcmp(tidied_leaf, argv_leaf) != 0) {
21506 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
21518 if eval $compile; then
21519 if $run ./try; then
21520 echo "You can use _NSGetExecutablePath to find the executing program." >&4
21523 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
21526 echo "I'm unable to compile the test program." >&4
21527 echo "I'll assume no _NSGetExecutablePath here." >&4
21530 set usensgetexecutablepath
21533 : Check if site customization support was requested
21534 case "$usesitecustomize" in
21535 $define|true|[Yy]*)
21536 usesitecustomize="$define"
21539 usesitecustomize="$undef"
21543 : see if prototypes support variable argument declarations
21545 case "$prototype$i_stdarg" in
21547 echo "It appears we'll be able to prototype varargs functions." >&4
21551 echo "Too bad... We won't be using prototyped varargs functions..." >&4
21558 : determine compiler compiler
21567 if $test -f "$byacc$_exe"; then
21569 comp="byacc or $comp"
21571 if $test -f "$bison$_exe"; then
21572 comp="$comp or bison -y"
21574 rp="Which compiler compiler ($comp) shall I use?"
21583 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
21589 : see if this is a assert.h system
21590 set assert.h i_assert
21593 : see if this is a fp.h system
21597 : see if this is a fp_class.h system
21598 set fp_class.h i_fp_class
21601 : see if gdbm.h is available
21606 : see if gdbm_open exists
21607 set gdbm_open d_gdbm_open
21609 case "$d_gdbm_open" in
21612 echo "We won't be including <gdbm.h>"
21621 : see if this is a ieeefp.h system
21622 case "$i_ieeefp" in
21623 '' ) set ieeefp.h i_ieeefp
21628 : see if this is a libutil.h system
21629 set libutil.h i_libutil
21632 : see if mach cthreads are available
21633 if test "X$usethreads" = "X$define"; then
21634 set mach/cthreads.h i_machcthr
21637 i_machcthr="$undef"
21640 : see if this is a mntent.h system
21641 set mntent.h i_mntent
21644 : see if net/errno.h is available
21646 set net/errno.h val
21649 : Unfortunately, it causes problems on some systems. Arrgh.
21652 cat > try.c <<'EOM'
21655 #include <net/errno.h>
21661 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21662 echo "We'll be including <net/errno.h>." >&4
21664 echo "We won't be including <net/errno.h>." >&4
21673 : see if netinet/tcp.h is available
21674 set netinet/tcp.h i_netinettcp
21677 : see if this is a poll.h system
21681 : see if this is a prot.h system
21685 : Preprocessor symbols
21687 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21688 $cat <<'EOSH' > Cppsym.know
21689 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21690 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21691 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21692 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21693 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21694 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21695 bull c cadmus clipper CMU COFF COMPILER_VERSION
21696 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21697 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21698 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21699 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21701 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21702 H3050R H3050RX hbullx20 hcx host_mips
21703 hp200 hp300 hp700 HP700 hp800 hp9000
21704 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21705 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21706 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21707 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21708 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21709 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21710 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21711 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21712 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21713 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21714 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21715 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21716 MATH_HAS_NO_SIDE_EFFECTS
21717 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21718 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21719 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21720 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21721 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21722 NetBSD news1500 news1700 news1800 news1900 news3700
21723 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21724 ns32016 ns32332 ns32k nsc32000
21725 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21726 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21727 pc532 pdp11 PGC PIC plexus PORTAR posix
21728 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21729 POSIX_C_SOURCE POSIX_SOURCE POWER
21730 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21731 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21732 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21733 sony sony_news sonyrisc sparc sparclite spectrum
21734 stardent stdc STDC_EXT stratos sun sun3 sun386
21735 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21736 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21737 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21738 sysV68 sysV88 Tek4132 Tek4300 titan
21739 TM3200 TM5400 TM5600
21740 tower tower32 tower32_200 tower32_600 tower32_700
21741 tower32_800 tower32_850 tss
21742 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21743 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21744 unix UNIX95 UNIX99 unixpc unos
21745 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21746 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21747 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21749 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21750 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21751 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21754 # Maybe put other stuff here too.
21755 cat <<EOSH >>Cppsym.know
21758 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21759 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21760 $cat Cppsym.know > Cppsym.c
21761 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21762 $rm -f Cppsym.a Cppsym.b Cppsym.c
21763 cat <<EOSH > Cppsym
21765 if $test \$# -gt 0; then
21766 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21767 if $test -s Cppsym.got; then
21774 $tr " " "$trnl" | ./Cppsym.try
21780 cat <<EOSH > Cppsym.try
21782 cat <<'EOCP' > try.c
21785 #define STRINGIFY(a) "a"
21787 #if cpp_stuff == 42
21788 #define StGiFy(a) #a
21789 #define STRINGIFY(a) StGiFy(a)
21791 #if $cpp_stuff != 1 && $cpp_stuff != 42
21792 # include "Bletch: How does this C preprocessor stringify macros?"
21798 cat <<'EOSH' >> Cppsym.try
21800 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21801 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21802 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21803 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21805 echo 'return 0;}' >> try.c
21807 cat <<EOSH >> Cppsym.try
21809 case "$osname-$gccversion" in
21810 irix-) ccflags="\$ccflags -woff 1178" ;;
21811 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21813 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21815 chmod +x Cppsym.try
21816 $eunicefix Cppsym.try
21817 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
21818 : Add in any Linux cpp "predefined macros":
21819 case "$osname::$gccversion" in
21820 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
21822 rm -f $tHdrH'.h' $tHdrH
21824 # Filter out macro arguments, such as Linux's __INT8_C(c)
21825 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21826 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21827 if [ -s $tHdrH'_cppsym.real' ]; then
21828 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21831 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21834 : now check the C compiler for additional symbols
21835 postprocess_cc_v=''
21837 aix) postprocess_cc_v="|$tr , ' '" ;;
21844 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21847 -D*) echo "\$i" | $sed 's/^-D//';;
21848 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21853 postprocess_cc_v=''
21856 ./ccsym > ccsym1.raw
21857 if $test -s ccsym1.raw; then
21858 $sort ccsym1.raw | $uniq >ccsym.raw
21860 mv ccsym1.raw ccsym.raw
21863 $awk '/\=/ { print $0; next }
21864 { print $0"=1" }' ccsym.raw >ccsym.list
21865 $comm -13 Cppsym.true ccsym.list >ccsym.own
21866 $comm -12 Cppsym.true ccsym.list >ccsym.com
21867 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21869 if $test -z ccsym.raw; then
21870 echo "Your C compiler doesn't seem to define any symbols!" >&4
21872 echo "However, your C preprocessor defines the following symbols:"
21875 cppsymbols=`$cat Cppsym.true`
21876 cppsymbols=`echo $cppsymbols`
21877 cppccsymbols="$cppsymbols"
21879 if $test -s ccsym.com; then
21880 echo "Your C compiler and pre-processor define these symbols:"
21881 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
21884 cppccsymbols=`$cat ccsym.com`
21885 cppccsymbols=`echo $cppccsymbols`
21886 $test "$silent" || sleep 1
21888 if $test -s ccsym.cpp; then
21889 $test "$also" && echo " "
21890 echo "Your C pre-processor ${also}defines the following symbols:"
21891 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
21893 cppsymbols=`$cat ccsym.cpp`
21894 cppsymbols=`echo $cppsymbols`
21895 $test "$silent" || sleep 1
21897 if $test -s ccsym.own; then
21898 $test "$also" && echo " "
21899 echo "Your C compiler ${also}defines the following cpp symbols:"
21900 $sed -e 's/\(..*\)=1/\1/' ccsym.own
21901 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
21902 ccsymbols=`$cat ccsym.own`
21903 ccsymbols=`echo $ccsymbols`
21904 $test "$silent" || sleep 1
21908 : see if this is a termio system
21912 if $test `./findhdr termios.h`; then
21913 set tcsetattr i_termios
21919 "$define") echo "You have POSIX termios.h... good!" >&4;;
21920 *) if ./Cppsym pyr; then
21921 case "`/bin/universe`" in
21922 ucb) if $test `./findhdr sgtty.h`; then
21924 echo "<sgtty.h> found." >&4
21926 echo "System is pyramid with BSD universe."
21927 ./warn "<sgtty.h> not found--you could have problems."
21929 *) if $test `./findhdr termio.h`; then
21931 echo "<termio.h> found." >&4
21933 echo "System is pyramid with USG universe."
21934 ./warn "<termio.h> not found--you could have problems."
21938 if $test `./findhdr termio.h`; then
21939 echo "<termio.h> found." >&4
21941 elif $test `./findhdr sgtty.h`; then
21942 echo "<sgtty.h> found." >&4
21945 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
21948 if $test `./findhdr sgtty.h`; then
21949 echo "<sgtty.h> found." >&4
21951 elif $test `./findhdr termio.h`; then
21952 echo "<termio.h> found." >&4
21955 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
21959 set i_termio; eval $setvar
21960 val=$val2; set i_sgtty; eval $setvar
21961 val=$val3; set i_termios; eval $setvar
21963 : see if stdbool is available
21964 : we want a real compile instead of Inhdr because some Solaris systems
21965 : have stdbool.h, but it can only be used if the compiler indicates it
21966 : is sufficiently c99-compliant.
21970 #include <stdbool.h>
21975 int main(int argc, char **argv)
21981 if eval $compile; then
21982 echo "<stdbool.h> found." >&4
21985 echo "<stdbool.h> NOT found." >&4
21992 : see if stddef is available
21993 set stddef.h i_stddef
21996 : see if sys/access.h is available
21997 set sys/access.h i_sysaccess
22000 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
22001 set sys/filio.h i_sysfilio
22004 if $test `./findhdr sys/ioctl.h`; then
22006 echo '<sys/ioctl.h> found.' >&4
22009 if $test $i_sysfilio = "$define"; then
22010 echo '<sys/ioctl.h> NOT found.' >&4
22012 $test $i_sgtty = "$define" && xxx="sgtty.h"
22013 $test $i_termio = "$define" && xxx="termio.h"
22014 $test $i_termios = "$define" && xxx="termios.h"
22015 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
22021 : see if socket ioctl defs are in sys/sockio.h
22023 xxx=`./findhdr sys/sockio.h`
22024 if $test "$xxx"; then
22025 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
22027 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
22030 echo "No socket ioctls found in <sys/sockio.h>." >&4
22035 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
22041 : see if this is a syslog.h system
22042 set syslog.h i_syslog
22045 : see if this is a sys/mode.h system
22046 set sys/mode.h i_sysmode
22049 : see if there is a sys/poll.h file
22050 set sys/poll.h i_syspoll
22053 : see if sys/resource.h has to be included
22054 set sys/resource.h i_sysresrc
22057 : see if sys/security.h is available
22058 set sys/security.h i_syssecrt
22061 : see if this is a sys/statvfs.h system
22062 set sys/statvfs.h i_sysstatvfs
22065 : see if this is a sys/un.h system
22066 set sys/un.h i_sysun
22069 : see if this is a sys/utsname.h system
22070 set sys/utsname.h i_sysutsname
22073 : see if this is a syswait system
22074 set sys/wait.h i_syswait
22077 : see if this is a ustat.h system
22078 set ustat.h i_ustat
22081 : see if this is an utime system
22082 set utime.h i_utime
22085 : see if this is a vfork system
22088 set vfork.h i_vfork
22098 echo "Looking for extensions..." >&4
22099 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
22100 : contain old or inaccurate or duplicate values.
22101 nonxs_extensions=''
22103 : We do not use find because it might not be available.
22104 : We do not just use MANIFEST because the user may have dropped
22105 : some additional extensions into the source tree and expect them
22108 : Function to recursively find available extensions, ignoring DynaLoader
22109 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
22110 : In 5.10.1 and later, extensions are stored in directories
22111 : like File-Glob instead of the older File/Glob/.
22115 DynaLoader|dynaload) ;;
22117 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
22118 case "$this_ext" in
22119 Scalar/List/Utils) this_ext="List/Util";;
22120 PathTools) this_ext="Cwd";;
22122 echo " $xs_extensions $nonxs_extensions" > $$.tmp;
22123 if $contains " $this_ext " $$.tmp; then
22125 echo "Duplicate directories detected for extension $xxx" >&4;
22126 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
22127 case "$knowitall" in
22135 echo "Ok. Stopping Configure." >&4;
22136 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
22139 echo "Ok. You will need to correct config.sh before running make." >&4;
22141 $ls -1 $xxx > $$.tmp;
22142 if $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
22143 xs_extensions="$xs_extensions $this_ext";
22144 elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then
22145 xs_extensions="$xs_extensions $this_ext";
22146 elif $test -d $xxx; then
22147 nonxs_extensions="$nonxs_extensions $this_ext";
22157 eval $find_extensions
22161 eval $find_extensions
22165 eval $find_extensions
22166 set X $xs_extensions
22168 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22169 set X $nonxs_extensions
22171 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22173 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
22175 : Now see which are supported on this system.
22177 for xxx in $xs_extensions ; do
22181 $define) avail_ext="$avail_ext $xxx" ;;
22184 GDBM_File|gdbm_fil)
22186 $define) avail_ext="$avail_ext $xxx" ;;
22189 I18N/Langinfo|i18n_lan)
22190 case "$i_langinfo$d_nl_langinfo" in
22191 $define$define) avail_ext="$avail_ext $xxx" ;;
22195 : XXX Do we need a useipcsysv variable here
22196 case "${d_msg}${d_sem}${d_shm}" in
22197 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
22200 NDBM_File|ndbm_fil)
22203 case "$osname-$use64bitint" in
22206 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
22209 *) avail_ext="$avail_ext $xxx" ;;
22214 ODBM_File|odbm_fil)
22215 case "${i_dbm}${i_rpcsvcdbm}" in
22217 case "$d_cplusplus" in
22218 define) ;; # delete as a function name will not work
22219 *) case "$osname-$use64bitint" in
22222 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
22225 *) avail_ext="$avail_ext $xxx" ;;
22233 case "$useopcode" in
22234 true|define|y) avail_ext="$avail_ext $xxx" ;;
22238 case "$useposix" in
22239 true|define|y) avail_ext="$avail_ext $xxx" ;;
22243 case "$d_socket" in
22244 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22247 Sys/Syslog|sys/syslog)
22248 : XXX syslog requires socket
22249 case "$d_socket" in
22250 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22254 case "$usethreads" in
22256 case "$use5005threads" in
22257 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
22261 threads|threads/shared)
22262 # threads and threads::shared are special cases.
22263 # To stop people from asking "Perl 5.8.0 was supposed
22264 # to have this new fancy threads implementation but my
22265 # perl doesn't have it" and from people trying to
22266 # (re)install the threads module using CPAN.pm and
22267 # CPAN.pm then offering to reinstall Perl 5.8.0,
22268 # the threads.pm and threads/shared.pm will always be
22269 # there, croaking informatively ("you need to rebuild
22270 # all of Perl with threads, sorry") when threads haven't
22271 # been compiled in.
22273 avail_ext="$avail_ext $xxx"
22279 cygwin) avail_ext="$avail_ext $xxx" ;;
22282 XS/APItest|xs/apitest)
22283 # This is just for testing. Skip it unless we have dynamic loading.
22286 $define) avail_ext="$avail_ext $xxx" ;;
22289 XS/Typemap|xs/typemap)
22290 # This is just for testing. Skip it unless we have dynamic loading.
22292 $define) avail_ext="$avail_ext $xxx" ;;
22295 *) avail_ext="$avail_ext $xxx"
22304 case "$onlyextensions" in
22306 *) keepextensions=''
22307 echo "You have requested that only certain extensions be included..." >&4
22308 for i in $onlyextensions; do
22309 case " $avail_ext " in
22311 echo "Keeping extension $i."
22312 keepextensions="$keepextensions $i"
22314 *) echo "Ignoring extension $i." ;;
22317 avail_ext="$keepextensions"
22321 case "$noextensions" in
22323 *) keepextensions=''
22324 echo "You have requested that certain extensions be ignored..." >&4
22325 for i in $avail_ext; do
22326 case " $noextensions " in
22327 *" $i "*) echo "Ignoring extension $i." ;;
22328 *) echo "Keeping extension $i.";
22329 keepextensions="$keepextensions $i"
22333 avail_ext="$keepextensions"
22337 : Now see which nonxs extensions are supported on this system.
22338 : For now assume all are.
22340 for xxx in $nonxs_extensions ; do
22344 *) nonxs_ext="$nonxs_ext $xxx"
22356 A number of extensions are supplied with $package. You may choose to
22357 compile these extensions for dynamic loading (the default), compile
22358 them into the $package executable (static loading), or not include
22359 them at all. Answer "none" to include no extensions.
22360 Note that DynaLoader is always built and need not be mentioned here.
22363 case "$dynamic_ext" in
22365 : Exclude those listed in static_ext
22367 for xxx in $avail_ext; do
22368 case " $static_ext " in
22370 *) dflt="$dflt $xxx" ;;
22377 *) dflt="$dynamic_ext"
22378 # Perhaps we are reusing an old out-of-date config.sh.
22381 if test X"$dynamic_ext" != X"$avail_ext"; then
22383 NOTICE: Your previous config.sh list may be incorrect.
22384 The extensions now available to you are
22386 but the default list from your previous config.sh is
22398 rp="What extensions do you wish to load dynamically?"
22401 none) dynamic_ext=' ' ;;
22402 *) dynamic_ext="$ans" ;;
22405 case "$static_ext" in
22407 : Exclude those already listed in dynamic linking
22409 for xxx in $avail_ext; do
22410 case " $dynamic_ext " in
22412 *) dflt="$dflt $xxx" ;;
22419 *) dflt="$static_ext"
22426 rp="What extensions do you wish to load statically?"
22429 none) static_ext=' ' ;;
22430 *) static_ext="$ans" ;;
22435 A number of extensions are supplied with $package. Answer "none"
22436 to include no extensions.
22437 Note that DynaLoader is always built and need not be mentioned here.
22440 case "$static_ext" in
22441 '') dflt="$avail_ext" ;;
22442 *) dflt="$static_ext"
22443 # Perhaps we are reusing an old out-of-date config.sh.
22446 if test X"$static_ext" != X"$avail_ext"; then
22448 NOTICE: Your previous config.sh list may be incorrect.
22449 The extensions now available to you are
22451 but the default list from your previous config.sh is
22460 : Exclude those that are not xs extensions
22464 rp="What extensions do you wish to include?"
22467 none) static_ext=' ' ;;
22468 *) static_ext="$ans" ;;
22473 # Encode is a special case. If we are building Encode as a static
22474 # extension, we need to explicitly list its subextensions as well.
22475 # For other nested extensions, this is handled automatically by
22476 # the appropriate Makefile.PL.
22477 case " $static_ext " in
22478 *" Encode "*) # Add the subextensions of Encode
22480 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22481 static_ext="$static_ext Encode/$xxx"
22482 known_extensions="$known_extensions Encode/$xxx"
22488 set X $dynamic_ext $static_ext $nonxs_ext
22492 # Sanity check: We require an extension suitable for use with
22493 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22494 # should show up as failures in the test suite, but it's helpful to
22495 # catch them now.) The 'extensions' list is normally sorted
22496 # alphabetically, so we need to accept either
22497 # DB_File ... Fcntl ... IO ....
22498 # or something like
22499 # Fcntl ... NDBM_File ... IO ....
22500 case " $extensions" in
22501 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22502 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22503 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22504 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22505 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22509 : Remove libraries needed only for extensions
22510 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22511 : The exception is SunOS 4.x, which needs them.
22512 case "${osname}X${osvers}" in
22516 *) case "$usedl" in
22517 $define|true|[yY]*)
22518 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22522 *) perllibs="$libs"
22528 : Remove build directory name from cppstdin so it can be used from
22529 : either the present location or the final installed location.
22531 : Get out of the UU directory to get correct path name.
22533 case "$cppstdin" in
22535 echo "Stripping down cppstdin path name"
22541 : end of configuration questions
22543 echo "End of configuration questions."
22546 : back to where it started
22547 if test -d ../UU; then
22551 : configuration may be unconditionally patched via a 'config.arch' file
22552 if $test -f config.arch; then
22553 echo "I see a config.arch file, loading it." >&4
22557 : configuration may be patched via a 'config.over' file
22558 if $test -f config.over; then
22561 rp='I see a config.over file. Do you wish to load it?'
22564 n*) echo "OK, I'll ignore it.";;
22566 echo "Configuration override changes have been loaded."
22571 : in case they want portability, strip down executable paths
22572 case "$d_portable" in
22575 echo "Stripping down executable paths..." >&4
22576 for file in $loclist $trylist; do
22578 eval $file=`basename $temp`
22583 : create config.sh file
22585 echo "Creating config.sh..." >&4
22586 $spitshell <<EOT >config.sh
22589 # This file was produced by running the Configure script. It holds all the
22590 # definitions figured out by Configure. Should you modify one of these values,
22591 # do not forget to propagate your changes by running "Configure -der". You may
22592 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22595 # Package name : $package
22596 # Source directory : $src
22597 # Configuration time: $cf_time
22598 # Configured by : $cf_by
22599 # Target system : $myuname
22602 : Add in command line options if available
22603 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22605 $spitshell <<EOT >>config.sh
22614 Revision='$Revision'
22622 alignbytes='$alignbytes'
22623 ansi2knr='$ansi2knr'
22624 aphostname='$aphostname'
22625 api_revision='$api_revision'
22626 api_subversion='$api_subversion'
22627 api_version='$api_version'
22628 api_versionstring='$api_versionstring'
22631 archlibexp='$archlibexp'
22632 archname64='$archname64'
22633 archname='$archname'
22634 archobjs='$archobjs'
22635 asctime_r_proto='$asctime_r_proto'
22643 bootstrap_charset='$bootstrap_charset'
22645 byteorder='$byteorder'
22647 castflags='$castflags'
22650 cccdlflags='$cccdlflags'
22651 ccdlflags='$ccdlflags'
22653 ccflags_uselargefiles='$ccflags_uselargefiles'
22655 ccsymbols='$ccsymbols'
22656 ccversion='$ccversion'
22658 cf_email='$cf_email'
22660 charbits='$charbits'
22661 charsize='$charsize'
22665 clocktype='$clocktype'
22667 compress='$compress'
22668 contains='$contains'
22672 cpp_stuff='$cpp_stuff'
22673 cppccsymbols='$cppccsymbols'
22674 cppflags='$cppflags'
22676 cppminus='$cppminus'
22678 cppstdin='$cppstdin'
22679 cppsymbols='$cppsymbols'
22680 crypt_r_proto='$crypt_r_proto'
22681 cryptlib='$cryptlib'
22683 ctermid_r_proto='$ctermid_r_proto'
22684 ctime_r_proto='$ctime_r_proto'
22685 d_Gconvert='$d_Gconvert'
22686 d_PRIEUldbl='$d_PRIEUldbl'
22687 d_PRIFUldbl='$d_PRIFUldbl'
22688 d_PRIGUldbl='$d_PRIGUldbl'
22689 d_PRIXU64='$d_PRIXU64'
22690 d_PRId64='$d_PRId64'
22691 d_PRIeldbl='$d_PRIeldbl'
22692 d_PRIfldbl='$d_PRIfldbl'
22693 d_PRIgldbl='$d_PRIgldbl'
22694 d_PRIi64='$d_PRIi64'
22695 d_PRIo64='$d_PRIo64'
22696 d_PRIu64='$d_PRIu64'
22697 d_PRIx64='$d_PRIx64'
22698 d_SCNfldbl='$d_SCNfldbl'
22699 d__fwalk='$d__fwalk'
22700 d_access='$d_access'
22701 d_accessx='$d_accessx'
22704 d_archlib='$d_archlib'
22705 d_asctime64='$d_asctime64'
22706 d_asctime_r='$d_asctime_r'
22709 d_attribute_deprecated='$d_attribute_deprecated'
22710 d_attribute_format='$d_attribute_format'
22711 d_attribute_malloc='$d_attribute_malloc'
22712 d_attribute_nonnull='$d_attribute_nonnull'
22713 d_attribute_noreturn='$d_attribute_noreturn'
22714 d_attribute_pure='$d_attribute_pure'
22715 d_attribute_unused='$d_attribute_unused'
22716 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22720 d_bsdgetpgrp='$d_bsdgetpgrp'
22721 d_bsdsetpgrp='$d_bsdsetpgrp'
22722 d_builtin_choose_expr='$d_builtin_choose_expr'
22723 d_builtin_expect='$d_builtin_expect'
22725 d_c99_variadic_macros='$d_c99_variadic_macros'
22726 d_casti32='$d_casti32'
22727 d_castneg='$d_castneg'
22728 d_charvspr='$d_charvspr'
22730 d_chroot='$d_chroot'
22731 d_chsize='$d_chsize'
22733 d_clearenv='$d_clearenv'
22734 d_closedir='$d_closedir'
22735 d_cmsghdr_s='$d_cmsghdr_s'
22737 d_copysignl='$d_copysignl'
22738 d_cplusplus='$d_cplusplus'
22740 d_crypt_r='$d_crypt_r'
22742 d_ctermid='$d_ctermid'
22743 d_ctermid_r='$d_ctermid_r'
22744 d_ctime64='$d_ctime64'
22745 d_ctime_r='$d_ctime_r'
22746 d_cuserid='$d_cuserid'
22747 d_dbl_dig='$d_dbl_dig'
22748 d_dbminitproto='$d_dbminitproto'
22749 d_difftime64='$d_difftime64'
22750 d_difftime='$d_difftime'
22751 d_dir_dd_fd='$d_dir_dd_fd'
22753 d_dirnamlen='$d_dirnamlen'
22754 d_dlerror='$d_dlerror'
22755 d_dlopen='$d_dlopen'
22756 d_dlsymun='$d_dlsymun'
22757 d_dosuid='$d_dosuid'
22758 d_drand48_r='$d_drand48_r'
22759 d_drand48proto='$d_drand48proto'
22761 d_eaccess='$d_eaccess'
22762 d_endgrent='$d_endgrent'
22763 d_endgrent_r='$d_endgrent_r'
22764 d_endhent='$d_endhent'
22765 d_endhostent_r='$d_endhostent_r'
22766 d_endnent='$d_endnent'
22767 d_endnetent_r='$d_endnetent_r'
22768 d_endpent='$d_endpent'
22769 d_endprotoent_r='$d_endprotoent_r'
22770 d_endpwent='$d_endpwent'
22771 d_endpwent_r='$d_endpwent_r'
22772 d_endsent='$d_endsent'
22773 d_endservent_r='$d_endservent_r'
22774 d_eofnblk='$d_eofnblk'
22775 d_eunice='$d_eunice'
22776 d_faststdio='$d_faststdio'
22777 d_fchdir='$d_fchdir'
22778 d_fchmod='$d_fchmod'
22779 d_fchown='$d_fchown'
22781 d_fcntl_can_lock='$d_fcntl_can_lock'
22782 d_fd_macros='$d_fd_macros'
22783 d_fd_set='$d_fd_set'
22784 d_fds_bits='$d_fds_bits'
22785 d_fgetpos='$d_fgetpos'
22786 d_finite='$d_finite'
22787 d_finitel='$d_finitel'
22788 d_flexfnam='$d_flexfnam'
22790 d_flockproto='$d_flockproto'
22792 d_fp_class='$d_fp_class'
22793 d_fpathconf='$d_fpathconf'
22794 d_fpclass='$d_fpclass'
22795 d_fpclassify='$d_fpclassify'
22796 d_fpclassl='$d_fpclassl'
22797 d_fpos64_t='$d_fpos64_t'
22798 d_frexpl='$d_frexpl'
22799 d_fs_data_s='$d_fs_data_s'
22800 d_fseeko='$d_fseeko'
22801 d_fsetpos='$d_fsetpos'
22802 d_fstatfs='$d_fstatfs'
22803 d_fstatvfs='$d_fstatvfs'
22805 d_ftello='$d_ftello'
22807 d_futimes='$d_futimes'
22808 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
22809 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
22810 d_getaddrinfo='$d_getaddrinfo'
22811 d_getcwd='$d_getcwd'
22812 d_getespwnam='$d_getespwnam'
22813 d_getfsstat='$d_getfsstat'
22814 d_getgrent='$d_getgrent'
22815 d_getgrent_r='$d_getgrent_r'
22816 d_getgrgid_r='$d_getgrgid_r'
22817 d_getgrnam_r='$d_getgrnam_r'
22818 d_getgrps='$d_getgrps'
22819 d_gethbyaddr='$d_gethbyaddr'
22820 d_gethbyname='$d_gethbyname'
22821 d_gethent='$d_gethent'
22822 d_gethname='$d_gethname'
22823 d_gethostbyaddr_r='$d_gethostbyaddr_r'
22824 d_gethostbyname_r='$d_gethostbyname_r'
22825 d_gethostent_r='$d_gethostent_r'
22826 d_gethostprotos='$d_gethostprotos'
22827 d_getitimer='$d_getitimer'
22828 d_getlogin='$d_getlogin'
22829 d_getlogin_r='$d_getlogin_r'
22830 d_getmnt='$d_getmnt'
22831 d_getmntent='$d_getmntent'
22832 d_getnameinfo='$d_getnameinfo'
22833 d_getnbyaddr='$d_getnbyaddr'
22834 d_getnbyname='$d_getnbyname'
22835 d_getnent='$d_getnent'
22836 d_getnetbyaddr_r='$d_getnetbyaddr_r'
22837 d_getnetbyname_r='$d_getnetbyname_r'
22838 d_getnetent_r='$d_getnetent_r'
22839 d_getnetprotos='$d_getnetprotos'
22840 d_getpagsz='$d_getpagsz'
22841 d_getpbyname='$d_getpbyname'
22842 d_getpbynumber='$d_getpbynumber'
22843 d_getpent='$d_getpent'
22844 d_getpgid='$d_getpgid'
22845 d_getpgrp2='$d_getpgrp2'
22846 d_getpgrp='$d_getpgrp'
22847 d_getppid='$d_getppid'
22848 d_getprior='$d_getprior'
22849 d_getprotobyname_r='$d_getprotobyname_r'
22850 d_getprotobynumber_r='$d_getprotobynumber_r'
22851 d_getprotoent_r='$d_getprotoent_r'
22852 d_getprotoprotos='$d_getprotoprotos'
22853 d_getprpwnam='$d_getprpwnam'
22854 d_getpwent='$d_getpwent'
22855 d_getpwent_r='$d_getpwent_r'
22856 d_getpwnam_r='$d_getpwnam_r'
22857 d_getpwuid_r='$d_getpwuid_r'
22858 d_getsbyname='$d_getsbyname'
22859 d_getsbyport='$d_getsbyport'
22860 d_getsent='$d_getsent'
22861 d_getservbyname_r='$d_getservbyname_r'
22862 d_getservbyport_r='$d_getservbyport_r'
22863 d_getservent_r='$d_getservent_r'
22864 d_getservprotos='$d_getservprotos'
22865 d_getspnam='$d_getspnam'
22866 d_getspnam_r='$d_getspnam_r'
22867 d_gettimeod='$d_gettimeod'
22868 d_gmtime64='$d_gmtime64'
22869 d_gmtime_r='$d_gmtime_r'
22870 d_gnulibc='$d_gnulibc'
22871 d_grpasswd='$d_grpasswd'
22872 d_hasmntopt='$d_hasmntopt'
22874 d_ilogbl='$d_ilogbl'
22875 d_inc_version_list='$d_inc_version_list'
22877 d_inetaton='$d_inetaton'
22878 d_inetntop='$d_inetntop'
22879 d_inetpton='$d_inetpton'
22880 d_int64_t='$d_int64_t'
22881 d_ip_mreq='$d_ip_mreq'
22882 d_ip_mreq_source='$d_ip_mreq_source'
22883 d_ipv6_mreq='$d_ipv6_mreq'
22884 d_ipv6_mreq_source='$d_ipv6_mreq_source'
22885 d_isascii='$d_isascii'
22886 d_isblank='$d_isblank'
22887 d_isfinite='$d_isfinite'
22890 d_isnanl='$d_isnanl'
22891 d_killpg='$d_killpg'
22892 d_lchown='$d_lchown'
22893 d_ldbl_dig='$d_ldbl_dig'
22894 d_libm_lib_version='$d_libm_lib_version'
22896 d_localtime64='$d_localtime64'
22897 d_localtime_r='$d_localtime_r'
22898 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
22899 d_locconv='$d_locconv'
22901 d_longdbl='$d_longdbl'
22902 d_longlong='$d_longlong'
22903 d_lseekproto='$d_lseekproto'
22905 d_madvise='$d_madvise'
22906 d_malloc_good_size='$d_malloc_good_size'
22907 d_malloc_size='$d_malloc_size'
22909 d_mbstowcs='$d_mbstowcs'
22910 d_mbtowc='$d_mbtowc'
22911 d_memchr='$d_memchr'
22912 d_memcmp='$d_memcmp'
22913 d_memcpy='$d_memcpy'
22914 d_memmove='$d_memmove'
22915 d_memset='$d_memset'
22917 d_mkdtemp='$d_mkdtemp'
22918 d_mkfifo='$d_mkfifo'
22919 d_mkstemp='$d_mkstemp'
22920 d_mkstemps='$d_mkstemps'
22921 d_mktime64='$d_mktime64'
22922 d_mktime='$d_mktime'
22925 d_modfl_pow32_bug='$d_modfl_pow32_bug'
22926 d_modflproto='$d_modflproto'
22927 d_mprotect='$d_mprotect'
22929 d_msg_ctrunc='$d_msg_ctrunc'
22930 d_msg_dontroute='$d_msg_dontroute'
22931 d_msg_oob='$d_msg_oob'
22932 d_msg_peek='$d_msg_peek'
22933 d_msg_proxy='$d_msg_proxy'
22934 d_msgctl='$d_msgctl'
22935 d_msgget='$d_msgget'
22936 d_msghdr_s='$d_msghdr_s'
22937 d_msgrcv='$d_msgrcv'
22938 d_msgsnd='$d_msgsnd'
22940 d_munmap='$d_munmap'
22941 d_mymalloc='$d_mymalloc'
22943 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
22945 d_nl_langinfo='$d_nl_langinfo'
22946 d_nv_preserves_uv='$d_nv_preserves_uv'
22947 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
22948 d_off64_t='$d_off64_t'
22949 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
22950 d_oldpthreads='$d_oldpthreads'
22951 d_oldsock='$d_oldsock'
22953 d_pathconf='$d_pathconf'
22955 d_perl_otherlibdirs='$d_perl_otherlibdirs'
22956 d_phostname='$d_phostname'
22959 d_portable='$d_portable'
22961 d_prctl_set_name='$d_prctl_set_name'
22962 d_printf_format_null='$d_printf_format_null'
22963 d_procselfexe='$d_procselfexe'
22964 d_pseudofork='$d_pseudofork'
22965 d_pthread_atfork='$d_pthread_atfork'
22966 d_pthread_attr_setscope='$d_pthread_attr_setscope'
22967 d_pthread_yield='$d_pthread_yield'
22969 d_pwchange='$d_pwchange'
22970 d_pwclass='$d_pwclass'
22971 d_pwcomment='$d_pwcomment'
22972 d_pwexpire='$d_pwexpire'
22973 d_pwgecos='$d_pwgecos'
22974 d_pwpasswd='$d_pwpasswd'
22975 d_pwquota='$d_pwquota'
22978 d_random_r='$d_random_r'
22979 d_readdir64_r='$d_readdir64_r'
22980 d_readdir='$d_readdir'
22981 d_readdir_r='$d_readdir_r'
22982 d_readlink='$d_readlink'
22984 d_recvmsg='$d_recvmsg'
22985 d_rename='$d_rename'
22986 d_rewinddir='$d_rewinddir'
22988 d_safebcpy='$d_safebcpy'
22989 d_safemcpy='$d_safemcpy'
22990 d_sanemcmp='$d_sanemcmp'
22991 d_sbrkproto='$d_sbrkproto'
22992 d_scalbnl='$d_scalbnl'
22993 d_sched_yield='$d_sched_yield'
22994 d_scm_rights='$d_scm_rights'
22995 d_seekdir='$d_seekdir'
22996 d_select='$d_select'
22998 d_semctl='$d_semctl'
22999 d_semctl_semid_ds='$d_semctl_semid_ds'
23000 d_semctl_semun='$d_semctl_semun'
23001 d_semget='$d_semget'
23003 d_sendmsg='$d_sendmsg'
23004 d_setegid='$d_setegid'
23005 d_seteuid='$d_seteuid'
23006 d_setgrent='$d_setgrent'
23007 d_setgrent_r='$d_setgrent_r'
23008 d_setgrps='$d_setgrps'
23009 d_sethent='$d_sethent'
23010 d_sethostent_r='$d_sethostent_r'
23011 d_setitimer='$d_setitimer'
23012 d_setlinebuf='$d_setlinebuf'
23013 d_setlocale='$d_setlocale'
23014 d_setlocale_r='$d_setlocale_r'
23015 d_setnent='$d_setnent'
23016 d_setnetent_r='$d_setnetent_r'
23017 d_setpent='$d_setpent'
23018 d_setpgid='$d_setpgid'
23019 d_setpgrp2='$d_setpgrp2'
23020 d_setpgrp='$d_setpgrp'
23021 d_setprior='$d_setprior'
23022 d_setproctitle='$d_setproctitle'
23023 d_setprotoent_r='$d_setprotoent_r'
23024 d_setpwent='$d_setpwent'
23025 d_setpwent_r='$d_setpwent_r'
23026 d_setregid='$d_setregid'
23027 d_setresgid='$d_setresgid'
23028 d_setresuid='$d_setresuid'
23029 d_setreuid='$d_setreuid'
23030 d_setrgid='$d_setrgid'
23031 d_setruid='$d_setruid'
23032 d_setsent='$d_setsent'
23033 d_setservent_r='$d_setservent_r'
23034 d_setsid='$d_setsid'
23035 d_setvbuf='$d_setvbuf'
23038 d_shmatprototype='$d_shmatprototype'
23039 d_shmctl='$d_shmctl'
23041 d_shmget='$d_shmget'
23042 d_sigaction='$d_sigaction'
23043 d_signbit='$d_signbit'
23044 d_sigprocmask='$d_sigprocmask'
23045 d_sigsetjmp='$d_sigsetjmp'
23046 d_sin6_scope_id='$d_sin6_scope_id'
23047 d_sitearch='$d_sitearch'
23048 d_snprintf='$d_snprintf'
23049 d_sockaddr_in6='$d_sockaddr_in6'
23050 d_sockaddr_sa_len='$d_sockaddr_sa_len'
23051 d_sockatmark='$d_sockatmark'
23052 d_sockatmarkproto='$d_sockatmarkproto'
23053 d_socket='$d_socket'
23054 d_socklen_t='$d_socklen_t'
23055 d_sockpair='$d_sockpair'
23056 d_socks5_init='$d_socks5_init'
23057 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
23059 d_srand48_r='$d_srand48_r'
23060 d_srandom_r='$d_srandom_r'
23061 d_sresgproto='$d_sresgproto'
23062 d_sresuproto='$d_sresuproto'
23063 d_statblks='$d_statblks'
23064 d_statfs_f_flags='$d_statfs_f_flags'
23065 d_statfs_s='$d_statfs_s'
23066 d_static_inline='$d_static_inline'
23067 d_statvfs='$d_statvfs'
23068 d_stdio_cnt_lval='$d_stdio_cnt_lval'
23069 d_stdio_ptr_lval='$d_stdio_ptr_lval'
23070 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
23071 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
23072 d_stdio_stream_array='$d_stdio_stream_array'
23073 d_stdiobase='$d_stdiobase'
23074 d_stdstdio='$d_stdstdio'
23075 d_strchr='$d_strchr'
23076 d_strcoll='$d_strcoll'
23077 d_strctcpy='$d_strctcpy'
23078 d_strerrm='$d_strerrm'
23079 d_strerror='$d_strerror'
23080 d_strerror_r='$d_strerror_r'
23081 d_strftime='$d_strftime'
23082 d_strlcat='$d_strlcat'
23083 d_strlcpy='$d_strlcpy'
23084 d_strtod='$d_strtod'
23085 d_strtol='$d_strtol'
23086 d_strtold='$d_strtold'
23087 d_strtoll='$d_strtoll'
23088 d_strtoq='$d_strtoq'
23089 d_strtoul='$d_strtoul'
23090 d_strtoull='$d_strtoull'
23091 d_strtouq='$d_strtouq'
23092 d_strxfrm='$d_strxfrm'
23093 d_suidsafe='$d_suidsafe'
23094 d_symlink='$d_symlink'
23095 d_syscall='$d_syscall'
23096 d_syscallproto='$d_syscallproto'
23097 d_sysconf='$d_sysconf'
23098 d_sysernlst='$d_sysernlst'
23099 d_syserrlst='$d_syserrlst'
23100 d_system='$d_system'
23101 d_tcgetpgrp='$d_tcgetpgrp'
23102 d_tcsetpgrp='$d_tcsetpgrp'
23103 d_telldir='$d_telldir'
23104 d_telldirproto='$d_telldirproto'
23106 d_timegm='$d_timegm'
23108 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
23109 d_tm_tm_zone='$d_tm_tm_zone'
23110 d_tmpnam_r='$d_tmpnam_r'
23111 d_truncate='$d_truncate'
23112 d_ttyname_r='$d_ttyname_r'
23113 d_tzname='$d_tzname'
23114 d_u32align='$d_u32align'
23115 d_ualarm='$d_ualarm'
23118 d_union_semun='$d_union_semun'
23119 d_unordered='$d_unordered'
23120 d_unsetenv='$d_unsetenv'
23121 d_usleep='$d_usleep'
23122 d_usleepproto='$d_usleepproto'
23124 d_vendorarch='$d_vendorarch'
23125 d_vendorbin='$d_vendorbin'
23126 d_vendorlib='$d_vendorlib'
23127 d_vendorscript='$d_vendorscript'
23129 d_void_closedir='$d_void_closedir'
23130 d_voidsig='$d_voidsig'
23131 d_voidtty='$d_voidtty'
23132 d_volatile='$d_volatile'
23133 d_vprintf='$d_vprintf'
23134 d_vsnprintf='$d_vsnprintf'
23136 d_waitpid='$d_waitpid'
23137 d_wcstombs='$d_wcstombs'
23138 d_wctomb='$d_wctomb'
23139 d_writev='$d_writev'
23142 db_hashtype='$db_hashtype'
23143 db_prefixtype='$db_prefixtype'
23144 db_version_major='$db_version_major'
23145 db_version_minor='$db_version_minor'
23146 db_version_patch='$db_version_patch'
23147 direntrytype='$direntrytype'
23150 doublesize='$doublesize'
23152 drand48_r_proto='$drand48_r_proto'
23154 dynamic_ext='$dynamic_ext'
23160 endgrent_r_proto='$endgrent_r_proto'
23161 endhostent_r_proto='$endhostent_r_proto'
23162 endnetent_r_proto='$endnetent_r_proto'
23163 endprotoent_r_proto='$endprotoent_r_proto'
23164 endpwent_r_proto='$endpwent_r_proto'
23165 endservent_r_proto='$endservent_r_proto'
23166 eunicefix='$eunicefix'
23169 extensions='$extensions'
23170 extern_C='$extern_C'
23172 fflushNULL='$fflushNULL'
23173 fflushall='$fflushall'
23175 firstmakefile='$firstmakefile'
23177 fpossize='$fpossize'
23178 fpostype='$fpostype'
23179 freetype='$freetype'
23182 full_csh='$full_csh'
23183 full_sed='$full_sed'
23184 gccansipedantic='$gccansipedantic'
23185 gccosandvers='$gccosandvers'
23186 gccversion='$gccversion'
23187 getgrent_r_proto='$getgrent_r_proto'
23188 getgrgid_r_proto='$getgrgid_r_proto'
23189 getgrnam_r_proto='$getgrnam_r_proto'
23190 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
23191 gethostbyname_r_proto='$gethostbyname_r_proto'
23192 gethostent_r_proto='$gethostent_r_proto'
23193 getlogin_r_proto='$getlogin_r_proto'
23194 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
23195 getnetbyname_r_proto='$getnetbyname_r_proto'
23196 getnetent_r_proto='$getnetent_r_proto'
23197 getprotobyname_r_proto='$getprotobyname_r_proto'
23198 getprotobynumber_r_proto='$getprotobynumber_r_proto'
23199 getprotoent_r_proto='$getprotoent_r_proto'
23200 getpwent_r_proto='$getpwent_r_proto'
23201 getpwnam_r_proto='$getpwnam_r_proto'
23202 getpwuid_r_proto='$getpwuid_r_proto'
23203 getservbyname_r_proto='$getservbyname_r_proto'
23204 getservbyport_r_proto='$getservbyport_r_proto'
23205 getservent_r_proto='$getservent_r_proto'
23206 getspnam_r_proto='$getspnam_r_proto'
23207 gidformat='$gidformat'
23213 gmtime_r_proto='$gmtime_r_proto'
23214 gnulibc_version='$gnulibc_version'
23216 groupcat='$groupcat'
23217 groupstype='$groupstype'
23220 h_sysfile='$h_sysfile'
23223 html1dir='$html1dir'
23224 html1direxp='$html1direxp'
23225 html3dir='$html3dir'
23226 html3direxp='$html3direxp'
23235 i_arpainet='$i_arpainet'
23236 i_assert='$i_assert'
23237 i_bsdioctl='$i_bsdioctl'
23241 i_dirent='$i_dirent'
23246 i_fp_class='$i_fp_class'
23248 i_gdbm_ndbm='$i_gdbm_ndbm'
23249 i_gdbmndbm='$i_gdbmndbm'
23251 i_ieeefp='$i_ieeefp'
23252 i_inttypes='$i_inttypes'
23253 i_langinfo='$i_langinfo'
23254 i_libutil='$i_libutil'
23255 i_limits='$i_limits'
23256 i_locale='$i_locale'
23257 i_machcthr='$i_machcthr'
23258 i_malloc='$i_malloc'
23259 i_mallocmalloc='$i_mallocmalloc'
23261 i_memory='$i_memory'
23262 i_mntent='$i_mntent'
23265 i_neterrno='$i_neterrno'
23266 i_netinettcp='$i_netinettcp'
23270 i_pthread='$i_pthread'
23272 i_rpcsvcdbm='$i_rpcsvcdbm'
23274 i_shadow='$i_shadow'
23276 i_stdarg='$i_stdarg'
23277 i_stdbool='$i_stdbool'
23278 i_stddef='$i_stddef'
23279 i_stdlib='$i_stdlib'
23280 i_string='$i_string'
23281 i_sunmath='$i_sunmath'
23282 i_sysaccess='$i_sysaccess'
23283 i_sysdir='$i_sysdir'
23284 i_sysfile='$i_sysfile'
23285 i_sysfilio='$i_sysfilio'
23287 i_sysioctl='$i_sysioctl'
23288 i_syslog='$i_syslog'
23289 i_sysmman='$i_sysmman'
23290 i_sysmode='$i_sysmode'
23291 i_sysmount='$i_sysmount'
23292 i_sysndir='$i_sysndir'
23293 i_sysparam='$i_sysparam'
23294 i_syspoll='$i_syspoll'
23295 i_sysresrc='$i_sysresrc'
23296 i_syssecrt='$i_syssecrt'
23297 i_sysselct='$i_sysselct'
23298 i_syssockio='$i_syssockio'
23299 i_sysstat='$i_sysstat'
23300 i_sysstatfs='$i_sysstatfs'
23301 i_sysstatvfs='$i_sysstatvfs'
23302 i_systime='$i_systime'
23303 i_systimek='$i_systimek'
23304 i_systimes='$i_systimes'
23305 i_systypes='$i_systypes'
23306 i_sysuio='$i_sysuio'
23308 i_sysutsname='$i_sysutsname'
23309 i_sysvfs='$i_sysvfs'
23310 i_syswait='$i_syswait'
23311 i_termio='$i_termio'
23312 i_termios='$i_termios'
23314 i_unistd='$i_unistd'
23317 i_values='$i_values'
23318 i_varargs='$i_varargs'
23319 i_varhdr='$i_varhdr'
23321 ignore_versioned_solibs='$ignore_versioned_solibs'
23322 inc_version_list='$inc_version_list'
23323 inc_version_list_init='$inc_version_list_init'
23326 initialinstalllocation='$initialinstalllocation'
23327 installarchlib='$installarchlib'
23328 installbin='$installbin'
23329 installhtml1dir='$installhtml1dir'
23330 installhtml3dir='$installhtml3dir'
23331 installman1dir='$installman1dir'
23332 installman3dir='$installman3dir'
23333 installprefix='$installprefix'
23334 installprefixexp='$installprefixexp'
23335 installprivlib='$installprivlib'
23336 installscript='$installscript'
23337 installsitearch='$installsitearch'
23338 installsitebin='$installsitebin'
23339 installsitehtml1dir='$installsitehtml1dir'
23340 installsitehtml3dir='$installsitehtml3dir'
23341 installsitelib='$installsitelib'
23342 installsiteman1dir='$installsiteman1dir'
23343 installsiteman3dir='$installsiteman3dir'
23344 installsitescript='$installsitescript'
23345 installstyle='$installstyle'
23346 installusrbinperl='$installusrbinperl'
23347 installvendorarch='$installvendorarch'
23348 installvendorbin='$installvendorbin'
23349 installvendorhtml1dir='$installvendorhtml1dir'
23350 installvendorhtml3dir='$installvendorhtml3dir'
23351 installvendorlib='$installvendorlib'
23352 installvendorman1dir='$installvendorman1dir'
23353 installvendorman3dir='$installvendorman3dir'
23354 installvendorscript='$installvendorscript'
23356 issymlink='$issymlink'
23357 ivdformat='$ivdformat'
23360 known_extensions='$known_extensions'
23363 ld_can_script='$ld_can_script'
23364 lddlflags='$lddlflags'
23366 ldflags_uselargefiles='$ldflags_uselargefiles'
23367 ldlibpthname='$ldlibpthname'
23374 libsdirs='$libsdirs'
23375 libsfiles='$libsfiles'
23376 libsfound='$libsfound'
23377 libspath='$libspath'
23378 libswanted='$libswanted'
23379 libswanted_uselargefiles='$libswanted_uselargefiles'
23385 localtime_r_proto='$localtime_r_proto'
23386 locincpth='$locincpth'
23387 loclibpth='$loclibpth'
23388 longdblsize='$longdblsize'
23389 longlongsize='$longlongsize'
23390 longsize='$longsize'
23394 lseeksize='$lseeksize'
23395 lseektype='$lseektype'
23398 madlyobj='$madlyobj'
23399 madlysrc='$madlysrc'
23403 make_set_make='$make_set_make'
23404 mallocobj='$mallocobj'
23405 mallocsrc='$mallocsrc'
23406 malloctype='$malloctype'
23408 man1direxp='$man1direxp'
23411 man3direxp='$man3direxp'
23413 mips_type='$mips_type'
23414 mistrustnm='$mistrustnm'
23416 mmaptype='$mmaptype'
23417 modetype='$modetype'
23419 multiarch='$multiarch'
23421 myarchname='$myarchname'
23422 mydomain='$mydomain'
23423 myhostname='$myhostname'
23426 need_va_copy='$need_va_copy'
23427 netdb_hlen_type='$netdb_hlen_type'
23428 netdb_host_type='$netdb_host_type'
23429 netdb_name_type='$netdb_name_type'
23430 netdb_net_type='$netdb_net_type'
23433 nm_so_opt='$nm_so_opt'
23434 nonxs_ext='$nonxs_ext'
23436 nvEUformat='$nvEUformat'
23437 nvFUformat='$nvFUformat'
23438 nvGUformat='$nvGUformat'
23439 nv_overflows_integers_at='$nv_overflows_integers_at'
23440 nv_preserves_uv_bits='$nv_preserves_uv_bits'
23441 nveformat='$nveformat'
23442 nvfformat='$nvfformat'
23443 nvgformat='$nvgformat'
23446 o_nonblock='$o_nonblock'
23448 old_pthread_create_joinable='$old_pthread_create_joinable'
23449 optimize='$optimize'
23450 orderlib='$orderlib'
23453 otherlibdirs='$otherlibdirs'
23457 patchlevel='$patchlevel'
23458 path_sep='$path_sep'
23461 perl_patchlevel='$perl_patchlevel'
23462 perl_static_inline='$perl_static_inline'
23463 perladmin='$perladmin'
23464 perllibs='$perllibs'
23465 perlpath='$perlpath'
23467 phostname='$phostname'
23473 prefixexp='$prefixexp'
23475 privlibexp='$privlibexp'
23476 procselfexe='$procselfexe'
23477 prototype='$prototype'
23479 quadkind='$quadkind'
23480 quadtype='$quadtype'
23481 randbits='$randbits'
23482 randfunc='$randfunc'
23483 random_r_proto='$random_r_proto'
23484 randseedtype='$randseedtype'
23486 rd_nodata='$rd_nodata'
23487 readdir64_r_proto='$readdir64_r_proto'
23488 readdir_r_proto='$readdir_r_proto'
23489 revision='$revision'
23495 sGMTIME_max='$sGMTIME_max'
23496 sGMTIME_min='$sGMTIME_min'
23497 sLOCALTIME_max='$sLOCALTIME_max'
23498 sLOCALTIME_min='$sLOCALTIME_min'
23499 sPRIEUldbl='$sPRIEUldbl'
23500 sPRIFUldbl='$sPRIFUldbl'
23501 sPRIGUldbl='$sPRIGUldbl'
23502 sPRIXU64='$sPRIXU64'
23504 sPRIeldbl='$sPRIeldbl'
23505 sPRIfldbl='$sPRIfldbl'
23506 sPRIgldbl='$sPRIgldbl'
23511 sSCNfldbl='$sSCNfldbl'
23512 sched_yield='$sched_yield'
23513 scriptdir='$scriptdir'
23514 scriptdirexp='$scriptdirexp'
23516 seedfunc='$seedfunc'
23517 selectminbits='$selectminbits'
23518 selecttype='$selecttype'
23519 sendmail='$sendmail'
23520 setgrent_r_proto='$setgrent_r_proto'
23521 sethostent_r_proto='$sethostent_r_proto'
23522 setlocale_r_proto='$setlocale_r_proto'
23523 setnetent_r_proto='$setnetent_r_proto'
23524 setprotoent_r_proto='$setprotoent_r_proto'
23525 setpwent_r_proto='$setpwent_r_proto'
23526 setservent_r_proto='$setservent_r_proto'
23529 sharpbang='$sharpbang'
23530 shmattype='$shmattype'
23531 shortsize='$shortsize'
23534 sig_count='$sig_count'
23535 sig_name='$sig_name'
23536 sig_name_init='$sig_name_init'
23538 sig_num_init='$sig_num_init'
23539 sig_size='$sig_size'
23540 signal_t='$signal_t'
23541 sitearch='$sitearch'
23542 sitearchexp='$sitearchexp'
23544 sitebinexp='$sitebinexp'
23545 sitehtml1dir='$sitehtml1dir'
23546 sitehtml1direxp='$sitehtml1direxp'
23547 sitehtml3dir='$sitehtml3dir'
23548 sitehtml3direxp='$sitehtml3direxp'
23550 sitelib_stem='$sitelib_stem'
23551 sitelibexp='$sitelibexp'
23552 siteman1dir='$siteman1dir'
23553 siteman1direxp='$siteman1direxp'
23554 siteman3dir='$siteman3dir'
23555 siteman3direxp='$siteman3direxp'
23556 siteprefix='$siteprefix'
23557 siteprefixexp='$siteprefixexp'
23558 sitescript='$sitescript'
23559 sitescriptexp='$sitescriptexp'
23560 sizesize='$sizesize'
23561 sizetype='$sizetype'
23565 sockethdr='$sockethdr'
23566 socketlib='$socketlib'
23567 socksizetype='$socksizetype'
23569 spackage='$spackage'
23570 spitshell='$spitshell'
23571 srand48_r_proto='$srand48_r_proto'
23572 srandom_r_proto='$srandom_r_proto'
23574 ssizetype='$ssizetype'
23575 st_ino_sign='$st_ino_sign'
23576 st_ino_size='$st_ino_size'
23577 startperl='$startperl'
23579 static_ext='$static_ext'
23581 stdio_base='$stdio_base'
23582 stdio_bufsiz='$stdio_bufsiz'
23583 stdio_cnt='$stdio_cnt'
23584 stdio_filbuf='$stdio_filbuf'
23585 stdio_ptr='$stdio_ptr'
23586 stdio_stream_array='$stdio_stream_array'
23587 strerror_r_proto='$strerror_r_proto'
23590 subversion='$subversion'
23594 targetarch='$targetarch'
23598 timeincl='$timeincl'
23599 timetype='$timetype'
23600 tmpnam_r_proto='$tmpnam_r_proto'
23606 ttyname_r_proto='$ttyname_r_proto'
23615 uidformat='$uidformat'
23621 uquadtype='$uquadtype'
23622 use5005threads='$use5005threads'
23623 use64bitall='$use64bitall'
23624 use64bitint='$use64bitint'
23625 usecrosscompile='$usecrosscompile'
23626 usedevel='$usedevel'
23628 usedtrace='$usedtrace'
23629 usefaststdio='$usefaststdio'
23630 useithreads='$useithreads'
23631 usekernprocpathname='$usekernprocpathname'
23632 uselargefiles='$uselargefiles'
23633 uselongdouble='$uselongdouble'
23634 usemallocwrap='$usemallocwrap'
23635 usemorebits='$usemorebits'
23636 usemultiplicity='$usemultiplicity'
23637 usemymalloc='$usemymalloc'
23639 usensgetexecutablepath='$usensgetexecutablepath'
23640 useopcode='$useopcode'
23641 useperlio='$useperlio'
23642 useposix='$useposix'
23643 usereentrant='$usereentrant'
23644 userelocatableinc='$userelocatableinc'
23645 useshrplib='$useshrplib'
23646 usesitecustomize='$usesitecustomize'
23647 usesocks='$usesocks'
23648 usethreads='$usethreads'
23649 usevendorprefix='$usevendorprefix'
23650 useversionedarchname='$useversionedarchname'
23651 usevfork='$usevfork'
23654 uvXUformat='$uvXUformat'
23655 uvoformat='$uvoformat'
23658 uvuformat='$uvuformat'
23659 uvxformat='$uvxformat'
23661 vendorarch='$vendorarch'
23662 vendorarchexp='$vendorarchexp'
23663 vendorbin='$vendorbin'
23664 vendorbinexp='$vendorbinexp'
23665 vendorhtml1dir='$vendorhtml1dir'
23666 vendorhtml1direxp='$vendorhtml1direxp'
23667 vendorhtml3dir='$vendorhtml3dir'
23668 vendorhtml3direxp='$vendorhtml3direxp'
23669 vendorlib='$vendorlib'
23670 vendorlib_stem='$vendorlib_stem'
23671 vendorlibexp='$vendorlibexp'
23672 vendorman1dir='$vendorman1dir'
23673 vendorman1direxp='$vendorman1direxp'
23674 vendorman3dir='$vendorman3dir'
23675 vendorman3direxp='$vendorman3direxp'
23676 vendorprefix='$vendorprefix'
23677 vendorprefixexp='$vendorprefixexp'
23678 vendorscript='$vendorscript'
23679 vendorscriptexp='$vendorscriptexp'
23681 version_patchlevel_string='$version_patchlevel_string'
23682 versiononly='$versiononly'
23686 yaccflags='$yaccflags'
23691 : add special variables
23692 $test -f $src/patchlevel.h && \
23693 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23694 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
23695 echo "PERL_CONFIG_SH=true" >>config.sh
23697 : propagate old symbols
23698 if $test -f UU/config.sh; then
23699 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23700 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23701 config.sh config.sh UU/oldconfig.sh |\
23702 $sort | $uniq -u >UU/oldsyms
23703 set X `$cat UU/oldsyms`
23709 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23711 echo ": Variables propagated from previous config.sh file." >>config.sh
23712 for sym in `$cat UU/oldsyms`; do
23713 echo " Propagating $hint variable "'$'"$sym..."
23714 eval 'tmp="$'"${sym}"'"'
23716 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23722 : Finish up by extracting the .SH files
23726 echo "Extraction done."
23736 If you'd like to make any changes to the config.sh file before I begin
23737 to configure things, do it as a shell escape now (e.g. !vi config.sh).
23740 rp="Press return or use a shell escape to edit config.sh:"
23745 *) : in case they cannot read
23746 sh 1>&4 -c "$ans";;
23751 : if this fails, just run all the .SH files by hand
23760 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
23767 Now you need to generate make dependencies by running "$make depend".
23768 You might prefer to run it in background: "$make depend > makedepend.out &"
23769 It can take a while, so you might not want to run it right now.
23774 rp="Run $make depend now?"
23778 $make depend && echo "Now you must run '$make'."
23781 echo "You must run '$make depend' then '$make'."
23784 elif test -f [Mm]akefile; then
23786 echo "Now you must run a $make."
23788 echo "Configure done."
23791 if $test -f Policy.sh; then
23794 If you compile $package on a different machine or from a different object
23795 directory, copy the Policy.sh file from this object directory to the
23796 new one before you run Configure -- this will help you with most of
23797 the policy defaults.
23801 if $test -f config.msg; then
23802 echo "Hmm. I also noted the following information while running:"
23804 $cat config.msg >&4
23807 $rm -f kit*isdone ark*isdone