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 Mon Sep 16 14:37:58 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=''
730 d_ipv6_mreq_source=''
747 d_sprintf_returns_strlen=''
759 perl_static_inline=''
764 d_stdio_ptr_lval_nochange_cnt=''
765 d_stdio_ptr_lval_sets_cnt=''
910 d_gdbm_ndbm_h_uses_prototypes=''
911 d_gdbmndbm_h_uses_prototypes=''
913 d_ndbm_h_uses_prototypes=''
988 d_inc_version_list=''
990 inc_version_list_init=''
1009 ignore_versioned_solibs=''
1073 d_perl_otherlibdirs=''
1081 api_versionstring=''
1087 version_patchlevel_string=''
1091 d_nv_preserves_uv=''
1092 d_nv_zero_is_allbits_zero=''
1103 nv_overflows_integers_at=''
1104 nv_preserves_uv_bits=''
1176 installsitehtml1dir=''
1179 installsitehtml3dir=''
1186 installsiteman1dir=''
1189 installsiteman3dir=''
1194 installsitescript=''
1211 d_stdio_stream_array=''
1212 stdio_stream_array=''
1229 usekernprocpathname=''
1230 ccflags_uselargefiles=''
1231 ldflags_uselargefiles=''
1232 libswanted_uselargefiles=''
1241 usensgetexecutablepath=''
1254 installvendorarch=''
1261 installvendorhtml1dir=''
1263 vendorhtml1direxp=''
1264 installvendorhtml3dir=''
1266 vendorhtml3direxp=''
1272 installvendorman1dir=''
1275 installvendorman3dir=''
1282 installvendorscript=''
1293 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1296 : We must find out about Eunice early
1298 if test -f /etc/unixtovms; then
1299 eunicefix=/etc/unixtovms
1301 if test -f /etc/unixtovms.exe; then
1302 eunicefix=/etc/unixtovms.exe
1305 : Set executable suffix now -- needed before hints available
1306 if test -f "/libs/version.library"; then
1309 elif test -f "/system/gnu_library/bin/ar.pm"; then
1312 elif test -n "$DJGPP"; 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="sfio 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 cat >> try.msg <<'EOQS'
5334 If $libs contains -lsfio, and sfio is mis-configured, then it
5335 sometimes (apparently) runs and exits with a 0 status, but with no
5336 output! It may have to do with sfio's use of _exit vs. exit.
5339 rp="You have a big problem. Shall I abort Configure"
5346 echo "The program compiled OK, but exited with status $?." >>try.msg
5347 rp="You have a problem. Shall I abort Configure"
5351 echo "I can't compile the test program." >>try.msg
5352 rp="You have a BIG problem. Shall I abort Configure"
5358 case "$knowitall" in
5360 echo "(The supplied flags or libraries might be incorrect.)"
5368 *) echo "Ok. Stopping Configure." >&4
5373 n) echo "OK, that should do.";;
5375 $rm_try gcctest gcctest.out
5377 : define a shorthand compile call
5381 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5382 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5386 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5387 : define a shorthand compile call for compilations that should be ok.
5391 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5393 : determine filename position in cpp output
5395 echo "Computing filename position in cpp output for #include directives..." >&4
5397 vos) testaccess=-e ;;
5400 echo '#include <stdio.h>' > foo.c
5403 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5404 $grep '^[ ]*#.*stdio\.h' | \
5405 while read cline; do
5408 while $test \$# -gt 0; do
5409 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5414 pos=\`expr \$pos + 1\`
5426 *) pos="${fieldn}th";;
5428 echo "Your cpp writes the filename in the $pos field of the line."
5431 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5432 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5435 : locate header file
5440 for usrincdir in $usrinc
5442 if test -f \$usrincdir/\$wanted; then
5443 echo "\$usrincdir/\$wanted"
5447 awkprg='{ print \$$fieldn }'
5448 echo "#include <\$wanted>" > foo\$\$.c
5449 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5450 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5451 while read cline; do
5452 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5454 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5455 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5460 # status = 0: grep returned 0 lines, case statement not executed
5461 # status = 1: headerfile found
5462 # status = 2: while loop executed, no headerfile found
5466 if test \$status -eq 1; then
5473 : define an alternate in-header-list? function
5474 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5475 cont=true; xxf="echo \"<\$1> found.\" >&4";
5476 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5477 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5479 case $# in 4) instead=instead;; *) instead="at last";; esac;
5480 while $test "$cont"; do
5482 var=$2; eval "was=\$$2";
5483 if $test "$xxx" && $test -r "$xxx";
5485 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5488 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5489 set $yyy; shift; shift; yyy=$@;
5490 case $# in 0) cont="";;
5491 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5492 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5493 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5494 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5498 do set $yyy; var=$2; eval "was=\$$2";
5499 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5500 set $yyy; shift; shift; yyy=$@;
5503 : see if stdlib is available
5504 set stdlib.h i_stdlib
5507 : check for lengths of integral types
5511 echo "Checking to see how big your integers are..." >&4
5520 printf("intsize=%d;\n", (int)sizeof(int));
5521 printf("longsize=%d;\n", (int)sizeof(long));
5522 printf("shortsize=%d;\n", (int)sizeof(short));
5527 if eval $compile_ok && $run ./try > /dev/null; then
5529 echo "Your integers are $intsize bytes long."
5530 echo "Your long integers are $longsize bytes long."
5531 echo "Your short integers are $shortsize bytes long."
5535 Help! I can't compile and run the intsize test program: please enlighten me!
5536 (This is probably a misconfiguration in your system or libraries, and
5537 you really ought to fix it. Still, I'll try anyway.)
5541 rp="What is the size of an integer (in bytes)?"
5545 rp="What is the size of a long integer (in bytes)?"
5549 rp="What is the size of a short integer (in bytes)?"
5557 : check for long long
5559 echo "Checking to see if you have long long..." >&4
5560 echo 'int main() { long long x = 7; return 0; }' > try.c
5562 if eval $compile; then
5564 echo "You have long long."
5567 echo "You do not have long long."
5573 : check for length of long long
5574 case "${d_longlong}${longlongsize}" in
5577 echo "Checking to see how big your long longs are..." >&4
5578 $cat >try.c <<'EOCP'
5582 printf("%d\n", (int)sizeof(long long));
5587 if eval $compile_ok; then
5588 longlongsize=`$run ./try`
5589 echo "Your long longs are $longlongsize bytes long."
5593 echo "(I can't seem to compile the test program. Guessing...)"
5594 rp="What is the size of a long long (in bytes)?"
5598 if $test "X$longsize" = "X$longlongsize"; then
5599 echo "(That isn't any different from an ordinary long.)"
5605 : see if inttypes.h is available
5606 : we want a real compile instead of Inhdr because some systems
5607 : have an inttypes.h which includes non-existent headers
5610 #include <inttypes.h>
5612 static int32_t foo32 = 0x12345678;
5616 if eval $compile; then
5617 echo "<inttypes.h> found." >&4
5620 echo "<inttypes.h> NOT found." >&4
5629 echo "Checking to see if you have int64_t..." >&4
5631 #include <sys/types.h>
5632 #$i_inttypes I_INTTYPES
5634 #include <inttypes.h>
5636 int main() { int64_t x = 7; }
5639 if eval $compile; then
5641 echo "You have int64_t."
5644 echo "You do not have int64_t."
5650 : Check if 64bit ints have a quad type
5652 echo "Checking which 64-bit integer type we could use..." >&4
5658 val='"unsigned int"'
5663 *) case "$longsize" in
5667 val='"unsigned long"'
5672 *) case "$d_longlong:$longlongsize" in
5677 val='"unsigned long long"'
5682 *) case "$d_int64_t" in
5701 '') echo "Alas, no 64-bit integer types in sight." >&4
5704 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5709 : Do we want 64bit support
5710 case "$uselonglong" in
5711 "$define"|true|[yY]*)
5714 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5716 use64bitint="$define"
5719 case "$use64bits" in
5720 "$define"|true|[yY]*)
5723 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5725 use64bitint="$define"
5728 case "$use64bitints" in
5729 "$define"|true|[yY]*)
5732 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5734 use64bitint="$define"
5737 case "$use64bitsint" in
5738 "$define"|true|[yY]*)
5741 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5743 use64bitint="$define"
5746 case "$uselonglongs" in
5747 "$define"|true|[yY]*)
5750 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5752 use64bitint="$define"
5755 case "$use64bitsall" in
5756 "$define"|true|[yY]*)
5759 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5761 use64bitall="$define"
5766 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5768 case "$use64bitall" in
5769 "$define"|true|[yY]*) use64bitint="$define" ;;
5775 You have natively 64-bit long integers.
5779 *) case "$use64bitint" in
5780 "$define"|true|[yY]*) dflt='y';;
5789 Perl can be built to take advantage of 64-bit integer types
5790 on some systems. To do so, Configure can be run with -Duse64bitint.
5791 Choosing this option will most probably introduce binary incompatibilities.
5793 If this doesn't make any sense to you, just accept the default '$dflt'.
5794 (The default has been chosen based on your configuration.)
5796 rp='Try to use 64-bit integers, if available?'
5799 [yY]*) val="$define" ;;
5807 case "$use64bitall" in
5808 "$define"|true|[yY]*) dflt='y' ;;
5809 *) case "$longsize" in
5817 You may also choose to try maximal 64-bitness. It means using as much
5818 64-bitness as possible on the platform. This in turn means even more
5819 binary incompatibilities. On the other hand, your platform may not
5820 have any more 64-bitness available than what you already have chosen.
5822 If this doesn't make any sense to you, just accept the default '$dflt'.
5823 (The default has been chosen based on your configuration.)
5825 rp='Try to use maximal 64-bit support, if available?'
5828 [yY]*) val="$define" ;;
5833 case "$use64bitall" in
5835 case "$use64bitint" in
5839 Since you have chosen a maximally 64-bit build, I'm also turning on
5840 the use of 64-bit integers.
5842 use64bitint="$define" ;;
5847 : Look for a hint-file generated 'call-back-unit'. If the
5848 : user has specified that a 64-bit perl is to be built,
5849 : we may need to set or change some other defaults.
5850 if $test -f use64bitint.cbu; then
5851 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5854 case "$use64bitint" in
5855 "$define"|true|[yY]*)
5856 : This test was common to all the OpenBSD forks, and seems harmless for
5859 echo "Checking if your C library has broken 64-bit functions..." >&4
5862 typedef $uquadtype myULL;
5869 {4294967303.15, 4294967303ULL},
5870 {4294967294.2, 4294967294ULL},
5871 {4294967295.7, 4294967295ULL},
5874 for (p = test; p->u; p++) {
5875 myULL x = (myULL)p->d;
5886 if eval $compile_ok; then
5888 echo "Your C library's 64-bit functions are $libcquad."
5890 echo "(I can't seem to compile the test program.)"
5891 echo "Assuming that your C library's 64-bit functions are ok."
5900 *** You have a C library with broken 64-bit functions.
5901 *** 64-bit support does not work reliably in this configuration.
5902 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5903 *** Cannot continue, aborting.
5910 4) case "$archname64" in
5911 '') archname64=64int ;;
5918 : Look for a hint-file generated 'call-back-unit'. If the
5919 : user has specified that a maximally 64-bit perl is to be built,
5920 : we may need to set or change some other defaults.
5921 if $test -f use64bitall.cbu; then
5922 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5925 case "$use64bitall" in
5926 "$define"|true|[yY]*)
5928 4) case "$archname64" in
5929 ''|64int) archname64=64all ;;
5936 case "$d_quad:$use64bitint" in
5940 *** You have chosen to use 64-bit integers,
5941 *** but none can be found.
5942 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5943 *** Cannot continue, aborting.
5950 : check for length of double
5952 case "$doublesize" in
5954 echo "Checking to see how big your double precision numbers are..." >&4
5963 printf("%d\n", (int)sizeof(double));
5968 if eval $compile_ok; then
5969 doublesize=`$run ./try`
5970 echo "Your double is $doublesize bytes long."
5973 echo "(I can't seem to compile the test program. Guessing...)"
5974 rp="What is the size of a double precision number (in bytes)?"
5982 : check for long doubles
5984 echo "Checking to see if you have long double..." >&4
5985 echo 'int main() { long double x = 7.0; }' > try.c
5987 if eval $compile; then
5989 echo "You have long double."
5992 echo "You do not have long double."
5998 : check for length of long double
5999 case "${d_longdbl}${longdblsize}" in
6002 echo "Checking to see how big your long doubles are..." >&4
6003 $cat >try.c <<'EOCP'
6007 printf("%d\n", sizeof(long double));
6012 if eval $compile; then
6013 longdblsize=`$run ./try`
6014 echo "Your long doubles are $longdblsize bytes long."
6018 echo "(I can't seem to compile the test program. Guessing...)" >&4
6019 rp="What is the size of a long double (in bytes)?"
6023 if $test "X$doublesize" = "X$longdblsize"; then
6024 echo "That isn't any different from an ordinary double."
6025 echo "I'll keep your setting anyway, but you may see some"
6026 echo "harmless compilation warnings."
6032 : determine the architecture name
6034 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6035 tarch=`arch`"-$osname"
6036 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6037 if uname -m > tmparch 2>&1 ; then
6038 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6039 -e 's/$/'"-$osname/" tmparch`
6047 case "$myarchname" in
6050 echo "(Your architecture name used to be $myarchname.)"
6054 case "$targetarch" in
6056 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6061 *) dflt="$archname";;
6063 rp='What is your architecture name'
6067 : optionally add API version to the architecture for versioned archlibs
6068 case "$useversionedarchname" in
6069 $define|true|[yY]*) dflt='y';;
6072 rp='Add the Perl API version to your archname?'
6075 y|Y) useversionedarchname="$define" ;;
6076 *) useversionedarchname="$undef" ;;
6078 case "$useversionedarchname" in
6081 *-$api_versionstring)
6082 echo "...and architecture name already has -$api_versionstring" >&4
6085 archname="$archname-$api_versionstring"
6086 echo "...setting architecture name to $archname." >&4
6092 case "$usethreads" in
6094 echo "Threads selected." >&4
6096 *-thread*) echo "...and architecture name already has -thread." >&4
6098 *) archname="$archname-thread"
6099 echo "...setting architecture name to $archname." >&4
6104 case "$usemultiplicity" in
6106 echo "Multiplicity selected." >&4
6108 *-multi*) echo "...and architecture name already has -multi." >&4
6110 *) archname="$archname-multi"
6111 echo "...setting architecture name to $archname." >&4
6116 case "$use64bitint$use64bitall" in
6118 case "$archname64" in
6120 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6123 case "$use64bitint" in
6124 "$define") echo "64 bit integers selected." >&4 ;;
6126 case "$use64bitall" in
6127 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6130 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6132 *) archname="$archname-$archname64"
6133 echo "...setting architecture name to $archname." >&4
6139 case "$uselongdouble" in
6141 echo "Long doubles selected." >&4
6142 case "$longdblsize" in
6144 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6148 *-ld*) echo "...and architecture name already has -ld." >&4
6150 *) archname="$archname-ld"
6151 echo "...setting architecture name to $archname." >&4
6158 if $test -f archname.cbu; then
6159 echo "Your platform has some specific hints for architecture name, using them..."
6163 : set the prefixit variable, to compute a suitable default value
6164 prefixit='case "$3" in
6166 case "$oldprefix" in
6167 "") eval "$1=\"\$$2\"";;
6174 ""|" ") eval "$1=\"\$$2\"";;
6180 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6182 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6183 /*-$oldprefix/*|\~*-$oldprefix/*)
6184 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6185 *) eval "$1=\"\$$2\"";;
6189 : determine installation style
6190 : For now, try to deduce it from prefix unless it is already set.
6191 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6192 case "$installstyle" in
6193 '') case "$prefix" in
6194 *perl*) dflt='lib';;
6195 *) dflt='lib/perl5' ;;
6198 *) dflt="$installstyle" ;;
6200 : Probably not worth prompting for this since we prompt for all
6201 : the directories individually, and the prompt would be too long and
6205 : determine where public executables go
6210 rp='Pathname where the public executables will reside?'
6212 if $test "X$ansexp" != "X$binexp"; then
6216 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6217 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6218 : this via initialinstalllocation
6221 case "$userelocatableinc" in
6222 $define|true|[yY]*) dflt='y' ;;
6227 Would you like to build Perl so that the installation is relocatable, so that
6228 library paths in @INC are determined relative to the path of the perl binary?
6229 This is not advised for system Perl installs, or if you need to run setid
6230 scripts or scripts under taint mode.
6232 If this doesn't make any sense to you, just accept the default '$dflt'.
6234 rp='Use relocatable @INC?'
6237 y|Y) val="$define" ;;
6240 set userelocatableinc
6243 initialinstalllocation="$binexp"
6244 : Default prefix is now "up one level from where the binaries are"
6245 case "$userelocatableinc" in
6251 installprefixexp=".../.."
6255 : determine where private library files go
6256 : Usual default is /usr/local/lib/perl5/$version.
6257 : Also allow things like /opt/perl/lib/$version, since
6258 : /opt/perl/lib/perl5... would be redundant.
6259 : The default "style" setting is made in installstyle.U
6260 case "$installstyle" in
6261 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6262 *) set dflt privlib lib/$version ;;
6267 There are some auxiliary files for $package that need to be put into a
6268 private library directory that is accessible by everyone.
6273 rp='Pathname where the private library files will reside?'
6278 : set the prefixup variable, to restore leading tilda escape
6279 prefixup='case "$prefixexp" in
6281 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6284 : determine where public architecture dependent libraries go
6287 : privlib default is /usr/local/lib/$package/$version
6288 : archlib default is /usr/local/lib/$package/$version/$archname
6289 : privlib may have an optional trailing /share.
6290 tdflt=`echo $privlib | $sed 's,/share$,,'`
6291 tdflt=$tdflt/$archname
6300 $spackage contains architecture-dependent library files. If you are
6301 sharing libraries in a heterogeneous environment, you might store
6302 these files in a separate location. Otherwise, you can just include
6303 them with the rest of the public library files.
6308 rp='Where do you want to put the public architecture-dependent libraries?'
6312 if $test X"$archlib" = X"$privlib"; then
6318 : see if setuid scripts can be secure
6321 Some kernels have a bug that prevents setuid #! scripts from being
6322 secure. Some sites have disabled setuid #! scripts because of this.
6324 First let's decide if your kernel supports secure setuid #! scripts.
6325 (If setuid #! scripts would be secure but have been disabled anyway,
6326 don't say that they are secure if asked.)
6331 if $test -d /dev/fd; then
6332 echo "#!$ls" >reflect
6333 chmod +x,u+s reflect
6334 ./reflect >flect 2>&1
6335 if $contains "/dev/fd" flect >/dev/null; then
6336 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6340 If you are not sure if they are secure, I can check but I'll need a
6341 username and password different from the one you are using right now.
6342 If you don't have such a username or don't want me to test, simply
6346 rp='Other username to test security of setuid scripts with?'
6351 case "$d_suidsafe" in
6352 '') echo "I'll assume setuid scripts are *not* secure." >&4
6355 echo "Well, the $hint value is *not* secure." >&4
6357 *) echo "Well, the $hint value *is* secure." >&4
6362 $rm -f reflect flect
6363 echo "#!$ls" >reflect
6364 chmod +x,u+s reflect
6367 echo '"su" will (probably) prompt you for '"$ans's password."
6368 su $ans -c './reflect >flect'
6369 if $contains "/dev/fd" flect >/dev/null; then
6370 echo "Okay, it looks like setuid scripts are secure." >&4
6373 echo "I don't think setuid scripts are secure." >&4
6378 rp='Does your kernel have *secure* setuid scripts?'
6381 [yY]*) val="$define";;
6386 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6387 echo "(That's for file descriptors, not floppy disks.)"
6393 $rm -f reflect flect
6395 : now see if they want to do setuid emulation
6396 if $test $patchlevel -lt 11; then
6399 case "$d_suidsafe" in
6402 echo "No need to emulate SUID scripts since they are secure here." >&4
6406 Some systems have disabled setuid scripts, especially systems where
6407 setuid scripts cannot be secure. On systems where setuid scripts have
6408 been disabled, the setuid/setgid bits on scripts are currently
6409 useless. It is possible for $package to detect those bits and emulate
6410 setuid/setgid in a secure fashion. This emulation will only work if
6411 setuid scripts have been disabled in your kernel.
6415 "$define") dflt=y ;;
6418 rp="Do you want to do setuid/setgid emulation?"
6421 [yY]*) val="$define";;
6433 SUID emulation has been removed for 5.12
6434 Please re-run Configure without -Dd_dosuid
6443 : Find perl5.005 or later.
6444 echo "Looking for a previously installed perl5.005 or later... "
6446 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6447 : Check if this perl is recent and can load a simple module
6448 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6451 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6461 '') echo "None found. That's ok.";;
6462 *) echo "Using $perl5." ;;
6465 : Set the siteprefix variables
6468 After $package is installed, you may wish to install various
6469 add-on modules and utilities. Typically, these add-ons will
6470 be installed under $prefix with the rest
6471 of this package. However, you may wish to install such add-ons
6472 elsewhere under a different prefix.
6474 If you do not wish to put everything under a single prefix, that's
6475 ok. You will be prompted for the individual locations; this siteprefix
6476 is only used to suggest the defaults.
6478 The default should be fine for most people.
6482 rp='Installation prefix to use for add-on modules and utilities?'
6483 : XXX Here might be another good place for an installstyle setting.
6484 case "$siteprefix" in
6486 *) dflt=$siteprefix ;;
6489 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6491 case "$siteprefix" in
6495 *) oldsiteprefix="$prefix";;
6500 siteprefixexp="$ansexp"
6502 : determine where site specific libraries go.
6503 : Usual default is /usr/local/lib/perl5/site_perl/$version
6504 : The default "style" setting is made in installstyle.U
6505 : XXX No longer works with Prefixit stuff.
6506 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6508 '') case "$installstyle" in
6509 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6510 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6518 The installation process will create a directory for
6519 site-specific extensions and modules. Most users find it convenient
6520 to place all site-specific files in this directory rather than in the
6521 main distribution directory.
6525 rp='Pathname for the site-specific library files?'
6529 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6531 : Determine list of previous versions to include in @INC
6532 $cat > getverlist <<EOPL
6535 \$api_versionstring = "$api_versionstring";
6536 \$version = "$version";
6537 \$stem = "$sitelib_stem";
6538 \$archname = "$archname";
6540 $cat >> getverlist <<'EOPL'
6541 # The list found is store twice for each entry: the original name, and
6542 # the binary broken down version as pack "sss", so sorting is easy and
6543 # unambiguous. This will work for all versions that have a maximum of
6544 # three digit groups, separate by '.'s or '_'s. Names are extended with
6545 # ".0.0" to ensure at least three elements for the pack.
6546 # -- H.Merijn Brand (m)'06 23-10-2006
6548 # Can't have leading @ because metaconfig interprets it as a command!
6549 ;@inc_version_list=();
6550 # XXX Redo to do opendir/readdir?
6553 ;@candidates = map {
6554 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6555 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
6561 ($pversion, $aversion, $vsn5005) = map {
6562 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6563 foreach $d (@candidates) {
6564 if ($d->[1] lt $pversion) {
6565 if ($d->[1] ge $aversion) {
6566 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6568 elsif ($d->[1] ge $vsn5005) {
6569 unshift(@inc_version_list, grep { -d } $d->[0]);
6573 # Skip newer version. I.e. don't look in
6574 # 5.7.0 if we're installing 5.6.1.
6578 if (@inc_version_list) {
6579 print join(' ', @inc_version_list);
6582 # Blank space to preserve value for next Configure run.
6587 case "$inc_version_list" in
6588 '') if test -x "$perl5$exe_ext"; then
6589 dflt=`$perl5 getverlist`
6594 $undef) dflt='none' ;;
6595 *) eval dflt=\"$inc_version_list\" ;;
6598 ''|' ') dflt=none ;;
6605 In order to ease the process of upgrading, this version of perl
6606 can be configured to use modules built and installed with earlier
6607 versions of perl that were installed under $prefix. Specify here
6608 the list of earlier versions that this version of perl should check.
6609 If Configure detected no earlier versions of perl installed under
6610 $prefix, then the list will be empty. Answer 'none' to tell perl
6611 to not search earlier versions.
6613 The default should almost always be sensible, so if you're not sure,
6614 just accept the default.
6617 rp='List of earlier versions to include in @INC?'
6620 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6621 *) inc_version_list="$ans" ;;
6623 case "$inc_version_list" in
6625 inc_version_list_init='0'
6626 d_inc_version_list="$undef"
6628 *) inc_version_list_init=`echo $inc_version_list |
6629 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6630 d_inc_version_list="$define"
6635 : see if malloc/malloc.h has to be included
6636 set malloc/malloc.h i_mallocmalloc
6639 : see if this is a malloc.h system
6640 : we want a real compile instead of Inhdr because some systems have a
6641 : malloc.h that just gives a compile error saying to use stdlib.h instead
6646 #$i_mallocmalloc I_MALLOCMALLOC
6647 #ifdef I_MALLOCMALLOC
6648 # include <malloc/malloc.h>
6651 int main () { return 0; }
6654 if eval $compile; then
6655 echo "<malloc.h> found." >&4
6658 echo "<malloc.h> NOT found." >&4
6665 : check for length of pointer
6669 echo "Checking to see how big your pointers are..." >&4
6678 printf("%d\n", (int)sizeof(void *));
6683 if eval $compile_ok; then
6684 ptrsize=`$run ./try`
6685 echo "Your pointers are $ptrsize bytes long."
6688 echo "(I can't seem to compile the test program. Guessing...)" >&4
6689 rp="What is the size of a pointer (in bytes)?"
6696 case "$use64bitall" in
6697 "$define"|true|[yY]*)
6701 *** You have chosen a maximally 64-bit build,
6702 *** but your pointers are only 4 bytes wide.
6703 *** Please rerun Configure without -Duse64bitall.
6708 *** Since you have quads, you could possibly try with -Duse64bitint.
6713 *** Cannot continue, aborting.
6724 : determine whether to use malloc wrapping
6726 case "$usemallocwrap" in
6727 [yY]*|true|$define) dflt='y' ;;
6728 [nN]*|false|$undef) dflt='n' ;;
6729 *) case "$usedevel" in
6730 [yY]*|true|$define) dflt='y' ;;
6735 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6737 usemallocwrap="$ans"
6740 usemallocwrap="$define" ;;
6742 usemallocwrap="$undef" ;;
6745 : determine which malloc to compile in
6747 case "$usemymalloc" in
6748 [yY]*|true|$define) dflt='y' ;;
6749 [nN]*|false|$undef) dflt='n' ;;
6750 *) case "$ptrsize" in
6754 if test "$useithreads" = "$define"; then dflt='n'; fi
6757 rp="Do you wish to attempt to use the malloc that comes with $package?"
6763 mallocsrc='malloc.c'
6764 mallocobj="malloc$_o"
6765 d_mymalloc="$define"
6768 : Remove malloc from list of libraries to use
6769 echo "Removing unneeded -lmalloc from library list" >&4
6770 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6773 echo "libs = $libs" >&4
6785 : compute the return types of malloc and free
6787 $cat >malloc.c <<END
6791 #include <sys/types.h>
6805 case "$malloctype" in
6807 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6814 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6818 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6825 echo "Your system uses $freetype free(), it would seem." >&4
6827 : determine where site specific architecture-dependent libraries go.
6828 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6829 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6830 : sitelib may have an optional trailing /share.
6832 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6833 dflt="$dflt/$archname"
6838 set sitearch sitearch none
6842 The installation process will also create a directory for
6843 architecture-dependent site-specific extensions and modules.
6847 rp='Pathname for the site-specific architecture-dependent library files?'
6851 if $test X"$sitearch" = X"$sitelib"; then
6854 d_sitearch="$define"
6857 : Set the vendorprefix variables
6860 The installation process will also create a directory for
6861 vendor-supplied add-ons. Vendors who supply perl with their system
6862 may find it convenient to place all vendor-supplied files in this
6863 directory rather than in the main distribution directory. This will
6864 ease upgrades between binary-compatible maintenance versions of perl.
6866 Of course you may also use these directories in whatever way you see
6867 fit. For example, you might use them to access modules shared over a
6868 company-wide network.
6870 The default answer should be fine for most people.
6871 This causes further questions about vendor add-ons to be skipped
6872 and no vendor-specific directories will be configured for perl.
6875 rp='Do you want to configure vendor-specific add-on directories?'
6876 case "$usevendorprefix" in
6877 define|true|[yY]*) dflt=y ;;
6878 *) : User may have set vendorprefix directly on Configure command line.
6879 case "$vendorprefix" in
6888 rp='Installation prefix to use for vendor-supplied add-ons?'
6889 case "$vendorprefix" in
6890 '') dflt="$prefix" ;;
6891 *) dflt=$vendorprefix ;;
6894 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6896 case "$vendorprefix" in
6900 *) oldvendorprefix="$prefix";;
6904 usevendorprefix="$define"
6906 vendorprefixexp="$ansexp"
6908 *) usevendorprefix="$undef"
6914 : Set the vendorlib variables
6915 case "$vendorprefix" in
6916 '') d_vendorlib="$undef"
6920 *) d_vendorlib="$define"
6921 : determine where vendor-supplied modules go.
6922 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6923 case "$vendorlib" in
6925 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6926 case "$installstyle" in
6927 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6928 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6931 *) dflt="$vendorlib"
6935 rp='Pathname for the vendor-supplied library files?'
6938 vendorlibexp="$ansexp"
6941 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6945 : Set the vendorarch variables
6946 case "$vendorprefix" in
6947 '') d_vendorarch="$undef"
6951 *) d_vendorarch="$define"
6952 : determine where vendor-supplied architecture-dependent libraries go.
6953 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6954 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6955 : vendorlib may have an optional trailing /share.
6956 case "$vendorarch" in
6957 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6958 dflt="$dflt/$archname"
6960 *) dflt="$vendorarch" ;;
6963 rp='Pathname for vendor-supplied architecture-dependent files?'
6966 vendorarchexp="$ansexp"
6969 prefixvar=vendorarch
6971 if $test X"$vendorarch" = X"$vendorlib"; then
6972 d_vendorarch="$undef"
6974 d_vendorarch="$define"
6977 : Final catch-all directories to search
6980 Lastly, you can have perl look in other directories for extensions and
6981 modules in addition to those already specified.
6982 These directories will be searched after
6986 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6987 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6989 case "$otherlibdirs" in
6990 ''|' ') dflt='none' ;;
6991 *) dflt="$otherlibdirs" ;;
6994 Enter a colon-separated set of extra paths to include in perl's @INC
6995 search path, or enter 'none' for no extra paths.
6999 rp='Colon-separated list of additional directories for perl to search?'
7002 ' '|''|none) otherlibdirs=' ' ;;
7003 *) otherlibdirs="$ans" ;;
7005 case "$otherlibdirs" in
7009 set d_perl_otherlibdirs
7012 : Cruising for prototypes
7014 echo "Checking out function prototypes..." >&4
7015 $cat >prototype.c <<EOCP
7020 int main(int argc, char *argv[]) {
7023 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7024 echo "Your C compiler appears to support function prototypes."
7027 echo "Your C compiler doesn't seem to understand function prototypes."
7034 : Check if ansi2knr is required
7035 case "$prototype" in
7037 *) ansi2knr='ansi2knr'
7042 This version of $package can only be compiled by a compiler that
7043 understands function prototypes. Unfortunately, your C compiler
7045 doesn't seem to understand them. Sorry about that.
7047 If GNU cc is available for your system, perhaps you could try that instead.
7049 Eventually, we hope to support building Perl with pre-ANSI compilers.
7050 If you would like to help in that effort, please contact <perlbug@perl.org>.
7052 Aborting Configure now.
7059 dflt_dtrace='/usr/sbin/dtrace'
7060 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
7064 Perl can be built to support DTrace on platforms that support it.
7065 DTrace is a diagnosis and performance analysis tool from Sun.
7067 If this doesn't make any sense to you, just accept the default '$dflt'.
7071 case "$usedtrace" in
7077 dflt_dtrace=$usedtrace
7084 rp='Support DTrace if available?'
7087 y|Y) val="$define" ;;
7093 test "X$usedtrace" != "X$define" && break
7096 rp='Where is the dtrace executable?'
7105 if $dtrace -h -s ../perldtrace.d \
7106 -o perldtrace.tmp >/dev/null 2>&1 \
7107 && rm -f perldtrace.tmp
7110 echo "Good: your $dtrace knows about the -h flag."
7114 *** $me: Fatal Error: $dtrace doesn't support -h flag
7116 *** Your installed dtrace doesn't support the -h switch to compile a D
7117 *** program into a C header. Can't continue.
7129 *** $me: Fatal Error: $dtrace not found.
7136 echo "*** $dtrace was not found."
7142 : See if we want extra modules installed
7149 Perl can be built with extra modules or bundles of modules which
7150 will be fetched from the CPAN and installed alongside Perl.
7152 Notice that you will need access to the CPAN; either via the Internet,
7153 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7154 be asked later to configure the CPAN.pm module which will in turn do
7155 the installation of the rest of the extra modules or bundles.)
7157 Notice also that if the modules require any external software such as
7158 libraries and headers (the libz library and the zlib.h header for the
7159 Compress::Zlib module, for example) you MUST have any such software
7160 already installed, this configuration process will NOT install such
7163 If this doesn't make any sense to you, just accept the default '$dflt'.
7165 rp='Install any extra modules (y or n)?'
7171 Please list any extra modules or bundles to be installed from CPAN,
7172 with spaces between the names. The names can be in any format the
7173 'install' command of CPAN.pm will understand. (Answer 'none',
7174 without the quotes, to install no extra modules or bundles.)
7184 $rm -f ../extras.lst
7186 *) echo "(Saving the list of extras for later...)"
7187 echo "$extras" > ../extras.lst
7195 : determine where html pages for programs go
7196 set html1dir html1dir none
7200 If you wish to install html files for programs in $spackage, indicate
7201 the appropriate directory here. To skip installing html files,
7205 ''|none|$undef|' ') dflt=none ;;
7206 *) dflt=$html1dir ;;
7209 rp="Directory for the main $spackage html pages?"
7213 : Use ' ' for none so value is preserved next time through Configure
7214 $test X"$html1dir" = "X" && html1dir=' '
7216 : determine where html pages for libraries and modules go
7217 set html3dir html3dir none
7221 If you wish to install html files for modules associated with $spackage,
7222 indicate the appropriate directory here. To skip installing html files,
7225 : There is no obvious default. If they have specified html1dir, then
7226 : try to key off that, possibly changing .../html1 into .../html3.
7228 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7229 *) dflt=$html3dir ;;
7232 rp="Directory for the $spackage module html pages?"
7236 : Use ' ' for none so value is preserved next time through Configure
7237 $test X"$html3dir" = "X" && html3dir=' '
7239 : determine whether to install perl also as /usr/bin/perl
7242 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7244 Many scripts expect perl to be installed as /usr/bin/perl.
7246 If you want to, I can install the perl you are about to compile
7247 as /usr/bin/perl (in addition to $bin/perl).
7249 if test -f /usr/bin/perl; then
7252 However, please note that because you already have a /usr/bin/perl,
7253 overwriting that with a new Perl would very probably cause problems.
7254 Therefore I'm assuming you don't want to do that (unless you insist).
7257 case "$installusrbinperl" in
7258 "$define"|[yY]*) dflt='y';;
7264 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7267 case "$installusrbinperl" in
7268 "$undef"|[nN]*) dflt='n';;
7272 rp="Do you want to install perl as /usr/bin/perl?"
7275 [yY]*) val="$define";;
7281 set installusrbinperl
7284 : Check if we are using the GNU C library
7286 echo "Checking for GNU C Library..." >&4
7288 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7289 alone are insufficient to distinguish different versions, such as
7290 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7291 libc version 2.1.0. A. Dougherty, June 3, 2002.
7297 # ifdef __GLIBC_MINOR__
7298 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7299 # include <gnu/libc-version.h>
7300 printf("%s\n", gnu_get_libc_version());
7302 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7305 printf("%d\n", __GLIBC__);
7314 if eval $compile_ok && $run ./try > glibc.ver; then
7316 gnulibc_version=`$cat glibc.ver`
7317 echo "You are using the GNU C Library version $gnulibc_version"
7321 echo "You are not using the GNU C Library"
7327 : see if nm is to be used to determine whether a symbol is defined or not
7331 case "$d_gnulibc" in
7334 echo "nm probably won't work on the GNU C Library." >&4
7340 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7342 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7343 echo "'nm' won't be sufficient on this system." >&4
7349 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7350 if $test $dflt -gt 20; then
7360 true|$define) dflt=y;;
7367 I can use $nm to extract the symbols from your C libraries. This
7368 is a time consuming task which may generate huge output on the disk (up
7369 to 3 megabytes) but that should make the symbols extraction faster. The
7370 alternative is to skip the 'nm' extraction part and to compile a small
7371 test program instead to determine whether each symbol is present. If
7372 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7373 this may be the best solution.
7375 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7378 rp="Shall I use $nm to extract C symbols from the libraries?"
7381 [Nn]*) usenm=false;;
7390 : nm options which may be necessary
7392 '') if $test -f /mach_boot; then
7394 elif $test -d /usr/ccs/lib; then
7395 nm_opt='-p' # Solaris (and SunOS?)
7396 elif $test -f /dgux; then
7398 elif $test -f /lib64/rld; then
7399 nm_opt='-p' # 64-bit Irix
7405 : nm options which may be necessary for shared libraries but illegal
7406 : for archive libraries. Thank you, Linux.
7407 case "$nm_so_opt" in
7408 '') case "$myuname" in
7410 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7411 nm_so_opt='--dynamic'
7418 : Figure out where the libc is located
7421 : get list of predefined functions in a handy place
7426 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7432 *) for thislib in $libs; do
7435 : Handle C library specially below.
7438 thislib=`echo $thislib | $sed -e 's/^-l//'`
7439 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7441 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7443 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7445 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7447 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7449 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7451 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7456 libnames="$libnames $try"
7458 *) libnames="$libnames $thislib" ;;
7467 for xxx in $libpth; do
7468 $test -r $1 || set $xxx/libc.$so
7469 : The messy sed command sorts on library version numbers.
7471 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7472 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7474 s/[0-9][0-9]*/0000&/g
7475 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7478 $sort | $sed -e 's/^.* //'`
7481 $test -r $1 || set /usr/ccs/lib/libc.$so
7482 $test -r $1 || set /lib/libsys_s$_a
7488 if $test -r "$1"; then
7489 echo "Your (shared) C library seems to be in $1."
7491 elif $test -r /lib/libc && $test -r /lib/clib; then
7492 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7494 libc='/lib/clib /lib/libc'
7495 if $test -r /lib/syslib; then
7496 echo "(Your math library is in /lib/syslib.)"
7497 libc="$libc /lib/syslib"
7499 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7500 echo "Your C library seems to be in $libc, as you said before."
7501 elif $test -r $incpath/usr/lib/libc$_a; then
7502 libc=$incpath/usr/lib/libc$_a;
7503 echo "Your C library seems to be in $libc. That's fine."
7504 elif $test -r /lib/libc$_a; then
7506 echo "Your C library seems to be in $libc. You're normal."
7508 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7510 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7511 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7512 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7514 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7516 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7519 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7521 if $test -r "$tans"; then
7522 echo "Your C library seems to be in $tans, of all places."
7528 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7532 If the guess above is wrong (which it might be if you're using a strange
7533 compiler, or your machine supports multiple models), you can override it here.
7538 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7540 I can't seem to find your C library. I've looked in the following places:
7543 $sed 's/^/ /' libpath
7546 None of these seems to contain your C library. I need to get its name...
7551 rp='Where is your C library?'
7556 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7557 set X `cat libnames`
7560 case $# in 1) xxx=file; esac
7561 echo "Extracting names from the following $xxx for later perusal:" >&4
7563 $sed 's/^/ /' libnames >&4
7565 $echo $n "This may take a while...$c" >&4
7569 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7570 *) $nm $nm_opt $file 2>/dev/null;;
7575 $grep fprintf libc.tmp > libc.ptf
7576 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7577 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7579 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7581 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7583 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7585 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7587 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7589 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7591 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7593 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7595 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7597 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7599 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7601 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7603 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7604 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7606 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7608 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7610 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7612 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7614 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7616 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7618 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7620 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7622 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7624 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7626 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7628 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7630 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7632 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7634 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7637 $nm -p $* 2>/dev/null >libc.tmp
7638 $grep fprintf libc.tmp > libc.ptf
7639 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7640 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7646 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7648 if $ar t $libc > libc.tmp && \
7649 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7651 for thisname in $libnames $libc; do
7652 $ar t $thisname >>libc.tmp
7654 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7656 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7657 for thisname in $libnames $libc; do
7658 $ar tv $thisname >>libc.tmp
7659 emximp -o tmp.imp $thisname \
7661 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7662 < tmp.imp >>libc.tmp
7665 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7668 echo "$ar didn't seem to work right." >&4
7669 echo "Maybe this is a Cray...trying bld instead..." >&4
7671 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7674 for thisname in $libnames; do
7676 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7677 $ar t $thisname >>libc.tmp
7681 echo "That didn't work either. Giving up." >&4
7691 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7692 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7694 *) if $test -f /lib/syscalls.exp; then
7696 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7697 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7698 /lib/syscalls.exp >>libc.list
7704 $rm -f libnames libpath
7706 : Check if we are using C++
7708 echo "Checking for C++..." >&4
7709 $cat >try.c <<'EOCP'
7721 if eval $compile_ok && $run ./try; then
7723 echo "You are using a C++ compiler."
7726 echo "You are not using a C++ compiler."
7732 : is a C symbol defined?
7735 -v) tf=libc.tmp; tdc="";;
7736 -a) tf=libc.tmp; tdc="[]";;
7737 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7739 case "$d_cplusplus" in
7740 $define) extern_C="extern \"C\"" ;;
7741 *) extern_C="extern" ;;
7744 case "$reuseval-$4" in
7746 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7751 if $test "$runnm" = true; then
7752 if $contains $tlook $tf >/dev/null 2>&1; then
7754 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7755 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7756 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7757 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7761 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7762 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7768 $define) tval=true;;
7775 : define an is-in-libc? function
7776 inlibc='echo " "; td=$define; tu=$undef;
7777 sym=$1; var=$2; eval "was=\$$2";
7779 case "$reuseval$was" in
7789 echo "$sym() found." >&4;
7790 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7792 echo "$sym() NOT found." >&4;
7793 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7797 $define) echo "$sym() found." >&4;;
7798 *) echo "$sym() NOT found." >&4;;
7802 : see if dlopen exists
7804 xxx_ccflags="$ccflags"
7806 : with g++ one needs -shared to get is-in-libc to work for dlopen
7807 case "$gccversion" in
7809 *) case "$d_cplusplus" in
7810 "$define") ccflags="$ccflags -shared" ;;
7817 ccflags="$xxx_ccflags"
7819 : see if this is a unistd.h system
7820 set unistd.h i_unistd
7823 : determine which dynamic loading, if any, to compile in
7825 dldir="ext/DynaLoader"
7838 $define) dflt='y' ;;
7840 : Does a dl_xxx.xs file exist for this operating system
7841 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7844 rp="Do you wish to use dynamic loading?"
7852 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7853 dflt="$dldir/dl_${osname}.xs"
7854 elif $test "$d_dlopen" = "$define" ; then
7855 dflt="$dldir/dl_dlopen.xs"
7860 *) dflt="$dldir/$dlsrc"
7863 echo "The following dynamic loading files are available:"
7864 : Can not go over to $dldir because getfile has path hard-coded in.
7865 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7866 rp="Source file to use for dynamic loading"
7872 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7876 Some systems may require passing special flags to $cc -c to
7877 compile modules that will be used to create a shared library.
7878 To use no flags, say "none".
7881 case "$cccdlflags" in
7882 '') case "$gccversion" in
7883 '') case "$osname" in
7885 next) dflt='none' ;;
7886 irix*) dflt='-KPIC' ;;
7887 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7888 sunos) dflt='-pic' ;;
7892 *) case "$osname" in
7893 darwin) dflt='none' ;;
7894 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7899 *) dflt="$cccdlflags" ;;
7901 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7904 none) cccdlflags=' ' ;;
7905 *) cccdlflags="$ans" ;;
7910 Some systems use ld to create libraries that can be dynamically loaded,
7911 while other systems (such as those using ELF) use $cc.
7915 : Determine if this is ELF
7917 /* Test for whether ELF binaries are produced */
7929 int i = open("a.out",O_RDONLY);
7932 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7933 exit(0); /* succeed (yes, it is ELF) */
7938 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7944 '') if $test $bin_ELF = "$define"; then
7946 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7950 echo "I'll use ld to build dynamic libraries."
7958 rp="What command should be used to create dynamic libraries?"
7964 Some systems may require passing special flags to $ld to create a
7965 library that can be dynamically loaded. If your ld flags include
7966 -L/other/path options to locate libraries outside your loader's normal
7967 search path, you may need to specify those -L options here as well. To
7968 use no flags, say "none".
7971 case "$lddlflags" in
7972 '') case "$osname" in
7973 haiku) dflt='-shared' ;;
7975 case "$gccversion" in
7976 '') dflt="$dflt +vnocompatwarnings" ;;
7979 linux|irix*|gnu*) dflt="-shared $optimize" ;;
7980 next) dflt='none' ;;
7981 solaris) # See [perl #66604].
7982 # On Solaris 11, gcc -m64 on amd64
7983 # appears not to understand -G. gcc versions at
7984 # least as old as 3.4.3 support -shared, so just
7985 # use that with Solaris 11 and later, but keep
7986 # the old behavior for older Solaris versions.
7987 case "$gccversion" in
7989 *) case "$osvers" in
7990 2.?|2.10) dflt='-G' ;;
7991 *) dflt='-shared' ;;
7996 sunos) dflt='-assert nodefinitions' ;;
7997 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8001 *) dflt="$lddlflags" ;;
8004 : Try to guess additional flags to pick up local libraries.
8005 : Be careful not to append to a plain 'none'
8009 for thisflag in $ldflags; do
8014 *) dflt="$dflt $thisflag" ;;
8021 ''|' ') dflt='none' ;;
8025 *-fstack-protector*)
8027 *-fstack-protector*) ;; # Don't add it again
8028 *) dflt="$dflt -fstack-protector" ;;
8034 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8037 none) lddlflags=' ' ;;
8038 *) lddlflags="$ans" ;;
8043 Some systems may require passing special flags to $cc to indicate that
8044 the resulting executable will use dynamic linking. To use no flags,
8048 case "$ccdlflags" in
8049 '') case "$osname" in
8050 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8051 next|sunos) dflt='none' ;;
8055 *) dflt="$ccdlflags" ;;
8057 rp="Any special flags to pass to $cc to use dynamic linking?"
8060 none) ccdlflags=' ' ;;
8061 *) ccdlflags="$ans" ;;
8072 ld_can_script="$undef"
8073 case "$bin_ELF$usedl" in
8075 # Abuse try.h and a.out names for neat cleanup
8087 if $cc $cccdlflags $ccdlflags $ccflags \
8088 $ldflags $lddlflags -o a.out try.c \
8089 -Wl,--version-script=try.h >/dev/null 2>&1 \
8090 && $test -s a.out ; then
8091 echo "ld supports scripting" >&4
8092 ld_can_script="$define"
8094 echo "ld does not support scripting" >&4
8100 : Do we want a shared libperl?
8104 # No dynamic loading being used, so don't bother even to prompt.
8107 *) case "$useshrplib" in
8108 '') case "$osname" in
8109 svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
8111 also='Building a shared libperl is required for dynamic loading to work on your system.'
8116 also='Building a shared libperl is needed for MAB support.'
8134 The perl executable is normally obtained by linking perlmain.c with
8135 libperl${_a}, any static extensions (usually just DynaLoader), and
8136 any other libraries needed on this system (such as -lm, etc.). Since
8137 your system supports dynamic loading, it is probably possible to build
8138 a shared libperl.$so. If you will have more than one executable linked
8139 to libperl.$so, this will significantly reduce the size of each
8140 executable, but it may have a noticeable effect on performance. The
8141 default is probably sensible for your system.
8145 rp="Build a shared libperl.$so (y/n)"
8149 useshrplib='true' ;;
8150 *) useshrplib='false' ;;
8155 case "$useshrplib" in
8157 case "$userelocatableinc" in
8159 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8160 echo "See INSTALL for an explanation why that won't work." >&4
8166 # Figure out a good name for libperl.so. Since it gets stored in
8167 # a version-specific architecture-dependent library, the version
8168 # number isn't really that important, except for making cc/ld happy.
8170 # A name such as libperl.so.10.1
8171 majmin="libperl.$so.$patchlevel.$subversion"
8172 # A name such as libperl.so.100
8173 majonly=`echo $patchlevel $subversion |
8174 $awk '{printf "%d%02d", $1, $2}'`
8175 majonly=libperl.$so.$majonly
8176 # I'd prefer to keep the os-specific stuff here to a minimum, and
8177 # rely on figuring it out from the naming of libc.
8178 case "${osname}${osvers}" in
8181 # XXX How handle the --version stuff for MAB?
8183 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8186 cygwin*) # ld links now against the dll directly
8187 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8188 majonly=`echo $patchlevel $subversion |
8189 $awk '{printf "%03d%03d", $1, $2}'`
8190 majonly=cygperl5.$majonly.$so
8193 *) # Try to guess based on whether libc has major.minor.
8195 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8196 *libc.$so.[0-9]*) dflt=$majonly ;;
8197 *) dflt=libperl.$so ;;
8207 I need to select a good name for the shared libperl. If your system uses
8208 library names with major and minor numbers, then you might want something
8209 like $majmin. Alternatively, if your system uses a single version
8210 number for shared libraries, then you might want to use $majonly.
8211 Or, your system might be quite happy with a simple libperl.$so.
8213 Since the shared libperl will get installed into a version-specific
8214 architecture-dependent directory, the version number of the shared perl
8215 library probably isn't important, so the default should be o.k.
8218 rp='What name do you want to give to the shared libperl?'
8221 echo "Ok, I'll use $libperl"
8224 libperl="libperl${_a}"
8228 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8232 WARNING: Use of the shrpdir variable for the installation location of
8233 the shared $libperl is not supported. It was never documented and
8234 will not work in this version. Let me (perlbug@perl.org)
8235 know of any problems this may cause.
8241 But your current setting of $shrpdir is
8242 the default anyway, so it's harmless.
8247 Further, your current attempted setting of $shrpdir
8248 conflicts with the value of $archlibexp/CORE
8249 that installperl will use.
8256 # How will the perl executable find the installed shared $libperl?
8257 # Add $xxx to ccdlflags.
8258 # If we can't figure out a command-line option, use $shrpenv to
8259 # set env LD_RUN_PATH. The main perl makefile uses this.
8260 shrpdir=$archlibexp/CORE
8263 if "$useshrplib"; then
8266 # We'll set it in Makefile.SH...
8271 freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
8272 xxx="-Wl,-R$shrpdir"
8274 bsdos|linux|irix*|dec_osf|gnu*)
8275 xxx="-Wl,-rpath,$shrpdir"
8278 # next doesn't like the default...
8281 # Haiku doesn't like the default, either.
8284 # hpux doesn't like the default, either.
8285 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8288 # cygwin needs only ldlibpth
8291 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8297 # Only add $xxx if it isn't already in ccdlflags.
8298 case " $ccdlflags " in
8300 *) ccdlflags="$ccdlflags $xxx"
8303 Adding $xxx to the flags
8304 passed to $ld so that the perl executable will find the
8305 installed shared $libperl.
8313 # Fix ccdlflags in AIX for building external extensions.
8314 # (For building Perl itself bare -bE:perl.exp is needed,
8315 # Makefile.SH takes care of this.)
8317 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8319 # Respect a hint or command-line value.
8321 '') shrpenv="$tmp_shrpenv" ;;
8323 case "$ldlibpthname" in
8324 '') ldlibpthname=LD_LIBRARY_PATH ;;
8325 none) ldlibpthname='' ;;
8328 : determine where manual pages are on this system
8332 syspath='/usr/share/man/man1 /usr/man/man1'
8333 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8334 syspath="$syspath /usr/man/u_man/man1"
8335 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8336 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8337 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8338 sysman=`./loc . /usr/man/man1 $syspath`
8341 if $test -d "$sysman"; then
8342 echo "System manual is in $sysman." >&4
8344 echo "Could not find manual pages in source form." >&4
8347 : determine where manual pages go
8348 set man1dir man1dir none
8352 $spackage has manual pages available in source form.
8356 echo "However, you don't have nroff, so they're probably useless to you."
8358 '') man1dir="none";;
8361 echo "If you don't want the manual sources installed, answer 'none'."
8366 lookpath="$prefixexp/share/man/man1"
8367 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8368 lookpath="$lookpath $prefixexp/man/p_man/man1"
8369 lookpath="$lookpath $prefixexp/man/u_man/man1"
8370 lookpath="$lookpath $prefixexp/man/man.1"
8372 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8373 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8383 rp="Where do the main $spackage manual pages (source) go?"
8385 if $test "X$man1direxp" != "X$ansexp"; then
8396 : What suffix to use on installed man pages
8403 rp="What suffix should be used for the main $spackage man pages?"
8405 '') case "$man1dir" in
8419 *) dflt="$man1ext";;
8426 : see if we can have long filenames
8428 first=123456789abcdef
8430 if (echo hi >$first) 2>/dev/null; then
8431 if $test -f 123456789abcde; then
8432 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8435 echo 'You can have filenames longer than 14 characters.'>&4
8440 You can't have filenames longer than 14 chars.
8441 You can't even think about them!
8447 $rm -rf 123456789abcde*
8449 : determine where library module manual pages go
8450 set man3dir man3dir none
8454 $spackage has manual pages for many of the library modules.
8460 However, you don't have nroff, so they're probably useless to you.
8463 '') man3dir="none";;
8467 case "$d_flexfnam" in
8470 However, your system can't handle the long file names like File::Basename.3.
8473 '') man3dir="none";;
8477 echo "If you don't want the manual sources installed, answer 'none'."
8478 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8480 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8481 if $test -d "$privlib/man/man3"; then
8484 WARNING: Previous versions of perl installed man3 pages into
8485 $privlib/man/man3. This version will suggest a
8486 new default of $dflt.
8490 rp='Do you wish to preserve the old behavior?(y/n)'
8493 y*) dflt="$privlib/man/man3" ;;
8498 *) dflt="$man3dir" ;;
8505 rp="Where do the $package library man pages (source) go?"
8515 : What suffix to use on installed man pages
8521 rp="What suffix should be used for the $package library man pages?"
8523 '') case "$man3dir" in
8537 *) dflt="$man3ext";;
8544 : see if we have to deal with yellow pages, now NIS.
8545 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8546 if $test -f /usr/etc/nibindd; then
8548 echo "I'm fairly confident you're on a NeXT."
8550 rp='Do you get the hosts file via NetInfo?'
8559 y*) hostcat='nidump hosts .';;
8560 *) case "$hostcat" in
8561 nidump*) hostcat='';;
8571 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8579 rp='Are you getting the hosts file via yellow pages?'
8582 y*) hostcat='ypcat hosts';;
8583 *) hostcat='cat /etc/hosts';;
8589 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8592 '') test -f /etc/group && groupcat='cat /etc/group';;
8595 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8598 : now get the host name
8600 echo "Figuring out host name..." >&4
8601 case "$myhostname" in
8603 echo 'Maybe "hostname" will work...'
8604 if tans=`sh -c hostname 2>&1` ; then
8612 if $test "$cont"; then
8614 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8615 if tans=`cat /etc/systemid 2>&1` ; then
8617 phostname='cat /etc/systemid'
8618 echo "Whadyaknow. Xenix always was a bit strange..."
8621 elif $test -r /etc/systemid; then
8622 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8625 if $test "$cont"; then
8626 echo 'No, maybe "uuname -l" will work...'
8627 if tans=`sh -c 'uuname -l' 2>&1` ; then
8629 phostname='uuname -l'
8631 echo 'Strange. Maybe "uname -n" will work...'
8632 if tans=`sh -c 'uname -n' 2>&1` ; then
8634 phostname='uname -n'
8636 echo 'Oh well, maybe I can mine it out of whoami.h...'
8637 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8638 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8639 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8641 case "$myhostname" in
8642 '') echo "Does this machine have an identity crisis or something?"
8645 echo "Well, you said $myhostname before..."
8646 phostname='echo $myhostname';;
8652 case "$myhostname" in
8653 '') myhostname=noname ;;
8655 : you do not want to know about this
8660 if $test "$myhostname" ; then
8662 rp='Your host name appears to be "'$myhostname'".'" Right?"
8670 : bad guess or no guess
8671 while $test "X$myhostname" = X ; do
8673 rp="Please type the (one word) name of your host:"
8678 : translate upper to lower if necessary
8679 case "$myhostname" in
8681 echo "(Normalizing case in your host name)"
8682 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8686 case "$myhostname" in
8688 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8689 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8690 echo "(Trimming domain name from host name--host name is now $myhostname)"
8692 *) case "$mydomain" in
8695 test "X$hostcat" = "Xypcat hosts" &&
8696 ypmatch "$myhostname" hosts 2>/dev/null |\
8697 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8700 test "X$hostcat" != "X" &&
8701 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8702 /[ ]$myhostname[ . ]/p" > hosts
8705 if $test -f hosts; then
8706 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8707 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8708 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8709 hosts | $sort | $uniq | \
8710 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8711 case `$echo X$dflt` in
8712 X*\ *) echo "(Several hosts in the database matched hostname)"
8715 X.) echo "(You do not have fully-qualified names in the hosts database)"
8719 echo "(I cannot locate a hosts database anywhere)"
8724 tans=`./loc resolv.conf X /etc /usr/etc`
8725 if $test -f "$tans"; then
8726 echo "(Attempting domain name extraction from $tans)"
8727 dflt=.`$sed -n -e 's/ / /g' \
8728 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8731 .) dflt=.`$sed -n -e 's/ / /g' \
8732 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8740 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8741 dflt=.`sh -c domainname 2>/dev/null`
8744 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8748 case "$dflt$osname" in
8749 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8750 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8754 .) echo "(Lost all hope -- silly guess then)"
8760 *) dflt="$mydomain";;
8764 rp="What is your domain name?"
8774 : translate upper to lower if necessary
8777 echo "(Normalizing case in your domain name)"
8778 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8782 : a little sanity check here
8783 case "$phostname" in
8786 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8787 $myhostname$mydomain|$myhostname) ;;
8789 case "$phostname" in
8791 echo "(That doesn't agree with your whoami.h file, by the way.)"
8794 echo "(That doesn't agree with your $phostname command, by the way.)"
8802 : determine the e-mail address of the user who is running us
8805 I need to get your e-mail address in Internet format if possible, i.e.
8806 something like user@host.domain. Please answer accurately since I have
8807 no easy means to double check it. The default value provided below
8808 is most probably close to reality but may not be valid from outside
8809 your organization...
8813 while test "$cont"; do
8814 case "$MAILDOMAIN" in
8816 if $test -s /etc/mailname; then
8817 maildomain=`$cat /etc/mailname`
8819 maildomain="$myhostname$mydomain"
8822 *) maildomain="$MAILDOMAIN";;
8825 '') dflt="$cf_by@$maildomain";;
8826 *) dflt="$cf_email";;
8828 rp='What is your e-mail address?'
8834 rp='Address does not look like an Internet one. Use it anyway?'
8848 : Ask e-mail of administrator
8851 If you or somebody else will be maintaining perl at your site, please
8852 fill in the correct e-mail address here so that they may be contacted
8853 if necessary. Currently, the "perlbug" program included with perl
8854 will send mail to this address in addition to perlbug@perl.org. You may
8855 enter "none" for no administrator.
8858 case "$perladmin" in
8859 '') dflt="$cf_email";;
8860 *) dflt="$perladmin";;
8862 rp='Perl administrator e-mail address'
8866 : determine whether to only install version-specific parts.
8869 Do you want to install only the version-specific parts of the perl
8870 distribution? Usually you do *not* want to do this.
8872 case "$versiononly" in
8873 "$define"|[Yy]*|true) dflt='y' ;;
8876 rp="Do you want to install only the version-specific parts of perl?"
8879 [yY]*) val="$define";;
8885 case "$versiononly" in
8886 "$define") inc_version_list=''
8887 inc_version_list_init=0
8891 : figure out how to guarantee perl startup
8892 : XXX Note that this currently takes advantage of the bug that binexp ignores
8893 : the Configure -Dinstallprefix setting, which in turn means that under
8894 : relocatable @INC, initialinstalllocation is what binexp started as.
8895 case "$startperl" in
8897 case "$sharpbang" in
8901 I can use the #! construct to start perl on your system. This will
8902 make startup of perl scripts faster, but may cause problems if you
8903 want to share those scripts and perl is not in a standard place
8904 ($initialinstalllocation/perl) on all your platforms. The alternative
8905 is to force a shell by starting the script with a single ':' character.
8908 case "$versiononly" in
8909 "$define") dflt="$initialinstalllocation/perl$version";;
8910 *) dflt="$initialinstalllocation/perl";;
8912 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8915 none) startperl=": # use perl";;
8916 *) startperl="#!$ans"
8917 if $test 30 -lt `echo "$ans" | wc -c`; then
8920 WARNING: Some systems limit the #! command to 32 characters.
8921 If you experience difficulty running Perl scripts with #!, try
8922 installing Perl in a directory with a shorter pathname.
8928 *) startperl=": # use perl"
8933 echo "I'll use $startperl to start perl scripts."
8935 : figure best path for perl in scripts
8938 case "$versiononly" in
8939 "$define") perlpath="$initialinstalllocation/perl$version";;
8940 *) perlpath="$initialinstalllocation/perl";;
8942 case "$startperl" in
8947 I will use the "eval 'exec'" idiom to start Perl on your system.
8948 I can use the full path of your Perl binary for this purpose, but
8949 doing so may cause problems if you want to share those scripts and
8950 Perl is not always in a standard place ($initialinstalllocation/perl).
8953 dflt="$initialinstalllocation/perl"
8954 rp="What path shall I use in \"eval 'exec'\"?"
8961 case "$startperl" in
8963 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8966 : determine where public executable scripts go
8967 set scriptdir scriptdir
8969 case "$scriptdir" in
8972 : guess some guesses
8973 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8974 $test -d /usr/share/bin && dflt=/usr/share/bin
8975 $test -d /usr/local/script && dflt=/usr/local/script
8976 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8977 $test -d $prefixexp/script && dflt=$prefixexp/script
8981 *) dflt="$scriptdir"
8986 Some installations have a separate directory just for executable scripts so
8987 that they can mount it across multiple architectures but keep the scripts in
8988 one spot. You might, for example, have a subdirectory of /usr/share for this.
8989 Or you might just lump your scripts in with all your other executables.
8993 rp='Where do you keep publicly executable scripts?'
8995 if $test "X$ansexp" != "X$scriptdirexp"; then
9001 : A little fix up for an irregularly named variable.
9002 installscript="$installscriptdir"
9004 : determine where add-on public executables go
9006 '') dflt=$siteprefix/bin ;;
9010 rp='Pathname where the add-on public executables should be installed?'
9015 : determine where add-on html pages go
9016 : There is no standard location, so try to copy the previously-selected
9017 : directory structure for the core html pages.
9018 case "$sitehtml1dir" in
9019 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9020 *) dflt=$sitehtml1dir ;;
9023 ''|' ') dflt=none ;;
9026 rp='Pathname where the site-specific html pages should be installed?'
9028 prefixvar=sitehtml1dir
9031 : determine where add-on library html pages go
9032 : There is no standard location, so try to copy the previously-selected
9033 : directory structure for the core html pages.
9034 case "$sitehtml3dir" in
9035 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9036 *) dflt=$sitehtml3dir ;;
9039 ''|' ') dflt=none ;;
9042 rp='Pathname where the site-specific library html pages should be installed?'
9044 prefixvar=sitehtml3dir
9047 : determine where add-on manual pages go
9048 case "$siteman1dir" in
9049 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9050 *) dflt=$siteman1dir ;;
9053 ''|' ') dflt=none ;;
9056 rp='Pathname where the site-specific manual pages should be installed?'
9058 prefixvar=siteman1dir
9061 : determine where add-on library man pages go
9062 case "$siteman3dir" in
9063 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9064 *) dflt=$siteman3dir ;;
9067 ''|' ') dflt=none ;;
9070 rp='Pathname where the site-specific library manual pages should be installed?'
9072 prefixvar=siteman3dir
9075 : determine where add-on public executable scripts go
9076 case "$sitescript" in
9077 '') dflt=$siteprefix/script
9078 $test -d $dflt || dflt=$sitebin ;;
9079 *) dflt="$sitescript" ;;
9082 rp='Pathname where add-on public executable scripts should be installed?'
9084 prefixvar=sitescript
9087 : Check if faststdio is requested and available
9088 case "$usefaststdio" in
9089 $define|true|[yY]*|'')
9090 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9100 Perl can be built to use 'fast stdio', which means using the stdio
9101 library but also directly manipulating the stdio buffers to enable
9102 faster I/O. Using stdio is better for backward compatibility (especially
9103 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9104 interface has been preferred instead of stdio.
9106 If this doesn't make any sense to you, just accept the default '$dflt'.
9108 rp='Use the "fast stdio" if available?'
9111 y|Y) val="$define" ;;
9118 : define an is-a-typedef? function
9119 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9121 "") inclist="sys/types.h";;
9123 eval "varval=\$$var";
9127 for inc in $inclist; do
9128 echo "#include <$inc>" >>temp.c;
9130 echo "#ifdef $type" >> temp.c;
9131 echo "printf(\"We have $type\");" >> temp.c;
9132 echo "#endif" >> temp.c;
9133 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9134 if $contains $type temp.E >/dev/null 2>&1; then
9140 *) eval "$var=\$varval";;
9143 : define an is-a-typedef? function that prompts if the type is not available.
9144 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9146 "") inclist="sys/types.h";;
9148 eval "varval=\$$var";
9152 for inc in $inclist; do
9153 echo "#include <$inc>" >>temp.c;
9155 echo "#ifdef $type" >> temp.c;
9156 echo "printf(\"We have $type\");" >> temp.c;
9157 echo "#endif" >> temp.c;
9158 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9160 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9161 if $contains $type temp.E >/dev/null 2>&1; then
9162 echo "$type found." >&4;
9165 echo "$type NOT found." >&4;
9171 *) eval "$var=\$varval";;
9174 : see what type lseek is declared as in the kernel
9175 rp="What is the type used for lseek's offset on this system?"
9176 set off_t lseektype long stdio.h sys/types.h
9180 echo "Checking to see how big your file offsets are..." >&4
9182 #include <sys/types.h>
9186 printf("%d\n", (int)sizeof($lseektype));
9191 if eval $compile_ok; then
9192 lseeksize=`$run ./try`
9193 echo "Your file offsets are $lseeksize bytes long."
9197 echo "(I can't seem to compile the test program. Guessing...)"
9198 rp="What is the size of your file offsets (in bytes)?"
9204 : see what type file positions are declared as in the library
9205 rp="What is the type for file position used by fsetpos()?"
9206 set fpos_t fpostype long stdio.h sys/types.h
9209 : Check size for Fpos_t
9212 *_t) zzz="$fpostype" ;;
9215 echo "Checking the size of $zzz..." >&4
9217 #include <sys/types.h>
9224 printf("%d\n", (int)sizeof($fpostype));
9229 if eval $compile_ok; then
9233 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9236 echo "Your $zzz is $fpossize bytes long."
9242 echo "(I can't compile the test program. Guessing...)" >&4
9243 rp="What is the size of your file positions (in bytes)?"
9248 : Check for large file support
9249 # Backward compatibility (uselfs is deprecated).
9251 "$define"|true|[yY]*)
9254 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9256 uselargefiles="$define"
9260 case "$lseeksize:$fpossize" in
9263 You can have files larger than 2 gigabytes.
9266 *) case "$uselargefiles" in
9267 "$undef"|false|[nN]*) dflt='n' ;;
9272 Perl can be built to understand large files (files larger than 2 gigabytes)
9273 on some systems. To do so, Configure can be run with -Duselargefiles.
9275 If this doesn't make any sense to you, just accept the default '$dflt'.
9277 rp='Try to understand large files, if available?'
9280 y|Y) val="$define" ;;
9287 : Look for a hint-file generated 'call-back-unit'. If the
9288 : user has specified that a large files perl is to be built,
9289 : we may need to set or change some other defaults.
9290 if $test -f uselargefiles.cbu; then
9291 echo "Your platform has some specific hints regarding large file builds, using them..."
9292 . ./uselargefiles.cbu
9294 case "$uselargefiles" in
9296 if $test -f uselargefiles.cbu; then
9298 echo "Rechecking to see how big your file offsets are..." >&4
9300 #include <sys/types.h>
9304 printf("%d\n", (int)sizeof($lseektype));
9309 if eval $compile_ok; then
9310 lseeksize=`$run ./try`
9311 $echo "Your file offsets are now $lseeksize bytes long."
9315 echo "(I can't seem to compile the test program. Guessing...)"
9316 rp="What is the size of your file offsets (in bytes)?"
9321 *_t) zzz="$fpostype" ;;
9324 $echo $n "Rechecking the size of $zzz...$c" >&4
9326 #include <sys/types.h>
9333 printf("%d\n", (int)sizeof($fpostype));
9338 if eval $compile_ok; then
9343 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9346 echo " $fpossize bytes." >&4
9352 echo "(I can't compile the test program. Guessing...)" >&4
9353 rp="What is the size of your file positions (in bytes)?"
9362 : Check if we want perlio
9365 : Set the vendorbin variables
9366 case "$vendorprefix" in
9367 '') d_vendorbin="$undef"
9371 *) d_vendorbin="$define"
9372 : determine where vendor-supplied executables go.
9373 case "$vendorbin" in
9374 '') dflt=$vendorprefix/bin ;;
9375 *) dflt="$vendorbin" ;;
9378 rp='Pathname for the vendor-supplied executables directory?'
9381 vendorbinexp="$ansexp"
9387 : Set the vendorhtml1dir variables
9388 case "$vendorprefix" in
9389 '') vendorhtml1dir=''
9390 vendorhtml1direxp=''
9392 *) : determine where vendor-supplied html pages go.
9393 : There is no standard location, so try to copy the previously-selected
9394 : directory structure for the core html pages.
9395 : XXX Better default suggestions would be welcome.
9396 case "$vendorhtml1dir" in
9397 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9398 *) dflt=$vendorhtml1dir ;;
9401 ''|' ') dflt=none ;;
9404 rp='Pathname for the vendor-supplied html pages?'
9406 vendorhtml1dir="$ans"
9407 vendorhtml1direxp="$ansexp"
9410 : Use ' ' for none so value is preserved next time through Configure
9411 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9412 prefixvar=vendorhtml1dir
9415 : Set the vendorhtml3dir variables
9416 case "$vendorprefix" in
9417 '') vendorhtml3dir=''
9418 vendorhtml3direxp=''
9420 *) : determine where vendor-supplied module html pages go.
9421 : There is no standard location, so try to copy the previously-selected
9422 : directory structure for the core html pages.
9423 : XXX Better default suggestions would be welcome.
9424 case "$vendorhtml3dir" in
9425 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9426 *) dflt=$vendorhtml3dir ;;
9429 ''|' ') dflt=none ;;
9432 rp='Pathname for the vendor-supplied html pages?'
9434 vendorhtml3dir="$ans"
9435 vendorhtml3direxp="$ansexp"
9438 : Use ' ' for none so value is preserved next time through Configure
9439 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9440 prefixvar=vendorhtml3dir
9443 : Set the vendorman1dir variables
9444 case "$vendorprefix" in
9445 '') vendorman1dir=''
9448 *) : determine where vendor-supplied manual pages go.
9449 case "$vendorman1dir" in
9450 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9451 *) dflt=$vendorman1dir ;;
9454 ''|' ') dflt=none ;;
9457 rp='Pathname for the vendor-supplied manual section 1 pages?'
9459 vendorman1dir="$ans"
9460 vendorman1direxp="$ansexp"
9463 : Use ' ' for none so value is preserved next time through Configure
9464 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9465 prefixvar=vendorman1dir
9468 : Set the vendorman3dir variables
9469 case "$vendorprefix" in
9470 '') vendorman3dir=''
9473 *) : determine where vendor-supplied module manual pages go.
9474 case "$vendorman3dir" in
9475 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9476 *) dflt=$vendorman3dir ;;
9479 ''|' ') dflt=none ;;
9482 rp='Pathname for the vendor-supplied manual section 3 pages?'
9484 vendorman3dir="$ans"
9485 vendorman3direxp="$ansexp"
9488 : Use ' ' for none so value is preserved next time through Configure
9489 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9490 prefixvar=vendorman3dir
9493 : Set the vendorscript variables
9494 case "$vendorprefix" in
9495 '') d_vendorscript="$undef"
9499 *) d_vendorscript="$define"
9500 : determine where vendor-supplied scripts go.
9501 case "$vendorscript" in
9502 '') dflt=$vendorprefix/script
9503 $test -d $dflt || dflt=$vendorbin ;;
9504 *) dflt="$vendorscript" ;;
9508 The installation process will create a directory for
9509 vendor-supplied scripts.
9513 rp='Pathname for the vendor-supplied scripts directory?'
9516 vendorscriptexp="$ansexp"
9519 prefixvar=vendorscript
9522 : script used to emit important warnings
9525 if test \$# -gt 0; then
9530 echo "*** WARNING:" >&4
9531 sed -e 's/^/*** /' <msg >&4
9533 cat msg >>config.msg
9534 echo " " >>config.msg
9540 : see which of string.h or strings.h is needed
9542 strings=`./findhdr string.h`
9543 if $test "$strings" && $test -r "$strings"; then
9544 echo "Using <string.h> instead of <strings.h>." >&4
9548 strings=`./findhdr strings.h`
9549 if $test "$strings" && $test -r "$strings"; then
9550 echo "Using <strings.h> instead of <string.h>." >&4
9552 ./warn "No string header found -- You'll surely have problems."
9558 "$undef") strings=`./findhdr strings.h`;;
9559 *) strings=`./findhdr string.h`;;
9562 : see if qgcvt exists
9566 : Check print/scan long double stuff
9569 if $test X"$d_longdbl" = X"$define"; then
9571 echo "Checking how to print long doubles..." >&4
9573 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9574 $cat >try.c <<'EOCP'
9575 #include <sys/types.h>
9579 printf("%.3f\n", d);
9583 if eval $compile; then
9587 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9588 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9589 echo "We will use %f."
9595 if $test X"$sPRIfldbl" = X; then
9596 $cat >try.c <<'EOCP'
9597 #include <sys/types.h>
9600 long double d = 123.456;
9601 printf("%.3Lf\n", d);
9605 if eval $compile; then
9609 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9610 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9611 echo "We will use %Lf."
9617 if $test X"$sPRIfldbl" = X; then
9618 $cat >try.c <<'EOCP'
9619 #include <sys/types.h>
9622 long double d = 123.456;
9623 printf("%.3llf\n", d);
9627 if eval $compile; then
9631 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9632 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9633 echo "We will use %llf."
9639 if $test X"$sPRIfldbl" = X; then
9640 $cat >try.c <<'EOCP'
9641 #include <sys/types.h>
9644 long double d = 123.456;
9645 printf("%.3lf\n", d);
9649 if eval $compile; then
9653 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9654 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9655 echo "We will use %lf."
9661 if $test X"$sPRIfldbl" = X; then
9662 echo "Cannot figure out how to print long doubles." >&4
9664 sSCNfldbl=$sPRIfldbl # expect consistency
9671 case "$sPRIfldbl" in
9672 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9673 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9674 d_SCNfldbl="$undef";
9676 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9677 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9678 d_SCNfldbl="$define";
9682 : Check how to convert floats to strings.
9684 if test "X$d_Gconvert" = X; then
9687 echo "Checking for an efficient way to convert floats to strings."
9689 case "$uselongdouble" in
9690 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9692 case "$d_longdbl" in
9693 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9695 case "$d_PRIgldbl" in
9696 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9700 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9701 char *myname = "gconvert";
9704 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9705 char *myname = "gcvt";
9708 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9709 char *myname = "qgcvt";
9710 #define DOUBLETYPE long double
9713 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9715 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9717 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9720 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9722 char *myname = "sprintf";
9726 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9727 #define DOUBLETYPE long double
9729 #define DOUBLETYPE double
9741 # include <string.h>
9743 # include <strings.h>
9746 int checkit(char *expect, char *got)
9748 if (strcmp(expect, got)) {
9749 printf("%s oddity: Expected %s, got %s\n",
9750 myname, expect, got);
9760 /* This must be 1st test on (which?) platform */
9761 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9762 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9763 checkit("0.1", buf);
9765 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9766 checkit("0.01", buf);
9768 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9769 checkit("0.001", buf);
9771 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9772 checkit("0.0001", buf);
9774 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9775 if (strlen(buf) > 5)
9776 checkit("9e-005", buf); /* for Microsoft ?? */
9778 checkit("9e-05", buf);
9780 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9783 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9784 checkit("1.1", buf);
9786 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9787 checkit("1.01", buf);
9789 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9790 checkit("1.001", buf);
9792 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9793 checkit("1.0001", buf);
9795 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9796 checkit("1.00001", buf);
9798 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9799 checkit("1.000001", buf);
9801 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9804 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9807 /* Some Linux gcvt's give 1.e+5 here. */
9808 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9809 checkit("100000", buf);
9811 /* Some Linux gcvt's give -1.e+5 here. */
9812 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9813 checkit("-100000", buf);
9815 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9816 checkit("123.456", buf);
9818 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9819 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9820 /* 34 should be enough to scare even long double
9821 * places into using the e notation. */
9822 if (strlen(buf) > 5)
9823 checkit("1e+034", buf); /* for Microsoft */
9825 checkit("1e+34", buf);
9827 /* For Perl, if you add additional tests here, also add them to
9828 * t/base/num.t for benefit of platforms not using Configure or
9829 * overriding d_Gconvert */
9834 : first add preferred functions to our list
9836 for xxx_convert in $gconvert_preference; do
9837 case $xxx_convert in
9838 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9839 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9842 : then add any others
9843 for xxx_convert in gconvert gcvt sprintf; do
9846 *) xxx_list="$xxx_list $xxx_convert" ;;
9850 case "$d_longdbl$uselongdouble" in
9852 : again, add preferred functions to our list first
9854 for xxx_convert in $gconvert_ld_preference; do
9855 case $xxx_convert in
9856 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9857 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9860 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9861 for xxx_convert in qgcvt sprintf $xxx_list; do
9862 case "$xxx_ld_list" in
9863 $xxx_convert*|*" $xxx_convert"*) ;;
9864 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9867 : if sprintf cannot do long doubles, move it to the end
9868 if test "$d_PRIgldbl" != "$define"; then
9869 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9871 : if no qgcvt, remove it
9872 if test "$d_qgcvt" != "$define"; then
9873 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9876 xxx_list="$xxx_ld_list"
9880 for xxx_convert in $xxx_list; do
9881 echo "Trying $xxx_convert..."
9882 $rm -f try try$_o core
9883 set try -DTRY_$xxx_convert
9884 if eval $compile; then
9885 echo "$xxx_convert() found." >&4
9887 echo "I'll use $xxx_convert to convert floats into a string." >&4
9890 echo "...But $xxx_convert didn't work as I expected."
9894 echo "$xxx_convert NOT found." >&4
9898 if test X$xxx_convert = X; then
9899 echo "*** WHOA THERE!!! ***" >&4
9900 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9904 case "$xxx_convert" in
9905 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9906 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9907 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9908 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9909 "$define$define$define")
9910 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9911 "$define$define$undef")
9912 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9913 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9921 : see if _fwalk exists
9925 : Initialize h_fcntl
9928 : Initialize h_sysfile
9931 : access call always available on UNIX
9935 : locate the flags for 'access()'
9939 $cat >access.c <<EOCP
9940 #include <sys/types.h>
9945 #include <sys/file.h>
9958 : check sys/file.h first, no particular reason here
9959 if $test `./findhdr sys/file.h` && \
9960 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9962 echo "<sys/file.h> defines the *_OK access constants." >&4
9963 elif $test `./findhdr fcntl.h` && \
9964 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9966 echo "<fcntl.h> defines the *_OK access constants." >&4
9967 elif $test `./findhdr unistd.h` && \
9968 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9969 echo "<unistd.h> defines the *_OK access constants." >&4
9971 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9977 : see if accessx exists
9978 set accessx d_accessx
9981 : see if aintl exists
9985 : see if alarm exists
9989 : see if 64bit time functions exists
9991 set ctime64 d_ctime64
9994 set localtime64 d_localtime64
9997 set gmtime64 d_gmtime64
10000 set mktime64 d_mktime64
10003 set difftime64 d_difftime64
10006 set asctime64 d_asctime64
10009 : see if POSIX threads are available
10010 set pthread.h i_pthread
10013 : define a function to check prototypes
10014 $cat > protochk <<EOSH
10017 optimize="$optimize"
10019 prototype="$prototype"
10022 usethreads=$usethreads
10023 i_pthread=$i_pthread
10024 pthread_h_first=$pthread_h_first
10027 $cat >> protochk <<'EOSH'
10032 while test $# -ge 2; do
10034 $define) echo "#include <$2>" >> try.c ;;
10035 literal) echo "$2" >> try.c ;;
10037 # Extra magic for the benefit of systems that need pthread.h
10038 # to be included early to correctly detect threadsafe functions.
10039 # Such functions must guarantee themselves, though, that the usethreads
10040 # and i_pthread have been defined, before calling protochk.
10041 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10042 echo "#include <pthread.h>" >> try.c
10047 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10048 cat >> try.c <<'EOCP'
10049 #ifdef CAN_PROTOTYPE
10050 #define _(args) args
10055 echo "$foo" >> try.c
10056 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10057 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10063 $eunicefix protochk
10065 : Define hasproto macro for Configure internal use
10066 hasproto='varname=$1; func=$2; shift; shift;
10067 while $test $# -ge 2; do
10069 $define) echo "#include <$2>";;
10073 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10074 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10075 echo "$func() prototype found.";
10078 echo "$func() prototype NOT found.";
10085 : see if sys/types.h has to be included
10086 set sys/types.h i_systypes
10089 : see if sys/select.h has to be included
10090 set sys/select.h i_sysselct
10093 : Define hasfield macro for Configure internal use
10094 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10095 while $test $# -ge 2; do
10097 $define) echo "#include <$2>";;
10101 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10103 if eval $compile; then
10112 : see if we should include time.h, sys/time.h, or both
10114 if test "X$timeincl" = X; then
10115 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10116 $echo $n "I'm now running the test program...$c"
10118 #include <sys/types.h>
10123 #ifdef SYSTIMEKERNEL
10126 #include <sys/time.h>
10129 #include <sys/select.h>
10131 #$i_stdlib I_STDLIB
10133 #include <stdlib.h>
10139 struct timeval bar;
10142 struct timezone tzp;
10144 if (foo.tm_sec == foo.tm_sec)
10147 if (bar.tv_sec == bar.tv_sec)
10154 for s_timezone in '-DS_TIMEZONE' ''; do
10156 for s_timeval in '-DS_TIMEVAL' ''; do
10157 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10158 for i_time in '' '-DI_TIME'; do
10159 for i_systime in '-DI_SYSTIME' ''; do
10162 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10163 if eval $compile; then
10164 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10168 $echo $n "Succeeded with $flags$c"
10180 *SYSTIMEKERNEL*) i_systimek="$define"
10181 timeincl=`./findhdr sys/time.h`
10182 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10183 *) i_systimek="$undef";;
10186 *I_TIME*) i_time="$define"
10187 timeincl=`./findhdr time.h`" $timeincl"
10188 echo "We'll include <time.h>." >&4;;
10189 *) i_time="$undef";;
10192 *I_SYSTIME*) i_systime="$define"
10193 timeincl=`./findhdr sys/time.h`" $timeincl"
10194 echo "We'll include <sys/time.h>." >&4;;
10195 *) i_systime="$undef";;
10199 : see if struct tm knows about tm_zone
10200 case "$i_systime$i_time" in
10203 echo "Checking to see if your struct tm has tm_zone field..." >&4
10204 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10212 case "$d_tm_tm_zone" in
10213 "$define") echo "Yes, it does." ;;
10214 *) echo "No, it doesn't." ;;
10216 : see if struct tm knows about tm_gmtoff
10217 case "$i_systime$i_time" in
10220 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10221 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10229 case "$d_tm_tm_gmtoff" in
10230 "$define") echo "Yes, it does." ;;
10231 *) echo "No, it doesn't." ;;
10234 : see if asctime_r exists
10235 set asctime_r d_asctime_r
10237 case "$d_asctime_r" in
10239 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10240 case "$d_asctime_r_proto:$usethreads" in
10241 ":define") d_asctime_r_proto=define
10242 set d_asctime_r_proto asctime_r $hdrs
10246 case "$d_asctime_r_proto" in
10248 case "$asctime_r_proto" in
10249 ''|0) try='char* asctime_r(const struct tm*, char*);'
10250 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10252 case "$asctime_r_proto" in
10253 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10254 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10256 case "$asctime_r_proto" in
10257 ''|0) try='int asctime_r(const struct tm*, char*);'
10258 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10260 case "$asctime_r_proto" in
10261 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10262 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10264 case "$asctime_r_proto" in
10265 ''|0) d_asctime_r=undef
10267 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10268 * ) case "$asctime_r_proto" in
10269 REENTRANT_PROTO*) ;;
10270 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10272 echo "Prototype: $try" ;;
10275 *) case "$usethreads" in
10276 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10283 *) asctime_r_proto=0
10287 : see if atolf exists
10291 : see if atoll exists
10295 : Look for GCC-style attribute format
10296 case "$d_attribute_format" in
10299 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10300 $cat >attrib.c <<'EOCP'
10302 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10304 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10305 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10306 echo "Your C compiler doesn't support __attribute__((format))."
10309 echo "Your C compiler supports __attribute__((format))."
10313 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10317 *) val="$d_attribute_format" ;;
10319 set d_attribute_format
10323 : Look for GCC-style attribute format with null format allowed
10324 case "$d_printf_format_null" in
10325 '') case "$d_attribute_format" in
10328 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10329 $cat >attrib.c <<EOCP
10331 #$i_stdlib I_STDLIB
10333 #include <stdlib.h>
10335 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10336 int null_printf (char* pat,...) { return (int)pat; }
10337 int main () { exit(null_printf(NULL)); }
10339 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10340 : run the executable in case it produces a run-time warning
10341 if $run ./attrib >>attrib.out 2>&1; then
10342 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10343 echo "Your C compiler doesn't allow __printf__ format to be null."
10346 echo "Your C compiler allows __printf__ format to be null."
10350 echo "Your C compiler executable failed with __printf__ format null."
10354 echo "Your C compiler fails with __printf__ format null."
10361 *) val="$d_printf_format_null" ;;
10363 set d_printf_format_null
10367 : Look for GCC-style attribute malloc
10368 case "$d_attribute_malloc" in
10371 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10372 $cat >attrib.c <<'EOCP'
10374 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10376 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10377 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10378 echo "Your C compiler doesn't support __attribute__((malloc))."
10381 echo "Your C compiler supports __attribute__((malloc))."
10385 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10389 *) val="$d_attribute_malloc" ;;
10391 set d_attribute_malloc
10395 : Look for GCC-style attribute nonnull
10396 case "$d_attribute_nonnull" in
10399 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10400 $cat >attrib.c <<'EOCP'
10402 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10404 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10405 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10406 echo "Your C compiler doesn't support __attribute__((nonnull))."
10409 echo "Your C compiler supports __attribute__((nonnull))."
10413 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10417 *) val="$d_attribute_nonnull" ;;
10419 set d_attribute_nonnull
10423 : Look for GCC-style attribute noreturn
10424 case "$d_attribute_noreturn" in
10427 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10428 $cat >attrib.c <<'EOCP'
10430 void fall_over_dead( void ) __attribute__((noreturn));
10432 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10433 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10434 echo "Your C compiler doesn't support __attribute__((noreturn))."
10437 echo "Your C compiler supports __attribute__((noreturn))."
10441 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10445 *) val="$d_attribute_noreturn" ;;
10447 set d_attribute_noreturn
10451 : Look for GCC-style attribute pure
10452 case "$d_attribute_pure" in
10455 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10456 $cat >attrib.c <<'EOCP'
10458 int square( int n ) __attribute__((pure));
10460 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10461 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10462 echo "Your C compiler doesn't support __attribute__((pure))."
10465 echo "Your C compiler supports __attribute__((pure))."
10469 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10473 *) val="$d_attribute_pure" ;;
10475 set d_attribute_pure
10479 : Look for GCC-style attribute unused
10480 case "$d_attribute_unused" in
10483 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10484 $cat >attrib.c <<'EOCP'
10486 int do_something( int dummy __attribute__((unused)), int n );
10488 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10489 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10490 echo "Your C compiler doesn't support __attribute__((unused))."
10493 echo "Your C compiler supports __attribute__((unused))."
10497 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10501 *) val="$d_attribute_unused" ;;
10503 set d_attribute_unused
10507 : Look for GCC-style attribute deprecated
10508 case "$d_attribute_deprecated" in
10511 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10512 $cat >attrib.c <<'EOCP'
10514 int I_am_deprecated(void) __attribute__((deprecated));
10516 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10517 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10518 echo "Your C compiler doesn't support __attribute__((deprecated))."
10521 echo "Your C compiler supports __attribute__((deprecated))."
10525 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10529 *) val="$d_attribute_deprecated" ;;
10531 set d_attribute_deprecated
10535 : Look for GCC-style attribute warn_unused_result
10536 case "$d_attribute_warn_unused_result" in
10539 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10540 $cat >attrib.c <<'EOCP'
10542 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10544 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10545 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10546 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10549 echo "Your C compiler supports __attribute__((warn_unused_result))."
10553 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10557 *) val="$d_attribute_warn_unused_result" ;;
10559 set d_attribute_warn_unused_result
10563 : see if bcmp exists
10567 : see if bcopy exists
10571 : see if getpgrp exists
10572 set getpgrp d_getpgrp
10575 case "$d_getpgrp" in
10578 echo "Checking to see which flavor of getpgrp is in use..."
10580 #$i_unistd I_UNISTD
10581 #include <sys/types.h>
10583 # include <unistd.h>
10585 #$i_stdlib I_STDLIB
10587 #include <stdlib.h>
10591 if (getuid() == 0) {
10592 printf("(I see you are running Configure as super-user...)\n");
10595 #ifdef TRY_BSD_PGRP
10596 if (getpgrp(1) == 0)
10605 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10606 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10608 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10609 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10612 echo "I can't seem to compile and run the test program."
10614 xxx="a USG one, i.e. you use getpgrp()."
10616 # SVR4 systems can appear rather BSD-ish.
10617 case "$i_unistd" in
10619 xxx="a BSD one, i.e. you use getpgrp(pid)."
10623 xxx="probably a USG one, i.e. you use getpgrp()."
10628 echo "Assuming your getpgrp is $xxx" >&4
10637 : see if setpgrp exists
10638 set setpgrp d_setpgrp
10641 case "$d_setpgrp" in
10644 echo "Checking to see which flavor of setpgrp is in use..."
10646 #$i_unistd I_UNISTD
10647 #include <sys/types.h>
10649 # include <unistd.h>
10651 #$i_stdlib I_STDLIB
10653 #include <stdlib.h>
10657 if (getuid() == 0) {
10658 printf("(I see you are running Configure as super-user...)\n");
10661 #ifdef TRY_BSD_PGRP
10662 if (-1 == setpgrp(1, 1))
10665 if (setpgrp() != -1)
10671 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10672 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10674 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10675 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10678 echo "(I can't seem to compile and run the test program.)"
10680 xxx="a USG one, i.e. you use setpgrp()."
10682 # SVR4 systems can appear rather BSD-ish.
10683 case "$i_unistd" in
10685 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10689 xxx="probably a USG one, i.e. you use setpgrp()."
10694 echo "Assuming your setpgrp is $xxx" >&4
10703 : Look for GCC-style __builtin_choose_expr
10704 case "$d_builtin_choose_expr" in
10707 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10708 $cat >try.c <<'EOCP'
10709 #include <assert.h>
10710 #include <stdlib.h>
10713 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10716 assert( SYRINX(1) == 2112 );
10717 assert( SYRINX(1) != 5150 );
10718 assert( SYRINX(0) == 5150 );
10719 assert( SYRINX(0) != 2112 );
10720 puts( "All good!" );
10726 if eval $compile && $run ./try; then
10727 echo "Your C compiler supports __builtin_choose_expr."
10730 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10734 *) val="$d_builtin_choose_expr" ;;
10737 set d_builtin_choose_expr
10741 : Look for GCC-style __builtin_expect
10742 case "$d_builtin_expect" in
10745 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10746 $cat >try.c <<'EOCP'
10749 if ( __builtin_expect(n, 0) ) n = 1;
10750 /* Remember shell exit code truth is 0, C truth is non-zero */
10755 if eval $compile && $run ./try; then
10756 echo "Your C compiler supports __builtin_expect."
10759 echo "Your C compiler doesn't seem to understand __builtin_expect."
10763 *) val="$d_builtin_expect" ;;
10766 set d_builtin_expect
10770 : see if bzero exists
10774 : see if stdarg is available
10776 if $test `./findhdr stdarg.h`; then
10777 echo "<stdarg.h> found." >&4
10780 echo "<stdarg.h> NOT found." >&4
10784 : see if varargs is available
10786 if $test `./findhdr varargs.h`; then
10787 echo "<varargs.h> found." >&4
10789 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10792 : set up the varargs testing programs
10793 $cat > varargs.c <<EOP
10795 #include <stdarg.h>
10798 #include <varargs.h>
10802 int f(char *p, ...)
10816 p = va_arg(ap, char *);
10822 $cat > varargs <<EOP
10824 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10833 : now check which varargs header should be included
10839 if `./varargs I_STDARG`; then
10841 elif `./varargs I_VARARGS`; then
10846 if `./varargs I_VARARGS`; then
10854 echo "*** WHOA THERE!!! ***" >&4
10855 echo " Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
10856 case "$knowitall" in
10858 echo " I'm giving up; maybe you can try again with a different compiler?" >&4
10862 echo "I could not find the definition for va_dcl... You have problems..." >&4
10863 val="$undef"; set i_stdarg; eval $setvar
10864 val="$undef"; set i_varargs; eval $setvar
10869 case "$i_varhdr" in
10871 val="$define"; set i_stdarg; eval $setvar
10872 val="$undef"; set i_varargs; eval $setvar
10875 val="$undef"; set i_stdarg; eval $setvar
10876 val="$define"; set i_varargs; eval $setvar
10879 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10883 : see if the Compiler supports C99 variadic macros
10884 case "$i_stdarg$i_stdlib" in
10886 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10889 #include <stdarg.h>
10891 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10895 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10901 if eval $compile && $run ./try 2>&1 >/dev/null; then
10902 case "`$run ./try`" in
10904 echo "You have C99 variadic macros." >&4
10905 d_c99_variadic_macros="$define"
10908 echo "You don't have functional C99 variadic macros." >&4
10909 d_c99_variadic_macros="$undef"
10913 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10914 d_c99_variadic_macros="$undef"
10919 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10920 d_c99_variadic_macros="$undef"
10924 : see if signal is declared as pointer to function returning int or void
10926 xxx=`./findhdr signal.h`
10927 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10928 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10929 echo "You have int (*signal())() instead of void." >&4
10931 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10932 echo "You have void (*signal())()." >&4
10934 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10935 echo "You have int (*signal())() instead of void." >&4
10937 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10938 echo "You have void (*signal())()." >&4
10941 case "$d_voidsig" in
10943 echo "I can't determine whether signal handler returns void or int..." >&4
10945 rp="What type does your signal handler return?"
10948 v*) val="$define";;
10952 echo "As you already told me, signal handler returns void." >&4
10955 *) echo "As you already told me, signal handler returns int." >&4
10962 case "$d_voidsig" in
10963 "$define") signal_t="void";;
10964 *) signal_t="int";;
10968 : check for ability to cast large floats to 32-bit ints.
10970 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10971 if $test "$intsize" -ge 4; then
10978 #$i_stdlib I_STDLIB
10980 #include <stdlib.h>
10982 #include <sys/types.h>
10983 #include <signal.h>
10984 $signal_t blech(int s) { exit(3); }
10991 signal(SIGFPE, blech);
10993 /* Don't let compiler optimize the test away. Store the number
10994 in a writable string for gcc to pass to sscanf under HP-UX.
10996 sprintf(str, "2147483647");
10997 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11001 /* x86 processors will probably give 0x8000 0000, which is a
11002 sign change. We don't want that. We want to mimic SPARC
11003 behavior here, which is to preserve the sign and give
11006 if (i32 != ($xxx) f)
11012 if eval $compile_ok; then
11016 echo "(I can't seem to compile the test program--assuming it can't)"
11021 echo "Yup, it can."
11024 echo "Nope, it can't."
11031 : check for ability to cast negative floats to unsigned
11033 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11036 #$i_stdlib I_STDLIB
11038 #include <stdlib.h>
11040 #include <sys/types.h>
11041 #include <signal.h>
11042 $signal_t blech(int s) { exit(7); }
11043 $signal_t blech_in_list(int s) { exit(4); }
11044 unsigned long dummy_long(unsigned long p) { return p; }
11045 unsigned int dummy_int(unsigned int p) { return p; }
11046 unsigned short dummy_short(unsigned short p) { return p; }
11050 unsigned long along;
11052 unsigned short ashort;
11056 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11057 a direct f = -123. assignment. gcc-2.8.0 reportedly
11058 optimized the whole file away
11060 /* Store the number in a writable string for gcc to pass to
11061 sscanf under HP-UX.
11063 sprintf(str, "-123");
11064 sscanf(str, "%lf", &f); /* f = -123.; */
11066 signal(SIGFPE, blech);
11067 along = (unsigned long)f;
11068 aint = (unsigned int)f;
11069 ashort = (unsigned short)f;
11070 if (along != (unsigned long)-123)
11072 if (aint != (unsigned int)-123)
11074 if (ashort != (unsigned short)-123)
11076 sprintf(str, "1073741824.");
11077 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11080 along = (unsigned long)f;
11081 if (along != 0x80000000)
11085 along = (unsigned long)f;
11086 if (along != 0x7fffffff)
11090 along = (unsigned long)f;
11091 if (along != 0x80000001)
11095 signal(SIGFPE, blech_in_list);
11096 sprintf(str, "123.");
11097 sscanf(str, "%lf", &f); /* f = 123.; */
11098 along = dummy_long((unsigned long)f);
11099 aint = dummy_int((unsigned int)f);
11100 ashort = dummy_short((unsigned short)f);
11101 if (along != (unsigned long)123)
11103 if (aint != (unsigned int)123)
11105 if (ashort != (unsigned short)123)
11112 if eval $compile_ok; then
11116 echo "(I can't seem to compile the test program--assuming it can't)"
11119 case "$castflags" in
11121 echo "Yup, it can."
11124 echo "Nope, it can't."
11131 : see if vprintf exists
11133 if set vprintf val -f d_vprintf; eval $csym; $val; then
11134 echo 'vprintf() found.' >&4
11137 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11138 #$i_varargs I_VARARGS
11140 #$i_stdlib I_STDLIB
11141 #$i_unistd I_UNISTD
11144 # include <stdarg.h>
11145 #else /* I_VARARGS */
11146 # include <varargs.h>
11150 # include <unistd.h>
11154 # include <stdlib.h>
11157 #include <stdio.h> /* vsprintf prototype */
11160 void xxx(int n, ...)
11165 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11167 int main() { xxx(1, "foo"); }
11169 #else /* I_VARARGS */
11177 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11179 int main() { xxx("foo"); }
11185 if eval $compile_ok; then
11186 if $run ./try; then
11187 echo "Your vsprintf() returns (int)." >&4
11190 echo "Your vsprintf() returns (char*)." >&4
11194 echo 'I am unable to compile the vsprintf() test program.' >&4
11195 # We shouldn't get here. If we do, assume the standard signature,
11196 # not the old BSD one.
11197 echo 'Guessing that vsprintf() returns (int).' >&4
11201 echo 'vprintf() NOT found.' >&4
11212 : see if chown exists
11216 : see if chroot exists
11217 set chroot d_chroot
11220 : see if chsize exists
11221 set chsize d_chsize
11224 : see if class exists
11228 : see if clearenv exists
11229 set clearenv d_clearenv
11232 : Define hasstruct macro for Configure internal use
11233 hasstruct='varname=$1; struct=$2; shift; shift;
11234 while $test $# -ge 2; do
11236 $define) echo "#include <$2>";;
11240 echo "int main () { struct $struct foo; }" >> try.c;
11242 if eval $compile; then
11251 : see whether socket exists
11255 $echo $n "Hmm... $c" >&4
11256 if set socket val -f d_socket; eval $csym; $val; then
11257 echo "Looks like you have Berkeley networking support." >&4
11259 if set setsockopt val -f; eval $csym; $val; then
11262 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11263 d_oldsock="$define"
11266 if $contains socklib libc.list >/dev/null 2>&1; then
11267 echo "Looks like you have Berkeley networking support." >&4
11269 : we will have to assume that it supports the 4.2 BSD interface
11272 echo "You don't have Berkeley networking in libc$_a..." >&4
11273 if test "X$d_socket" = "X$define"; then
11274 echo "...but you seem to believe that you have sockets." >&4
11276 for net in net socket
11278 if test -f /usr/lib/lib$net$_a; then
11279 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11280 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11281 if $contains socket libc.list >/dev/null 2>&1; then
11286 echo "...but the Wollongong group seems to have hacked it in." >&4
11287 sockethdr="-I/usr/netinclude"
11290 echo "Found Berkeley sockets interface in lib$net." >&4
11291 if $contains setsockopt libc.list >/dev/null 2>&1; then
11294 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11295 d_oldsock="$define"
11301 if test "X$d_socket" != "X$define"; then
11302 echo "or anywhere else I see." >&4
11310 : see if socketpair exists
11311 set socketpair d_sockpair
11316 echo "Checking the availability sa_len in the sock struct ..." >&4
11318 #include <sys/types.h>
11319 #include <sys/socket.h>
11321 struct sockaddr sa;
11322 return (sa.sa_len);
11326 set try; if eval $compile; then
11329 set d_sockaddr_sa_len; eval $setvar
11333 echo "Checking the availability struct sockaddr_in6 ..." >&4
11335 #include <sys/types.h>
11336 #include <sys/socket.h>
11337 #include <netinet/in.h>
11339 struct sockaddr_in6 sin6;
11340 return (sin6.sin6_family);
11344 set try; if eval $compile; then
11347 set d_sockaddr_in6; eval $setvar
11351 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
11353 #include <sys/types.h>
11354 #include <sys/socket.h>
11355 #include <netinet/in.h>
11357 struct sockaddr_in6 sin6;
11358 return (sin6.sin6_scope_id);
11362 set try; if eval $compile; then
11365 set d_sin6_scope_id; eval $setvar
11369 echo "Checking the availability struct ip_mreq ..." >&4
11371 #include <sys/types.h>
11372 #include <sys/socket.h>
11373 #include <netinet/in.h>
11375 struct ip_mreq mreq;
11376 return (mreq.imr_multiaddr.s_addr);
11380 set try; if eval $compile; then
11383 set d_ip_mreq; eval $setvar
11387 echo "Checking the availability struct ip_mreq_source ..." >&4
11389 #include <sys/types.h>
11390 #include <sys/socket.h>
11391 #include <netinet/in.h>
11393 struct ip_mreq_source mreq;
11394 return (mreq.imr_multiaddr.s_addr);
11398 set try; if eval $compile; then
11401 set d_ip_mreq_source; eval $setvar
11405 echo "Checking the availability struct ipv6_mreq ..." >&4
11407 #include <sys/types.h>
11408 #include <sys/socket.h>
11409 #include <netinet/in.h>
11411 struct ipv6_mreq mreq;
11412 return (mreq.ipv6mr_interface);
11416 set try; if eval $compile; then
11419 set d_ipv6_mreq; eval $setvar
11423 echo "Checking the availability struct ipv6_mreq_source ..." >&4
11425 #include <sys/types.h>
11426 #include <sys/socket.h>
11427 #include <netinet/in.h>
11429 struct ipv6_mreq_source mreq;
11430 return (mreq.imr_multiaddr.s_addr);
11434 set try; if eval $compile; then
11437 set d_ipv6_mreq_source; eval $setvar
11441 echo "Checking the availability of certain socket constants..." >&4
11442 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11443 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11445 #include <sys/types.h>
11446 #include <sys/socket.h>
11452 set try; if eval $compile; then
11455 set d_${enum}; eval $setvar
11459 : see if this is a sys/uio.h system
11460 set sys/uio.h i_sysuio
11463 : Check for cmsghdr support
11465 echo "Checking to see if your system supports struct cmsghdr..." >&4
11466 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11468 case "$d_cmsghdr_s" in
11469 "$define") echo "Yes, it does." ;;
11470 *) echo "No, it doesn't." ;;
11474 : check for const keyword
11476 echo 'Checking to see if your C compiler knows about "const"...' >&4
11477 $cat >const.c <<'EOCP'
11478 typedef struct spug { int drokk; } spug;
11482 const spug y = { 0 };
11485 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11487 echo "Yup, it does."
11490 echo "Nope, it doesn't."
11495 : see if copysignl exists
11496 set copysignl d_copysignl
11499 : see if crypt exists
11504 $define) cryptlib='' ;;
11505 *) if set crypt val -f d_crypt; eval $csym; $val; then
11506 echo 'crypt() found.' >&4
11510 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11511 if $test -z "$cryptlib"; then
11512 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11516 if $test -z "$cryptlib"; then
11517 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11521 if $test -z "$cryptlib"; then
11522 cryptlib=`./loc libcrypt$_a "" $libpth`
11526 if $test -z "$cryptlib"; then
11527 echo 'crypt() NOT found.' >&4
11538 : see if this is a crypt.h system
11539 set crypt.h i_crypt
11542 : see if crypt_r exists
11543 set crypt_r d_crypt_r
11545 case "$d_crypt_r" in
11547 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11548 case "$d_crypt_r_proto:$usethreads" in
11549 ":define") d_crypt_r_proto=define
11550 set d_crypt_r_proto crypt_r $hdrs
11554 case "$d_crypt_r_proto" in
11556 case "$crypt_r_proto" in
11557 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11558 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11560 case "$crypt_r_proto" in
11561 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11562 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11564 case "$crypt_r_proto" in
11565 ''|0) d_crypt_r=undef
11567 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11568 * ) case "$crypt_r_proto" in
11569 REENTRANT_PROTO*) ;;
11570 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11572 echo "Prototype: $try" ;;
11575 *) case "$usethreads" in
11576 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11587 : get csh whereabouts
11589 'csh') val="$undef" ;;
11590 *) val="$define" ;;
11594 : Respect a hint or command line value for full_csh.
11595 case "$full_csh" in
11596 '') full_csh=$csh ;;
11599 : see if ctermid exists
11600 set ctermid d_ctermid
11603 : see if ctermid_r exists
11604 set ctermid_r d_ctermid_r
11606 case "$d_ctermid_r" in
11608 hdrs="$i_systypes sys/types.h define stdio.h "
11609 case "$d_ctermid_r_proto:$usethreads" in
11610 ":define") d_ctermid_r_proto=define
11611 set d_ctermid_r_proto ctermid_r $hdrs
11615 case "$d_ctermid_r_proto" in
11617 case "$ctermid_r_proto" in
11618 ''|0) try='char* ctermid_r(char*);'
11619 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11621 case "$ctermid_r_proto" in
11622 ''|0) d_ctermid_r=undef
11624 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11625 * ) case "$ctermid_r_proto" in
11626 REENTRANT_PROTO*) ;;
11627 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11629 echo "Prototype: $try" ;;
11632 *) case "$usethreads" in
11633 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11640 *) ctermid_r_proto=0
11644 : see if ctime_r exists
11645 set ctime_r d_ctime_r
11647 case "$d_ctime_r" in
11649 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11650 case "$d_ctime_r_proto:$usethreads" in
11651 ":define") d_ctime_r_proto=define
11652 set d_ctime_r_proto ctime_r $hdrs
11656 case "$d_ctime_r_proto" in
11658 case "$ctime_r_proto" in
11659 ''|0) try='char* ctime_r(const time_t*, char*);'
11660 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11662 case "$ctime_r_proto" in
11663 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11664 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11666 case "$ctime_r_proto" in
11667 ''|0) try='int ctime_r(const time_t*, char*);'
11668 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11670 case "$ctime_r_proto" in
11671 ''|0) try='int ctime_r(const time_t*, char*, int);'
11672 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11674 case "$ctime_r_proto" in
11675 ''|0) d_ctime_r=undef
11677 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11678 * ) case "$ctime_r_proto" in
11679 REENTRANT_PROTO*) ;;
11680 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11682 echo "Prototype: $try" ;;
11685 *) case "$usethreads" in
11686 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11697 : see if cuserid exists
11698 set cuserid d_cuserid
11701 : see if this is a limits.h system
11702 set limits.h i_limits
11705 : see if this is a float.h system
11706 set float.h i_float
11709 : See if number of significant digits in a double precision number is known
11711 $cat >dbl_dig.c <<EOM
11712 #$i_limits I_LIMITS
11715 #include <limits.h>
11721 printf("Contains DBL_DIG");
11724 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11725 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11726 echo "DBL_DIG found." >&4
11729 echo "DBL_DIG NOT found." >&4
11736 : see if dbm.h is available
11737 : see if dbmclose exists
11738 set dbmclose d_dbmclose
11741 case "$d_dbmclose" in
11751 *) set rpcsvc/dbm.h i_rpcsvcdbm
11756 *) echo "We won't be including <dbm.h>"
11766 : see if prototype for dbminit is available
11768 set d_dbminitproto dbminit $i_dbm dbm.h
11771 : see if difftime exists
11772 set difftime d_difftime
11775 : see if this is a dirent system
11777 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11779 echo "<dirent.h> found." >&4
11782 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11783 echo "<sys/dir.h> found." >&4
11786 xinc=`./findhdr sys/ndir.h`
11788 echo "<dirent.h> NOT found." >&4
11793 : Look for type of directory structure.
11795 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11797 case "$direntrytype" in
11799 case "$i_dirent" in
11800 $define) guess1='struct dirent' ;;
11801 *) guess1='struct direct' ;;
11804 *) guess1="$direntrytype"
11809 'struct dirent') guess2='struct direct' ;;
11810 *) guess2='struct dirent' ;;
11813 if $contains "$guess1" try.c >/dev/null 2>&1; then
11814 direntrytype="$guess1"
11815 echo "Your directory entries are $direntrytype." >&4
11816 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11817 direntrytype="$guess2"
11818 echo "Your directory entries seem to be $direntrytype." >&4
11820 echo "I don't recognize your system's directory entries." >&4
11821 rp="What type is used for directory entries on this system?"
11824 direntrytype="$ans"
11828 : see if the directory entry stores field length
11830 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11831 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11832 echo "Good, your directory entry keeps length information in d_namlen." >&4
11835 echo "Your directory entry does not know about the d_namlen field." >&4
11842 : Look for DIR.dd_fd
11843 case "$i_dirent" in
11845 echo "Checking to see if DIR has a dd_fd member variable" >&4
11847 #$i_stdlib I_STDLIB
11849 #include <stdlib.h>
11851 #include <dirent.h>
11861 if eval $compile; then
11862 echo "Yes, it does."
11865 echo "No, it does not."
11870 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11878 : see if this is an sysdir system
11879 set sys/dir.h i_sysdir
11882 : see if this is an sysndir system
11883 set sys/ndir.h i_sysndir
11888 $cat >dirfd.c <<EOM
11890 #$i_stdlib I_STDLIB
11892 #include <stdlib.h>
11894 #$i_dirent I_DIRENT /**/
11895 #$i_sysdir I_SYS_DIR /**/
11896 #$i_sysndir I_SYS_NDIR /**/
11897 #$i_systypes I_SYS_TYPES /**/
11898 #if defined(I_SYS_TYPES)
11899 #include <sys/types.h>
11901 #if defined(I_DIRENT)
11902 #include <dirent.h>
11903 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11904 #include <sys/dir.h>
11908 #include <sys/ndir.h>
11912 #include <ndir.h> /* may be wrong in the future */
11914 #include <sys/dir.h>
11920 DIR *dirp = opendir(".");
11921 if (dirfd(dirp) >= 0)
11929 if eval $compile; then
11933 $define) echo "dirfd() found." >&4 ;;
11934 *) echo "dirfd() NOT found." >&4 ;;
11940 : see if dlerror exists
11943 set dlerror d_dlerror
11947 : see if dlfcn is available
11948 set dlfcn.h i_dlfcn
11951 : Check what extension to use for shared libs
11956 On a few systems, the dynamically loaded modules that perl generates and uses
11957 will need a different extension than shared libs. The default will probably
11963 *) dflt="$dlext" ;;
11965 rp='What is the extension of dynamically loaded modules'
11974 : Check if dlsym need a leading underscore
11980 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11981 $cat >dyna.c <<'EOM'
11988 #$i_stdlib I_STDLIB
11990 #include <stdlib.h>
11994 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11996 #include <sys/types.h>
12001 extern int fred() ;
12010 int mode = RTLD_LAZY ;
12012 handle = dlopen("./dyna.$dlext", mode) ;
12013 if (handle == NULL) {
12018 symbol = dlsym(handle, "fred") ;
12019 if (symbol == NULL) {
12020 /* try putting a leading underscore */
12021 symbol = dlsym(handle, "_fred") ;
12022 if (symbol == NULL) {
12035 : Call the object file tmp-dyna.o in case dlext=o.
12036 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
12037 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
12038 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
12039 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
12042 1) echo "Test program failed using dlopen." >&4
12043 echo "Perhaps you should not use dynamic loading." >&4;;
12044 2) echo "Test program failed using dlsym." >&4
12045 echo "Perhaps you should not use dynamic loading." >&4;;
12046 3) echo "dlsym needs a leading underscore" >&4
12048 4) echo "dlsym doesn't need a leading underscore." >&4;;
12051 echo "I can't compile and run the test program." >&4
12052 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
12057 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
12062 : see if drand48_r exists
12063 set drand48_r d_drand48_r
12065 case "$d_drand48_r" in
12067 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
12068 case "$d_drand48_r_proto:$usethreads" in
12069 ":define") d_drand48_r_proto=define
12070 set d_drand48_r_proto drand48_r $hdrs
12074 case "$d_drand48_r_proto" in
12076 case "$drand48_r_proto" in
12077 ''|0) try='int drand48_r(struct drand48_data*, double*);'
12078 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
12080 case "$drand48_r_proto" in
12081 ''|0) d_drand48_r=undef
12083 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12084 * ) case "$drand48_r_proto" in
12085 REENTRANT_PROTO*) ;;
12086 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12088 echo "Prototype: $try" ;;
12091 *) case "$usethreads" in
12092 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12099 *) drand48_r_proto=0
12103 : see if prototype for drand48 is available
12105 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12108 : see if dup2 exists
12112 : see if eaccess exists
12113 set eaccess d_eaccess
12116 : see if endgrent exists
12117 set endgrent d_endgrent
12120 : see if this is an grp system
12126 xxx=`./findhdr grp.h`
12127 $cppstdin $cppflags $cppminus < $xxx >$$.h
12129 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12141 set d_grpasswd; eval $setvar
12145 : see if endgrent_r exists
12146 set endgrent_r d_endgrent_r
12148 case "$d_endgrent_r" in
12150 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12151 case "$d_endgrent_r_proto:$usethreads" in
12152 ":define") d_endgrent_r_proto=define
12153 set d_endgrent_r_proto endgrent_r $hdrs
12157 case "$d_endgrent_r_proto" in
12159 case "$endgrent_r_proto" in
12160 ''|0) try='int endgrent_r(FILE**);'
12161 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12163 case "$endgrent_r_proto" in
12164 ''|0) try='void endgrent_r(FILE**);'
12165 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12167 case "$endgrent_r_proto" in
12168 ''|0) d_endgrent_r=undef
12170 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12171 * ) case "$endgrent_r_proto" in
12172 REENTRANT_PROTO*) ;;
12173 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12175 echo "Prototype: $try" ;;
12178 *) case "$usethreads" in
12179 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12186 *) endgrent_r_proto=0
12190 : see if endhostent exists
12191 set endhostent d_endhent
12194 : see if this is a netdb.h system
12195 set netdb.h i_netdb
12198 : see if endhostent_r exists
12199 set endhostent_r d_endhostent_r
12201 case "$d_endhostent_r" in
12203 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12204 case "$d_endhostent_r_proto:$usethreads" in
12205 ":define") d_endhostent_r_proto=define
12206 set d_endhostent_r_proto endhostent_r $hdrs
12210 case "$d_endhostent_r_proto" in
12212 case "$endhostent_r_proto" in
12213 ''|0) try='int endhostent_r(struct hostent_data*);'
12214 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12216 case "$endhostent_r_proto" in
12217 ''|0) try='void endhostent_r(struct hostent_data*);'
12218 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12220 case "$endhostent_r_proto" in
12221 ''|0) d_endhostent_r=undef
12222 endhostent_r_proto=0
12223 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12224 * ) case "$endhostent_r_proto" in
12225 REENTRANT_PROTO*) ;;
12226 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12228 echo "Prototype: $try" ;;
12231 *) case "$usethreads" in
12232 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12234 d_endhostent_r=undef
12235 endhostent_r_proto=0
12239 *) endhostent_r_proto=0
12243 : see if endnetent exists
12244 set endnetent d_endnent
12247 : see if endnetent_r exists
12248 set endnetent_r d_endnetent_r
12250 case "$d_endnetent_r" in
12252 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12253 case "$d_endnetent_r_proto:$usethreads" in
12254 ":define") d_endnetent_r_proto=define
12255 set d_endnetent_r_proto endnetent_r $hdrs
12259 case "$d_endnetent_r_proto" in
12261 case "$endnetent_r_proto" in
12262 ''|0) try='int endnetent_r(struct netent_data*);'
12263 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12265 case "$endnetent_r_proto" in
12266 ''|0) try='void endnetent_r(struct netent_data*);'
12267 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12269 case "$endnetent_r_proto" in
12270 ''|0) d_endnetent_r=undef
12271 endnetent_r_proto=0
12272 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12273 * ) case "$endnetent_r_proto" in
12274 REENTRANT_PROTO*) ;;
12275 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12277 echo "Prototype: $try" ;;
12280 *) case "$usethreads" in
12281 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12283 d_endnetent_r=undef
12284 endnetent_r_proto=0
12288 *) endnetent_r_proto=0
12292 : see if endprotoent exists
12293 set endprotoent d_endpent
12296 : see if endprotoent_r exists
12297 set endprotoent_r d_endprotoent_r
12299 case "$d_endprotoent_r" in
12301 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12302 case "$d_endprotoent_r_proto:$usethreads" in
12303 ":define") d_endprotoent_r_proto=define
12304 set d_endprotoent_r_proto endprotoent_r $hdrs
12308 case "$d_endprotoent_r_proto" in
12310 case "$endprotoent_r_proto" in
12311 ''|0) try='int endprotoent_r(struct protoent_data*);'
12312 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12314 case "$endprotoent_r_proto" in
12315 ''|0) try='void endprotoent_r(struct protoent_data*);'
12316 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12318 case "$endprotoent_r_proto" in
12319 ''|0) d_endprotoent_r=undef
12320 endprotoent_r_proto=0
12321 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12322 * ) case "$endprotoent_r_proto" in
12323 REENTRANT_PROTO*) ;;
12324 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12326 echo "Prototype: $try" ;;
12329 *) case "$usethreads" in
12330 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12332 d_endprotoent_r=undef
12333 endprotoent_r_proto=0
12337 *) endprotoent_r_proto=0
12341 : see if endpwent exists
12342 set endpwent d_endpwent
12345 : see if this is a pwd.h system
12351 xxx=`./findhdr pwd.h`
12352 $cppstdin $cppflags $cppminus < $xxx >$$.h
12354 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12362 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12370 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12378 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12386 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12394 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12402 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12410 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12422 set d_pwquota; eval $setvar
12423 set d_pwage; eval $setvar
12424 set d_pwchange; eval $setvar
12425 set d_pwclass; eval $setvar
12426 set d_pwexpire; eval $setvar
12427 set d_pwcomment; eval $setvar
12428 set d_pwgecos; eval $setvar
12429 set d_pwpasswd; eval $setvar
12433 : see if endpwent_r exists
12434 set endpwent_r d_endpwent_r
12436 case "$d_endpwent_r" in
12438 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12439 case "$d_endpwent_r_proto:$usethreads" in
12440 ":define") d_endpwent_r_proto=define
12441 set d_endpwent_r_proto endpwent_r $hdrs
12445 case "$d_endpwent_r_proto" in
12447 case "$endpwent_r_proto" in
12448 ''|0) try='int endpwent_r(FILE**);'
12449 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12451 case "$endpwent_r_proto" in
12452 ''|0) try='void endpwent_r(FILE**);'
12453 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12455 case "$endpwent_r_proto" in
12456 ''|0) d_endpwent_r=undef
12458 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12459 * ) case "$endpwent_r_proto" in
12460 REENTRANT_PROTO*) ;;
12461 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12463 echo "Prototype: $try" ;;
12466 *) case "$usethreads" in
12467 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12474 *) endpwent_r_proto=0
12478 : see if endservent exists
12479 set endservent d_endsent
12482 : see if endservent_r exists
12483 set endservent_r d_endservent_r
12485 case "$d_endservent_r" in
12487 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12488 case "$d_endservent_r_proto:$usethreads" in
12489 ":define") d_endservent_r_proto=define
12490 set d_endservent_r_proto endservent_r $hdrs
12494 case "$d_endservent_r_proto" in
12496 case "$endservent_r_proto" in
12497 ''|0) try='int endservent_r(struct servent_data*);'
12498 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12500 case "$endservent_r_proto" in
12501 ''|0) try='void endservent_r(struct servent_data*);'
12502 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12504 case "$endservent_r_proto" in
12505 ''|0) d_endservent_r=undef
12506 endservent_r_proto=0
12507 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12508 * ) case "$endservent_r_proto" in
12509 REENTRANT_PROTO*) ;;
12510 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12512 echo "Prototype: $try" ;;
12515 *) case "$usethreads" in
12516 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12518 d_endservent_r=undef
12519 endservent_r_proto=0
12523 *) endservent_r_proto=0
12527 : Locate the flags for 'open()'
12530 #include <sys/types.h>
12535 #include <sys/file.h>
12537 #$i_stdlib I_STDLIB
12539 #include <stdlib.h>
12550 : check sys/file.h first to get FREAD on Sun
12551 if $test `./findhdr sys/file.h` && \
12552 set try -DI_SYS_FILE && eval $compile; then
12554 echo "<sys/file.h> defines the O_* constants..." >&4
12555 if $run ./try; then
12556 echo "and you have the 3 argument form of open()." >&4
12559 echo "but not the 3 argument form of open(). Oh, well." >&4
12562 elif $test `./findhdr fcntl.h` && \
12563 set try -DI_FCNTL && eval $compile; then
12565 echo "<fcntl.h> defines the O_* constants..." >&4
12566 if $run ./try; then
12567 echo "and you have the 3 argument form of open()." >&4
12570 echo "but not the 3 argument form of open(). Oh, well." >&4
12575 echo "I can't find the O_* constant definitions! You got problems." >&4
12581 : see if this is a sys/file.h system
12586 : do we need to include sys/file.h ?
12590 if $h_sysfile; then
12592 echo "We'll be including <sys/file.h>." >&4
12595 echo "We won't be including <sys/file.h>." >&4
12605 : see if fcntl.h is there
12610 : see if we can include fcntl.h
12616 echo "We'll be including <fcntl.h>." >&4
12619 if $h_sysfile; then
12620 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12622 echo "We won't be including <fcntl.h>." >&4
12634 : see if fork exists
12638 : see if pipe exists
12642 : check for non-blocking I/O stuff
12643 case "$h_sysfile" in
12644 true) echo "#include <sys/file.h>" > head.c;;
12647 true) echo "#include <fcntl.h>" > head.c;;
12648 *) echo "#include <sys/fcntl.h>" > head.c;;
12653 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12654 case "$o_nonblock" in
12656 $cat head.c > try.c
12657 $cat >>try.c <<EOCP
12659 #$i_stdlib I_STDLIB
12661 #include <stdlib.h>
12669 printf("O_NONBLOCK\n");
12673 printf("O_NDELAY\n");
12677 printf("FNDELAY\n");
12684 if eval $compile_ok; then
12685 o_nonblock=`$run ./try`
12686 case "$o_nonblock" in
12687 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12688 *) echo "Seems like we can use $o_nonblock.";;
12691 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12694 *) echo "Using $hint value $o_nonblock.";;
12699 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12702 case "$d_fork:$d_pipe" in
12704 $cat head.c > try.c
12705 $cat >>try.c <<EOCP
12707 #include <sys/types.h>
12708 #include <signal.h>
12710 #$i_stdlib I_STDLIB
12712 #include <stdlib.h>
12718 #define MY_O_NONBLOCK $o_nonblock
12719 #ifndef errno /* XXX need better Configure test */
12722 #$i_unistd I_UNISTD
12724 #include <unistd.h>
12726 #$i_string I_STRING
12728 #include <string.h>
12730 #include <strings.h>
12732 $signal_t blech(int x) { exit(3); }
12734 $cat >> try.c <<'EOCP'
12742 pipe(pd); /* Down: child -> parent */
12743 pipe(pu); /* Up: parent -> child */
12746 close(pd[1]); /* Parent reads from pd[0] */
12747 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12749 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12754 signal(SIGALRM, blech);
12756 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12758 sprintf(string, "%d\n", ret);
12759 write(2, string, strlen(string));
12762 if (errno == EAGAIN) {
12763 printf("EAGAIN\n");
12768 if (errno == EWOULDBLOCK)
12769 printf("EWOULDBLOCK\n");
12772 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12773 sleep(2); /* Give it time to close our pipe */
12775 ret = read(pd[0], buf, 1); /* Should read EOF */
12777 sprintf(string, "%d\n", ret);
12778 write(4, string, strlen(string));
12782 close(pd[0]); /* We write to pd[1] */
12783 close(pu[1]); /* We read from pu[0] */
12784 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12785 close(pd[1]); /* Pipe pd is now fully closed! */
12786 exit(0); /* Bye bye, thank you for playing! */
12790 if eval $compile_ok; then
12791 echo "$startsh" >mtry
12792 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12794 ./mtry >/dev/null 2>&1
12796 0) eagain=`$cat try.out`;;
12797 1) echo "Could not perform non-blocking setting!";;
12798 2) echo "I did a successful read() for something that was not there!";;
12799 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12800 4) echo "Could not find F_SETFL!";;
12801 *) echo "Something terribly wrong happened during testing.";;
12803 rd_nodata=`$cat try.ret`
12804 echo "A read() system call with no data present returns $rd_nodata."
12805 case "$rd_nodata" in
12808 echo "(That's peculiar, fixing that to be -1.)"
12814 echo "Forcing errno EAGAIN on read() with no data available."
12818 echo "Your read() sets errno to $eagain when no data is available."
12821 status=`$cat try.err`
12823 0) echo "And it correctly returns 0 to signal EOF.";;
12824 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12825 *) echo "However, your read() returns '$status' on EOF??";;
12828 if test "$status" = "$rd_nodata"; then
12829 echo "WARNING: you can't distinguish between EOF and no data!"
12833 echo "I can't compile the test program--assuming errno EAGAIN will do."
12837 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12846 echo "Using $hint value $eagain."
12847 echo "Your read() returns $rd_nodata when no data is present."
12848 case "$d_eofnblk" in
12849 "$define") echo "And you can see EOF because read() returns 0.";;
12850 "$undef") echo "But you can't see EOF status from read() returned value.";;
12852 echo "(Assuming you can't see EOF status from read anyway.)"
12858 $rm_try head.c mtry
12860 : see if _ptr and _cnt from stdio act std
12863 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12864 echo "(Looks like you have stdio.h from BSD.)"
12865 case "$stdio_ptr" in
12866 '') stdio_ptr='((fp)->_p)'
12869 *) ptr_lval=$d_stdio_ptr_lval;;
12871 case "$stdio_cnt" in
12872 '') stdio_cnt='((fp)->_r)'
12875 *) cnt_lval=$d_stdio_cnt_lval;;
12877 case "$stdio_base" in
12878 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12880 case "$stdio_bufsiz" in
12881 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12883 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12884 echo "(Looks like you have stdio.h from Linux.)"
12885 case "$stdio_ptr" in
12886 '') stdio_ptr='((fp)->_IO_read_ptr)'
12889 *) ptr_lval=$d_stdio_ptr_lval;;
12891 case "$stdio_cnt" in
12892 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12895 *) cnt_lval=$d_stdio_cnt_lval;;
12897 case "$stdio_base" in
12898 '') stdio_base='((fp)->_IO_read_base)';;
12900 case "$stdio_bufsiz" in
12901 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12904 case "$stdio_ptr" in
12905 '') stdio_ptr='((fp)->_ptr)'
12908 *) ptr_lval=$d_stdio_ptr_lval;;
12910 case "$stdio_cnt" in
12911 '') stdio_cnt='((fp)->_cnt)'
12914 *) cnt_lval=$d_stdio_cnt_lval;;
12916 case "$stdio_base" in
12917 '') stdio_base='((fp)->_base)';;
12919 case "$stdio_bufsiz" in
12920 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12924 : test whether _ptr and _cnt really work
12925 echo "Checking how std your stdio is..." >&4
12928 #$i_stdlib I_STDLIB
12930 #include <stdlib.h>
12932 #define FILE_ptr(fp) $stdio_ptr
12933 #define FILE_cnt(fp) $stdio_cnt
12935 FILE *fp = fopen("try.c", "r");
12938 18 <= FILE_cnt(fp) &&
12939 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12947 if eval $compile && $to try.c; then
12948 if $run ./try; then
12949 echo "Your stdio acts pretty std."
12952 echo "Your stdio isn't very std."
12955 echo "Your stdio doesn't appear very std."
12959 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12960 # direct buffer manipulation no longer works. The Configure tests
12961 # should be changed to correctly detect this, but until then,
12962 # the following check should at least let perl compile and run.
12963 # (This quick fix should be updated before 5.8.1.)
12964 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12965 # A. Dougherty, June 3, 2002.
12966 case "$d_gnulibc" in
12968 case "$gnulibc_version" in
12972 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12981 : Can _ptr be used as an lvalue?
12982 case "$d_stdstdio$ptr_lval" in
12983 $define$define) val=$define ;;
12986 set d_stdio_ptr_lval
12989 : Can _cnt be used as an lvalue?
12990 case "$d_stdstdio$cnt_lval" in
12991 $define$define) val=$define ;;
12994 set d_stdio_cnt_lval
12998 : test whether setting _ptr sets _cnt as a side effect
12999 d_stdio_ptr_lval_sets_cnt="$undef"
13000 d_stdio_ptr_lval_nochange_cnt="$undef"
13001 case "$d_stdio_ptr_lval$d_stdstdio" in
13003 echo "Checking to see what happens if we set the stdio ptr..." >&4
13006 /* Can we scream? */
13007 /* Eat dust sed :-) */
13008 /* In the buffer space, no one can hear you scream. */
13009 #$i_stdlib I_STDLIB
13011 #include <stdlib.h>
13013 #define FILE_ptr(fp) $stdio_ptr
13014 #define FILE_cnt(fp) $stdio_cnt
13015 #include <sys/types.h>
13017 FILE *fp = fopen("try.c", "r");
13022 puts("Fail even to read");
13025 c = getc(fp); /* Read away the first # */
13027 puts("Fail even to read");
13031 18 <= FILE_cnt(fp) &&
13032 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
13034 puts("Fail even to read");
13037 ptr = (char*) FILE_ptr(fp);
13038 cnt = (size_t)FILE_cnt(fp);
13040 FILE_ptr(fp) += 42;
13042 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
13043 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
13046 if (FILE_cnt(fp) <= 20) {
13047 printf ("Fail (<20 chars to test)");
13050 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
13051 puts("Fail compare");
13054 if (cnt == FILE_cnt(fp)) {
13055 puts("Pass_unchanged");
13058 if (FILE_cnt(fp) == (cnt - 42)) {
13059 puts("Pass_changed");
13062 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
13068 if eval $compile && $to try.c; then
13069 case `$run ./try` in
13071 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
13072 d_stdio_ptr_lval_sets_cnt="$define" ;;
13074 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
13075 d_stdio_ptr_lval_nochange_cnt="$define" ;;
13077 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
13079 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
13082 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13088 : see if _base is also standard
13090 case "$d_stdstdio" in
13094 #$i_stdlib I_STDLIB
13096 #include <stdlib.h>
13098 #define FILE_base(fp) $stdio_base
13099 #define FILE_bufsiz(fp) $stdio_bufsiz
13101 FILE *fp = fopen("try.c", "r");
13104 19 <= FILE_bufsiz(fp) &&
13105 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13112 if eval $compile && $to try.c; then
13113 if $run ./try; then
13114 echo "And its _base field acts std."
13117 echo "But its _base field isn't std."
13120 echo "However, it seems to be lacking the _base field."
13128 : see if fast_stdio exists
13130 case "$d_stdstdio:$d_stdio_ptr_lval" in
13132 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13134 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13145 : see if fchdir exists
13146 set fchdir d_fchdir
13149 : see if fchmod exists
13150 set fchmod d_fchmod
13153 : see if fchown exists
13154 set fchown d_fchown
13157 : see if this is an fcntl system
13161 : See if fcntl-based locking works.
13164 #$i_stdlib I_STDLIB
13166 #include <stdlib.h>
13168 #include <unistd.h>
13170 #include <signal.h>
13171 $signal_t blech(int x) { exit(3); }
13173 #if defined(F_SETLK) && defined(F_SETLKW)
13174 struct flock flock;
13176 fd = open("try.c", O_RDONLY);
13177 flock.l_type = F_RDLCK;
13178 flock.l_whence = SEEK_SET;
13179 flock.l_start = flock.l_len = 0;
13180 signal(SIGALRM, blech);
13182 retval = fcntl(fd, F_SETLK, &flock);
13184 (retval < 0 ? exit(2) : exit(0));
13190 echo "Checking if fcntl-based file locking works... "
13194 if eval $compile_ok; then
13195 if $run ./try; then
13196 echo "Yes, it seems to work."
13199 echo "Nope, it didn't work."
13204 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13205 *** This is (almost) impossible.
13206 *** If your NFS lock daemons are not feeling well, something like
13207 *** this may happen, please investigate. Cannot continue, aborting.
13215 echo "I'm unable to compile the test program, so I'll assume not."
13220 echo "Nope, since you don't even have fcntl()."
13223 set d_fcntl_can_lock
13227 : check for fd_set items
13230 Checking to see how well your C compiler handles fd_set and friends ...
13233 #$i_stdlib I_STDLIB
13235 #include <stdlib.h>
13237 #$i_systime I_SYS_TIME
13238 #$i_sysselct I_SYS_SELECT
13239 #$d_socket HAS_SOCKET
13240 #include <sys/types.h>
13242 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13245 #include <sys/time.h>
13247 #ifdef I_SYS_SELECT
13248 #include <sys/select.h>
13257 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13265 if eval $compile; then
13266 d_fds_bits="$define"
13268 echo "Well, your system knows about the normal fd_set typedef..." >&4
13269 if $run ./try; then
13270 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13271 d_fd_macros="$define"
13274 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13276 d_fd_macros="$undef"
13280 Hmm, your compiler has some difficulty with fd_set. Checking further...
13283 if eval $compile; then
13284 d_fds_bits="$undef"
13286 echo "Well, your system has some sort of fd_set available..." >&4
13287 if $run ./try; then
13288 echo "and you have the normal fd_set macros." >&4
13289 d_fd_macros="$define"
13292 but not the normal fd_set macros! Gross! More work for me...
13294 d_fd_macros="$undef"
13297 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13299 d_fds_bits="$undef"
13300 d_fd_macros="$undef"
13305 : see if fgetpos exists
13306 set fgetpos d_fgetpos
13309 : see if finite exists
13310 set finite d_finite
13313 : see if finitel exists
13314 set finitel d_finitel
13317 : see if flock exists
13321 : see if prototype for flock is available
13323 set d_flockproto flock $i_sysfile sys/file.h
13326 : see if fp_class exists
13327 set fp_class d_fp_class
13330 : see if pathconf exists
13331 set pathconf d_pathconf
13334 : see if fpathconf exists
13335 set fpathconf d_fpathconf
13338 : see if fpclass exists
13339 set fpclass d_fpclass
13342 : see if fpclassify exists
13343 set fpclassify d_fpclassify
13346 : see if fpclassl exists
13347 set fpclassl d_fpclassl
13350 : check for fpos64_t
13352 echo "Checking to see if you have fpos64_t..." >&4
13355 int main() { fpos64_t x = 7; }
13358 if eval $compile; then
13360 echo "You have fpos64_t."
13363 echo "You do not have fpos64_t."
13364 case "$fpossize" in
13365 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13372 : see if frexpl exists
13373 set frexpl d_frexpl
13376 : see if this is a sys/param system
13377 set sys/param.h i_sysparam
13380 : see if this is a sys/mount.h system
13381 set sys/mount.h i_sysmount
13384 : Check for fs_data_s
13386 echo "Checking to see if your system supports struct fs_data..." >&4
13387 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13389 case "$d_fs_data_s" in
13390 "$define") echo "Yes, it does." ;;
13391 *) echo "No, it doesn't." ;;
13394 : see if fseeko exists
13395 set fseeko d_fseeko
13397 case "$longsize" in
13398 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13401 : see if fsetpos exists
13402 set fsetpos d_fsetpos
13405 : see if fstatfs exists
13406 set fstatfs d_fstatfs
13409 : see if statvfs exists
13410 set statvfs d_statvfs
13413 : see if fstatvfs exists
13414 set fstatvfs d_fstatvfs
13418 : see if fsync exists
13422 : see if ftello exists
13423 set ftello d_ftello
13425 case "$longsize" in
13426 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13429 : check for a working futimes
13432 echo "Checking if you have a working futimes()" >&4
13435 #include <sys/time.h>
13442 fd = open ("try.c", O_RDWR);
13443 if (-1 == fd) exit (1);
13444 rv = futimes (fd, NULL);
13445 exit (rv == -1 ? errno : 0);
13449 if eval $compile; then
13453 0) echo "Yes, you have" >&4
13454 d_futimes="$define"
13456 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13460 echo "No, it does not (probably harmless)" >&4
13464 : see if ndbm.h is available
13467 : Compatibility location for RedHat 7.1
13468 set gdbm/ndbm.h i_gdbmndbm
13470 : Compatibility location for Debian 4.0
13471 set gdbm-ndbm.h i_gdbm_ndbm
13475 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13476 : see if dbm_open exists
13477 set dbm_open d_dbm_open
13479 case "$d_dbm_open" in
13482 i_gdbmndbm="$undef"
13483 i_gdbm_ndbm="$undef"
13484 echo "We won't be including <ndbm.h>"
13494 ndbm_hdr_protochk='name=$1; hdr=$2;
13495 eval "ihdr=\$""i_$name";
13497 if $test "$ihdr" = "$define"; then
13498 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13499 case "$d_cplusplus" in
13500 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13501 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13504 $define) $echo "Your <$hdr> seems to have prototypes";;
13505 *) $echo "Your <$hdr> does not seem to have prototypes";;
13508 set "d_${name}_h_uses_prototypes";
13512 eval $ndbm_hdr_protochk
13513 set gdbmndbm gdbm/ndbm.h
13514 eval $ndbm_hdr_protochk
13515 set gdbm_ndbm gdbm-ndbm.h
13516 eval $ndbm_hdr_protochk
13518 : see if getaddrinfo exists
13519 set getaddrinfo d_getaddrinfo
13522 : see if getcwd exists
13523 set getcwd d_getcwd
13526 : see if getespwnam exists
13527 set getespwnam d_getespwnam
13530 : see if getfsstat exists
13531 set getfsstat d_getfsstat
13534 : see if getgrent exists
13535 set getgrent d_getgrent
13538 : see if getgrent_r exists
13539 set getgrent_r d_getgrent_r
13541 case "$d_getgrent_r" in
13543 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13544 case "$d_getgrent_r_proto:$usethreads" in
13545 ":define") d_getgrent_r_proto=define
13546 set d_getgrent_r_proto getgrent_r $hdrs
13550 case "$d_getgrent_r_proto" in
13552 case "$getgrent_r_proto" in
13553 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13554 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13556 case "$getgrent_r_proto" in
13557 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13558 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13560 case "$getgrent_r_proto" in
13561 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13562 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13564 case "$getgrent_r_proto" in
13565 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13566 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13568 case "$getgrent_r_proto" in
13569 ''|0) try='int getgrent_r(struct group*, char*, int);'
13570 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13572 case "$getgrent_r_proto" in
13573 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13574 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13576 case "$getgrent_r_proto" in
13577 ''|0) d_getgrent_r=undef
13579 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13580 * ) case "$getgrent_r_proto" in
13581 REENTRANT_PROTO*) ;;
13582 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13584 echo "Prototype: $try" ;;
13587 *) case "$usethreads" in
13588 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13595 *) getgrent_r_proto=0
13599 : see if getgrgid_r exists
13600 set getgrgid_r d_getgrgid_r
13602 case "$d_getgrgid_r" in
13604 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13605 case "$d_getgrgid_r_proto:$usethreads" in
13606 ":define") d_getgrgid_r_proto=define
13607 set d_getgrgid_r_proto getgrgid_r $hdrs
13611 case "$d_getgrgid_r_proto" in
13613 case "$getgrgid_r_proto" in
13614 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13615 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13617 case "$getgrgid_r_proto" in
13618 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13619 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13621 case "$getgrgid_r_proto" in
13622 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13623 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13625 case "$getgrgid_r_proto" in
13626 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13627 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13629 case "$getgrgid_r_proto" in
13630 ''|0) d_getgrgid_r=undef
13632 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13633 * ) case "$getgrgid_r_proto" in
13634 REENTRANT_PROTO*) ;;
13635 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13637 echo "Prototype: $try" ;;
13640 *) case "$usethreads" in
13641 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13648 *) getgrgid_r_proto=0
13652 : see if getgrnam_r exists
13653 set getgrnam_r d_getgrnam_r
13655 case "$d_getgrnam_r" in
13657 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13658 case "$d_getgrnam_r_proto:$usethreads" in
13659 ":define") d_getgrnam_r_proto=define
13660 set d_getgrnam_r_proto getgrnam_r $hdrs
13664 case "$d_getgrnam_r_proto" in
13666 case "$getgrnam_r_proto" in
13667 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13668 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13670 case "$getgrnam_r_proto" in
13671 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13672 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13674 case "$getgrnam_r_proto" in
13675 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13676 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13678 case "$getgrnam_r_proto" in
13679 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13680 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13682 case "$getgrnam_r_proto" in
13683 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13684 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13686 case "$getgrnam_r_proto" in
13687 ''|0) d_getgrnam_r=undef
13689 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13690 * ) case "$getgrnam_r_proto" in
13691 REENTRANT_PROTO*) ;;
13692 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13694 echo "Prototype: $try" ;;
13697 *) case "$usethreads" in
13698 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13705 *) getgrnam_r_proto=0
13709 : see if gethostbyaddr exists
13710 set gethostbyaddr d_gethbyaddr
13713 : see if gethostbyname exists
13714 set gethostbyname d_gethbyname
13717 : see if gethostent exists
13718 set gethostent d_gethent
13721 : see how we will look up host name
13724 if set gethostname val -f d_gethname; eval $csym; $val; then
13725 echo 'gethostname() found.' >&4
13726 d_gethname="$define"
13729 if set uname val -f d_uname; eval $csym; $val; then
13732 uname() was found, but you're running xenix, and older versions of xenix
13733 have a broken uname(). If you don't really know whether your xenix is old
13734 enough to have a broken system call, use the default answer.
13739 "$define") dflt=n;;
13741 rp='Is your uname() broken?'
13744 n*) d_uname="$define"; call=uname;;
13747 echo 'uname() found.' >&4
13754 case "$d_gethname" in
13755 '') d_gethname="$undef";;
13758 '') d_uname="$undef";;
13760 case "$d_uname$d_gethname" in
13765 Every now and then someone has a $call() that lies about the hostname
13766 but can't be fixed for political or economic reasons. If you wish, I can
13767 pretend $call() isn't there and maybe compute hostname at run-time
13768 thanks to the '$phostname' command.
13771 rp="Shall I ignore $call() from now on?"
13774 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13777 case "$phostname" in
13778 '') aphostname='';;
13779 *) case "$aphostname" in
13781 *) set X $phostname
13785 file=`./loc $file $file $pth`
13786 aphostname=`echo $file $*`
13791 case "$d_uname$d_gethname" in
13794 case "$phostname" in
13796 echo "There will be no way for $package to get your hostname." >&4;;
13798 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13802 case "$d_phostname" in
13803 '') d_phostname="$undef";;
13806 : see if gethostbyaddr_r exists
13807 set gethostbyaddr_r d_gethostbyaddr_r
13809 case "$d_gethostbyaddr_r" in
13811 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13812 case "$d_gethostbyaddr_r_proto:$usethreads" in
13813 ":define") d_gethostbyaddr_r_proto=define
13814 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13818 case "$d_gethostbyaddr_r_proto" in
13820 case "$gethostbyaddr_r_proto" in
13821 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13822 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13824 case "$gethostbyaddr_r_proto" in
13825 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13826 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13828 case "$gethostbyaddr_r_proto" in
13829 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13830 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13832 case "$gethostbyaddr_r_proto" in
13833 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13834 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13836 case "$gethostbyaddr_r_proto" in
13837 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13838 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13840 case "$gethostbyaddr_r_proto" in
13841 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13842 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13844 case "$gethostbyaddr_r_proto" in
13845 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13846 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13848 case "$gethostbyaddr_r_proto" in
13849 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13850 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13852 case "$gethostbyaddr_r_proto" in
13853 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13854 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13856 case "$gethostbyaddr_r_proto" in
13857 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13858 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13860 case "$gethostbyaddr_r_proto" in
13861 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13862 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13864 case "$gethostbyaddr_r_proto" in
13865 ''|0) d_gethostbyaddr_r=undef
13866 gethostbyaddr_r_proto=0
13867 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13868 * ) case "$gethostbyaddr_r_proto" in
13869 REENTRANT_PROTO*) ;;
13870 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13872 echo "Prototype: $try" ;;
13875 *) case "$usethreads" in
13876 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13878 d_gethostbyaddr_r=undef
13879 gethostbyaddr_r_proto=0
13883 *) gethostbyaddr_r_proto=0
13887 : see if gethostbyname_r exists
13888 set gethostbyname_r d_gethostbyname_r
13890 case "$d_gethostbyname_r" in
13892 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13893 case "$d_gethostbyname_r_proto:$usethreads" in
13894 ":define") d_gethostbyname_r_proto=define
13895 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13899 case "$d_gethostbyname_r_proto" in
13901 case "$gethostbyname_r_proto" in
13902 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13903 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13905 case "$gethostbyname_r_proto" in
13906 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13907 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13909 case "$gethostbyname_r_proto" in
13910 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13911 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13913 case "$gethostbyname_r_proto" in
13914 ''|0) d_gethostbyname_r=undef
13915 gethostbyname_r_proto=0
13916 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13917 * ) case "$gethostbyname_r_proto" in
13918 REENTRANT_PROTO*) ;;
13919 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13921 echo "Prototype: $try" ;;
13924 *) case "$usethreads" in
13925 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13927 d_gethostbyname_r=undef
13928 gethostbyname_r_proto=0
13932 *) gethostbyname_r_proto=0
13936 : see if gethostent_r exists
13937 set gethostent_r d_gethostent_r
13939 case "$d_gethostent_r" in
13941 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13942 case "$d_gethostent_r_proto:$usethreads" in
13943 ":define") d_gethostent_r_proto=define
13944 set d_gethostent_r_proto gethostent_r $hdrs
13948 case "$d_gethostent_r_proto" in
13950 case "$gethostent_r_proto" in
13951 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13952 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13954 case "$gethostent_r_proto" in
13955 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13956 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13958 case "$gethostent_r_proto" in
13959 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13960 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13962 case "$gethostent_r_proto" in
13963 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13964 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
13966 case "$gethostent_r_proto" in
13967 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13968 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
13970 case "$gethostent_r_proto" in
13971 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13972 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
13974 case "$gethostent_r_proto" in
13975 ''|0) d_gethostent_r=undef
13976 gethostent_r_proto=0
13977 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13978 * ) case "$gethostent_r_proto" in
13979 REENTRANT_PROTO*) ;;
13980 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13982 echo "Prototype: $try" ;;
13985 *) case "$usethreads" in
13986 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13988 d_gethostent_r=undef
13989 gethostent_r_proto=0
13993 *) gethostent_r_proto=0
13997 : see if prototypes for various gethostxxx netdb.h functions are available
13999 set d_gethostprotos gethostent $i_netdb netdb.h
14002 : see if getitimer exists
14003 set getitimer d_getitimer
14006 : see if getlogin exists
14007 set getlogin d_getlogin
14010 : see if getlogin_r exists
14011 set getlogin_r d_getlogin_r
14013 case "$d_getlogin_r" in
14015 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
14016 case "$d_getlogin_r_proto:$usethreads" in
14017 ":define") d_getlogin_r_proto=define
14018 set d_getlogin_r_proto getlogin_r $hdrs
14022 case "$d_getlogin_r_proto" in
14024 case "$getlogin_r_proto" in
14025 ''|0) try='int getlogin_r(char*, size_t);'
14026 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
14028 case "$getlogin_r_proto" in
14029 ''|0) try='int getlogin_r(char*, int);'
14030 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
14032 case "$getlogin_r_proto" in
14033 ''|0) try='char* getlogin_r(char*, size_t);'
14034 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
14036 case "$getlogin_r_proto" in
14037 ''|0) try='char* getlogin_r(char*, int);'
14038 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
14040 case "$getlogin_r_proto" in
14041 ''|0) d_getlogin_r=undef
14043 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
14044 * ) case "$getlogin_r_proto" in
14045 REENTRANT_PROTO*) ;;
14046 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
14048 echo "Prototype: $try" ;;
14051 *) case "$usethreads" in
14052 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
14059 *) getlogin_r_proto=0
14063 : see if getmnt exists
14064 set getmnt d_getmnt
14067 : see if getmntent exists
14068 set getmntent d_getmntent
14071 : see if getnameinfo exists
14072 set getnameinfo d_getnameinfo
14075 : see if getnetbyaddr exists
14076 set getnetbyaddr d_getnbyaddr
14079 : see if getnetbyname exists
14080 set getnetbyname d_getnbyname
14083 : see if getnetent exists
14084 set getnetent d_getnent
14087 : see if getnetbyaddr_r exists
14088 set getnetbyaddr_r d_getnetbyaddr_r
14090 case "$d_getnetbyaddr_r" in
14092 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14093 case "$d_getnetbyaddr_r_proto:$usethreads" in
14094 ":define") d_getnetbyaddr_r_proto=define
14095 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14099 case "$d_getnetbyaddr_r_proto" in
14101 case "$getnetbyaddr_r_proto" in
14102 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14103 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14105 case "$getnetbyaddr_r_proto" in
14106 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14107 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14109 case "$getnetbyaddr_r_proto" in
14110 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14111 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14113 case "$getnetbyaddr_r_proto" in
14114 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14115 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14117 case "$getnetbyaddr_r_proto" in
14118 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14119 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14121 case "$getnetbyaddr_r_proto" in
14122 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14123 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14125 case "$getnetbyaddr_r_proto" in
14126 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14127 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14129 case "$getnetbyaddr_r_proto" in
14130 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14131 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14133 case "$getnetbyaddr_r_proto" in
14134 ''|0) d_getnetbyaddr_r=undef
14135 getnetbyaddr_r_proto=0
14136 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14137 * ) case "$getnetbyaddr_r_proto" in
14138 REENTRANT_PROTO*) ;;
14139 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14141 echo "Prototype: $try" ;;
14144 *) case "$usethreads" in
14145 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14147 d_getnetbyaddr_r=undef
14148 getnetbyaddr_r_proto=0
14152 *) getnetbyaddr_r_proto=0
14156 : see if getnetbyname_r exists
14157 set getnetbyname_r d_getnetbyname_r
14159 case "$d_getnetbyname_r" in
14161 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14162 case "$d_getnetbyname_r_proto:$usethreads" in
14163 ":define") d_getnetbyname_r_proto=define
14164 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14168 case "$d_getnetbyname_r_proto" in
14170 case "$getnetbyname_r_proto" in
14171 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14172 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14174 case "$getnetbyname_r_proto" in
14175 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14176 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14178 case "$getnetbyname_r_proto" in
14179 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14180 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14182 case "$getnetbyname_r_proto" in
14183 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14184 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14186 case "$getnetbyname_r_proto" in
14187 ''|0) d_getnetbyname_r=undef
14188 getnetbyname_r_proto=0
14189 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14190 * ) case "$getnetbyname_r_proto" in
14191 REENTRANT_PROTO*) ;;
14192 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14194 echo "Prototype: $try" ;;
14197 *) case "$usethreads" in
14198 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14200 d_getnetbyname_r=undef
14201 getnetbyname_r_proto=0
14205 *) getnetbyname_r_proto=0
14209 : see if getnetent_r exists
14210 set getnetent_r d_getnetent_r
14212 case "$d_getnetent_r" in
14214 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14215 case "$d_getnetent_r_proto:$usethreads" in
14216 ":define") d_getnetent_r_proto=define
14217 set d_getnetent_r_proto getnetent_r $hdrs
14221 case "$d_getnetent_r_proto" in
14223 case "$getnetent_r_proto" in
14224 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14225 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14227 case "$getnetent_r_proto" in
14228 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14229 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14231 case "$getnetent_r_proto" in
14232 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14233 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14235 case "$getnetent_r_proto" in
14236 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14237 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14239 case "$getnetent_r_proto" in
14240 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14241 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14243 case "$getnetent_r_proto" in
14244 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14245 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14247 case "$getnetent_r_proto" in
14248 ''|0) d_getnetent_r=undef
14249 getnetent_r_proto=0
14250 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14251 * ) case "$getnetent_r_proto" in
14252 REENTRANT_PROTO*) ;;
14253 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14255 echo "Prototype: $try" ;;
14258 *) case "$usethreads" in
14259 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14261 d_getnetent_r=undef
14262 getnetent_r_proto=0
14266 *) getnetent_r_proto=0
14270 : see if prototypes for various getnetxxx netdb.h functions are available
14272 set d_getnetprotos getnetent $i_netdb netdb.h
14275 : see if getpagesize exists
14276 set getpagesize d_getpagsz
14279 : Optional checks for getprotobyname and getprotobynumber
14281 : see if getprotobyname exists
14282 set getprotobyname d_getpbyname
14285 : see if getprotobynumber exists
14286 set getprotobynumber d_getpbynumber
14289 : see if getprotoent exists
14290 set getprotoent d_getpent
14293 : see if getpgid exists
14294 set getpgid d_getpgid
14297 : see if getpgrp2 exists
14298 set getpgrp2 d_getpgrp2
14301 : see if getppid exists
14302 set getppid d_getppid
14305 : see if getpriority exists
14306 set getpriority d_getprior
14309 : see if getprotobyname_r exists
14310 set getprotobyname_r d_getprotobyname_r
14312 case "$d_getprotobyname_r" in
14314 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14315 case "$d_getprotobyname_r_proto:$usethreads" in
14316 ":define") d_getprotobyname_r_proto=define
14317 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14321 case "$d_getprotobyname_r_proto" in
14323 case "$getprotobyname_r_proto" in
14324 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14325 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14327 case "$getprotobyname_r_proto" in
14328 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14329 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14331 case "$getprotobyname_r_proto" in
14332 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14333 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14335 case "$getprotobyname_r_proto" in
14336 ''|0) d_getprotobyname_r=undef
14337 getprotobyname_r_proto=0
14338 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14339 * ) case "$getprotobyname_r_proto" in
14340 REENTRANT_PROTO*) ;;
14341 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14343 echo "Prototype: $try" ;;
14346 *) case "$usethreads" in
14347 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14349 d_getprotobyname_r=undef
14350 getprotobyname_r_proto=0
14354 *) getprotobyname_r_proto=0
14358 : see if getprotobynumber_r exists
14359 set getprotobynumber_r d_getprotobynumber_r
14361 case "$d_getprotobynumber_r" in
14363 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14364 case "$d_getprotobynumber_r_proto:$usethreads" in
14365 ":define") d_getprotobynumber_r_proto=define
14366 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14370 case "$d_getprotobynumber_r_proto" in
14372 case "$getprotobynumber_r_proto" in
14373 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14374 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14376 case "$getprotobynumber_r_proto" in
14377 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14378 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14380 case "$getprotobynumber_r_proto" in
14381 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14382 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14384 case "$getprotobynumber_r_proto" in
14385 ''|0) d_getprotobynumber_r=undef
14386 getprotobynumber_r_proto=0
14387 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14388 * ) case "$getprotobynumber_r_proto" in
14389 REENTRANT_PROTO*) ;;
14390 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14392 echo "Prototype: $try" ;;
14395 *) case "$usethreads" in
14396 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14398 d_getprotobynumber_r=undef
14399 getprotobynumber_r_proto=0
14403 *) getprotobynumber_r_proto=0
14407 : see if getprotoent_r exists
14408 set getprotoent_r d_getprotoent_r
14410 case "$d_getprotoent_r" in
14412 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14413 case "$d_getprotoent_r_proto:$usethreads" in
14414 ":define") d_getprotoent_r_proto=define
14415 set d_getprotoent_r_proto getprotoent_r $hdrs
14419 case "$d_getprotoent_r_proto" in
14421 case "$getprotoent_r_proto" in
14422 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14423 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14425 case "$getprotoent_r_proto" in
14426 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14427 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14429 case "$getprotoent_r_proto" in
14430 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14431 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14433 case "$getprotoent_r_proto" in
14434 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14435 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14437 case "$getprotoent_r_proto" in
14438 ''|0) d_getprotoent_r=undef
14439 getprotoent_r_proto=0
14440 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14441 * ) case "$getprotoent_r_proto" in
14442 REENTRANT_PROTO*) ;;
14443 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14445 echo "Prototype: $try" ;;
14448 *) case "$usethreads" in
14449 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14451 d_getprotoent_r=undef
14452 getprotoent_r_proto=0
14456 *) getprotoent_r_proto=0
14460 : see if prototypes for various getprotoxxx netdb.h functions are available
14462 set d_getprotoprotos getprotoent $i_netdb netdb.h
14465 : see if getprpwnam exists
14466 set getprpwnam d_getprpwnam
14469 : see if getpwent exists
14470 set getpwent d_getpwent
14473 : see if getpwent_r exists
14474 set getpwent_r d_getpwent_r
14476 case "$d_getpwent_r" in
14478 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14479 case "$d_getpwent_r_proto:$usethreads" in
14480 ":define") d_getpwent_r_proto=define
14481 set d_getpwent_r_proto getpwent_r $hdrs
14485 case "$d_getpwent_r_proto" in
14487 case "$getpwent_r_proto" in
14488 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14489 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14491 case "$getpwent_r_proto" in
14492 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14493 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14495 case "$getpwent_r_proto" in
14496 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14497 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14499 case "$getpwent_r_proto" in
14500 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14501 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14503 case "$getpwent_r_proto" in
14504 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14505 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14507 case "$getpwent_r_proto" in
14508 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14509 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14511 case "$getpwent_r_proto" in
14512 ''|0) d_getpwent_r=undef
14514 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14515 * ) case "$getpwent_r_proto" in
14516 REENTRANT_PROTO*) ;;
14517 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14519 echo "Prototype: $try" ;;
14522 *) case "$usethreads" in
14523 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14530 *) getpwent_r_proto=0
14534 : see if getpwnam_r exists
14535 set getpwnam_r d_getpwnam_r
14537 case "$d_getpwnam_r" in
14539 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14540 case "$d_getpwnam_r_proto:$usethreads" in
14541 ":define") d_getpwnam_r_proto=define
14542 set d_getpwnam_r_proto getpwnam_r $hdrs
14546 case "$d_getpwnam_r_proto" in
14548 case "$getpwnam_r_proto" in
14549 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14550 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14552 case "$getpwnam_r_proto" in
14553 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14554 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14556 case "$getpwnam_r_proto" in
14557 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14558 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14560 case "$getpwnam_r_proto" in
14561 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14562 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14564 case "$getpwnam_r_proto" in
14565 ''|0) d_getpwnam_r=undef
14567 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14568 * ) case "$getpwnam_r_proto" in
14569 REENTRANT_PROTO*) ;;
14570 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14572 echo "Prototype: $try" ;;
14575 *) case "$usethreads" in
14576 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14583 *) getpwnam_r_proto=0
14587 : see if getpwuid_r exists
14588 set getpwuid_r d_getpwuid_r
14590 case "$d_getpwuid_r" in
14592 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14593 case "$d_getpwuid_r_proto:$usethreads" in
14594 ":define") d_getpwuid_r_proto=define
14595 set d_getpwuid_r_proto getpwuid_r $hdrs
14599 case "$d_getpwuid_r_proto" in
14601 case "$getpwuid_r_proto" in
14602 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14603 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14605 case "$getpwuid_r_proto" in
14606 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14607 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14609 case "$getpwuid_r_proto" in
14610 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14611 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14613 case "$getpwuid_r_proto" in
14614 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14615 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14617 case "$getpwuid_r_proto" in
14618 ''|0) d_getpwuid_r=undef
14620 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14621 * ) case "$getpwuid_r_proto" in
14622 REENTRANT_PROTO*) ;;
14623 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14625 echo "Prototype: $try" ;;
14628 *) case "$usethreads" in
14629 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14636 *) getpwuid_r_proto=0
14640 : Optional checks for getsbyname and getsbyport
14642 : see if getservbyname exists
14643 set getservbyname d_getsbyname
14646 : see if getservbyport exists
14647 set getservbyport d_getsbyport
14650 : see if getservent exists
14651 set getservent d_getsent
14654 : see if getservbyname_r exists
14655 set getservbyname_r d_getservbyname_r
14657 case "$d_getservbyname_r" in
14659 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14660 case "$d_getservbyname_r_proto:$usethreads" in
14661 ":define") d_getservbyname_r_proto=define
14662 set d_getservbyname_r_proto getservbyname_r $hdrs
14666 case "$d_getservbyname_r_proto" in
14668 case "$getservbyname_r_proto" in
14669 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14670 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14672 case "$getservbyname_r_proto" in
14673 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14674 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14676 case "$getservbyname_r_proto" in
14677 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14678 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14680 case "$getservbyname_r_proto" in
14681 ''|0) d_getservbyname_r=undef
14682 getservbyname_r_proto=0
14683 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14684 * ) case "$getservbyname_r_proto" in
14685 REENTRANT_PROTO*) ;;
14686 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14688 echo "Prototype: $try" ;;
14691 *) case "$usethreads" in
14692 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14694 d_getservbyname_r=undef
14695 getservbyname_r_proto=0
14699 *) getservbyname_r_proto=0
14703 : see if getservbyport_r exists
14704 set getservbyport_r d_getservbyport_r
14706 case "$d_getservbyport_r" in
14708 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14709 case "$d_getservbyport_r_proto:$usethreads" in
14710 ":define") d_getservbyport_r_proto=define
14711 set d_getservbyport_r_proto getservbyport_r $hdrs
14715 case "$d_getservbyport_r_proto" in
14717 case "$getservbyport_r_proto" in
14718 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14719 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14721 case "$getservbyport_r_proto" in
14722 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14723 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14725 case "$getservbyport_r_proto" in
14726 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14727 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14729 case "$getservbyport_r_proto" in
14730 ''|0) d_getservbyport_r=undef
14731 getservbyport_r_proto=0
14732 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14733 * ) case "$getservbyport_r_proto" in
14734 REENTRANT_PROTO*) ;;
14735 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14737 echo "Prototype: $try" ;;
14740 *) case "$usethreads" in
14741 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14743 d_getservbyport_r=undef
14744 getservbyport_r_proto=0
14748 *) getservbyport_r_proto=0
14752 : see if getservent_r exists
14753 set getservent_r d_getservent_r
14755 case "$d_getservent_r" in
14757 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14758 case "$d_getservent_r_proto:$usethreads" in
14759 ":define") d_getservent_r_proto=define
14760 set d_getservent_r_proto getservent_r $hdrs
14764 case "$d_getservent_r_proto" in
14766 case "$getservent_r_proto" in
14767 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14768 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14770 case "$getservent_r_proto" in
14771 ''|0) try='int getservent_r(struct servent*, char*, int);'
14772 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14774 case "$getservent_r_proto" in
14775 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14776 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14778 case "$getservent_r_proto" in
14779 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14780 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14782 case "$getservent_r_proto" in
14783 ''|0) d_getservent_r=undef
14784 getservent_r_proto=0
14785 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14786 * ) case "$getservent_r_proto" in
14787 REENTRANT_PROTO*) ;;
14788 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14790 echo "Prototype: $try" ;;
14793 *) case "$usethreads" in
14794 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14796 d_getservent_r=undef
14797 getservent_r_proto=0
14801 *) getservent_r_proto=0
14805 : see if prototypes for various getservxxx netdb.h functions are available
14807 set d_getservprotos getservent $i_netdb netdb.h
14810 : see if getspnam exists
14811 set getspnam d_getspnam
14814 : see if this is a shadow.h system
14815 set shadow.h i_shadow
14818 : see if getspnam_r exists
14819 set getspnam_r d_getspnam_r
14821 case "$d_getspnam_r" in
14823 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14824 case "$d_getspnam_r_proto:$usethreads" in
14825 ":define") d_getspnam_r_proto=define
14826 set d_getspnam_r_proto getspnam_r $hdrs
14830 case "$d_getspnam_r_proto" in
14832 case "$getspnam_r_proto" in
14833 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14834 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14836 case "$getspnam_r_proto" in
14837 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14838 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14840 case "$getspnam_r_proto" in
14841 ''|0) d_getspnam_r=undef
14843 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14844 * ) case "$getspnam_r_proto" in
14845 REENTRANT_PROTO*) ;;
14846 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14848 echo "Prototype: $try" ;;
14851 *) case "$usethreads" in
14852 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14859 *) getspnam_r_proto=0
14863 : see if gettimeofday or ftime exists
14864 set gettimeofday d_gettimeod
14866 case "$d_gettimeod" in
14872 val="$undef"; set d_ftime; eval $setvar
14875 case "$d_gettimeod$d_ftime" in
14878 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14882 : see if gmtime_r exists
14883 set gmtime_r d_gmtime_r
14885 case "$d_gmtime_r" in
14887 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14888 case "$d_gmtime_r_proto:$usethreads" in
14889 ":define") d_gmtime_r_proto=define
14890 set d_gmtime_r_proto gmtime_r $hdrs
14894 case "$d_gmtime_r_proto" in
14896 case "$gmtime_r_proto" in
14897 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14898 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
14900 case "$gmtime_r_proto" in
14901 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14902 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
14904 case "$gmtime_r_proto" in
14905 ''|0) d_gmtime_r=undef
14907 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14908 * ) case "$gmtime_r_proto" in
14909 REENTRANT_PROTO*) ;;
14910 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14912 echo "Prototype: $try" ;;
14915 *) case "$usethreads" in
14916 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14923 *) gmtime_r_proto=0
14927 : see if hasmntopt exists
14928 set hasmntopt d_hasmntopt
14931 : see if this is a netinet/in.h or sys/in.h system
14932 set netinet/in.h i_niin sys/in.h i_sysin
14935 : see if arpa/inet.h has to be included
14936 set arpa/inet.h i_arpainet
14939 : see if htonl --and friends-- exists
14944 : Maybe they are macros.
14947 $cat >htonl.c <<EOM
14949 #include <sys/types.h>
14950 #$i_niin I_NETINET_IN
14952 #$i_arpainet I_ARPA_INET
14953 #ifdef I_NETINET_IN
14954 #include <netinet/in.h>
14957 #include <sys/in.h>
14960 #include <arpa/inet.h>
14963 printf("Defined as a macro.");
14966 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14967 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14969 echo "But it seems to be defined as a macro." >&4
14977 : see if ilogbl exists
14978 set ilogbl d_ilogbl
14983 if set index val -f; eval $csym; $val; then
14984 if set strchr val -f d_strchr; eval $csym; $val; then
14985 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14988 echo "strchr() found." >&4
14992 echo "index() found." >&4
14997 echo "index() found." >&4
15000 if set strchr val -f d_strchr; eval $csym; $val; then
15003 echo "strchr() found." >&4
15005 echo "No index() or strchr() found!" >&4
15010 set d_strchr; eval $setvar
15012 set d_index; eval $setvar
15014 : check whether inet_aton exists
15015 set inet_aton d_inetaton
15018 : see if inet_ntop exists
15019 set inet_ntop d_inetntop
15022 : see if inet_pton exists
15023 set inet_pton d_inetpton
15028 $cat >isascii.c <<EOCP
15031 #$i_stdlib I_STDLIB
15033 #include <stdlib.h>
15044 if eval $compile; then
15045 echo "isascii() found." >&4
15048 echo "isascii() NOT found." >&4
15057 $cat >isblank.c <<'EOCP'
15068 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
15069 echo "isblank() found." >&4
15072 echo "isblank() NOT found." >&4
15079 : see if isfinite exists
15080 set isfinite d_isfinite
15083 : see if isinf exists
15087 : see if isnan exists
15091 : see if isnanl exists
15092 set isnanl d_isnanl
15095 : see if killpg exists
15096 set killpg d_killpg
15099 : see if lchown exists
15101 $cat > try.c <<'EOCP'
15102 /* System header to define __stub macros and hopefully few prototypes,
15103 which can conflict with char lchown(); below. */
15104 #include <assert.h>
15105 /* Override any gcc2 internal prototype to avoid an error. */
15106 /* We use char because int might match the return type of a gcc2
15107 builtin and then its argument prototype would still apply. */
15110 /* The GNU C library defines this for functions which it implements
15111 to always fail with ENOSYS. Some functions are actually named
15112 something starting with __ and the normal name is an alias. */
15113 #if defined (__stub_lchown) || defined (__stub___lchown)
15121 if eval $compile; then
15122 $echo "lchown() found." >&4
15125 $echo "lchown() NOT found." >&4
15131 : See if number of significant digits in a double precision number is known
15133 $cat >ldbl_dig.c <<EOM
15134 #$i_limits I_LIMITS
15137 #include <limits.h>
15143 printf("Contains LDBL_DIG");
15146 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15147 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15148 echo "LDBL_DIG found." >&4
15151 echo "LDBL_DIG NOT found." >&4
15158 : see if this is a math.h system
15162 : check to see if math.h defines _LIB_VERSION
15163 d_libm_lib_version="$undef"
15167 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15169 #include <unistd.h>
15171 int main (int argc, char *argv[])
15173 printf ("%d\n", _LIB_VERSION);
15178 if eval $compile; then
15180 echo "Yes, it does ($foo)" >&4
15181 d_libm_lib_version="$define"
15183 echo "No, it does not (probably harmless)" >&4
15190 : see if link exists
15194 : see if localtime_r exists
15195 set localtime_r d_localtime_r
15197 case "$d_localtime_r" in
15199 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15200 case "$d_localtime_r_proto:$usethreads" in
15201 ":define") d_localtime_r_proto=define
15202 set d_localtime_r_proto localtime_r $hdrs
15206 case "$d_localtime_r_proto" in
15208 case "$localtime_r_proto" in
15209 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15210 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15212 case "$localtime_r_proto" in
15213 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15214 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15216 case "$localtime_r_proto" in
15217 ''|0) d_localtime_r=undef
15218 localtime_r_proto=0
15219 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15220 * ) case "$localtime_r_proto" in
15221 REENTRANT_PROTO*) ;;
15222 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15224 echo "Prototype: $try" ;;
15227 *) case "$usethreads" in
15228 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15230 d_localtime_r=undef
15231 localtime_r_proto=0
15235 *) localtime_r_proto=0
15239 : see if localtime_r calls tzset
15240 case "$localtime_r_proto" in
15243 /* Does our libc's localtime_r call tzset ?
15244 * return 0 if so, 1 otherwise.
15246 #$i_systypes I_SYS_TYPES
15247 #$i_unistd I_UNISTD
15249 #$i_stdlib I_STDLIB
15250 #$i_string I_STRING
15251 #$i_malloc I_MALLOC
15253 # include <sys/types.h>
15256 # include <unistd.h>
15262 #include <stdlib.h>
15265 # include <string.h>
15267 # include <strings.h>
15270 # include <malloc.h>
15274 time_t t = time(0L);
15275 char w_tz[]="TZ" "=GMT+5",
15276 e_tz[]="TZ" "=GMT-5",
15277 *tz_e = (char*)malloc(16),
15278 *tz_w = (char*)malloc(16);
15279 struct tm tm_e, tm_w;
15280 memset(&tm_e,'\0',sizeof(struct tm));
15281 memset(&tm_w,'\0',sizeof(struct tm));
15286 localtime_r(&t, &tm_e);
15289 localtime_r(&t, &tm_w);
15291 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15297 if eval $compile; then
15298 if $run ./try; then
15299 d_localtime_r_needs_tzset=undef;
15301 d_localtime_r_needs_tzset=define;
15304 d_localtime_r_needs_tzset=undef;
15308 d_localtime_r_needs_tzset=undef;
15313 : see if localeconv exists
15314 set localeconv d_locconv
15317 : see if lockf exists
15321 : see if prototype for lseek is available
15323 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15326 : see if lstat exists
15330 : see if madvise exists
15331 set madvise d_madvise
15334 : see if malloc_size exists
15335 set malloc_size d_malloc_size
15338 : see if malloc_size_good exists
15339 set malloc_good_size d_malloc_good_size
15342 : see if mblen exists
15346 : see if mbstowcs exists
15347 set mbstowcs d_mbstowcs
15350 : see if mbtowc exists
15351 set mbtowc d_mbtowc
15354 : see if memchr exists
15355 set memchr d_memchr
15358 : see if memcmp exists
15359 set memcmp d_memcmp
15362 : see if memcpy exists
15363 set memcpy d_memcpy
15366 : see if memmove exists
15367 set memmove d_memmove
15370 : see if memset exists
15371 set memset d_memset
15374 : see if mkdir exists
15378 : see if mkdtemp exists
15379 set mkdtemp d_mkdtemp
15382 : see if mkfifo exists
15383 set mkfifo d_mkfifo
15386 : see if mkstemp exists
15387 set mkstemp d_mkstemp
15390 : see if mkstemps exists
15391 set mkstemps d_mkstemps
15394 : see if mktime exists
15395 set mktime d_mktime
15398 : see if this is a sys/mman.h system
15399 set sys/mman.h i_sysmman
15402 : see if mmap exists
15405 : see what shmat returns
15406 : default to something harmless
15408 case "$i_sysmman$d_mmap" in
15410 $cat >mmap.c <<'END'
15411 #include <sys/mman.h>
15414 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15419 echo "and it returns ($mmaptype)." >&4
15425 : see if sqrtl exists
15429 : see if scalbnl exists
15430 set scalbnl d_scalbnl
15433 : see if modfl exists
15437 : see if prototype for modfl is available
15439 set d_modflproto modfl $i_math math.h
15442 d_modfl_pow32_bug="$undef"
15444 case "$d_longdbl$d_modfl" in
15447 Checking to see whether your modfl() is okay for large values...
15453 if $test "X$d_modflproto" != "X$define"; then
15454 $cat >>try.c <<EOCP
15455 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15456 long double modfl (long double, long double *);
15459 $cat >>try.c <<EOCP
15461 long double nv = 4294967303.15;
15467 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15471 case "$osname:$gccversion" in
15472 aix:) saveccflags="$ccflags"
15473 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15476 if eval $compile; then
15479 *" 4294967303.150000 1.150000 4294967302.000000")
15480 echo >&4 "Your modfl() is broken for large values."
15481 d_modfl_pow32_bug="$define"
15483 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15487 *" 4294967303.150000 0.150000 4294967303.000000")
15488 echo >&4 "Your modfl() seems okay for large values."
15490 *) echo >&4 "I don't understand your modfl() at all."
15496 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15499 case "$osname:$gccversion" in
15500 aix:) ccflags="$saveccflags" ;; # restore
15505 if $test "$uselongdouble" = "$define"; then
15507 if $test "$d_sqrtl" != "$define"; then
15508 message="$message sqrtl"
15510 if $test "$d_modfl" != "$define"; then
15511 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15512 echo "You have both aintl and copysignl, so I can emulate modfl."
15514 message="$message modfl"
15517 if $test "$d_frexpl" != "$define"; then
15518 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15519 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15521 message="$message frexpl"
15525 if $test "$message" != ""; then
15528 *** You requested the use of long doubles but you do not seem to have
15529 *** the following mathematical functions needed for long double support:
15531 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15532 *** Cannot continue, aborting.
15540 : see if mprotect exists
15541 set mprotect d_mprotect
15544 : see if msgctl exists
15545 set msgctl d_msgctl
15548 : see if msgget exists
15549 set msgget d_msgget
15552 : see if msgsnd exists
15553 set msgsnd d_msgsnd
15556 : see if msgrcv exists
15557 set msgrcv d_msgrcv
15560 : see how much of the 'msg*(2)' library is present.
15563 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15564 *"$undef"*) h_msg=false;;
15568 case "`ipcs 2>&1`" in
15569 "SVID messages"*"not configured"*)
15570 echo "Your $osname does not have the msg*(2) configured." >&4
15573 set msgctl d_msgctl
15575 set msgget d_msgget
15577 set msgsnd d_msgsnd
15579 set msgrcv d_msgrcv
15585 : we could also check for sys/ipc.h ...
15586 if $h_msg && $test `./findhdr sys/msg.h`; then
15587 echo "You have the full msg*(2) library." >&4
15590 echo "You don't have the full msg*(2) library." >&4
15596 : Check for msghdr_s
15598 echo "Checking to see if your system supports struct msghdr..." >&4
15599 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15601 case "$d_msghdr_s" in
15602 "$define") echo "Yes, it does." ;;
15603 *) echo "No, it doesn't." ;;
15607 : see if msync exists
15611 : see if munmap exists
15612 set munmap d_munmap
15615 : see if nice exists
15619 : see if this is a langinfo.h system
15620 set langinfo.h i_langinfo
15623 : see if nl_langinfo exists
15624 set nl_langinfo d_nl_langinfo
15627 : check for volatile keyword
15629 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15630 $cat >try.c <<'EOCP'
15633 typedef struct _goo_struct goo_struct;
15634 goo_struct * volatile goo = ((goo_struct *)0);
15635 struct _goo_struct {
15640 typedef unsigned short foo_t;
15641 char *volatile foo;
15643 volatile foo_t blech;
15647 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15649 echo "Yup, it does."
15652 echo "Nope, it doesn't."
15658 : Check basic sizes
15660 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15662 case "$use64bitint:$d_quad:$quadtype" in
15665 uvtype="$uquadtype"
15670 uvtype="unsigned long"
15676 case "$uselongdouble:$d_longdbl" in
15678 nvtype="long double"
15679 nvsize=$longdblsize
15686 $echo "(IV will be "$ivtype", $ivsize bytes)"
15687 $echo "(UV will be "$uvtype", $uvsize bytes)"
15688 $echo "(NV will be "$nvtype", $nvsize bytes)"
15691 #$i_inttypes I_INTTYPES
15693 #include <inttypes.h>
15698 int8_t i = INT8_MAX;
15699 uint8_t u = UINT8_MAX;
15700 printf("int8_t\n");
15703 int16_t i = INT16_MAX;
15704 uint16_t u = UINT16_MAX;
15705 printf("int16_t\n");
15708 int32_t i = INT32_MAX;
15709 uint32_t u = UINT32_MAX;
15710 printf("int32_t\n");
15715 i8type="signed char"
15716 u8type="unsigned char"
15721 '') case "$shortsize" in
15723 u16type="unsigned short"
15731 '') set try -DINT16
15732 if eval $compile; then
15733 case "`$run ./try`" in
15745 '') if $test $shortsize -ge 2; then
15747 u16type="unsigned short"
15755 '') case "$longsize" in
15757 u32type="unsigned long"
15761 *) case "$intsize" in
15763 u32type="unsigned int"
15773 '') set try -DINT32
15774 if eval $compile; then
15775 case "`$run ./try`" in
15787 '') if $test $intsize -ge 4; then
15789 u32type="unsigned int"
15797 '') case "$d_quad:$quadtype" in
15799 i64type="$quadtype"
15800 u64type="$uquadtype"
15808 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15809 : volatile so that the compiler has to store it out to memory.
15810 if test X"$d_volatile" = X"$define"; then
15815 #$i_stdlib I_STDLIB
15817 #include <stdlib.h>
15819 #include <sys/types.h>
15820 #include <signal.h>
15822 $volatile int bletched = 0;
15823 $signal_t blech(int s) { bletched = 1; }
15828 int n = 8 * $uvsize;
15831 signal(SIGFPE, blech);
15834 for (i = 0; i < n; i++) {
15835 u = u << 1 | ($uvtype)1;
15837 if (($uvtype)d != u)
15841 d = ($nvtype)(u - 1);
15842 if (($uvtype)d != (u - 1))
15849 printf("%d\n", ((i == n) ? -n : i));
15855 d_nv_preserves_uv="$undef"
15856 if eval $compile; then
15857 nv_preserves_uv_bits="`$run ./try`"
15859 case "$nv_preserves_uv_bits" in
15861 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15862 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15863 d_nv_preserves_uv="$define"
15865 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15866 d_nv_preserves_uv="$undef" ;;
15867 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15868 nv_preserves_uv_bits="0" ;;
15872 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15873 : volatile so that the compiler has to store it out to memory.
15874 if test X"$d_volatile" = X"$define"; then
15880 typedef $nvtype NV;
15887 while(count < 256) {
15888 $volatile NV up = value + 1.0;
15889 $volatile NV negated = -value;
15890 $volatile NV down = negated - 1.0;
15891 $volatile NV got_up = up - value;
15892 int up_good = got_up == 1.0;
15893 int got_down = down - negated;
15894 int down_good = got_down == -1.0;
15896 if (down_good != up_good) {
15898 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15899 up_good, (double) got_up, down_good, (double) got_down,
15900 count, (double) value);
15907 fputs("256.0", stdout);
15910 fputs("2.0", stdout);
15916 fputs("*", stdout);
15922 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15923 count, (double) value);
15929 nv_overflows_integers_at='0'
15930 if eval $compile; then
15936 The largest integer your NVs can preserve is equal to $xxx
15938 nv_overflows_integers_at="$xxx"
15941 Cannot determine the largest integer value your NVs can hold, unexpected output
15948 Cannot determine the largest integer value your NVs can hold
15955 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15956 : volatile so that the compiler has to store it out to memory.
15957 if test X"$d_volatile" = X"$define"; then
15962 #$i_stdlib I_STDLIB
15964 #include <stdlib.h>
15966 #$i_string I_STRING
15968 # include <string.h>
15970 # include <strings.h>
15972 #include <sys/types.h>
15973 #include <signal.h>
15975 $volatile int bletched = 0;
15976 $signal_t blech(int s) { bletched = 1; }
15979 int checkit($nvtype d, char *where) {
15980 unsigned char *p = (char *)&d;
15981 unsigned char *end = p + sizeof(d);
15991 printf("No - %s: 0x", where);
15993 printf ("%02X", *p++);
15998 int main(int argc, char **argv) {
16001 fail += checkit(d, "0.0");
16003 /* The compiler shouldn't be assuming that bletched is 0 */
16006 fail += checkit(d, "bleched");
16009 signal(SIGFPE, blech);
16012 /* Paranoia - the compiler should have no way of knowing that ANSI says
16013 that argv[argc] will always be NULL. Actually, if it did assume this it
16014 would be buggy, as this is C and main() can be called from elsewhere in
16016 d = argv[argc] ? 1 : 0;
16019 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
16022 fail += checkit(d, "ternary");
16024 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
16027 printf("No - memset doesn't give 0.0\n");
16028 /* This might just blow up: */
16029 printf("(gives %g)\n", d);
16035 printf("No - something bleched\n");
16040 printf("No - %d fail(s)\n", fail);
16049 d_nv_zero_is_allbits_zero="$undef"
16050 if eval $compile; then
16056 0.0 is represented as all bits zero in memory
16058 d_nv_zero_is_allbits_zero="$define"
16061 0.0 is not represented as all bits zero in memory
16063 d_nv_zero_is_allbits_zero="$undef"
16068 0.0 is not represented as all bits zero in memory
16070 d_nv_zero_is_allbits_zero="$undef"
16076 : check for off64_t
16078 echo "Checking to see if you have off64_t..." >&4
16080 #include <sys/types.h>
16081 #include <unistd.h>
16082 int main() { off64_t x = 7; }
16085 if eval $compile; then
16087 echo "You have off64_t."
16090 echo "You do not have off64_t."
16091 case "$lseeksize" in
16092 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
16099 : how to create joinable pthreads
16100 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
16102 echo "Checking what constant to use for creating joinable pthreads..." >&4
16103 $cat >try.c <<'EOCP'
16104 #include <pthread.h>
16106 int detachstate = JOINABLE;
16109 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16110 if eval $compile; then
16111 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16112 val="$undef" # Yes, undef.
16113 set d_old_pthread_create_joinable
16116 set old_pthread_create_joinable
16119 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16120 if eval $compile; then
16121 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16123 set d_old_pthread_create_joinable
16125 val=PTHREAD_CREATE_UNDETACHED
16126 set old_pthread_create_joinable
16129 set try -DJOINABLE=__UNDETACHED
16130 if eval $compile; then
16131 echo "You seem to use __UNDETACHED." >&4
16133 set d_old_pthread_create_joinable
16136 set old_pthread_create_joinable
16139 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16141 set d_old_pthread_create_joinable
16144 set old_pthread_create_joinable
16151 d_old_pthread_create_joinable="$undef"
16152 old_pthread_create_joinable=""
16155 : see if pause exists
16159 : see if poll exists
16163 : see if prctl exists
16167 : see if prctl supports PR_SET_NAME
16168 d_prctl_set_name=$undef
16172 #include <sys/prctl.h>
16174 int main (int argc, char *argv[])
16176 return (prctl (PR_SET_NAME, "Test"));
16180 if eval $compile_ok && $run ./try; then
16181 echo "Your prctl (PR_SET_NAME, ...) works"
16182 d_prctl_set_name=$define
16188 : see if readlink exists
16189 set readlink d_readlink
16192 : Check if exe is symlink to abs path of executing program
16196 case "$d_readlink" in
16198 : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
16199 : more tidy to avoid an extra level of symlink
16200 set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
16201 while test $# -gt 0; do
16204 if $issymlink $try; then
16205 $ls -l $try > reflect
16206 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16207 echo "You have $type-like $try."
16208 procselfexe='"'$try'"'
16210 : This will break out of the loop
16221 : backward compatibility for d_hvfork
16222 if test X$d_hvfork != X; then
16223 d_vfork="$d_hvfork"
16226 : see if there is a vfork
16231 d_pseudofork=$undef
16233 : Ok, but do we want to use it. vfork is reportedly unreliable in
16234 : perl on Solaris 2.x, and probably elsewhere.
16238 case "$usevfork" in
16244 Perl can only use a vfork() that doesn't suffer from strict
16245 restrictions on calling functions or modifying global data in
16246 the child. For example, glibc-2.1 contains such a vfork()
16247 that is unsuitable. If your system provides a proper fork()
16248 call, chances are that you do NOT want perl to use vfork().
16251 rp="Do you still want to use vfork()?"
16256 echo "Ok, we won't use vfork()."
16265 $define) usevfork='true';;
16266 *) usevfork='false';;
16269 : see whether the pthread_atfork exists
16271 #include <pthread.h>
16274 #ifdef PTHREAD_ATFORK
16275 pthread_atfork(NULL,NULL,NULL);
16280 : see if pthread_atfork exists
16281 set try -DPTHREAD_ATFORK
16282 if eval $compile; then
16287 case "$usethreads" in
16290 $define) echo 'pthread_atfork found.' >&4 ;;
16291 *) echo 'pthread_atfork NOT found.' >&4 ;;
16294 set d_pthread_atfork
16297 : see if pthread_attr_setscope exists
16298 set pthread_attr_setscope d_pthread_attr_setscope
16301 : see whether the various POSIXish _yields exist
16303 #include <pthread.h>
16309 #ifdef PTHREAD_YIELD
16312 #ifdef PTHREAD_YIELD_NULL
16313 pthread_yield(NULL);
16319 : see if sched_yield exists
16320 set try -DSCHED_YIELD
16321 if eval $compile; then
16323 sched_yield='sched_yield()'
16327 case "$usethreads" in
16330 $define) echo 'sched_yield() found.' >&4 ;;
16331 *) echo 'sched_yield() NOT found.' >&4 ;;
16337 : see if pthread_yield exists
16338 set try -DPTHREAD_YIELD
16339 if eval $compile; then
16341 case "$sched_yield" in
16342 '') sched_yield='pthread_yield()' ;;
16345 set try -DPTHREAD_YIELD_NULL
16346 if eval $compile; then
16348 case "$sched_yield" in
16349 '') sched_yield='pthread_yield(NULL)' ;;
16355 case "$usethreads" in
16358 $define) echo 'pthread_yield() found.' >&4 ;;
16359 *) echo 'pthread_yield() NOT found.' >&4 ;;
16363 set d_pthread_yield
16365 case "$sched_yield" in
16366 '') sched_yield=undef ;;
16370 : see if random_r exists
16371 set random_r d_random_r
16373 case "$d_random_r" in
16375 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16376 case "$d_random_r_proto:$usethreads" in
16377 ":define") d_random_r_proto=define
16378 set d_random_r_proto random_r $hdrs
16382 case "$d_random_r_proto" in
16384 case "$random_r_proto" in
16385 ''|0) try='int random_r(int*, struct random_data*);'
16386 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16388 case "$random_r_proto" in
16389 ''|0) try='int random_r(long*, struct random_data*);'
16390 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16392 case "$random_r_proto" in
16393 ''|0) try='int random_r(struct random_data*, int32_t*);'
16394 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16396 case "$random_r_proto" in
16397 ''|0) d_random_r=undef
16399 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16400 * ) case "$random_r_proto" in
16401 REENTRANT_PROTO*) ;;
16402 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16404 echo "Prototype: $try" ;;
16407 *) case "$usethreads" in
16408 define) echo "random_r has no prototype, not using it." >&4 ;;
16415 *) random_r_proto=0
16419 : see if readdir and friends exist
16420 set readdir d_readdir
16422 set seekdir d_seekdir
16424 set telldir d_telldir
16426 set rewinddir d_rewinddir
16429 : see if readdir64_r exists
16430 set readdir64_r d_readdir64_r
16432 case "$d_readdir64_r" in
16434 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16435 case "$d_readdir64_r_proto:$usethreads" in
16436 ":define") d_readdir64_r_proto=define
16437 set d_readdir64_r_proto readdir64_r $hdrs
16441 case "$d_readdir64_r_proto" in
16443 case "$readdir64_r_proto" in
16444 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16445 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16447 case "$readdir64_r_proto" in
16448 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16449 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16451 case "$readdir64_r_proto" in
16452 ''|0) d_readdir64_r=undef
16453 readdir64_r_proto=0
16454 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16455 * ) case "$readdir64_r_proto" in
16456 REENTRANT_PROTO*) ;;
16457 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16459 echo "Prototype: $try" ;;
16462 *) case "$usethreads" in
16463 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16465 d_readdir64_r=undef
16466 readdir64_r_proto=0
16470 *) readdir64_r_proto=0
16474 : see if readdir_r exists
16475 set readdir_r d_readdir_r
16477 case "$d_readdir_r" in
16479 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16480 case "$d_readdir_r_proto:$usethreads" in
16481 ":define") d_readdir_r_proto=define
16482 set d_readdir_r_proto readdir_r $hdrs
16486 case "$d_readdir_r_proto" in
16488 case "$readdir_r_proto" in
16489 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16490 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16492 case "$readdir_r_proto" in
16493 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16494 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16496 case "$readdir_r_proto" in
16497 ''|0) d_readdir_r=undef
16499 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16500 * ) case "$readdir_r_proto" in
16501 REENTRANT_PROTO*) ;;
16502 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16504 echo "Prototype: $try" ;;
16507 *) case "$usethreads" in
16508 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16515 *) readdir_r_proto=0
16519 : see if readv exists
16523 : see if recvmsg exists
16524 set recvmsg d_recvmsg
16527 : see if rename exists
16528 set rename d_rename
16531 : see if rmdir exists
16535 : see if memory.h is available.
16540 : See if it conflicts with string.h
16546 $cppstdin $cppflags $cppminus < $strings > mem.h
16547 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16549 echo "We won't be including <memory.h>."
16559 : can bcopy handle overlapping blocks?
16562 case "$d_memmove" in
16563 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16564 *) case "$d_bcopy" in
16566 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16568 #$i_memory I_MEMORY
16569 #$i_stdlib I_STDLIB
16570 #$i_string I_STRING
16571 #$i_unistd I_UNISTD
16573 $cat >>try.c <<'EOCP'
16576 # include <memory.h>
16579 # include <stdlib.h>
16582 # include <string.h>
16584 # include <strings.h>
16587 # include <unistd.h> /* Needed for NetBSD */
16591 char buf[128], abc[128];
16597 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16598 try to store the string in read-only memory. */
16599 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16601 for (align = 7; align >= 0; align--) {
16602 for (len = 36; len; len--) {
16604 bcopy(abc, b, len);
16605 for (off = 1; off <= len; off++) {
16606 bcopy(b, b+off, len);
16607 bcopy(b+off, b, len);
16608 if (bcmp(b, abc, len))
16617 if eval $compile_ok; then
16618 if $run ./try 2>/dev/null; then
16619 echo "Yes, it can."
16622 echo "It can't, sorry."
16625 echo "(I can't compile the test program, so we'll assume not...)"
16635 : can memcpy handle overlapping blocks?
16638 case "$d_memmove" in
16639 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16640 *) case "$d_memcpy" in
16642 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16644 #$i_memory I_MEMORY
16645 #$i_stdlib I_STDLIB
16646 #$i_string I_STRING
16647 #$i_unistd I_UNISTD
16649 $cat >>try.c <<'EOCP'
16652 # include <memory.h>
16655 # include <stdlib.h>
16658 # include <string.h>
16660 # include <strings.h>
16663 # include <unistd.h> /* Needed for NetBSD */
16667 char buf[128], abc[128];
16673 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16674 try to store the string in read-only memory. */
16675 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16677 for (align = 7; align >= 0; align--) {
16678 for (len = 36; len; len--) {
16680 memcpy(b, abc, len);
16681 for (off = 1; off <= len; off++) {
16682 memcpy(b+off, b, len);
16683 memcpy(b, b+off, len);
16684 if (memcmp(b, abc, len))
16693 if eval $compile_ok; then
16694 if $run ./try 2>/dev/null; then
16695 echo "Yes, it can."
16698 echo "It can't, sorry."
16701 echo "(I can't compile the test program, so we'll assume not...)"
16711 : can memcmp be trusted to compare relative magnitude?
16713 case "$d_memcmp" in
16716 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16718 #$i_memory I_MEMORY
16719 #$i_stdlib I_STDLIB
16720 #$i_string I_STRING
16721 #$i_unistd I_UNISTD
16723 $cat >>try.c <<'EOCP'
16726 # include <memory.h>
16729 # include <stdlib.h>
16732 # include <string.h>
16734 # include <strings.h>
16737 # include <unistd.h> /* Needed for NetBSD */
16743 if ((a < b) && memcmp(&a, &b, 1) < 0)
16749 if eval $compile_ok; then
16750 if $run ./try 2>/dev/null; then
16751 echo "Yes, it can."
16754 echo "No, it can't (it uses signed chars)."
16757 echo "(I can't compile the test program, so we'll assume not...)"
16765 : see if prototype for sbrk is available
16767 set d_sbrkproto sbrk $i_unistd unistd.h
16770 : see if select exists
16771 set select d_select
16774 : see if semctl exists
16775 set semctl d_semctl
16778 : see if semget exists
16779 set semget d_semget
16782 : see if semop exists
16786 : see how much of the 'sem*(2)' library is present.
16789 case "$d_semctl$d_semget$d_semop" in
16790 *"$undef"*) h_sem=false;;
16794 case "`ipcs 2>&1`" in
16795 "SVID messages"*"not configured"*)
16796 echo "Your $osname does not have the sem*(2) configured." >&4
16799 set semctl d_semctl
16801 set semget d_semget
16809 : we could also check for sys/ipc.h ...
16810 if $h_sem && $test `./findhdr sys/sem.h`; then
16811 echo "You have the full sem*(2) library." >&4
16814 echo "You don't have the full sem*(2) library." >&4
16820 : see whether sys/sem.h defines union semun
16822 $cat > try.c <<'END'
16823 #include <sys/types.h>
16824 #include <sys/ipc.h>
16825 #include <sys/sem.h>
16826 int main () { union semun semun; semun.buf = 0; }
16829 if eval $compile; then
16830 echo "You have union semun in <sys/sem.h>." >&4
16833 echo "You do not have union semun in <sys/sem.h>." >&4
16840 : see how to do semctl IPC_STAT
16844 $cat > tryh.h <<END
16847 # define S_IRUSR S_IREAD
16848 # define S_IWUSR S_IWRITE
16849 # define S_IXUSR S_IEXEC
16851 # define S_IRUSR 0400
16852 # define S_IWUSR 0200
16853 # define S_IXUSR 0100
16855 # define S_IRGRP (S_IRUSR>>3)
16856 # define S_IWGRP (S_IWUSR>>3)
16857 # define S_IXGRP (S_IXUSR>>3)
16858 # define S_IROTH (S_IRUSR>>6)
16859 # define S_IWOTH (S_IWUSR>>6)
16860 # define S_IXOTH (S_IXUSR>>6)
16863 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16864 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16865 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16868 : see whether semctl IPC_STAT can use union semun
16869 case "$d_semctl_semun" in
16873 #include <sys/types.h>
16874 #include <sys/ipc.h>
16875 #include <sys/sem.h>
16876 #include <sys/stat.h>
16883 #$d_union_semun HAS_UNION_SEMUN
16886 #ifndef HAS_UNION_SEMUN
16889 struct semid_ds *buf;
16890 unsigned short *array;
16896 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16897 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16899 struct semid_ds argbuf;
16902 st = semctl(sem, 0, IPC_STAT, arg);
16906 # endif /* IPC_STAT */
16907 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16909 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16910 # endif /* IPC_RMID */
16911 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16913 #endif /* IPC_PRIVATE && ... */
16914 printf("semget failed: errno = %d\n", errno);
16919 if eval $compile; then
16922 semun) val="$define" ;;
16930 case "$d_semctl_semun" in
16932 echo "You can use union semun for semctl IPC_STAT." >&4
16935 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16940 : see whether semctl IPC_STAT can use struct semid_ds pointer
16941 case "$d_semctl_semid_ds" in
16944 $cat > try.c <<'END'
16945 #include <sys/types.h>
16946 #include <sys/ipc.h>
16947 #include <sys/sem.h>
16948 #include <sys/stat.h>
16956 struct semid_ds arg;
16959 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16960 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16963 st = semctl(sem, 0, IPC_STAT, &arg);
16965 printf("semid_ds\n");
16967 # endif /* IPC_STAT */
16968 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16970 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16971 # endif /* IPC_RMID */
16972 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16974 #endif /* IPC_PRIVATE && ... */
16975 printf("semget failed: errno = %d\n", errno);
16981 if eval $compile; then
16984 semid_ds) val="$define" ;;
16988 set d_semctl_semid_ds
16992 case "$d_semctl_semid_ds" in
16994 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16996 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
17002 # We do not have the full sem*(2) library, so assume we can not
17008 set d_semctl_semid_ds
17014 : see if sendmsg exists
17015 set sendmsg d_sendmsg
17018 : see if setegid exists
17019 set setegid d_setegid
17022 : see if seteuid exists
17023 set seteuid d_seteuid
17026 : see if setgrent exists
17027 set setgrent d_setgrent
17030 : see if setgrent_r exists
17031 set setgrent_r d_setgrent_r
17033 case "$d_setgrent_r" in
17035 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
17036 case "$d_setgrent_r_proto:$usethreads" in
17037 ":define") d_setgrent_r_proto=define
17038 set d_setgrent_r_proto setgrent_r $hdrs
17042 case "$d_setgrent_r_proto" in
17044 case "$setgrent_r_proto" in
17045 ''|0) try='int setgrent_r(FILE**);'
17046 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
17048 case "$setgrent_r_proto" in
17049 ''|0) try='void setgrent_r(FILE**);'
17050 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
17052 case "$setgrent_r_proto" in
17053 ''|0) d_setgrent_r=undef
17055 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
17056 * ) case "$setgrent_r_proto" in
17057 REENTRANT_PROTO*) ;;
17058 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
17060 echo "Prototype: $try" ;;
17063 *) case "$usethreads" in
17064 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
17071 *) setgrent_r_proto=0
17075 : see if sethostent exists
17076 set sethostent d_sethent
17079 : see if sethostent_r exists
17080 set sethostent_r d_sethostent_r
17082 case "$d_sethostent_r" in
17084 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17085 case "$d_sethostent_r_proto:$usethreads" in
17086 ":define") d_sethostent_r_proto=define
17087 set d_sethostent_r_proto sethostent_r $hdrs
17091 case "$d_sethostent_r_proto" in
17093 case "$sethostent_r_proto" in
17094 ''|0) try='int sethostent_r(int, struct hostent_data*);'
17095 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
17097 case "$sethostent_r_proto" in
17098 ''|0) try='void sethostent_r(int, struct hostent_data*);'
17099 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
17101 case "$sethostent_r_proto" in
17102 ''|0) d_sethostent_r=undef
17103 sethostent_r_proto=0
17104 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
17105 * ) case "$sethostent_r_proto" in
17106 REENTRANT_PROTO*) ;;
17107 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17109 echo "Prototype: $try" ;;
17112 *) case "$usethreads" in
17113 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17115 d_sethostent_r=undef
17116 sethostent_r_proto=0
17120 *) sethostent_r_proto=0
17124 : see if setitimer exists
17125 set setitimer d_setitimer
17128 : see if setlinebuf exists
17129 set setlinebuf d_setlinebuf
17132 : see if setlocale exists
17133 set setlocale d_setlocale
17136 : see if locale.h is available
17137 set locale.h i_locale
17140 : see if setlocale_r exists
17141 set setlocale_r d_setlocale_r
17143 case "$d_setlocale_r" in
17145 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17146 case "$d_setlocale_r_proto:$usethreads" in
17147 ":define") d_setlocale_r_proto=define
17148 set d_setlocale_r_proto setlocale_r $hdrs
17152 case "$d_setlocale_r_proto" in
17154 case "$setlocale_r_proto" in
17155 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17156 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17158 case "$setlocale_r_proto" in
17159 ''|0) d_setlocale_r=undef
17160 setlocale_r_proto=0
17161 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17162 * ) case "$setlocale_r_proto" in
17163 REENTRANT_PROTO*) ;;
17164 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17166 echo "Prototype: $try" ;;
17169 *) case "$usethreads" in
17170 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17172 d_setlocale_r=undef
17173 setlocale_r_proto=0
17177 *) setlocale_r_proto=0
17181 : see if setnetent exists
17182 set setnetent d_setnent
17185 : see if setnetent_r exists
17186 set setnetent_r d_setnetent_r
17188 case "$d_setnetent_r" in
17190 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17191 case "$d_setnetent_r_proto:$usethreads" in
17192 ":define") d_setnetent_r_proto=define
17193 set d_setnetent_r_proto setnetent_r $hdrs
17197 case "$d_setnetent_r_proto" in
17199 case "$setnetent_r_proto" in
17200 ''|0) try='int setnetent_r(int, struct netent_data*);'
17201 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17203 case "$setnetent_r_proto" in
17204 ''|0) try='void setnetent_r(int, struct netent_data*);'
17205 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17207 case "$setnetent_r_proto" in
17208 ''|0) d_setnetent_r=undef
17209 setnetent_r_proto=0
17210 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17211 * ) case "$setnetent_r_proto" in
17212 REENTRANT_PROTO*) ;;
17213 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17215 echo "Prototype: $try" ;;
17218 *) case "$usethreads" in
17219 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17221 d_setnetent_r=undef
17222 setnetent_r_proto=0
17226 *) setnetent_r_proto=0
17230 : see if setprotoent exists
17231 set setprotoent d_setpent
17234 : see if setpgid exists
17235 set setpgid d_setpgid
17238 : see if setpgrp2 exists
17239 set setpgrp2 d_setpgrp2
17242 : see if setpriority exists
17243 set setpriority d_setprior
17246 : see if setproctitle exists
17247 set setproctitle d_setproctitle
17250 : see if setprotoent_r exists
17251 set setprotoent_r d_setprotoent_r
17253 case "$d_setprotoent_r" in
17255 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17256 case "$d_setprotoent_r_proto:$usethreads" in
17257 ":define") d_setprotoent_r_proto=define
17258 set d_setprotoent_r_proto setprotoent_r $hdrs
17262 case "$d_setprotoent_r_proto" in
17264 case "$setprotoent_r_proto" in
17265 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17266 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17268 case "$setprotoent_r_proto" in
17269 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17270 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17272 case "$setprotoent_r_proto" in
17273 ''|0) d_setprotoent_r=undef
17274 setprotoent_r_proto=0
17275 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17276 * ) case "$setprotoent_r_proto" in
17277 REENTRANT_PROTO*) ;;
17278 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17280 echo "Prototype: $try" ;;
17283 *) case "$usethreads" in
17284 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17286 d_setprotoent_r=undef
17287 setprotoent_r_proto=0
17291 *) setprotoent_r_proto=0
17295 : see if setpwent exists
17296 set setpwent d_setpwent
17299 : see if setpwent_r exists
17300 set setpwent_r d_setpwent_r
17302 case "$d_setpwent_r" in
17304 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17305 case "$d_setpwent_r_proto:$usethreads" in
17306 ":define") d_setpwent_r_proto=define
17307 set d_setpwent_r_proto setpwent_r $hdrs
17311 case "$d_setpwent_r_proto" in
17313 case "$setpwent_r_proto" in
17314 ''|0) try='int setpwent_r(FILE**);'
17315 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17317 case "$setpwent_r_proto" in
17318 ''|0) try='void setpwent_r(FILE**);'
17319 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17321 case "$setpwent_r_proto" in
17322 ''|0) d_setpwent_r=undef
17324 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17325 * ) case "$setpwent_r_proto" in
17326 REENTRANT_PROTO*) ;;
17327 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17329 echo "Prototype: $try" ;;
17332 *) case "$usethreads" in
17333 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17340 *) setpwent_r_proto=0
17344 : see if setregid exists
17345 set setregid d_setregid
17347 set setresgid d_setresgid
17350 : see if setreuid exists
17351 set setreuid d_setreuid
17353 set setresuid d_setresuid
17356 : see if setrgid exists
17357 set setrgid d_setrgid
17360 : see if setruid exists
17361 set setruid d_setruid
17364 : see if setservent exists
17365 set setservent d_setsent
17368 : see if setservent_r exists
17369 set setservent_r d_setservent_r
17371 case "$d_setservent_r" in
17373 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17374 case "$d_setservent_r_proto:$usethreads" in
17375 ":define") d_setservent_r_proto=define
17376 set d_setservent_r_proto setservent_r $hdrs
17380 case "$d_setservent_r_proto" in
17382 case "$setservent_r_proto" in
17383 ''|0) try='int setservent_r(int, struct servent_data*);'
17384 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17386 case "$setservent_r_proto" in
17387 ''|0) try='void setservent_r(int, struct servent_data*);'
17388 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17390 case "$setservent_r_proto" in
17391 ''|0) d_setservent_r=undef
17392 setservent_r_proto=0
17393 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17394 * ) case "$setservent_r_proto" in
17395 REENTRANT_PROTO*) ;;
17396 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17398 echo "Prototype: $try" ;;
17401 *) case "$usethreads" in
17402 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17404 d_setservent_r=undef
17405 setservent_r_proto=0
17409 *) setservent_r_proto=0
17413 : see if setsid exists
17414 set setsid d_setsid
17417 : see if setvbuf exists
17418 set setvbuf d_setvbuf
17421 : see if sfio.h is available
17425 : see if sfio library is available
17436 : Ok, but do we want to use it.
17440 true|$define|[yY]*) dflt='y';;
17443 echo "$package can use the sfio library, but it is experimental."
17444 rp="You seem to have sfio available, do you want to try using it?"
17447 y|Y) echo "Ok, turning on sfio then."
17450 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17455 *) case "$usesfio" in
17456 true|$define|[yY]*)
17457 echo "Sorry, cannot find sfio on this machine." >&4
17458 echo "Ignoring your setting of usesfio=$usesfio." >&4
17467 $define) usesfio='true';;
17468 *) usesfio='false';;
17472 *) : Remove sfio from list of libraries to use
17475 echo "Removing unneeded -lsfio from library list" >&4
17476 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17479 echo "libs = $libs" >&4
17486 : see if shmctl exists
17487 set shmctl d_shmctl
17490 : see if shmget exists
17491 set shmget d_shmget
17494 : see if shmat exists
17497 : see what shmat returns
17500 $cat >shmat.c <<'END'
17501 #include <sys/shm.h>
17504 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17509 echo "and it returns ($shmattype)." >&4
17510 : see if a prototype for shmat is available
17511 xxx=`./findhdr sys/shm.h`
17512 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17513 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17524 set d_shmatprototype
17527 : see if shmdt exists
17531 : see how much of the 'shm*(2)' library is present.
17534 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17535 *"$undef"*) h_shm=false;;
17539 case "`ipcs 2>&1`" in
17540 "SVID shared memory"*"not configured"*)
17541 echo "Your $osname does not have the shm*(2) configured." >&4
17544 set shmctl d_shmctl
17546 set shmget d_shmget
17556 : we could also check for sys/ipc.h ...
17557 if $h_shm && $test `./findhdr sys/shm.h`; then
17558 echo "You have the full shm*(2) library." >&4
17561 echo "You don't have the full shm*(2) library." >&4
17567 : see if we have sigaction
17569 if set sigaction val -f d_sigaction; eval $csym; $val; then
17570 echo 'sigaction() found.' >&4
17573 #include <sys/types.h>
17574 #include <signal.h>
17575 #$i_stdlib I_STDLIB
17577 #include <stdlib.h>
17581 struct sigaction act, oact;
17583 oact.sa_handler = 0;
17584 /* so that act and oact are used */
17585 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17589 if eval $compile_ok; then
17592 echo "But you don't seem to have a usable struct sigaction." >&4
17596 echo 'sigaction NOT found.' >&4
17599 set d_sigaction; eval $setvar
17602 : see if this is a sunmath.h system
17603 set sunmath.h i_sunmath
17606 : see if signbit exists
17607 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17610 #$i_sunmath I_SUNMATH
17614 #ifdef I_SUNMATH /* Solaris special math library */
17615 # include <sunmath.h>
17618 int main(int argc, char **argv)
17622 if ((signbit(x) == 0) && (signbit(y) != 0))
17630 if eval $compile; then
17631 if $run ./try; then
17635 $echo "Signbit seems to be available, but doesn't work as I expected."
17636 $echo "I won't use it." >&4
17647 : see if sigprocmask exists
17648 set sigprocmask d_sigprocmask
17651 : see if sigsetjmp exists
17653 case "$d_sigsetjmp" in
17656 #include <setjmp.h>
17657 #$i_stdlib I_STDLIB
17659 #include <stdlib.h>
17665 if (sigsetjmp(env,1))
17668 siglongjmp(env, 1);
17673 if eval $compile; then
17674 if $run ./try >/dev/null 2>&1; then
17675 echo "POSIX sigsetjmp found." >&4
17679 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17685 echo "sigsetjmp not found." >&4
17689 *) val="$d_sigsetjmp"
17690 case "$d_sigsetjmp" in
17691 $define) echo "POSIX sigsetjmp found." >&4;;
17692 $undef) echo "sigsetjmp not found." >&4;;
17700 : see if snprintf exists
17701 set snprintf d_snprintf
17704 : see if vsnprintf exists
17705 set vsnprintf d_vsnprintf
17708 case "$d_snprintf-$d_vsnprintf" in
17711 Checking whether your snprintf() and vsnprintf() work okay...
17713 $cat >try.c <<'EOCP'
17714 /* v?snprintf testing logic courtesy of Russ Allbery.
17715 * According to C99:
17716 * - if the buffer is too short it still must be \0-terminated
17717 * - if the buffer is too short the potentially required length
17718 * must be returned and not -1
17719 * - if the buffer is NULL the potentially required length
17720 * must be returned and not -1 or core dump
17723 #include <stdarg.h>
17727 int test (char *format, ...)
17732 va_start (args, format);
17733 count = vsnprintf (buf, sizeof buf, format, args);
17740 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17741 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17745 if eval $compile; then
17748 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17750 Your snprintf() and snprintf() don't seem to be working okay.
17752 d_snprintf="$undef"
17753 d_vsnprintf="$undef"
17757 echo "(I can't seem to compile the test program--assuming they don't)"
17758 d_snprintf="$undef"
17759 d_vsnprintf="$undef"
17765 : see if sockatmark exists
17766 set sockatmark d_sockatmark
17769 : see if prototype for sockatmark is available
17771 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17774 : see if socks5_init exists
17775 set socks5_init d_socks5_init
17778 : see if sprintf returns the length of the string in the buffer as per ANSI
17779 $echo "Checking whether sprintf returns the length of the string..." >&4
17782 #$i_stdlib I_STDLIB
17784 #include <stdlib.h>
17786 #$i_string I_STRING
17788 # include <string.h>
17790 # include <strings.h>
17799 int check (size_t expect, int test) {
17800 size_t got = strlen(buffer);
17804 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17809 int main(int argc, char **argv) {
17812 check(sprintf(buffer, ""), ++test);
17813 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17814 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17821 if eval $compile; then
17825 sprintf returns the length of the string (as ANSI says it should)
17827 d_sprintf_returns_strlen="$define"
17830 sprintf does not return the length of the string (how old is this system?)
17832 d_sprintf_returns_strlen="$undef"
17836 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17837 d_sprintf_returns_strlen="$undef"
17841 : see if srand48_r exists
17842 set srand48_r d_srand48_r
17844 case "$d_srand48_r" in
17846 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17847 case "$d_srand48_r_proto:$usethreads" in
17848 ":define") d_srand48_r_proto=define
17849 set d_srand48_r_proto srand48_r $hdrs
17853 case "$d_srand48_r_proto" in
17855 case "$srand48_r_proto" in
17856 ''|0) try='int srand48_r(long, struct drand48_data*);'
17857 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17859 case "$srand48_r_proto" in
17860 ''|0) d_srand48_r=undef
17862 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17863 * ) case "$srand48_r_proto" in
17864 REENTRANT_PROTO*) ;;
17865 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17867 echo "Prototype: $try" ;;
17870 *) case "$usethreads" in
17871 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17878 *) srand48_r_proto=0
17882 : see if srandom_r exists
17883 set srandom_r d_srandom_r
17885 case "$d_srandom_r" in
17887 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17888 case "$d_srandom_r_proto:$usethreads" in
17889 ":define") d_srandom_r_proto=define
17890 set d_srandom_r_proto srandom_r $hdrs
17894 case "$d_srandom_r_proto" in
17896 case "$srandom_r_proto" in
17897 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17898 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
17900 case "$srandom_r_proto" in
17901 ''|0) d_srandom_r=undef
17903 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17904 * ) case "$srandom_r_proto" in
17905 REENTRANT_PROTO*) ;;
17906 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17908 echo "Prototype: $try" ;;
17911 *) case "$usethreads" in
17912 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17919 *) srandom_r_proto=0
17923 : see if prototype for setresgid is available
17925 set d_sresgproto setresgid $i_unistd unistd.h
17928 : see if prototype for setresuid is available
17930 set d_sresuproto setresuid $i_unistd unistd.h
17933 : see if sys/stat.h is available
17934 set sys/stat.h i_sysstat
17937 : see if stat knows about block sizes
17939 echo "Checking to see if your struct stat has st_blocks field..." >&4
17940 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17943 : see if this is a sys/vfs.h system
17944 set sys/vfs.h i_sysvfs
17947 : see if this is a sys/statfs.h system
17948 set sys/statfs.h i_sysstatfs
17951 : Check for statfs_s
17953 echo "Checking to see if your system supports struct statfs..." >&4
17954 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
17956 case "$d_statfs_s" in
17957 "$define") echo "Yes, it does." ;;
17958 *) echo "No, it doesn't." ;;
17962 : see if struct statfs knows about f_flags
17963 case "$d_statfs_s" in
17966 echo "Checking to see if your struct statfs has f_flags field..." >&4
17967 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
17971 set d_statfs_f_flags
17975 case "$d_statfs_f_flags" in
17976 "$define") echo "Yes, it does." ;;
17977 *) echo "No, it doesn't." ;;
17980 : see what flavor, if any, of static inline is supported
17982 echo "Checking to see if your system supports static inline..."
17983 $cat > try.c <<'EOCP'
17984 #include <stdlib.h>
17985 extern int f_via_a(int x);
17986 extern int f_via_b(int x);
17987 int main(int argc, char **argv)
17996 return EXIT_SUCCESS;
17999 return EXIT_FAILURE;
18003 $cat > a.c <<'EOCP'
18004 static INLINE int f(int x) {
18015 $cat > b.c <<'EOCP'
18016 extern int f(int x);
18024 # Respect a hint (or previous) value for perl_static_inline, if there is one.
18025 case "$perl_static_inline" in
18026 '') # Check the various possibilities, and break out on success.
18027 # For gcc, prefer __inline__, which will still permit
18028 # cflags.SH to add in -ansi.
18029 case "$gccversion" in
18030 '') xxx="inline __inline__ __inline _inline";;
18031 *) xxx="__inline__ inline __inline _inline";;
18033 for inline in $xxx; do
18034 set try -DINLINE=$inline a.c
18035 if eval $compile && $run ./try; then
18036 # Now make sure there is no external linkage of static
18038 set try -DINLINE=$inline -DUSE_B a.c b.c
18039 if eval $compile && $run ./try; then
18040 $echo "Your compiler supports static $inline, " >&4
18041 $echo "but it also creates an external definition," >&4
18042 $echo "so I won't use it." >&4
18045 $echo "Your compiler supports static $inline." >&4
18047 perl_static_inline="static $inline";
18051 $echo "Your compiler does NOT support static $inline." >&4
18056 *inline*) # Some variant of inline exists.
18057 echo "Keeping your $hint value of $perl_static_inline."
18060 static) # No inline capabilities
18061 echo "Keeping your $hint value of $perl_static_inline."
18064 *) # Unrecognized previous value -- blindly trust the supplied
18065 # value and hope it makes sense. Use old value for
18066 # d_static_inline, if there is one.
18067 echo "Keeping your $hint value of $perl_static_inline."
18068 case "$d_static_inline" in
18070 *) val=$d_static_inline ;;
18074 # Fallback to plain 'static' if nothing worked.
18075 case "$perl_static_inline" in
18077 perl_static_inline="static"
18081 set d_static_inline
18083 $rm -f a.[co] b.[co]
18086 : Check stream access
18088 Checking how to access stdio streams by file descriptor number...
18090 case "$stdio_stream_array" in
18091 '') $cat >try.c <<EOCP
18094 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
18098 for s in _iob __iob __sF
18100 set try -DSTDIO_STREAM_ARRAY=$s
18101 if eval $compile; then
18102 case "`$run ./try`" in
18103 yes) stdio_stream_array=$s; break ;;
18109 case "$stdio_stream_array" in
18111 I can't figure out how to access stdio streams by file descriptor number.
18113 d_stdio_stream_array="$undef"
18116 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18118 d_stdio_stream_array="$define"
18122 : see if strcoll exists
18123 set strcoll d_strcoll
18126 : check for structure copying
18128 echo "Checking to see if your C compiler can copy structs..." >&4
18129 $cat >try.c <<'EOCP'
18139 if $cc -c try.c >/dev/null 2>&1 ; then
18141 echo "Yup, it can."
18144 echo "Nope, it can't."
18150 : see if strerror and/or sys_errlist[] exist
18152 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18153 if set strerror val -f d_strerror; eval $csym; $val; then
18154 echo 'strerror() found.' >&4
18155 d_strerror="$define"
18156 d_strerrm='strerror(e)'
18157 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18158 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18159 d_syserrlst="$define"
18161 echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
18162 d_syserrlst="$undef"
18164 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18165 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18166 echo 'strerror() found in string header.' >&4
18167 d_strerror="$define"
18168 d_strerrm='strerror(e)'
18169 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18170 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18171 d_syserrlst="$define"
18173 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18174 d_syserrlst="$undef"
18176 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18177 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18178 d_strerror="$undef"
18179 d_syserrlst="$define"
18180 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18182 echo 'strerror() and sys_errlist[] NOT found.' >&4
18183 d_strerror="$undef"
18184 d_syserrlst="$undef"
18185 d_strerrm='"unknown"'
18189 : see if strerror_r exists
18190 set strerror_r d_strerror_r
18192 case "$d_strerror_r" in
18194 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18195 case "$d_strerror_r_proto:$usethreads" in
18196 ":define") d_strerror_r_proto=define
18197 set d_strerror_r_proto strerror_r $hdrs
18201 case "$d_strerror_r_proto" in
18203 case "$strerror_r_proto" in
18204 ''|0) try='int strerror_r(int, char*, size_t);'
18205 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18207 case "$strerror_r_proto" in
18208 ''|0) try='int strerror_r(int, char*, int);'
18209 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18211 case "$strerror_r_proto" in
18212 ''|0) try='char* strerror_r(int, char*, size_t);'
18213 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18215 case "$strerror_r_proto" in
18216 ''|0) d_strerror_r=undef
18218 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18219 * ) case "$strerror_r_proto" in
18220 REENTRANT_PROTO*) ;;
18221 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18223 echo "Prototype: $try" ;;
18226 *) case "$usethreads" in
18227 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18234 *) strerror_r_proto=0
18238 : see if strftime exists
18239 set strftime d_strftime
18242 : see if strlcat exists
18243 set strlcat d_strlcat
18246 : see if strlcpy exists
18247 set strlcpy d_strlcpy
18250 : see if strtod exists
18251 set strtod d_strtod
18254 : see if strtol exists
18255 set strtol d_strtol
18258 : see if strtold exists
18259 set strtold d_strtold
18262 : see if strtoll exists
18263 set strtoll d_strtoll
18266 case "$d_longlong-$d_strtoll" in
18269 Checking whether your strtoll() works okay...
18271 $cat >try.c <<'EOCP'
18274 #define strtoll __strtoll
18277 #define strtoll _strtoll
18280 extern long long int strtoll(char *s, char **, int);
18281 static int bad = 0;
18282 int check(char *s, long long ell, int een) {
18285 gll = strtoll(s, 0, 10);
18286 if (!((gll == ell) && (errno == een)))
18290 check(" 1", 1LL, 0);
18291 check(" 0", 0LL, 0);
18292 check("-1", -1LL, 0);
18293 check("-9223372036854775808", -9223372036854775808LL, 0);
18294 check("-9223372036854775808", -9223372036854775808LL, 0);
18295 check(" 9223372036854775807", 9223372036854775807LL, 0);
18296 check("-9223372036854775808", -9223372036854775808LL, 0);
18297 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18298 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18304 if eval $compile; then
18307 ok) echo "Your strtoll() seems to be working okay." ;;
18309 Your strtoll() doesn't seem to be working okay.
18315 echo "(I can't seem to compile the test program--assuming it doesn't)"
18321 : see if strtoq exists
18322 set strtoq d_strtoq
18325 : see if strtoul exists
18326 set strtoul d_strtoul
18329 case "$d_strtoul" in
18332 Checking whether your strtoul() works okay...
18334 $cat >try.c <<'EOCP'
18337 extern unsigned long int strtoul(char *s, char **, int);
18338 static int bad = 0;
18339 void check(char *s, unsigned long eul, int een) {
18342 gul = strtoul(s, 0, 10);
18343 if (!((gul == eul) && (errno == een)))
18347 check(" 1", 1L, 0);
18348 check(" 0", 0L, 0);
18350 case "$longsize" in
18352 $cat >>try.c <<'EOCP'
18353 check("18446744073709551615", 18446744073709551615UL, 0);
18354 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18355 #if 0 /* strtoul() for /^-/ strings is undefined. */
18356 check("-1", 18446744073709551615UL, 0);
18357 check("-18446744073709551614", 2, 0);
18358 check("-18446744073709551615", 1, 0);
18359 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18360 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18365 $cat >>try.c <<'EOCP'
18366 check("4294967295", 4294967295UL, 0);
18367 check("4294967296", 4294967295UL, ERANGE);
18368 #if 0 /* strtoul() for /^-/ strings is undefined. */
18369 check("-1", 4294967295UL, 0);
18370 check("-4294967294", 2, 0);
18371 check("-4294967295", 1, 0);
18372 check("-4294967296", 4294967295UL, ERANGE);
18373 check("-4294967297", 4294967295UL, ERANGE);
18378 : Should we write these tests to be more portable by sprintf-ing
18379 : ~0 and then manipulating that char string as input for strtol?
18382 $cat >>try.c <<'EOCP'
18389 if eval $compile; then
18390 case "`$run ./try`" in
18391 ok) echo "Your strtoul() seems to be working okay." ;;
18393 Your strtoul() doesn't seem to be working okay.
18399 echo "(I can't seem to compile the test program--assuming it doesn't)"
18405 : see if strtoull exists
18406 set strtoull d_strtoull
18409 case "$d_longlong-$d_strtoull" in
18412 Checking whether your strtoull() works okay...
18414 $cat >try.c <<'EOCP'
18417 #define strtoull __strtoull
18420 extern unsigned long long int strtoull(char *s, char **, int);
18421 static int bad = 0;
18422 int check(char *s, long long eull, int een) {
18425 gull = strtoull(s, 0, 10);
18426 if (!((gull == eull) && (errno == een)))
18430 check(" 1", 1LL, 0);
18431 check(" 0", 0LL, 0);
18432 check("18446744073709551615", 18446744073709551615ULL, 0);
18433 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18434 #if 0 /* strtoull() for /^-/ strings is undefined. */
18435 check("-1", 18446744073709551615ULL, 0);
18436 check("-18446744073709551614", 2LL, 0);
18437 check("-18446744073709551615", 1LL, 0);
18438 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18439 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18446 if eval $compile; then
18447 case "`$run ./try`" in
18448 ok) echo "Your strtoull() seems to be working okay." ;;
18450 Your strtoull() doesn't seem to be working okay.
18452 d_strtoull="$undef"
18456 echo "(I can't seem to compile the test program--assuming it doesn't)"
18457 d_strtoull="$undef"
18462 : see if strtouq exists
18463 set strtouq d_strtouq
18466 case "$d_strtouq" in
18469 Checking whether your strtouq() works okay...
18471 $cat >try.c <<'EOCP'
18474 extern unsigned long long int strtouq(char *s, char **, int);
18475 static int bad = 0;
18476 void check(char *s, unsigned long long eull, int een) {
18477 unsigned long long gull;
18479 gull = strtouq(s, 0, 10);
18480 if (!((gull == eull) && (errno == een)))
18484 check(" 1", 1LL, 0);
18485 check(" 0", 0LL, 0);
18486 check("18446744073709551615", 18446744073709551615ULL, 0);
18487 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18488 #if 0 /* strtouq() for /^-/ strings is undefined. */
18489 check("-1", 18446744073709551615ULL, 0);
18490 check("-18446744073709551614", 2LL, 0);
18491 check("-18446744073709551615", 1LL, 0);
18492 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18493 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18501 if eval $compile; then
18502 case "`$run ./try`" in
18503 ok) echo "Your strtouq() seems to be working okay." ;;
18505 Your strtouq() doesn't seem to be working okay.
18511 echo "(I can't seem to compile the test program--assuming it doesn't)"
18517 : see if strxfrm exists
18518 set strxfrm d_strxfrm
18521 : see if symlink exists
18522 set symlink d_symlink
18525 : see if syscall exists
18526 set syscall d_syscall
18529 : see if prototype for syscall is available
18531 set d_syscallproto syscall $i_unistd unistd.h
18534 : see if sysconf exists
18535 set sysconf d_sysconf
18538 : see if system exists
18539 set system d_system
18542 : see if tcgetpgrp exists
18543 set tcgetpgrp d_tcgetpgrp
18546 : see if tcsetpgrp exists
18547 set tcsetpgrp d_tcsetpgrp
18550 : see if prototype for telldir is available
18552 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18555 : see if time exists
18557 if test "X$d_time" = X -o X"$timetype" = X; then
18558 if set time val -f d_time; eval $csym; $val; then
18559 echo 'time() found.' >&4
18561 rp="What is the type returned by time() on this system?"
18562 set time_t timetype long stdio.h sys/types.h
18565 echo 'time() not found, hope that will do.' >&4
18573 : see if timegm exists
18574 set timegm d_timegm
18577 : see if this is a sys/times.h system
18578 set sys/times.h i_systimes
18581 : see if times exists
18583 if set times val -f d_times; eval $csym; $val; then
18584 echo 'times() found.' >&4
18587 case "$i_systimes" in
18588 "$define") inc='sys/times.h';;
18590 rp="What is the type returned by times() on this system?"
18591 set clock_t clocktype long stdio.h sys/types.h $inc
18594 echo 'times() NOT found, hope that will do.' >&4
18599 : see if tmpnam_r exists
18600 set tmpnam_r d_tmpnam_r
18602 case "$d_tmpnam_r" in
18604 hdrs="$i_systypes sys/types.h define stdio.h "
18605 case "$d_tmpnam_r_proto:$usethreads" in
18606 ":define") d_tmpnam_r_proto=define
18607 set d_tmpnam_r_proto tmpnam_r $hdrs
18611 case "$d_tmpnam_r_proto" in
18613 case "$tmpnam_r_proto" in
18614 ''|0) try='char* tmpnam_r(char*);'
18615 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18617 case "$tmpnam_r_proto" in
18618 ''|0) d_tmpnam_r=undef
18620 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18621 * ) case "$tmpnam_r_proto" in
18622 REENTRANT_PROTO*) ;;
18623 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18625 echo "Prototype: $try" ;;
18628 *) case "$usethreads" in
18629 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18636 *) tmpnam_r_proto=0
18640 : see if truncate exists
18641 set truncate d_truncate
18644 : see if ttyname_r exists
18645 set ttyname_r d_ttyname_r
18647 case "$d_ttyname_r" in
18649 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18650 case "$d_ttyname_r_proto:$usethreads" in
18651 ":define") d_ttyname_r_proto=define
18652 set d_ttyname_r_proto ttyname_r $hdrs
18656 case "$d_ttyname_r_proto" in
18658 case "$ttyname_r_proto" in
18659 ''|0) try='int ttyname_r(int, char*, size_t);'
18660 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18662 case "$ttyname_r_proto" in
18663 ''|0) try='int ttyname_r(int, char*, int);'
18664 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18666 case "$ttyname_r_proto" in
18667 ''|0) try='char* ttyname_r(int, char*, int);'
18668 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18670 case "$ttyname_r_proto" in
18671 ''|0) d_ttyname_r=undef
18673 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18674 * ) case "$ttyname_r_proto" in
18675 REENTRANT_PROTO*) ;;
18676 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18678 echo "Prototype: $try" ;;
18681 *) case "$usethreads" in
18682 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18689 *) ttyname_r_proto=0
18693 : see if tzname[] exists
18695 if set tzname val -a d_tzname; eval $csym; $val; then
18697 echo 'tzname[] found.' >&4
18700 echo 'tzname[] NOT found.' >&4
18705 : Check if is a multiplatform env
18707 next|darwin) multiarch="$define" ;;
18709 case "$multiarch" in
18710 ''|[nN]*) multiarch="$undef" ;;
18713 : check for ordering of bytes in a UV
18715 case "$usecrosscompile$multiarch" in
18718 You seem to be either cross-compiling or doing a multiarchitecture build,
18719 skipping the byteorder check.
18725 case "$byteorder" in
18728 In the following, larger digits indicate more significance. A big-endian
18729 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18730 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18731 machines may have weird orders like 3412. A Cray will report 87654321,
18732 an Alpha will report 12345678. If the test program works the default is
18734 I'm now running the test program...
18738 #$i_stdlib I_STDLIB
18740 #include <stdlib.h>
18742 #include <sys/types.h>
18743 typedef $uvtype UV;
18753 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18755 u.l = (UV)0x04030201;
18756 for (i = 0; i < $uvsize; i++)
18757 printf("%c", u.c[i]+'0');
18764 if eval $compile && $run ./try > /dev/null; then
18767 [1-4][1-4][1-4][1-4]|12345678|87654321)
18768 echo "(The test program ran ok.)"
18769 echo "byteorder=$dflt"
18772 ????|????????) echo "(The test program ran ok.)" ;;
18773 *) echo "(The test program didn't run right for some reason.)" ;;
18778 (I can't seem to compile the test program. Guessing big-endian...)
18781 case "$xxx_prompt" in
18783 rp="What is the order of bytes in $uvtype?"
18796 : Checking 32bit alignedness
18799 Checking to see whether you can access character data unalignedly...
18801 case "$d_u32align" in
18802 '') $cat >try.c <<EOCP
18804 #$i_stdlib I_STDLIB
18806 #include <stdlib.h>
18808 #define U32 $u32type
18809 #define BYTEORDER 0x$byteorder
18811 #include <signal.h>
18813 $signal_t bletch(int s) { exit(4); }
18816 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18817 volatile U8 buf[8];
18821 if (sizeof(U32) != 4) {
18822 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18829 signal(SIGBUS, bletch);
18841 for (i = 0; i < 4; i++) {
18842 up = (U32*)(buf + i);
18843 if (! ((*up == 1 << (8*i)) || /* big-endian */
18844 (*up == 1 << (8*(3-i))) /* little-endian */
18848 printf("read failed (%x)\n", *up);
18854 for (i = 0; i < 4; i++) {
18855 up = (U32*)(buf + i);
18857 if (*up != 0xBeef) {
18858 printf("write failed (%x)\n", *up);
18872 if eval $compile_ok; then
18873 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18874 $run ./try 2>&1 >/dev/null
18877 You can access character data pretty unalignedly.
18879 d_u32align="$undef"
18882 It seems that you must access character data in an aligned manner.
18884 d_u32align="$define"
18888 rp='Can you access character data at unaligned addresses?'
18892 [yY]*) d_u32align="$undef" ;;
18893 *) d_u32align="$define" ;;
18900 : see if ualarm exists
18901 set ualarm d_ualarm
18904 : see if umask exists
18908 : see if unordered exists
18909 set unordered d_unordered
18912 : see if unsetenv exists
18913 set unsetenv d_unsetenv
18916 : see if usleep exists
18917 set usleep d_usleep
18920 : see if prototype for usleep is available
18922 set d_usleepproto usleep $i_unistd unistd.h
18925 : see if ustat exists
18929 : see if closedir exists
18930 set closedir d_closedir
18933 case "$d_closedir" in
18936 echo "Checking whether closedir() returns a status..." >&4
18938 #$i_dirent I_DIRENT /**/
18939 #$i_sysdir I_SYS_DIR /**/
18940 #$i_sysndir I_SYS_NDIR /**/
18941 #$i_systypes I_SYS_TYPES /**/
18943 #if defined(I_SYS_TYPES)
18944 #include <sys/types.h>
18946 #if defined(I_DIRENT)
18947 #include <dirent.h>
18948 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18949 #include <sys/dir.h>
18953 #include <sys/ndir.h>
18957 #include <ndir.h> /* may be wrong in the future */
18959 #include <sys/dir.h>
18964 int main() { return closedir(opendir(".")); }
18967 if eval $compile_ok; then
18968 if $run ./try > /dev/null 2>&1 ; then
18969 echo "Yes, it does."
18972 echo "No, it doesn't."
18976 echo "(I can't seem to compile the test program--assuming it doesn't)"
18984 set d_void_closedir
18988 : see if there is a wait4
18992 : see if waitpid exists
18993 set waitpid d_waitpid
18996 : see if wcstombs exists
18997 set wcstombs d_wcstombs
19000 : see if wctomb exists
19001 set wctomb d_wctomb
19004 : see if writev exists
19005 set writev d_writev
19008 : preserve RCS keywords in files with variable substitution, grrr
19013 Revision='$Revision'
19015 : check for alignment requirements
19017 case "$usecrosscompile" in
19020 You seem to be cross-compiling. Skipping the memory alignment check.
19023 case "$alignbytes" in
19024 '') alignbytes=8 ;;
19028 case "$alignbytes" in
19029 '') echo "Checking alignment constraints..." >&4
19030 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
19031 $cat >try.c <<'EOCP'
19032 typedef long double NV;
19035 $cat >try.c <<'EOCP'
19039 $cat >>try.c <<'EOCP'
19047 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
19052 if eval $compile_ok; then
19056 echo "(I can't seem to compile the test program...)"
19058 case "$multiarch" in
19060 : The usual safe value is 8, but Darwin with -Duselongdouble
19061 : needs 16. Hence, we will take 8 as a minimum, but allow
19062 : Configure to pick a larger value if needed.
19063 if $test "$dflt" -lt 8; then
19065 echo "Setting alignment to 8 for multiarch support.">&4
19070 *) dflt="$alignbytes"
19073 rp="Doubles must be aligned on a how-many-byte boundary?"
19081 : set the base revision
19084 : Determine if this is an EBCDIC system
19086 echo "Determining whether or not we are on an EBCDIC system..." >&4
19087 $cat >try.c <<'EOM'
19090 if ('M'==0xd4) return 0;
19095 case "$BOOTSTRAP_CHARSET" in
19096 Y|y|define) bootstrap_charset=$define ;;
19097 *) bootstrap_charset=$undef ;;
19102 if eval $compile_ok; then
19103 if $run ./try; then
19104 echo "You seem to speak EBCDIC." >&4
19107 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19110 echo "I'm unable to compile the test program." >&4
19111 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19117 : length of character in bytes. Is always 1, otherwise it is not C
19118 : This used to be a test using sizeof
19121 : Check for the number of bits in a character
19122 case "$charbits" in
19123 '') echo "Checking how long a character is (in bits)..." >&4
19130 for (c = 1, n = 0; c; c <<= 1, n++) ;
19131 printf ("%d\n", n);
19136 if eval $compile_ok; then
19140 echo "(I can't seem to compile the test program. Guessing...)"
19147 rp="What is the length of a character (in bits)?"
19151 case "$charbits" in
19154 Your system has an unsigned character size of $charbits bits, which
19155 is rather unusual (normally it is 8 bits). Perl likely will not work
19156 correctly on your system, with subtle bugs in various places.
19158 rp='Do you really want to continue?'
19162 [yY]) echo >&4 "Okay, continuing." ;;
19167 : how do we concatenate cpp tokens here?
19169 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19170 $cat >cpp_stuff.c <<'EOCP'
19171 #define RCAT(a,b)a/**/b
19172 #define ACAT(a,b)a ## b
19176 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19177 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19178 echo "Oh! Smells like ANSI's been here." >&4
19179 echo "We can catify or stringify, separately or together!"
19181 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19182 echo "Ah, yes! The good old days!" >&4
19183 echo "However, in the good old days we don't know how to stringify and"
19184 echo "catify at the same time."
19188 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19189 You're going to have to edit the values of CAT[2-5] in config.h...
19191 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19195 : see if this is a db.h system
19201 : Check db version.
19203 echo "Checking Berkeley DB version ..." >&4
19209 #include <sys/types.h>
19211 #$i_stdlib I_STDLIB
19213 #include <stdlib.h>
19216 int main(int argc, char *argv[])
19218 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19219 int Major, Minor, Patch ;
19220 unsigned long Version ;
19221 (void)db_version(&Major, &Minor, &Patch) ;
19223 printf("%d %d %d %d %d %d\n",
19224 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19225 Major, Minor, Patch);
19228 printf("You have Berkeley DB Version 2 or greater.\n");
19230 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19231 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19232 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19233 Major, Minor, Patch) ;
19235 /* check that db.h & libdb are compatible */
19236 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19237 printf("db.h and libdb are incompatible.\n") ;
19241 printf("db.h and libdb are compatible.\n") ;
19243 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19244 + DB_VERSION_PATCH ;
19246 /* needs to be >= 2.3.4 */
19247 if (Version < 2003004) {
19248 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19249 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19255 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19260 printf("You have Berkeley DB Version 1.\n");
19261 exit(0); /* DB version < 2: the coast is clear. */
19263 exit(1); /* <db.h> not Berkeley DB? */
19269 if eval $compile_ok && $run ./try; then
19270 echo 'Looks OK.' >&4
19272 db_version_major=$1
19273 db_version_minor=$2
19274 db_version_patch=$3
19276 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19280 : Remove db from list of libraries to use
19281 echo "Removing unusable -ldb from library list" >&4
19282 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19285 echo "libs = $libs" >&4
19295 : Check the return type needed for hash
19297 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19303 #include <sys/types.h>
19306 #ifndef DB_VERSION_MAJOR
19307 u_int32_t hash_cb (ptr, size)
19315 info.hash = hash_cb;
19319 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19320 if $contains warning try.out >>/dev/null 2>&1 ; then
19323 db_hashtype='u_int32_t'
19326 : XXX Maybe we should just give up here.
19327 db_hashtype=u_int32_t
19329 echo "Help: I can't seem to compile the db test program." >&4
19330 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19333 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19335 *) db_hashtype=u_int32_t
19340 : Check the return type needed for prefix
19342 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19348 #include <sys/types.h>
19351 #ifndef DB_VERSION_MAJOR
19352 size_t prefix_cb (key1, key2)
19360 info.prefix = prefix_cb;
19364 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19365 if $contains warning try.out >>/dev/null 2>&1 ; then
19366 db_prefixtype='int'
19368 db_prefixtype='size_t'
19371 db_prefixtype='size_t'
19372 : XXX Maybe we should just give up here.
19374 echo "Help: I can't seem to compile the db test program." >&4
19375 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19378 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19380 *) db_prefixtype='size_t'
19384 : How can we generate normalized random numbers ?
19386 echo "Using our internal random number implementation..." >&4
19389 *-Dmy_rand=*|*-Dmy_srand=*)
19390 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19391 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19392 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19393 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19397 randfunc=Perl_drand48
19398 drand01="Perl_drand48()"
19399 seedfunc="Perl_drand48_init"
19403 : Check how to flush
19406 Checking how to flush all pending stdio output...
19408 # I only know how to find the first 32 possibly open files on SunOS.
19409 # See also hints/sunos_4_1.sh and util.c --AD
19411 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19413 $cat >>try.c <<EOCP
19415 #$i_stdlib I_STDLIB
19417 #include <stdlib.h>
19419 #$i_unistd I_UNISTD
19421 # include <unistd.h>
19423 #$d_sysconf HAS_SYSCONF
19424 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19425 #ifdef HAS_STDIO_STREAM_ARRAY
19426 # define STDIO_STREAM_ARRAY $stdio_stream_array
19431 p = fopen("try.out", "w");
19435 # ifdef TRY_FPRINTF
19439 #ifdef TRY_FFLUSH_NULL
19442 #ifdef TRY_FFLUSH_ALL
19444 long open_max = -1;
19445 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19446 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19448 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19449 open_max = sysconf(_SC_OPEN_MAX);
19452 open_max = FOPEN_MAX;
19455 open_max = OPEN_MAX;
19464 # ifdef HAS_STDIO_STREAM_ARRAY
19465 if (open_max > 0) {
19467 for (i = 0; i < open_max; i++)
19468 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19469 STDIO_STREAM_ARRAY[i]._file < open_max &&
19470 STDIO_STREAM_ARRAY[i]._flag)
19471 fflush(&STDIO_STREAM_ARRAY[i]);
19479 : first we have to find out how _not_ to flush
19481 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19483 set try -DTRY_FPUTC
19484 if eval $compile; then
19485 $run ./try 2>/dev/null
19488 if $test ! -s try.out -a "X$code" = X42; then
19494 set try -DTRY_FPRINTF
19495 if eval $compile; then
19496 $run ./try 2>/dev/null
19499 if $test ! -s try.out -a "X$code" = X42; then
19500 output=-DTRY_FPRINTF
19506 : check for fflush NULL behavior
19507 case "$fflushNULL" in
19508 '') set try -DTRY_FFLUSH_NULL $output
19509 if eval $compile; then
19510 $run ./try 2>/dev/null
19513 if $test -s try.out -a "X$code" = X42; then
19514 fflushNULL="`$cat try.out`"
19516 if $test "X$code" != X42; then
19518 (If this test failed, don't worry, we'll try another method shortly.)
19523 $rm -f core try.core core.try.*
19524 case "$fflushNULL" in
19526 Your fflush(NULL) works okay for output streams.
19527 Let's see if it clobbers input pipes...
19529 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19530 # bug that improperly flushes the input end of pipes. So we avoid the
19531 # autoflush on fork/system/exec support for now. :-(
19532 $cat >tryp.c <<EOCP
19535 main(int argc, char **argv)
19541 while ((i = getc(stdin)) != -1
19542 && (*bp++ = i) != '\n'
19543 && bp < &buf[1024])
19546 fprintf(stdout, "%s", buf);
19554 fflushNULL="$define"
19556 if eval $compile; then
19558 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19559 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19561 fflush(NULL) seems to behave okay with input streams.
19563 fflushNULL="$define"
19566 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19568 fflushNULL="$undef"
19571 $rm -f core tryp.c tryp.core core.tryp.*
19574 Your fflush(NULL) isn't working (contrary to ANSI C).
19576 fflushNULL="$undef"
19579 Cannot figure out whether your fflush(NULL) works or not.
19580 I'm assuming it doesn't (contrary to ANSI C).
19582 fflushNULL="$undef"
19586 $define|true|[yY]*)
19587 fflushNULL="$define"
19590 fflushNULL="$undef"
19593 : check explicit looping only if NULL did not work, and if the pipe
19594 : bug does not show up on an explicit flush too
19595 case "$fflushNULL" in
19597 $cat >tryp.c <<EOCP
19600 main(int argc, char **argv)
19606 while ((i = getc(stdin)) != -1
19607 && (*bp++ = i) != '\n'
19608 && bp < &buf[1024])
19611 fprintf(stdout, "%s", buf);
19620 if eval $compile; then
19622 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19623 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19625 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19627 : now check for fflushall behaviour
19628 case "$fflushall" in
19629 '') set try -DTRY_FFLUSH_ALL $output
19630 if eval $compile; then
19632 (Now testing the other method--but note that this also may fail.)
19634 $run ./try 2>/dev/null
19637 if $test -s try.out -a "X$code" = X42; then
19638 fflushall="`$cat try.out`"
19642 case "$fflushall" in
19644 Whew. Flushing explicitly all the stdio streams works.
19646 fflushall="$define"
19649 Sigh. Flushing explicitly all the stdio streams doesn't work.
19654 Cannot figure out whether flushing stdio streams explicitly works or not.
19655 I'm assuming it doesn't.
19661 "$define"|true|[yY]*)
19662 fflushall="$define"
19670 All is futile. Even fflush(stdin) clobbers input pipes!
19677 $rm -f core tryp.c tryp.core core.tryp.*
19679 *) fflushall="$undef"
19683 case "$fflushNULL$fflushall" in
19686 OK, I give up. I cannot figure out how to flush pending stdio output.
19687 We won't be flushing handles at all before fork/exec/popen.
19693 : Store the full pathname to the ar program for use in the C program
19694 : Respect a hint or command line value for full_ar.
19699 : Store the full pathname to the sed program for use in the C program
19702 : see what type gids are declared as in the kernel
19704 echo "Looking for the type for group ids returned by getgid()."
19705 set gid_t gidtype xxx stdio.h sys/types.h
19709 xxx=`./findhdr sys/user.h`
19710 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19712 unsigned) dflt="$1 $2" ;;
19716 *) dflt="$gidtype";;
19719 gid_t) echo "gid_t found." ;;
19720 *) rp="What is the type for group ids returned by getgid()?"
19726 : Check the size of GID
19729 *_t) zzz="$gidtype" ;;
19732 echo "Checking the size of $zzz..." >&4
19734 #include <sys/types.h>
19736 #$i_stdlib I_STDLIB
19738 #include <stdlib.h>
19741 printf("%d\n", (int)sizeof($gidtype));
19746 if eval $compile_ok; then
19750 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19753 echo "Your $zzz is $gidsize bytes long."
19758 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19762 : Check if GID is signed
19765 *_t) zzz="$gidtype" ;;
19768 echo "Checking the sign of $zzz..." >&4
19770 #include <sys/types.h>
19781 if eval $compile; then
19785 echo "(I can't execute the test program--guessing unsigned.)" >&4
19789 1) echo "Your $zzz is unsigned." ;;
19790 -1) echo "Your $zzz is signed." ;;
19796 echo "(I can't compile the test program--guessing unsigned.)" >&4
19800 : Check 64bit sizes
19803 if $test X"$quadtype" != X; then
19805 echo "Checking how to print 64-bit integers..." >&4
19807 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19808 $cat >try.c <<'EOCP'
19809 #include <sys/types.h>
19812 int q = 12345678901;
19813 printf("%ld\n", q);
19817 if eval $compile; then
19821 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19822 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19823 echo "We will use %d."
19829 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19830 $cat >try.c <<'EOCP'
19831 #include <sys/types.h>
19834 long q = 12345678901;
19835 printf("%ld\n", q);
19839 if eval $compile; then
19843 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19844 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19845 echo "We will use %ld."
19851 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19852 $cat >try.c <<'EOCP'
19853 #include <sys/types.h>
19854 #include <inttypes.h>
19857 int64_t q = 12345678901;
19858 printf("%" PRId64 "\n", q);
19862 if eval $compile; then
19866 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19867 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19868 echo "We will use the C9X style."
19874 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19876 #include <sys/types.h>
19879 $quadtype q = 12345678901;
19880 printf("%Ld\n", q);
19884 if eval $compile; then
19888 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19889 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19890 echo "We will use %Ld."
19896 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19897 $cat >try.c <<'EOCP'
19898 #include <sys/types.h>
19901 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19902 printf("%lld\n", q);
19906 if eval $compile; then
19910 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19911 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19912 echo "We will use the %lld style."
19918 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19920 #include <sys/types.h>
19923 $quadtype q = 12345678901;
19924 printf("%qd\n", q);
19928 if eval $compile; then
19932 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19933 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19934 echo "We will use %qd."
19940 if $test X"$sPRId64" = X; then
19941 echo "Cannot figure out how to print 64-bit integers." >&4
19948 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19949 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19951 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19952 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19956 : Check format strings for internal types
19958 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19960 if $test X"$ivsize" = X8; then
19961 ivdformat="$sPRId64"
19962 uvuformat="$sPRIu64"
19963 uvoformat="$sPRIo64"
19964 uvxformat="$sPRIx64"
19965 uvXUformat="$sPRIXU64"
19967 if $test X"$ivsize" = X"$longsize"; then
19974 if $test X"$ivsize" = X"$intsize"; then
19982 if $test X"$ivsize" = X"$shortsize"; then
19993 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19994 nveformat="$sPRIeldbl"
19995 nvfformat="$sPRIfldbl"
19996 nvgformat="$sPRIgldbl"
19997 nvEUformat="$sPRIEUldbl"
19998 nvFUformat="$sPRIFUldbl"
19999 nvGUformat="$sPRIGUldbl"
20009 case "$ivdformat" in
20010 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
20015 : Check format string for GID
20018 $echo "Checking the format string to be used for gids..." >&4
20021 -1) if $test X"$gidsize" = X"$ivsize"; then
20022 gidformat="$ivdformat"
20024 if $test X"$gidsize" = X"$longsize"; then
20027 if $test X"$gidsize" = X"$intsize"; then
20030 if $test X"$gidsize" = X"$shortsize"; then
20037 *) if $test X"$gidsize" = X"$uvsize"; then
20038 gidformat="$uvuformat"
20040 if $test X"$gidsize" = X"$longsize"; then
20043 if $test X"$gidsize" = X"$intsize"; then
20046 if $test X"$gidsize" = X"$shortsize"; then
20055 : see if getgroups exists
20056 set getgroups d_getgrps
20059 : see if setgroups exists
20060 set setgroups d_setgrps
20063 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
20065 case "$d_getgrps$d_setgrps" in
20067 case "$groupstype" in
20068 '') dflt="$gidtype" ;;
20069 *) dflt="$groupstype" ;;
20072 What type of pointer is the second argument to getgroups() and setgroups()?
20073 Usually this is the same as group ids, $gidtype, but not always.
20076 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20080 *) groupstype="$gidtype";;
20083 : MAD = Misc Attribute Definition
20085 if $test $patchlevel -lt 9; then
20086 : MAD is not available in 5.8.x or earlier.
20090 $define|true|[yY]*) dflt='y' ;;
20095 Would you like to build with Misc Attribute Decoration? This is development
20096 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
20097 overhead on the interpreter.
20099 If this doesn't make any sense to you, just accept the default '$dflt'.
20101 rp='Build Perl with MAD?'
20106 madlyh='madly.h madly.act madly.tab'
20108 madlyobj="madly$_o" ;;
20117 : check whether make sets MAKE
20119 echo "Checking if your $make program sets \$(MAKE)..." >&4
20120 case "$make_set_make" in
20122 $sed 's/^X //' > testmake.mak << 'EOF'
20124 X @echo 'maketemp="$(MAKE)"'
20126 case "`$make -f testmake.mak 2>/dev/null`" in
20127 *maketemp=*) make_set_make='#' ;;
20128 *) make_set_make="MAKE=$make" ;;
20130 $rm -f testmake.mak
20133 case "$make_set_make" in
20134 '#') echo "Yup, it does.";;
20135 *) echo "Nope, it doesn't.";;
20138 : see what type is used for mode_t
20139 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20140 set mode_t modetype int stdio.h sys/types.h
20143 : see if we need va_copy
20145 case "$i_stdarg" in
20148 #include <stdarg.h>
20150 #$i_stdlib I_STDLIB
20152 #include <stdlib.h>
20154 #include <signal.h>
20157 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20159 return vfprintf(f, fmt, *valp);
20163 myvfprintf(FILE *f, const char *fmt, va_list val)
20165 return ivfprintf(f, fmt, &val);
20169 myprintf(char *fmt, ...)
20172 va_start(val, fmt);
20173 return myvfprintf(stdout, fmt, val);
20177 main(int ac, char **av)
20179 signal(SIGSEGV, exit);
20181 myprintf("%s%cs all right, then\n", "that", '\'');
20186 if eval $compile && $run ./try 2>&1 >/dev/null; then
20187 case "`$run ./try`" in
20188 "that's all right, then")
20194 yes) echo "It seems that you don't need va_copy()." >&4
20195 need_va_copy="$undef"
20197 *) echo "It seems that va_copy() or similar will be needed." >&4
20198 need_va_copy="$define"
20203 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20204 need_va_copy="$undef"
20208 : see what type is used for size_t
20209 rp="What is the type used for the length parameter for string functions?"
20210 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20213 : check for type of arguments to gethostbyaddr.
20214 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20215 case "$d_gethbyaddr" in
20219 Checking to see what type of arguments are accepted by gethostbyaddr().
20221 hdrs="$define sys/types.h
20222 $d_socket sys/socket.h
20223 $i_niin netinet/in.h
20225 $i_unistd unistd.h"
20226 : The first arg can 'char *' or 'void *'
20227 : The second arg is some of integral type
20228 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20229 for yyy in size_t long int; do
20230 case "$netdb_host_type" in
20231 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20232 if ./protochk "$try" $hdrs; then
20233 echo "Your system accepts $xxx for the first arg."
20234 echo "...and $yyy for the second arg."
20235 netdb_host_type="$xxx"
20236 netdb_hlen_type="$yyy"
20242 : In case none of those worked, prompt the user.
20243 case "$netdb_host_type" in
20244 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20247 netdb_host_type=$ans
20248 rp='What is the type for the 2nd argument to gethostbyaddr?'
20251 netdb_hlen_type=$ans
20255 *) : no gethostbyaddr, so pick harmless defaults
20256 netdb_host_type='char *'
20257 netdb_hlen_type="$sizetype"
20260 # Remove the "const" if needed. -- but then we'll have a
20262 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20265 : check for type of argument to gethostbyname.
20266 if test "X$netdb_name_type" = X ; then
20267 case "$d_gethbyname" in
20271 Checking to see what type of argument is accepted by gethostbyname().
20273 hdrs="$define sys/types.h
20274 $d_socket sys/socket.h
20275 $i_niin netinet/in.h
20277 $i_unistd unistd.h"
20278 for xxx in "const char *" "char *"; do
20279 case "$netdb_name_type" in
20280 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20281 if ./protochk "$try" $hdrs; then
20282 echo "Your system accepts $xxx."
20283 netdb_name_type="$xxx"
20288 : In case none of those worked, prompt the user.
20289 case "$netdb_name_type" in
20290 '') rp='What is the type for the 1st argument to gethostbyname?'
20293 netdb_name_type=$ans
20297 *) : no gethostbyname, so pick harmless default
20298 netdb_name_type='char *'
20303 : check for type of 1st argument to getnetbyaddr.
20304 if test "X$netdb_net_type" = X ; then
20305 case "$d_getnbyaddr" in
20309 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20311 hdrs="$define sys/types.h
20312 $d_socket sys/socket.h
20313 $i_niin netinet/in.h
20315 $i_unistd unistd.h"
20316 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20317 case "$netdb_net_type" in
20318 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20319 if ./protochk "$try" $hdrs; then
20320 echo "Your system accepts $xxx."
20321 netdb_net_type="$xxx"
20326 : In case none of those worked, prompt the user.
20327 case "$netdb_net_type" in
20328 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20331 netdb_net_type=$ans
20335 *) : no getnetbyaddr, so pick harmless default
20336 netdb_net_type='long'
20340 : locate the preferred pager for this system
20347 [a-zA-Z]:/*) dflt=$pg;;
20351 [a-zA-Z]:/*) dflt=$more;;
20355 [a-zA-Z]:/*) dflt=$less;;
20358 '') dflt=/usr/ucb/more;;
20366 rp='What pager is used on your system?'
20370 : see what type pids are declared as in the kernel
20371 rp="What is the type of process ids on this system?"
20372 set pid_t pidtype int stdio.h sys/types.h
20375 : see if ar generates random libraries by itself
20377 echo "Checking how to generate random libraries on your machine..." >&4
20378 echo 'int bar1() { return bar2(); }' > bar1.c
20379 echo 'int bar2() { return 2; }' > bar2.c
20381 #$i_stdlib I_STDLIB
20383 #include <stdlib.h>
20385 int main() { printf("%d\n", bar1()); exit(0); }
20387 $cc $ccflags -c bar1.c >/dev/null 2>&1
20388 $cc $ccflags -c bar2.c >/dev/null 2>&1
20389 $cc $ccflags -c foo.c >/dev/null 2>&1
20390 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20391 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20392 $run ./foobar >/dev/null 2>&1; then
20393 echo "$ar appears to generate random libraries itself."
20395 if [ "X$ranlib" = "X" ]; then
20398 elif $ar s bar$_a >/dev/null 2>&1 &&
20399 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20400 $run ./foobar >/dev/null 2>&1; then
20401 echo "a table of contents needs to be added with '$ar s'."
20404 elif $ar ts bar$_a >/dev/null 2>&1 &&
20405 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20406 $run ./foobar >/dev/null 2>&1; then
20407 echo "a table of contents needs to be added with '$ar ts'."
20414 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20415 $test -f $ranlib || ranlib=''
20418 if $test -n "$ranlib"; then
20419 echo "your system has '$ranlib'; we'll use that."
20422 echo "your system doesn't seem to support random libraries"
20423 echo "so we'll use lorder and tsort to order the libraries."
20430 : see if this is a values.h system
20431 set values.h i_values
20434 : Check the max offset that gmtime and localtime accept
20435 echo "Checking max offsets that gmtime () accepts"
20438 define) yyy="#include <values.h>" ;;
20442 case "$sGMTIME_min/$sGMTIME_max" in
20445 #include <sys/types.h>
20454 void gm_check (time_t t, int min_year, int max_year)
20457 if ( tmp == NULL ||
20458 /* Check tm_year overflow */
20459 tmp->tm_year < min_year || tmp->tm_year > max_year)
20470 gm_check (MAXLONG, 69, 0x7fffffff);
20472 if (tmp == NULL || tmp->tm_year < 0) {
20473 for (i = 63; i >= 0; i--) {
20474 time_t x = pt | ((time_t)1 << i);
20475 if (x < 0 || x < pt) continue;
20476 gm_check (x, 69, 0x7fffffff);
20479 printf ("sGMTIME_max=%ld\n", pt);
20488 gm_check (MINLONG, -1900, 70);
20491 for (i = 36; i >= 0; i--) {
20492 time_t x = pt - ((time_t)1 << i);
20493 if (x > 0) continue;
20494 gm_check (x, -1900, 70);
20497 printf ("sGMTIME_min=%ld\n", pt);
20501 int main (int argc, char *argv[])
20503 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20510 if eval $compile; then
20513 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20519 echo "Checking max offsets that localtime () accepts"
20521 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20524 #include <sys/types.h>
20533 void local_check (time_t t, int min_year, int max_year)
20535 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20538 tmp = localtime (&t);
20539 if ( tmp == NULL ||
20540 /* Check tm_year overflow */
20541 tmp->tm_year < min_year || tmp->tm_year > max_year)
20545 } /* local_check */
20552 local_check (MAXLONG, 69, 0x7fffffff);
20554 if (tmp == NULL || tmp->tm_year < 0) {
20555 for (i = 63; i >= 0; i--) {
20556 time_t x = pt | ((time_t)1 << i);
20557 if (x < 0 || x < pt) continue;
20558 local_check (x, 69, 0x7fffffff);
20561 printf ("sLOCALTIME_max=%ld\n", pt);
20570 local_check (MINLONG, -1900, 70);
20573 for (i = 36; i >= 0; i--) {
20574 time_t x = pt - ((time_t)1 << i);
20575 if (x > 0) continue;
20576 local_check (x, -1900, 70);
20579 printf ("sLOCALTIME_min=%ld\n", pt);
20583 int main (int argc, char *argv[])
20591 if eval $compile; then
20594 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20600 : check for type of arguments to select.
20601 case "$selecttype" in
20602 '') case "$d_select" in
20606 Checking to see what type of arguments are accepted by select().
20608 hdrs="$define sys/types.h
20609 $i_systime sys/time.h
20610 $i_sysselct sys/select.h
20611 $d_socket sys/socket.h"
20612 : The first arg can be int, unsigned, or size_t
20613 : The last arg may or may not be 'const'
20615 : void pointer has been seen but using that
20616 : breaks the selectminbits test
20617 for xxx in 'fd_set *' 'int *'; do
20618 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20619 for tmo in 'struct timeval *' 'const struct timeval *'; do
20621 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20622 if ./protochk "$try" $hdrs; then
20623 echo "Your system accepts $xxx."
20632 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20633 case "$d_fd_set" in
20634 $define) dflt="fd_set *" ;;
20643 *) : no select, so pick a harmless default
20650 : check for the select 'width'
20651 case "$selectminbits" in
20652 '') safebits=`expr $ptrsize \* 8`
20653 case "$d_select" in
20657 Checking to see on how many bits at a time your select() operates...
20660 #include <sys/types.h>
20662 #$i_systime I_SYS_TIME
20663 #$i_systimek I_SYS_TIME_KERNEL
20668 # ifdef I_SYS_TIME_KERNEL
20671 # include <sys/time.h>
20672 # ifdef I_SYS_TIME_KERNEL
20676 #$i_sysselct I_SYS_SELECT
20677 #ifdef I_SYS_SELECT
20678 #include <sys/select.h>
20680 #$d_socket HAS_SOCKET
20682 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20685 #$i_stdlib I_STDLIB
20687 #include <stdlib.h>
20690 #define S sizeof(*(b))
20692 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20693 #define NBITS (NBYTES * 8)
20695 char *s = (char *)malloc(NBYTES);
20704 fp = fopen("try.c", "r");
20710 b = ($selecttype)s;
20711 for (i = 0; i < NBITS; i++)
20715 select(fd + 1, b, 0, 0, &t);
20716 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20718 printf("%d\n", i + 1);
20723 if eval $compile_ok; then
20724 selectminbits=`$run ./try`
20725 case "$selectminbits" in
20727 Cannot figure out on how many bits at a time your select() operates.
20728 I'll play safe and guess it is $safebits bits.
20730 selectminbits=$safebits
20731 bits="$safebits bits"
20734 *) bits="$selectminbits bits" ;;
20736 echo "Your select() operates on $bits at a time." >&4
20738 rp='What is the minimum number of bits your select() operates on?'
20739 case "$byteorder" in
20740 12345678) dflt=64 ;;
20746 selectminbits="$val"
20750 *) : no select, so pick a harmless default
20751 selectminbits=$safebits
20757 : Trace out the files included by signal.h, then look for SIGxxx names.
20758 if [ "X$fieldn" = X ]; then
20759 : Just make some guesses. We check them later.
20760 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20762 xxx=`echo '#include <signal.h>' |
20763 $cppstdin $cppminus $cppflags 2>/dev/null |
20764 $grep '^[ ]*#.*include' |
20765 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20766 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20769 for xx in $xxx /dev/null ; do
20770 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20772 case "$xxxfiles" in
20773 '') xxxfiles=`./findhdr signal.h` ;;
20776 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20777 print substr($2, 4, 20)
20779 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20780 print substr($3, 4, 20)
20782 : Append some common names just in case the awk scan failed.
20783 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20784 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20785 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20786 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20787 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20789 : generate a few handy files for later
20790 $cat > signal.c <<EOCP
20791 #include <sys/types.h>
20792 #include <signal.h>
20793 #$i_stdlib I_STDLIB
20795 #include <stdlib.h>
20800 /* Strange style to avoid deeply-nested #if/#else/#endif */
20803 # define NSIG (_NSIG)
20809 # define NSIG (SIGMAX+1)
20815 # define NSIG (SIG_MAX+1)
20821 # define NSIG (_SIG_MAX+1)
20827 # define NSIG (MAXSIG+1)
20833 # define NSIG (MAX_SIG+1)
20838 # ifdef SIGARRAYSIZE
20839 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20845 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20849 /* Default to some arbitrary number that's big enough to get most
20850 of the common signals.
20856 printf("NSIG %d\n", NSIG);
20862 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20864 printf "#ifdef SIG"; printf $1; printf "\n"
20865 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20866 printf $1; printf ");\n"
20870 printf "#endif /* JUST_NSIG */\n";
20871 printf "exit(0);\n}\n";
20874 $cat >signal.awk <<'EOP'
20875 BEGIN { ndups = 0 }
20876 $1 ~ /^NSIG$/ { nsig = $2 }
20877 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20878 if ($2 > maxsig) { maxsig = $2 }
20879 if (sig_name[$2]) {
20880 dup_name[ndups] = $1
20881 dup_num[ndups] = $2
20893 printf("NSIG %d\n", nsig);
20894 for (n = 1; n < nsig; n++) {
20896 printf("%s %d\n", sig_name[n], sig_num[n])
20899 printf("NUM%d %d\n", n, n)
20902 for (n = 0; n < ndups; n++) {
20903 printf("%s %d\n", dup_name[n], dup_num[n])
20907 $cat >signal_cmd <<EOS
20909 if $test -s signal.lst; then
20910 echo "Using your existing signal.lst file"
20915 $cat >>signal_cmd <<'EOS'
20918 if eval $compile_ok; then
20919 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20920 $uniq | $awk -f signal.awk >signal.lst
20922 echo "(I can't seem be able to compile the whole test program)" >&4
20923 echo "(I'll try it in little pieces.)" >&4
20924 set signal -DJUST_NSIG
20925 if eval $compile_ok; then
20926 $run ./signal$_exe > signal.nsg
20929 echo "I can't seem to figure out how many signals you have." >&4
20930 echo "Guessing 50." >&4
20931 echo 'NSIG 50' > signal.nsg
20933 : Now look at all the signal names, one at a time.
20934 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20935 $cat > signal.c <<EOCP
20936 #include <sys/types.h>
20937 #include <signal.h>
20940 printf("$xx %d\n", SIG${xx});
20945 if eval $compile; then
20946 echo "SIG${xx} found."
20947 $run ./signal$_exe >> signal.ls1
20949 echo "SIG${xx} NOT found."
20952 if $test -s signal.ls1; then
20953 $cat signal.nsg signal.ls1 |
20954 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20958 if $test -s signal.lst; then
20961 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20962 echo 'kill -l' >signal
20963 set X `csh -f <signal`
20967 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20969 echo $@ | $tr ' ' $trnl | \
20970 $awk '{ printf "%s %d\n", $1, ++s; }
20971 END { printf "NSIG %d\n", ++s }' >signal.lst
20973 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20975 chmod a+x signal_cmd
20976 $eunicefix signal_cmd
20978 : generate list of signal names
20980 case "$sig_name_init" in
20982 *) case "$sig_num_init" in
20983 ''|*,*) doinit=yes ;;
20988 echo "Generating a list of signal names and numbers..." >&4
20990 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20991 sig_name=`$awk 'BEGIN { printf "ZERO " }
20992 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20993 sig_num=`$awk 'BEGIN { printf "0 " }
20994 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20995 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20996 !/^NSIG/ { printf "\"%s\", ", $1 }
20997 END { printf "0\n" }' signal.lst`
20998 sig_num_init=`$awk 'BEGIN { printf "0, " }
20999 !/^NSIG/ { printf "%d, ", $2}
21000 END { printf "0\n"}' signal.lst`
21003 echo "The following $sig_count signals are available:"
21005 echo $sig_name | $awk \
21006 'BEGIN { linelen = 0 }
21008 for (i = 1; i <= NF; i++) {
21009 name = "SIG" $i " "
21010 linelen = linelen + length(name)
21011 if (linelen > 70) {
21013 linelen = length(name)
21019 sig_size=`echo $sig_name | awk '{print NF}'`
21020 $rm -f signal signal.c signal.awk signal.lst signal_cmd
21022 : Check size of size
21024 case "$sizetype" in
21025 *_t) zzz="$sizetype" ;;
21026 *) zzz="filesize" ;;
21028 echo "Checking the size of $zzz..." >&4
21030 #include <sys/types.h>
21032 #$i_stdlib I_STDLIB
21034 #include <stdlib.h>
21037 printf("%d\n", (int)sizeof($sizetype));
21042 if eval $compile_ok; then
21046 echo "(I can't execute the test program--guessing $sizesize.)" >&4
21049 echo "Your $zzz size is $sizesize bytes."
21054 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21058 : check for socklen_t
21060 echo "Checking to see if you have socklen_t..." >&4
21062 #include <sys/types.h>
21063 #$d_socket HAS_SOCKET
21065 #include <sys/socket.h>
21067 int main() { socklen_t x = 16; }
21070 if eval $compile; then
21072 echo "You have socklen_t."
21075 echo "You do not have socklen_t."
21076 case "$sizetype" in
21077 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21084 : see if this is a socks.h system
21085 set socks.h i_socks
21088 : check for type of the size argument to socket calls
21089 case "$d_socket" in
21093 Checking to see what type is the last argument of accept().
21096 case "$d_socklen_t" in
21097 "$define") yyy="$yyy socklen_t"
21099 yyy="$yyy $sizetype int long unsigned"
21100 for xxx in $yyy; do
21101 case "$socksizetype" in
21102 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21103 case "$usesocks" in
21105 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21106 echo "Your system accepts '$xxx *' for the last argument of accept()."
21107 socksizetype="$xxx"
21110 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21111 echo "Your system accepts '$xxx *' for the last argument of accept()."
21112 socksizetype="$xxx"
21119 : In case none of those worked, prompt the user.
21120 case "$socksizetype" in
21121 '') rp='What is the type for socket address structure sizes?'
21128 *) : no sockets, so pick relatively harmless default
21133 : see what type is used for signed size_t
21134 set ssize_t ssizetype int stdio.h sys/types.h
21139 #$i_stdlib I_STDLIB
21141 #include <stdlib.h>
21143 #include <sys/types.h>
21144 #define Size_t $sizetype
21145 #define SSize_t $dflt
21148 if (sizeof(Size_t) == sizeof(SSize_t))
21150 else if (sizeof(Size_t) == sizeof(int))
21159 if eval $compile_ok && $run ./try > /dev/null; then
21160 ssizetype=`$run ./try`
21161 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21164 Help! I can't compile and run the ssize_t test program: please enlighten me!
21165 (This is probably a misconfiguration in your system or libraries, and
21166 you really ought to fix it. Still, I'll try anyway.)
21168 I need a type that is the same size as $sizetype, but is guaranteed to
21169 be signed. Common values are ssize_t, int and long.
21172 rp="What signed type is the same size as $sizetype?"
21178 : Check the size of st_ino
21180 $echo "Checking the size of st_ino..." >&4
21181 $cat > try.c <<EOCP
21182 #include <sys/stat.h>
21184 #$i_stdlib I_STDLIB
21186 #include <stdlib.h>
21190 printf("%d\n", (int)sizeof(st.st_ino));
21195 if eval $compile_ok; then
21199 $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
21201 *) st_ino_size=$val
21202 $echo "Your st_ino is $st_ino_size bytes long."
21207 $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
21211 : Check if st_ino is signed
21213 $echo "Checking the sign of st_ino..." >&4
21214 $cat > try.c <<EOCP
21215 #include <sys/stat.h>
21220 if (foo.st_ino < 0)
21227 if eval $compile; then
21231 $echo "(I can't execute the test program--guessing unsigned.)" >&4
21233 *) st_ino_sign=$val
21234 case "$st_ino_sign" in
21235 1) $echo "Your st_ino is unsigned." ;;
21236 -1) $echo "Your st_ino is signed." ;;
21242 $echo "(I can't compile the test program--guessing unsigned.)" >&4
21246 : see what type of char stdio uses.
21248 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21249 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21250 echo "Your stdio uses unsigned chars." >&4
21251 stdchar="unsigned char"
21253 echo "Your stdio uses signed chars." >&4
21258 : see what type uids are declared as in the kernel
21260 echo "Looking for the type for user ids returned by getuid()."
21261 set uid_t uidtype xxx stdio.h sys/types.h
21265 xxx=`./findhdr sys/user.h`
21266 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21268 unsigned) dflt="$1 $2" ;;
21272 *) dflt="$uidtype";;
21275 uid_t) echo "uid_t found." ;;
21276 *) rp="What is the type for user ids returned by getuid()?"
21282 : Check size of UID
21285 *_t) zzz="$uidtype" ;;
21288 echo "Checking the size of $zzz..." >&4
21290 #include <sys/types.h>
21292 #$i_stdlib I_STDLIB
21294 #include <stdlib.h>
21297 printf("%d\n", (int)sizeof($uidtype));
21302 if eval $compile_ok; then
21306 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21309 echo "Your $zzz is $uidsize bytes long."
21314 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21317 : Check if UID is signed
21320 *_t) zzz="$uidtype" ;;
21323 echo "Checking the sign of $zzz..." >&4
21325 #include <sys/types.h>
21336 if eval $compile; then
21340 echo "(I can't execute the test program--guessing unsigned.)" >&4
21344 1) echo "Your $zzz is unsigned." ;;
21345 -1) echo "Your $zzz is signed." ;;
21351 echo "(I can't compile the test program--guessing unsigned.)" >&4
21355 : Check format string for UID
21357 $echo "Checking the format string to be used for uids..." >&4
21360 -1) if $test X"$uidsize" = X"$ivsize"; then
21361 uidformat="$ivdformat"
21363 if $test X"$uidsize" = X"$longsize"; then
21366 if $test X"$uidsize" = X"$intsize"; then
21369 if $test X"$uidsize" = X"$shortsize"; then
21376 *) if $test X"$uidsize" = X"$uvsize"; then
21377 uidformat="$uvuformat"
21379 if $test X"$uidsize" = X"$longsize"; then
21382 if $test X"$uidsize" = X"$intsize"; then
21385 if $test X"$uidsize" = X"$shortsize"; then
21394 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
21396 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
21397 $cat >try.c <<'EOM'
21398 /* Intentionally a long probe as I'd like to sanity check that the exact
21399 approach is going to work, as thinking it will work, but only having it
21400 part working at runtime is worse than not having it. */
21402 #include <sys/types.h>
21403 #include <sys/sysctl.h>
21404 #include <sys/param.h>
21406 #include <string.h>
21407 #include <stdlib.h>
21408 #include <unistd.h>
21411 main(int argc, char **argv) {
21413 char *argv_leaf = strrchr(argv[0], '/');
21419 mib[1] = KERN_PROC;
21420 mib[2] = KERN_PROC_PATHNAME;
21424 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21428 if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
21433 if (size < strlen(argv_leaf) + 1) {
21434 fprintf(stderr, "size %lu is too short for a path\n",
21435 (unsigned long) size);
21439 if (size > MAXPATHLEN * MAXPATHLEN) {
21440 fprintf(stderr, "size %lu is too long for a path\n",
21441 (unsigned long) size);
21445 buffer = malloc(size);
21451 if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
21456 if (strlen(buffer) + 1 != size) {
21457 fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
21458 (unsigned long)size, (unsigned long)strlen(buffer) + 1);
21463 if (*buffer != '/') {
21464 fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
21468 if (strstr(buffer, "/./")) {
21469 fprintf(stderr, "Contains /./: '%s'\n", buffer);
21473 if (strstr(buffer, "/../")) {
21474 fprintf(stderr, "Contains /../: '%s'\n", buffer);
21478 buffer_leaf = strrchr(buffer, '/');
21479 if (strcmp(buffer_leaf, argv_leaf) != 0) {
21480 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
21492 if eval $compile; then
21493 if $run ./try; then
21494 echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
21497 echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
21501 echo "I'm unable to compile the test program." >&4
21502 echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
21506 set usekernprocpathname
21509 : Determine if we can use _NSGetExecutablePath to find executing program
21511 echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
21512 $cat >try.c <<'EOM'
21513 /* Intentionally a long probe as I'd like to sanity check that the exact
21514 approach is going to work, as thinking it will work, but only having it
21515 part working at runtime is worse than not having it. */
21516 #include <mach-o/dyld.h>
21518 #include <stdlib.h>
21519 #include <sys/param.h>
21520 #include <string.h>
21523 main(int argc, char **argv) {
21525 uint32_t size = sizeof(buf);
21529 char *argv_leaf = strrchr(argv[0], '/');
21533 fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
21537 _NSGetExecutablePath(buf, &size);
21538 if (size > MAXPATHLEN * MAXPATHLEN) {
21539 fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
21540 (unsigned int) size);
21544 buffer = malloc(size);
21550 result = _NSGetExecutablePath(buffer, &size);
21552 fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
21553 result, (unsigned int) size);
21557 tidied = realpath(buffer, NULL);
21559 perror("realpath");
21565 if (*tidied != '/') {
21566 fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
21570 if (strstr(tidied, "/./")) {
21571 fprintf(stderr, "Contains /./: '%s'\n", tidied);
21575 if (strstr(tidied, "/../")) {
21576 fprintf(stderr, "Contains /../: '%s'\n", tidied);
21580 tidied_leaf = strrchr(tidied, '/');
21581 if (strcmp(tidied_leaf, argv_leaf) != 0) {
21582 fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
21594 if eval $compile; then
21595 if $run ./try; then
21596 echo "You can use _NSGetExecutablePath to find the executing program." >&4
21599 echo "Nope, _NSGetExecutablePath doesn't work here." >&4
21602 echo "I'm unable to compile the test program." >&4
21603 echo "I'll assume no _NSGetExecutablePath here." >&4
21606 set usensgetexecutablepath
21609 : Check if site customization support was requested
21610 case "$usesitecustomize" in
21611 $define|true|[Yy]*)
21612 usesitecustomize="$define"
21615 usesitecustomize="$undef"
21619 : see if prototypes support variable argument declarations
21621 case "$prototype$i_stdarg" in
21623 echo "It appears we'll be able to prototype varargs functions." >&4
21627 echo "Too bad... We won't be using prototyped varargs functions..." >&4
21634 : determine compiler compiler
21643 if $test -f "$byacc$_exe"; then
21645 comp="byacc or $comp"
21647 if $test -f "$bison$_exe"; then
21648 comp="$comp or bison -y"
21650 rp="Which compiler compiler ($comp) shall I use?"
21659 echo "(Adding -y option to bison to get yacc-compatible behavior.)"
21665 : see if this is a assert.h system
21666 set assert.h i_assert
21669 : see if this is a fp.h system
21673 : see if this is a fp_class.h system
21674 set fp_class.h i_fp_class
21677 : see if gdbm.h is available
21682 : see if gdbm_open exists
21683 set gdbm_open d_gdbm_open
21685 case "$d_gdbm_open" in
21688 echo "We won't be including <gdbm.h>"
21697 : see if this is a ieeefp.h system
21698 case "$i_ieeefp" in
21699 '' ) set ieeefp.h i_ieeefp
21704 : see if this is a libutil.h system
21705 set libutil.h i_libutil
21708 : see if mach cthreads are available
21709 if test "X$usethreads" = "X$define"; then
21710 set mach/cthreads.h i_machcthr
21713 i_machcthr="$undef"
21716 : see if this is a mntent.h system
21717 set mntent.h i_mntent
21720 : see if net/errno.h is available
21722 set net/errno.h val
21725 : Unfortunately, it causes problems on some systems. Arrgh.
21728 cat > try.c <<'EOM'
21731 #include <net/errno.h>
21737 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21738 echo "We'll be including <net/errno.h>." >&4
21740 echo "We won't be including <net/errno.h>." >&4
21749 : see if netinet/tcp.h is available
21750 set netinet/tcp.h i_netinettcp
21753 : see if this is a poll.h system
21757 : see if this is a prot.h system
21761 : Preprocessor symbols
21763 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21764 $cat <<'EOSH' > Cppsym.know
21765 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21766 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21767 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21768 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21769 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21770 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21771 bull c cadmus clipper CMU COFF COMPILER_VERSION
21772 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21773 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21774 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21775 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21777 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21778 H3050R H3050RX hbullx20 hcx host_mips
21779 hp200 hp300 hp700 HP700 hp800 hp9000
21780 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21781 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21782 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21783 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21784 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21785 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21786 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21787 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21788 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21789 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21790 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21791 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21792 MATH_HAS_NO_SIDE_EFFECTS
21793 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21794 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21795 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21796 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21797 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21798 NetBSD news1500 news1700 news1800 news1900 news3700
21799 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21800 ns32016 ns32332 ns32k nsc32000
21801 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21802 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21803 pc532 pdp11 PGC PIC plexus PORTAR posix
21804 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21805 POSIX_C_SOURCE POSIX_SOURCE POWER
21806 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21807 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21808 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21809 sony sony_news sonyrisc sparc sparclite spectrum
21810 stardent stdc STDC_EXT stratos sun sun3 sun386
21811 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21812 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21813 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21814 sysV68 sysV88 Tek4132 Tek4300 titan
21815 TM3200 TM5400 TM5600
21816 tower tower32 tower32_200 tower32_600 tower32_700
21817 tower32_800 tower32_850 tss
21818 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21819 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21820 unix UNIX95 UNIX99 unixpc unos
21821 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21822 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21823 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21825 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21826 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21827 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21830 # Maybe put other stuff here too.
21831 cat <<EOSH >>Cppsym.know
21834 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21835 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21836 $cat Cppsym.know > Cppsym.c
21837 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21838 $rm -f Cppsym.a Cppsym.b Cppsym.c
21839 cat <<EOSH > Cppsym
21841 if $test \$# -gt 0; then
21842 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21843 if $test -s Cppsym.got; then
21850 $tr " " "$trnl" | ./Cppsym.try
21856 cat <<EOSH > Cppsym.try
21858 cat <<'EOCP' > try.c
21861 #define STRINGIFY(a) "a"
21863 #if cpp_stuff == 42
21864 #define StGiFy(a) #a
21865 #define STRINGIFY(a) StGiFy(a)
21867 #if $cpp_stuff != 1 && $cpp_stuff != 42
21868 # include "Bletch: How does this C preprocessor stringify macros?"
21874 cat <<'EOSH' >> Cppsym.try
21876 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21877 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21878 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21879 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21881 echo 'return 0;}' >> try.c
21883 cat <<EOSH >> Cppsym.try
21885 case "$osname-$gccversion" in
21886 irix-) ccflags="\$ccflags -woff 1178" ;;
21887 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21889 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21891 chmod +x Cppsym.try
21892 $eunicefix Cppsym.try
21893 ./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
21894 : Add in any Linux cpp "predefined macros":
21895 case "$osname::$gccversion" in
21896 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
21898 rm -f $tHdrH'.h' $tHdrH
21900 # Filter out macro arguments, such as Linux's __INT8_C(c)
21901 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21902 sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21903 if [ -s $tHdrH'_cppsym.real' ]; then
21904 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21907 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21910 : now check the C compiler for additional symbols
21911 postprocess_cc_v=''
21913 aix) postprocess_cc_v="|$tr , ' '" ;;
21920 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21923 -D*) echo "\$i" | $sed 's/^-D//';;
21924 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21929 postprocess_cc_v=''
21932 ./ccsym > ccsym1.raw
21933 if $test -s ccsym1.raw; then
21934 $sort ccsym1.raw | $uniq >ccsym.raw
21936 mv ccsym1.raw ccsym.raw
21939 $awk '/\=/ { print $0; next }
21940 { print $0"=1" }' ccsym.raw >ccsym.list
21941 $comm -13 Cppsym.true ccsym.list >ccsym.own
21942 $comm -12 Cppsym.true ccsym.list >ccsym.com
21943 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21945 if $test -z ccsym.raw; then
21946 echo "Your C compiler doesn't seem to define any symbols!" >&4
21948 echo "However, your C preprocessor defines the following symbols:"
21951 cppsymbols=`$cat Cppsym.true`
21952 cppsymbols=`echo $cppsymbols`
21953 cppccsymbols="$cppsymbols"
21955 if $test -s ccsym.com; then
21956 echo "Your C compiler and pre-processor define these symbols:"
21957 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
21960 cppccsymbols=`$cat ccsym.com`
21961 cppccsymbols=`echo $cppccsymbols`
21962 $test "$silent" || sleep 1
21964 if $test -s ccsym.cpp; then
21965 $test "$also" && echo " "
21966 echo "Your C pre-processor ${also}defines the following symbols:"
21967 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
21969 cppsymbols=`$cat ccsym.cpp`
21970 cppsymbols=`echo $cppsymbols`
21971 $test "$silent" || sleep 1
21973 if $test -s ccsym.own; then
21974 $test "$also" && echo " "
21975 echo "Your C compiler ${also}defines the following cpp symbols:"
21976 $sed -e 's/\(..*\)=1/\1/' ccsym.own
21977 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
21978 ccsymbols=`$cat ccsym.own`
21979 ccsymbols=`echo $ccsymbols`
21980 $test "$silent" || sleep 1
21984 : see if this is a termio system
21988 if $test `./findhdr termios.h`; then
21989 set tcsetattr i_termios
21995 "$define") echo "You have POSIX termios.h... good!" >&4;;
21996 *) if ./Cppsym pyr; then
21997 case "`/bin/universe`" in
21998 ucb) if $test `./findhdr sgtty.h`; then
22000 echo "<sgtty.h> found." >&4
22002 echo "System is pyramid with BSD universe."
22003 ./warn "<sgtty.h> not found--you could have problems."
22005 *) if $test `./findhdr termio.h`; then
22007 echo "<termio.h> found." >&4
22009 echo "System is pyramid with USG universe."
22010 ./warn "<termio.h> not found--you could have problems."
22014 if $test `./findhdr termio.h`; then
22015 echo "<termio.h> found." >&4
22017 elif $test `./findhdr sgtty.h`; then
22018 echo "<sgtty.h> found." >&4
22021 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
22024 if $test `./findhdr sgtty.h`; then
22025 echo "<sgtty.h> found." >&4
22027 elif $test `./findhdr termio.h`; then
22028 echo "<termio.h> found." >&4
22031 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
22035 set i_termio; eval $setvar
22036 val=$val2; set i_sgtty; eval $setvar
22037 val=$val3; set i_termios; eval $setvar
22039 : see if stdbool is available
22040 : we want a real compile instead of Inhdr because some Solaris systems
22041 : have stdbool.h, but it can only be used if the compiler indicates it
22042 : is sufficiently c99-compliant.
22046 #include <stdbool.h>
22051 int main(int argc, char **argv)
22057 if eval $compile; then
22058 echo "<stdbool.h> found." >&4
22061 echo "<stdbool.h> NOT found." >&4
22068 : see if stddef is available
22069 set stddef.h i_stddef
22072 : see if sys/access.h is available
22073 set sys/access.h i_sysaccess
22076 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
22077 set sys/filio.h i_sysfilio
22080 if $test `./findhdr sys/ioctl.h`; then
22082 echo '<sys/ioctl.h> found.' >&4
22085 if $test $i_sysfilio = "$define"; then
22086 echo '<sys/ioctl.h> NOT found.' >&4
22088 $test $i_sgtty = "$define" && xxx="sgtty.h"
22089 $test $i_termio = "$define" && xxx="termio.h"
22090 $test $i_termios = "$define" && xxx="termios.h"
22091 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
22097 : see if socket ioctl defs are in sys/sockio.h
22099 xxx=`./findhdr sys/sockio.h`
22100 if $test "$xxx"; then
22101 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
22103 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
22106 echo "No socket ioctls found in <sys/sockio.h>." >&4
22111 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
22117 : see if this is a syslog.h system
22118 set syslog.h i_syslog
22121 : see if this is a sys/mode.h system
22122 set sys/mode.h i_sysmode
22125 : see if there is a sys/poll.h file
22126 set sys/poll.h i_syspoll
22129 : see if sys/resource.h has to be included
22130 set sys/resource.h i_sysresrc
22133 : see if sys/security.h is available
22134 set sys/security.h i_syssecrt
22137 : see if this is a sys/statvfs.h system
22138 set sys/statvfs.h i_sysstatvfs
22141 : see if this is a sys/un.h system
22142 set sys/un.h i_sysun
22145 : see if this is a sys/utsname.h system
22146 set sys/utsname.h i_sysutsname
22149 : see if this is a syswait system
22150 set sys/wait.h i_syswait
22153 : see if this is a ustat.h system
22154 set ustat.h i_ustat
22157 : see if this is an utime system
22158 set utime.h i_utime
22161 : see if this is a vfork system
22164 set vfork.h i_vfork
22174 echo "Looking for extensions..." >&4
22175 : If we are using the old config.sh, nonxs_extensions and xs_extensions may
22176 : contain old or inaccurate or duplicate values.
22177 nonxs_extensions=''
22179 : We do not use find because it might not be available.
22180 : We do not just use MANIFEST because the user may have dropped
22181 : some additional extensions into the source tree and expect them
22184 : Function to recursively find available extensions, ignoring DynaLoader
22185 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
22186 : In 5.10.1 and later, extensions are stored in directories
22187 : like File-Glob instead of the older File/Glob/.
22191 DynaLoader|dynaload) ;;
22193 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
22194 echo " $xs_extensions $nonxs_extensions" > $$.tmp;
22195 if $contains " $this_ext " $$.tmp; then
22197 echo "Duplicate directories detected for extension $xxx" >&4;
22198 echo "Configure cannot correctly recover from this - shall I abort?" >&4;
22199 case "$knowitall" in
22207 echo "Ok. Stopping Configure." >&4;
22208 echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
22211 echo "Ok. You will need to correct config.sh before running make." >&4;
22213 $ls -1 $xxx > $$.tmp;
22214 if $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
22215 xs_extensions="$xs_extensions $this_ext";
22216 elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then
22217 xs_extensions="$xs_extensions $this_ext";
22218 elif $test -d $xxx; then
22219 nonxs_extensions="$nonxs_extensions $this_ext";
22229 eval $find_extensions
22233 eval $find_extensions
22237 eval $find_extensions
22238 set X $xs_extensions
22240 xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22241 set X $nonxs_extensions
22243 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
22245 known_extensions=`echo $nonxs_extensions $xs_extensions | tr ' ' $trnl | $sort | tr $trnl ' '`
22247 : Now see which are supported on this system.
22249 for xxx in $xs_extensions ; do
22253 $define) avail_ext="$avail_ext $xxx" ;;
22256 GDBM_File|gdbm_fil)
22258 $define) avail_ext="$avail_ext $xxx" ;;
22261 I18N/Langinfo|i18n_lan)
22262 case "$i_langinfo$d_nl_langinfo" in
22263 $define$define) avail_ext="$avail_ext $xxx" ;;
22267 : XXX Do we need a useipcsysv variable here
22268 case "${d_msg}${d_sem}${d_shm}" in
22269 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
22272 NDBM_File|ndbm_fil)
22275 case "$osname-$use64bitint" in
22278 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
22281 *) avail_ext="$avail_ext $xxx" ;;
22286 ODBM_File|odbm_fil)
22287 case "${i_dbm}${i_rpcsvcdbm}" in
22289 case "$d_cplusplus" in
22290 define) ;; # delete as a function name will not work
22291 *) case "$osname-$use64bitint" in
22294 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
22297 *) avail_ext="$avail_ext $xxx" ;;
22305 case "$useopcode" in
22306 true|define|y) avail_ext="$avail_ext $xxx" ;;
22310 case "$useposix" in
22311 true|define|y) avail_ext="$avail_ext $xxx" ;;
22315 case "$d_socket" in
22316 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22319 Sys/Syslog|sys/syslog)
22320 : XXX syslog requires socket
22321 case "$d_socket" in
22322 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22326 case "$usethreads" in
22328 case "$use5005threads" in
22329 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
22333 threads|threads/shared)
22334 # threads and threads::shared are special cases.
22335 # To stop people from asking "Perl 5.8.0 was supposed
22336 # to have this new fancy threads implementation but my
22337 # perl doesn't have it" and from people trying to
22338 # (re)install the threads module using CPAN.pm and
22339 # CPAN.pm then offering to reinstall Perl 5.8.0,
22340 # the threads.pm and threads/shared.pm will always be
22341 # there, croaking informatively ("you need to rebuild
22342 # all of Perl with threads, sorry") when threads haven't
22343 # been compiled in.
22345 avail_ext="$avail_ext $xxx"
22351 cygwin) avail_ext="$avail_ext $xxx" ;;
22354 XS/APItest|xs/apitest)
22355 # This is just for testing. Skip it unless we have dynamic loading.
22358 $define) avail_ext="$avail_ext $xxx" ;;
22361 XS/Typemap|xs/typemap)
22362 # This is just for testing. Skip it unless we have dynamic loading.
22364 $define) avail_ext="$avail_ext $xxx" ;;
22367 *) avail_ext="$avail_ext $xxx"
22376 case "$onlyextensions" in
22378 *) keepextensions=''
22379 echo "You have requested that only certain extensions be included..." >&4
22380 for i in $onlyextensions; do
22381 case " $avail_ext " in
22383 echo "Keeping extension $i."
22384 keepextensions="$keepextensions $i"
22386 *) echo "Ignoring extension $i." ;;
22389 avail_ext="$keepextensions"
22393 case "$noextensions" in
22395 *) keepextensions=''
22396 echo "You have requested that certain extensions be ignored..." >&4
22397 for i in $avail_ext; do
22398 case " $noextensions " in
22399 *" $i "*) echo "Ignoring extension $i." ;;
22400 *) echo "Keeping extension $i.";
22401 keepextensions="$keepextensions $i"
22405 avail_ext="$keepextensions"
22409 : Now see which nonxs extensions are supported on this system.
22410 : For now assume all are.
22412 for xxx in $nonxs_extensions ; do
22416 *) nonxs_ext="$nonxs_ext $xxx"
22428 A number of extensions are supplied with $package. You may choose to
22429 compile these extensions for dynamic loading (the default), compile
22430 them into the $package executable (static loading), or not include
22431 them at all. Answer "none" to include no extensions.
22432 Note that DynaLoader is always built and need not be mentioned here.
22435 case "$dynamic_ext" in
22437 : Exclude those listed in static_ext
22439 for xxx in $avail_ext; do
22440 case " $static_ext " in
22442 *) dflt="$dflt $xxx" ;;
22449 *) dflt="$dynamic_ext"
22450 # Perhaps we are reusing an old out-of-date config.sh.
22453 if test X"$dynamic_ext" != X"$avail_ext"; then
22455 NOTICE: Your previous config.sh list may be incorrect.
22456 The extensions now available to you are
22458 but the default list from your previous config.sh is
22470 rp="What extensions do you wish to load dynamically?"
22473 none) dynamic_ext=' ' ;;
22474 *) dynamic_ext="$ans" ;;
22477 case "$static_ext" in
22479 : Exclude those already listed in dynamic linking
22481 for xxx in $avail_ext; do
22482 case " $dynamic_ext " in
22484 *) dflt="$dflt $xxx" ;;
22491 *) dflt="$static_ext"
22498 rp="What extensions do you wish to load statically?"
22501 none) static_ext=' ' ;;
22502 *) static_ext="$ans" ;;
22507 A number of extensions are supplied with $package. Answer "none"
22508 to include no extensions.
22509 Note that DynaLoader is always built and need not be mentioned here.
22512 case "$static_ext" in
22513 '') dflt="$avail_ext" ;;
22514 *) dflt="$static_ext"
22515 # Perhaps we are reusing an old out-of-date config.sh.
22518 if test X"$static_ext" != X"$avail_ext"; then
22520 NOTICE: Your previous config.sh list may be incorrect.
22521 The extensions now available to you are
22523 but the default list from your previous config.sh is
22532 : Exclude those that are not xs extensions
22536 rp="What extensions do you wish to include?"
22539 none) static_ext=' ' ;;
22540 *) static_ext="$ans" ;;
22545 # Encode is a special case. If we are building Encode as a static
22546 # extension, we need to explicitly list its subextensions as well.
22547 # For other nested extensions, this is handled automatically by
22548 # the appropriate Makefile.PL.
22549 case " $static_ext " in
22550 *" Encode "*) # Add the subextensions of Encode
22552 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22553 static_ext="$static_ext Encode/$xxx"
22554 known_extensions="$known_extensions Encode/$xxx"
22560 set X $dynamic_ext $static_ext $nonxs_ext
22564 # Sanity check: We require an extension suitable for use with
22565 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22566 # should show up as failures in the test suite, but it's helpful to
22567 # catch them now.) The 'extensions' list is normally sorted
22568 # alphabetically, so we need to accept either
22569 # DB_File ... Fcntl ... IO ....
22570 # or something like
22571 # Fcntl ... NDBM_File ... IO ....
22572 case " $extensions" in
22573 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22574 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22575 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22576 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22577 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22581 : Remove libraries needed only for extensions
22582 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22583 : The exception is SunOS 4.x, which needs them.
22584 case "${osname}X${osvers}" in
22588 *) case "$usedl" in
22589 $define|true|[yY]*)
22590 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22594 *) perllibs="$libs"
22600 : Remove build directory name from cppstdin so it can be used from
22601 : either the present location or the final installed location.
22603 : Get out of the UU directory to get correct path name.
22605 case "$cppstdin" in
22607 echo "Stripping down cppstdin path name"
22613 : end of configuration questions
22615 echo "End of configuration questions."
22618 : back to where it started
22619 if test -d ../UU; then
22623 : configuration may be unconditionally patched via a 'config.arch' file
22624 if $test -f config.arch; then
22625 echo "I see a config.arch file, loading it." >&4
22629 : configuration may be patched via a 'config.over' file
22630 if $test -f config.over; then
22633 rp='I see a config.over file. Do you wish to load it?'
22636 n*) echo "OK, I'll ignore it.";;
22638 echo "Configuration override changes have been loaded."
22643 : in case they want portability, strip down executable paths
22644 case "$d_portable" in
22647 echo "Stripping down executable paths..." >&4
22648 for file in $loclist $trylist; do
22650 eval $file=`basename $temp`
22655 : create config.sh file
22657 echo "Creating config.sh..." >&4
22658 $spitshell <<EOT >config.sh
22661 # This file was produced by running the Configure script. It holds all the
22662 # definitions figured out by Configure. Should you modify one of these values,
22663 # do not forget to propagate your changes by running "Configure -der". You may
22664 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22667 # Package name : $package
22668 # Source directory : $src
22669 # Configuration time: $cf_time
22670 # Configured by : $cf_by
22671 # Target system : $myuname
22674 : Add in command line options if available
22675 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22677 $spitshell <<EOT >>config.sh
22686 Revision='$Revision'
22694 alignbytes='$alignbytes'
22695 ansi2knr='$ansi2knr'
22696 aphostname='$aphostname'
22697 api_revision='$api_revision'
22698 api_subversion='$api_subversion'
22699 api_version='$api_version'
22700 api_versionstring='$api_versionstring'
22703 archlibexp='$archlibexp'
22704 archname64='$archname64'
22705 archname='$archname'
22706 archobjs='$archobjs'
22707 asctime_r_proto='$asctime_r_proto'
22715 bootstrap_charset='$bootstrap_charset'
22717 byteorder='$byteorder'
22719 castflags='$castflags'
22722 cccdlflags='$cccdlflags'
22723 ccdlflags='$ccdlflags'
22725 ccflags_uselargefiles='$ccflags_uselargefiles'
22727 ccsymbols='$ccsymbols'
22728 ccversion='$ccversion'
22730 cf_email='$cf_email'
22732 charbits='$charbits'
22733 charsize='$charsize'
22737 clocktype='$clocktype'
22739 compress='$compress'
22740 contains='$contains'
22744 cpp_stuff='$cpp_stuff'
22745 cppccsymbols='$cppccsymbols'
22746 cppflags='$cppflags'
22748 cppminus='$cppminus'
22750 cppstdin='$cppstdin'
22751 cppsymbols='$cppsymbols'
22752 crypt_r_proto='$crypt_r_proto'
22753 cryptlib='$cryptlib'
22755 ctermid_r_proto='$ctermid_r_proto'
22756 ctime_r_proto='$ctime_r_proto'
22757 d_Gconvert='$d_Gconvert'
22758 d_PRIEUldbl='$d_PRIEUldbl'
22759 d_PRIFUldbl='$d_PRIFUldbl'
22760 d_PRIGUldbl='$d_PRIGUldbl'
22761 d_PRIXU64='$d_PRIXU64'
22762 d_PRId64='$d_PRId64'
22763 d_PRIeldbl='$d_PRIeldbl'
22764 d_PRIfldbl='$d_PRIfldbl'
22765 d_PRIgldbl='$d_PRIgldbl'
22766 d_PRIi64='$d_PRIi64'
22767 d_PRIo64='$d_PRIo64'
22768 d_PRIu64='$d_PRIu64'
22769 d_PRIx64='$d_PRIx64'
22770 d_SCNfldbl='$d_SCNfldbl'
22771 d__fwalk='$d__fwalk'
22772 d_access='$d_access'
22773 d_accessx='$d_accessx'
22776 d_archlib='$d_archlib'
22777 d_asctime64='$d_asctime64'
22778 d_asctime_r='$d_asctime_r'
22781 d_attribute_deprecated='$d_attribute_deprecated'
22782 d_attribute_format='$d_attribute_format'
22783 d_attribute_malloc='$d_attribute_malloc'
22784 d_attribute_nonnull='$d_attribute_nonnull'
22785 d_attribute_noreturn='$d_attribute_noreturn'
22786 d_attribute_pure='$d_attribute_pure'
22787 d_attribute_unused='$d_attribute_unused'
22788 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22792 d_bsdgetpgrp='$d_bsdgetpgrp'
22793 d_bsdsetpgrp='$d_bsdsetpgrp'
22794 d_builtin_choose_expr='$d_builtin_choose_expr'
22795 d_builtin_expect='$d_builtin_expect'
22797 d_c99_variadic_macros='$d_c99_variadic_macros'
22798 d_casti32='$d_casti32'
22799 d_castneg='$d_castneg'
22800 d_charvspr='$d_charvspr'
22802 d_chroot='$d_chroot'
22803 d_chsize='$d_chsize'
22805 d_clearenv='$d_clearenv'
22806 d_closedir='$d_closedir'
22807 d_cmsghdr_s='$d_cmsghdr_s'
22809 d_copysignl='$d_copysignl'
22810 d_cplusplus='$d_cplusplus'
22812 d_crypt_r='$d_crypt_r'
22814 d_ctermid='$d_ctermid'
22815 d_ctermid_r='$d_ctermid_r'
22816 d_ctime64='$d_ctime64'
22817 d_ctime_r='$d_ctime_r'
22818 d_cuserid='$d_cuserid'
22819 d_dbl_dig='$d_dbl_dig'
22820 d_dbminitproto='$d_dbminitproto'
22821 d_difftime64='$d_difftime64'
22822 d_difftime='$d_difftime'
22823 d_dir_dd_fd='$d_dir_dd_fd'
22825 d_dirnamlen='$d_dirnamlen'
22826 d_dlerror='$d_dlerror'
22827 d_dlopen='$d_dlopen'
22828 d_dlsymun='$d_dlsymun'
22829 d_dosuid='$d_dosuid'
22830 d_drand48_r='$d_drand48_r'
22831 d_drand48proto='$d_drand48proto'
22833 d_eaccess='$d_eaccess'
22834 d_endgrent='$d_endgrent'
22835 d_endgrent_r='$d_endgrent_r'
22836 d_endhent='$d_endhent'
22837 d_endhostent_r='$d_endhostent_r'
22838 d_endnent='$d_endnent'
22839 d_endnetent_r='$d_endnetent_r'
22840 d_endpent='$d_endpent'
22841 d_endprotoent_r='$d_endprotoent_r'
22842 d_endpwent='$d_endpwent'
22843 d_endpwent_r='$d_endpwent_r'
22844 d_endsent='$d_endsent'
22845 d_endservent_r='$d_endservent_r'
22846 d_eofnblk='$d_eofnblk'
22847 d_eunice='$d_eunice'
22848 d_faststdio='$d_faststdio'
22849 d_fchdir='$d_fchdir'
22850 d_fchmod='$d_fchmod'
22851 d_fchown='$d_fchown'
22853 d_fcntl_can_lock='$d_fcntl_can_lock'
22854 d_fd_macros='$d_fd_macros'
22855 d_fd_set='$d_fd_set'
22856 d_fds_bits='$d_fds_bits'
22857 d_fgetpos='$d_fgetpos'
22858 d_finite='$d_finite'
22859 d_finitel='$d_finitel'
22860 d_flexfnam='$d_flexfnam'
22862 d_flockproto='$d_flockproto'
22864 d_fp_class='$d_fp_class'
22865 d_fpathconf='$d_fpathconf'
22866 d_fpclass='$d_fpclass'
22867 d_fpclassify='$d_fpclassify'
22868 d_fpclassl='$d_fpclassl'
22869 d_fpos64_t='$d_fpos64_t'
22870 d_frexpl='$d_frexpl'
22871 d_fs_data_s='$d_fs_data_s'
22872 d_fseeko='$d_fseeko'
22873 d_fsetpos='$d_fsetpos'
22874 d_fstatfs='$d_fstatfs'
22875 d_fstatvfs='$d_fstatvfs'
22877 d_ftello='$d_ftello'
22879 d_futimes='$d_futimes'
22880 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
22881 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
22882 d_getaddrinfo='$d_getaddrinfo'
22883 d_getcwd='$d_getcwd'
22884 d_getespwnam='$d_getespwnam'
22885 d_getfsstat='$d_getfsstat'
22886 d_getgrent='$d_getgrent'
22887 d_getgrent_r='$d_getgrent_r'
22888 d_getgrgid_r='$d_getgrgid_r'
22889 d_getgrnam_r='$d_getgrnam_r'
22890 d_getgrps='$d_getgrps'
22891 d_gethbyaddr='$d_gethbyaddr'
22892 d_gethbyname='$d_gethbyname'
22893 d_gethent='$d_gethent'
22894 d_gethname='$d_gethname'
22895 d_gethostbyaddr_r='$d_gethostbyaddr_r'
22896 d_gethostbyname_r='$d_gethostbyname_r'
22897 d_gethostent_r='$d_gethostent_r'
22898 d_gethostprotos='$d_gethostprotos'
22899 d_getitimer='$d_getitimer'
22900 d_getlogin='$d_getlogin'
22901 d_getlogin_r='$d_getlogin_r'
22902 d_getmnt='$d_getmnt'
22903 d_getmntent='$d_getmntent'
22904 d_getnameinfo='$d_getnameinfo'
22905 d_getnbyaddr='$d_getnbyaddr'
22906 d_getnbyname='$d_getnbyname'
22907 d_getnent='$d_getnent'
22908 d_getnetbyaddr_r='$d_getnetbyaddr_r'
22909 d_getnetbyname_r='$d_getnetbyname_r'
22910 d_getnetent_r='$d_getnetent_r'
22911 d_getnetprotos='$d_getnetprotos'
22912 d_getpagsz='$d_getpagsz'
22913 d_getpbyname='$d_getpbyname'
22914 d_getpbynumber='$d_getpbynumber'
22915 d_getpent='$d_getpent'
22916 d_getpgid='$d_getpgid'
22917 d_getpgrp2='$d_getpgrp2'
22918 d_getpgrp='$d_getpgrp'
22919 d_getppid='$d_getppid'
22920 d_getprior='$d_getprior'
22921 d_getprotobyname_r='$d_getprotobyname_r'
22922 d_getprotobynumber_r='$d_getprotobynumber_r'
22923 d_getprotoent_r='$d_getprotoent_r'
22924 d_getprotoprotos='$d_getprotoprotos'
22925 d_getprpwnam='$d_getprpwnam'
22926 d_getpwent='$d_getpwent'
22927 d_getpwent_r='$d_getpwent_r'
22928 d_getpwnam_r='$d_getpwnam_r'
22929 d_getpwuid_r='$d_getpwuid_r'
22930 d_getsbyname='$d_getsbyname'
22931 d_getsbyport='$d_getsbyport'
22932 d_getsent='$d_getsent'
22933 d_getservbyname_r='$d_getservbyname_r'
22934 d_getservbyport_r='$d_getservbyport_r'
22935 d_getservent_r='$d_getservent_r'
22936 d_getservprotos='$d_getservprotos'
22937 d_getspnam='$d_getspnam'
22938 d_getspnam_r='$d_getspnam_r'
22939 d_gettimeod='$d_gettimeod'
22940 d_gmtime64='$d_gmtime64'
22941 d_gmtime_r='$d_gmtime_r'
22942 d_gnulibc='$d_gnulibc'
22943 d_grpasswd='$d_grpasswd'
22944 d_hasmntopt='$d_hasmntopt'
22946 d_ilogbl='$d_ilogbl'
22947 d_inc_version_list='$d_inc_version_list'
22949 d_inetaton='$d_inetaton'
22950 d_inetntop='$d_inetntop'
22951 d_inetpton='$d_inetpton'
22952 d_int64_t='$d_int64_t'
22953 d_ip_mreq='$d_ip_mreq'
22954 d_ip_mreq_source='$d_ip_mreq_source'
22955 d_ipv6_mreq='$d_ipv6_mreq'
22956 d_ipv6_mreq_source='$d_ipv6_mreq_source'
22957 d_isascii='$d_isascii'
22958 d_isblank='$d_isblank'
22959 d_isfinite='$d_isfinite'
22962 d_isnanl='$d_isnanl'
22963 d_killpg='$d_killpg'
22964 d_lchown='$d_lchown'
22965 d_ldbl_dig='$d_ldbl_dig'
22966 d_libm_lib_version='$d_libm_lib_version'
22968 d_localtime64='$d_localtime64'
22969 d_localtime_r='$d_localtime_r'
22970 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
22971 d_locconv='$d_locconv'
22973 d_longdbl='$d_longdbl'
22974 d_longlong='$d_longlong'
22975 d_lseekproto='$d_lseekproto'
22977 d_madvise='$d_madvise'
22978 d_malloc_good_size='$d_malloc_good_size'
22979 d_malloc_size='$d_malloc_size'
22981 d_mbstowcs='$d_mbstowcs'
22982 d_mbtowc='$d_mbtowc'
22983 d_memchr='$d_memchr'
22984 d_memcmp='$d_memcmp'
22985 d_memcpy='$d_memcpy'
22986 d_memmove='$d_memmove'
22987 d_memset='$d_memset'
22989 d_mkdtemp='$d_mkdtemp'
22990 d_mkfifo='$d_mkfifo'
22991 d_mkstemp='$d_mkstemp'
22992 d_mkstemps='$d_mkstemps'
22993 d_mktime64='$d_mktime64'
22994 d_mktime='$d_mktime'
22997 d_modfl_pow32_bug='$d_modfl_pow32_bug'
22998 d_modflproto='$d_modflproto'
22999 d_mprotect='$d_mprotect'
23001 d_msg_ctrunc='$d_msg_ctrunc'
23002 d_msg_dontroute='$d_msg_dontroute'
23003 d_msg_oob='$d_msg_oob'
23004 d_msg_peek='$d_msg_peek'
23005 d_msg_proxy='$d_msg_proxy'
23006 d_msgctl='$d_msgctl'
23007 d_msgget='$d_msgget'
23008 d_msghdr_s='$d_msghdr_s'
23009 d_msgrcv='$d_msgrcv'
23010 d_msgsnd='$d_msgsnd'
23012 d_munmap='$d_munmap'
23013 d_mymalloc='$d_mymalloc'
23015 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
23017 d_nl_langinfo='$d_nl_langinfo'
23018 d_nv_preserves_uv='$d_nv_preserves_uv'
23019 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
23020 d_off64_t='$d_off64_t'
23021 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
23022 d_oldpthreads='$d_oldpthreads'
23023 d_oldsock='$d_oldsock'
23025 d_pathconf='$d_pathconf'
23027 d_perl_otherlibdirs='$d_perl_otherlibdirs'
23028 d_phostname='$d_phostname'
23031 d_portable='$d_portable'
23033 d_prctl_set_name='$d_prctl_set_name'
23034 d_printf_format_null='$d_printf_format_null'
23035 d_procselfexe='$d_procselfexe'
23036 d_pseudofork='$d_pseudofork'
23037 d_pthread_atfork='$d_pthread_atfork'
23038 d_pthread_attr_setscope='$d_pthread_attr_setscope'
23039 d_pthread_yield='$d_pthread_yield'
23041 d_pwchange='$d_pwchange'
23042 d_pwclass='$d_pwclass'
23043 d_pwcomment='$d_pwcomment'
23044 d_pwexpire='$d_pwexpire'
23045 d_pwgecos='$d_pwgecos'
23046 d_pwpasswd='$d_pwpasswd'
23047 d_pwquota='$d_pwquota'
23050 d_random_r='$d_random_r'
23051 d_readdir64_r='$d_readdir64_r'
23052 d_readdir='$d_readdir'
23053 d_readdir_r='$d_readdir_r'
23054 d_readlink='$d_readlink'
23056 d_recvmsg='$d_recvmsg'
23057 d_rename='$d_rename'
23058 d_rewinddir='$d_rewinddir'
23060 d_safebcpy='$d_safebcpy'
23061 d_safemcpy='$d_safemcpy'
23062 d_sanemcmp='$d_sanemcmp'
23063 d_sbrkproto='$d_sbrkproto'
23064 d_scalbnl='$d_scalbnl'
23065 d_sched_yield='$d_sched_yield'
23066 d_scm_rights='$d_scm_rights'
23067 d_seekdir='$d_seekdir'
23068 d_select='$d_select'
23070 d_semctl='$d_semctl'
23071 d_semctl_semid_ds='$d_semctl_semid_ds'
23072 d_semctl_semun='$d_semctl_semun'
23073 d_semget='$d_semget'
23075 d_sendmsg='$d_sendmsg'
23076 d_setegid='$d_setegid'
23077 d_seteuid='$d_seteuid'
23078 d_setgrent='$d_setgrent'
23079 d_setgrent_r='$d_setgrent_r'
23080 d_setgrps='$d_setgrps'
23081 d_sethent='$d_sethent'
23082 d_sethostent_r='$d_sethostent_r'
23083 d_setitimer='$d_setitimer'
23084 d_setlinebuf='$d_setlinebuf'
23085 d_setlocale='$d_setlocale'
23086 d_setlocale_r='$d_setlocale_r'
23087 d_setnent='$d_setnent'
23088 d_setnetent_r='$d_setnetent_r'
23089 d_setpent='$d_setpent'
23090 d_setpgid='$d_setpgid'
23091 d_setpgrp2='$d_setpgrp2'
23092 d_setpgrp='$d_setpgrp'
23093 d_setprior='$d_setprior'
23094 d_setproctitle='$d_setproctitle'
23095 d_setprotoent_r='$d_setprotoent_r'
23096 d_setpwent='$d_setpwent'
23097 d_setpwent_r='$d_setpwent_r'
23098 d_setregid='$d_setregid'
23099 d_setresgid='$d_setresgid'
23100 d_setresuid='$d_setresuid'
23101 d_setreuid='$d_setreuid'
23102 d_setrgid='$d_setrgid'
23103 d_setruid='$d_setruid'
23104 d_setsent='$d_setsent'
23105 d_setservent_r='$d_setservent_r'
23106 d_setsid='$d_setsid'
23107 d_setvbuf='$d_setvbuf'
23111 d_shmatprototype='$d_shmatprototype'
23112 d_shmctl='$d_shmctl'
23114 d_shmget='$d_shmget'
23115 d_sigaction='$d_sigaction'
23116 d_signbit='$d_signbit'
23117 d_sigprocmask='$d_sigprocmask'
23118 d_sigsetjmp='$d_sigsetjmp'
23119 d_sin6_scope_id='$d_sin6_scope_id'
23120 d_sitearch='$d_sitearch'
23121 d_snprintf='$d_snprintf'
23122 d_sockaddr_in6='$d_sockaddr_in6'
23123 d_sockaddr_sa_len='$d_sockaddr_sa_len'
23124 d_sockatmark='$d_sockatmark'
23125 d_sockatmarkproto='$d_sockatmarkproto'
23126 d_socket='$d_socket'
23127 d_socklen_t='$d_socklen_t'
23128 d_sockpair='$d_sockpair'
23129 d_socks5_init='$d_socks5_init'
23130 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
23132 d_srand48_r='$d_srand48_r'
23133 d_srandom_r='$d_srandom_r'
23134 d_sresgproto='$d_sresgproto'
23135 d_sresuproto='$d_sresuproto'
23136 d_statblks='$d_statblks'
23137 d_statfs_f_flags='$d_statfs_f_flags'
23138 d_statfs_s='$d_statfs_s'
23139 d_static_inline='$d_static_inline'
23140 d_statvfs='$d_statvfs'
23141 d_stdio_cnt_lval='$d_stdio_cnt_lval'
23142 d_stdio_ptr_lval='$d_stdio_ptr_lval'
23143 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
23144 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
23145 d_stdio_stream_array='$d_stdio_stream_array'
23146 d_stdiobase='$d_stdiobase'
23147 d_stdstdio='$d_stdstdio'
23148 d_strchr='$d_strchr'
23149 d_strcoll='$d_strcoll'
23150 d_strctcpy='$d_strctcpy'
23151 d_strerrm='$d_strerrm'
23152 d_strerror='$d_strerror'
23153 d_strerror_r='$d_strerror_r'
23154 d_strftime='$d_strftime'
23155 d_strlcat='$d_strlcat'
23156 d_strlcpy='$d_strlcpy'
23157 d_strtod='$d_strtod'
23158 d_strtol='$d_strtol'
23159 d_strtold='$d_strtold'
23160 d_strtoll='$d_strtoll'
23161 d_strtoq='$d_strtoq'
23162 d_strtoul='$d_strtoul'
23163 d_strtoull='$d_strtoull'
23164 d_strtouq='$d_strtouq'
23165 d_strxfrm='$d_strxfrm'
23166 d_suidsafe='$d_suidsafe'
23167 d_symlink='$d_symlink'
23168 d_syscall='$d_syscall'
23169 d_syscallproto='$d_syscallproto'
23170 d_sysconf='$d_sysconf'
23171 d_sysernlst='$d_sysernlst'
23172 d_syserrlst='$d_syserrlst'
23173 d_system='$d_system'
23174 d_tcgetpgrp='$d_tcgetpgrp'
23175 d_tcsetpgrp='$d_tcsetpgrp'
23176 d_telldir='$d_telldir'
23177 d_telldirproto='$d_telldirproto'
23179 d_timegm='$d_timegm'
23181 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
23182 d_tm_tm_zone='$d_tm_tm_zone'
23183 d_tmpnam_r='$d_tmpnam_r'
23184 d_truncate='$d_truncate'
23185 d_ttyname_r='$d_ttyname_r'
23186 d_tzname='$d_tzname'
23187 d_u32align='$d_u32align'
23188 d_ualarm='$d_ualarm'
23191 d_union_semun='$d_union_semun'
23192 d_unordered='$d_unordered'
23193 d_unsetenv='$d_unsetenv'
23194 d_usleep='$d_usleep'
23195 d_usleepproto='$d_usleepproto'
23197 d_vendorarch='$d_vendorarch'
23198 d_vendorbin='$d_vendorbin'
23199 d_vendorlib='$d_vendorlib'
23200 d_vendorscript='$d_vendorscript'
23202 d_void_closedir='$d_void_closedir'
23203 d_voidsig='$d_voidsig'
23204 d_voidtty='$d_voidtty'
23205 d_volatile='$d_volatile'
23206 d_vprintf='$d_vprintf'
23207 d_vsnprintf='$d_vsnprintf'
23209 d_waitpid='$d_waitpid'
23210 d_wcstombs='$d_wcstombs'
23211 d_wctomb='$d_wctomb'
23212 d_writev='$d_writev'
23215 db_hashtype='$db_hashtype'
23216 db_prefixtype='$db_prefixtype'
23217 db_version_major='$db_version_major'
23218 db_version_minor='$db_version_minor'
23219 db_version_patch='$db_version_patch'
23220 direntrytype='$direntrytype'
23223 doublesize='$doublesize'
23225 drand48_r_proto='$drand48_r_proto'
23227 dynamic_ext='$dynamic_ext'
23233 endgrent_r_proto='$endgrent_r_proto'
23234 endhostent_r_proto='$endhostent_r_proto'
23235 endnetent_r_proto='$endnetent_r_proto'
23236 endprotoent_r_proto='$endprotoent_r_proto'
23237 endpwent_r_proto='$endpwent_r_proto'
23238 endservent_r_proto='$endservent_r_proto'
23239 eunicefix='$eunicefix'
23242 extensions='$extensions'
23243 extern_C='$extern_C'
23245 fflushNULL='$fflushNULL'
23246 fflushall='$fflushall'
23248 firstmakefile='$firstmakefile'
23250 fpossize='$fpossize'
23251 fpostype='$fpostype'
23252 freetype='$freetype'
23255 full_csh='$full_csh'
23256 full_sed='$full_sed'
23257 gccansipedantic='$gccansipedantic'
23258 gccosandvers='$gccosandvers'
23259 gccversion='$gccversion'
23260 getgrent_r_proto='$getgrent_r_proto'
23261 getgrgid_r_proto='$getgrgid_r_proto'
23262 getgrnam_r_proto='$getgrnam_r_proto'
23263 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
23264 gethostbyname_r_proto='$gethostbyname_r_proto'
23265 gethostent_r_proto='$gethostent_r_proto'
23266 getlogin_r_proto='$getlogin_r_proto'
23267 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
23268 getnetbyname_r_proto='$getnetbyname_r_proto'
23269 getnetent_r_proto='$getnetent_r_proto'
23270 getprotobyname_r_proto='$getprotobyname_r_proto'
23271 getprotobynumber_r_proto='$getprotobynumber_r_proto'
23272 getprotoent_r_proto='$getprotoent_r_proto'
23273 getpwent_r_proto='$getpwent_r_proto'
23274 getpwnam_r_proto='$getpwnam_r_proto'
23275 getpwuid_r_proto='$getpwuid_r_proto'
23276 getservbyname_r_proto='$getservbyname_r_proto'
23277 getservbyport_r_proto='$getservbyport_r_proto'
23278 getservent_r_proto='$getservent_r_proto'
23279 getspnam_r_proto='$getspnam_r_proto'
23280 gidformat='$gidformat'
23286 gmtime_r_proto='$gmtime_r_proto'
23287 gnulibc_version='$gnulibc_version'
23289 groupcat='$groupcat'
23290 groupstype='$groupstype'
23293 h_sysfile='$h_sysfile'
23296 html1dir='$html1dir'
23297 html1direxp='$html1direxp'
23298 html3dir='$html3dir'
23299 html3direxp='$html3direxp'
23308 i_arpainet='$i_arpainet'
23309 i_assert='$i_assert'
23310 i_bsdioctl='$i_bsdioctl'
23314 i_dirent='$i_dirent'
23319 i_fp_class='$i_fp_class'
23321 i_gdbm_ndbm='$i_gdbm_ndbm'
23322 i_gdbmndbm='$i_gdbmndbm'
23324 i_ieeefp='$i_ieeefp'
23325 i_inttypes='$i_inttypes'
23326 i_langinfo='$i_langinfo'
23327 i_libutil='$i_libutil'
23328 i_limits='$i_limits'
23329 i_locale='$i_locale'
23330 i_machcthr='$i_machcthr'
23331 i_malloc='$i_malloc'
23332 i_mallocmalloc='$i_mallocmalloc'
23334 i_memory='$i_memory'
23335 i_mntent='$i_mntent'
23338 i_neterrno='$i_neterrno'
23339 i_netinettcp='$i_netinettcp'
23343 i_pthread='$i_pthread'
23345 i_rpcsvcdbm='$i_rpcsvcdbm'
23348 i_shadow='$i_shadow'
23350 i_stdarg='$i_stdarg'
23351 i_stdbool='$i_stdbool'
23352 i_stddef='$i_stddef'
23353 i_stdlib='$i_stdlib'
23354 i_string='$i_string'
23355 i_sunmath='$i_sunmath'
23356 i_sysaccess='$i_sysaccess'
23357 i_sysdir='$i_sysdir'
23358 i_sysfile='$i_sysfile'
23359 i_sysfilio='$i_sysfilio'
23361 i_sysioctl='$i_sysioctl'
23362 i_syslog='$i_syslog'
23363 i_sysmman='$i_sysmman'
23364 i_sysmode='$i_sysmode'
23365 i_sysmount='$i_sysmount'
23366 i_sysndir='$i_sysndir'
23367 i_sysparam='$i_sysparam'
23368 i_syspoll='$i_syspoll'
23369 i_sysresrc='$i_sysresrc'
23370 i_syssecrt='$i_syssecrt'
23371 i_sysselct='$i_sysselct'
23372 i_syssockio='$i_syssockio'
23373 i_sysstat='$i_sysstat'
23374 i_sysstatfs='$i_sysstatfs'
23375 i_sysstatvfs='$i_sysstatvfs'
23376 i_systime='$i_systime'
23377 i_systimek='$i_systimek'
23378 i_systimes='$i_systimes'
23379 i_systypes='$i_systypes'
23380 i_sysuio='$i_sysuio'
23382 i_sysutsname='$i_sysutsname'
23383 i_sysvfs='$i_sysvfs'
23384 i_syswait='$i_syswait'
23385 i_termio='$i_termio'
23386 i_termios='$i_termios'
23388 i_unistd='$i_unistd'
23391 i_values='$i_values'
23392 i_varargs='$i_varargs'
23393 i_varhdr='$i_varhdr'
23395 ignore_versioned_solibs='$ignore_versioned_solibs'
23396 inc_version_list='$inc_version_list'
23397 inc_version_list_init='$inc_version_list_init'
23400 initialinstalllocation='$initialinstalllocation'
23401 installarchlib='$installarchlib'
23402 installbin='$installbin'
23403 installhtml1dir='$installhtml1dir'
23404 installhtml3dir='$installhtml3dir'
23405 installman1dir='$installman1dir'
23406 installman3dir='$installman3dir'
23407 installprefix='$installprefix'
23408 installprefixexp='$installprefixexp'
23409 installprivlib='$installprivlib'
23410 installscript='$installscript'
23411 installsitearch='$installsitearch'
23412 installsitebin='$installsitebin'
23413 installsitehtml1dir='$installsitehtml1dir'
23414 installsitehtml3dir='$installsitehtml3dir'
23415 installsitelib='$installsitelib'
23416 installsiteman1dir='$installsiteman1dir'
23417 installsiteman3dir='$installsiteman3dir'
23418 installsitescript='$installsitescript'
23419 installstyle='$installstyle'
23420 installusrbinperl='$installusrbinperl'
23421 installvendorarch='$installvendorarch'
23422 installvendorbin='$installvendorbin'
23423 installvendorhtml1dir='$installvendorhtml1dir'
23424 installvendorhtml3dir='$installvendorhtml3dir'
23425 installvendorlib='$installvendorlib'
23426 installvendorman1dir='$installvendorman1dir'
23427 installvendorman3dir='$installvendorman3dir'
23428 installvendorscript='$installvendorscript'
23430 issymlink='$issymlink'
23431 ivdformat='$ivdformat'
23434 known_extensions='$known_extensions'
23437 ld_can_script='$ld_can_script'
23438 lddlflags='$lddlflags'
23440 ldflags_uselargefiles='$ldflags_uselargefiles'
23441 ldlibpthname='$ldlibpthname'
23448 libsdirs='$libsdirs'
23449 libsfiles='$libsfiles'
23450 libsfound='$libsfound'
23451 libspath='$libspath'
23452 libswanted='$libswanted'
23453 libswanted_uselargefiles='$libswanted_uselargefiles'
23459 localtime_r_proto='$localtime_r_proto'
23460 locincpth='$locincpth'
23461 loclibpth='$loclibpth'
23462 longdblsize='$longdblsize'
23463 longlongsize='$longlongsize'
23464 longsize='$longsize'
23468 lseeksize='$lseeksize'
23469 lseektype='$lseektype'
23472 madlyobj='$madlyobj'
23473 madlysrc='$madlysrc'
23477 make_set_make='$make_set_make'
23478 mallocobj='$mallocobj'
23479 mallocsrc='$mallocsrc'
23480 malloctype='$malloctype'
23482 man1direxp='$man1direxp'
23485 man3direxp='$man3direxp'
23487 mips_type='$mips_type'
23488 mistrustnm='$mistrustnm'
23490 mmaptype='$mmaptype'
23491 modetype='$modetype'
23493 multiarch='$multiarch'
23495 myarchname='$myarchname'
23496 mydomain='$mydomain'
23497 myhostname='$myhostname'
23500 need_va_copy='$need_va_copy'
23501 netdb_hlen_type='$netdb_hlen_type'
23502 netdb_host_type='$netdb_host_type'
23503 netdb_name_type='$netdb_name_type'
23504 netdb_net_type='$netdb_net_type'
23507 nm_so_opt='$nm_so_opt'
23508 nonxs_ext='$nonxs_ext'
23510 nvEUformat='$nvEUformat'
23511 nvFUformat='$nvFUformat'
23512 nvGUformat='$nvGUformat'
23513 nv_overflows_integers_at='$nv_overflows_integers_at'
23514 nv_preserves_uv_bits='$nv_preserves_uv_bits'
23515 nveformat='$nveformat'
23516 nvfformat='$nvfformat'
23517 nvgformat='$nvgformat'
23520 o_nonblock='$o_nonblock'
23522 old_pthread_create_joinable='$old_pthread_create_joinable'
23523 optimize='$optimize'
23524 orderlib='$orderlib'
23527 otherlibdirs='$otherlibdirs'
23531 patchlevel='$patchlevel'
23532 path_sep='$path_sep'
23535 perl_patchlevel='$perl_patchlevel'
23536 perl_static_inline='$perl_static_inline'
23537 perladmin='$perladmin'
23538 perllibs='$perllibs'
23539 perlpath='$perlpath'
23541 phostname='$phostname'
23547 prefixexp='$prefixexp'
23549 privlibexp='$privlibexp'
23550 procselfexe='$procselfexe'
23551 prototype='$prototype'
23553 quadkind='$quadkind'
23554 quadtype='$quadtype'
23555 randbits='$randbits'
23556 randfunc='$randfunc'
23557 random_r_proto='$random_r_proto'
23558 randseedtype='$randseedtype'
23560 rd_nodata='$rd_nodata'
23561 readdir64_r_proto='$readdir64_r_proto'
23562 readdir_r_proto='$readdir_r_proto'
23563 revision='$revision'
23569 sGMTIME_max='$sGMTIME_max'
23570 sGMTIME_min='$sGMTIME_min'
23571 sLOCALTIME_max='$sLOCALTIME_max'
23572 sLOCALTIME_min='$sLOCALTIME_min'
23573 sPRIEUldbl='$sPRIEUldbl'
23574 sPRIFUldbl='$sPRIFUldbl'
23575 sPRIGUldbl='$sPRIGUldbl'
23576 sPRIXU64='$sPRIXU64'
23578 sPRIeldbl='$sPRIeldbl'
23579 sPRIfldbl='$sPRIfldbl'
23580 sPRIgldbl='$sPRIgldbl'
23585 sSCNfldbl='$sSCNfldbl'
23586 sched_yield='$sched_yield'
23587 scriptdir='$scriptdir'
23588 scriptdirexp='$scriptdirexp'
23590 seedfunc='$seedfunc'
23591 selectminbits='$selectminbits'
23592 selecttype='$selecttype'
23593 sendmail='$sendmail'
23594 setgrent_r_proto='$setgrent_r_proto'
23595 sethostent_r_proto='$sethostent_r_proto'
23596 setlocale_r_proto='$setlocale_r_proto'
23597 setnetent_r_proto='$setnetent_r_proto'
23598 setprotoent_r_proto='$setprotoent_r_proto'
23599 setpwent_r_proto='$setpwent_r_proto'
23600 setservent_r_proto='$setservent_r_proto'
23603 sharpbang='$sharpbang'
23604 shmattype='$shmattype'
23605 shortsize='$shortsize'
23608 sig_count='$sig_count'
23609 sig_name='$sig_name'
23610 sig_name_init='$sig_name_init'
23612 sig_num_init='$sig_num_init'
23613 sig_size='$sig_size'
23614 signal_t='$signal_t'
23615 sitearch='$sitearch'
23616 sitearchexp='$sitearchexp'
23618 sitebinexp='$sitebinexp'
23619 sitehtml1dir='$sitehtml1dir'
23620 sitehtml1direxp='$sitehtml1direxp'
23621 sitehtml3dir='$sitehtml3dir'
23622 sitehtml3direxp='$sitehtml3direxp'
23624 sitelib_stem='$sitelib_stem'
23625 sitelibexp='$sitelibexp'
23626 siteman1dir='$siteman1dir'
23627 siteman1direxp='$siteman1direxp'
23628 siteman3dir='$siteman3dir'
23629 siteman3direxp='$siteman3direxp'
23630 siteprefix='$siteprefix'
23631 siteprefixexp='$siteprefixexp'
23632 sitescript='$sitescript'
23633 sitescriptexp='$sitescriptexp'
23634 sizesize='$sizesize'
23635 sizetype='$sizetype'
23639 sockethdr='$sockethdr'
23640 socketlib='$socketlib'
23641 socksizetype='$socksizetype'
23643 spackage='$spackage'
23644 spitshell='$spitshell'
23645 srand48_r_proto='$srand48_r_proto'
23646 srandom_r_proto='$srandom_r_proto'
23648 ssizetype='$ssizetype'
23649 st_ino_sign='$st_ino_sign'
23650 st_ino_size='$st_ino_size'
23651 startperl='$startperl'
23653 static_ext='$static_ext'
23655 stdio_base='$stdio_base'
23656 stdio_bufsiz='$stdio_bufsiz'
23657 stdio_cnt='$stdio_cnt'
23658 stdio_filbuf='$stdio_filbuf'
23659 stdio_ptr='$stdio_ptr'
23660 stdio_stream_array='$stdio_stream_array'
23661 strerror_r_proto='$strerror_r_proto'
23664 subversion='$subversion'
23668 targetarch='$targetarch'
23672 timeincl='$timeincl'
23673 timetype='$timetype'
23674 tmpnam_r_proto='$tmpnam_r_proto'
23680 ttyname_r_proto='$ttyname_r_proto'
23689 uidformat='$uidformat'
23695 uquadtype='$uquadtype'
23696 use5005threads='$use5005threads'
23697 use64bitall='$use64bitall'
23698 use64bitint='$use64bitint'
23699 usecrosscompile='$usecrosscompile'
23700 usedevel='$usedevel'
23702 usedtrace='$usedtrace'
23703 usefaststdio='$usefaststdio'
23704 useithreads='$useithreads'
23705 usekernprocpathname='$usekernprocpathname'
23706 uselargefiles='$uselargefiles'
23707 uselongdouble='$uselongdouble'
23708 usemallocwrap='$usemallocwrap'
23709 usemorebits='$usemorebits'
23710 usemultiplicity='$usemultiplicity'
23711 usemymalloc='$usemymalloc'
23713 usensgetexecutablepath='$usensgetexecutablepath'
23714 useopcode='$useopcode'
23715 useperlio='$useperlio'
23716 useposix='$useposix'
23717 usereentrant='$usereentrant'
23718 userelocatableinc='$userelocatableinc'
23720 useshrplib='$useshrplib'
23721 usesitecustomize='$usesitecustomize'
23722 usesocks='$usesocks'
23723 usethreads='$usethreads'
23724 usevendorprefix='$usevendorprefix'
23725 useversionedarchname='$useversionedarchname'
23726 usevfork='$usevfork'
23729 uvXUformat='$uvXUformat'
23730 uvoformat='$uvoformat'
23733 uvuformat='$uvuformat'
23734 uvxformat='$uvxformat'
23736 vendorarch='$vendorarch'
23737 vendorarchexp='$vendorarchexp'
23738 vendorbin='$vendorbin'
23739 vendorbinexp='$vendorbinexp'
23740 vendorhtml1dir='$vendorhtml1dir'
23741 vendorhtml1direxp='$vendorhtml1direxp'
23742 vendorhtml3dir='$vendorhtml3dir'
23743 vendorhtml3direxp='$vendorhtml3direxp'
23744 vendorlib='$vendorlib'
23745 vendorlib_stem='$vendorlib_stem'
23746 vendorlibexp='$vendorlibexp'
23747 vendorman1dir='$vendorman1dir'
23748 vendorman1direxp='$vendorman1direxp'
23749 vendorman3dir='$vendorman3dir'
23750 vendorman3direxp='$vendorman3direxp'
23751 vendorprefix='$vendorprefix'
23752 vendorprefixexp='$vendorprefixexp'
23753 vendorscript='$vendorscript'
23754 vendorscriptexp='$vendorscriptexp'
23756 version_patchlevel_string='$version_patchlevel_string'
23757 versiononly='$versiononly'
23761 yaccflags='$yaccflags'
23766 : add special variables
23767 $test -f $src/patchlevel.h && \
23768 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23769 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
23770 echo "PERL_CONFIG_SH=true" >>config.sh
23772 : propagate old symbols
23773 if $test -f UU/config.sh; then
23774 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23775 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23776 config.sh config.sh UU/oldconfig.sh |\
23777 $sort | $uniq -u >UU/oldsyms
23778 set X `$cat UU/oldsyms`
23784 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23786 echo ": Variables propagated from previous config.sh file." >>config.sh
23787 for sym in `$cat UU/oldsyms`; do
23788 echo " Propagating $hint variable "'$'"$sym..."
23789 eval 'tmp="$'"${sym}"'"'
23791 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23797 : Finish up by extracting the .SH files
23801 echo "Extraction done."
23811 If you'd like to make any changes to the config.sh file before I begin
23812 to configure things, do it as a shell escape now (e.g. !vi config.sh).
23815 rp="Press return or use a shell escape to edit config.sh:"
23820 *) : in case they cannot read
23821 sh 1>&4 -c "$ans";;
23826 : if this fails, just run all the .SH files by hand
23835 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
23842 Now you need to generate make dependencies by running "$make depend".
23843 You might prefer to run it in background: "$make depend > makedepend.out &"
23844 It can take a while, so you might not want to run it right now.
23849 rp="Run $make depend now?"
23853 $make depend && echo "Now you must run '$make'."
23856 echo "You must run '$make depend' then '$make'."
23859 elif test -f [Mm]akefile; then
23861 echo "Now you must run a $make."
23863 echo "Configure done."
23866 if $test -f Policy.sh; then
23869 If you compile $package on a different machine or from a different object
23870 directory, copy the Policy.sh file from this object directory to the
23871 new one before you run Configure -- this will help you with most of
23872 the policy defaults.
23876 if $test -f config.msg; then
23877 echo "Hmm. I also noted the following information while running:"
23879 $cat config.msg >&4
23882 $rm -f kit*isdone ark*isdone