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.sourceforge.net/svnroot/dist/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 # $Id: Head.U 6 2006-08-25 22:21:46Z rmanfredi $
33 # Generated on Wed Jun 23 16:03:55 CEST 2010 [metaconfig 3.5 PL0]
34 # (with additional metaconfig patches by perlbug@perl.org)
39 SCO csh still thinks true is false. Write to SCO today and tell them that next
40 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
42 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
43 we'd have to do is go in and swap the && and || tokens, wherever they are.)
45 [End of diatribe. We now return you to your regularly scheduled programming...]
49 OOPS! You naughty creature! You didn't run Configure with sh!
50 I will attempt to remedy the situation by running sh for you...
54 true || exec sh $0 $argv:q
56 (exit $?0) || cat c2$$
57 (exit $?0) || exec sh $0 $argv:q
60 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
63 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
64 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
65 *** Please read the README.plan9 for further instructions.
66 *** Cannot continue, aborting.
72 if test ! -c /dev/null ; then
75 *** I'm sorry, but /dev/null appears to be a file rather than a device.
76 *** Please consult your operating sytem's notes for making a device
78 *** Cannot continue, aborting.
84 : compute my invocation name
88 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
93 : Proper separator for the PATH environment variable
95 : On OS/2 this directory should exist if this is not floppy only system ":-]"
96 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
97 if test -n "$OS2_SHELL"; then
99 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
100 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
102 elif test -n "$DJGPP"; then
103 case "X${MACHTYPE:-nonesuchmach}" in
110 : Proper PATH setting
111 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
112 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
113 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
114 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
115 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
116 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
117 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
118 paths="$paths /sbin /usr/sbin /usr/libexec"
119 paths="$paths /system/gnu_library/bin"
123 case "$p_$PATH$p_" in
125 *) test -d $p && PATH=$PATH$p_$p ;;
132 : shall we be using ksh?
138 if (PATH=.; alias -x) >/dev/null 2>&1; then
141 if test -f /hp-ux -a -f /bin/ksh; then
142 needksh='to avoid sh bug in "here document" expansion'
144 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
145 if test X`/usr/bin/uname -v` = X4; then
146 avoidksh="to avoid AIX 4's /bin/sh"
150 if test -f /osf_boot -a -f /usr/sbin/setld; then
151 if test X`/usr/bin/uname -s` = XOSF1; then
152 avoidksh="to avoid Digital UNIX' ksh"
157 case "$inksh/$needksh" in
164 case "$inksh/$avoidksh" in
170 case "$inksh/$needksh-$avoidksh-" in
173 (I see you are using the Korn shell. Some ksh's blow up on $me,
174 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
181 echo "(Feeding myself to $newsh $reason.)"
183 Configure|*/Configure) exec $newsh $0 "$@";;
184 *) exec $newsh Configure "$@";;
188 test -x "${newsh}" || unset newsh
190 : if needed, set CDPATH to a harmless value that is not chatty
191 : avoid bash 2.02 problems with empty CDPATH.
195 *bash*) CDPATH='.' ;;
201 : Configure runs within the UU subdirectory
202 test -d UU || mkdir UU
342 initialinstalllocation=''
371 d_attribute_deprecated=''
372 d_attribute_format=''
373 d_attribute_malloc=''
374 d_attribute_nonnull=''
375 d_attribute_noreturn=''
377 d_attribute_unused=''
378 d_attribute_warn_unused_result=''
379 d_printf_format_null=''
382 d_builtin_choose_expr=''
385 d_c99_variadic_macros=''
432 endhostent_r_proto=''
438 endprotoent_r_proto=''
444 endservent_r_proto=''
497 gethostbyaddr_r_proto=''
499 gethostbyname_r_proto=''
501 gethostent_r_proto=''
514 getnetbyaddr_r_proto=''
516 getnetbyname_r_proto=''
530 d_getprotobyname_r=''
531 getprotobyname_r_proto=''
532 d_getprotobynumber_r=''
533 getprotobynumber_r_proto=''
535 getprotoent_r_proto=''
547 getservbyname_r_proto=''
549 getservbyport_r_proto=''
551 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=''
740 d_sprintf_returns_strlen=''
752 perl_static_inline=''
757 d_stdio_ptr_lval_nochange_cnt=''
758 d_stdio_ptr_lval_sets_cnt=''
902 d_gdbm_ndbm_h_uses_prototypes=''
903 d_gdbmndbm_h_uses_prototypes=''
905 d_ndbm_h_uses_prototypes=''
979 d_inc_version_list=''
981 inc_version_list_init=''
1000 ignore_versioned_solibs=''
1064 d_perl_otherlibdirs=''
1072 api_versionstring=''
1078 version_patchlevel_string=''
1082 d_nv_preserves_uv=''
1083 d_nv_zero_is_allbits_zero=''
1094 nv_overflows_integers_at=''
1095 nv_preserves_uv_bits=''
1167 installsitehtml1dir=''
1170 installsitehtml3dir=''
1177 installsiteman1dir=''
1180 installsiteman3dir=''
1185 installsitescript=''
1200 d_stdio_stream_array=''
1201 stdio_stream_array=''
1218 ccflags_uselargefiles=''
1219 ldflags_uselargefiles=''
1220 libswanted_uselargefiles=''
1241 installvendorarch=''
1248 installvendorhtml1dir=''
1250 vendorhtml1direxp=''
1251 installvendorhtml3dir=''
1253 vendorhtml3direxp=''
1259 installvendorman1dir=''
1262 installvendorman3dir=''
1269 installvendorscript=''
1282 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1285 : We must find out about Eunice early
1287 if test -f /etc/unixtovms; then
1288 eunicefix=/etc/unixtovms
1290 if test -f /etc/unixtovms.exe; then
1291 eunicefix=/etc/unixtovms.exe
1294 : Set executable suffix now -- needed before hints available
1295 if test -f "/libs/version.library"; then
1298 elif test -f "/system/gnu_library/bin/ar.pm"; then
1301 elif test -n "$DJGPP"; then
1304 elif test -d c:/. -o -n "$is_os2" ; then
1311 : Trailing extension. Override this in a hint file, if needed.
1312 : Extra object files, if any, needed on this platform.
1316 : change the next line if compiling for Xenix/286 on Xenix/386
1317 xlibpth='/usr/lib/386 /lib/386'
1318 : Possible local library directories to search.
1319 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1320 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1322 : general looking path for locating libraries
1323 glibpth="/lib /usr/lib $xlibpth"
1324 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1325 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1326 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1327 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1329 : Private path used by Configure to find libraries. Its value
1330 : is prepended to libpth. This variable takes care of special
1331 : machines, like the mips. Usually, it should be empty.
1334 : default library list
1336 : some systems want to use only the non-versioned libso:s
1337 ignore_versioned_solibs=''
1338 : set usethreads on the Configure command line to enable threads.
1339 usereentrant='undef'
1340 : full support for void wanted by default
1343 : Possible local include directories to search.
1344 : Set locincpth to "" in a hint file to defeat local include searches.
1345 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1346 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1348 : no include file wanted by default
1351 : Enable -DEBUGGING and -DDEBUGGING from the command line
1358 : set useposix=false in your hint file to disable the POSIX extension.
1360 : set useopcode=false in your hint file to disable the Opcode extension.
1363 ccflags_uselargefiles=''
1364 ldflags_uselargefiles=''
1365 libswanted_uselargefiles=''
1366 : set usemultiplicity on the Configure command line to enable multiplicity.
1367 : set usesocks on the Configure command line to enable socks.
1368 : List of libraries we want.
1369 : If anyone needs extra -lxxx, put those in a hint file.
1370 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1371 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1372 : We probably want to search /usr/shlib before most other libraries.
1373 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1374 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1375 glibpth="/usr/shlib $glibpth"
1376 : Do not use vfork unless overridden by a hint file.
1379 : Find the basic shell for Bourne shell scripts
1383 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1386 if test -f "$xxx"; then
1389 : Build up a list and do a single loop so we can 'break' out.
1390 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1391 for xxx in sh bash ksh pdksh ash; do
1393 try="$try ${p}/${xxx}"
1397 if test -f "$xxx"; then
1400 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1403 elif test -f "$xxx.exe"; then
1414 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1416 Usually it's in /bin/sh. How did you even get this far?
1417 Please contact me (Perl Maintainers) at perlbug@perl.org and
1418 we'll try to straighten this all out.
1424 : see if sh knows # comments
1425 if `$sh -c '#' >/dev/null 2>&1`; then
1429 test -f $xcat$_exe || xcat=/usr/bin/cat
1430 if test ! -f $xcat$_exe; then
1431 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1432 if test -f $p/cat$_exe; then
1437 if test ! -f $xcat$_exe; then
1438 echo "Can't find cat anywhere!"
1442 echo "#!$xcat" >sharp
1445 ./sharp > today 2>/dev/null
1446 if test -s today; then
1449 echo "#! $xcat" > sharp
1452 ./sharp > today 2>/dev/null
1453 if test -s today; then
1461 echo "Your $sh doesn't grok # comments--I will strip them later on."
1464 echo "exec grep -v '^[ ]*#'" >spitshell
1466 $eunicefix spitshell
1467 spitshell=`pwd`/spitshell
1469 echo "I presume that if # doesn't work, #! won't work either!"
1474 : figure out how to guarantee sh startup
1476 '') startsh=${sharpbang}${sh} ;;
1488 : echo "Yup, it does."
1490 echo "Hmm... '$startsh' does not guarantee sh startup..."
1491 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1495 : Save command line options in file UU/cmdline.opt for later use in
1496 : generating config.sh.
1497 cat > cmdline.opt <<EOSH
1498 : Configure command line arguments.
1507 cat >>cmdline.opt <<EOSH
1508 config_arg$argn='$arg'
1510 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1513 arg_exp=`cat cmdl.opt`
1514 args_exp="$args_exp$args_sep'$arg_exp'"
1515 argn=`expr $argn + 1`
1520 : produce awk script to parse command line options
1521 cat >options.awk <<'EOF'
1523 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1525 len = length(optstr);
1526 for (i = 1; i <= len; i++) {
1527 c = substr(optstr, i, 1);
1528 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1539 if (substr(str, 1, 1) != "-") {
1540 printf("'%s'\n", str);
1544 for (i = 2; i <= len; i++) {
1545 c = substr(str, i, 1);
1547 printf("-%s\n", substr(str, i));
1553 printf("'%s'\n", substr(str, i + 1));
1566 : process the command line options
1567 set X `for arg in "$@"; do echo "X$arg"; done |
1568 sed -e s/X// | awk -f options.awk`
1573 : set up default values
1583 rm -f optdef.sh posthint.sh
1584 cat >optdef.sh <<EOS
1590 while test $# -gt 0; do
1592 -d) shift; fastread=yes;;
1593 -e) shift; alldone=cont;;
1597 if test -r "$1"; then
1600 echo "$me: cannot read config file $1." >&2
1606 -h) shift; error=true;;
1607 -r) shift; reuseval=true;;
1608 -s) shift; silent=true; realsilent=true;;
1609 -E) shift; alldone=exit;;
1610 -K) shift; knowitall=true;;
1611 -O) shift; override=true;;
1612 -S) shift; silent=true; extractsh=true;;
1617 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1618 echo "$me: ignoring -D $1" >&2
1621 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1622 *) echo "$1='define'" >> optdef.sh;;
1629 *=) echo "$1" >> optdef.sh;;
1631 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1632 echo "$me: ignoring -U $1" >&2
1634 *) echo "$1='undef'" >> optdef.sh;;
1645 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1649 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1650 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1656 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1657 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1658 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1659 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1660 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1661 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1667 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1669 echo "$yyy=''" >> posthint.sh ;;
1674 echo "$yyy='$zzz'" >> posthint.sh ;;
1676 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1678 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1683 echo "$yyy=$zzz" >> posthint.sh ;;
1684 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1688 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1691 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1699 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1700 [-U symbol] [-U symbol=] [-A command:symbol...]
1701 -d : use defaults for all answers.
1702 -e : go on without questioning past the production of config.sh.
1703 -f : specify an alternate default configuration file.
1704 -h : print this help message and exit (with an error status).
1705 -r : reuse C symbols value if possible (skips costly nm extraction).
1706 -s : silent mode, only echoes questions and essential information.
1707 -D : define symbol to have some value:
1708 -D symbol symbol gets the value 'define'
1709 -D symbol=value symbol gets the value 'value'
1710 common used examples (see INSTALL for more info):
1711 -Duse64bitint use 64bit integers
1712 -Duse64bitall use 64bit integers and pointers
1713 -Dusethreads use thread support
1714 -Dinc_version_list=none do not include older perl trees in @INC
1715 -DEBUGGING=none DEBUGGING options
1716 -Dcc=gcc choose your compiler
1717 -Dprefix=/opt/perl5 choose your destination
1718 -E : stop at the end of questions, after having produced config.sh.
1719 -K : do not use unless you know what you are doing.
1720 -O : let -D and -U override definitions from loaded configuration file.
1721 -S : perform variable substitutions on all .SH files (can mix with -f)
1722 -U : undefine symbol:
1723 -U symbol symbol gets the value 'undef'
1724 -U symbol= symbol gets completely empty
1726 -A : manipulate symbol after the platform specific hints have been applied:
1727 -A append:symbol=value append value to symbol
1728 -A symbol=value like append:, but with a separating space
1729 -A define:symbol=value define symbol to have value
1730 -A clear:symbol define symbol to be ''
1731 -A define:symbol define symbol to be 'define'
1732 -A eval:symbol=value define symbol to be eval of value
1733 -A prepend:symbol=value prepend value to symbol
1734 -A undef:symbol define symbol to be 'undef'
1735 -A undef:symbol= define symbol to be ''
1736 e.g.: -A prepend:libswanted='cl pthread '
1737 -A ccflags=-DSOME_MACRO
1738 -V : print version number and exit (with a zero status).
1745 case "$fastread$alldone" in
1748 case "$extractsh" in
1751 if test ! -t 0; then
1752 echo "Say 'sh Configure', not 'sh <Configure'"
1762 true) exec 1>/dev/null;;
1765 : run the defines and the undefines, if any, but leave the file out there...
1768 : create the posthint manipulation script and leave the file out there...
1773 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1774 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1775 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1776 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1777 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1780 : Some greps do not return status, grrr.
1781 echo "grimblepritz" >grimble
1782 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1784 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1790 : the following should work in any shell
1794 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1795 cat >contains <<'EOSS'
1796 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1801 : Find the path to the source tree
1804 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1808 *) src=`cd ../$src && pwd` ;;
1821 if test -f $rsrc/Configure && \
1822 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1824 : found it, so we are ok.
1827 for src in . .. ../.. ../../.. ../../../..; do
1828 if test -f ../$src/Configure && \
1829 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1840 Sorry, I can't seem to locate the source dir for $package. Please start
1841 Configure with an explicit path -- i.e. /some/path/Configure.
1849 echo "Sources for $package found in \"$src\"." >&4
1853 : script used to extract .SH files with variable substitutions
1854 cat >extract <<'EOS'
1856 echo "Doing variable substitutions on .SH files..."
1857 if test -f MANIFEST; then
1858 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1860 echo "(Looking for .SH files under the source directory.)"
1861 set x `(cd "$src"; find . -name "*.SH" -print)`
1865 0) set x `(cd "$src"; echo *.SH)`; shift;;
1867 if test ! -f "$src/$1"; then
1873 while test $name; do
1874 if test ! -d "$name"; then
1875 create="$name $create";
1876 name=`echo $name | sed -e "s|^[^/]*$||"`;
1877 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1882 for file in $create; do
1891 dir=`expr X$file : 'X\(.*\)/'`
1892 file=`expr X$file : 'X.*/\(.*\)'`
1893 (cd "$dir" && . ./$file)
1903 dir=`expr X$file : 'X\(.*\)/'`
1904 file=`expr X$file : 'X.*/\(.*\)'`
1905 (set x $dir; shift; eval $mkdir_p)
1906 sh <"$src/$dir/$file"
1915 if test -f "$src/config_h.SH"; then
1916 if test ! -f config.h; then
1917 : oops, they left it out of MANIFEST, probably, so do it anyway.
1918 . "$src/config_h.SH"
1923 : extract files and exit if asked to do so
1924 case "$extractsh" in
1926 case "$realsilent" in
1930 case "$config_sh" in
1931 '') config_sh='config.sh';;
1934 echo "Fetching answers from $config_sh..."
1937 test "$override" && . ./optdef.sh
1941 echo "Extraction done."
1946 : Eunice requires " " instead of "", can you believe it
1949 echo "Beginning of configuration questions for $package."
1951 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1953 : first determine how to suppress newline on echo command
1955 echo "Checking echo to see how to suppress newlines..."
1956 (echo "hi there\c" ; echo " ") >.echotmp
1957 if $contains c .echotmp >/dev/null 2>&1 ; then
1968 echo $n "The star should be here-->$c"
1972 : Now test for existence of everything in MANIFEST
1974 if test -f "$rsrc/MANIFEST"; then
1975 echo "First let's make sure your kit is complete. Checking..." >&4
1976 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1977 (split -l 50 2>/dev/null || split -50)
1980 for filelist in x??; do
1981 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1982 >/dev/null 2>>"$tmppwd/missing")
1984 if test -s missing; then
1988 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1990 You have the option of continuing the configuration process, despite the
1991 distinct possibility that your kit is damaged, by typing 'y'es. If you
1992 do, don't blame me if something goes wrong. I advise you to type 'n'o
1993 and contact the author (perlbug@perl.org).
1996 echo $n "Continue? [n] $c" >&4
2000 echo "Continuing..." >&4
2004 echo "ABORTING..." >&4
2009 echo "Looks good..."
2012 echo "There is no MANIFEST file. I hope your kit is complete !"
2016 : Find the appropriate value for a newline for tr
2018 if test -n "$DJGPP"; then
2021 if test X"$trnl" = X; then
2022 case "`echo foo|tr '\n' x 2>/dev/null`" in
2026 if test X"$trnl" = X; then
2027 case "`echo foo|tr '\012' x 2>/dev/null`" in
2028 foox) trnl='\012' ;;
2031 if test X"$trnl" = X; then
2032 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2033 fooxy) trnl='\n\r' ;;
2036 if test X"$trnl" = X; then
2039 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2045 : compute the number of columns on the terminal for proper question formatting
2050 : set up the echo used in my read
2051 myecho="case \"\$xxxm\" in
2052 '') echo $n \"\$rp $c\" >&4;;
2054 '') echo $n \"[\$xxxm] $c\";;
2056 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2058 echo $n \"[\$xxxm] $c\" >&4
2060 echo $n \"\$rp [\$xxxm] $c\" >&4
2066 : now set up to do reads with possible shell escape and default assignment
2072 case "\$fastread" in
2073 yes) case "\$dflt" in
2076 case "\$silent-\$rp" in
2081 *) case "\$silent" in
2082 true) case "\$rp" in
2087 while expr "X\$ans" : "X!" >/dev/null; do
2091 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2099 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2108 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2113 echo "(OK, I'll run with -d after this question.)" >&4
2116 echo "*** Sorry, \$1 not supported yet." >&4
2126 echo "*** Substitution done -- please confirm."
2128 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2133 echo "*** Error -- try again."
2140 case "\$ans\$xxxm\$nostick" in
2152 : create .config dir to save info across Configure sessions
2153 test -d ../.config || mkdir ../.config
2154 cat >../.config/README <<EOF
2155 This directory created by Configure to save information that should
2156 persist across sessions for $package.
2158 You may safely delete it if you wish.
2161 : See if we are using a devel version and want that
2162 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2165 usedevel="$define" ;;
2166 *) case "$xversion" in
2169 *** WHOA THERE!!! ***
2171 This is an UNSTABLE DEVELOPMENT release.
2172 The version of this $package distribution is $xversion, that is, odd,
2173 (as opposed to even) and that signifies a development release.
2174 If you want a maintenance release, you want an even-numbered version.
2176 Do ***NOT*** install this into production use.
2177 Data corruption and crashes are possible.
2179 It is most seriously suggested that you do not continue any further
2180 unless you want to help in developing and debugging Perl.
2182 If you *still* want to build perl, you can answer 'y' now,
2183 or pass -Dusedevel to Configure.
2186 rp='Do you really want to continue?'
2190 [yY]) echo >&4 "Okay, continuing."
2191 usedevel="$define" ;;
2192 *) echo >&4 "Okay, bye."
2203 case "$versiononly" in
2204 '') versiononly="$define" ;;
2206 case "$installusrbinperl" in
2207 '') installusrbinperl="$undef" ;;
2212 : general instructions
2215 user=`(logname) 2>/dev/null`
2217 '') user=`whoami 2>&1`;;
2219 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2222 rp='Would you like to see the instructions?'
2233 This installation shell script will examine your system and ask you questions
2234 to determine how the perl5 package should be installed. If you get
2235 stuck on a question, you may use a ! shell escape to start a subshell or
2236 execute a command. Many of the questions will have default answers in square
2237 brackets; typing carriage return will give you the default.
2239 On some of the questions which ask for file or directory names you are allowed
2240 to use the ~name construct to specify the login directory belonging to "name",
2241 even if you don't have a shell which knows about that. Questions where this is
2242 allowed will be marked "(~name ok)".
2246 dflt='Type carriage return to continue'
2250 The prompter used in this script allows you to use shell variables and
2251 backticks in your answers. You may use $1, $2, etc... to refer to the words
2252 in the default answer, as if the default line was a set of arguments given to a
2253 script shell. This means you may also use $* to repeat the whole default line,
2254 so you do not have to re-type everything to add something to the default.
2256 Everytime there is a substitution, you will have to confirm. If there is an
2257 error (e.g. an unmatched backtick), the default answer will remain unchanged
2258 and you will be prompted again.
2260 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2261 the questions and use the computed defaults (or the previous answers if there
2262 was already a config.sh file). Type 'Configure -h' for a list of options.
2263 You may also start interactively and then answer '& -d' at any prompt to turn
2264 on the non-interactive behaviour for the remainder of the execution.
2270 Much effort has been expended to ensure that this shell script will run on any
2271 Unix system. If despite that it blows up on yours, your best bet is to edit
2272 Configure and run it again. If you can't run Configure for some reason,
2273 you'll have to generate a config.sh file by hand. Whatever problems you
2274 have, let me (perlbug@perl.org) know how I blew it.
2276 This installation script affects things in two ways:
2278 1) it may do direct variable substitutions on some of the files included
2280 2) it builds a config.h file for inclusion in C programs. You may edit
2281 any of these files as the need arises after running this script.
2283 If you make a mistake on a question, there is no easy way to back up to it
2284 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2285 files. Configure will offer to let you do this before it runs the SH files.
2288 dflt='Type carriage return to continue'
2290 case "$firsttime" in
2291 true) echo $user >>../.config/instruct;;
2295 : find out where common programs are
2297 echo "Locating common programs..." >&4
2310 if test -d \$dir/\$thing; then
2316 for thisthing in \$dir/\$thing; do
2317 : just loop through to pick last item
2319 if test -f \$thisthing; then
2322 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2325 elif test -f \$dir/\$thing.exe; then
2326 if test -n "$DJGPP"; then
2327 echo \$dir/\$thing.exe
2328 elif test "$eunicefix" != ":"; then
2329 : on Eunice apparently
2381 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2382 pth="$pth /lib /usr/lib"
2383 for file in $loclist; do
2387 if test -f "$xxx"; then
2390 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2391 xxx=`./loc $file $file $pth`
2394 '') xxx=`./loc $file $file $pth`;;
2395 *) xxx=`./loc $xxx $xxx $pth`;;
2397 eval $file=$xxx$_exe
2401 echo $file is in $xxx.
2404 echo $file is in $xxx.
2407 echo "I don't know where '$file' is, and my life depends on it." >&4
2408 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2414 echo "Don't worry if any of the following aren't found..."
2416 for file in $trylist; do
2420 if test -f "$xxx"; then
2423 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2424 xxx=`./loc $file $file $pth`
2427 '') xxx=`./loc $file $file $pth`;;
2428 *) xxx=`./loc $xxx $xxx $pth`;;
2430 eval $file=$xxx$_exe
2434 echo $file is in $xxx.
2437 echo $file is in $xxx.
2440 echo "I don't see $file out there, $say."
2447 echo "Substituting grep for egrep."
2454 *) if $less -R </dev/null >/dev/null; then
2455 echo "Substituting less -R for less."
2463 echo "Substituting cp for ln."
2472 echo "I can't find make or gmake, and my life depends on it." >&4
2473 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2481 *) # We can't have osname yet.
2482 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2483 # Assume that gmake, if found, is definitely GNU make
2484 # and prefer it over the system make.
2485 echo "Substituting gmake for make."
2493 echo "Hopefully test is built into your sh."
2496 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2497 echo "Using the test built into your sh."
2505 echo "Hopefully echo is built into your sh."
2510 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2511 $echo $n "hi there$c" >foo1
2512 echo $n "hi there$c" >foo2
2513 if cmp foo1 foo2 >/dev/null 2>&1; then
2514 echo "They are compatible. In fact, they may be identical."
2521 They are not compatible! You are probably running ksh on a non-USG system.
2522 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2523 have echo built in and we may have to run some Bourne shell scripts. That
2524 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2527 $echo $n "The star should be here-->$c"
2534 # This question was auctioned at YAPC::Europe-2007 in Vienna
2535 # I never promised you could answer it. I only auctioned the question.
2537 The following message is sponsored by
2539 Dresden.pm<--The stars should be here.
2541 Dear Perl user, system administrator or package
2542 maintainer, the Perl community sends greetings to
2543 you. Do you (emblematical) greet back [Y/n]? n
2547 : Check what type of C compiler we use
2551 cat <<'EOSC' >>trygcc
2556 int main(int argc, char *argv[]) {
2560 if $cc -o try $ccflags $ldflags try.c; then
2563 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2569 # Skip this test because it gives a false match on output like:
2570 # ./trygcc: line 23: cc: command not found
2571 # case "`$cc -v -c try.c 2>&1`" in
2572 # *gcc*) trygcc=no ;;
2574 if $test X"$trygcc" = Xyes; then
2575 if gcc -o try -c try.c; then
2577 echo "You seem to have a working gcc, though." >&4
2578 # Switching compilers may undo the work of hints files.
2579 # The most common problem is -D_REENTRANT for threads.
2580 # This heuristic catches that case, but gets false positives
2581 # if -Dusethreads was not actually specified. Better to
2582 # bail out here with a useful message than fail
2583 # mysteriously later. Should we perhaps just try to
2584 # re-invoke Configure -Dcc=gcc config_args ?
2585 if $test -f usethreads.cbu; then
2588 *** However, any setting of the C compiler flags (e.g. for thread support)
2589 *** will be lost. It may be necessary for you to restart Configure and
2590 *** add -Dcc=gcc to your Configure command line.
2593 rp="Would you like to go ahead and try gcc anyway?"
2596 rp="Would you like to use it?"
2599 if $test -f myread; then
2602 if $test -f UU/myread; then
2605 echo "Cannot find myread, sorry. Aborting." >&2
2610 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2623 cat <<'EOSC' >>checkcc
2628 int main(int argc, char *argv[]) {
2632 if $cc -o try $ccflags $ldflags try.c; then
2635 if $test X"$despair" = Xyes; then
2636 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2639 You need to find a working C compiler.
2640 Either (purchase and) install the C compiler supplied by your OS vendor,
2641 or for a free C compiler try http://gcc.gnu.org/
2642 I cannot continue any further, aborting.
2651 : determine whether symbolic links are supported
2654 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2655 echo "Symbolic links are supported." >&4
2658 echo "Symbolic links are NOT supported." >&4
2663 : determine whether symbolic links are supported
2667 echo "Checking how to test for symbolic links..." >&4
2669 if $test "X$issymlink" = X; then
2671 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2672 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2674 if test $? = 0; then
2677 echo "Your builtin 'test -h' may be broken." >&4
2680 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2683 if test -f "$p/$test"; then
2692 echo "Trying external '$test -h'." >&4
2693 issymlink="$test -h"
2694 if $test ! -h sym >/dev/null 2>&1; then
2695 echo "External '$test -h' is broken, too." >&4
2703 if $test "X$issymlink" = X; then
2704 if $test -L sym 2>/dev/null; then
2705 issymlink="$test -L"
2706 echo "The builtin '$test -L' worked." >&4
2709 if $test "X$issymlink" != X; then
2710 echo "You can test for symbolic links with '$issymlink'." >&4
2712 echo "I do not know how you can test for symbolic links." >&4
2716 *) echo "No symbolic links, so not testing for their testing..." >&4
2721 : Make symlinks util
2722 case "$mksymlinks" in
2725 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2728 *) case "$lns:$issymlink" in
2729 *"ln"*" -s:"*"test -"?)
2730 echo "Creating the symbolic links..." >&4
2731 echo "(First creating the subdirectories...)" >&4
2733 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2735 test -z "$directory" && break
2739 if test ! -d t/base; then
2740 echo "Failed to create the subdirectories. Aborting." >&4
2743 echo "(Then creating the symlinks...)" >&4
2744 awk '{print $1}' $src/MANIFEST | while true; do
2746 test -z "$filename" && break
2747 if test -f $filename; then
2748 if $issymlink $filename; then
2752 if test -f $filename; then
2753 echo "$filename already exists, not symlinking."
2755 ln -s $src/$filename $filename
2759 if test ! -f t/base/lex.t; then
2760 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2765 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2773 : Check for Cross-Compilation
2774 case "$usecrosscompile" in
2776 $echo "Cross-compiling..."
2779 *-*-gcc) # A cross-compiling gcc, probably.
2780 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2782 # leave out ld, choosing it is more complex
2784 ranlib=$targetarch-ranlib
2785 $echo 'extern int foo;' > try.c
2786 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2788 if $test $# -gt 0; then
2790 incpth="`$echo $incpth|$sed 's/^ //'`"
2791 echo "Guessing incpth '$incpth'." >&4
2793 j="`$echo $i|$sed 's,/include$,/lib,'`"
2794 if $test -d $j; then
2798 libpth="`$echo $libpth|$sed 's/^ //'`"
2799 echo "Guessing libpth '$libpth'." >&4
2804 case "$targetarch" in
2805 '') echo "Targetarch not defined." >&4; croak=y ;;
2806 *) echo "Using targetarch $targetarch." >&4 ;;
2809 '') echo "Incpth not defined." >&4; croak=y ;;
2810 *) echo "Using incpth '$incpth'." >&4 ;;
2813 '') echo "Libpth not defined." >&4; croak=y ;;
2814 *) echo "Using libpth '$libpth'." >&4 ;;
2817 '') for i in $incpth; do
2818 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2820 echo "Guessing usrinc $usrinc." >&4
2825 '') echo "Usrinc not defined." >&4; croak=y ;;
2828 *) echo "Using usrinc $usrinc." >&4 ;;
2830 case "$targethost" in
2831 '') echo "Targethost not defined." >&4; croak=y ;;
2832 *) echo "Using targethost $targethost." >&4
2837 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2840 /*) run=$src/Cross/run
2841 targetmkdir=$src/Cross/mkdir
2843 from=$src/Cross/from
2845 *) pwd=`$test -f ../Configure & cd ..; pwd`
2847 targetmkdir=$pwd/Cross/mkdir
2849 from=$pwd/Cross/from
2852 case "$targetrun" in
2853 '') targetrun=ssh ;;
2858 case "$targetfrom" in
2859 '') targetfrom=scp ;;
2863 from=$from-$targetfrom
2864 case "$targetdir" in
2866 echo "Guessing targetdir $targetdir." >&4
2869 case "$targetuser" in
2871 echo "Guessing targetuser $targetuser." >&4
2874 case "$targetfrom" in
2878 case "$targetrun" in
2890 '') cwd=$targetdir ;;
2894 if $test ! -f \$exe.xok; then
2898 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2901 *) echo "Unknown targetrun '$targetrun'" >&4
2905 case "$targetmkdir" in
2907 cat >$targetmkdir <<EOF
2909 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2911 $chmod a+rx $targetmkdir
2913 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2925 $targetmkdir \`dirname \$f\`
2926 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2929 $targetmkdir $targetdir/\`dirname \$f\`
2930 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2943 $mkdir -p $targetdir/\`dirname \$f\`
2944 $cp \$f $targetdir/\$f || exit 1
2947 $targetmkdir $targetdir/\`dirname \$f\`
2948 $cp \$f $targetdir/\$f || exit 1
2955 *) echo "Unknown targetto '$targetto'" >&4
2959 case "$targetfrom" in
2966 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2971 cp) cat >$from <<EOF
2976 cp $targetdir/\$f . || exit 1
2981 *) echo "Unknown targetfrom '$targetfrom'" >&4
2985 if $test ! -f $run; then
2986 echo "Target 'run' script '$run' not found." >&4
2990 if $test ! -f $to; then
2991 echo "Target 'to' script '$to' not found." >&4
2995 if $test ! -f $from; then
2996 echo "Target 'from' script '$from' not found." >&4
3000 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3004 Using '$run' for remote execution,
3005 and '$from' and '$to'
3006 for remote file transfer.
3012 usecrosscompile='undef'
3017 : see whether [:lower:] and [:upper:] are supported character classes
3019 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3021 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3025 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3026 # (0xd9 and 0xe2), therefore that is a nice testing point.
3027 if test "X$up" = X -o "X$low" = X; then
3028 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3034 if test "X$up" = X -o "X$low" = X; then
3035 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3041 if test "X$up" = X -o "X$low" = X; then
3042 case "`echo RS | od -x 2>/dev/null`" in
3044 echo "Hey, this might be EBCDIC." >&4
3045 if test "X$up" = X -o "X$low" = X; then
3046 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3047 rs) up='[A-IJ-RS-Z]'
3052 if test "X$up" = X -o "X$low" = X; then
3053 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3063 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3065 echo "Using $up and $low to convert case." >&4
3068 echo "I don't know how to translate letters from upper to lower case." >&4
3069 echo "Your tr is not acting any way I know of." >&4
3073 : set up the translation script tr, must be called with ./tr of course
3077 '[A-Z][a-z]') exec $tr '$up' '$low';;
3078 '[a-z][A-Z]') exec $tr '$low' '$up';;
3085 : Try to determine whether config.sh was made on this system
3086 case "$config_sh" in
3088 myuname=`$uname -a 2>/dev/null`
3089 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3090 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3091 # because the A-Z/a-z are not consecutive.
3092 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3093 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3094 newmyuname="$myuname"
3096 case "$knowitall" in
3098 if test -f ../config.sh; then
3099 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3100 eval "`grep myuname= ../config.sh`"
3102 if test "X$myuname" = "X$newmyuname"; then
3110 : Get old answers from old config file if Configure was run on the
3111 : same system, otherwise use the hints.
3114 if test -f config.sh; then
3116 rp="I see a config.sh file. Shall I use it to set the defaults?"
3119 n*|N*) echo "OK, I'll ignore it."
3120 mv config.sh config.sh.old
3121 myuname="$newmyuname"
3123 *) echo "Fetching default answers from your old config.sh file..." >&4
3131 : Older versions did not always set $sh. Catch re-use of such
3141 if test ! -f config.sh; then
3144 First time through, eh? I have some defaults handy for some systems
3145 that need some extra help getting the Configure answers right:
3148 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3150 : Half the following guesses are probably wrong... If you have better
3151 : tests or hints, please send them to perlbug@perl.org
3152 : The metaconfig authors would also appreciate a copy...
3153 $test -f /irix && osname=irix
3154 $test -f /xenix && osname=sco_xenix
3155 $test -f /dynix && osname=dynix
3156 $test -f /dnix && osname=dnix
3157 $test -f /lynx.os && osname=lynxos
3158 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3159 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3160 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3161 $test -f /bin/mips && /bin/mips && osname=mips
3162 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3163 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3164 $test -d /usr/apollo/bin && osname=apollo
3165 $test -f /etc/saf/_sactab && osname=svr4
3166 $test -d /usr/include/minix && osname=minix
3167 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3168 if $test -d /MachTen -o -d /MachTen_Folder; then
3170 if $test -x /sbin/version; then
3171 osvers=`/sbin/version | $awk '{print $2}' |
3172 $sed -e 's/[A-Za-z]$//'`
3173 elif $test -x /usr/etc/version; then
3174 osvers=`/usr/etc/version | $awk '{print $2}' |
3175 $sed -e 's/[A-Za-z]$//'`
3181 $test -f /sys/posix.dll &&
3182 $test -f /usr/bin/what &&
3183 set X `/usr/bin/what /sys/posix.dll` &&
3184 $test "$3" = UWIN &&
3188 if $test -f $uname; then
3196 umips) osname=umips ;;
3199 [23]100) osname=mips ;;
3200 next*) osname=next ;;
3202 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3203 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3206 elif $test -f /etc/kconfig; then
3208 if test "$lns" = "$ln -s"; then
3210 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3212 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3219 if test -n "$DJGPP"; then
3228 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3230 # oslevel can fail with:
3231 # oslevel: Unable to acquire lock.
3232 *not\ found) osvers="$4"."$3" ;;
3233 '<3240'|'<>3240') osvers=3.2.0 ;;
3234 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3235 '=3250'|'>3250') osvers=3.2.5 ;;
3239 bsd386) osname=bsd386
3242 cygwin*) osname=cygwin
3245 *dc.osx) osname=dcosx
3251 domainos) osname=apollo
3257 dragonfly) osname=dragonfly
3260 dynixptx*) osname=dynixptx
3261 osvers=`echo "$4"|sed 's/^v//'`
3263 freebsd) osname=freebsd
3265 genix) osname=genix ;;
3269 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3285 netbsd*) osname=netbsd
3288 news-os) osvers="$3"
3290 4*) osname=newsos4 ;;
3294 next*) osname=next ;;
3295 nonstop-ux) osname=nonstopux ;;
3296 openbsd) osname=openbsd
3302 POSIX-BC | posix-bc ) osname=posix-bc
3305 powerux | power_ux | powermax_os | powermaxos | \
3306 powerunix | power_unix) osname=powerux
3312 solaris) osname=solaris
3314 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3321 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3325 titanos) osname=titanos
3334 ultrix) osname=ultrix
3337 osf1|mls+) case "$5" in
3340 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3343 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3346 hp*) osname=hp_osf1 ;;
3347 mips) osname=mips_osf1 ;;
3350 # UnixWare 7.1.2 is known as Open UNIX 8
3351 openunix|unixware) osname=svr5
3359 $2) case "$osname" in
3363 : svr4.x or possibly later
3373 if test -f /stand/boot ; then
3374 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3375 if test -n "$INITPROG" -a -f "$INITPROG"; then
3376 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3377 if test -n "$isesix"; then
3385 *) if test -f /etc/systemid; then
3387 set `echo $3 | $sed 's/\./ /g'` $4
3388 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3390 elif $test -f $src/hints/sco_$1_$2.sh; then
3392 elif $test -f $src/hints/sco_$1.sh; then
3397 '') : Still unknown. Probably a generic Sys V.
3406 *) case "$osname" in
3407 '') : Still unknown. Probably a generic BSD.
3415 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3416 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3417 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3420 $rm -f UU/kernel.what
3421 elif test -d c:/. -o -n "$is_os2" ; then
3428 case "$targetarch" in
3431 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3436 : Now look for a hint file osname_osvers, unless one has been
3437 : specified already.
3440 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3441 : Also try without trailing minor version numbers.
3442 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3443 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3444 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3445 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3448 *) case "$osvers" in
3451 *) if $test -f $src/hints/$file.sh ; then
3453 elif $test -f $src/hints/$xfile.sh ; then
3455 elif $test -f $src/hints/$xxfile.sh ; then
3457 elif $test -f $src/hints/$xxxfile.sh ; then
3459 elif $test -f $src/hints/$xxxxfile.sh ; then
3461 elif $test -f "$src/hints/${osname}.sh" ; then
3470 if $test -f Policy.sh ; then
3473 none) dflt="Policy" ;;
3474 *) dflt="Policy $dflt" ;;
3479 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3483 if $test -f Policy.sh ; then
3486 There's also a Policy hint file available, which should make the
3487 site-specific (policy) questions easier to answer.
3494 You may give one or more space-separated answers, or "none" if appropriate.
3495 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3496 previous run of Configure, you may specify it as well as or instead of
3497 OS-specific hints. If hints are provided for your OS, you should use them:
3498 although Perl can probably be built without hints on many platforms, using
3499 hints often improve performance and may enable features that Configure can't
3500 set up on its own. If there are no hints that match your OS, specify "none";
3501 DO NOT give a wrong version or a wrong OS.
3505 rp="Which of these apply, if any?"
3508 for file in $tans; do
3509 if $test X$file = XPolicy -a -f Policy.sh; then
3511 $cat Policy.sh >> UU/config.sh
3512 elif $test -f $src/hints/$file.sh; then
3513 . $src/hints/$file.sh
3514 $cat $src/hints/$file.sh >> UU/config.sh
3515 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3518 : Give one chance to correct a possible typo.
3519 echo "$file.sh does not exist"
3521 rp="hint to use instead?"
3523 for file in $ans; do
3524 if $test -f "$src/hints/$file.sh"; then
3525 . $src/hints/$file.sh
3526 $cat $src/hints/$file.sh >> UU/config.sh
3527 elif $test X$ans = X -o X$ans = Xnone ; then
3530 echo "$file.sh does not exist -- ignored."
3537 : Remember our hint file for later.
3538 if $test -f "$src/hints/$file.sh" ; then
3548 echo "Fetching default answers from $config_sh..." >&4
3552 cp $config_sh config.sh 2>/dev/null
3562 test "$override" && . ./optdef.sh
3564 : Restore computed paths
3565 for file in $loclist $trylist; do
3566 eval $file="\$_$file"
3571 Configure uses the operating system name and version to set some defaults.
3572 The default value is probably right if the name rings a bell. Otherwise,
3573 since spelling matters for me, either accept the default or answer "none"
3580 ''|' '|none) dflt=none ;;
3581 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3584 *) dflt="$osname" ;;
3586 rp="Operating system name?"
3590 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3596 ''|' '|none) dflt=none ;;
3597 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3598 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3600 ''|' ') dflt=none ;;
3605 *) dflt="$osvers" ;;
3607 rp="Operating system version?"
3617 : who configured the system
3618 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3621 cf_by=`(logname) 2>/dev/null`
3624 cf_by=`(whoami) 2>/dev/null`
3626 "") cf_by=unknown ;;
3631 : decide how portable to be. Allow command line overrides.
3632 case "$d_portable" in
3634 *) d_portable="$define" ;;
3637 : set up shell script to do ~ expansion
3643 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3646 if $test -f /bin/csh; then
3647 /bin/csh -f -c "glob \$1"
3652 name=\`$expr x\$1 : '..\([^/]*\)'\`
3653 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3654 if $test ! -d "\$dir"; then
3656 echo "\$me: can't locate home directory for: \$name" >&2
3661 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3677 : now set up to get a file name
3681 cat <<'EOSC' >>getfile
3697 : getfile will accept an answer from the comma-separated list
3698 : enclosed in parentheses even if it does not meet other criteria.
3699 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3700 fn=`echo $fn | sed 's/(.*)//'`
3706 loc_file=`expr $fn : '.*:\(.*\)'`
3707 fn=`expr $fn : '\(.*\):.*'`
3715 */*) fullpath=true;;
3724 *e*) exp_file=true;;
3727 *p*) nopath_ok=true;;
3732 *d*) type='Directory';;
3733 *l*) type='Locate';;
3738 Locate) what='File';;
3743 case "$d_portable" in
3751 while test "$type"; do
3756 true) rp="$rp (~name ok)";;
3759 if test -f UU/getfile.ok && \
3760 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3779 value=`UU/filexp $ans`
3782 if test "$ans" != "$value"; then
3783 echo "(That expands to $value on this system.)"
3797 /*) value="$ansexp" ;;
3798 [a-zA-Z]:/*) value="$ansexp" ;;
3803 echo "I shall only accept a full path name, as in /bin/ls." >&4
3804 echo "Use a ! shell escape if you wish to check pathnames." >&4
3807 echo "Please give a full path name, starting with slash." >&4
3810 echo "Note that using ~name is ok provided it expands well." >&4
3823 for fp in $gfpth; do
3824 if test "X$fp" = X.; then
3829 if test -f "$pf"; then
3831 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3833 echo "($value is not a plain file, but that's ok.)"
3836 if test X"$type" = X; then
3843 for fp in $gfpth; do
3844 if test "X$fp" = X.; then
3849 direxp="$fp/$ansexp"
3851 if test -d "$direxp"; then
3859 if test -d "$ansexp"; then
3860 echo "(Looking for $loc_file in directory $value.)"
3861 value="$value/$loc_file"
3862 ansexp="$ansexp/$loc_file"
3864 if test -f "$ansexp"; then
3867 case "$nopath_ok" in
3868 true) case "$value" in
3870 *) echo "Assuming $value will be in people's path."
3886 if test "$fastread" = yes; then
3891 rp="$what $value doesn't exist. Use that name anyway?"
3910 test "X$gfpthkeep" != Xy && gfpth=""
3913 : determine root of directory hierarchy where package will be installed.
3916 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3919 dflt=`echo "$prefix" | sed 's/.$//'`
3927 By default, $package will be installed in $dflt/bin, manual pages
3928 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3929 installation directories. Typically this is something like /usr/local.
3930 If you wish to have binaries under /usr/bin but other parts of the
3931 installation under /usr/local, that's ok: you will be prompted
3932 separately for each of the installation directories, the prefix being
3933 only used to set the defaults.
3937 rp='Installation prefix to use?'
3945 *) oldprefix="$prefix";;
3952 : allow them to override the AFS root
3955 *) afsroot=$afsroot ;;
3961 $define|true) afs=true ;;
3962 $undef|false) afs=false ;;
3963 *) if $test -d $afsroot; then
3971 echo "AFS may be running... I'll be extra cautious then..." >&4
3973 echo "AFS does not seem to be running..." >&4
3976 : determine installation prefix for where package is to be installed.
3980 Since you are running AFS, I need to distinguish the directory in which
3981 files will reside from the directory in which they are installed (and from
3982 which they are presumably copied to the former directory by occult means).
3985 case "$installprefix" in
3986 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3987 *) dflt="$installprefix";;
3992 In some special cases, particularly when building $package for distribution,
3993 it is convenient to distinguish the directory in which files should be
3994 installed from the directory ($prefix) in which they will
3995 eventually reside. For most users, these two directories are the same.
3998 case "$installprefix" in
4000 *) dflt=$installprefix;;
4004 rp='What installation prefix should I use for installing files?'
4006 installprefix="$ans"
4007 installprefixexp="$ansexp"
4009 : Perform the prefixexp/installprefixexp correction if necessary
4010 cat <<EOS >installprefix
4013 cat <<'EOSC' >>installprefix
4014 : Change installation prefix, if necessary.
4015 if $test X"$prefix" != X"$installprefix"; then
4016 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4018 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4021 chmod +x installprefix
4022 $eunicefix installprefix
4024 : Set variables such as privlib and privlibexp from the output of ./getfile
4025 : performing the prefixexp/installprefixexp correction if necessary.
4026 cat <<EOS >setprefixvar
4029 cat <<'EOSC' >>setprefixvar
4030 eval "${prefixvar}=\"\$ans\""
4031 eval "${prefixvar}exp=\"\$ansexp\""
4034 chmod +x setprefixvar
4035 $eunicefix setprefixvar
4037 : set up the script used to warn in case of inconsistency
4046 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4048 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4049 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4054 echo "*** WHOA THERE!!! ***" >&4
4055 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4058 rp=" Keep the $hint value?"
4061 y) td=$was; tu=$was;;
4065 : function used to set '$1' to '$val'
4066 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4068 $define$undef) . ./whoa; eval "$var=\$td";;
4069 $undef$define) . ./whoa; eval "$var=\$tu";;
4070 *) eval "$var=$val";;
4073 : Check is we will use socks
4075 $define|true|[yY]*) dflt='y';;
4080 Perl can be built to use the SOCKS proxy protocol library. To do so,
4081 Configure must be run with -Dusesocks. If you use SOCKS you also need
4082 to use the PerlIO abstraction layer, this will be implicitly selected.
4084 If this doesn't make any sense to you, just accept the default '$dflt'.
4086 rp='Build Perl for SOCKS?'
4089 y|Y) val="$define" ;;
4096 $define|true|[yY]*) useperlio="$define";;
4099 : Check if we want perlio
4100 case "$useperlio" in
4101 $define|true|[yY]*|'') dflt='y';;
4106 Previous version of $package used the standard IO mechanisms as
4107 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4108 alternate IO mechanisms via the PerlIO abstraction layer, but the
4109 stdio mechanism is still available if needed. The abstraction layer
4110 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4111 Using PerlIO with sfio may cause problems with some extension modules.
4113 If this doesn't make any sense to you, just accept the default '$dflt'.
4115 rp='Use the PerlIO abstraction layer?'
4122 echo "Ok, doing things the stdio way."
4131 case "$useperlio" in
4132 $define|true|[yY]*) ;;
4135 You are using the SOCKS proxy protocol library which means that you
4136 should also use the PerlIO layer. You may be headed for trouble.
4144 : get the patchlevel
4146 echo "Getting the current patchlevel..." >&4
4147 if $test -r $rsrc/patchlevel.h;then
4148 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4149 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4150 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4151 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4152 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4153 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4154 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4163 $echo "(You do not have patchlevel.h. Eek.)"
4165 if $test -r $rsrc/.patch ; then
4166 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
4167 perl_patchlevel=`cat $rsrc/.patch`
4170 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4171 version_patchlevel_string="version $patchlevel subversion $subversion"
4172 case "$perl_patchlevel" in
4174 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4175 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4179 $echo "(You have $package $version_patchlevel_string.)"
4183 : XXX Should be a Configure test for double-dots in filenames.
4184 version=`echo $revision $patchlevel $subversion | \
4185 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4186 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4187 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4190 version=`echo $revision $patchlevel $subversion | \
4191 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4192 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4193 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4196 : Special case the 5.005_xx maintenance series, which used 5.005
4197 : without any subversion label as a subdirectory in $sitelib
4198 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4199 api_versionstring='5.005'
4202 : Do we want threads support and if so, what type
4203 case "$usethreads" in
4204 $define|true|[yY]*) dflt='y';;
4205 *) # Catch case where user specified ithreads or 5005threads but
4206 # forgot -Dusethreads (A.D. 4/2002)
4207 case "$useithreads$use5005threads" in
4209 case "$useperlio" in
4210 "$define") dflt='y' ;;
4220 Perl can be built to take advantage of threads on some systems.
4221 To do so, Configure can be run with -Dusethreads.
4223 Note that Perl built with threading support runs slightly slower
4224 and uses more memory than plain Perl. The current implementation
4225 is believed to be stable, but it is fairly new, and so should be
4226 treated with caution.
4228 If this doesn't make any sense to you, just accept the default '$dflt'.
4230 rp='Build a threading Perl?'
4233 y|Y) val="$define" ;;
4239 if $test $patchlevel -lt 9; then
4240 case "$usethreads" in
4244 Since release 5.6, Perl has had two different threading implementations,
4245 the newer interpreter-based version (ithreads) with one interpreter per
4246 thread, and the older 5.005 version (5005threads).
4247 The 5005threads version is effectively unmaintained and will probably be
4248 removed in Perl 5.10, so there should be no need to build a Perl using it
4249 unless needed for backwards compatibility with some existing 5.005threads
4253 : Default to ithreads unless overridden on command line or with
4256 case "$use5005threads" in
4257 $define|true|[yY]*) dflt='n';;
4259 case "$useithreads" in
4260 $undef|false|[nN]*) dflt='n';;
4262 rp='Use the newer interpreter-based ithreads?'
4265 y|Y) val="$define" ;;
4270 : Now set use5005threads to the opposite value.
4271 case "$useithreads" in
4272 $define) val="$undef" ;;
4279 useithreads="$undef"
4280 use5005threads="$undef"
4284 case "$useithreads$use5005threads" in
4288 You cannot have both the ithreads and the 5.005 threads enabled
4289 at the same time. Disabling the 5.005 threads since they are
4290 much less stable than the ithreads.
4293 use5005threads="$undef"
4298 : perl-5.9.x and later
4300 if test X"$usethreads" = "X$define"; then
4301 case "$use5005threads" in
4305 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4312 use5005threads="$undef"
4313 useithreads="$usethreads"
4316 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4319 *** To build with ithreads you must also use the PerlIO layer.
4320 *** Cannot continue, aborting.
4326 case "$d_oldpthreads" in
4327 '') : Configure tests would be welcome here. For now, assume undef.
4329 *) val="$d_oldpthreads" ;;
4335 : Look for a hint-file generated 'call-back-unit'. If the
4336 : user has specified that a threading perl is to be built,
4337 : we may need to set or change some other defaults.
4338 if $test -f usethreads.cbu; then
4339 echo "Your platform has some specific hints regarding threaded builds, using them..."
4342 case "$usethreads" in
4343 "$define"|true|[yY]*)
4345 (Your platform does not have any specific hints for threaded builds.
4346 Assuming POSIX threads, then.)
4352 : Check if multiplicity is required
4355 Perl can be built so that multiple Perl interpreters can coexist
4356 within the same Perl executable.
4359 case "$useithreads" in
4362 This multiple interpreter support is required for interpreter-based threads.
4366 *) case "$usemultiplicity" in
4367 $define|true|[yY]*) dflt='y';;
4371 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4372 rp='Build Perl for multiplicity?'
4375 y|Y) val="$define" ;;
4383 : Check if morebits is requested
4384 case "$usemorebits" in
4385 "$define"|true|[yY]*)
4386 use64bitint="$define"
4387 uselongdouble="$define"
4388 usemorebits="$define"
4390 *) usemorebits="$undef"
4394 : Determine the C compiler to be used
4400 rp="Use which C compiler?"
4404 : See whether they have no cc but they do have gcc
4406 if $test -f cc.cbu; then
4411 : make some quick guesses about what we are up against
4413 $echo $n "Hmm... $c"
4423 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4424 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4426 echo "Looks kind of like an OSF/1 system, but we'll see..."
4428 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4429 xxx=`./loc addbib blurfl $pth`
4430 if $test -f $xxx; then
4431 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4435 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4436 echo "Looks kind of like an extended USG system, but we'll see..."
4438 echo "Looks kind of like a USG system, but we'll see..."
4442 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4443 echo "Looks kind of like a BSD system, but we'll see..."
4447 echo "Looks kind of like a Version 7 system, but we'll see..."
4450 case "$eunicefix" in
4453 There is, however, a strange, musty smell in the air that reminds me of
4454 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4458 : it so happens the Eunice I know will not run shell scripts in Unix format
4462 echo "Congratulations. You aren't running Eunice."
4466 : Detect OS2. The p_ variable is set above in the Head.U unit.
4467 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4468 : semicolon as a patch separator
4473 I have the feeling something is not exactly right, however...don't tell me...
4474 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4475 (Or you may be running DOS with DJGPP.)
4480 if test -f /xenix; then
4481 echo "Actually, this looks more like a XENIX system..."
4486 echo "It's not Xenix..."
4491 if test -f /venix; then
4492 echo "Actually, this looks more like a VENIX system..."
4499 echo "Nor is it Venix..."
4502 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4503 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4506 : Check if we are using GNU gcc and what its version is
4508 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4512 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4514 printf("%s\n", __VERSION__);
4516 printf("%s\n", "1");
4522 if $cc -o try $ccflags $ldflags try.c; then
4523 gccversion=`$run ./try`
4524 case "$gccversion" in
4525 '') echo "You are not using GNU cc." ;;
4526 *) echo "You are using GNU cc $gccversion."
4532 echo "*** WHOA THERE!!! ***" >&4
4533 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4534 case "$knowitall" in
4536 echo " You'd better start hunting for one and let me know about it." >&4
4542 case "$gccversion" in
4543 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4545 case "$gccversion" in
4546 '') gccosandvers='' ;;
4547 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4548 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4550 case "$gccosandvers" in
4551 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4552 $osname$osvers) ;; # looking good
4553 $osname*) cat <<EOM >&4
4555 *** WHOA THERE!!! ***
4557 Your gcc has not been compiled for the exact release of
4558 your operating system ($gccosandvers versus $osname$osvers).
4560 In general it is a good idea to keep gcc synchronized with
4561 the operating system because otherwise serious problems
4562 may ensue when trying to compile software, like Perl.
4564 I'm trying to be optimistic here, though, and will continue.
4565 If later during the configuration and build icky compilation
4566 problems appear (headerfile conflicts being the most common
4567 manifestation), I suggest reinstalling the gcc to match
4568 your operating system release.
4572 *) gccosandvers='' ;; # failed to parse, better be silent
4580 # gcc 3.* complain about adding -Idirectories that they already know about,
4581 # so we will take those off from locincpth.
4582 case "$gccversion" in
4584 echo "main(){}">try.c
4585 for incdir in $locincpth; do
4586 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4587 grep '^c[cp]p*[01]: warning: changing search order '`
4588 if test "X$warn" != X; then
4589 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4595 : What should the include directory be ?
4597 $echo $n "Hmm... $c"
4601 if $test -f /bin/mips && /bin/mips; then
4602 echo "Looks like a MIPS system..."
4603 $cat >usr.c <<'EOCP'
4604 #ifdef SYSTYPE_BSD43
4608 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4609 dflt='/bsd43/usr/include'
4613 mips_type='System V'
4615 $rm -f usr.c usr.out
4616 echo "and you're compiling with the $mips_type compiler and libraries."
4620 echo "Doesn't look like a MIPS system."
4630 case "$xxx_prompt" in
4633 rp='Where are the include files you want to use?'
4641 : see how we invoke the C preprocessor
4643 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4644 cat <<'EOT' >testcpp.c
4650 if test ! -f cppstdin; then
4651 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4652 # AIX cc -E doesn't show the absolute headerfile
4653 # locations but we'll cheat by using the -M flag.
4654 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
4656 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4659 echo "Keeping your $hint cppstdin wrapper."
4662 wrapper=`pwd`/cppstdin
4666 if $test "X$cppstdin" != "X" && \
4667 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4668 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4670 echo "You used to use $cppstdin $cppminus so we'll use that again."
4672 '') echo "But let's see if we can live without a wrapper..." ;;
4674 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4675 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4677 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4680 echo "(However, $cpprun $cpplast does not work, let's see...)"
4688 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4695 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4696 $cc -E <testcpp.c >testcpp.out 2>&1; \
4697 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4698 echo "Yup, it does."
4701 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4702 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4703 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4704 echo "Yup, it does."
4707 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4708 $cc -P <testcpp.c >testcpp.out 2>&1; \
4709 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4710 echo "Yipee, that works!"
4713 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4714 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4715 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4716 echo "At long last!"
4719 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4720 $cpp <testcpp.c >testcpp.out 2>&1; \
4721 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4725 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4726 $cpp - <testcpp.c >testcpp.out 2>&1; \
4727 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4728 echo "Hooray, it works! I was beginning to wonder."
4731 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4732 $wrapper <testcpp.c >testcpp.out 2>&1; \
4733 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4739 rp="No dice. I can't find a C preprocessor. Name one:"
4743 $x_cpp <testcpp.c >testcpp.out 2>&1
4744 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4745 echo "OK, that will do." >&4
4747 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4762 echo "Perhaps can we force $cc -E using a wrapper..."
4763 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4764 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4770 echo "Nope, we'll have to live without it..."
4784 "$wrapper"|'cppstdin') ;;
4785 *) $rm -f $wrapper;;
4787 $rm -f testcpp.c testcpp.out
4789 : Set private lib path
4792 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4797 '') dlist="$loclibpth $plibpth $glibpth";;
4798 *) dlist="$libpth";;
4801 : Now check and see which directories actually exist, avoiding duplicates
4805 if $test -d $xxx; then
4808 *) libpth="$libpth $xxx";;
4814 Some systems have incompatible or broken versions of libraries. Among
4815 the directories listed in the question below, please remove any you
4816 know not to be holding relevant libraries, and add any that are needed.
4817 Say "none" for none.
4828 rp="Directories to use for library searches?"
4835 : compute shared library extension
4838 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4848 On some systems, shared libraries may be available. Answer 'none' if
4849 you want to suppress searching of shared libraries for the remainder
4850 of this configuration.
4853 rp='What is the file extension used for shared libraries?'
4857 : Define several unixisms.
4858 : Hints files or command line option can be used to override them.
4859 : The convoluted testing is in case hints files set either the old
4862 '') case "$exe_ext" in
4864 *) _exe="$exe_ext" ;;
4869 '') case "$lib_ext" in
4876 '') case "$obj_ext" in
4883 '') case "$path_sep" in
4894 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4896 : Which makefile gets called first. This is used by make depend.
4897 case "$firstmakefile" in
4898 '') firstmakefile='makefile';;
4901 : Check for uselongdouble support
4903 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4906 case "$uselongdouble" in
4907 $define|true|[yY]*) dflt='y';;
4912 Perl can be built to take advantage of long doubles which
4913 (if available) may give more accuracy and range for floating point numbers.
4915 If this doesn't make any sense to you, just accept the default '$dflt'.
4917 rp='Try to use long doubles if available?'
4920 y|Y) val="$define" ;;
4926 case "$uselongdouble" in
4927 true|[yY]*) uselongdouble="$define" ;;
4930 : Look for a hint-file generated 'call-back-unit'. If the
4931 : user has specified that long doubles should be used,
4932 : we may need to set or change some other defaults.
4933 if $test -f uselongdouble.cbu; then
4934 echo "Your platform has some specific hints regarding long doubles, using them..."
4935 . ./uselongdouble.cbu
4937 case "$uselongdouble" in
4940 (Your platform does not have any specific hints for long doubles.)
4946 : Looking for optional libraries
4948 echo "Checking for optional libraries..." >&4
4953 case "$libswanted" in
4954 '') libswanted='c_s';;
4957 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4963 for thisdir in $libpth $xlibpth; do
4964 test -d $thisdir && libspath="$libspath $thisdir"
4966 for thislib in $libswanted; do
4967 for thisdir in $libspath; do
4969 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4970 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4971 $test -f "$xxx" && eval $libscheck
4972 $test -f "$xxx" && libstyle=shared
4974 if test ! -f "$xxx"; then
4975 xxx=$thisdir/lib$thislib.$so
4976 $test -f "$xxx" && eval $libscheck
4977 $test -f "$xxx" && libstyle=shared
4979 if test ! -f "$xxx"; then
4980 xxx=$thisdir/lib$thislib$_a
4981 $test -f "$xxx" && eval $libscheck
4982 $test -f "$xxx" && libstyle=static
4984 if test ! -f "$xxx"; then
4985 xxx=$thisdir/$thislib$_a
4986 $test -f "$xxx" && eval $libscheck
4987 $test -f "$xxx" && libstyle=static
4989 if test ! -f "$xxx"; then
4990 xxx=$thisdir/lib${thislib}_s$_a
4991 $test -f "$xxx" && eval $libscheck
4992 $test -f "$xxx" && libstyle=static
4993 $test -f "$xxx" && thislib=${thislib}_s
4995 if test ! -f "$xxx"; then
4996 xxx=$thisdir/Slib$thislib$_a
4997 $test -f "$xxx" && eval $libscheck
4998 $test -f "$xxx" && libstyle=static
5000 if $test -f "$xxx"; then
5002 shared) echo "Found -l$thislib (shared)." ;;
5003 static) echo "Found -l$thislib." ;;
5004 *) echo "Found -l$thislib ($libstyle)." ;;
5008 *) dflt="$dflt -l$thislib"
5009 libsfound="$libsfound $xxx"
5011 libsfiles="$libsfiles $yyy"
5012 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5013 case " $libsdirs " in
5015 *) libsdirs="$libsdirs $yyy" ;;
5022 if $test ! -f "$xxx"; then
5023 echo "No -l$thislib."
5034 ' '|'') dflt='none';;
5039 In order to compile $package on your machine, a number of libraries
5040 are usually needed. Include any other special libraries here as well.
5041 Say "none" for none. The default list is almost always right.
5045 rp="What libraries to use?"
5052 : determine optimization, if desired, or use for debug flag also
5054 ' '|$undef) dflt='none';;
5056 *) dflt="$optimize";;
5060 By default, $package compiles with the -O flag to use the optimizer.
5061 Alternately, you might want to use the symbolic debugger, which uses
5062 the -g flag (on traditional Unix systems). Either flag can be
5063 specified here. To use neither flag, specify the word "none".
5066 rp="What optimizer/debugger flag should be used?"
5070 'none') optimize=" ";;
5073 : Check what DEBUGGING is required from the command line
5074 : -DEBUGGING or -DDEBUGGING or
5075 : -DEBUGGING=both = -g + -DDEBUGGING
5076 : -DEBUGGING=-g or -Doptimize=-g = -g
5077 : -DEBUGGING=none or -UDEBUGGING =
5078 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5081 *) DEBUGGING=$EBUGGING ;;
5084 case "$DEBUGGING" in
5088 *) optimize="$optimize -g" ;;
5092 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5100 case "$DEBUGGING" in
5101 both|$define) dflt='-DDEBUGGING'
5104 : argument order is deliberate, as the flag will start with - which set could
5105 : think is an option
5106 checkccflag='check=$1; flag=$2; callback=$3;
5108 echo "Checking if your compiler accepts $flag" 2>&1;
5109 echo "int main(void) { return 0; }" > gcctest.c;
5110 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5111 echo "Yes, it does." 2>&1;
5112 if $test -s gcctest.out ; then
5113 echo "But your platform does not like it:";
5118 echo "Leaving current flags $ccflags alone." 2>&1
5120 *) dflt="$dflt $flag";
5126 echo "Nope, it does not, but that is ok." 2>&1;
5130 : We will not override a previous value, but we might want to
5131 : augment a hint file
5133 default|recommended)
5134 case "$gccversion" in
5135 1*) dflt="$dflt -fpcc-struct-return" ;;
5137 case "$optimize:$DEBUGGING" in
5138 *-g*:old) dflt="$dflt -DDEBUGGING";;
5140 case "$gccversion" in
5141 2*) if $test -d /etc/conf/kconfig.d &&
5142 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5144 # Interactive Systems (ISC) POSIX mode.
5149 case "$gccversion" in
5152 ?*) set strict-aliasing -fno-strict-aliasing
5156 # For gcc, adding -pipe speeds up compilations for some, but apparently
5157 # some assemblers can't read from stdin. (It also slows down compilations
5158 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5159 case "$gccversion" in
5165 # on x86_64 (at least) we require an extra library (libssp) in the
5166 # link command line. This library is not named, so I infer that it is
5167 # an implementation detail that may change. Hence the safest approach
5168 # is to add the flag to the flags passed to the compiler at link time,
5169 # as that way the compiler can do the right implementation dependant
5171 case "$gccversion" in
5172 ?*) set stack-protector -fstack-protector
5179 case "$mips_type" in
5180 *BSD*|'') inclwanted="$locincpth $usrinc";;
5181 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5183 for thisincl in $inclwanted; do
5184 if $test -d $thisincl; then
5185 if $test x$thisincl != x$usrinc; then
5187 *" -I$thisincl "*);;
5188 *) dflt="$dflt -I$thisincl ";;
5194 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5196 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5204 *) dflt="$dflt -D$2";;
5208 set signal.h LANGUAGE_C; eval $inctest
5212 ccflags="$ccflags -DSOCKS"
5217 default|recommended) dflt="$ccflags $dflt" ;;
5218 *) dflt="$ccflags";;
5227 Your C compiler may want other flags. For this question you should include
5228 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5229 but you should NOT include libraries or ld flags like -lwhatever. If you
5230 want $package to honor its debug switch, you should include -DDEBUGGING here.
5231 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5233 To use no flags, specify the word "none".
5239 rp="Any additional cc flags?"
5246 : the following weeds options from ccflags that are of no interest to cpp
5248 '') cppflags="$ccflags" ;;
5249 *) cppflags="$cppflags $ccflags" ;;
5251 case "$gccversion" in
5252 1*) cppflags="$cppflags -D__GNUC__"
5254 case "$mips_type" in
5256 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5262 echo "Let me guess what the preprocessor flags are..." >&4
5276 *) ftry="$previous $flag";;
5278 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5279 >cpp1.out 2>/dev/null && \
5280 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5281 >cpp2.out 2>/dev/null && \
5282 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5283 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5285 cppflags="$cppflags $ftry"
5295 *-*) echo "They appear to be: $cppflags";;
5297 $rm -f cpp.c cpp?.out
5301 : flags used in final linking phase
5303 '') if ./venix; then
5309 *-posix*) dflt="$dflt -posix" ;;
5312 *) dflt="$ldflags";;
5314 # See note above about -fstack-protector
5316 *-fstack-protector*)
5318 *-fstack-protector*) ;; # Don't add it again
5319 *) dflt="$dflt -fstack-protector" ;;
5324 : Try to guess additional flags to pick up local libraries.
5325 for thislibdir in $libpth; do
5326 case " $loclibpth " in
5329 *"-L$thislibdir "*) ;;
5330 *) dflt="$dflt -L$thislibdir" ;;
5342 Your C linker may need flags. For this question you should
5343 include -L/whatever and any other flags used by the C linker, but you
5344 should NOT include libraries like -lwhatever.
5346 Make sure you include the appropriate -L/path flags if your C linker
5347 does not normally search all of the directories you specified above,
5350 To use no flags, specify the word "none".
5354 rp="Any additional ld flags (NOT including libraries)?"
5360 rmlist="$rmlist pdp11"
5364 echo "Checking your choice of C compiler and flags for coherency..." >&4
5365 $cat > try.c <<'EOF'
5367 int main() { printf("Ok\n"); return(0); }
5369 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5371 $cat >try.msg <<'EOM'
5372 I've tried to compile and run the following simple program:
5375 $cat try.c >> try.msg
5377 $cat >> try.msg <<EOM
5384 and I got the following output:
5388 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5389 if $sh -c "$run ./try " >>try.msg 2>&1; then
5393 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5396 cat >> try.msg <<'EOQS'
5397 If $libs contains -lsfio, and sfio is mis-configured, then it
5398 sometimes (apparently) runs and exits with a 0 status, but with no
5399 output! It may have to do with sfio's use of _exit vs. exit.
5402 rp="You have a big problem. Shall I abort Configure"
5409 echo "The program compiled OK, but exited with status $?." >>try.msg
5410 rp="You have a problem. Shall I abort Configure"
5414 echo "I can't compile the test program." >>try.msg
5415 rp="You have a BIG problem. Shall I abort Configure"
5421 case "$knowitall" in
5423 echo "(The supplied flags or libraries might be incorrect.)"
5431 *) echo "Ok. Stopping Configure." >&4
5436 n) echo "OK, that should do.";;
5438 $rm_try gcctest gcctest.out
5440 : define a shorthand compile call
5444 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5445 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5449 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5450 : define a shorthand compile call for compilations that should be ok.
5454 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5456 : determine filename position in cpp output
5458 echo "Computing filename position in cpp output for #include directives..." >&4
5460 vos) testaccess=-e ;;
5463 echo '#include <stdio.h>' > foo.c
5466 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5467 $grep '^[ ]*#.*stdio\.h' | \
5468 while read cline; do
5471 while $test \$# -gt 0; do
5472 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5477 pos=\`expr \$pos + 1\`
5489 *) pos="${fieldn}th";;
5491 echo "Your cpp writes the filename in the $pos field of the line."
5494 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5495 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5498 : locate header file
5503 for usrincdir in $usrinc
5505 if test -f \$usrincdir/\$wanted; then
5506 echo "\$usrincdir/\$wanted"
5510 awkprg='{ print \$$fieldn }'
5511 echo "#include <\$wanted>" > foo\$\$.c
5512 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5513 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5514 while read cline; do
5515 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5517 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5518 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5523 # status = 0: grep returned 0 lines, case statement not executed
5524 # status = 1: headerfile found
5525 # status = 2: while loop executed, no headerfile found
5529 if test \$status -eq 1; then
5536 : define an alternate in-header-list? function
5537 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5538 cont=true; xxf="echo \"<\$1> found.\" >&4";
5539 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5540 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5542 case $# in 4) instead=instead;; *) instead="at last";; esac;
5543 while $test "$cont"; do
5545 var=$2; eval "was=\$$2";
5546 if $test "$xxx" && $test -r "$xxx";
5548 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5551 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5552 set $yyy; shift; shift; yyy=$@;
5553 case $# in 0) cont="";;
5554 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5555 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5556 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5557 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5561 do set $yyy; var=$2; eval "was=\$$2";
5562 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5563 set $yyy; shift; shift; yyy=$@;
5566 : see if stdlib is available
5567 set stdlib.h i_stdlib
5570 : check for lengths of integral types
5574 echo "Checking to see how big your integers are..." >&4
5583 printf("intsize=%d;\n", (int)sizeof(int));
5584 printf("longsize=%d;\n", (int)sizeof(long));
5585 printf("shortsize=%d;\n", (int)sizeof(short));
5590 if eval $compile_ok && $run ./try > /dev/null; then
5592 echo "Your integers are $intsize bytes long."
5593 echo "Your long integers are $longsize bytes long."
5594 echo "Your short integers are $shortsize bytes long."
5598 Help! I can't compile and run the intsize test program: please enlighten me!
5599 (This is probably a misconfiguration in your system or libraries, and
5600 you really ought to fix it. Still, I'll try anyway.)
5604 rp="What is the size of an integer (in bytes)?"
5608 rp="What is the size of a long integer (in bytes)?"
5612 rp="What is the size of a short integer (in bytes)?"
5620 : check for long long
5622 echo "Checking to see if you have long long..." >&4
5623 echo 'int main() { long long x = 7; return 0; }' > try.c
5625 if eval $compile; then
5627 echo "You have long long."
5630 echo "You do not have long long."
5636 : check for length of long long
5637 case "${d_longlong}${longlongsize}" in
5640 echo "Checking to see how big your long longs are..." >&4
5641 $cat >try.c <<'EOCP'
5645 printf("%d\n", (int)sizeof(long long));
5650 if eval $compile_ok; then
5651 longlongsize=`$run ./try`
5652 echo "Your long longs are $longlongsize bytes long."
5656 echo "(I can't seem to compile the test program. Guessing...)"
5657 rp="What is the size of a long long (in bytes)?"
5661 if $test "X$longsize" = "X$longlongsize"; then
5662 echo "(That isn't any different from an ordinary long.)"
5668 : see if inttypes.h is available
5669 : we want a real compile instead of Inhdr because some systems
5670 : have an inttypes.h which includes non-existent headers
5673 #include <inttypes.h>
5675 static int32_t foo32 = 0x12345678;
5679 if eval $compile; then
5680 echo "<inttypes.h> found." >&4
5683 echo "<inttypes.h> NOT found." >&4
5692 echo "Checking to see if you have int64_t..." >&4
5694 #include <sys/types.h>
5695 #$i_inttypes I_INTTYPES
5697 #include <inttypes.h>
5699 int main() { int64_t x = 7; }
5702 if eval $compile; then
5704 echo "You have int64_t."
5707 echo "You do not have int64_t."
5713 : Check if 64bit ints have a quad type
5715 echo "Checking which 64-bit integer type we could use..." >&4
5721 val='"unsigned int"'
5726 *) case "$longsize" in
5730 val='"unsigned long"'
5735 *) case "$d_longlong:$longlongsize" in
5740 val='"unsigned long long"'
5745 *) case "$d_int64_t" in
5764 '') echo "Alas, no 64-bit integer types in sight." >&4
5767 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5772 : Do we want 64bit support
5773 case "$uselonglong" in
5774 "$define"|true|[yY]*)
5777 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5779 use64bitint="$define"
5782 case "$use64bits" in
5783 "$define"|true|[yY]*)
5786 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5788 use64bitint="$define"
5791 case "$use64bitints" in
5792 "$define"|true|[yY]*)
5795 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5797 use64bitint="$define"
5800 case "$use64bitsint" in
5801 "$define"|true|[yY]*)
5804 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5806 use64bitint="$define"
5809 case "$uselonglongs" in
5810 "$define"|true|[yY]*)
5813 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5815 use64bitint="$define"
5818 case "$use64bitsall" in
5819 "$define"|true|[yY]*)
5822 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5824 use64bitall="$define"
5829 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5831 case "$use64bitall" in
5832 "$define"|true|[yY]*) use64bitint="$define" ;;
5838 You have natively 64-bit long integers.
5842 *) case "$use64bitint" in
5843 "$define"|true|[yY]*) dflt='y';;
5852 Perl can be built to take advantage of 64-bit integer types
5853 on some systems. To do so, Configure can be run with -Duse64bitint.
5854 Choosing this option will most probably introduce binary incompatibilities.
5856 If this doesn't make any sense to you, just accept the default '$dflt'.
5857 (The default has been chosen based on your configuration.)
5859 rp='Try to use 64-bit integers, if available?'
5862 [yY]*) val="$define" ;;
5870 case "$use64bitall" in
5871 "$define"|true|[yY]*) dflt='y' ;;
5872 *) case "$longsize" in
5880 You may also choose to try maximal 64-bitness. It means using as much
5881 64-bitness as possible on the platform. This in turn means even more
5882 binary incompatibilities. On the other hand, your platform may not
5883 have any more 64-bitness available than what you already have chosen.
5885 If this doesn't make any sense to you, just accept the default '$dflt'.
5886 (The default has been chosen based on your configuration.)
5888 rp='Try to use maximal 64-bit support, if available?'
5891 [yY]*) val="$define" ;;
5896 case "$use64bitall" in
5898 case "$use64bitint" in
5902 Since you have chosen a maximally 64-bit build, I'm also turning on
5903 the use of 64-bit integers.
5905 use64bitint="$define" ;;
5910 : Look for a hint-file generated 'call-back-unit'. If the
5911 : user has specified that a 64-bit perl is to be built,
5912 : we may need to set or change some other defaults.
5913 if $test -f use64bitint.cbu; then
5914 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5917 case "$use64bitint" in
5918 "$define"|true|[yY]*)
5920 4) case "$archname64" in
5921 '') archname64=64int ;;
5928 : Look for a hint-file generated 'call-back-unit'. If the
5929 : user has specified that a maximally 64-bit perl is to be built,
5930 : we may need to set or change some other defaults.
5931 if $test -f use64bitall.cbu; then
5932 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5935 case "$use64bitall" in
5936 "$define"|true|[yY]*)
5938 4) case "$archname64" in
5939 ''|64int) archname64=64all ;;
5946 case "$d_quad:$use64bitint" in
5950 *** You have chosen to use 64-bit integers,
5951 *** but none can be found.
5952 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5953 *** Cannot continue, aborting.
5960 : check for length of double
5962 case "$doublesize" in
5964 echo "Checking to see how big your double precision numbers are..." >&4
5973 printf("%d\n", (int)sizeof(double));
5978 if eval $compile_ok; then
5979 doublesize=`$run ./try`
5980 echo "Your double is $doublesize bytes long."
5983 echo "(I can't seem to compile the test program. Guessing...)"
5984 rp="What is the size of a double precision number (in bytes)?"
5992 : check for long doubles
5994 echo "Checking to see if you have long double..." >&4
5995 echo 'int main() { long double x = 7.0; }' > try.c
5997 if eval $compile; then
5999 echo "You have long double."
6002 echo "You do not have long double."
6008 : check for length of long double
6009 case "${d_longdbl}${longdblsize}" in
6012 echo "Checking to see how big your long doubles are..." >&4
6013 $cat >try.c <<'EOCP'
6017 printf("%d\n", sizeof(long double));
6022 if eval $compile; then
6023 longdblsize=`$run ./try`
6024 echo "Your long doubles are $longdblsize bytes long."
6028 echo "(I can't seem to compile the test program. Guessing...)" >&4
6029 rp="What is the size of a long double (in bytes)?"
6033 if $test "X$doublesize" = "X$longdblsize"; then
6034 echo "That isn't any different from an ordinary double."
6035 echo "I'll keep your setting anyway, but you may see some"
6036 echo "harmless compilation warnings."
6042 : determine the architecture name
6044 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6045 tarch=`arch`"-$osname"
6046 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6047 if uname -m > tmparch 2>&1 ; then
6048 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6049 -e 's/$/'"-$osname/" tmparch`
6057 case "$myarchname" in
6060 echo "(Your architecture name used to be $myarchname.)"
6064 case "$targetarch" in
6066 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6071 *) dflt="$archname";;
6073 rp='What is your architecture name'
6076 case "$usethreads" in
6078 echo "Threads selected." >&4
6080 *-thread*) echo "...and architecture name already has -thread." >&4
6082 *) archname="$archname-thread"
6083 echo "...setting architecture name to $archname." >&4
6088 case "$usemultiplicity" in
6090 echo "Multiplicity selected." >&4
6092 *-multi*) echo "...and architecture name already has -multi." >&4
6094 *) archname="$archname-multi"
6095 echo "...setting architecture name to $archname." >&4
6100 case "$use64bitint$use64bitall" in
6102 case "$archname64" in
6104 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6107 case "$use64bitint" in
6108 "$define") echo "64 bit integers selected." >&4 ;;
6110 case "$use64bitall" in
6111 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6114 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6116 *) archname="$archname-$archname64"
6117 echo "...setting architecture name to $archname." >&4
6123 case "$uselongdouble" in
6125 echo "Long doubles selected." >&4
6126 case "$longdblsize" in
6128 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6132 *-ld*) echo "...and architecture name already has -ld." >&4
6134 *) archname="$archname-ld"
6135 echo "...setting architecture name to $archname." >&4
6142 case "$useperlio" in
6144 echo "Perlio selected." >&4
6147 echo "Perlio not selected, using stdio." >&4
6149 *-stdio*) echo "...and architecture name already has -stdio." >&4
6151 *) archname="$archname-stdio"
6152 echo "...setting architecture name to $archname." >&4
6157 if $test -f archname.cbu; then
6158 echo "Your platform has some specific hints for architecture name, using them..."
6162 : set the prefixit variable, to compute a suitable default value
6163 prefixit='case "$3" in
6165 case "$oldprefix" in
6166 "") eval "$1=\"\$$2\"";;
6173 ""|" ") eval "$1=\"\$$2\"";;
6179 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6181 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6182 /*-$oldprefix/*|\~*-$oldprefix/*)
6183 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6184 *) eval "$1=\"\$$2\"";;
6188 : determine installation style
6189 : For now, try to deduce it from prefix unless it is already set.
6190 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6191 case "$installstyle" in
6192 '') case "$prefix" in
6193 *perl*) dflt='lib';;
6194 *) dflt='lib/perl5' ;;
6197 *) dflt="$installstyle" ;;
6199 : Probably not worth prompting for this since we prompt for all
6200 : the directories individually, and the prompt would be too long and
6204 : determine where public executables go
6209 rp='Pathname where the public executables will reside?'
6211 if $test "X$ansexp" != "X$binexp"; then
6215 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6216 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6217 : this via initialinstalllocation
6220 case "$userelocatableinc" in
6221 $define|true|[yY]*) dflt='y' ;;
6226 Would you like to build Perl so that the installation is relocatable, so that
6227 library paths in @INC are determined relative to the path of the perl binary?
6228 This is not advised for system Perl installs, or if you need to run setid
6229 scripts or scripts under taint mode.
6231 If this doesn't make any sense to you, just accept the default '$dflt'.
6233 rp='Use relocatable @INC?'
6236 y|Y) val="$define" ;;
6239 set userelocatableinc
6242 initialinstalllocation="$binexp"
6243 : Default prefix is now "up one level from where the binaries are"
6244 case "$userelocatableinc" in
6250 installprefixexp=".../.."
6254 : determine where private library files go
6255 : Usual default is /usr/local/lib/perl5/$version.
6256 : Also allow things like /opt/perl/lib/$version, since
6257 : /opt/perl/lib/perl5... would be redundant.
6258 : The default "style" setting is made in installstyle.U
6259 case "$installstyle" in
6260 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6261 *) set dflt privlib lib/$version ;;
6266 There are some auxiliary files for $package that need to be put into a
6267 private library directory that is accessible by everyone.
6272 rp='Pathname where the private library files will reside?'
6277 : set the prefixup variable, to restore leading tilda escape
6278 prefixup='case "$prefixexp" in
6280 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6283 : determine where public architecture dependent libraries go
6286 : privlib default is /usr/local/lib/$package/$version
6287 : archlib default is /usr/local/lib/$package/$version/$archname
6288 : privlib may have an optional trailing /share.
6289 tdflt=`echo $privlib | $sed 's,/share$,,'`
6290 tdflt=$tdflt/$archname
6299 $spackage contains architecture-dependent library files. If you are
6300 sharing libraries in a heterogeneous environment, you might store
6301 these files in a separate location. Otherwise, you can just include
6302 them with the rest of the public library files.
6307 rp='Where do you want to put the public architecture-dependent libraries?'
6311 if $test X"$archlib" = X"$privlib"; then
6317 : see if setuid scripts can be secure
6320 Some kernels have a bug that prevents setuid #! scripts from being
6321 secure. Some sites have disabled setuid #! scripts because of this.
6323 First let's decide if your kernel supports secure setuid #! scripts.
6324 (If setuid #! scripts would be secure but have been disabled anyway,
6325 don't say that they are secure if asked.)
6330 if $test -d /dev/fd; then
6331 echo "#!$ls" >reflect
6332 chmod +x,u+s reflect
6333 ./reflect >flect 2>&1
6334 if $contains "/dev/fd" flect >/dev/null; then
6335 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6339 If you are not sure if they are secure, I can check but I'll need a
6340 username and password different from the one you are using right now.
6341 If you don't have such a username or don't want me to test, simply
6345 rp='Other username to test security of setuid scripts with?'
6350 case "$d_suidsafe" in
6351 '') echo "I'll assume setuid scripts are *not* secure." >&4
6354 echo "Well, the $hint value is *not* secure." >&4
6356 *) echo "Well, the $hint value *is* secure." >&4
6361 $rm -f reflect flect
6362 echo "#!$ls" >reflect
6363 chmod +x,u+s reflect
6366 echo '"su" will (probably) prompt you for '"$ans's password."
6367 su $ans -c './reflect >flect'
6368 if $contains "/dev/fd" flect >/dev/null; then
6369 echo "Okay, it looks like setuid scripts are secure." >&4
6372 echo "I don't think setuid scripts are secure." >&4
6377 rp='Does your kernel have *secure* setuid scripts?'
6380 [yY]*) val="$define";;
6385 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6386 echo "(That's for file descriptors, not floppy disks.)"
6392 $rm -f reflect flect
6394 : now see if they want to do setuid emulation
6395 if $test $patchlevel -lt 11; then
6398 case "$d_suidsafe" in
6401 echo "No need to emulate SUID scripts since they are secure here." >&4
6405 Some systems have disabled setuid scripts, especially systems where
6406 setuid scripts cannot be secure. On systems where setuid scripts have
6407 been disabled, the setuid/setgid bits on scripts are currently
6408 useless. It is possible for $package to detect those bits and emulate
6409 setuid/setgid in a secure fashion. This emulation will only work if
6410 setuid scripts have been disabled in your kernel.
6414 "$define") dflt=y ;;
6417 rp="Do you want to do setuid/setgid emulation?"
6420 [yY]*) val="$define";;
6432 SUID emulation has been removed for 5.12
6433 Please re-run Configure without -Dd_dosuid
6442 : Find perl5.005 or later.
6443 echo "Looking for a previously installed perl5.005 or later... "
6445 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6446 : Check if this perl is recent and can load a simple module
6447 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6450 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6460 '') echo "None found. That's ok.";;
6461 *) echo "Using $perl5." ;;
6464 : Set the siteprefix variables
6467 After $package is installed, you may wish to install various
6468 add-on modules and utilities. Typically, these add-ons will
6469 be installed under $prefix with the rest
6470 of this package. However, you may wish to install such add-ons
6471 elsewhere under a different prefix.
6473 If you do not wish to put everything under a single prefix, that's
6474 ok. You will be prompted for the individual locations; this siteprefix
6475 is only used to suggest the defaults.
6477 The default should be fine for most people.
6481 rp='Installation prefix to use for add-on modules and utilities?'
6482 : XXX Here might be another good place for an installstyle setting.
6483 case "$siteprefix" in
6485 *) dflt=$siteprefix ;;
6488 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6490 case "$siteprefix" in
6494 *) oldsiteprefix="$prefix";;
6499 siteprefixexp="$ansexp"
6501 : determine where site specific libraries go.
6502 : Usual default is /usr/local/lib/perl5/site_perl/$version
6503 : The default "style" setting is made in installstyle.U
6504 : XXX No longer works with Prefixit stuff.
6505 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6507 '') case "$installstyle" in
6508 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6509 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6517 The installation process will create a directory for
6518 site-specific extensions and modules. Most users find it convenient
6519 to place all site-specific files in this directory rather than in the
6520 main distribution directory.
6524 rp='Pathname for the site-specific library files?'
6528 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6530 : Determine list of previous versions to include in @INC
6531 $cat > getverlist <<EOPL
6534 \$api_versionstring = "$api_versionstring";
6535 \$version = "$version";
6536 \$stem = "$sitelib_stem";
6537 \$archname = "$archname";
6539 $cat >> getverlist <<'EOPL'
6540 # The list found is store twice for each entry: the original name, and
6541 # the binary broken down version as pack "sss", so sorting is easy and
6542 # unambiguous. This will work for all versions that have a maximum of
6543 # three digit groups, separate by '.'s or '_'s. Names are extended with
6544 # ".0.0" to ensure at least three elements for the pack.
6545 # -- H.Merijn Brand (m)'06 23-10-2006
6547 # Can't have leading @ because metaconfig interprets it as a command!
6548 ;@inc_version_list=();
6549 # XXX Redo to do opendir/readdir?
6552 ;@candidates = map {
6553 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6554 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
6560 ($pversion, $aversion, $vsn5005) = map {
6561 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6562 foreach $d (@candidates) {
6563 if ($d->[1] lt $pversion) {
6564 if ($d->[1] ge $aversion) {
6565 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6567 elsif ($d->[1] ge $vsn5005) {
6568 unshift(@inc_version_list, grep { -d } $d->[0]);
6572 # Skip newer version. I.e. don't look in
6573 # 5.7.0 if we're installing 5.6.1.
6577 if (@inc_version_list) {
6578 print join(' ', @inc_version_list);
6581 # Blank space to preserve value for next Configure run.
6586 case "$inc_version_list" in
6587 '') if test -x "$perl5$exe_ext"; then
6588 dflt=`$perl5 getverlist`
6593 $undef) dflt='none' ;;
6594 *) eval dflt=\"$inc_version_list\" ;;
6597 ''|' ') dflt=none ;;
6604 In order to ease the process of upgrading, this version of perl
6605 can be configured to use modules built and installed with earlier
6606 versions of perl that were installed under $prefix. Specify here
6607 the list of earlier versions that this version of perl should check.
6608 If Configure detected no earlier versions of perl installed under
6609 $prefix, then the list will be empty. Answer 'none' to tell perl
6610 to not search earlier versions.
6612 The default should almost always be sensible, so if you're not sure,
6613 just accept the default.
6616 rp='List of earlier versions to include in @INC?'
6619 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6620 *) inc_version_list="$ans" ;;
6622 case "$inc_version_list" in
6624 inc_version_list_init='0'
6625 d_inc_version_list="$undef"
6627 *) inc_version_list_init=`echo $inc_version_list |
6628 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6629 d_inc_version_list="$define"
6634 : see if malloc/malloc.h has to be included
6635 set malloc/malloc.h i_mallocmalloc
6638 : see if this is a malloc.h system
6639 : we want a real compile instead of Inhdr because some systems have a
6640 : malloc.h that just gives a compile error saying to use stdlib.h instead
6645 #$i_mallocmalloc I_MALLOCMALLOC
6646 #ifdef I_MALLOCMALLOC
6647 # include <malloc/malloc.h>
6650 int main () { return 0; }
6653 if eval $compile; then
6654 echo "<malloc.h> found." >&4
6657 echo "<malloc.h> NOT found." >&4
6664 : check for void type
6666 echo "Checking to see how well your C compiler groks the void type..." >&4
6667 case "$voidflags" in
6679 extern void moo(); /* function returning void */
6680 void (*goo)(); /* ptr to func returning void */
6682 void *hue; /* generic ptr */
6695 int main() { sub(); }
6697 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6698 voidflags=$defvoidused
6699 echo "Good. It appears to support void to the level $package wants.">&4
6700 if $contains warning .out >/dev/null 2>&1; then
6701 echo "However, you might get some warnings that look like this:"
6705 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6706 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6707 echo "It supports 1..."
6708 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6709 echo "It also supports 2..."
6710 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6712 echo "And it supports 4 but not 8 definitely."
6714 echo "It doesn't support 4..."
6715 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6717 echo "But it supports 8."
6720 echo "Neither does it support 8."
6724 echo "It does not support 2..."
6725 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6727 echo "But it supports 4 and 8."
6729 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6731 echo "And it supports 4 but has not heard about 8."
6733 echo "However it supports 8 but not 4."
6738 echo "There is no support at all for void."
6743 case "$voidflags" in
6746 Support flag bits are:
6747 1: basic void declarations.
6748 2: arrays of pointers to functions returning void.
6749 4: operations between pointers to and addresses of void functions.
6750 8: generic void pointers.
6753 rp="Your void support flags add up to what?"
6760 : check for length of pointer
6764 echo "Checking to see how big your pointers are..." >&4
6765 if test "$voidflags" -gt 7; then
6766 echo '#define VOID_PTR char *' > try.c
6768 echo '#define VOID_PTR void *' > try.c
6778 printf("%d\n", (int)sizeof(VOID_PTR));
6783 if eval $compile_ok; then
6784 ptrsize=`$run ./try`
6785 echo "Your pointers are $ptrsize bytes long."
6788 echo "(I can't seem to compile the test program. Guessing...)" >&4
6789 rp="What is the size of a pointer (in bytes)?"
6796 case "$use64bitall" in
6797 "$define"|true|[yY]*)
6801 *** You have chosen a maximally 64-bit build,
6802 *** but your pointers are only 4 bytes wide.
6803 *** Please rerun Configure without -Duse64bitall.
6808 *** Since you have quads, you could possibly try with -Duse64bitint.
6813 *** Cannot continue, aborting.
6824 : determine whether to use malloc wrapping
6826 case "$usemallocwrap" in
6827 [yY]*|true|$define) dflt='y' ;;
6828 [nN]*|false|$undef) dflt='n' ;;
6829 *) case "$usedevel" in
6830 [yY]*|true|$define) dflt='y' ;;
6835 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6837 usemallocwrap="$ans"
6840 usemallocwrap="$define" ;;
6842 usemallocwrap="$undef" ;;
6845 : determine which malloc to compile in
6847 case "$usemymalloc" in
6848 [yY]*|true|$define) dflt='y' ;;
6849 [nN]*|false|$undef) dflt='n' ;;
6850 *) case "$ptrsize" in
6856 rp="Do you wish to attempt to use the malloc that comes with $package?"
6862 mallocsrc='malloc.c'
6863 mallocobj="malloc$_o"
6864 d_mymalloc="$define"
6867 : Remove malloc from list of libraries to use
6868 echo "Removing unneeded -lmalloc from library list" >&4
6869 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6872 echo "libs = $libs" >&4
6884 : compute the return types of malloc and free
6886 $cat >malloc.c <<END
6890 #include <sys/types.h>
6904 case "$malloctype" in
6906 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6913 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6917 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6924 echo "Your system uses $freetype free(), it would seem." >&4
6926 : determine where site specific architecture-dependent libraries go.
6927 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6928 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6929 : sitelib may have an optional trailing /share.
6931 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6932 dflt="$dflt/$archname"
6937 set sitearch sitearch none
6941 The installation process will also create a directory for
6942 architecture-dependent site-specific extensions and modules.
6946 rp='Pathname for the site-specific architecture-dependent library files?'
6950 if $test X"$sitearch" = X"$sitelib"; then
6953 d_sitearch="$define"
6956 : Set the vendorprefix variables
6959 The installation process will also create a directory for
6960 vendor-supplied add-ons. Vendors who supply perl with their system
6961 may find it convenient to place all vendor-supplied files in this
6962 directory rather than in the main distribution directory. This will
6963 ease upgrades between binary-compatible maintenance versions of perl.
6965 Of course you may also use these directories in whatever way you see
6966 fit. For example, you might use them to access modules shared over a
6967 company-wide network.
6969 The default answer should be fine for most people.
6970 This causes further questions about vendor add-ons to be skipped
6971 and no vendor-specific directories will be configured for perl.
6974 rp='Do you want to configure vendor-specific add-on directories?'
6975 case "$usevendorprefix" in
6976 define|true|[yY]*) dflt=y ;;
6977 *) : User may have set vendorprefix directly on Configure command line.
6978 case "$vendorprefix" in
6987 rp='Installation prefix to use for vendor-supplied add-ons?'
6988 case "$vendorprefix" in
6990 *) dflt=$vendorprefix ;;
6993 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6995 case "$vendorprefix" in
6999 *) oldvendorprefix="$prefix";;
7003 usevendorprefix="$define"
7005 vendorprefixexp="$ansexp"
7007 *) usevendorprefix="$undef"
7013 : Set the vendorlib variables
7014 case "$vendorprefix" in
7015 '') d_vendorlib="$undef"
7019 *) d_vendorlib="$define"
7020 : determine where vendor-supplied modules go.
7021 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7022 case "$vendorlib" in
7024 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7025 case "$installstyle" in
7026 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7027 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7030 *) dflt="$vendorlib"
7034 rp='Pathname for the vendor-supplied library files?'
7037 vendorlibexp="$ansexp"
7040 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7044 : Set the vendorarch variables
7045 case "$vendorprefix" in
7046 '') d_vendorarch="$undef"
7050 *) d_vendorarch="$define"
7051 : determine where vendor-supplied architecture-dependent libraries go.
7052 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7053 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7054 : vendorlib may have an optional trailing /share.
7055 case "$vendorarch" in
7056 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7057 dflt="$dflt/$archname"
7059 *) dflt="$vendorarch" ;;
7062 rp='Pathname for vendor-supplied architecture-dependent files?'
7065 vendorarchexp="$ansexp"
7068 prefixvar=vendorarch
7070 if $test X"$vendorarch" = X"$vendorlib"; then
7071 d_vendorarch="$undef"
7073 d_vendorarch="$define"
7076 : Final catch-all directories to search
7079 Lastly, you can have perl look in other directories for extensions and
7080 modules in addition to those already specified.
7081 These directories will be searched after
7085 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7086 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7088 case "$otherlibdirs" in
7089 ''|' ') dflt='none' ;;
7090 *) dflt="$otherlibdirs" ;;
7093 Enter a colon-separated set of extra paths to include in perl's @INC
7094 search path, or enter 'none' for no extra paths.
7098 rp='Colon-separated list of additional directories for perl to search?'
7101 ' '|''|none) otherlibdirs=' ' ;;
7102 *) otherlibdirs="$ans" ;;
7104 case "$otherlibdirs" in
7108 set d_perl_otherlibdirs
7111 : Cruising for prototypes
7113 echo "Checking out function prototypes..." >&4
7114 $cat >prototype.c <<EOCP
7119 int main(int argc, char *argv[]) {
7122 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7123 echo "Your C compiler appears to support function prototypes."
7126 echo "Your C compiler doesn't seem to understand function prototypes."
7133 : Check if ansi2knr is required
7134 case "$prototype" in
7136 *) ansi2knr='ansi2knr'
7141 This version of $package can only be compiled by a compiler that
7142 understands function prototypes. Unfortunately, your C compiler
7144 doesn't seem to understand them. Sorry about that.
7146 If GNU cc is available for your system, perhaps you could try that instead.
7148 Eventually, we hope to support building Perl with pre-ANSI compilers.
7149 If you would like to help in that effort, please contact <perlbug@perl.org>.
7151 Aborting Configure now.
7158 dflt_dtrace='/usr/sbin/dtrace'
7159 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
7163 Perl can be built to support DTrace on platforms that support it.
7164 DTrace is a diagnosis and performance analysis tool from Sun.
7166 If this doesn't make any sense to you, just accept the default '$dflt'.
7170 case "$usedtrace" in
7176 dflt_dtrace=$usedtrace
7183 rp='Support DTrace if available?'
7186 y|Y) val="$define" ;;
7192 test "X$usedtrace" != "X$define" && break
7195 rp='Where is the dtrace executable?'
7204 if $dtrace -h -s ../perldtrace.d \
7205 -o perldtrace.tmp >/dev/null 2>&1 \
7206 && rm -f perldtrace.tmp
7209 echo "Good: your $dtrace knows about the -h flag."
7213 *** $me: Fatal Error: $dtrace doesn't support -h flag
7215 *** Your installed dtrace doesn't support the -h switch to compile a D
7216 *** program into a C header. Can't continue.
7228 *** $me: Fatal Error: $dtrace not found.
7235 echo "*** $dtrace was not found."
7241 : See if we want extra modules installed
7248 Perl can be built with extra modules or bundles of modules which
7249 will be fetched from the CPAN and installed alongside Perl.
7251 Notice that you will need access to the CPAN; either via the Internet,
7252 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7253 be asked later to configure the CPAN.pm module which will in turn do
7254 the installation of the rest of the extra modules or bundles.)
7256 Notice also that if the modules require any external software such as
7257 libraries and headers (the libz library and the zlib.h header for the
7258 Compress::Zlib module, for example) you MUST have any such software
7259 already installed, this configuration process will NOT install such
7262 If this doesn't make any sense to you, just accept the default '$dflt'.
7264 rp='Install any extra modules (y or n)?'
7270 Please list any extra modules or bundles to be installed from CPAN,
7271 with spaces between the names. The names can be in any format the
7272 'install' command of CPAN.pm will understand. (Answer 'none',
7273 without the quotes, to install no extra modules or bundles.)
7283 $rm -f ../extras.lst
7285 *) echo "(Saving the list of extras for later...)"
7286 echo "$extras" > ../extras.lst
7294 : determine where html pages for programs go
7295 set html1dir html1dir none
7299 If you wish to install html files for programs in $spackage, indicate
7300 the appropriate directory here. To skip installing html files,
7304 ''|none|$undef|' ') dflt=none ;;
7305 *) dflt=$html1dir ;;
7308 rp="Directory for the main $spackage html pages?"
7312 : Use ' ' for none so value is preserved next time through Configure
7313 $test X"$html1dir" = "X" && html1dir=' '
7315 : determine where html pages for libraries and modules go
7316 set html3dir html3dir none
7320 If you wish to install html files for modules associated with $spackage,
7321 indicate the appropriate directory here. To skip installing html files,
7324 : There is no obvious default. If they have specified html1dir, then
7325 : try to key off that, possibly changing .../html1 into .../html3.
7327 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7328 *) dflt=$html3dir ;;
7331 rp="Directory for the $spackage module html pages?"
7335 : Use ' ' for none so value is preserved next time through Configure
7336 $test X"$html3dir" = "X" && html3dir=' '
7338 : determine whether to install perl also as /usr/bin/perl
7341 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7343 Many scripts expect perl to be installed as /usr/bin/perl.
7345 If you want to, I can install the perl you are about to compile
7346 as /usr/bin/perl (in addition to $bin/perl).
7348 if test -f /usr/bin/perl; then
7351 However, please note that because you already have a /usr/bin/perl,
7352 overwriting that with a new Perl would very probably cause problems.
7353 Therefore I'm assuming you don't want to do that (unless you insist).
7356 case "$installusrbinperl" in
7357 "$define"|[yY]*) dflt='y';;
7363 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7366 case "$installusrbinperl" in
7367 "$undef"|[nN]*) dflt='n';;
7371 rp="Do you want to install perl as /usr/bin/perl?"
7374 [yY]*) val="$define";;
7380 set installusrbinperl
7383 : Check if we are using the GNU C library
7385 echo "Checking for GNU C Library..." >&4
7387 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7388 alone are insufficient to distinguish different versions, such as
7389 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7390 libc version 2.1.0. A. Dougherty, June 3, 2002.
7396 # ifdef __GLIBC_MINOR__
7397 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7398 # include <gnu/libc-version.h>
7399 printf("%s\n", gnu_get_libc_version());
7401 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7404 printf("%d\n", __GLIBC__);
7413 if eval $compile_ok && $run ./try > glibc.ver; then
7415 gnulibc_version=`$cat glibc.ver`
7416 echo "You are using the GNU C Library version $gnulibc_version"
7420 echo "You are not using the GNU C Library"
7426 : see if nm is to be used to determine whether a symbol is defined or not
7430 case "$d_gnulibc" in
7433 echo "nm probably won't work on the GNU C Library." >&4
7439 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7441 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7442 echo "'nm' won't be sufficient on this sytem." >&4
7448 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7449 if $test $dflt -gt 20; then
7459 true|$define) dflt=y;;
7466 I can use $nm to extract the symbols from your C libraries. This
7467 is a time consuming task which may generate huge output on the disk (up
7468 to 3 megabytes) but that should make the symbols extraction faster. The
7469 alternative is to skip the 'nm' extraction part and to compile a small
7470 test program instead to determine whether each symbol is present. If
7471 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7472 this may be the best solution.
7474 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7477 rp="Shall I use $nm to extract C symbols from the libraries?"
7480 [Nn]*) usenm=false;;
7489 : nm options which may be necessary
7491 '') if $test -f /mach_boot; then
7493 elif $test -d /usr/ccs/lib; then
7494 nm_opt='-p' # Solaris (and SunOS?)
7495 elif $test -f /dgux; then
7497 elif $test -f /lib64/rld; then
7498 nm_opt='-p' # 64-bit Irix
7504 : nm options which may be necessary for shared libraries but illegal
7505 : for archive libraries. Thank you, Linux.
7506 case "$nm_so_opt" in
7507 '') case "$myuname" in
7509 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7510 nm_so_opt='--dynamic'
7517 : Figure out where the libc is located
7520 : get list of predefined functions in a handy place
7525 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7531 *) for thislib in $libs; do
7534 : Handle C library specially below.
7537 thislib=`echo $thislib | $sed -e 's/^-l//'`
7538 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7540 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7542 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7544 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7546 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7548 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7550 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7555 libnames="$libnames $try"
7557 *) libnames="$libnames $thislib" ;;
7566 for xxx in $libpth; do
7567 $test -r $1 || set $xxx/libc.$so
7568 : The messy sed command sorts on library version numbers.
7570 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7571 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7573 s/[0-9][0-9]*/0000&/g
7574 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7577 $sort | $sed -e 's/^.* //'`
7580 $test -r $1 || set /usr/ccs/lib/libc.$so
7581 $test -r $1 || set /lib/libsys_s$_a
7587 if $test -r "$1"; then
7588 echo "Your (shared) C library seems to be in $1."
7590 elif $test -r /lib/libc && $test -r /lib/clib; then
7591 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7593 libc='/lib/clib /lib/libc'
7594 if $test -r /lib/syslib; then
7595 echo "(Your math library is in /lib/syslib.)"
7596 libc="$libc /lib/syslib"
7598 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7599 echo "Your C library seems to be in $libc, as you said before."
7600 elif $test -r $incpath/usr/lib/libc$_a; then
7601 libc=$incpath/usr/lib/libc$_a;
7602 echo "Your C library seems to be in $libc. That's fine."
7603 elif $test -r /lib/libc$_a; then
7605 echo "Your C library seems to be in $libc. You're normal."
7607 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7609 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7610 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7611 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7613 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7615 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7618 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7620 if $test -r "$tans"; then
7621 echo "Your C library seems to be in $tans, of all places."
7627 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7631 If the guess above is wrong (which it might be if you're using a strange
7632 compiler, or your machine supports multiple models), you can override it here.
7637 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7639 I can't seem to find your C library. I've looked in the following places:
7642 $sed 's/^/ /' libpath
7645 None of these seems to contain your C library. I need to get its name...
7650 rp='Where is your C library?'
7655 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7656 set X `cat libnames`
7659 case $# in 1) xxx=file; esac
7660 echo "Extracting names from the following $xxx for later perusal:" >&4
7662 $sed 's/^/ /' libnames >&4
7664 $echo $n "This may take a while...$c" >&4
7668 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7669 *) $nm $nm_opt $file 2>/dev/null;;
7674 $grep fprintf libc.tmp > libc.ptf
7675 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7676 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7678 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7680 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7682 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7684 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7686 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7688 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7690 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7692 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7694 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7696 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7698 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7700 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7702 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7703 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7705 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7707 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7709 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7711 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7713 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7715 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7717 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7719 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7721 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7723 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7725 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7727 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7729 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7731 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7733 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7736 $nm -p $* 2>/dev/null >libc.tmp
7737 $grep fprintf libc.tmp > libc.ptf
7738 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7739 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7745 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7747 if $ar t $libc > libc.tmp && \
7748 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7750 for thisname in $libnames $libc; do
7751 $ar t $thisname >>libc.tmp
7753 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7755 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7756 for thisname in $libnames $libc; do
7757 $ar tv $thisname >>libc.tmp
7758 emximp -o tmp.imp $thisname \
7760 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7761 < tmp.imp >>libc.tmp
7764 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7767 echo "$ar didn't seem to work right." >&4
7768 echo "Maybe this is a Cray...trying bld instead..." >&4
7770 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7773 for thisname in $libnames; do
7775 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7776 $ar t $thisname >>libc.tmp
7780 echo "That didn't work either. Giving up." >&4
7790 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7791 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7793 *) if $test -f /lib/syscalls.exp; then
7795 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7796 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7797 /lib/syscalls.exp >>libc.list
7803 $rm -f libnames libpath
7805 : see if dld is available
7809 : Check if we are using C++
7811 echo "Checking for C++..." >&4
7812 $cat >try.c <<'EOCP'
7824 if eval $compile_ok && $run ./try; then
7826 echo "You are using a C++ compiler."
7829 echo "You are not using a C++ compiler."
7835 : is a C symbol defined?
7838 -v) tf=libc.tmp; tdc="";;
7839 -a) tf=libc.tmp; tdc="[]";;
7840 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7842 case "$d_cplusplus" in
7843 $define) extern_C="extern \"C\"" ;;
7844 *) extern_C="extern" ;;
7847 case "$reuseval-$4" in
7849 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7854 if $test "$runnm" = true; then
7855 if $contains $tlook $tf >/dev/null 2>&1; then
7857 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7858 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7859 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7860 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7864 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7865 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7871 $define) tval=true;;
7878 : define an is-in-libc? function
7879 inlibc='echo " "; td=$define; tu=$undef;
7880 sym=$1; var=$2; eval "was=\$$2";
7882 case "$reuseval$was" in
7892 echo "$sym() found." >&4;
7893 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7895 echo "$sym() NOT found." >&4;
7896 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7900 $define) echo "$sym() found." >&4;;
7901 *) echo "$sym() NOT found." >&4;;
7905 : see if dlopen exists
7907 xxx_ccflags="$ccflags"
7909 : with g++ one needs -shared to get is-in-libc to work for dlopen
7910 case "$gccversion" in
7912 *) case "$d_cplusplus" in
7913 "$define") ccflags="$ccflags -shared" ;;
7920 ccflags="$xxx_ccflags"
7922 : see if this is a unistd.h system
7923 set unistd.h i_unistd
7926 : determine which dynamic loading, if any, to compile in
7928 dldir="ext/DynaLoader"
7941 $define) dflt='y' ;;
7944 $define) dflt='y' ;;
7946 : Does a dl_xxx.xs file exist for this operating system
7947 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7950 rp="Do you wish to use dynamic loading?"
7958 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7959 dflt="$dldir/dl_${osname}.xs"
7960 elif $test "$d_dlopen" = "$define" ; then
7961 dflt="$dldir/dl_dlopen.xs"
7962 elif $test "$i_dld" = "$define" ; then
7963 dflt="$dldir/dl_dld.xs"
7968 *) dflt="$dldir/$dlsrc"
7971 echo "The following dynamic loading files are available:"
7972 : Can not go over to $dldir because getfile has path hard-coded in.
7973 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7974 rp="Source file to use for dynamic loading"
7980 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7984 Some systems may require passing special flags to $cc -c to
7985 compile modules that will be used to create a shared library.
7986 To use no flags, say "none".
7989 case "$cccdlflags" in
7990 '') case "$gccversion" in
7991 '') case "$osname" in
7993 next) dflt='none' ;;
7994 irix*) dflt='-KPIC' ;;
7995 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7996 sunos) dflt='-pic' ;;
8000 *) case "$osname" in
8001 darwin) dflt='none' ;;
8002 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8007 *) dflt="$cccdlflags" ;;
8009 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8012 none) cccdlflags=' ' ;;
8013 *) cccdlflags="$ans" ;;
8018 Some systems use ld to create libraries that can be dynamically loaded,
8019 while other systems (such as those using ELF) use $cc.
8023 '') $cat >try.c <<EOM
8024 /* Test for whether ELF binaries are produced */
8036 int i = open("a.out",O_RDONLY);
8039 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8040 exit(0); /* succeed (yes, it's ELF) */
8045 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8047 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8052 echo "I'll use ld to build dynamic libraries."
8061 rp="What command should be used to create dynamic libraries?"
8067 Some systems may require passing special flags to $ld to create a
8068 library that can be dynamically loaded. If your ld flags include
8069 -L/other/path options to locate libraries outside your loader's normal
8070 search path, you may need to specify those -L options here as well. To
8071 use no flags, say "none".
8074 case "$lddlflags" in
8075 '') case "$osname" in
8076 beos) dflt='-nostart' ;;
8077 haiku) dflt='-shared' ;;
8079 case "$gccversion" in
8080 '') dflt="$dflt +vnocompatwarnings" ;;
8083 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8084 next) dflt='none' ;;
8085 solaris) dflt='-G' ;;
8086 sunos) dflt='-assert nodefinitions' ;;
8087 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8091 *) dflt="$lddlflags" ;;
8094 : Try to guess additional flags to pick up local libraries.
8095 : Be careful not to append to a plain 'none'
8099 for thisflag in $ldflags; do
8104 *) dflt="$dflt $thisflag" ;;
8111 ''|' ') dflt='none' ;;
8115 *-fstack-protector*)
8117 *-fstack-protector*) ;; # Don't add it again
8118 *) dflt="$dflt -fstack-protector" ;;
8124 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8127 none) lddlflags=' ' ;;
8128 *) lddlflags="$ans" ;;
8133 Some systems may require passing special flags to $cc to indicate that
8134 the resulting executable will use dynamic linking. To use no flags,
8138 case "$ccdlflags" in
8139 '') case "$osname" in
8140 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8141 next|sunos) dflt='none' ;;
8145 *) dflt="$ccdlflags" ;;
8147 rp="Any special flags to pass to $cc to use dynamic linking?"
8150 none) ccdlflags=' ' ;;
8151 *) ccdlflags="$ans" ;;
8162 : Do we want a shared libperl?
8166 # No dynamic loading being used, so don't bother even to prompt.
8169 *) case "$useshrplib" in
8170 '') case "$osname" in
8171 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|haiku|cygwin*)
8173 also='Building a shared libperl is required for dynamic loading to work on your system.'
8178 also='Building a shared libperl is needed for MAB support.'
8196 The perl executable is normally obtained by linking perlmain.c with
8197 libperl${_a}, any static extensions (usually just DynaLoader), and
8198 any other libraries needed on this system (such as -lm, etc.). Since
8199 your system supports dynamic loading, it is probably possible to build
8200 a shared libperl.$so. If you will have more than one executable linked
8201 to libperl.$so, this will significantly reduce the size of each
8202 executable, but it may have a noticeable effect on performance. The
8203 default is probably sensible for your system.
8207 rp="Build a shared libperl.$so (y/n)"
8211 useshrplib='true' ;;
8212 *) useshrplib='false' ;;
8217 case "$useshrplib" in
8219 case "$userelocatableinc" in
8221 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8222 echo "See INSTALL for an explanation why that won't work." >&4
8228 # Figure out a good name for libperl.so. Since it gets stored in
8229 # a version-specific architecture-dependent library, the version
8230 # number isn't really that important, except for making cc/ld happy.
8232 # A name such as libperl.so.10.1
8233 majmin="libperl.$so.$patchlevel.$subversion"
8234 # A name such as libperl.so.100
8235 majonly=`echo $patchlevel $subversion |
8236 $awk '{printf "%d%02d", $1, $2}'`
8237 majonly=libperl.$so.$majonly
8238 # I'd prefer to keep the os-specific stuff here to a minimum, and
8239 # rely on figuring it out from the naming of libc.
8240 case "${osname}${osvers}" in
8243 # XXX How handle the --version stuff for MAB?
8245 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8248 cygwin*) # ld links now against the dll directly
8249 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8250 majonly=`echo $patchlevel $subversion |
8251 $awk '{printf "%03d%03d", $1, $2}'`
8252 majonly=cygperl5.$majonly.$so
8255 *) # Try to guess based on whether libc has major.minor.
8257 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8258 *libc.$so.[0-9]*) dflt=$majonly ;;
8259 *) dflt=libperl.$so ;;
8269 I need to select a good name for the shared libperl. If your system uses
8270 library names with major and minor numbers, then you might want something
8271 like $majmin. Alternatively, if your system uses a single version
8272 number for shared libraries, then you might want to use $majonly.
8273 Or, your system might be quite happy with a simple libperl.$so.
8275 Since the shared libperl will get installed into a version-specific
8276 architecture-dependent directory, the version number of the shared perl
8277 library probably isn't important, so the default should be o.k.
8280 rp='What name do you want to give to the shared libperl?'
8283 echo "Ok, I'll use $libperl"
8286 libperl="libperl${_a}"
8290 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8294 WARNING: Use of the shrpdir variable for the installation location of
8295 the shared $libperl is not supported. It was never documented and
8296 will not work in this version. Let me (perlbug@perl.org)
8297 know of any problems this may cause.
8303 But your current setting of $shrpdir is
8304 the default anyway, so it's harmless.
8309 Further, your current attempted setting of $shrpdir
8310 conflicts with the value of $archlibexp/CORE
8311 that installperl will use.
8318 # How will the perl executable find the installed shared $libperl?
8319 # Add $xxx to ccdlflags.
8320 # If we can't figure out a command-line option, use $shrpenv to
8321 # set env LD_RUN_PATH. The main perl makefile uses this.
8322 shrpdir=$archlibexp/CORE
8325 if "$useshrplib"; then
8328 # We'll set it in Makefile.SH...
8333 freebsd|netbsd|openbsd|interix|dragonfly)
8334 xxx="-Wl,-R$shrpdir"
8336 bsdos|linux|irix*|dec_osf|gnu*)
8337 xxx="-Wl,-rpath,$shrpdir"
8340 # next doesn't like the default...
8343 # beos doesn't like the default, either.
8346 # Haiku doesn't like the default, either.
8349 # hpux doesn't like the default, either.
8350 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8353 # cygwin needs only ldlibpth
8356 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8362 # Only add $xxx if it isn't already in ccdlflags.
8363 case " $ccdlflags " in
8365 *) ccdlflags="$ccdlflags $xxx"
8368 Adding $xxx to the flags
8369 passed to $ld so that the perl executable will find the
8370 installed shared $libperl.
8378 # Fix ccdlflags in AIX for building external extensions.
8379 # (For building Perl itself bare -bE:perl.exp is needed,
8380 # Makefile.SH takes care of this.)
8382 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8384 # Respect a hint or command-line value.
8386 '') shrpenv="$tmp_shrpenv" ;;
8388 case "$ldlibpthname" in
8389 '') ldlibpthname=LD_LIBRARY_PATH ;;
8390 none) ldlibpthname='' ;;
8393 : determine where manual pages are on this system
8397 syspath='/usr/share/man/man1 /usr/man/man1'
8398 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8399 syspath="$syspath /usr/man/u_man/man1"
8400 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8401 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8402 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8403 sysman=`./loc . /usr/man/man1 $syspath`
8406 if $test -d "$sysman"; then
8407 echo "System manual is in $sysman." >&4
8409 echo "Could not find manual pages in source form." >&4
8412 : determine where manual pages go
8413 set man1dir man1dir none
8417 $spackage has manual pages available in source form.
8421 echo "However, you don't have nroff, so they're probably useless to you."
8423 '') man1dir="none";;
8426 echo "If you don't want the manual sources installed, answer 'none'."
8431 lookpath="$prefixexp/share/man/man1"
8432 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8433 lookpath="$lookpath $prefixexp/man/p_man/man1"
8434 lookpath="$lookpath $prefixexp/man/u_man/man1"
8435 lookpath="$lookpath $prefixexp/man/man.1"
8437 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8438 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8448 rp="Where do the main $spackage manual pages (source) go?"
8450 if $test "X$man1direxp" != "X$ansexp"; then
8461 : What suffix to use on installed man pages
8468 rp="What suffix should be used for the main $spackage man pages?"
8470 '') case "$man1dir" in
8484 *) dflt="$man1ext";;
8491 : see if we can have long filenames
8493 first=123456789abcdef
8495 if (echo hi >$first) 2>/dev/null; then
8496 if $test -f 123456789abcde; then
8497 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8500 echo 'You can have filenames longer than 14 characters.'>&4
8505 You can't have filenames longer than 14 chars.
8506 You can't even think about them!
8512 $rm -rf 123456789abcde*
8514 : determine where library module manual pages go
8515 set man3dir man3dir none
8519 $spackage has manual pages for many of the library modules.
8525 However, you don't have nroff, so they're probably useless to you.
8528 '') man3dir="none";;
8532 case "$d_flexfnam" in
8535 However, your system can't handle the long file names like File::Basename.3.
8538 '') man3dir="none";;
8542 echo "If you don't want the manual sources installed, answer 'none'."
8543 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8545 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8546 if $test -d "$privlib/man/man3"; then
8549 WARNING: Previous versions of perl installed man3 pages into
8550 $privlib/man/man3. This version will suggest a
8551 new default of $dflt.
8555 rp='Do you wish to preserve the old behavior?(y/n)'
8558 y*) dflt="$privlib/man/man3" ;;
8563 *) dflt="$man3dir" ;;
8570 rp="Where do the $package library man pages (source) go?"
8580 : What suffix to use on installed man pages
8586 rp="What suffix should be used for the $package library man pages?"
8588 '') case "$man3dir" in
8602 *) dflt="$man3ext";;
8609 : see if we have to deal with yellow pages, now NIS.
8610 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8611 if $test -f /usr/etc/nibindd; then
8613 echo "I'm fairly confident you're on a NeXT."
8615 rp='Do you get the hosts file via NetInfo?'
8624 y*) hostcat='nidump hosts .';;
8625 *) case "$hostcat" in
8626 nidump*) hostcat='';;
8636 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8644 rp='Are you getting the hosts file via yellow pages?'
8647 y*) hostcat='ypcat hosts';;
8648 *) hostcat='cat /etc/hosts';;
8654 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8657 '') test -f /etc/group && groupcat='cat /etc/group';;
8660 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8663 : now get the host name
8665 echo "Figuring out host name..." >&4
8666 case "$myhostname" in
8668 echo 'Maybe "hostname" will work...'
8669 if tans=`sh -c hostname 2>&1` ; then
8677 if $test "$cont"; then
8679 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8680 if tans=`cat /etc/systemid 2>&1` ; then
8682 phostname='cat /etc/systemid'
8683 echo "Whadyaknow. Xenix always was a bit strange..."
8686 elif $test -r /etc/systemid; then
8687 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8690 if $test "$cont"; then
8691 echo 'No, maybe "uuname -l" will work...'
8692 if tans=`sh -c 'uuname -l' 2>&1` ; then
8694 phostname='uuname -l'
8696 echo 'Strange. Maybe "uname -n" will work...'
8697 if tans=`sh -c 'uname -n' 2>&1` ; then
8699 phostname='uname -n'
8701 echo 'Oh well, maybe I can mine it out of whoami.h...'
8702 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8703 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8704 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8706 case "$myhostname" in
8707 '') echo "Does this machine have an identity crisis or something?"
8710 echo "Well, you said $myhostname before..."
8711 phostname='echo $myhostname';;
8717 case "$myhostname" in
8718 '') myhostname=noname ;;
8720 : you do not want to know about this
8725 if $test "$myhostname" ; then
8727 rp='Your host name appears to be "'$myhostname'".'" Right?"
8735 : bad guess or no guess
8736 while $test "X$myhostname" = X ; do
8738 rp="Please type the (one word) name of your host:"
8743 : translate upper to lower if necessary
8744 case "$myhostname" in
8746 echo "(Normalizing case in your host name)"
8747 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8751 case "$myhostname" in
8753 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8754 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8755 echo "(Trimming domain name from host name--host name is now $myhostname)"
8757 *) case "$mydomain" in
8760 test "X$hostcat" = "Xypcat hosts" &&
8761 ypmatch "$myhostname" hosts 2>/dev/null |\
8762 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8765 test "X$hostcat" != "X" &&
8766 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8767 /[ ]$myhostname[ . ]/p" > hosts
8770 if $test -f hosts; then
8771 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8772 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8773 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8774 hosts | $sort | $uniq | \
8775 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8776 case `$echo X$dflt` in
8777 X*\ *) echo "(Several hosts in the database matched hostname)"
8780 X.) echo "(You do not have fully-qualified names in the hosts database)"
8784 echo "(I cannot locate a hosts database anywhere)"
8789 tans=`./loc resolv.conf X /etc /usr/etc`
8790 if $test -f "$tans"; then
8791 echo "(Attempting domain name extraction from $tans)"
8792 dflt=.`$sed -n -e 's/ / /g' \
8793 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8796 .) dflt=.`$sed -n -e 's/ / /g' \
8797 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8805 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8806 dflt=.`sh -c domainname 2>/dev/null`
8809 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8813 case "$dflt$osname" in
8814 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8815 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8819 .) echo "(Lost all hope -- silly guess then)"
8825 *) dflt="$mydomain";;
8829 rp="What is your domain name?"
8839 : translate upper to lower if necessary
8842 echo "(Normalizing case in your domain name)"
8843 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8847 : a little sanity check here
8848 case "$phostname" in
8851 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8852 $myhostname$mydomain|$myhostname) ;;
8854 case "$phostname" in
8856 echo "(That doesn't agree with your whoami.h file, by the way.)"
8859 echo "(That doesn't agree with your $phostname command, by the way.)"
8867 : determine the e-mail address of the user who is running us
8870 I need to get your e-mail address in Internet format if possible, i.e.
8871 something like user@host.domain. Please answer accurately since I have
8872 no easy means to double check it. The default value provided below
8873 is most probably close to reality but may not be valid from outside
8874 your organization...
8878 while test "$cont"; do
8880 '') dflt="$cf_by@$myhostname$mydomain";;
8881 *) dflt="$cf_email";;
8883 rp='What is your e-mail address?'
8889 rp='Address does not look like an Internet one. Use it anyway?'
8903 : Ask e-mail of administrator
8906 If you or somebody else will be maintaining perl at your site, please
8907 fill in the correct e-mail address here so that they may be contacted
8908 if necessary. Currently, the "perlbug" program included with perl
8909 will send mail to this address in addition to perlbug@perl.org. You may
8910 enter "none" for no administrator.
8913 case "$perladmin" in
8914 '') dflt="$cf_email";;
8915 *) dflt="$perladmin";;
8917 rp='Perl administrator e-mail address'
8921 : determine whether to only install version-specific parts.
8924 Do you want to install only the version-specific parts of the perl
8925 distribution? Usually you do *not* want to do this.
8927 case "$versiononly" in
8928 "$define"|[Yy]*|true) dflt='y' ;;
8931 rp="Do you want to install only the version-specific parts of perl?"
8934 [yY]*) val="$define";;
8940 case "$versiononly" in
8941 "$define") inc_version_list=''
8942 inc_version_list_init=0
8946 : figure out how to guarantee perl startup
8947 : XXX Note that this currently takes advantage of the bug that binexp ignores
8948 : the Configure -Dinstallprefix setting, which in turn means that under
8949 : relocatable @INC, initialinstalllocation is what binexp started as.
8950 case "$startperl" in
8952 case "$sharpbang" in
8956 I can use the #! construct to start perl on your system. This will
8957 make startup of perl scripts faster, but may cause problems if you
8958 want to share those scripts and perl is not in a standard place
8959 ($initialinstalllocation/perl) on all your platforms. The alternative
8960 is to force a shell by starting the script with a single ':' character.
8963 case "$versiononly" in
8964 "$define") dflt="$initialinstalllocation/perl$version";;
8965 *) dflt="$initialinstalllocation/perl";;
8967 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8970 none) startperl=": # use perl";;
8971 *) startperl="#!$ans"
8972 if $test 30 -lt `echo "$ans" | wc -c`; then
8975 WARNING: Some systems limit the #! command to 32 characters.
8976 If you experience difficulty running Perl scripts with #!, try
8977 installing Perl in a directory with a shorter pathname.
8983 *) startperl=": # use perl"
8988 echo "I'll use $startperl to start perl scripts."
8990 : figure best path for perl in scripts
8993 case "$versiononly" in
8994 "$define") perlpath="$initialinstalllocation/perl$version";;
8995 *) perlpath="$initialinstalllocation/perl";;
8997 case "$startperl" in
9002 I will use the "eval 'exec'" idiom to start Perl on your system.
9003 I can use the full path of your Perl binary for this purpose, but
9004 doing so may cause problems if you want to share those scripts and
9005 Perl is not always in a standard place ($initialinstalllocation/perl).
9008 dflt="$initialinstalllocation/perl"
9009 rp="What path shall I use in \"eval 'exec'\"?"
9016 case "$startperl" in
9018 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9021 : determine where public executable scripts go
9022 set scriptdir scriptdir
9024 case "$scriptdir" in
9027 : guess some guesses
9028 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9029 $test -d /usr/share/bin && dflt=/usr/share/bin
9030 $test -d /usr/local/script && dflt=/usr/local/script
9031 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9032 $test -d $prefixexp/script && dflt=$prefixexp/script
9036 *) dflt="$scriptdir"
9041 Some installations have a separate directory just for executable scripts so
9042 that they can mount it across multiple architectures but keep the scripts in
9043 one spot. You might, for example, have a subdirectory of /usr/share for this.
9044 Or you might just lump your scripts in with all your other executables.
9048 rp='Where do you keep publicly executable scripts?'
9050 if $test "X$ansexp" != "X$scriptdirexp"; then
9056 : A little fix up for an irregularly named variable.
9057 installscript="$installscriptdir"
9059 : determine where add-on public executables go
9061 '') dflt=$siteprefix/bin ;;
9065 rp='Pathname where the add-on public executables should be installed?'
9070 : determine where add-on html pages go
9071 : There is no standard location, so try to copy the previously-selected
9072 : directory structure for the core html pages.
9073 case "$sitehtml1dir" in
9074 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9075 *) dflt=$sitehtml1dir ;;
9078 ''|' ') dflt=none ;;
9081 rp='Pathname where the site-specific html pages should be installed?'
9083 prefixvar=sitehtml1dir
9086 : determine where add-on library html pages go
9087 : There is no standard location, so try to copy the previously-selected
9088 : directory structure for the core html pages.
9089 case "$sitehtml3dir" in
9090 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9091 *) dflt=$sitehtml3dir ;;
9094 ''|' ') dflt=none ;;
9097 rp='Pathname where the site-specific library html pages should be installed?'
9099 prefixvar=sitehtml3dir
9102 : determine where add-on manual pages go
9103 case "$siteman1dir" in
9104 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9105 *) dflt=$siteman1dir ;;
9108 ''|' ') dflt=none ;;
9111 rp='Pathname where the site-specific manual pages should be installed?'
9113 prefixvar=siteman1dir
9116 : determine where add-on library man pages go
9117 case "$siteman3dir" in
9118 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9119 *) dflt=$siteman3dir ;;
9122 ''|' ') dflt=none ;;
9125 rp='Pathname where the site-specific library manual pages should be installed?'
9127 prefixvar=siteman3dir
9130 : determine where add-on public executable scripts go
9131 case "$sitescript" in
9132 '') dflt=$siteprefix/script
9133 $test -d $dflt || dflt=$sitebin ;;
9134 *) dflt="$sitescript" ;;
9137 rp='Pathname where add-on public executable scripts should be installed?'
9139 prefixvar=sitescript
9142 : Check if faststdio is requested and available
9143 case "$usefaststdio" in
9144 $define|true|[yY]*|'')
9145 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9155 Perl can be built to use 'fast stdio', which means using the stdio
9156 library but also directly manipulating the stdio buffers to enable
9157 faster I/O. Using stdio is better for backward compatibility (especially
9158 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9159 interface has been preferred instead of stdio.
9161 If this doesn't make any sense to you, just accept the default '$dflt'.
9163 rp='Use the "fast stdio" if available?'
9166 y|Y) val="$define" ;;
9173 : define an is-a-typedef? function
9174 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9176 "") inclist="sys/types.h";;
9178 eval "varval=\$$var";
9182 for inc in $inclist; do
9183 echo "#include <$inc>" >>temp.c;
9185 echo "#ifdef $type" >> temp.c;
9186 echo "printf(\"We have $type\");" >> temp.c;
9187 echo "#endif" >> temp.c;
9188 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9189 if $contains $type temp.E >/dev/null 2>&1; then
9195 *) eval "$var=\$varval";;
9198 : define an is-a-typedef? function that prompts if the type is not available.
9199 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9201 "") inclist="sys/types.h";;
9203 eval "varval=\$$var";
9207 for inc in $inclist; do
9208 echo "#include <$inc>" >>temp.c;
9210 echo "#ifdef $type" >> temp.c;
9211 echo "printf(\"We have $type\");" >> temp.c;
9212 echo "#endif" >> temp.c;
9213 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9215 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9216 if $contains $type temp.E >/dev/null 2>&1; then
9217 echo "$type found." >&4;
9220 echo "$type NOT found." >&4;
9226 *) eval "$var=\$varval";;
9229 : see what type lseek is declared as in the kernel
9230 rp="What is the type used for lseek's offset on this system?"
9231 set off_t lseektype long stdio.h sys/types.h
9235 echo "Checking to see how big your file offsets are..." >&4
9237 #include <sys/types.h>
9241 printf("%d\n", (int)sizeof($lseektype));
9246 if eval $compile_ok; then
9247 lseeksize=`$run ./try`
9248 echo "Your file offsets are $lseeksize bytes long."
9252 echo "(I can't seem to compile the test program. Guessing...)"
9253 rp="What is the size of your file offsets (in bytes)?"
9259 : see what type file positions are declared as in the library
9260 rp="What is the type for file position used by fsetpos()?"
9261 set fpos_t fpostype long stdio.h sys/types.h
9264 : Check size for Fpos_t
9267 *_t) zzz="$fpostype" ;;
9270 echo "Checking the size of $zzz..." >&4
9272 #include <sys/types.h>
9279 printf("%d\n", (int)sizeof($fpostype));
9284 if eval $compile_ok; then
9288 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9291 echo "Your $zzz is $fpossize bytes long."
9297 echo "(I can't compile the test program. Guessing...)" >&4
9298 rp="What is the size of your file positions (in bytes)?"
9303 : Check for large file support
9304 # Backward compatibility (uselfs is deprecated).
9306 "$define"|true|[yY]*)
9309 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9311 uselargefiles="$define"
9315 case "$lseeksize:$fpossize" in
9318 You can have files larger than 2 gigabytes.
9321 *) case "$uselargefiles" in
9322 "$undef"|false|[nN]*) dflt='n' ;;
9327 Perl can be built to understand large files (files larger than 2 gigabytes)
9328 on some systems. To do so, Configure can be run with -Duselargefiles.
9330 If this doesn't make any sense to you, just accept the default '$dflt'.
9332 rp='Try to understand large files, if available?'
9335 y|Y) val="$define" ;;
9342 : Look for a hint-file generated 'call-back-unit'. If the
9343 : user has specified that a large files perl is to be built,
9344 : we may need to set or change some other defaults.
9345 if $test -f uselargefiles.cbu; then
9346 echo "Your platform has some specific hints regarding large file builds, using them..."
9347 . ./uselargefiles.cbu
9349 case "$uselargefiles" in
9351 if $test -f uselargefiles.cbu; then
9353 echo "Rechecking to see how big your file offsets are..." >&4
9355 #include <sys/types.h>
9359 printf("%d\n", (int)sizeof($lseektype));
9364 if eval $compile_ok; then
9365 lseeksize=`$run ./try`
9366 $echo "Your file offsets are now $lseeksize bytes long."
9370 echo "(I can't seem to compile the test program. Guessing...)"
9371 rp="What is the size of your file offsets (in bytes)?"
9376 *_t) zzz="$fpostype" ;;
9379 $echo $n "Rechecking the size of $zzz...$c" >&4
9381 #include <sys/types.h>
9388 printf("%d\n", (int)sizeof($fpostype));
9393 if eval $compile_ok; then
9398 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9401 echo " $fpossize bytes." >&4
9407 echo "(I can't compile the test program. Guessing...)" >&4
9408 rp="What is the size of your file positions (in bytes)?"
9417 : Set the vendorbin variables
9418 case "$vendorprefix" in
9419 '') d_vendorbin="$undef"
9423 *) d_vendorbin="$define"
9424 : determine where vendor-supplied executables go.
9425 case "$vendorbin" in
9426 '') dflt=$vendorprefix/bin ;;
9427 *) dflt="$vendorbin" ;;
9430 rp='Pathname for the vendor-supplied executables directory?'
9433 vendorbinexp="$ansexp"
9439 : Set the vendorhtml1dir variables
9440 case "$vendorprefix" in
9441 '') vendorhtml1dir=''
9442 vendorhtml1direxp=''
9444 *) : determine where vendor-supplied html pages go.
9445 : There is no standard location, so try to copy the previously-selected
9446 : directory structure for the core html pages.
9447 : XXX Better default suggestions would be welcome.
9448 case "$vendorhtml1dir" in
9449 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9450 *) dflt=$vendorhtml1dir ;;
9453 ''|' ') dflt=none ;;
9456 rp='Pathname for the vendor-supplied html pages?'
9458 vendorhtml1dir="$ans"
9459 vendorhtml1direxp="$ansexp"
9462 : Use ' ' for none so value is preserved next time through Configure
9463 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9464 prefixvar=vendorhtml1dir
9467 : Set the vendorhtml3dir variables
9468 case "$vendorprefix" in
9469 '') vendorhtml3dir=''
9470 vendorhtml3direxp=''
9472 *) : determine where vendor-supplied module html pages go.
9473 : There is no standard location, so try to copy the previously-selected
9474 : directory structure for the core html pages.
9475 : XXX Better default suggestions would be welcome.
9476 case "$vendorhtml3dir" in
9477 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9478 *) dflt=$vendorhtml3dir ;;
9481 ''|' ') dflt=none ;;
9484 rp='Pathname for the vendor-supplied html pages?'
9486 vendorhtml3dir="$ans"
9487 vendorhtml3direxp="$ansexp"
9490 : Use ' ' for none so value is preserved next time through Configure
9491 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9492 prefixvar=vendorhtml3dir
9495 : Set the vendorman1dir variables
9496 case "$vendorprefix" in
9497 '') vendorman1dir=''
9500 *) : determine where vendor-supplied manual pages go.
9501 case "$vendorman1dir" in
9502 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9503 *) dflt=$vendorman1dir ;;
9506 ''|' ') dflt=none ;;
9509 rp='Pathname for the vendor-supplied manual section 1 pages?'
9511 vendorman1dir="$ans"
9512 vendorman1direxp="$ansexp"
9515 : Use ' ' for none so value is preserved next time through Configure
9516 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9517 prefixvar=vendorman1dir
9520 : Set the vendorman3dir variables
9521 case "$vendorprefix" in
9522 '') vendorman3dir=''
9525 *) : determine where vendor-supplied module manual pages go.
9526 case "$vendorman3dir" in
9527 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9528 *) dflt=$vendorman3dir ;;
9531 ''|' ') dflt=none ;;
9534 rp='Pathname for the vendor-supplied manual section 3 pages?'
9536 vendorman3dir="$ans"
9537 vendorman3direxp="$ansexp"
9540 : Use ' ' for none so value is preserved next time through Configure
9541 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9542 prefixvar=vendorman3dir
9545 : Set the vendorscript variables
9546 case "$vendorprefix" in
9547 '') d_vendorscript="$undef"
9551 *) d_vendorscript="$define"
9552 : determine where vendor-supplied scripts go.
9553 case "$vendorscript" in
9554 '') dflt=$vendorprefix/script
9555 $test -d $dflt || dflt=$vendorbin ;;
9556 *) dflt="$vendorscript" ;;
9560 The installation process will create a directory for
9561 vendor-supplied scripts.
9565 rp='Pathname for the vendor-supplied scripts directory?'
9568 vendorscriptexp="$ansexp"
9571 prefixvar=vendorscript
9574 : script used to emit important warnings
9577 if test \$# -gt 0; then
9582 echo "*** WARNING:" >&4
9583 sed -e 's/^/*** /' <msg >&4
9585 cat msg >>config.msg
9586 echo " " >>config.msg
9592 : see which of string.h or strings.h is needed
9594 strings=`./findhdr string.h`
9595 if $test "$strings" && $test -r "$strings"; then
9596 echo "Using <string.h> instead of <strings.h>." >&4
9600 strings=`./findhdr strings.h`
9601 if $test "$strings" && $test -r "$strings"; then
9602 echo "Using <strings.h> instead of <string.h>." >&4
9604 ./warn "No string header found -- You'll surely have problems."
9610 "$undef") strings=`./findhdr strings.h`;;
9611 *) strings=`./findhdr string.h`;;
9614 : see if qgcvt exists
9618 : Check print/scan long double stuff
9621 if $test X"$d_longdbl" = X"$define"; then
9623 echo "Checking how to print long doubles..." >&4
9625 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9626 $cat >try.c <<'EOCP'
9627 #include <sys/types.h>
9631 printf("%.3f\n", d);
9635 if eval $compile; then
9639 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9640 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9641 echo "We will use %f."
9647 if $test X"$sPRIfldbl" = X; then
9648 $cat >try.c <<'EOCP'
9649 #include <sys/types.h>
9652 long double d = 123.456;
9653 printf("%.3Lf\n", d);
9657 if eval $compile; then
9661 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9662 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9663 echo "We will use %Lf."
9669 if $test X"$sPRIfldbl" = X; then
9670 $cat >try.c <<'EOCP'
9671 #include <sys/types.h>
9674 long double d = 123.456;
9675 printf("%.3llf\n", d);
9679 if eval $compile; then
9683 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9684 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9685 echo "We will use %llf."
9691 if $test X"$sPRIfldbl" = X; then
9692 $cat >try.c <<'EOCP'
9693 #include <sys/types.h>
9696 long double d = 123.456;
9697 printf("%.3lf\n", d);
9701 if eval $compile; then
9705 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9706 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9707 echo "We will use %lf."
9713 if $test X"$sPRIfldbl" = X; then
9714 echo "Cannot figure out how to print long doubles." >&4
9716 sSCNfldbl=$sPRIfldbl # expect consistency
9723 case "$sPRIfldbl" in
9724 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9725 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9726 d_SCNfldbl="$undef";
9728 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9729 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9730 d_SCNfldbl="$define";
9734 : Check how to convert floats to strings.
9736 if test "X$d_Gconvert" = X; then
9739 echo "Checking for an efficient way to convert floats to strings."
9741 case "$uselongdouble" in
9742 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9744 case "$d_longdbl" in
9745 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9747 case "$d_PRIgldbl" in
9748 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9752 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9753 char *myname = "gconvert";
9756 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9757 char *myname = "gcvt";
9760 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9761 char *myname = "qgcvt";
9762 #define DOUBLETYPE long double
9765 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9767 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9769 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9772 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9774 char *myname = "sprintf";
9778 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9779 #define DOUBLETYPE long double
9781 #define DOUBLETYPE double
9793 # include <string.h>
9795 # include <strings.h>
9798 int checkit(char *expect, char *got)
9800 if (strcmp(expect, got)) {
9801 printf("%s oddity: Expected %s, got %s\n",
9802 myname, expect, got);
9812 /* This must be 1st test on (which?) platform */
9813 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9814 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9815 checkit("0.1", buf);
9817 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9818 checkit("0.01", buf);
9820 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9821 checkit("0.001", buf);
9823 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9824 checkit("0.0001", buf);
9826 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9827 if (strlen(buf) > 5)
9828 checkit("9e-005", buf); /* for Microsoft ?? */
9830 checkit("9e-05", buf);
9832 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9835 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9836 checkit("1.1", buf);
9838 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9839 checkit("1.01", buf);
9841 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9842 checkit("1.001", buf);
9844 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9845 checkit("1.0001", buf);
9847 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9848 checkit("1.00001", buf);
9850 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9851 checkit("1.000001", buf);
9853 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9856 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9859 /* Some Linux gcvt's give 1.e+5 here. */
9860 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9861 checkit("100000", buf);
9863 /* Some Linux gcvt's give -1.e+5 here. */
9864 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9865 checkit("-100000", buf);
9867 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9868 checkit("123.456", buf);
9870 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9871 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9872 /* 34 should be enough to scare even long double
9873 * places into using the e notation. */
9874 if (strlen(buf) > 5)
9875 checkit("1e+034", buf); /* for Microsoft */
9877 checkit("1e+34", buf);
9879 /* For Perl, if you add additional tests here, also add them to
9880 * t/base/num.t for benefit of platforms not using Configure or
9881 * overriding d_Gconvert */
9886 : first add preferred functions to our list
9888 for xxx_convert in $gconvert_preference; do
9889 case $xxx_convert in
9890 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9891 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9894 : then add any others
9895 for xxx_convert in gconvert gcvt sprintf; do
9898 *) xxx_list="$xxx_list $xxx_convert" ;;
9902 case "$d_longdbl$uselongdouble" in
9904 : again, add prefered functions to our list first
9906 for xxx_convert in $gconvert_ld_preference; do
9907 case $xxx_convert in
9908 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9909 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9912 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9913 for xxx_convert in qgcvt sprintf $xxx_list; do
9914 case "$xxx_ld_list" in
9915 $xxx_convert*|*" $xxx_convert"*) ;;
9916 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9919 : if sprintf cannot do long doubles, move it to the end
9920 if test "$d_PRIgldbl" != "$define"; then
9921 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9923 : if no qgcvt, remove it
9924 if test "$d_qgcvt" != "$define"; then
9925 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9928 xxx_list="$xxx_ld_list"
9932 for xxx_convert in $xxx_list; do
9933 echo "Trying $xxx_convert..."
9934 $rm -f try try$_o core
9935 set try -DTRY_$xxx_convert
9936 if eval $compile; then
9937 echo "$xxx_convert() found." >&4
9939 echo "I'll use $xxx_convert to convert floats into a string." >&4
9942 echo "...But $xxx_convert didn't work as I expected."
9946 echo "$xxx_convert NOT found." >&4
9950 if test X$xxx_convert = X; then
9951 echo "*** WHOA THERE!!! ***" >&4
9952 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9956 case "$xxx_convert" in
9957 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9958 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9959 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9960 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9961 "$define$define$define")
9962 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9963 "$define$define$undef")
9964 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9965 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9973 : see if _fwalk exists
9977 : Initialize h_fcntl
9980 : Initialize h_sysfile
9983 : access call always available on UNIX
9987 : locate the flags for 'access()'
9991 $cat >access.c <<EOCP
9992 #include <sys/types.h>
9997 #include <sys/file.h>
10000 #include <unistd.h>
10002 #$i_stdlib I_STDLIB
10004 #include <stdlib.h>
10010 : check sys/file.h first, no particular reason here
10011 if $test `./findhdr sys/file.h` && \
10012 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10014 echo "<sys/file.h> defines the *_OK access constants." >&4
10015 elif $test `./findhdr fcntl.h` && \
10016 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10018 echo "<fcntl.h> defines the *_OK access constants." >&4
10019 elif $test `./findhdr unistd.h` && \
10020 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10021 echo "<unistd.h> defines the *_OK access constants." >&4
10023 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10029 : see if accessx exists
10030 set accessx d_accessx
10033 : see if aintl exists
10037 : see if alarm exists
10041 : see if 64bit time functions exists
10043 set ctime64 d_ctime64
10046 set localtime64 d_localtime64
10049 set gmtime64 d_gmtime64
10052 set mktime64 d_mktime64
10055 set difftime64 d_difftime64
10058 set asctime64 d_asctime64
10061 : see if POSIX threads are available
10062 set pthread.h i_pthread
10065 : define a fucntion to check prototypes
10066 $cat > protochk <<EOSH
10069 optimize="$optimize"
10071 prototype="$prototype"
10074 usethreads=$usethreads
10075 i_pthread=$i_pthread
10076 pthread_h_first=$pthread_h_first
10079 $cat >> protochk <<'EOSH'
10084 while test $# -ge 2; do
10086 $define) echo "#include <$2>" >> try.c ;;
10087 literal) echo "$2" >> try.c ;;
10089 # Extra magic for the benefit of systems that need pthread.h
10090 # to be included early to correctly detect threadsafe functions.
10091 # Such functions must guarantee themselves, though, that the usethreads
10092 # and i_pthread have been defined, before calling protochk.
10093 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10094 echo "#include <pthread.h>" >> try.c
10099 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10100 cat >> try.c <<'EOCP'
10101 #ifdef CAN_PROTOTYPE
10102 #define _(args) args
10107 echo "$foo" >> try.c
10108 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10109 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10115 $eunicefix protochk
10117 : Define hasproto macro for Configure internal use
10118 hasproto='varname=$1; func=$2; shift; shift;
10119 while $test $# -ge 2; do
10121 $define) echo "#include <$2>";;
10125 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10126 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10127 echo "$func() prototype found.";
10130 echo "$func() prototype NOT found.";
10137 : see if sys/types.h has to be included
10138 set sys/types.h i_systypes
10141 : see if sys/select.h has to be included
10142 set sys/select.h i_sysselct
10145 : Define hasfield macro for Configure internal use
10146 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10147 while $test $# -ge 2; do
10149 $define) echo "#include <$2>";;
10153 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10155 if eval $compile; then
10164 : see if we should include time.h, sys/time.h, or both
10166 if test "X$timeincl" = X; then
10167 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10168 $echo $n "I'm now running the test program...$c"
10170 #include <sys/types.h>
10175 #ifdef SYSTIMEKERNEL
10178 #include <sys/time.h>
10181 #include <sys/select.h>
10183 #$i_stdlib I_STDLIB
10185 #include <stdlib.h>
10191 struct timeval bar;
10194 struct timezone tzp;
10196 if (foo.tm_sec == foo.tm_sec)
10199 if (bar.tv_sec == bar.tv_sec)
10206 for s_timezone in '-DS_TIMEZONE' ''; do
10208 for s_timeval in '-DS_TIMEVAL' ''; do
10209 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10210 for i_time in '' '-DI_TIME'; do
10211 for i_systime in '-DI_SYSTIME' ''; do
10214 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10215 if eval $compile; then
10216 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10220 $echo $n "Succeeded with $flags$c"
10232 *SYSTIMEKERNEL*) i_systimek="$define"
10233 timeincl=`./findhdr sys/time.h`
10234 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10235 *) i_systimek="$undef";;
10238 *I_TIME*) i_time="$define"
10239 timeincl=`./findhdr time.h`" $timeincl"
10240 echo "We'll include <time.h>." >&4;;
10241 *) i_time="$undef";;
10244 *I_SYSTIME*) i_systime="$define"
10245 timeincl=`./findhdr sys/time.h`" $timeincl"
10246 echo "We'll include <sys/time.h>." >&4;;
10247 *) i_systime="$undef";;
10251 : see if struct tm knows about tm_zone
10252 case "$i_systime$i_time" in
10255 echo "Checking to see if your struct tm has tm_zone field..." >&4
10256 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10264 case "$d_tm_tm_zone" in
10265 "$define") echo "Yes, it does." ;;
10266 *) echo "No, it doesn't." ;;
10268 : see if struct tm knows about tm_gmtoff
10269 case "$i_systime$i_time" in
10272 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10273 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10281 case "$d_tm_tm_gmtoff" in
10282 "$define") echo "Yes, it does." ;;
10283 *) echo "No, it doesn't." ;;
10286 : see if asctime_r exists
10287 set asctime_r d_asctime_r
10289 case "$d_asctime_r" in
10291 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10292 case "$d_asctime_r_proto:$usethreads" in
10293 ":define") d_asctime_r_proto=define
10294 set d_asctime_r_proto asctime_r $hdrs
10298 case "$d_asctime_r_proto" in
10300 case "$asctime_r_proto" in
10301 ''|0) try='char* asctime_r(const struct tm*, char*);'
10302 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10304 case "$asctime_r_proto" in
10305 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10306 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10308 case "$asctime_r_proto" in
10309 ''|0) try='int asctime_r(const struct tm*, char*);'
10310 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10312 case "$asctime_r_proto" in
10313 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10314 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10316 case "$asctime_r_proto" in
10317 ''|0) d_asctime_r=undef
10319 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10320 * ) case "$asctime_r_proto" in
10321 REENTRANT_PROTO*) ;;
10322 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10324 echo "Prototype: $try" ;;
10327 *) case "$usethreads" in
10328 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10335 *) asctime_r_proto=0
10339 : see if atolf exists
10343 : see if atoll exists
10347 : Look for GCC-style attribute format
10348 case "$d_attribute_format" in
10351 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10352 $cat >attrib.c <<'EOCP'
10354 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10356 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10357 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10358 echo "Your C compiler doesn't support __attribute__((format))."
10361 echo "Your C compiler supports __attribute__((format))."
10365 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10369 *) val="$d_attribute_format" ;;
10371 set d_attribute_format
10375 : Look for GCC-style attribute format with null format allowed
10376 case "$d_printf_format_null" in
10377 '') case "$d_attribute_format" in
10380 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10381 $cat >attrib.c <<EOCP
10383 #$i_stdlib I_STDLIB
10385 #include <stdlib.h>
10387 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10388 int null_printf (char* pat,...) { return (int)pat; }
10389 int main () { exit(null_printf(NULL)); }
10391 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10392 : run the executable in case it produces a run-time warning
10393 if $run ./attrib >>attrib.out 2>&1; then
10394 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10395 echo "Your C compiler doesn't allow __printf__ format to be null."
10398 echo "Your C compiler allows __printf__ format to be null."
10402 echo "Your C compiler executable failed with __printf__ format null."
10406 echo "Your C compiler fails with __printf__ format null."
10413 *) val="$d_printf_format_null" ;;
10415 set d_printf_format_null
10419 : Look for GCC-style attribute malloc
10420 case "$d_attribute_malloc" in
10423 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10424 $cat >attrib.c <<'EOCP'
10426 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10428 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10429 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10430 echo "Your C compiler doesn't support __attribute__((malloc))."
10433 echo "Your C compiler supports __attribute__((malloc))."
10437 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10441 *) val="$d_attribute_malloc" ;;
10443 set d_attribute_malloc
10447 : Look for GCC-style attribute nonnull
10448 case "$d_attribute_nonnull" in
10451 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10452 $cat >attrib.c <<'EOCP'
10454 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10456 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10457 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10458 echo "Your C compiler doesn't support __attribute__((nonnull))."
10461 echo "Your C compiler supports __attribute__((nonnull))."
10465 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10469 *) val="$d_attribute_nonnull" ;;
10471 set d_attribute_nonnull
10475 : Look for GCC-style attribute noreturn
10476 case "$d_attribute_noreturn" in
10479 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10480 $cat >attrib.c <<'EOCP'
10482 void fall_over_dead( void ) __attribute__((noreturn));
10484 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10485 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10486 echo "Your C compiler doesn't support __attribute__((noreturn))."
10489 echo "Your C compiler supports __attribute__((noreturn))."
10493 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10497 *) val="$d_attribute_noreturn" ;;
10499 set d_attribute_noreturn
10503 : Look for GCC-style attribute pure
10504 case "$d_attribute_pure" in
10507 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10508 $cat >attrib.c <<'EOCP'
10510 int square( int n ) __attribute__((pure));
10512 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10513 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10514 echo "Your C compiler doesn't support __attribute__((pure))."
10517 echo "Your C compiler supports __attribute__((pure))."
10521 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10525 *) val="$d_attribute_pure" ;;
10527 set d_attribute_pure
10531 : Look for GCC-style attribute unused
10532 case "$d_attribute_unused" in
10535 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10536 $cat >attrib.c <<'EOCP'
10538 int do_something( int dummy __attribute__((unused)), int n );
10540 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10541 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10542 echo "Your C compiler doesn't support __attribute__((unused))."
10545 echo "Your C compiler supports __attribute__((unused))."
10549 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10553 *) val="$d_attribute_unused" ;;
10555 set d_attribute_unused
10559 : Look for GCC-style attribute deprecated
10560 case "$d_attribute_deprecated" in
10563 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10564 $cat >attrib.c <<'EOCP'
10566 int I_am_deprecated(void) __attribute__((deprecated));
10568 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10569 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10570 echo "Your C compiler doesn't support __attribute__((deprecated))."
10573 echo "Your C compiler supports __attribute__((deprecated))."
10577 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10581 *) val="$d_attribute_deprecated" ;;
10583 set d_attribute_deprecated
10587 : Look for GCC-style attribute warn_unused_result
10588 case "$d_attribute_warn_unused_result" in
10591 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10592 $cat >attrib.c <<'EOCP'
10594 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10596 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10597 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10598 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10601 echo "Your C compiler supports __attribute__((warn_unused_result))."
10605 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10609 *) val="$d_attribute_warn_unused_result" ;;
10611 set d_attribute_warn_unused_result
10615 : see if bcmp exists
10619 : see if bcopy exists
10623 : see if getpgrp exists
10624 set getpgrp d_getpgrp
10627 case "$d_getpgrp" in
10630 echo "Checking to see which flavor of getpgrp is in use..."
10632 #$i_unistd I_UNISTD
10633 #include <sys/types.h>
10635 # include <unistd.h>
10637 #$i_stdlib I_STDLIB
10639 #include <stdlib.h>
10643 if (getuid() == 0) {
10644 printf("(I see you are running Configure as super-user...)\n");
10647 #ifdef TRY_BSD_PGRP
10648 if (getpgrp(1) == 0)
10657 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10658 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10660 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10661 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10664 echo "I can't seem to compile and run the test program."
10666 xxx="a USG one, i.e. you use getpgrp()."
10668 # SVR4 systems can appear rather BSD-ish.
10669 case "$i_unistd" in
10671 xxx="a BSD one, i.e. you use getpgrp(pid)."
10675 xxx="probably a USG one, i.e. you use getpgrp()."
10680 echo "Assuming your getpgrp is $xxx" >&4
10689 : see if setpgrp exists
10690 set setpgrp d_setpgrp
10693 case "$d_setpgrp" in
10696 echo "Checking to see which flavor of setpgrp is in use..."
10698 #$i_unistd I_UNISTD
10699 #include <sys/types.h>
10701 # include <unistd.h>
10703 #$i_stdlib I_STDLIB
10705 #include <stdlib.h>
10709 if (getuid() == 0) {
10710 printf("(I see you are running Configure as super-user...)\n");
10713 #ifdef TRY_BSD_PGRP
10714 if (-1 == setpgrp(1, 1))
10717 if (setpgrp() != -1)
10723 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10724 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10726 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10727 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10730 echo "(I can't seem to compile and run the test program.)"
10732 xxx="a USG one, i.e. you use setpgrp()."
10734 # SVR4 systems can appear rather BSD-ish.
10735 case "$i_unistd" in
10737 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10741 xxx="probably a USG one, i.e. you use setpgrp()."
10746 echo "Assuming your setpgrp is $xxx" >&4
10755 : Look for GCC-style __builtin_choose_expr
10756 case "$d_builtin_choose_expr" in
10759 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10760 $cat >try.c <<'EOCP'
10761 #include <assert.h>
10762 #include <stdlib.h>
10765 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10768 assert( SYRINX(1) == 2112 );
10769 assert( SYRINX(1) != 5150 );
10770 assert( SYRINX(0) == 5150 );
10771 assert( SYRINX(0) != 2112 );
10772 puts( "All good!" );
10778 if eval $compile && $run ./try; then
10779 echo "Your C compiler supports __builtin_choose_expr."
10782 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10786 *) val="$d_builtin_choose_expr" ;;
10789 set d_builtin_choose_expr
10793 : Look for GCC-style __builtin_expect
10794 case "$d_builtin_expect" in
10797 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10798 $cat >try.c <<'EOCP'
10801 if ( __builtin_expect(n, 0) ) n = 1;
10802 /* Remember shell exit code truth is 0, C truth is non-zero */
10807 if eval $compile && $run ./try; then
10808 echo "Your C compiler supports __builtin_expect."
10811 echo "Your C compiler doesn't seem to understand __builtin_expect."
10815 *) val="$d_builtin_expect" ;;
10818 set d_builtin_expect
10822 : see if bzero exists
10826 : see if stdarg is available
10828 if $test `./findhdr stdarg.h`; then
10829 echo "<stdarg.h> found." >&4
10832 echo "<stdarg.h> NOT found." >&4
10836 : see if varags is available
10838 if $test `./findhdr varargs.h`; then
10839 echo "<varargs.h> found." >&4
10841 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10844 : set up the varargs testing programs
10845 $cat > varargs.c <<EOP
10847 #include <stdarg.h>
10850 #include <varargs.h>
10854 int f(char *p, ...)
10868 p = va_arg(ap, char *);
10874 $cat > varargs <<EOP
10876 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10885 : now check which varargs header should be included
10890 if `./varargs I_STDARG`; then
10892 elif `./varargs I_VARARGS`; then
10897 if `./varargs I_VARARGS`; then
10904 echo "I could not find the definition for va_dcl... You have problems..." >&4
10905 val="$undef"; set i_stdarg; eval $setvar
10906 val="$undef"; set i_varargs; eval $setvar
10911 case "$i_varhdr" in
10913 val="$define"; set i_stdarg; eval $setvar
10914 val="$undef"; set i_varargs; eval $setvar
10917 val="$undef"; set i_stdarg; eval $setvar
10918 val="$define"; set i_varargs; eval $setvar
10921 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10925 : see if the Compiler supports C99 variadic macros
10926 case "$i_stdarg$i_stdlib" in
10928 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10931 #include <stdarg.h>
10933 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10937 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10943 if eval $compile && $run ./try 2>&1 >/dev/null; then
10944 case "`$run ./try`" in
10946 echo "You have C99 variadic macros." >&4
10947 d_c99_variadic_macros="$define"
10950 echo "You don't have functional C99 variadic macros." >&4
10951 d_c99_variadic_macros="$undef"
10955 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10956 d_c99_variadic_macros="$undef"
10961 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10962 d_c99_variadic_macros="$undef"
10966 : see if signal is declared as pointer to function returning int or void
10968 xxx=`./findhdr signal.h`
10969 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10970 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10971 echo "You have int (*signal())() instead of void." >&4
10973 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10974 echo "You have void (*signal())()." >&4
10976 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10977 echo "You have int (*signal())() instead of void." >&4
10979 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10980 echo "You have void (*signal())()." >&4
10983 case "$d_voidsig" in
10985 echo "I can't determine whether signal handler returns void or int..." >&4
10987 rp="What type does your signal handler return?"
10990 v*) val="$define";;
10994 echo "As you already told me, signal handler returns void." >&4
10997 *) echo "As you already told me, signal handler returns int." >&4
11004 case "$d_voidsig" in
11005 "$define") signal_t="void";;
11006 *) signal_t="int";;
11010 : check for ability to cast large floats to 32-bit ints.
11012 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11013 if $test "$intsize" -ge 4; then
11020 #$i_stdlib I_STDLIB
11022 #include <stdlib.h>
11024 #include <sys/types.h>
11025 #include <signal.h>
11026 $signal_t blech(int s) { exit(3); }
11033 signal(SIGFPE, blech);
11035 /* Don't let compiler optimize the test away. Store the number
11036 in a writable string for gcc to pass to sscanf under HP-UX.
11038 sprintf(str, "2147483647");
11039 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11043 /* x86 processors will probably give 0x8000 0000, which is a
11044 sign change. We don't want that. We want to mimic SPARC
11045 behavior here, which is to preserve the sign and give
11048 if (i32 != ($xxx) f)
11054 if eval $compile_ok; then
11058 echo "(I can't seem to compile the test program--assuming it can't)"
11063 echo "Yup, it can."
11066 echo "Nope, it can't."
11073 : check for ability to cast negative floats to unsigned
11075 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11078 #$i_stdlib I_STDLIB
11080 #include <stdlib.h>
11082 #include <sys/types.h>
11083 #include <signal.h>
11084 $signal_t blech(int s) { exit(7); }
11085 $signal_t blech_in_list(int s) { exit(4); }
11086 unsigned long dummy_long(unsigned long p) { return p; }
11087 unsigned int dummy_int(unsigned int p) { return p; }
11088 unsigned short dummy_short(unsigned short p) { return p; }
11092 unsigned long along;
11094 unsigned short ashort;
11098 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11099 a direct f = -123. assignment. gcc-2.8.0 reportedly
11100 optimized the whole file away
11102 /* Store the number in a writable string for gcc to pass to
11103 sscanf under HP-UX.
11105 sprintf(str, "-123");
11106 sscanf(str, "%lf", &f); /* f = -123.; */
11108 signal(SIGFPE, blech);
11109 along = (unsigned long)f;
11110 aint = (unsigned int)f;
11111 ashort = (unsigned short)f;
11112 if (along != (unsigned long)-123)
11114 if (aint != (unsigned int)-123)
11116 if (ashort != (unsigned short)-123)
11118 sprintf(str, "1073741824.");
11119 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11122 along = (unsigned long)f;
11123 if (along != 0x80000000)
11127 along = (unsigned long)f;
11128 if (along != 0x7fffffff)
11132 along = (unsigned long)f;
11133 if (along != 0x80000001)
11137 signal(SIGFPE, blech_in_list);
11138 sprintf(str, "123.");
11139 sscanf(str, "%lf", &f); /* f = 123.; */
11140 along = dummy_long((unsigned long)f);
11141 aint = dummy_int((unsigned int)f);
11142 ashort = dummy_short((unsigned short)f);
11143 if (along != (unsigned long)123)
11145 if (aint != (unsigned int)123)
11147 if (ashort != (unsigned short)123)
11154 if eval $compile_ok; then
11158 echo "(I can't seem to compile the test program--assuming it can't)"
11161 case "$castflags" in
11163 echo "Yup, it can."
11166 echo "Nope, it can't."
11173 : see if vprintf exists
11175 if set vprintf val -f d_vprintf; eval $csym; $val; then
11176 echo 'vprintf() found.' >&4
11179 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11180 #$i_varargs I_VARARGS
11182 #$i_stdlib I_STDLIB
11183 #$i_unistd I_UNISTD
11186 # include <stdarg.h>
11187 #else /* I_VARARGS */
11188 # include <varargs.h>
11192 # include <unistd.h>
11196 # include <stdlib.h>
11199 #include <stdio.h> /* vsprintf prototype */
11202 void xxx(int n, ...)
11207 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11209 int main() { xxx(1, "foo"); }
11211 #else /* I_VARARGS */
11219 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11221 int main() { xxx("foo"); }
11227 if eval $compile_ok; then
11228 if $run ./try; then
11229 echo "Your vsprintf() returns (int)." >&4
11232 echo "Your vsprintf() returns (char*)." >&4
11236 echo 'I am unable to compile the vsprintf() test program.' >&4
11237 # We shouldn't get here. If we do, assume the standard signature,
11238 # not the old BSD one.
11239 echo 'Guessing that vsprintf() returns (int).' >&4
11243 echo 'vprintf() NOT found.' >&4
11254 : see if chown exists
11258 : see if chroot exists
11259 set chroot d_chroot
11262 : see if chsize exists
11263 set chsize d_chsize
11266 : see if class exists
11270 : see if clearenv exists
11271 set clearenv d_clearenv
11274 : Define hasstruct macro for Configure internal use
11275 hasstruct='varname=$1; struct=$2; shift; shift;
11276 while $test $# -ge 2; do
11278 $define) echo "#include <$2>";;
11282 echo "int main () { struct $struct foo; }" >> try.c;
11284 if eval $compile; then
11293 : see whether socket exists
11297 $echo $n "Hmm... $c" >&4
11298 if set socket val -f d_socket; eval $csym; $val; then
11299 echo "Looks like you have Berkeley networking support." >&4
11301 if set setsockopt val -f; eval $csym; $val; then
11304 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11305 d_oldsock="$define"
11308 if $contains socklib libc.list >/dev/null 2>&1; then
11309 echo "Looks like you have Berkeley networking support." >&4
11311 : we will have to assume that it supports the 4.2 BSD interface
11314 echo "You don't have Berkeley networking in libc$_a..." >&4
11315 if test "X$d_socket" = "X$define"; then
11316 echo "...but you seem to believe that you have sockets." >&4
11318 for net in net socket
11320 if test -f /usr/lib/lib$net$_a; then
11321 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11322 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11323 if $contains socket libc.list >/dev/null 2>&1; then
11328 echo "...but the Wollongong group seems to have hacked it in." >&4
11329 sockethdr="-I/usr/netinclude"
11332 echo "Found Berkeley sockets interface in lib$net." >&4
11333 if $contains setsockopt libc.list >/dev/null 2>&1; then
11336 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11337 d_oldsock="$define"
11343 if test "X$d_socket" != "X$define"; then
11344 echo "or anywhere else I see." >&4
11352 : see if socketpair exists
11353 set socketpair d_sockpair
11358 echo "Checking the availability of certain socket constants..." >&4
11359 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11360 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11362 #include <sys/types.h>
11363 #include <sys/socket.h>
11369 set try; if eval $compile; then
11372 set d_${enum}; eval $setvar
11376 : see if this is a sys/uio.h system
11377 set sys/uio.h i_sysuio
11380 : Check for cmsghdr support
11382 echo "Checking to see if your system supports struct cmsghdr..." >&4
11383 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11385 case "$d_cmsghdr_s" in
11386 "$define") echo "Yes, it does." ;;
11387 *) echo "No, it doesn't." ;;
11391 : check for const keyword
11393 echo 'Checking to see if your C compiler knows about "const"...' >&4
11394 $cat >const.c <<'EOCP'
11395 typedef struct spug { int drokk; } spug;
11399 const spug y = { 0 };
11402 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11404 echo "Yup, it does."
11407 echo "Nope, it doesn't."
11412 : see if copysignl exists
11413 set copysignl d_copysignl
11416 : see if crypt exists
11421 $define) cryptlib='' ;;
11422 *) if set crypt val -f d_crypt; eval $csym; $val; then
11423 echo 'crypt() found.' >&4
11427 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11428 if $test -z "$cryptlib"; then
11429 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11433 if $test -z "$cryptlib"; then
11434 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11438 if $test -z "$cryptlib"; then
11439 cryptlib=`./loc libcrypt$_a "" $libpth`
11443 if $test -z "$cryptlib"; then
11444 echo 'crypt() NOT found.' >&4
11455 : see if this is a crypt.h system
11456 set crypt.h i_crypt
11459 : see if crypt_r exists
11460 set crypt_r d_crypt_r
11462 case "$d_crypt_r" in
11464 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11465 case "$d_crypt_r_proto:$usethreads" in
11466 ":define") d_crypt_r_proto=define
11467 set d_crypt_r_proto crypt_r $hdrs
11471 case "$d_crypt_r_proto" in
11473 case "$crypt_r_proto" in
11474 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11475 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11477 case "$crypt_r_proto" in
11478 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11479 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11481 case "$crypt_r_proto" in
11482 ''|0) d_crypt_r=undef
11484 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11485 * ) case "$crypt_r_proto" in
11486 REENTRANT_PROTO*) ;;
11487 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11489 echo "Prototype: $try" ;;
11492 *) case "$usethreads" in
11493 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11504 : get csh whereabouts
11506 'csh') val="$undef" ;;
11507 *) val="$define" ;;
11511 : Respect a hint or command line value for full_csh.
11512 case "$full_csh" in
11513 '') full_csh=$csh ;;
11516 : see if ctermid exists
11517 set ctermid d_ctermid
11520 : see if ctermid_r exists
11521 set ctermid_r d_ctermid_r
11523 case "$d_ctermid_r" in
11525 hdrs="$i_systypes sys/types.h define stdio.h "
11526 case "$d_ctermid_r_proto:$usethreads" in
11527 ":define") d_ctermid_r_proto=define
11528 set d_ctermid_r_proto ctermid_r $hdrs
11532 case "$d_ctermid_r_proto" in
11534 case "$ctermid_r_proto" in
11535 ''|0) try='char* ctermid_r(char*);'
11536 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11538 case "$ctermid_r_proto" in
11539 ''|0) d_ctermid_r=undef
11541 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11542 * ) case "$ctermid_r_proto" in
11543 REENTRANT_PROTO*) ;;
11544 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11546 echo "Prototype: $try" ;;
11549 *) case "$usethreads" in
11550 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11557 *) ctermid_r_proto=0
11561 : see if ctime_r exists
11562 set ctime_r d_ctime_r
11564 case "$d_ctime_r" in
11566 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11567 case "$d_ctime_r_proto:$usethreads" in
11568 ":define") d_ctime_r_proto=define
11569 set d_ctime_r_proto ctime_r $hdrs
11573 case "$d_ctime_r_proto" in
11575 case "$ctime_r_proto" in
11576 ''|0) try='char* ctime_r(const time_t*, char*);'
11577 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11579 case "$ctime_r_proto" in
11580 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11581 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11583 case "$ctime_r_proto" in
11584 ''|0) try='int ctime_r(const time_t*, char*);'
11585 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11587 case "$ctime_r_proto" in
11588 ''|0) try='int ctime_r(const time_t*, char*, int);'
11589 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11591 case "$ctime_r_proto" in
11592 ''|0) d_ctime_r=undef
11594 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11595 * ) case "$ctime_r_proto" in
11596 REENTRANT_PROTO*) ;;
11597 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11599 echo "Prototype: $try" ;;
11602 *) case "$usethreads" in
11603 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11614 : see if cuserid exists
11615 set cuserid d_cuserid
11618 : see if this is a limits.h system
11619 set limits.h i_limits
11622 : see if this is a float.h system
11623 set float.h i_float
11626 : See if number of significant digits in a double precision number is known
11628 $cat >dbl_dig.c <<EOM
11629 #$i_limits I_LIMITS
11632 #include <limits.h>
11638 printf("Contains DBL_DIG");
11641 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11642 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11643 echo "DBL_DIG found." >&4
11646 echo "DBL_DIG NOT found." >&4
11653 : see if dbm.h is available
11654 : see if dbmclose exists
11655 set dbmclose d_dbmclose
11658 case "$d_dbmclose" in
11668 *) set rpcsvc/dbm.h i_rpcsvcdbm
11673 *) echo "We won't be including <dbm.h>"
11683 : see if prototype for dbminit is available
11685 set d_dbminitproto dbminit $i_dbm dbm.h
11688 : see if difftime exists
11689 set difftime d_difftime
11692 : see if this is a dirent system
11694 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11696 echo "<dirent.h> found." >&4
11699 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11700 echo "<sys/dir.h> found." >&4
11703 xinc=`./findhdr sys/ndir.h`
11705 echo "<dirent.h> NOT found." >&4
11710 : Look for type of directory structure.
11712 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11714 case "$direntrytype" in
11716 case "$i_dirent" in
11717 $define) guess1='struct dirent' ;;
11718 *) guess1='struct direct' ;;
11721 *) guess1="$direntrytype"
11726 'struct dirent') guess2='struct direct' ;;
11727 *) guess2='struct dirent' ;;
11730 if $contains "$guess1" try.c >/dev/null 2>&1; then
11731 direntrytype="$guess1"
11732 echo "Your directory entries are $direntrytype." >&4
11733 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11734 direntrytype="$guess2"
11735 echo "Your directory entries seem to be $direntrytype." >&4
11737 echo "I don't recognize your system's directory entries." >&4
11738 rp="What type is used for directory entries on this system?"
11741 direntrytype="$ans"
11745 : see if the directory entry stores field length
11747 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11748 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11749 echo "Good, your directory entry keeps length information in d_namlen." >&4
11752 echo "Your directory entry does not know about the d_namlen field." >&4
11759 : Look for DIR.dd_fd
11760 case "$i_dirent" in
11762 echo "Checking to see if DIR has a dd_fd member variable" >&4
11764 #$i_stdlib I_STDLIB
11766 #include <stdlib.h>
11768 #include <dirent.h>
11778 if eval $compile; then
11779 echo "Yes, it does."
11782 echo "No, it does not."
11787 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11795 : see if this is an sysdir system
11796 set sys/dir.h i_sysdir
11799 : see if this is an sysndir system
11800 set sys/ndir.h i_sysndir
11805 $cat >dirfd.c <<EOM
11807 #$i_stdlib I_STDLIB
11809 #include <stdlib.h>
11811 #$i_dirent I_DIRENT /**/
11812 #$i_sysdir I_SYS_DIR /**/
11813 #$i_sysndir I_SYS_NDIR /**/
11814 #$i_systypes I_SYS_TYPES /**/
11815 #if defined(I_SYS_TYPES)
11816 #include <sys/types.h>
11818 #if defined(I_DIRENT)
11819 #include <dirent.h>
11820 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11821 #include <sys/dir.h>
11825 #include <sys/ndir.h>
11829 #include <ndir.h> /* may be wrong in the future */
11831 #include <sys/dir.h>
11837 DIR *dirp = opendir(".");
11838 if (dirfd(dirp) >= 0)
11846 if eval $compile; then
11850 $define) echo "dirfd() found." >&4 ;;
11851 *) echo "dirfd() NOT found." >&4 ;;
11857 : see if dlerror exists
11860 set dlerror d_dlerror
11864 : see if dlfcn is available
11865 set dlfcn.h i_dlfcn
11868 : Check what extension to use for shared libs
11873 On a few systems, the dynamically loaded modules that perl generates and uses
11874 will need a different extension than shared libs. The default will probably
11880 *) dflt="$dlext" ;;
11882 rp='What is the extension of dynamically loaded modules'
11891 : Check if dlsym need a leading underscore
11897 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11898 $cat >dyna.c <<'EOM'
11905 #$i_stdlib I_STDLIB
11907 #include <stdlib.h>
11911 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11913 #include <sys/types.h>
11918 extern int fred() ;
11927 int mode = RTLD_LAZY ;
11929 handle = dlopen("./dyna.$dlext", mode) ;
11930 if (handle == NULL) {
11935 symbol = dlsym(handle, "fred") ;
11936 if (symbol == NULL) {
11937 /* try putting a leading underscore */
11938 symbol = dlsym(handle, "_fred") ;
11939 if (symbol == NULL) {
11952 : Call the object file tmp-dyna.o in case dlext=o.
11953 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11954 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11955 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11956 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11959 1) echo "Test program failed using dlopen." >&4
11960 echo "Perhaps you should not use dynamic loading." >&4;;
11961 2) echo "Test program failed using dlsym." >&4
11962 echo "Perhaps you should not use dynamic loading." >&4;;
11963 3) echo "dlsym needs a leading underscore" >&4
11965 4) echo "dlsym doesn't need a leading underscore." >&4;;
11968 echo "I can't compile and run the test program." >&4
11969 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11974 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11979 : see if drand48_r exists
11980 set drand48_r d_drand48_r
11982 case "$d_drand48_r" in
11984 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11985 case "$d_drand48_r_proto:$usethreads" in
11986 ":define") d_drand48_r_proto=define
11987 set d_drand48_r_proto drand48_r $hdrs
11991 case "$d_drand48_r_proto" in
11993 case "$drand48_r_proto" in
11994 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11995 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
11997 case "$drand48_r_proto" in
11998 ''|0) d_drand48_r=undef
12000 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
12001 * ) case "$drand48_r_proto" in
12002 REENTRANT_PROTO*) ;;
12003 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12005 echo "Prototype: $try" ;;
12008 *) case "$usethreads" in
12009 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12016 *) drand48_r_proto=0
12020 : see if prototype for drand48 is available
12022 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12025 : see if dup2 exists
12029 : see if eaccess exists
12030 set eaccess d_eaccess
12033 : see if endgrent exists
12034 set endgrent d_endgrent
12037 : see if this is an grp system
12043 xxx=`./findhdr grp.h`
12044 $cppstdin $cppflags $cppminus < $xxx >$$.h
12046 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12058 set d_grpasswd; eval $setvar
12062 : see if endgrent_r exists
12063 set endgrent_r d_endgrent_r
12065 case "$d_endgrent_r" in
12067 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12068 case "$d_endgrent_r_proto:$usethreads" in
12069 ":define") d_endgrent_r_proto=define
12070 set d_endgrent_r_proto endgrent_r $hdrs
12074 case "$d_endgrent_r_proto" in
12076 case "$endgrent_r_proto" in
12077 ''|0) try='int endgrent_r(FILE**);'
12078 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12080 case "$endgrent_r_proto" in
12081 ''|0) try='void endgrent_r(FILE**);'
12082 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12084 case "$endgrent_r_proto" in
12085 ''|0) d_endgrent_r=undef
12087 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12088 * ) case "$endgrent_r_proto" in
12089 REENTRANT_PROTO*) ;;
12090 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12092 echo "Prototype: $try" ;;
12095 *) case "$usethreads" in
12096 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12103 *) endgrent_r_proto=0
12107 : see if endhostent exists
12108 set endhostent d_endhent
12111 : see if this is a netdb.h system
12112 set netdb.h i_netdb
12115 : see if endhostent_r exists
12116 set endhostent_r d_endhostent_r
12118 case "$d_endhostent_r" in
12120 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12121 case "$d_endhostent_r_proto:$usethreads" in
12122 ":define") d_endhostent_r_proto=define
12123 set d_endhostent_r_proto endhostent_r $hdrs
12127 case "$d_endhostent_r_proto" in
12129 case "$endhostent_r_proto" in
12130 ''|0) try='int endhostent_r(struct hostent_data*);'
12131 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12133 case "$endhostent_r_proto" in
12134 ''|0) try='void endhostent_r(struct hostent_data*);'
12135 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12137 case "$endhostent_r_proto" in
12138 ''|0) d_endhostent_r=undef
12139 endhostent_r_proto=0
12140 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12141 * ) case "$endhostent_r_proto" in
12142 REENTRANT_PROTO*) ;;
12143 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12145 echo "Prototype: $try" ;;
12148 *) case "$usethreads" in
12149 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12151 d_endhostent_r=undef
12152 endhostent_r_proto=0
12156 *) endhostent_r_proto=0
12160 : see if endnetent exists
12161 set endnetent d_endnent
12164 : see if endnetent_r exists
12165 set endnetent_r d_endnetent_r
12167 case "$d_endnetent_r" in
12169 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12170 case "$d_endnetent_r_proto:$usethreads" in
12171 ":define") d_endnetent_r_proto=define
12172 set d_endnetent_r_proto endnetent_r $hdrs
12176 case "$d_endnetent_r_proto" in
12178 case "$endnetent_r_proto" in
12179 ''|0) try='int endnetent_r(struct netent_data*);'
12180 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12182 case "$endnetent_r_proto" in
12183 ''|0) try='void endnetent_r(struct netent_data*);'
12184 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12186 case "$endnetent_r_proto" in
12187 ''|0) d_endnetent_r=undef
12188 endnetent_r_proto=0
12189 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12190 * ) case "$endnetent_r_proto" in
12191 REENTRANT_PROTO*) ;;
12192 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12194 echo "Prototype: $try" ;;
12197 *) case "$usethreads" in
12198 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12200 d_endnetent_r=undef
12201 endnetent_r_proto=0
12205 *) endnetent_r_proto=0
12209 : see if endprotoent exists
12210 set endprotoent d_endpent
12213 : see if endprotoent_r exists
12214 set endprotoent_r d_endprotoent_r
12216 case "$d_endprotoent_r" in
12218 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12219 case "$d_endprotoent_r_proto:$usethreads" in
12220 ":define") d_endprotoent_r_proto=define
12221 set d_endprotoent_r_proto endprotoent_r $hdrs
12225 case "$d_endprotoent_r_proto" in
12227 case "$endprotoent_r_proto" in
12228 ''|0) try='int endprotoent_r(struct protoent_data*);'
12229 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12231 case "$endprotoent_r_proto" in
12232 ''|0) try='void endprotoent_r(struct protoent_data*);'
12233 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12235 case "$endprotoent_r_proto" in
12236 ''|0) d_endprotoent_r=undef
12237 endprotoent_r_proto=0
12238 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12239 * ) case "$endprotoent_r_proto" in
12240 REENTRANT_PROTO*) ;;
12241 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12243 echo "Prototype: $try" ;;
12246 *) case "$usethreads" in
12247 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12249 d_endprotoent_r=undef
12250 endprotoent_r_proto=0
12254 *) endprotoent_r_proto=0
12258 : see if endpwent exists
12259 set endpwent d_endpwent
12262 : see if this is a pwd.h system
12268 xxx=`./findhdr pwd.h`
12269 $cppstdin $cppflags $cppminus < $xxx >$$.h
12271 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12279 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12287 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12295 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12303 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12311 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12319 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12327 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12339 set d_pwquota; eval $setvar
12340 set d_pwage; eval $setvar
12341 set d_pwchange; eval $setvar
12342 set d_pwclass; eval $setvar
12343 set d_pwexpire; eval $setvar
12344 set d_pwcomment; eval $setvar
12345 set d_pwgecos; eval $setvar
12346 set d_pwpasswd; eval $setvar
12350 : see if endpwent_r exists
12351 set endpwent_r d_endpwent_r
12353 case "$d_endpwent_r" in
12355 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12356 case "$d_endpwent_r_proto:$usethreads" in
12357 ":define") d_endpwent_r_proto=define
12358 set d_endpwent_r_proto endpwent_r $hdrs
12362 case "$d_endpwent_r_proto" in
12364 case "$endpwent_r_proto" in
12365 ''|0) try='int endpwent_r(FILE**);'
12366 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12368 case "$endpwent_r_proto" in
12369 ''|0) try='void endpwent_r(FILE**);'
12370 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12372 case "$endpwent_r_proto" in
12373 ''|0) d_endpwent_r=undef
12375 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12376 * ) case "$endpwent_r_proto" in
12377 REENTRANT_PROTO*) ;;
12378 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12380 echo "Prototype: $try" ;;
12383 *) case "$usethreads" in
12384 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12391 *) endpwent_r_proto=0
12395 : see if endservent exists
12396 set endservent d_endsent
12399 : see if endservent_r exists
12400 set endservent_r d_endservent_r
12402 case "$d_endservent_r" in
12404 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12405 case "$d_endservent_r_proto:$usethreads" in
12406 ":define") d_endservent_r_proto=define
12407 set d_endservent_r_proto endservent_r $hdrs
12411 case "$d_endservent_r_proto" in
12413 case "$endservent_r_proto" in
12414 ''|0) try='int endservent_r(struct servent_data*);'
12415 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12417 case "$endservent_r_proto" in
12418 ''|0) try='void endservent_r(struct servent_data*);'
12419 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12421 case "$endservent_r_proto" in
12422 ''|0) d_endservent_r=undef
12423 endservent_r_proto=0
12424 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12425 * ) case "$endservent_r_proto" in
12426 REENTRANT_PROTO*) ;;
12427 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12429 echo "Prototype: $try" ;;
12432 *) case "$usethreads" in
12433 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12435 d_endservent_r=undef
12436 endservent_r_proto=0
12440 *) endservent_r_proto=0
12444 : Locate the flags for 'open()'
12447 #include <sys/types.h>
12452 #include <sys/file.h>
12454 #$i_stdlib I_STDLIB
12456 #include <stdlib.h>
12467 : check sys/file.h first to get FREAD on Sun
12468 if $test `./findhdr sys/file.h` && \
12469 set try -DI_SYS_FILE && eval $compile; then
12471 echo "<sys/file.h> defines the O_* constants..." >&4
12472 if $run ./try; then
12473 echo "and you have the 3 argument form of open()." >&4
12476 echo "but not the 3 argument form of open(). Oh, well." >&4
12479 elif $test `./findhdr fcntl.h` && \
12480 set try -DI_FCNTL && eval $compile; then
12482 echo "<fcntl.h> defines the O_* constants..." >&4
12483 if $run ./try; then
12484 echo "and you have the 3 argument form of open()." >&4
12487 echo "but not the 3 argument form of open(). Oh, well." >&4
12492 echo "I can't find the O_* constant definitions! You got problems." >&4
12498 : see if this is a sys/file.h system
12503 : do we need to include sys/file.h ?
12507 if $h_sysfile; then
12509 echo "We'll be including <sys/file.h>." >&4
12512 echo "We won't be including <sys/file.h>." >&4
12522 : see if fcntl.h is there
12527 : see if we can include fcntl.h
12533 echo "We'll be including <fcntl.h>." >&4
12536 if $h_sysfile; then
12537 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12539 echo "We won't be including <fcntl.h>." >&4
12551 : see if fork exists
12555 : see if pipe exists
12559 : check for non-blocking I/O stuff
12560 case "$h_sysfile" in
12561 true) echo "#include <sys/file.h>" > head.c;;
12564 true) echo "#include <fcntl.h>" > head.c;;
12565 *) echo "#include <sys/fcntl.h>" > head.c;;
12570 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12571 case "$o_nonblock" in
12573 $cat head.c > try.c
12574 $cat >>try.c <<EOCP
12576 #$i_stdlib I_STDLIB
12578 #include <stdlib.h>
12586 printf("O_NONBLOCK\n");
12590 printf("O_NDELAY\n");
12594 printf("FNDELAY\n");
12601 if eval $compile_ok; then
12602 o_nonblock=`$run ./try`
12603 case "$o_nonblock" in
12604 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12605 *) echo "Seems like we can use $o_nonblock.";;
12608 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12611 *) echo "Using $hint value $o_nonblock.";;
12616 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12619 case "$d_fork:$d_pipe" in
12621 $cat head.c > try.c
12622 $cat >>try.c <<EOCP
12624 #include <sys/types.h>
12625 #include <signal.h>
12627 #$i_stdlib I_STDLIB
12629 #include <stdlib.h>
12635 #define MY_O_NONBLOCK $o_nonblock
12636 #ifndef errno /* XXX need better Configure test */
12639 #$i_unistd I_UNISTD
12641 #include <unistd.h>
12643 #$i_string I_STRING
12645 #include <string.h>
12647 #include <strings.h>
12649 $signal_t blech(int x) { exit(3); }
12651 $cat >> try.c <<'EOCP'
12659 pipe(pd); /* Down: child -> parent */
12660 pipe(pu); /* Up: parent -> child */
12663 close(pd[1]); /* Parent reads from pd[0] */
12664 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12666 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12671 signal(SIGALRM, blech);
12673 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12675 sprintf(string, "%d\n", ret);
12676 write(2, string, strlen(string));
12679 if (errno == EAGAIN) {
12680 printf("EAGAIN\n");
12685 if (errno == EWOULDBLOCK)
12686 printf("EWOULDBLOCK\n");
12689 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12690 sleep(2); /* Give it time to close our pipe */
12692 ret = read(pd[0], buf, 1); /* Should read EOF */
12694 sprintf(string, "%d\n", ret);
12695 write(4, string, strlen(string));
12699 close(pd[0]); /* We write to pd[1] */
12700 close(pu[1]); /* We read from pu[0] */
12701 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12702 close(pd[1]); /* Pipe pd is now fully closed! */
12703 exit(0); /* Bye bye, thank you for playing! */
12707 if eval $compile_ok; then
12708 echo "$startsh" >mtry
12709 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12711 ./mtry >/dev/null 2>&1
12713 0) eagain=`$cat try.out`;;
12714 1) echo "Could not perform non-blocking setting!";;
12715 2) echo "I did a successful read() for something that was not there!";;
12716 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12717 4) echo "Could not find F_SETFL!";;
12718 *) echo "Something terribly wrong happened during testing.";;
12720 rd_nodata=`$cat try.ret`
12721 echo "A read() system call with no data present returns $rd_nodata."
12722 case "$rd_nodata" in
12725 echo "(That's peculiar, fixing that to be -1.)"
12731 echo "Forcing errno EAGAIN on read() with no data available."
12735 echo "Your read() sets errno to $eagain when no data is available."
12738 status=`$cat try.err`
12740 0) echo "And it correctly returns 0 to signal EOF.";;
12741 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12742 *) echo "However, your read() returns '$status' on EOF??";;
12745 if test "$status" = "$rd_nodata"; then
12746 echo "WARNING: you can't distinguish between EOF and no data!"
12750 echo "I can't compile the test program--assuming errno EAGAIN will do."
12754 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12763 echo "Using $hint value $eagain."
12764 echo "Your read() returns $rd_nodata when no data is present."
12765 case "$d_eofnblk" in
12766 "$define") echo "And you can see EOF because read() returns 0.";;
12767 "$undef") echo "But you can't see EOF status from read() returned value.";;
12769 echo "(Assuming you can't see EOF status from read anyway.)"
12775 $rm_try head.c mtry
12777 : see if _ptr and _cnt from stdio act std
12780 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12781 echo "(Looks like you have stdio.h from BSD.)"
12782 case "$stdio_ptr" in
12783 '') stdio_ptr='((fp)->_p)'
12786 *) ptr_lval=$d_stdio_ptr_lval;;
12788 case "$stdio_cnt" in
12789 '') stdio_cnt='((fp)->_r)'
12792 *) cnt_lval=$d_stdio_cnt_lval;;
12794 case "$stdio_base" in
12795 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12797 case "$stdio_bufsiz" in
12798 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12800 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12801 echo "(Looks like you have stdio.h from Linux.)"
12802 case "$stdio_ptr" in
12803 '') stdio_ptr='((fp)->_IO_read_ptr)'
12806 *) ptr_lval=$d_stdio_ptr_lval;;
12808 case "$stdio_cnt" in
12809 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12812 *) cnt_lval=$d_stdio_cnt_lval;;
12814 case "$stdio_base" in
12815 '') stdio_base='((fp)->_IO_read_base)';;
12817 case "$stdio_bufsiz" in
12818 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12821 case "$stdio_ptr" in
12822 '') stdio_ptr='((fp)->_ptr)'
12825 *) ptr_lval=$d_stdio_ptr_lval;;
12827 case "$stdio_cnt" in
12828 '') stdio_cnt='((fp)->_cnt)'
12831 *) cnt_lval=$d_stdio_cnt_lval;;
12833 case "$stdio_base" in
12834 '') stdio_base='((fp)->_base)';;
12836 case "$stdio_bufsiz" in
12837 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12841 : test whether _ptr and _cnt really work
12842 echo "Checking how std your stdio is..." >&4
12845 #$i_stdlib I_STDLIB
12847 #include <stdlib.h>
12849 #define FILE_ptr(fp) $stdio_ptr
12850 #define FILE_cnt(fp) $stdio_cnt
12852 FILE *fp = fopen("try.c", "r");
12855 18 <= FILE_cnt(fp) &&
12856 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12864 if eval $compile && $to try.c; then
12865 if $run ./try; then
12866 echo "Your stdio acts pretty std."
12869 echo "Your stdio isn't very std."
12872 echo "Your stdio doesn't appear very std."
12876 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12877 # direct buffer manipulation no longer works. The Configure tests
12878 # should be changed to correctly detect this, but until then,
12879 # the following check should at least let perl compile and run.
12880 # (This quick fix should be updated before 5.8.1.)
12881 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12882 # A. Dougherty, June 3, 2002.
12883 case "$d_gnulibc" in
12885 case "$gnulibc_version" in
12889 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12898 : Can _ptr be used as an lvalue?
12899 case "$d_stdstdio$ptr_lval" in
12900 $define$define) val=$define ;;
12903 set d_stdio_ptr_lval
12906 : Can _cnt be used as an lvalue?
12907 case "$d_stdstdio$cnt_lval" in
12908 $define$define) val=$define ;;
12911 set d_stdio_cnt_lval
12915 : test whether setting _ptr sets _cnt as a side effect
12916 d_stdio_ptr_lval_sets_cnt="$undef"
12917 d_stdio_ptr_lval_nochange_cnt="$undef"
12918 case "$d_stdio_ptr_lval$d_stdstdio" in
12920 echo "Checking to see what happens if we set the stdio ptr..." >&4
12923 /* Can we scream? */
12924 /* Eat dust sed :-) */
12925 /* In the buffer space, no one can hear you scream. */
12926 #$i_stdlib I_STDLIB
12928 #include <stdlib.h>
12930 #define FILE_ptr(fp) $stdio_ptr
12931 #define FILE_cnt(fp) $stdio_cnt
12932 #include <sys/types.h>
12934 FILE *fp = fopen("try.c", "r");
12939 puts("Fail even to read");
12942 c = getc(fp); /* Read away the first # */
12944 puts("Fail even to read");
12948 18 <= FILE_cnt(fp) &&
12949 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12951 puts("Fail even to read");
12954 ptr = (char*) FILE_ptr(fp);
12955 cnt = (size_t)FILE_cnt(fp);
12957 FILE_ptr(fp) += 42;
12959 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12960 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12963 if (FILE_cnt(fp) <= 20) {
12964 printf ("Fail (<20 chars to test)");
12967 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12968 puts("Fail compare");
12971 if (cnt == FILE_cnt(fp)) {
12972 puts("Pass_unchanged");
12975 if (FILE_cnt(fp) == (cnt - 42)) {
12976 puts("Pass_changed");
12979 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12985 if eval $compile && $to try.c; then
12986 case `$run ./try` in
12988 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12989 d_stdio_ptr_lval_sets_cnt="$define" ;;
12991 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12992 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12994 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12996 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12999 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13005 : see if _base is also standard
13007 case "$d_stdstdio" in
13011 #$i_stdlib I_STDLIB
13013 #include <stdlib.h>
13015 #define FILE_base(fp) $stdio_base
13016 #define FILE_bufsiz(fp) $stdio_bufsiz
13018 FILE *fp = fopen("try.c", "r");
13021 19 <= FILE_bufsiz(fp) &&
13022 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13029 if eval $compile && $to try.c; then
13030 if $run ./try; then
13031 echo "And its _base field acts std."
13034 echo "But its _base field isn't std."
13037 echo "However, it seems to be lacking the _base field."
13045 : see if fast_stdio exists
13047 case "$d_stdstdio:$d_stdio_ptr_lval" in
13049 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13051 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13062 : see if fchdir exists
13063 set fchdir d_fchdir
13066 : see if fchmod exists
13067 set fchmod d_fchmod
13070 : see if fchown exists
13071 set fchown d_fchown
13074 : see if this is an fcntl system
13078 : See if fcntl-based locking works.
13081 #$i_stdlib I_STDLIB
13083 #include <stdlib.h>
13085 #include <unistd.h>
13087 #include <signal.h>
13088 $signal_t blech(int x) { exit(3); }
13090 #if defined(F_SETLK) && defined(F_SETLKW)
13091 struct flock flock;
13093 fd = open("try.c", O_RDONLY);
13094 flock.l_type = F_RDLCK;
13095 flock.l_whence = SEEK_SET;
13096 flock.l_start = flock.l_len = 0;
13097 signal(SIGALRM, blech);
13099 retval = fcntl(fd, F_SETLK, &flock);
13101 (retval < 0 ? exit(2) : exit(0));
13107 echo "Checking if fcntl-based file locking works... "
13111 if eval $compile_ok; then
13112 if $run ./try; then
13113 echo "Yes, it seems to work."
13116 echo "Nope, it didn't work."
13121 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13122 *** This is (almost) impossible.
13123 *** If your NFS lock daemons are not feeling well, something like
13124 *** this may happen, please investigate. Cannot continue, aborting.
13132 echo "I'm unable to compile the test program, so I'll assume not."
13137 echo "Nope, since you don't even have fcntl()."
13140 set d_fcntl_can_lock
13144 : check for fd_set items
13147 Checking to see how well your C compiler handles fd_set and friends ...
13150 #$i_stdlib I_STDLIB
13152 #include <stdlib.h>
13154 #$i_systime I_SYS_TIME
13155 #$i_sysselct I_SYS_SELECT
13156 #$d_socket HAS_SOCKET
13157 #include <sys/types.h>
13159 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13162 #include <sys/time.h>
13164 #ifdef I_SYS_SELECT
13165 #include <sys/select.h>
13174 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13182 if eval $compile; then
13183 d_fds_bits="$define"
13185 echo "Well, your system knows about the normal fd_set typedef..." >&4
13186 if $run ./try; then
13187 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13188 d_fd_macros="$define"
13191 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13193 d_fd_macros="$undef"
13197 Hmm, your compiler has some difficulty with fd_set. Checking further...
13200 if eval $compile; then
13201 d_fds_bits="$undef"
13203 echo "Well, your system has some sort of fd_set available..." >&4
13204 if $run ./try; then
13205 echo "and you have the normal fd_set macros." >&4
13206 d_fd_macros="$define"
13209 but not the normal fd_set macros! Gross! More work for me...
13211 d_fd_macros="$undef"
13214 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13216 d_fds_bits="$undef"
13217 d_fd_macros="$undef"
13222 : see if fgetpos exists
13223 set fgetpos d_fgetpos
13226 : see if finite exists
13227 set finite d_finite
13230 : see if finitel exists
13231 set finitel d_finitel
13234 : see if flock exists
13238 : see if prototype for flock is available
13240 set d_flockproto flock $i_sysfile sys/file.h
13243 : see if fp_class exists
13244 set fp_class d_fp_class
13247 : see if pathconf exists
13248 set pathconf d_pathconf
13251 : see if fpathconf exists
13252 set fpathconf d_fpathconf
13255 : see if fpclass exists
13256 set fpclass d_fpclass
13259 : see if fpclassify exists
13260 set fpclassify d_fpclassify
13263 : see if fpclassl exists
13264 set fpclassl d_fpclassl
13267 : check for fpos64_t
13269 echo "Checking to see if you have fpos64_t..." >&4
13272 int main() { fpos64_t x = 7; }
13275 if eval $compile; then
13277 echo "You have fpos64_t."
13280 echo "You do not have fpos64_t."
13281 case "$fpossize" in
13282 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13289 : see if frexpl exists
13290 set frexpl d_frexpl
13293 : see if this is a sys/param system
13294 set sys/param.h i_sysparam
13297 : see if this is a sys/mount.h system
13298 set sys/mount.h i_sysmount
13301 : Check for fs_data_s
13303 echo "Checking to see if your system supports struct fs_data..." >&4
13304 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13306 case "$d_fs_data_s" in
13307 "$define") echo "Yes, it does." ;;
13308 *) echo "No, it doesn't." ;;
13311 : see if fseeko exists
13312 set fseeko d_fseeko
13314 case "$longsize" in
13315 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13318 : see if fsetpos exists
13319 set fsetpos d_fsetpos
13322 : see if fstatfs exists
13323 set fstatfs d_fstatfs
13326 : see if statvfs exists
13327 set statvfs d_statvfs
13330 : see if fstatvfs exists
13331 set fstatvfs d_fstatvfs
13335 : see if fsync exists
13339 : see if ftello exists
13340 set ftello d_ftello
13342 case "$longsize" in
13343 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13346 : check for a working futimes
13349 echo "Checking if you have a working futimes()" >&4
13352 #include <sys/time.h>
13359 fd = open ("try.c", O_RDWR);
13360 if (-1 == fd) exit (1);
13361 rv = futimes (fd, NULL);
13362 exit (rv == -1 ? errno : 0);
13366 if eval $compile; then
13370 0) echo "Yes, you have" >&4
13371 d_futimes="$define"
13373 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13377 echo "No, it does not (probably harmless)" >&4
13381 : see if ndbm.h is available
13384 : Compatibility location for RedHat 7.1
13385 set gdbm/ndbm.h i_gdbmndbm
13387 : Compatibility location for Debian 4.0
13388 set gdbm-ndbm.h i_gdbm_ndbm
13392 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13393 : see if dbm_open exists
13394 set dbm_open d_dbm_open
13396 case "$d_dbm_open" in
13399 i_gdbmndbm="$undef"
13400 i_gdbm_ndbm="$undef"
13401 echo "We won't be including <ndbm.h>"
13411 ndbm_hdr_protochk='name=$1; hdr=$2;
13412 eval "ihdr=\$""i_$name";
13414 if $test "$ihdr" = "$define"; then
13415 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13416 case "$d_cplusplus" in
13417 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13418 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13421 $define) $echo "Your <$hdr> seems to have prototypes";;
13422 *) $echo "Your <$hdr> does not seem to have prototypes";;
13425 set "d_${name}_h_uses_prototypes";
13429 eval $ndbm_hdr_protochk
13430 set gdbmndbm gdbm/ndbm.h
13431 eval $ndbm_hdr_protochk
13432 set gdbm_ndbm gdbm-ndbm.h
13433 eval $ndbm_hdr_protochk
13435 : see if getaddrinfo exists
13436 set getaddrinfo d_getaddrinfo
13439 : see if getcwd exists
13440 set getcwd d_getcwd
13443 : see if getespwnam exists
13444 set getespwnam d_getespwnam
13447 : see if getfsstat exists
13448 set getfsstat d_getfsstat
13451 : see if getgrent exists
13452 set getgrent d_getgrent
13455 : see if getgrent_r exists
13456 set getgrent_r d_getgrent_r
13458 case "$d_getgrent_r" in
13460 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13461 case "$d_getgrent_r_proto:$usethreads" in
13462 ":define") d_getgrent_r_proto=define
13463 set d_getgrent_r_proto getgrent_r $hdrs
13467 case "$d_getgrent_r_proto" in
13469 case "$getgrent_r_proto" in
13470 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13471 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13473 case "$getgrent_r_proto" in
13474 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13475 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13477 case "$getgrent_r_proto" in
13478 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13479 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13481 case "$getgrent_r_proto" in
13482 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13483 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13485 case "$getgrent_r_proto" in
13486 ''|0) try='int getgrent_r(struct group*, char*, int);'
13487 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13489 case "$getgrent_r_proto" in
13490 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13491 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13493 case "$getgrent_r_proto" in
13494 ''|0) d_getgrent_r=undef
13496 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13497 * ) case "$getgrent_r_proto" in
13498 REENTRANT_PROTO*) ;;
13499 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13501 echo "Prototype: $try" ;;
13504 *) case "$usethreads" in
13505 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13512 *) getgrent_r_proto=0
13516 : see if getgrgid_r exists
13517 set getgrgid_r d_getgrgid_r
13519 case "$d_getgrgid_r" in
13521 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13522 case "$d_getgrgid_r_proto:$usethreads" in
13523 ":define") d_getgrgid_r_proto=define
13524 set d_getgrgid_r_proto getgrgid_r $hdrs
13528 case "$d_getgrgid_r_proto" in
13530 case "$getgrgid_r_proto" in
13531 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13532 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13534 case "$getgrgid_r_proto" in
13535 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13536 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13538 case "$getgrgid_r_proto" in
13539 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13540 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13542 case "$getgrgid_r_proto" in
13543 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13544 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13546 case "$getgrgid_r_proto" in
13547 ''|0) d_getgrgid_r=undef
13549 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13550 * ) case "$getgrgid_r_proto" in
13551 REENTRANT_PROTO*) ;;
13552 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13554 echo "Prototype: $try" ;;
13557 *) case "$usethreads" in
13558 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13565 *) getgrgid_r_proto=0
13569 : see if getgrnam_r exists
13570 set getgrnam_r d_getgrnam_r
13572 case "$d_getgrnam_r" in
13574 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13575 case "$d_getgrnam_r_proto:$usethreads" in
13576 ":define") d_getgrnam_r_proto=define
13577 set d_getgrnam_r_proto getgrnam_r $hdrs
13581 case "$d_getgrnam_r_proto" in
13583 case "$getgrnam_r_proto" in
13584 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13585 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13587 case "$getgrnam_r_proto" in
13588 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13589 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13591 case "$getgrnam_r_proto" in
13592 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13593 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13595 case "$getgrnam_r_proto" in
13596 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13597 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13599 case "$getgrnam_r_proto" in
13600 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13601 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13603 case "$getgrnam_r_proto" in
13604 ''|0) d_getgrnam_r=undef
13606 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13607 * ) case "$getgrnam_r_proto" in
13608 REENTRANT_PROTO*) ;;
13609 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13611 echo "Prototype: $try" ;;
13614 *) case "$usethreads" in
13615 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13622 *) getgrnam_r_proto=0
13626 : see if gethostbyaddr exists
13627 set gethostbyaddr d_gethbyaddr
13630 : see if gethostbyname exists
13631 set gethostbyname d_gethbyname
13634 : see if gethostent exists
13635 set gethostent d_gethent
13638 : see how we will look up host name
13641 if set gethostname val -f d_gethname; eval $csym; $val; then
13642 echo 'gethostname() found.' >&4
13643 d_gethname="$define"
13646 if set uname val -f d_uname; eval $csym; $val; then
13649 uname() was found, but you're running xenix, and older versions of xenix
13650 have a broken uname(). If you don't really know whether your xenix is old
13651 enough to have a broken system call, use the default answer.
13656 "$define") dflt=n;;
13658 rp='Is your uname() broken?'
13661 n*) d_uname="$define"; call=uname;;
13664 echo 'uname() found.' >&4
13671 case "$d_gethname" in
13672 '') d_gethname="$undef";;
13675 '') d_uname="$undef";;
13677 case "$d_uname$d_gethname" in
13682 Every now and then someone has a $call() that lies about the hostname
13683 but can't be fixed for political or economic reasons. If you wish, I can
13684 pretend $call() isn't there and maybe compute hostname at run-time
13685 thanks to the '$phostname' command.
13688 rp="Shall I ignore $call() from now on?"
13691 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13694 case "$phostname" in
13695 '') aphostname='';;
13696 *) case "$aphostname" in
13698 *) set X $phostname
13702 file=`./loc $file $file $pth`
13703 aphostname=`echo $file $*`
13708 case "$d_uname$d_gethname" in
13711 case "$phostname" in
13713 echo "There will be no way for $package to get your hostname." >&4;;
13715 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13719 case "$d_phostname" in
13720 '') d_phostname="$undef";;
13723 : see if gethostbyaddr_r exists
13724 set gethostbyaddr_r d_gethostbyaddr_r
13726 case "$d_gethostbyaddr_r" in
13728 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13729 case "$d_gethostbyaddr_r_proto:$usethreads" in
13730 ":define") d_gethostbyaddr_r_proto=define
13731 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13735 case "$d_gethostbyaddr_r_proto" in
13737 case "$gethostbyaddr_r_proto" in
13738 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13739 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13741 case "$gethostbyaddr_r_proto" in
13742 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13743 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13745 case "$gethostbyaddr_r_proto" in
13746 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13747 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13749 case "$gethostbyaddr_r_proto" in
13750 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13751 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13753 case "$gethostbyaddr_r_proto" in
13754 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13755 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13757 case "$gethostbyaddr_r_proto" in
13758 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13759 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13761 case "$gethostbyaddr_r_proto" in
13762 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13763 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13765 case "$gethostbyaddr_r_proto" in
13766 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13767 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13769 case "$gethostbyaddr_r_proto" in
13770 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13771 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13773 case "$gethostbyaddr_r_proto" in
13774 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13775 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13777 case "$gethostbyaddr_r_proto" in
13778 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13779 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13781 case "$gethostbyaddr_r_proto" in
13782 ''|0) d_gethostbyaddr_r=undef
13783 gethostbyaddr_r_proto=0
13784 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13785 * ) case "$gethostbyaddr_r_proto" in
13786 REENTRANT_PROTO*) ;;
13787 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13789 echo "Prototype: $try" ;;
13792 *) case "$usethreads" in
13793 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13795 d_gethostbyaddr_r=undef
13796 gethostbyaddr_r_proto=0
13800 *) gethostbyaddr_r_proto=0
13804 : see if gethostbyname_r exists
13805 set gethostbyname_r d_gethostbyname_r
13807 case "$d_gethostbyname_r" in
13809 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13810 case "$d_gethostbyname_r_proto:$usethreads" in
13811 ":define") d_gethostbyname_r_proto=define
13812 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13816 case "$d_gethostbyname_r_proto" in
13818 case "$gethostbyname_r_proto" in
13819 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13820 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13822 case "$gethostbyname_r_proto" in
13823 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13824 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13826 case "$gethostbyname_r_proto" in
13827 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13828 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13830 case "$gethostbyname_r_proto" in
13831 ''|0) d_gethostbyname_r=undef
13832 gethostbyname_r_proto=0
13833 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13834 * ) case "$gethostbyname_r_proto" in
13835 REENTRANT_PROTO*) ;;
13836 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13838 echo "Prototype: $try" ;;
13841 *) case "$usethreads" in
13842 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13844 d_gethostbyname_r=undef
13845 gethostbyname_r_proto=0
13849 *) gethostbyname_r_proto=0
13853 : see if gethostent_r exists
13854 set gethostent_r d_gethostent_r
13856 case "$d_gethostent_r" in
13858 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13859 case "$d_gethostent_r_proto:$usethreads" in
13860 ":define") d_gethostent_r_proto=define
13861 set d_gethostent_r_proto gethostent_r $hdrs
13865 case "$d_gethostent_r_proto" in
13867 case "$gethostent_r_proto" in
13868 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13869 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13871 case "$gethostent_r_proto" in
13872 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13873 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13875 case "$gethostent_r_proto" in
13876 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13877 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13879 case "$gethostent_r_proto" in
13880 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13881 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
13883 case "$gethostent_r_proto" in
13884 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13885 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
13887 case "$gethostent_r_proto" in
13888 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13889 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
13891 case "$gethostent_r_proto" in
13892 ''|0) d_gethostent_r=undef
13893 gethostent_r_proto=0
13894 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13895 * ) case "$gethostent_r_proto" in
13896 REENTRANT_PROTO*) ;;
13897 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13899 echo "Prototype: $try" ;;
13902 *) case "$usethreads" in
13903 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13905 d_gethostent_r=undef
13906 gethostent_r_proto=0
13910 *) gethostent_r_proto=0
13914 : see if prototypes for various gethostxxx netdb.h functions are available
13916 set d_gethostprotos gethostent $i_netdb netdb.h
13919 : see if getitimer exists
13920 set getitimer d_getitimer
13923 : see if getlogin exists
13924 set getlogin d_getlogin
13927 : see if getlogin_r exists
13928 set getlogin_r d_getlogin_r
13930 case "$d_getlogin_r" in
13932 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13933 case "$d_getlogin_r_proto:$usethreads" in
13934 ":define") d_getlogin_r_proto=define
13935 set d_getlogin_r_proto getlogin_r $hdrs
13939 case "$d_getlogin_r_proto" in
13941 case "$getlogin_r_proto" in
13942 ''|0) try='int getlogin_r(char*, size_t);'
13943 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
13945 case "$getlogin_r_proto" in
13946 ''|0) try='int getlogin_r(char*, int);'
13947 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
13949 case "$getlogin_r_proto" in
13950 ''|0) try='char* getlogin_r(char*, size_t);'
13951 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
13953 case "$getlogin_r_proto" in
13954 ''|0) try='char* getlogin_r(char*, int);'
13955 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
13957 case "$getlogin_r_proto" in
13958 ''|0) d_getlogin_r=undef
13960 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13961 * ) case "$getlogin_r_proto" in
13962 REENTRANT_PROTO*) ;;
13963 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13965 echo "Prototype: $try" ;;
13968 *) case "$usethreads" in
13969 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13976 *) getlogin_r_proto=0
13980 : see if getmnt exists
13981 set getmnt d_getmnt
13984 : see if getmntent exists
13985 set getmntent d_getmntent
13988 : see if getnameinfo exists
13989 set getnameinfo d_getnameinfo
13992 : see if getnetbyaddr exists
13993 set getnetbyaddr d_getnbyaddr
13996 : see if getnetbyname exists
13997 set getnetbyname d_getnbyname
14000 : see if getnetent exists
14001 set getnetent d_getnent
14004 : see if getnetbyaddr_r exists
14005 set getnetbyaddr_r d_getnetbyaddr_r
14007 case "$d_getnetbyaddr_r" in
14009 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14010 case "$d_getnetbyaddr_r_proto:$usethreads" in
14011 ":define") d_getnetbyaddr_r_proto=define
14012 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14016 case "$d_getnetbyaddr_r_proto" in
14018 case "$getnetbyaddr_r_proto" in
14019 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14020 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14022 case "$getnetbyaddr_r_proto" in
14023 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14024 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14026 case "$getnetbyaddr_r_proto" in
14027 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14028 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14030 case "$getnetbyaddr_r_proto" in
14031 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14032 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14034 case "$getnetbyaddr_r_proto" in
14035 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14036 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14038 case "$getnetbyaddr_r_proto" in
14039 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14040 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14042 case "$getnetbyaddr_r_proto" in
14043 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14044 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14046 case "$getnetbyaddr_r_proto" in
14047 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14048 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14050 case "$getnetbyaddr_r_proto" in
14051 ''|0) d_getnetbyaddr_r=undef
14052 getnetbyaddr_r_proto=0
14053 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14054 * ) case "$getnetbyaddr_r_proto" in
14055 REENTRANT_PROTO*) ;;
14056 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14058 echo "Prototype: $try" ;;
14061 *) case "$usethreads" in
14062 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14064 d_getnetbyaddr_r=undef
14065 getnetbyaddr_r_proto=0
14069 *) getnetbyaddr_r_proto=0
14073 : see if getnetbyname_r exists
14074 set getnetbyname_r d_getnetbyname_r
14076 case "$d_getnetbyname_r" in
14078 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14079 case "$d_getnetbyname_r_proto:$usethreads" in
14080 ":define") d_getnetbyname_r_proto=define
14081 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14085 case "$d_getnetbyname_r_proto" in
14087 case "$getnetbyname_r_proto" in
14088 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14089 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14091 case "$getnetbyname_r_proto" in
14092 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14093 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14095 case "$getnetbyname_r_proto" in
14096 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14097 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14099 case "$getnetbyname_r_proto" in
14100 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14101 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14103 case "$getnetbyname_r_proto" in
14104 ''|0) d_getnetbyname_r=undef
14105 getnetbyname_r_proto=0
14106 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14107 * ) case "$getnetbyname_r_proto" in
14108 REENTRANT_PROTO*) ;;
14109 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14111 echo "Prototype: $try" ;;
14114 *) case "$usethreads" in
14115 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14117 d_getnetbyname_r=undef
14118 getnetbyname_r_proto=0
14122 *) getnetbyname_r_proto=0
14126 : see if getnetent_r exists
14127 set getnetent_r d_getnetent_r
14129 case "$d_getnetent_r" in
14131 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14132 case "$d_getnetent_r_proto:$usethreads" in
14133 ":define") d_getnetent_r_proto=define
14134 set d_getnetent_r_proto getnetent_r $hdrs
14138 case "$d_getnetent_r_proto" in
14140 case "$getnetent_r_proto" in
14141 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14142 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14144 case "$getnetent_r_proto" in
14145 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14146 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14148 case "$getnetent_r_proto" in
14149 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14150 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14152 case "$getnetent_r_proto" in
14153 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14154 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14156 case "$getnetent_r_proto" in
14157 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14158 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14160 case "$getnetent_r_proto" in
14161 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14162 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14164 case "$getnetent_r_proto" in
14165 ''|0) d_getnetent_r=undef
14166 getnetent_r_proto=0
14167 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14168 * ) case "$getnetent_r_proto" in
14169 REENTRANT_PROTO*) ;;
14170 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14172 echo "Prototype: $try" ;;
14175 *) case "$usethreads" in
14176 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14178 d_getnetent_r=undef
14179 getnetent_r_proto=0
14183 *) getnetent_r_proto=0
14187 : see if prototypes for various getnetxxx netdb.h functions are available
14189 set d_getnetprotos getnetent $i_netdb netdb.h
14192 : see if getpagesize exists
14193 set getpagesize d_getpagsz
14196 : Optional checks for getprotobyname and getprotobynumber
14198 : see if getprotobyname exists
14199 set getprotobyname d_getpbyname
14202 : see if getprotobynumber exists
14203 set getprotobynumber d_getpbynumber
14206 : see if getprotoent exists
14207 set getprotoent d_getpent
14210 : see if getpgid exists
14211 set getpgid d_getpgid
14214 : see if getpgrp2 exists
14215 set getpgrp2 d_getpgrp2
14218 : see if getppid exists
14219 set getppid d_getppid
14222 : see if getpriority exists
14223 set getpriority d_getprior
14226 : see if getprotobyname_r exists
14227 set getprotobyname_r d_getprotobyname_r
14229 case "$d_getprotobyname_r" in
14231 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14232 case "$d_getprotobyname_r_proto:$usethreads" in
14233 ":define") d_getprotobyname_r_proto=define
14234 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14238 case "$d_getprotobyname_r_proto" in
14240 case "$getprotobyname_r_proto" in
14241 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14242 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14244 case "$getprotobyname_r_proto" in
14245 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14246 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14248 case "$getprotobyname_r_proto" in
14249 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14250 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14252 case "$getprotobyname_r_proto" in
14253 ''|0) d_getprotobyname_r=undef
14254 getprotobyname_r_proto=0
14255 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14256 * ) case "$getprotobyname_r_proto" in
14257 REENTRANT_PROTO*) ;;
14258 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14260 echo "Prototype: $try" ;;
14263 *) case "$usethreads" in
14264 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14266 d_getprotobyname_r=undef
14267 getprotobyname_r_proto=0
14271 *) getprotobyname_r_proto=0
14275 : see if getprotobynumber_r exists
14276 set getprotobynumber_r d_getprotobynumber_r
14278 case "$d_getprotobynumber_r" in
14280 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14281 case "$d_getprotobynumber_r_proto:$usethreads" in
14282 ":define") d_getprotobynumber_r_proto=define
14283 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14287 case "$d_getprotobynumber_r_proto" in
14289 case "$getprotobynumber_r_proto" in
14290 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14291 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14293 case "$getprotobynumber_r_proto" in
14294 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14295 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14297 case "$getprotobynumber_r_proto" in
14298 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14299 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14301 case "$getprotobynumber_r_proto" in
14302 ''|0) d_getprotobynumber_r=undef
14303 getprotobynumber_r_proto=0
14304 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14305 * ) case "$getprotobynumber_r_proto" in
14306 REENTRANT_PROTO*) ;;
14307 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14309 echo "Prototype: $try" ;;
14312 *) case "$usethreads" in
14313 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14315 d_getprotobynumber_r=undef
14316 getprotobynumber_r_proto=0
14320 *) getprotobynumber_r_proto=0
14324 : see if getprotoent_r exists
14325 set getprotoent_r d_getprotoent_r
14327 case "$d_getprotoent_r" in
14329 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14330 case "$d_getprotoent_r_proto:$usethreads" in
14331 ":define") d_getprotoent_r_proto=define
14332 set d_getprotoent_r_proto getprotoent_r $hdrs
14336 case "$d_getprotoent_r_proto" in
14338 case "$getprotoent_r_proto" in
14339 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14340 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14342 case "$getprotoent_r_proto" in
14343 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14344 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14346 case "$getprotoent_r_proto" in
14347 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14348 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14350 case "$getprotoent_r_proto" in
14351 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14352 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14354 case "$getprotoent_r_proto" in
14355 ''|0) d_getprotoent_r=undef
14356 getprotoent_r_proto=0
14357 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14358 * ) case "$getprotoent_r_proto" in
14359 REENTRANT_PROTO*) ;;
14360 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14362 echo "Prototype: $try" ;;
14365 *) case "$usethreads" in
14366 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14368 d_getprotoent_r=undef
14369 getprotoent_r_proto=0
14373 *) getprotoent_r_proto=0
14377 : see if prototypes for various getprotoxxx netdb.h functions are available
14379 set d_getprotoprotos getprotoent $i_netdb netdb.h
14382 : see if getprpwnam exists
14383 set getprpwnam d_getprpwnam
14386 : see if getpwent exists
14387 set getpwent d_getpwent
14390 : see if getpwent_r exists
14391 set getpwent_r d_getpwent_r
14393 case "$d_getpwent_r" in
14395 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14396 case "$d_getpwent_r_proto:$usethreads" in
14397 ":define") d_getpwent_r_proto=define
14398 set d_getpwent_r_proto getpwent_r $hdrs
14402 case "$d_getpwent_r_proto" in
14404 case "$getpwent_r_proto" in
14405 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14406 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14408 case "$getpwent_r_proto" in
14409 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14410 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14412 case "$getpwent_r_proto" in
14413 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14414 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14416 case "$getpwent_r_proto" in
14417 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14418 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14420 case "$getpwent_r_proto" in
14421 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14422 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14424 case "$getpwent_r_proto" in
14425 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14426 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14428 case "$getpwent_r_proto" in
14429 ''|0) d_getpwent_r=undef
14431 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14432 * ) case "$getpwent_r_proto" in
14433 REENTRANT_PROTO*) ;;
14434 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14436 echo "Prototype: $try" ;;
14439 *) case "$usethreads" in
14440 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14447 *) getpwent_r_proto=0
14451 : see if getpwnam_r exists
14452 set getpwnam_r d_getpwnam_r
14454 case "$d_getpwnam_r" in
14456 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14457 case "$d_getpwnam_r_proto:$usethreads" in
14458 ":define") d_getpwnam_r_proto=define
14459 set d_getpwnam_r_proto getpwnam_r $hdrs
14463 case "$d_getpwnam_r_proto" in
14465 case "$getpwnam_r_proto" in
14466 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14467 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14469 case "$getpwnam_r_proto" in
14470 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14471 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14473 case "$getpwnam_r_proto" in
14474 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14475 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14477 case "$getpwnam_r_proto" in
14478 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14479 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14481 case "$getpwnam_r_proto" in
14482 ''|0) d_getpwnam_r=undef
14484 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14485 * ) case "$getpwnam_r_proto" in
14486 REENTRANT_PROTO*) ;;
14487 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14489 echo "Prototype: $try" ;;
14492 *) case "$usethreads" in
14493 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14500 *) getpwnam_r_proto=0
14504 : see if getpwuid_r exists
14505 set getpwuid_r d_getpwuid_r
14507 case "$d_getpwuid_r" in
14509 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14510 case "$d_getpwuid_r_proto:$usethreads" in
14511 ":define") d_getpwuid_r_proto=define
14512 set d_getpwuid_r_proto getpwuid_r $hdrs
14516 case "$d_getpwuid_r_proto" in
14518 case "$getpwuid_r_proto" in
14519 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14520 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14522 case "$getpwuid_r_proto" in
14523 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14524 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14526 case "$getpwuid_r_proto" in
14527 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14528 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14530 case "$getpwuid_r_proto" in
14531 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14532 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14534 case "$getpwuid_r_proto" in
14535 ''|0) d_getpwuid_r=undef
14537 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14538 * ) case "$getpwuid_r_proto" in
14539 REENTRANT_PROTO*) ;;
14540 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14542 echo "Prototype: $try" ;;
14545 *) case "$usethreads" in
14546 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14553 *) getpwuid_r_proto=0
14557 : Optional checks for getsbyname and getsbyport
14559 : see if getservbyname exists
14560 set getservbyname d_getsbyname
14563 : see if getservbyport exists
14564 set getservbyport d_getsbyport
14567 : see if getservent exists
14568 set getservent d_getsent
14571 : see if getservbyname_r exists
14572 set getservbyname_r d_getservbyname_r
14574 case "$d_getservbyname_r" in
14576 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14577 case "$d_getservbyname_r_proto:$usethreads" in
14578 ":define") d_getservbyname_r_proto=define
14579 set d_getservbyname_r_proto getservbyname_r $hdrs
14583 case "$d_getservbyname_r_proto" in
14585 case "$getservbyname_r_proto" in
14586 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14587 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14589 case "$getservbyname_r_proto" in
14590 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14591 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14593 case "$getservbyname_r_proto" in
14594 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14595 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14597 case "$getservbyname_r_proto" in
14598 ''|0) d_getservbyname_r=undef
14599 getservbyname_r_proto=0
14600 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14601 * ) case "$getservbyname_r_proto" in
14602 REENTRANT_PROTO*) ;;
14603 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14605 echo "Prototype: $try" ;;
14608 *) case "$usethreads" in
14609 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14611 d_getservbyname_r=undef
14612 getservbyname_r_proto=0
14616 *) getservbyname_r_proto=0
14620 : see if getservbyport_r exists
14621 set getservbyport_r d_getservbyport_r
14623 case "$d_getservbyport_r" in
14625 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14626 case "$d_getservbyport_r_proto:$usethreads" in
14627 ":define") d_getservbyport_r_proto=define
14628 set d_getservbyport_r_proto getservbyport_r $hdrs
14632 case "$d_getservbyport_r_proto" in
14634 case "$getservbyport_r_proto" in
14635 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14636 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14638 case "$getservbyport_r_proto" in
14639 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14640 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14642 case "$getservbyport_r_proto" in
14643 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14644 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14646 case "$getservbyport_r_proto" in
14647 ''|0) d_getservbyport_r=undef
14648 getservbyport_r_proto=0
14649 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14650 * ) case "$getservbyport_r_proto" in
14651 REENTRANT_PROTO*) ;;
14652 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14654 echo "Prototype: $try" ;;
14657 *) case "$usethreads" in
14658 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14660 d_getservbyport_r=undef
14661 getservbyport_r_proto=0
14665 *) getservbyport_r_proto=0
14669 : see if getservent_r exists
14670 set getservent_r d_getservent_r
14672 case "$d_getservent_r" in
14674 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14675 case "$d_getservent_r_proto:$usethreads" in
14676 ":define") d_getservent_r_proto=define
14677 set d_getservent_r_proto getservent_r $hdrs
14681 case "$d_getservent_r_proto" in
14683 case "$getservent_r_proto" in
14684 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14685 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14687 case "$getservent_r_proto" in
14688 ''|0) try='int getservent_r(struct servent*, char*, int);'
14689 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14691 case "$getservent_r_proto" in
14692 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14693 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14695 case "$getservent_r_proto" in
14696 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14697 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14699 case "$getservent_r_proto" in
14700 ''|0) d_getservent_r=undef
14701 getservent_r_proto=0
14702 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14703 * ) case "$getservent_r_proto" in
14704 REENTRANT_PROTO*) ;;
14705 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14707 echo "Prototype: $try" ;;
14710 *) case "$usethreads" in
14711 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14713 d_getservent_r=undef
14714 getservent_r_proto=0
14718 *) getservent_r_proto=0
14722 : see if prototypes for various getservxxx netdb.h functions are available
14724 set d_getservprotos getservent $i_netdb netdb.h
14727 : see if getspnam exists
14728 set getspnam d_getspnam
14731 : see if this is a shadow.h system
14732 set shadow.h i_shadow
14735 : see if getspnam_r exists
14736 set getspnam_r d_getspnam_r
14738 case "$d_getspnam_r" in
14740 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14741 case "$d_getspnam_r_proto:$usethreads" in
14742 ":define") d_getspnam_r_proto=define
14743 set d_getspnam_r_proto getspnam_r $hdrs
14747 case "$d_getspnam_r_proto" in
14749 case "$getspnam_r_proto" in
14750 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14751 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14753 case "$getspnam_r_proto" in
14754 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14755 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14757 case "$getspnam_r_proto" in
14758 ''|0) d_getspnam_r=undef
14760 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14761 * ) case "$getspnam_r_proto" in
14762 REENTRANT_PROTO*) ;;
14763 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14765 echo "Prototype: $try" ;;
14768 *) case "$usethreads" in
14769 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14776 *) getspnam_r_proto=0
14780 : see if gettimeofday or ftime exists
14781 set gettimeofday d_gettimeod
14783 case "$d_gettimeod" in
14789 val="$undef"; set d_ftime; eval $setvar
14792 case "$d_gettimeod$d_ftime" in
14795 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14799 : see if gmtime_r exists
14800 set gmtime_r d_gmtime_r
14802 case "$d_gmtime_r" in
14804 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14805 case "$d_gmtime_r_proto:$usethreads" in
14806 ":define") d_gmtime_r_proto=define
14807 set d_gmtime_r_proto gmtime_r $hdrs
14811 case "$d_gmtime_r_proto" in
14813 case "$gmtime_r_proto" in
14814 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14815 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
14817 case "$gmtime_r_proto" in
14818 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14819 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
14821 case "$gmtime_r_proto" in
14822 ''|0) d_gmtime_r=undef
14824 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14825 * ) case "$gmtime_r_proto" in
14826 REENTRANT_PROTO*) ;;
14827 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14829 echo "Prototype: $try" ;;
14832 *) case "$usethreads" in
14833 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14840 *) gmtime_r_proto=0
14844 : see if hasmntopt exists
14845 set hasmntopt d_hasmntopt
14848 : see if this is a netinet/in.h or sys/in.h system
14849 set netinet/in.h i_niin sys/in.h i_sysin
14852 : see if arpa/inet.h has to be included
14853 set arpa/inet.h i_arpainet
14856 : see if htonl --and friends-- exists
14861 : Maybe they are macros.
14864 $cat >htonl.c <<EOM
14866 #include <sys/types.h>
14867 #$i_niin I_NETINET_IN
14869 #$i_arpainet I_ARPA_INET
14870 #ifdef I_NETINET_IN
14871 #include <netinet/in.h>
14874 #include <sys/in.h>
14877 #include <arpa/inet.h>
14880 printf("Defined as a macro.");
14883 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14884 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14886 echo "But it seems to be defined as a macro." >&4
14894 : see if ilogbl exists
14895 set ilogbl d_ilogbl
14900 if set index val -f; eval $csym; $val; then
14901 if set strchr val -f d_strchr; eval $csym; $val; then
14902 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14905 echo "strchr() found." >&4
14909 echo "index() found." >&4
14914 echo "index() found." >&4
14917 if set strchr val -f d_strchr; eval $csym; $val; then
14920 echo "strchr() found." >&4
14922 echo "No index() or strchr() found!" >&4
14927 set d_strchr; eval $setvar
14929 set d_index; eval $setvar
14931 : check whether inet_aton exists
14932 set inet_aton d_inetaton
14935 : see if inet_ntop exists
14936 set inet_ntop d_inetntop
14939 : see if inet_pton exists
14940 set inet_pton d_inetpton
14945 $cat >isascii.c <<EOCP
14948 #$i_stdlib I_STDLIB
14950 #include <stdlib.h>
14961 if eval $compile; then
14962 echo "isascii() found." >&4
14965 echo "isascii() NOT found." >&4
14972 : see if isfinite exists
14973 set isfinite d_isfinite
14976 : see if isinf exists
14980 : see if isnan exists
14984 : see if isnanl exists
14985 set isnanl d_isnanl
14988 : see if killpg exists
14989 set killpg d_killpg
14992 : see if lchown exists
14994 $cat > try.c <<'EOCP'
14995 /* System header to define __stub macros and hopefully few prototypes,
14996 which can conflict with char lchown(); below. */
14997 #include <assert.h>
14998 /* Override any gcc2 internal prototype to avoid an error. */
14999 /* We use char because int might match the return type of a gcc2
15000 builtin and then its argument prototype would still apply. */
15003 /* The GNU C library defines this for functions which it implements
15004 to always fail with ENOSYS. Some functions are actually named
15005 something starting with __ and the normal name is an alias. */
15006 #if defined (__stub_lchown) || defined (__stub___lchown)
15014 if eval $compile; then
15015 $echo "lchown() found." >&4
15018 $echo "lchown() NOT found." >&4
15024 : See if number of significant digits in a double precision number is known
15026 $cat >ldbl_dig.c <<EOM
15027 #$i_limits I_LIMITS
15030 #include <limits.h>
15036 printf("Contains LDBL_DIG");
15039 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15040 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15041 echo "LDBL_DIG found." >&4
15044 echo "LDBL_DIG NOT found." >&4
15051 : see if this is a math.h system
15055 : check to see if math.h defines _LIB_VERSION
15056 d_libm_lib_version="$undef"
15060 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15062 #include <unistd.h>
15064 int main (int argc, char *argv[])
15066 printf ("%d\n", _LIB_VERSION);
15071 if eval $compile; then
15073 echo "Yes, it does ($foo)" >&4
15074 d_libm_lib_version="$define"
15076 echo "No, it does not (probably harmless)" >&4
15083 : see if link exists
15087 : see if localtime_r exists
15088 set localtime_r d_localtime_r
15090 case "$d_localtime_r" in
15092 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15093 case "$d_localtime_r_proto:$usethreads" in
15094 ":define") d_localtime_r_proto=define
15095 set d_localtime_r_proto localtime_r $hdrs
15099 case "$d_localtime_r_proto" in
15101 case "$localtime_r_proto" in
15102 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15103 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15105 case "$localtime_r_proto" in
15106 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15107 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15109 case "$localtime_r_proto" in
15110 ''|0) d_localtime_r=undef
15111 localtime_r_proto=0
15112 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15113 * ) case "$localtime_r_proto" in
15114 REENTRANT_PROTO*) ;;
15115 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15117 echo "Prototype: $try" ;;
15120 *) case "$usethreads" in
15121 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15123 d_localtime_r=undef
15124 localtime_r_proto=0
15128 *) localtime_r_proto=0
15132 : see if localtime_r calls tzset
15133 case "$localtime_r_proto" in
15136 /* Does our libc's localtime_r call tzset ?
15137 * return 0 if so, 1 otherwise.
15139 #$i_systypes I_SYS_TYPES
15140 #$i_unistd I_UNISTD
15142 #$i_stdlib I_STDLIB
15143 #$i_string I_STRING
15144 #$i_malloc I_MALLOC
15146 # include <sys/types.h>
15149 # include <unistd.h>
15155 #include <stdlib.h>
15158 # include <string.h>
15160 # include <strings.h>
15163 # include <malloc.h>
15167 time_t t = time(0L);
15168 char w_tz[]="TZ" "=GMT+5",
15169 e_tz[]="TZ" "=GMT-5",
15170 *tz_e = (char*)malloc(16),
15171 *tz_w = (char*)malloc(16);
15172 struct tm tm_e, tm_w;
15173 memset(&tm_e,'\0',sizeof(struct tm));
15174 memset(&tm_w,'\0',sizeof(struct tm));
15179 localtime_r(&t, &tm_e);
15182 localtime_r(&t, &tm_w);
15184 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15190 if eval $compile; then
15191 if $run ./try; then
15192 d_localtime_r_needs_tzset=undef;
15194 d_localtime_r_needs_tzset=define;
15197 d_localtime_r_needs_tzset=undef;
15201 d_localtime_r_needs_tzset=undef;
15206 : see if localeconv exists
15207 set localeconv d_locconv
15210 : see if lockf exists
15214 : see if prototype for lseek is available
15216 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15219 : see if lstat exists
15223 : see if madvise exists
15224 set madvise d_madvise
15227 : see if malloc_size exists
15228 set malloc_size d_malloc_size
15231 : see if malloc_size_good exists
15232 set malloc_good_size d_malloc_good_size
15235 : see if mblen exists
15239 : see if mbstowcs exists
15240 set mbstowcs d_mbstowcs
15243 : see if mbtowc exists
15244 set mbtowc d_mbtowc
15247 : see if memchr exists
15248 set memchr d_memchr
15251 : see if memcmp exists
15252 set memcmp d_memcmp
15255 : see if memcpy exists
15256 set memcpy d_memcpy
15259 : see if memmove exists
15260 set memmove d_memmove
15263 : see if memset exists
15264 set memset d_memset
15267 : see if mkdir exists
15271 : see if mkdtemp exists
15272 set mkdtemp d_mkdtemp
15275 : see if mkfifo exists
15276 set mkfifo d_mkfifo
15279 : see if mkstemp exists
15280 set mkstemp d_mkstemp
15283 : see if mkstemps exists
15284 set mkstemps d_mkstemps
15287 : see if mktime exists
15288 set mktime d_mktime
15291 : see if this is a sys/mman.h system
15292 set sys/mman.h i_sysmman
15295 : see if mmap exists
15298 : see what shmat returns
15299 : default to something harmless
15301 case "$i_sysmman$d_mmap" in
15303 $cat >mmap.c <<'END'
15304 #include <sys/mman.h>
15307 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15312 echo "and it returns ($mmaptype)." >&4
15318 : see if sqrtl exists
15322 : see if scalbnl exists
15323 set scalbnl d_scalbnl
15326 : see if modfl exists
15330 : see if prototype for modfl is available
15332 set d_modflproto modfl $i_math math.h
15335 d_modfl_pow32_bug="$undef"
15337 case "$d_longdbl$d_modfl" in
15340 Checking to see whether your modfl() is okay for large values...
15346 if $test "X$d_modflproto" != "X$define"; then
15347 $cat >>try.c <<EOCP
15348 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15349 long double modfl (long double, long double *);
15352 $cat >>try.c <<EOCP
15354 long double nv = 4294967303.15;
15360 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15364 case "$osname:$gccversion" in
15365 aix:) saveccflags="$ccflags"
15366 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15369 if eval $compile; then
15372 *" 4294967303.150000 1.150000 4294967302.000000")
15373 echo >&4 "Your modfl() is broken for large values."
15374 d_modfl_pow32_bug="$define"
15376 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15380 *" 4294967303.150000 0.150000 4294967303.000000")
15381 echo >&4 "Your modfl() seems okay for large values."
15383 *) echo >&4 "I don't understand your modfl() at all."
15389 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15392 case "$osname:$gccversion" in
15393 aix:) ccflags="$saveccflags" ;; # restore
15398 if $test "$uselongdouble" = "$define"; then
15400 if $test "$d_sqrtl" != "$define"; then
15401 message="$message sqrtl"
15403 if $test "$d_modfl" != "$define"; then
15404 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15405 echo "You have both aintl and copysignl, so I can emulate modfl."
15407 message="$message modfl"
15410 if $test "$d_frexpl" != "$define"; then
15411 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15412 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15414 message="$message frexpl"
15418 if $test "$message" != ""; then
15421 *** You requested the use of long doubles but you do not seem to have
15422 *** the following mathematical functions needed for long double support:
15424 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15425 *** Cannot continue, aborting.
15433 : see if mprotect exists
15434 set mprotect d_mprotect
15437 : see if msgctl exists
15438 set msgctl d_msgctl
15441 : see if msgget exists
15442 set msgget d_msgget
15445 : see if msgsnd exists
15446 set msgsnd d_msgsnd
15449 : see if msgrcv exists
15450 set msgrcv d_msgrcv
15453 : see how much of the 'msg*(2)' library is present.
15456 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15457 *"$undef"*) h_msg=false;;
15461 case "`ipcs 2>&1`" in
15462 "SVID messages"*"not configured"*)
15463 echo "Your $osname does not have the msg*(2) configured." >&4
15466 set msgctl d_msgctl
15468 set msgget d_msgget
15470 set msgsnd d_msgsnd
15472 set msgrcv d_msgrcv
15478 : we could also check for sys/ipc.h ...
15479 if $h_msg && $test `./findhdr sys/msg.h`; then
15480 echo "You have the full msg*(2) library." >&4
15483 echo "You don't have the full msg*(2) library." >&4
15489 : Check for msghdr_s
15491 echo "Checking to see if your system supports struct msghdr..." >&4
15492 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15494 case "$d_msghdr_s" in
15495 "$define") echo "Yes, it does." ;;
15496 *) echo "No, it doesn't." ;;
15500 : see if msync exists
15504 : see if munmap exists
15505 set munmap d_munmap
15508 : see if nice exists
15512 : see if this is a langinfo.h system
15513 set langinfo.h i_langinfo
15516 : see if nl_langinfo exists
15517 set nl_langinfo d_nl_langinfo
15520 : check for volatile keyword
15522 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15523 $cat >try.c <<'EOCP'
15526 typedef struct _goo_struct goo_struct;
15527 goo_struct * volatile goo = ((goo_struct *)0);
15528 struct _goo_struct {
15533 typedef unsigned short foo_t;
15534 char *volatile foo;
15536 volatile foo_t blech;
15540 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15542 echo "Yup, it does."
15545 echo "Nope, it doesn't."
15551 : Check basic sizes
15553 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15555 case "$use64bitint:$d_quad:$quadtype" in
15558 uvtype="$uquadtype"
15563 uvtype="unsigned long"
15569 case "$uselongdouble:$d_longdbl" in
15571 nvtype="long double"
15572 nvsize=$longdblsize
15579 $echo "(IV will be "$ivtype", $ivsize bytes)"
15580 $echo "(UV will be "$uvtype", $uvsize bytes)"
15581 $echo "(NV will be "$nvtype", $nvsize bytes)"
15584 #$i_inttypes I_INTTYPES
15586 #include <inttypes.h>
15591 int8_t i = INT8_MAX;
15592 uint8_t u = UINT8_MAX;
15593 printf("int8_t\n");
15596 int16_t i = INT16_MAX;
15597 uint16_t i = UINT16_MAX;
15598 printf("int16_t\n");
15601 int32_t i = INT32_MAX;
15602 uint32_t u = UINT32_MAX;
15603 printf("int32_t\n");
15608 i8type="signed char"
15609 u8type="unsigned char"
15614 '') case "$shortsize" in
15616 u16type="unsigned short"
15624 '') set try -DINT16
15625 if eval $compile; then
15626 case "`$run ./try`" in
15638 '') if $test $shortsize -ge 2; then
15640 u16type="unsigned short"
15648 '') case "$longsize" in
15650 u32type="unsigned long"
15654 *) case "$intsize" in
15656 u32type="unsigned int"
15666 '') set try -DINT32
15667 if eval $compile; then
15668 case "`$run ./try`" in
15680 '') if $test $intsize -ge 4; then
15682 u32type="unsigned int"
15690 '') case "$d_quad:$quadtype" in
15692 i64type="$quadtype"
15693 u64type="$uquadtype"
15701 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15702 : volatile so that the compiler has to store it out to memory.
15703 if test X"$d_volatile" = X"$define"; then
15708 #$i_stdlib I_STDLIB
15710 #include <stdlib.h>
15712 #include <sys/types.h>
15713 #include <signal.h>
15715 $volatile int bletched = 0;
15716 $signal_t blech(int s) { bletched = 1; }
15721 int n = 8 * $uvsize;
15724 signal(SIGFPE, blech);
15727 for (i = 0; i < n; i++) {
15728 u = u << 1 | ($uvtype)1;
15730 if (($uvtype)d != u)
15734 d = ($nvtype)(u - 1);
15735 if (($uvtype)d != (u - 1))
15742 printf("%d\n", ((i == n) ? -n : i));
15748 d_nv_preserves_uv="$undef"
15749 if eval $compile; then
15750 nv_preserves_uv_bits="`$run ./try`"
15752 case "$nv_preserves_uv_bits" in
15754 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15755 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15756 d_nv_preserves_uv="$define"
15758 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15759 d_nv_preserves_uv="$undef" ;;
15760 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15761 nv_preserves_uv_bits="0" ;;
15765 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15766 : volatile so that the compiler has to store it out to memory.
15767 if test X"$d_volatile" = X"$define"; then
15773 typedef $nvtype NV;
15780 while(count < 256) {
15781 $volatile NV up = value + 1.0;
15782 $volatile NV negated = -value;
15783 $volatile NV down = negated - 1.0;
15784 $volatile NV got_up = up - value;
15785 int up_good = got_up == 1.0;
15786 int got_down = down - negated;
15787 int down_good = got_down == -1.0;
15789 if (down_good != up_good) {
15791 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15792 up_good, (double) got_up, down_good, (double) got_down,
15793 count, (double) value);
15800 fputs("256.0", stdout);
15803 fputs("2.0", stdout);
15809 fputs("*", stdout);
15815 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15816 count, (double) value);
15822 nv_overflows_integers_at='0'
15823 if eval $compile; then
15829 The largest integer your NVs can preserve is equal to $xxx
15831 nv_overflows_integers_at="$xxx"
15834 Cannot determine the largest integer value your NVs can hold, unexpected output
15841 Cannot determine the largest integer value your NVs can hold
15848 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15849 : volatile so that the compiler has to store it out to memory.
15850 if test X"$d_volatile" = X"$define"; then
15855 #$i_stdlib I_STDLIB
15857 #include <stdlib.h>
15859 #$i_string I_STRING
15861 # include <string.h>
15863 # include <strings.h>
15865 #include <sys/types.h>
15866 #include <signal.h>
15868 $volatile int bletched = 0;
15869 $signal_t blech(int s) { bletched = 1; }
15872 int checkit($nvtype d, char *where) {
15873 unsigned char *p = (char *)&d;
15874 unsigned char *end = p + sizeof(d);
15884 printf("No - %s: 0x", where);
15886 printf ("%02X", *p++);
15891 int main(int argc, char **argv) {
15894 fail += checkit(d, "0.0");
15896 /* The compiler shouldn't be assuming that bletched is 0 */
15899 fail += checkit(d, "bleched");
15902 signal(SIGFPE, blech);
15905 /* Paranoia - the compiler should have no way of knowing that ANSI says
15906 that argv[argc] will always be NULL. Actually, if it did assume this it
15907 would be buggy, as this is C and main() can be called from elsewhere in
15909 d = argv[argc] ? 1 : 0;
15912 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15915 fail += checkit(d, "ternary");
15917 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15920 printf("No - memset doesn't give 0.0\n");
15921 /* This might just blow up: */
15922 printf("(gives %g)\n", d);
15928 printf("No - something bleched\n");
15933 printf("No - %d fail(s)\n", fail);
15942 d_nv_zero_is_allbits_zero="$undef"
15943 if eval $compile; then
15949 0.0 is represented as all bits zero in memory
15951 d_nv_zero_is_allbits_zero="$define"
15954 0.0 is not represented as all bits zero in memory
15956 d_nv_zero_is_allbits_zero="$undef"
15961 0.0 is not represented as all bits zero in memory
15963 d_nv_zero_is_allbits_zero="$undef"
15969 : check for off64_t
15971 echo "Checking to see if you have off64_t..." >&4
15973 #include <sys/types.h>
15974 #include <unistd.h>
15975 int main() { off64_t x = 7; }
15978 if eval $compile; then
15980 echo "You have off64_t."
15983 echo "You do not have off64_t."
15984 case "$lseeksize" in
15985 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15992 : how to create joinable pthreads
15993 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15995 echo "Checking what constant to use for creating joinable pthreads..." >&4
15996 $cat >try.c <<'EOCP'
15997 #include <pthread.h>
15999 int detachstate = JOINABLE;
16002 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16003 if eval $compile; then
16004 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16005 val="$undef" # Yes, undef.
16006 set d_old_pthread_create_joinable
16009 set old_pthread_create_joinable
16012 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16013 if eval $compile; then
16014 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16016 set d_old_pthread_create_joinable
16018 val=PTHREAD_CREATE_UNDETACHED
16019 set old_pthread_create_joinable
16022 set try -DJOINABLE=__UNDETACHED
16023 if eval $compile; then
16024 echo "You seem to use __UNDETACHED." >&4
16026 set d_old_pthread_create_joinable
16029 set old_pthread_create_joinable
16032 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16034 set d_old_pthread_create_joinable
16037 set old_pthread_create_joinable
16044 d_old_pthread_create_joinable="$undef"
16045 old_pthread_create_joinable=""
16048 : see if pause exists
16052 : see if poll exists
16056 : see if prctl exists
16060 : see if prctl supports PR_SET_NAME
16061 d_prctl_set_name=$undef
16065 #include <sys/prctl.h>
16067 int main (int argc, char *argv[])
16069 return (prctl (PR_SET_NAME, "Test"));
16073 if eval $compile_ok && $run ./try; then
16074 echo "Your prctl (PR_SET_NAME, ...) works"
16075 d_prctl_set_name=$define
16081 : see if readlink exists
16082 set readlink d_readlink
16085 : Check if exe is symlink to abs path of executing program
16089 case "$d_readlink" in
16091 if $issymlink /proc/self/exe ; then
16092 $ls -l /proc/self/exe > reflect
16093 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16094 echo "You have Linux-like /proc/self/exe."
16095 procselfexe='"/proc/self/exe"'
16099 if $issymlink /proc/curproc/file ; then
16100 $ls -l /proc/curproc/file > reflect
16101 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16102 echo "You have BSD-like /proc/curproc/file."
16103 procselfexe='"/proc/curproc/file"'
16113 : backward compatibility for d_hvfork
16114 if test X$d_hvfork != X; then
16115 d_vfork="$d_hvfork"
16118 : see if there is a vfork
16123 d_pseudofork=$undef
16125 : Ok, but do we want to use it. vfork is reportedly unreliable in
16126 : perl on Solaris 2.x, and probably elsewhere.
16130 case "$usevfork" in
16136 Perl can only use a vfork() that doesn't suffer from strict
16137 restrictions on calling functions or modifying global data in
16138 the child. For example, glibc-2.1 contains such a vfork()
16139 that is unsuitable. If your system provides a proper fork()
16140 call, chances are that you do NOT want perl to use vfork().
16143 rp="Do you still want to use vfork()?"
16148 echo "Ok, we won't use vfork()."
16157 $define) usevfork='true';;
16158 *) usevfork='false';;
16161 : see whether the pthread_atfork exists
16163 #include <pthread.h>
16166 #ifdef PTHREAD_ATFORK
16167 pthread_atfork(NULL,NULL,NULL);
16172 : see if pthread_atfork exists
16173 set try -DPTHREAD_ATFORK
16174 if eval $compile; then
16179 case "$usethreads" in
16182 $define) echo 'pthread_atfork found.' >&4 ;;
16183 *) echo 'pthread_atfork NOT found.' >&4 ;;
16186 set d_pthread_atfork
16189 : see if pthread_attr_setscope exists
16190 set pthread_attr_setscope d_pthread_attr_setscope
16193 : see whether the various POSIXish _yields exist
16195 #include <pthread.h>
16201 #ifdef PTHREAD_YIELD
16204 #ifdef PTHREAD_YIELD_NULL
16205 pthread_yield(NULL);
16211 : see if sched_yield exists
16212 set try -DSCHED_YIELD
16213 if eval $compile; then
16215 sched_yield='sched_yield()'
16219 case "$usethreads" in
16222 $define) echo 'sched_yield() found.' >&4 ;;
16223 *) echo 'sched_yield() NOT found.' >&4 ;;
16229 : see if pthread_yield exists
16230 set try -DPTHREAD_YIELD
16231 if eval $compile; then
16233 case "$sched_yield" in
16234 '') sched_yield='pthread_yield()' ;;
16237 set try -DPTHREAD_YIELD_NULL
16238 if eval $compile; then
16240 case "$sched_yield" in
16241 '') sched_yield='pthread_yield(NULL)' ;;
16247 case "$usethreads" in
16250 $define) echo 'pthread_yield() found.' >&4 ;;
16251 *) echo 'pthread_yield() NOT found.' >&4 ;;
16255 set d_pthread_yield
16257 case "$sched_yield" in
16258 '') sched_yield=undef ;;
16262 : see if random_r exists
16263 set random_r d_random_r
16265 case "$d_random_r" in
16267 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16268 case "$d_random_r_proto:$usethreads" in
16269 ":define") d_random_r_proto=define
16270 set d_random_r_proto random_r $hdrs
16274 case "$d_random_r_proto" in
16276 case "$random_r_proto" in
16277 ''|0) try='int random_r(int*, struct random_data*);'
16278 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16280 case "$random_r_proto" in
16281 ''|0) try='int random_r(long*, struct random_data*);'
16282 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16284 case "$random_r_proto" in
16285 ''|0) try='int random_r(struct random_data*, int32_t*);'
16286 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16288 case "$random_r_proto" in
16289 ''|0) d_random_r=undef
16291 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16292 * ) case "$random_r_proto" in
16293 REENTRANT_PROTO*) ;;
16294 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16296 echo "Prototype: $try" ;;
16299 *) case "$usethreads" in
16300 define) echo "random_r has no prototype, not using it." >&4 ;;
16307 *) random_r_proto=0
16311 : see if readdir and friends exist
16312 set readdir d_readdir
16314 set seekdir d_seekdir
16316 set telldir d_telldir
16318 set rewinddir d_rewinddir
16321 : see if readdir64_r exists
16322 set readdir64_r d_readdir64_r
16324 case "$d_readdir64_r" in
16326 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16327 case "$d_readdir64_r_proto:$usethreads" in
16328 ":define") d_readdir64_r_proto=define
16329 set d_readdir64_r_proto readdir64_r $hdrs
16333 case "$d_readdir64_r_proto" in
16335 case "$readdir64_r_proto" in
16336 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16337 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16339 case "$readdir64_r_proto" in
16340 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16341 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16343 case "$readdir64_r_proto" in
16344 ''|0) d_readdir64_r=undef
16345 readdir64_r_proto=0
16346 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16347 * ) case "$readdir64_r_proto" in
16348 REENTRANT_PROTO*) ;;
16349 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16351 echo "Prototype: $try" ;;
16354 *) case "$usethreads" in
16355 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16357 d_readdir64_r=undef
16358 readdir64_r_proto=0
16362 *) readdir64_r_proto=0
16366 : see if readdir_r exists
16367 set readdir_r d_readdir_r
16369 case "$d_readdir_r" in
16371 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16372 case "$d_readdir_r_proto:$usethreads" in
16373 ":define") d_readdir_r_proto=define
16374 set d_readdir_r_proto readdir_r $hdrs
16378 case "$d_readdir_r_proto" in
16380 case "$readdir_r_proto" in
16381 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16382 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16384 case "$readdir_r_proto" in
16385 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16386 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16388 case "$readdir_r_proto" in
16389 ''|0) d_readdir_r=undef
16391 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16392 * ) case "$readdir_r_proto" in
16393 REENTRANT_PROTO*) ;;
16394 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16396 echo "Prototype: $try" ;;
16399 *) case "$usethreads" in
16400 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16407 *) readdir_r_proto=0
16411 : see if readv exists
16415 : see if recvmsg exists
16416 set recvmsg d_recvmsg
16419 : see if rename exists
16420 set rename d_rename
16423 : see if rmdir exists
16427 : see if memory.h is available.
16432 : See if it conflicts with string.h
16438 $cppstdin $cppflags $cppminus < $strings > mem.h
16439 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16441 echo "We won't be including <memory.h>."
16451 : can bcopy handle overlapping blocks?
16454 case "$d_memmove" in
16455 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16456 *) case "$d_bcopy" in
16458 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16460 #$i_memory I_MEMORY
16461 #$i_stdlib I_STDLIB
16462 #$i_string I_STRING
16463 #$i_unistd I_UNISTD
16465 $cat >>try.c <<'EOCP'
16468 # include <memory.h>
16471 # include <stdlib.h>
16474 # include <string.h>
16476 # include <strings.h>
16479 # include <unistd.h> /* Needed for NetBSD */
16483 char buf[128], abc[128];
16489 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16490 try to store the string in read-only memory. */
16491 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16493 for (align = 7; align >= 0; align--) {
16494 for (len = 36; len; len--) {
16496 bcopy(abc, b, len);
16497 for (off = 1; off <= len; off++) {
16498 bcopy(b, b+off, len);
16499 bcopy(b+off, b, len);
16500 if (bcmp(b, abc, len))
16509 if eval $compile_ok; then
16510 if $run ./try 2>/dev/null; then
16511 echo "Yes, it can."
16514 echo "It can't, sorry."
16517 echo "(I can't compile the test program, so we'll assume not...)"
16527 : can memcpy handle overlapping blocks?
16530 case "$d_memmove" in
16531 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16532 *) case "$d_memcpy" in
16534 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16536 #$i_memory I_MEMORY
16537 #$i_stdlib I_STDLIB
16538 #$i_string I_STRING
16539 #$i_unistd I_UNISTD
16541 $cat >>try.c <<'EOCP'
16544 # include <memory.h>
16547 # include <stdlib.h>
16550 # include <string.h>
16552 # include <strings.h>
16555 # include <unistd.h> /* Needed for NetBSD */
16559 char buf[128], abc[128];
16565 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16566 try to store the string in read-only memory. */
16567 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16569 for (align = 7; align >= 0; align--) {
16570 for (len = 36; len; len--) {
16572 memcpy(b, abc, len);
16573 for (off = 1; off <= len; off++) {
16574 memcpy(b+off, b, len);
16575 memcpy(b, b+off, len);
16576 if (memcmp(b, abc, len))
16585 if eval $compile_ok; then
16586 if $run ./try 2>/dev/null; then
16587 echo "Yes, it can."
16590 echo "It can't, sorry."
16593 echo "(I can't compile the test program, so we'll assume not...)"
16603 : can memcmp be trusted to compare relative magnitude?
16605 case "$d_memcmp" in
16608 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16610 #$i_memory I_MEMORY
16611 #$i_stdlib I_STDLIB
16612 #$i_string I_STRING
16613 #$i_unistd I_UNISTD
16615 $cat >>try.c <<'EOCP'
16618 # include <memory.h>
16621 # include <stdlib.h>
16624 # include <string.h>
16626 # include <strings.h>
16629 # include <unistd.h> /* Needed for NetBSD */
16635 if ((a < b) && memcmp(&a, &b, 1) < 0)
16641 if eval $compile_ok; then
16642 if $run ./try 2>/dev/null; then
16643 echo "Yes, it can."
16646 echo "No, it can't (it uses signed chars)."
16649 echo "(I can't compile the test program, so we'll assume not...)"
16657 : see if prototype for sbrk is available
16659 set d_sbrkproto sbrk $i_unistd unistd.h
16662 : see if select exists
16663 set select d_select
16666 : see if semctl exists
16667 set semctl d_semctl
16670 : see if semget exists
16671 set semget d_semget
16674 : see if semop exists
16678 : see how much of the 'sem*(2)' library is present.
16681 case "$d_semctl$d_semget$d_semop" in
16682 *"$undef"*) h_sem=false;;
16686 case "`ipcs 2>&1`" in
16687 "SVID messages"*"not configured"*)
16688 echo "Your $osname does not have the sem*(2) configured." >&4
16691 set semctl d_semctl
16693 set semget d_semget
16701 : we could also check for sys/ipc.h ...
16702 if $h_sem && $test `./findhdr sys/sem.h`; then
16703 echo "You have the full sem*(2) library." >&4
16706 echo "You don't have the full sem*(2) library." >&4
16712 : see whether sys/sem.h defines union semun
16714 $cat > try.c <<'END'
16715 #include <sys/types.h>
16716 #include <sys/ipc.h>
16717 #include <sys/sem.h>
16718 int main () { union semun semun; semun.buf = 0; }
16721 if eval $compile; then
16722 echo "You have union semun in <sys/sem.h>." >&4
16725 echo "You do not have union semun in <sys/sem.h>." >&4
16732 : see how to do semctl IPC_STAT
16736 $cat > tryh.h <<END
16739 # define S_IRUSR S_IREAD
16740 # define S_IWUSR S_IWRITE
16741 # define S_IXUSR S_IEXEC
16743 # define S_IRUSR 0400
16744 # define S_IWUSR 0200
16745 # define S_IXUSR 0100
16747 # define S_IRGRP (S_IRUSR>>3)
16748 # define S_IWGRP (S_IWUSR>>3)
16749 # define S_IXGRP (S_IXUSR>>3)
16750 # define S_IROTH (S_IRUSR>>6)
16751 # define S_IWOTH (S_IWUSR>>6)
16752 # define S_IXOTH (S_IXUSR>>6)
16755 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16756 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16757 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16760 : see whether semctl IPC_STAT can use union semun
16761 case "$d_semctl_semun" in
16765 #include <sys/types.h>
16766 #include <sys/ipc.h>
16767 #include <sys/sem.h>
16768 #include <sys/stat.h>
16775 #$d_union_semun HAS_UNION_SEMUN
16778 #ifndef HAS_UNION_SEMUN
16781 struct semid_ds *buf;
16782 unsigned short *array;
16788 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16789 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16791 struct semid_ds argbuf;
16794 st = semctl(sem, 0, IPC_STAT, arg);
16798 # endif /* IPC_STAT */
16799 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16801 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16802 # endif /* IPC_RMID */
16803 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16805 #endif /* IPC_PRIVATE && ... */
16806 printf("semget failed: errno = %d\n", errno);
16811 if eval $compile; then
16814 semun) val="$define" ;;
16822 case "$d_semctl_semun" in
16824 echo "You can use union semun for semctl IPC_STAT." >&4
16827 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16832 : see whether semctl IPC_STAT can use struct semid_ds pointer
16833 case "$d_semctl_semid_ds" in
16836 $cat > try.c <<'END'
16837 #include <sys/types.h>
16838 #include <sys/ipc.h>
16839 #include <sys/sem.h>
16840 #include <sys/stat.h>
16848 struct semid_ds arg;
16851 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16852 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16855 st = semctl(sem, 0, IPC_STAT, &arg);
16857 printf("semid_ds\n");
16859 # endif /* IPC_STAT */
16860 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16862 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16863 # endif /* IPC_RMID */
16864 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16866 #endif /* IPC_PRIVATE && ... */
16867 printf("semget failed: errno = %d\n", errno);
16873 if eval $compile; then
16876 semid_ds) val="$define" ;;
16880 set d_semctl_semid_ds
16884 case "$d_semctl_semid_ds" in
16886 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16888 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16894 # We do not have the full sem*(2) library, so assume we can not
16900 set d_semctl_semid_ds
16906 : see if sendmsg exists
16907 set sendmsg d_sendmsg
16910 : see if setegid exists
16911 set setegid d_setegid
16914 : see if seteuid exists
16915 set seteuid d_seteuid
16918 : see if setgrent exists
16919 set setgrent d_setgrent
16922 : see if setgrent_r exists
16923 set setgrent_r d_setgrent_r
16925 case "$d_setgrent_r" in
16927 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16928 case "$d_setgrent_r_proto:$usethreads" in
16929 ":define") d_setgrent_r_proto=define
16930 set d_setgrent_r_proto setgrent_r $hdrs
16934 case "$d_setgrent_r_proto" in
16936 case "$setgrent_r_proto" in
16937 ''|0) try='int setgrent_r(FILE**);'
16938 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
16940 case "$setgrent_r_proto" in
16941 ''|0) try='void setgrent_r(FILE**);'
16942 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
16944 case "$setgrent_r_proto" in
16945 ''|0) d_setgrent_r=undef
16947 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16948 * ) case "$setgrent_r_proto" in
16949 REENTRANT_PROTO*) ;;
16950 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16952 echo "Prototype: $try" ;;
16955 *) case "$usethreads" in
16956 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16963 *) setgrent_r_proto=0
16967 : see if sethostent exists
16968 set sethostent d_sethent
16971 : see if sethostent_r exists
16972 set sethostent_r d_sethostent_r
16974 case "$d_sethostent_r" in
16976 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16977 case "$d_sethostent_r_proto:$usethreads" in
16978 ":define") d_sethostent_r_proto=define
16979 set d_sethostent_r_proto sethostent_r $hdrs
16983 case "$d_sethostent_r_proto" in
16985 case "$sethostent_r_proto" in
16986 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16987 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
16989 case "$sethostent_r_proto" in
16990 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16991 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
16993 case "$sethostent_r_proto" in
16994 ''|0) d_sethostent_r=undef
16995 sethostent_r_proto=0
16996 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16997 * ) case "$sethostent_r_proto" in
16998 REENTRANT_PROTO*) ;;
16999 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
17001 echo "Prototype: $try" ;;
17004 *) case "$usethreads" in
17005 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17007 d_sethostent_r=undef
17008 sethostent_r_proto=0
17012 *) sethostent_r_proto=0
17016 : see if setitimer exists
17017 set setitimer d_setitimer
17020 : see if setlinebuf exists
17021 set setlinebuf d_setlinebuf
17024 : see if setlocale exists
17025 set setlocale d_setlocale
17028 : see if locale.h is available
17029 set locale.h i_locale
17032 : see if setlocale_r exists
17033 set setlocale_r d_setlocale_r
17035 case "$d_setlocale_r" in
17037 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17038 case "$d_setlocale_r_proto:$usethreads" in
17039 ":define") d_setlocale_r_proto=define
17040 set d_setlocale_r_proto setlocale_r $hdrs
17044 case "$d_setlocale_r_proto" in
17046 case "$setlocale_r_proto" in
17047 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17048 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17050 case "$setlocale_r_proto" in
17051 ''|0) d_setlocale_r=undef
17052 setlocale_r_proto=0
17053 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17054 * ) case "$setlocale_r_proto" in
17055 REENTRANT_PROTO*) ;;
17056 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17058 echo "Prototype: $try" ;;
17061 *) case "$usethreads" in
17062 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17064 d_setlocale_r=undef
17065 setlocale_r_proto=0
17069 *) setlocale_r_proto=0
17073 : see if setnetent exists
17074 set setnetent d_setnent
17077 : see if setnetent_r exists
17078 set setnetent_r d_setnetent_r
17080 case "$d_setnetent_r" in
17082 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17083 case "$d_setnetent_r_proto:$usethreads" in
17084 ":define") d_setnetent_r_proto=define
17085 set d_setnetent_r_proto setnetent_r $hdrs
17089 case "$d_setnetent_r_proto" in
17091 case "$setnetent_r_proto" in
17092 ''|0) try='int setnetent_r(int, struct netent_data*);'
17093 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17095 case "$setnetent_r_proto" in
17096 ''|0) try='void setnetent_r(int, struct netent_data*);'
17097 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17099 case "$setnetent_r_proto" in
17100 ''|0) d_setnetent_r=undef
17101 setnetent_r_proto=0
17102 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17103 * ) case "$setnetent_r_proto" in
17104 REENTRANT_PROTO*) ;;
17105 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17107 echo "Prototype: $try" ;;
17110 *) case "$usethreads" in
17111 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17113 d_setnetent_r=undef
17114 setnetent_r_proto=0
17118 *) setnetent_r_proto=0
17122 : see if setprotoent exists
17123 set setprotoent d_setpent
17126 : see if setpgid exists
17127 set setpgid d_setpgid
17130 : see if setpgrp2 exists
17131 set setpgrp2 d_setpgrp2
17134 : see if setpriority exists
17135 set setpriority d_setprior
17138 : see if setproctitle exists
17139 set setproctitle d_setproctitle
17142 : see if setprotoent_r exists
17143 set setprotoent_r d_setprotoent_r
17145 case "$d_setprotoent_r" in
17147 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17148 case "$d_setprotoent_r_proto:$usethreads" in
17149 ":define") d_setprotoent_r_proto=define
17150 set d_setprotoent_r_proto setprotoent_r $hdrs
17154 case "$d_setprotoent_r_proto" in
17156 case "$setprotoent_r_proto" in
17157 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17158 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17160 case "$setprotoent_r_proto" in
17161 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17162 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17164 case "$setprotoent_r_proto" in
17165 ''|0) d_setprotoent_r=undef
17166 setprotoent_r_proto=0
17167 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17168 * ) case "$setprotoent_r_proto" in
17169 REENTRANT_PROTO*) ;;
17170 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17172 echo "Prototype: $try" ;;
17175 *) case "$usethreads" in
17176 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17178 d_setprotoent_r=undef
17179 setprotoent_r_proto=0
17183 *) setprotoent_r_proto=0
17187 : see if setpwent exists
17188 set setpwent d_setpwent
17191 : see if setpwent_r exists
17192 set setpwent_r d_setpwent_r
17194 case "$d_setpwent_r" in
17196 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17197 case "$d_setpwent_r_proto:$usethreads" in
17198 ":define") d_setpwent_r_proto=define
17199 set d_setpwent_r_proto setpwent_r $hdrs
17203 case "$d_setpwent_r_proto" in
17205 case "$setpwent_r_proto" in
17206 ''|0) try='int setpwent_r(FILE**);'
17207 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17209 case "$setpwent_r_proto" in
17210 ''|0) try='void setpwent_r(FILE**);'
17211 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17213 case "$setpwent_r_proto" in
17214 ''|0) d_setpwent_r=undef
17216 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17217 * ) case "$setpwent_r_proto" in
17218 REENTRANT_PROTO*) ;;
17219 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17221 echo "Prototype: $try" ;;
17224 *) case "$usethreads" in
17225 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17232 *) setpwent_r_proto=0
17236 : see if setregid exists
17237 set setregid d_setregid
17239 set setresgid d_setresgid
17242 : see if setreuid exists
17243 set setreuid d_setreuid
17245 set setresuid d_setresuid
17248 : see if setrgid exists
17249 set setrgid d_setrgid
17252 : see if setruid exists
17253 set setruid d_setruid
17256 : see if setservent exists
17257 set setservent d_setsent
17260 : see if setservent_r exists
17261 set setservent_r d_setservent_r
17263 case "$d_setservent_r" in
17265 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17266 case "$d_setservent_r_proto:$usethreads" in
17267 ":define") d_setservent_r_proto=define
17268 set d_setservent_r_proto setservent_r $hdrs
17272 case "$d_setservent_r_proto" in
17274 case "$setservent_r_proto" in
17275 ''|0) try='int setservent_r(int, struct servent_data*);'
17276 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17278 case "$setservent_r_proto" in
17279 ''|0) try='void setservent_r(int, struct servent_data*);'
17280 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17282 case "$setservent_r_proto" in
17283 ''|0) d_setservent_r=undef
17284 setservent_r_proto=0
17285 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17286 * ) case "$setservent_r_proto" in
17287 REENTRANT_PROTO*) ;;
17288 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17290 echo "Prototype: $try" ;;
17293 *) case "$usethreads" in
17294 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17296 d_setservent_r=undef
17297 setservent_r_proto=0
17301 *) setservent_r_proto=0
17305 : see if setsid exists
17306 set setsid d_setsid
17309 : see if setvbuf exists
17310 set setvbuf d_setvbuf
17313 : see if sfio.h is available
17317 : see if sfio library is available
17328 : Ok, but do we want to use it.
17332 true|$define|[yY]*) dflt='y';;
17335 echo "$package can use the sfio library, but it is experimental."
17336 case "$useperlio" in
17338 echo "For sfio also the PerlIO abstraction layer is needed."
17339 echo "Earlier you said you wouldn't want that."
17342 rp="You seem to have sfio available, do you want to try using it?"
17345 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
17346 useperlio="$define"
17349 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17354 *) case "$usesfio" in
17355 true|$define|[yY]*)
17356 echo "Sorry, cannot find sfio on this machine." >&4
17357 echo "Ignoring your setting of usesfio=$usesfio." >&4
17366 $define) usesfio='true';;
17367 *) usesfio='false';;
17371 *) : Remove sfio from list of libraries to use
17374 echo "Removing unneeded -lsfio from library list" >&4
17375 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17378 echo "libs = $libs" >&4
17385 : see if shmctl exists
17386 set shmctl d_shmctl
17389 : see if shmget exists
17390 set shmget d_shmget
17393 : see if shmat exists
17396 : see what shmat returns
17399 $cat >shmat.c <<'END'
17400 #include <sys/shm.h>
17403 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17408 echo "and it returns ($shmattype)." >&4
17409 : see if a prototype for shmat is available
17410 xxx=`./findhdr sys/shm.h`
17411 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17412 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17423 set d_shmatprototype
17426 : see if shmdt exists
17430 : see how much of the 'shm*(2)' library is present.
17433 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17434 *"$undef"*) h_shm=false;;
17438 case "`ipcs 2>&1`" in
17439 "SVID shared memory"*"not configured"*)
17440 echo "Your $osname does not have the shm*(2) configured." >&4
17443 set shmctl d_shmctl
17445 set shmget d_shmget
17455 : we could also check for sys/ipc.h ...
17456 if $h_shm && $test `./findhdr sys/shm.h`; then
17457 echo "You have the full shm*(2) library." >&4
17460 echo "You don't have the full shm*(2) library." >&4
17466 : see if we have sigaction
17468 if set sigaction val -f d_sigaction; eval $csym; $val; then
17469 echo 'sigaction() found.' >&4
17472 #include <sys/types.h>
17473 #include <signal.h>
17474 #$i_stdlib I_STDLIB
17476 #include <stdlib.h>
17480 struct sigaction act, oact;
17482 oact.sa_handler = 0;
17483 /* so that act and oact are used */
17484 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17488 if eval $compile_ok; then
17491 echo "But you don't seem to have a useable struct sigaction." >&4
17495 echo 'sigaction NOT found.' >&4
17498 set d_sigaction; eval $setvar
17501 : see if this is a sunmath.h system
17502 set sunmath.h i_sunmath
17505 : see if signbit exists
17506 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17509 #$i_sunmath I_SUNMATH
17513 #ifdef I_SUNMATH /* Solaris special math library */
17514 # include <sunmath.h>
17517 int main(int argc, char **argv)
17521 if ((signbit(x) == 0) && (signbit(y) != 0))
17529 if eval $compile; then
17530 if $run ./try; then
17534 $echo "Signbit seems to be available, but doesn't work as I expected."
17535 $echo "I won't use it." >&4
17546 : see if sigprocmask exists
17547 set sigprocmask d_sigprocmask
17550 : see if sigsetjmp exists
17552 case "$d_sigsetjmp" in
17555 #include <setjmp.h>
17556 #$i_stdlib I_STDLIB
17558 #include <stdlib.h>
17564 if (sigsetjmp(env,1))
17567 siglongjmp(env, 1);
17572 if eval $compile; then
17573 if $run ./try >/dev/null 2>&1; then
17574 echo "POSIX sigsetjmp found." >&4
17578 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17584 echo "sigsetjmp not found." >&4
17588 *) val="$d_sigsetjmp"
17589 case "$d_sigsetjmp" in
17590 $define) echo "POSIX sigsetjmp found." >&4;;
17591 $undef) echo "sigsetjmp not found." >&4;;
17599 : see if snprintf exists
17600 set snprintf d_snprintf
17603 : see if vsnprintf exists
17604 set vsnprintf d_vsnprintf
17607 case "$d_snprintf-$d_vsnprintf" in
17610 Checking whether your snprintf() and vsnprintf() work okay...
17612 $cat >try.c <<'EOCP'
17613 /* v?snprintf testing logic courtesy of Russ Allbery.
17614 * According to C99:
17615 * - if the buffer is too short it still must be \0-terminated
17616 * - if the buffer is too short the potentially required length
17617 * must be returned and not -1
17618 * - if the buffer is NULL the potentially required length
17619 * must be returned and not -1 or core dump
17622 #include <stdarg.h>
17626 int test (char *format, ...)
17631 va_start (args, format);
17632 count = vsnprintf (buf, sizeof buf, format, args);
17639 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17640 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17644 if eval $compile; then
17647 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17649 Your snprintf() and snprintf() don't seem to be working okay.
17651 d_snprintf="$undef"
17652 d_vsnprintf="$undef"
17656 echo "(I can't seem to compile the test program--assuming they don't)"
17657 d_snprintf="$undef"
17658 d_vsnprintf="$undef"
17664 : see if sockatmark exists
17665 set sockatmark d_sockatmark
17668 : see if prototype for sockatmark is available
17670 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17673 : see if socks5_init exists
17674 set socks5_init d_socks5_init
17677 : see if sprintf returns the length of the string in the buffer as per ANSI
17678 $echo "Checking whether sprintf returns the length of the string..." >&4
17681 #$i_stdlib I_STDLIB
17683 #include <stdlib.h>
17685 #$i_string I_STRING
17687 # include <string.h>
17689 # include <strings.h>
17698 int check (size_t expect, int test) {
17699 size_t got = strlen(buffer);
17703 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17708 int main(int argc, char **argv) {
17711 check(sprintf(buffer, ""), ++test);
17712 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17713 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17720 if eval $compile; then
17724 sprintf returns the length of the string (as ANSI says it should)
17726 d_sprintf_returns_strlen="$define"
17729 sprintf does not return the length of the string (how old is this system?)
17731 d_sprintf_returns_strlen="$undef"
17735 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17736 d_sprintf_returns_strlen="$undef"
17740 : see if srand48_r exists
17741 set srand48_r d_srand48_r
17743 case "$d_srand48_r" in
17745 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17746 case "$d_srand48_r_proto:$usethreads" in
17747 ":define") d_srand48_r_proto=define
17748 set d_srand48_r_proto srand48_r $hdrs
17752 case "$d_srand48_r_proto" in
17754 case "$srand48_r_proto" in
17755 ''|0) try='int srand48_r(long, struct drand48_data*);'
17756 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17758 case "$srand48_r_proto" in
17759 ''|0) d_srand48_r=undef
17761 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17762 * ) case "$srand48_r_proto" in
17763 REENTRANT_PROTO*) ;;
17764 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17766 echo "Prototype: $try" ;;
17769 *) case "$usethreads" in
17770 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17777 *) srand48_r_proto=0
17781 : see if srandom_r exists
17782 set srandom_r d_srandom_r
17784 case "$d_srandom_r" in
17786 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17787 case "$d_srandom_r_proto:$usethreads" in
17788 ":define") d_srandom_r_proto=define
17789 set d_srandom_r_proto srandom_r $hdrs
17793 case "$d_srandom_r_proto" in
17795 case "$srandom_r_proto" in
17796 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17797 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
17799 case "$srandom_r_proto" in
17800 ''|0) d_srandom_r=undef
17802 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17803 * ) case "$srandom_r_proto" in
17804 REENTRANT_PROTO*) ;;
17805 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17807 echo "Prototype: $try" ;;
17810 *) case "$usethreads" in
17811 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17818 *) srandom_r_proto=0
17822 : see if prototype for setresgid is available
17824 set d_sresgproto setresgid $i_unistd unistd.h
17827 : see if prototype for setresuid is available
17829 set d_sresuproto setresuid $i_unistd unistd.h
17832 : see if sys/stat.h is available
17833 set sys/stat.h i_sysstat
17836 : see if stat knows about block sizes
17838 echo "Checking to see if your struct stat has st_blocks field..." >&4
17839 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17842 : see if this is a sys/vfs.h system
17843 set sys/vfs.h i_sysvfs
17846 : see if this is a sys/statfs.h system
17847 set sys/statfs.h i_sysstatfs
17850 : Check for statfs_s
17852 echo "Checking to see if your system supports struct statfs..." >&4
17853 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
17855 case "$d_statfs_s" in
17856 "$define") echo "Yes, it does." ;;
17857 *) echo "No, it doesn't." ;;
17861 : see if struct statfs knows about f_flags
17862 case "$d_statfs_s" in
17865 echo "Checking to see if your struct statfs has f_flags field..." >&4
17866 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
17870 set d_statfs_f_flags
17874 case "$d_statfs_f_flags" in
17875 "$define") echo "Yes, it does." ;;
17876 *) echo "No, it doesn't." ;;
17879 : see what flavor, if any, of static inline is supported
17881 echo "Checking to see if your system supports static inline..."
17882 $cat > try.c <<'EOCP'
17883 #include <stdlib.h>
17884 extern int f_via_a(int x);
17885 extern int f_via_b(int x);
17886 int main(int argc, char **argv)
17895 return EXIT_SUCCESS;
17898 return EXIT_FAILURE;
17902 $cat > a.c <<'EOCP'
17903 static INLINE int f(int x) {
17914 $cat > b.c <<'EOCP'
17915 extern int f(int x);
17923 # Respect a hint (or previous) value for perl_static_inline, if there is one.
17924 case "$perl_static_inline" in
17925 '') # Check the various possibilities, and break out on success.
17926 # For gcc, prefer __inline__, which will still permit
17927 # cflags.SH to add in -ansi.
17928 case "$gccversion" in
17929 '') xxx="inline __inline__ __inline _inline";;
17930 *) xxx="__inline__ inline __inline _inline";;
17932 for inline in $xxx; do
17933 set try -DINLINE=$inline a.c
17934 if eval $compile && $run ./try; then
17935 # Now make sure there is no external linkage of static
17937 set try -DINLINE=$inline -DUSE_B a.c b.c
17938 if eval $compile && $run ./try; then
17939 $echo "Your compiler supports static $inline, " >&4
17940 $echo "but it also creates an external definition," >&4
17941 $echo "so I won't use it." >&4
17944 $echo "Your compiler supports static $inline." >&4
17946 perl_static_inline="static $inline";
17950 $echo "Your compiler does NOT support static $inline." >&4
17955 *inline*) # Some variant of inline exists.
17956 echo "Keeping your $hint value of $perl_static_inline."
17959 static) # No inline capabilities
17960 echo "Keeping your $hint value of $perl_static_inline."
17963 *) # Unrecognized previous value -- blindly trust the supplied
17964 # value and hope it makes sense. Use old value for
17965 # d_static_inline, if there is one.
17966 echo "Keeping your $hint value of $perl_static_inline."
17967 case "$d_static_inline" in
17969 *) val=$d_static_inline ;;
17973 # Fallback to plain 'static' if nothing worked.
17974 case "$perl_static_inline" in
17976 perl_static_inline="static"
17980 set d_static_inline
17982 $rm -f a.[co] b.[co]
17985 : Check stream access
17987 Checking how to access stdio streams by file descriptor number...
17989 case "$stdio_stream_array" in
17990 '') $cat >try.c <<EOCP
17993 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17997 for s in _iob __iob __sF
17999 set try -DSTDIO_STREAM_ARRAY=$s
18000 if eval $compile; then
18001 case "`$run ./try`" in
18002 yes) stdio_stream_array=$s; break ;;
18008 case "$stdio_stream_array" in
18010 I can't figure out how to access stdio streams by file descriptor number.
18012 d_stdio_stream_array="$undef"
18015 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18017 d_stdio_stream_array="$define"
18021 : see if strcoll exists
18022 set strcoll d_strcoll
18025 : check for structure copying
18027 echo "Checking to see if your C compiler can copy structs..." >&4
18028 $cat >try.c <<'EOCP'
18038 if $cc -c try.c >/dev/null 2>&1 ; then
18040 echo "Yup, it can."
18043 echo "Nope, it can't."
18049 : see if strerror and/or sys_errlist[] exist
18051 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18052 if set strerror val -f d_strerror; eval $csym; $val; then
18053 echo 'strerror() found.' >&4
18054 d_strerror="$define"
18055 d_strerrm='strerror(e)'
18056 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18057 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18058 d_syserrlst="$define"
18060 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
18061 d_syserrlst="$undef"
18063 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18064 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18065 echo 'strerror() found in string header.' >&4
18066 d_strerror="$define"
18067 d_strerrm='strerror(e)'
18068 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18069 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18070 d_syserrlst="$define"
18072 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18073 d_syserrlst="$undef"
18075 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18076 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18077 d_strerror="$undef"
18078 d_syserrlst="$define"
18079 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18081 echo 'strerror() and sys_errlist[] NOT found.' >&4
18082 d_strerror="$undef"
18083 d_syserrlst="$undef"
18084 d_strerrm='"unknown"'
18088 : see if strerror_r exists
18089 set strerror_r d_strerror_r
18091 case "$d_strerror_r" in
18093 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18094 case "$d_strerror_r_proto:$usethreads" in
18095 ":define") d_strerror_r_proto=define
18096 set d_strerror_r_proto strerror_r $hdrs
18100 case "$d_strerror_r_proto" in
18102 case "$strerror_r_proto" in
18103 ''|0) try='int strerror_r(int, char*, size_t);'
18104 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18106 case "$strerror_r_proto" in
18107 ''|0) try='int strerror_r(int, char*, int);'
18108 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18110 case "$strerror_r_proto" in
18111 ''|0) try='char* strerror_r(int, char*, size_t);'
18112 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18114 case "$strerror_r_proto" in
18115 ''|0) d_strerror_r=undef
18117 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18118 * ) case "$strerror_r_proto" in
18119 REENTRANT_PROTO*) ;;
18120 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18122 echo "Prototype: $try" ;;
18125 *) case "$usethreads" in
18126 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18133 *) strerror_r_proto=0
18137 : see if strftime exists
18138 set strftime d_strftime
18141 : see if strlcat exists
18142 set strlcat d_strlcat
18145 : see if strlcpy exists
18146 set strlcpy d_strlcpy
18149 : see if strtod exists
18150 set strtod d_strtod
18153 : see if strtol exists
18154 set strtol d_strtol
18157 : see if strtold exists
18158 set strtold d_strtold
18161 : see if strtoll exists
18162 set strtoll d_strtoll
18165 case "$d_longlong-$d_strtoll" in
18168 Checking whether your strtoll() works okay...
18170 $cat >try.c <<'EOCP'
18173 #define strtoll __strtoll
18176 #define strtoll _strtoll
18179 extern long long int strtoll(char *s, char **, int);
18180 static int bad = 0;
18181 int check(char *s, long long ell, int een) {
18184 gll = strtoll(s, 0, 10);
18185 if (!((gll == ell) && (errno == een)))
18189 check(" 1", 1LL, 0);
18190 check(" 0", 0LL, 0);
18191 check("-1", -1LL, 0);
18192 check("-9223372036854775808", -9223372036854775808LL, 0);
18193 check("-9223372036854775808", -9223372036854775808LL, 0);
18194 check(" 9223372036854775807", 9223372036854775807LL, 0);
18195 check("-9223372036854775808", -9223372036854775808LL, 0);
18196 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18197 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18203 if eval $compile; then
18206 ok) echo "Your strtoll() seems to be working okay." ;;
18208 Your strtoll() doesn't seem to be working okay.
18214 echo "(I can't seem to compile the test program--assuming it doesn't)"
18220 : see if strtoq exists
18221 set strtoq d_strtoq
18224 : see if strtoul exists
18225 set strtoul d_strtoul
18228 case "$d_strtoul" in
18231 Checking whether your strtoul() works okay...
18233 $cat >try.c <<'EOCP'
18236 extern unsigned long int strtoul(char *s, char **, int);
18237 static int bad = 0;
18238 void check(char *s, unsigned long eul, int een) {
18241 gul = strtoul(s, 0, 10);
18242 if (!((gul == eul) && (errno == een)))
18246 check(" 1", 1L, 0);
18247 check(" 0", 0L, 0);
18249 case "$longsize" in
18251 $cat >>try.c <<'EOCP'
18252 check("18446744073709551615", 18446744073709551615UL, 0);
18253 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18254 #if 0 /* strtoul() for /^-/ strings is undefined. */
18255 check("-1", 18446744073709551615UL, 0);
18256 check("-18446744073709551614", 2, 0);
18257 check("-18446744073709551615", 1, 0);
18258 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18259 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18264 $cat >>try.c <<'EOCP'
18265 check("4294967295", 4294967295UL, 0);
18266 check("4294967296", 4294967295UL, ERANGE);
18267 #if 0 /* strtoul() for /^-/ strings is undefined. */
18268 check("-1", 4294967295UL, 0);
18269 check("-4294967294", 2, 0);
18270 check("-4294967295", 1, 0);
18271 check("-4294967296", 4294967295UL, ERANGE);
18272 check("-4294967297", 4294967295UL, ERANGE);
18277 : Should we write these tests to be more portable by sprintf-ing
18278 : ~0 and then manipulating that char string as input for strtol?
18281 $cat >>try.c <<'EOCP'
18288 if eval $compile; then
18289 case "`$run ./try`" in
18290 ok) echo "Your strtoul() seems to be working okay." ;;
18292 Your strtoul() doesn't seem to be working okay.
18298 echo "(I can't seem to compile the test program--assuming it doesn't)"
18304 : see if strtoull exists
18305 set strtoull d_strtoull
18308 case "$d_longlong-$d_strtoull" in
18311 Checking whether your strtoull() works okay...
18313 $cat >try.c <<'EOCP'
18316 #define strtoull __strtoull
18319 extern unsigned long long int strtoull(char *s, char **, int);
18320 static int bad = 0;
18321 int check(char *s, long long eull, int een) {
18324 gull = strtoull(s, 0, 10);
18325 if (!((gull == eull) && (errno == een)))
18329 check(" 1", 1LL, 0);
18330 check(" 0", 0LL, 0);
18331 check("18446744073709551615", 18446744073709551615ULL, 0);
18332 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18333 #if 0 /* strtoull() for /^-/ strings is undefined. */
18334 check("-1", 18446744073709551615ULL, 0);
18335 check("-18446744073709551614", 2LL, 0);
18336 check("-18446744073709551615", 1LL, 0);
18337 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18338 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18345 if eval $compile; then
18346 case "`$run ./try`" in
18347 ok) echo "Your strtoull() seems to be working okay." ;;
18349 Your strtoull() doesn't seem to be working okay.
18351 d_strtoull="$undef"
18355 echo "(I can't seem to compile the test program--assuming it doesn't)"
18356 d_strtoull="$undef"
18361 : see if strtouq exists
18362 set strtouq d_strtouq
18365 case "$d_strtouq" in
18368 Checking whether your strtouq() works okay...
18370 $cat >try.c <<'EOCP'
18373 extern unsigned long long int strtouq(char *s, char **, int);
18374 static int bad = 0;
18375 void check(char *s, unsigned long long eull, int een) {
18376 unsigned long long gull;
18378 gull = strtouq(s, 0, 10);
18379 if (!((gull == eull) && (errno == een)))
18383 check(" 1", 1LL, 0);
18384 check(" 0", 0LL, 0);
18385 check("18446744073709551615", 18446744073709551615ULL, 0);
18386 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18387 #if 0 /* strtouq() for /^-/ strings is undefined. */
18388 check("-1", 18446744073709551615ULL, 0);
18389 check("-18446744073709551614", 2LL, 0);
18390 check("-18446744073709551615", 1LL, 0);
18391 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18392 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18400 if eval $compile; then
18401 case "`$run ./try`" in
18402 ok) echo "Your strtouq() seems to be working okay." ;;
18404 Your strtouq() doesn't seem to be working okay.
18410 echo "(I can't seem to compile the test program--assuming it doesn't)"
18416 : see if strxfrm exists
18417 set strxfrm d_strxfrm
18420 : see if symlink exists
18421 set symlink d_symlink
18424 : see if syscall exists
18425 set syscall d_syscall
18428 : see if prototype for syscall is available
18430 set d_syscallproto syscall $i_unistd unistd.h
18433 : see if sysconf exists
18434 set sysconf d_sysconf
18437 : see if system exists
18438 set system d_system
18441 : see if tcgetpgrp exists
18442 set tcgetpgrp d_tcgetpgrp
18445 : see if tcsetpgrp exists
18446 set tcsetpgrp d_tcsetpgrp
18449 : see if prototype for telldir is available
18451 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18454 : see if time exists
18456 if test "X$d_time" = X -o X"$timetype" = X; then
18457 if set time val -f d_time; eval $csym; $val; then
18458 echo 'time() found.' >&4
18460 rp="What is the type returned by time() on this system?"
18461 set time_t timetype long stdio.h sys/types.h
18464 echo 'time() not found, hope that will do.' >&4
18472 : see if timegm exists
18473 set timegm d_timegm
18476 : see if this is a sys/times.h system
18477 set sys/times.h i_systimes
18480 : see if times exists
18482 if set times val -f d_times; eval $csym; $val; then
18483 echo 'times() found.' >&4
18486 case "$i_systimes" in
18487 "$define") inc='sys/times.h';;
18489 rp="What is the type returned by times() on this system?"
18490 set clock_t clocktype long stdio.h sys/types.h $inc
18493 echo 'times() NOT found, hope that will do.' >&4
18498 : see if tmpnam_r exists
18499 set tmpnam_r d_tmpnam_r
18501 case "$d_tmpnam_r" in
18503 hdrs="$i_systypes sys/types.h define stdio.h "
18504 case "$d_tmpnam_r_proto:$usethreads" in
18505 ":define") d_tmpnam_r_proto=define
18506 set d_tmpnam_r_proto tmpnam_r $hdrs
18510 case "$d_tmpnam_r_proto" in
18512 case "$tmpnam_r_proto" in
18513 ''|0) try='char* tmpnam_r(char*);'
18514 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18516 case "$tmpnam_r_proto" in
18517 ''|0) d_tmpnam_r=undef
18519 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18520 * ) case "$tmpnam_r_proto" in
18521 REENTRANT_PROTO*) ;;
18522 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18524 echo "Prototype: $try" ;;
18527 *) case "$usethreads" in
18528 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18535 *) tmpnam_r_proto=0
18539 : see if truncate exists
18540 set truncate d_truncate
18543 : see if ttyname_r exists
18544 set ttyname_r d_ttyname_r
18546 case "$d_ttyname_r" in
18548 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18549 case "$d_ttyname_r_proto:$usethreads" in
18550 ":define") d_ttyname_r_proto=define
18551 set d_ttyname_r_proto ttyname_r $hdrs
18555 case "$d_ttyname_r_proto" in
18557 case "$ttyname_r_proto" in
18558 ''|0) try='int ttyname_r(int, char*, size_t);'
18559 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18561 case "$ttyname_r_proto" in
18562 ''|0) try='int ttyname_r(int, char*, int);'
18563 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18565 case "$ttyname_r_proto" in
18566 ''|0) try='char* ttyname_r(int, char*, int);'
18567 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18569 case "$ttyname_r_proto" in
18570 ''|0) d_ttyname_r=undef
18572 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18573 * ) case "$ttyname_r_proto" in
18574 REENTRANT_PROTO*) ;;
18575 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18577 echo "Prototype: $try" ;;
18580 *) case "$usethreads" in
18581 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18588 *) ttyname_r_proto=0
18592 : see if tzname[] exists
18594 if set tzname val -a d_tzname; eval $csym; $val; then
18596 echo 'tzname[] found.' >&4
18599 echo 'tzname[] NOT found.' >&4
18604 : Check if is a multiplatform env
18606 next|rhapsody|darwin) multiarch="$define" ;;
18608 case "$multiarch" in
18609 ''|[nN]*) multiarch="$undef" ;;
18612 : check for ordering of bytes in a UV
18614 case "$usecrosscompile$multiarch" in
18617 You seem to be either cross-compiling or doing a multiarchitecture build,
18618 skipping the byteorder check.
18624 case "$byteorder" in
18627 In the following, larger digits indicate more significance. A big-endian
18628 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18629 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18630 machines may have weird orders like 3412. A Cray will report 87654321,
18631 an Alpha will report 12345678. If the test program works the default is
18633 I'm now running the test program...
18637 #$i_stdlib I_STDLIB
18639 #include <stdlib.h>
18641 #include <sys/types.h>
18642 typedef $uvtype UV;
18652 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18654 u.l = (UV)0x04030201;
18655 for (i = 0; i < $uvsize; i++)
18656 printf("%c", u.c[i]+'0');
18663 if eval $compile && $run ./try > /dev/null; then
18666 [1-4][1-4][1-4][1-4]|12345678|87654321)
18667 echo "(The test program ran ok.)"
18668 echo "byteorder=$dflt"
18671 ????|????????) echo "(The test program ran ok.)" ;;
18672 *) echo "(The test program didn't run right for some reason.)" ;;
18677 (I can't seem to compile the test program. Guessing big-endian...)
18680 case "$xxx_prompt" in
18682 rp="What is the order of bytes in $uvtype?"
18695 : Checking 32bit aligndness
18698 Checking to see whether you can access character data unalignedly...
18700 case "$d_u32align" in
18701 '') $cat >try.c <<EOCP
18703 #$i_stdlib I_STDLIB
18705 #include <stdlib.h>
18707 #define U32 $u32type
18708 #define BYTEORDER 0x$byteorder
18710 #include <signal.h>
18712 $signal_t bletch(int s) { exit(4); }
18715 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18716 volatile U8 buf[8];
18720 if (sizeof(U32) != 4) {
18721 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18728 signal(SIGBUS, bletch);
18740 for (i = 0; i < 4; i++) {
18741 up = (U32*)(buf + i);
18742 if (! ((*up == 1 << (8*i)) || /* big-endian */
18743 (*up == 1 << (8*(3-i))) /* little-endian */
18747 printf("read failed (%x)\n", *up);
18753 for (i = 0; i < 4; i++) {
18754 up = (U32*)(buf + i);
18756 if (*up != 0xBeef) {
18757 printf("write failed (%x)\n", *up);
18771 if eval $compile_ok; then
18772 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18773 $run ./try 2>&1 >/dev/null
18776 You can access character data pretty unalignedly.
18778 d_u32align="$undef"
18781 It seems that you must access character data in an aligned manner.
18783 d_u32align="$define"
18787 rp='Can you access character data at unaligned addresses?'
18791 [yY]*) d_u32align="$undef" ;;
18792 *) d_u32align="$define" ;;
18799 : see if ualarm exists
18800 set ualarm d_ualarm
18803 : see if umask exists
18807 : see if unordered exists
18808 set unordered d_unordered
18811 : see if unsetenv exists
18812 set unsetenv d_unsetenv
18815 : see if usleep exists
18816 set usleep d_usleep
18819 : see if prototype for usleep is available
18821 set d_usleepproto usleep $i_unistd unistd.h
18824 : see if ustat exists
18828 : see if closedir exists
18829 set closedir d_closedir
18832 case "$d_closedir" in
18835 echo "Checking whether closedir() returns a status..." >&4
18837 #$i_dirent I_DIRENT /**/
18838 #$i_sysdir I_SYS_DIR /**/
18839 #$i_sysndir I_SYS_NDIR /**/
18840 #$i_systypes I_SYS_TYPES /**/
18842 #if defined(I_SYS_TYPES)
18843 #include <sys/types.h>
18845 #if defined(I_DIRENT)
18846 #include <dirent.h>
18847 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18848 #include <sys/dir.h>
18852 #include <sys/ndir.h>
18856 #include <ndir.h> /* may be wrong in the future */
18858 #include <sys/dir.h>
18863 int main() { return closedir(opendir(".")); }
18866 if eval $compile_ok; then
18867 if $run ./try > /dev/null 2>&1 ; then
18868 echo "Yes, it does."
18871 echo "No, it doesn't."
18875 echo "(I can't seem to compile the test program--assuming it doesn't)"
18883 set d_void_closedir
18887 : see if there is a wait4
18891 : see if waitpid exists
18892 set waitpid d_waitpid
18895 : see if wcstombs exists
18896 set wcstombs d_wcstombs
18899 : see if wctomb exists
18900 set wctomb d_wctomb
18903 : see if writev exists
18904 set writev d_writev
18907 : preserve RCS keywords in files with variable substitution, grrr
18912 Revision='$Revision'
18914 : check for alignment requirements
18916 case "$usecrosscompile$multiarch" in
18919 You seem to be either cross-compiling or doing a multiarchitecture build,
18920 skipping the memory alignment check.
18923 case "$alignbytes" in
18924 '') alignbytes=8 ;;
18928 case "$alignbytes" in
18929 '') echo "Checking alignment constraints..." >&4
18930 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18931 $cat >try.c <<'EOCP'
18932 typedef long double NV;
18935 $cat >try.c <<'EOCP'
18939 $cat >>try.c <<'EOCP'
18947 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18952 if eval $compile_ok; then
18956 echo "(I can't seem to compile the test program...)"
18959 *) dflt="$alignbytes"
18962 rp="Doubles must be aligned on a how-many-byte boundary?"
18970 : set the base revision
18973 : length of character in bytes. Is always 1, otherwise it isnt C
18974 : This used to be a test using sizeof
18977 : Check for the number of bits in a character
18978 case "$charbits" in
18979 '') echo "Checking how long a character is (in bits)..." >&4
18986 for (c = 1, n = 0; c; c <<= 1, n++) ;
18987 printf ("%d\n", n);
18992 if eval $compile_ok; then
18996 echo "(I can't seem to compile the test program. Guessing...)"
19003 rp="What is the length of a character (in bits)?"
19007 case "$charbits" in
19010 Your system has an unsigned character size of $charbits bits, which
19011 is rather unusual (normally it is 8 bits). Perl likely will not work
19012 correctly on your system, with subtle bugs in various places.
19014 rp='Do you really want to continue?'
19018 [yY]) echo >&4 "Okay, continuing." ;;
19023 : how do we concatenate cpp tokens here?
19025 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19026 $cat >cpp_stuff.c <<'EOCP'
19027 #define RCAT(a,b)a/**/b
19028 #define ACAT(a,b)a ## b
19032 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19033 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19034 echo "Oh! Smells like ANSI's been here." >&4
19035 echo "We can catify or stringify, separately or together!"
19037 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19038 echo "Ah, yes! The good old days!" >&4
19039 echo "However, in the good old days we don't know how to stringify and"
19040 echo "catify at the same time."
19044 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19045 You're going to have to edit the values of CAT[2-5] in config.h...
19047 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19051 : see if this is a db.h system
19057 : Check db version.
19059 echo "Checking Berkeley DB version ..." >&4
19065 #include <sys/types.h>
19067 #$i_stdlib I_STDLIB
19069 #include <stdlib.h>
19072 int main(int argc, char *argv[])
19074 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19075 int Major, Minor, Patch ;
19076 unsigned long Version ;
19077 (void)db_version(&Major, &Minor, &Patch) ;
19079 printf("%d %d %d %d %d %d\n",
19080 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19081 Major, Minor, Patch);
19084 printf("You have Berkeley DB Version 2 or greater.\n");
19086 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19087 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19088 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19089 Major, Minor, Patch) ;
19091 /* check that db.h & libdb are compatible */
19092 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19093 printf("db.h and libdb are incompatible.\n") ;
19097 printf("db.h and libdb are compatible.\n") ;
19099 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19100 + DB_VERSION_PATCH ;
19102 /* needs to be >= 2.3.4 */
19103 if (Version < 2003004) {
19104 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19105 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19111 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19116 printf("You have Berkeley DB Version 1.\n");
19117 exit(0); /* DB version < 2: the coast is clear. */
19119 exit(1); /* <db.h> not Berkeley DB? */
19125 if eval $compile_ok && $run ./try; then
19126 echo 'Looks OK.' >&4
19128 db_version_major=$1
19129 db_version_minor=$2
19130 db_version_patch=$3
19132 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19136 : Remove db from list of libraries to use
19137 echo "Removing unusable -ldb from library list" >&4
19138 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19141 echo "libs = $libs" >&4
19151 : Check the return type needed for hash
19153 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19159 #include <sys/types.h>
19162 #ifndef DB_VERSION_MAJOR
19163 u_int32_t hash_cb (ptr, size)
19171 info.hash = hash_cb;
19175 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19176 if $contains warning try.out >>/dev/null 2>&1 ; then
19179 db_hashtype='u_int32_t'
19182 : XXX Maybe we should just give up here.
19183 db_hashtype=u_int32_t
19185 echo "Help: I can't seem to compile the db test program." >&4
19186 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19189 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19191 *) db_hashtype=u_int32_t
19196 : Check the return type needed for prefix
19198 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19204 #include <sys/types.h>
19207 #ifndef DB_VERSION_MAJOR
19208 size_t prefix_cb (key1, key2)
19216 info.prefix = prefix_cb;
19220 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19221 if $contains warning try.out >>/dev/null 2>&1 ; then
19222 db_prefixtype='int'
19224 db_prefixtype='size_t'
19227 db_prefixtype='size_t'
19228 : XXX Maybe we should just give up here.
19230 echo "Help: I can't seem to compile the db test program." >&4
19231 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19234 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19236 *) db_prefixtype='size_t'
19240 : How can we generate normalized random numbers ?
19242 echo "Looking for a random number function..." >&4
19243 case "$randfunc" in
19245 if set drand48 val -f; eval $csym; $val; then
19247 echo "Good, found drand48()." >&4
19248 elif set random val -f; eval $csym; $val; then
19250 echo "OK, found random()." >&4
19253 echo "Yick, looks like I have to use rand()." >&4
19264 *-Dmy_rand=*|*-Dmy_srand=*)
19265 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19266 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19267 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19268 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19272 while $test "$cont"; do
19273 rp="Use which function to generate random numbers?"
19275 if $test "$ans" = "$dflt"; then
19281 if set $ans val -f; eval $csym; $val; then
19285 rp="I cannot find function $ans. Use that name anyway?"
19294 case "$randfunc" in
19296 drand01="drand48()"
19302 case "$randbits" in
19304 echo "Checking to see how many bits your $randfunc() function produces..." >&4
19306 #$i_unistd I_UNISTD
19307 #$i_stdlib I_STDLIB
19310 # include <unistd.h>
19313 # include <stdlib.h>
19318 register unsigned long tmp;
19319 register unsigned long max = 0L;
19321 for (i = 1000; i; i--) {
19322 tmp = (unsigned long) $randfunc();
19323 if (tmp > max) max = tmp;
19325 for (i = 0; max; i++)
19331 if eval $compile_ok; then
19335 echo "(I can't seem to compile the test program...)"
19342 rp="How many bits does your $randfunc() function produce?"
19346 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19347 seedfunc="s$randfunc"
19348 randseedtype=unsigned
19352 rp="How many bits does your $randfunc() function produce?"
19355 seedfunc="s$randfunc"
19356 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19357 if set $seedfunc val -f; eval $csym; $val; then
19358 echo "(Using $seedfunc() to seed random generator)"
19360 echo "(Warning: no $seedfunc() to seed random generator)"
19363 randseedtype=unsigned
19370 : Determine if this is an EBCDIC system
19372 echo "Determining whether or not we are on an EBCDIC system..." >&4
19373 $cat >try.c <<'EOM'
19376 if ('M'==0xd4) return 0;
19383 if eval $compile_ok; then
19384 if $run ./try; then
19385 echo "You seem to speak EBCDIC." >&4
19388 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19391 echo "I'm unable to compile the test program." >&4
19392 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19398 : Check how to flush
19401 Checking how to flush all pending stdio output...
19403 # I only know how to find the first 32 possibly open files on SunOS.
19404 # See also hints/sunos_4_1.sh and util.c --AD
19406 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19408 $cat >>try.c <<EOCP
19410 #$i_stdlib I_STDLIB
19412 #include <stdlib.h>
19414 #$i_unistd I_UNISTD
19416 # include <unistd.h>
19418 #$d_sysconf HAS_SYSCONF
19419 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19420 #ifdef HAS_STDIO_STREAM_ARRAY
19421 # define STDIO_STREAM_ARRAY $stdio_stream_array
19426 p = fopen("try.out", "w");
19430 # ifdef TRY_FPRINTF
19434 #ifdef TRY_FFLUSH_NULL
19437 #ifdef TRY_FFLUSH_ALL
19439 long open_max = -1;
19440 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19441 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19443 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19444 open_max = sysconf(_SC_OPEN_MAX);
19447 open_max = FOPEN_MAX;
19450 open_max = OPEN_MAX;
19459 # ifdef HAS_STDIO_STREAM_ARRAY
19460 if (open_max > 0) {
19462 for (i = 0; i < open_max; i++)
19463 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19464 STDIO_STREAM_ARRAY[i]._file < open_max &&
19465 STDIO_STREAM_ARRAY[i]._flag)
19466 fflush(&STDIO_STREAM_ARRAY[i]);
19474 : first we have to find out how _not_ to flush
19476 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19478 set try -DTRY_FPUTC
19479 if eval $compile; then
19480 $run ./try 2>/dev/null
19483 if $test ! -s try.out -a "X$code" = X42; then
19489 set try -DTRY_FPRINTF
19490 if eval $compile; then
19491 $run ./try 2>/dev/null
19494 if $test ! -s try.out -a "X$code" = X42; then
19495 output=-DTRY_FPRINTF
19501 : check for fflush NULL behaviour
19502 case "$fflushNULL" in
19503 '') set try -DTRY_FFLUSH_NULL $output
19504 if eval $compile; then
19505 $run ./try 2>/dev/null
19508 if $test -s try.out -a "X$code" = X42; then
19509 fflushNULL="`$cat try.out`"
19511 if $test "X$code" != X42; then
19513 (If this test failed, don't worry, we'll try another method shortly.)
19518 $rm -f core try.core core.try.*
19519 case "$fflushNULL" in
19521 Your fflush(NULL) works okay for output streams.
19522 Let's see if it clobbers input pipes...
19524 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19525 # bug that improperly flushes the input end of pipes. So we avoid the
19526 # autoflush on fork/system/exec support for now. :-(
19527 $cat >tryp.c <<EOCP
19530 main(int argc, char **argv)
19536 while ((i = getc(stdin)) != -1
19537 && (*bp++ = i) != '\n'
19538 && bp < &buf[1024])
19541 fprintf(stdout, "%s", buf);
19549 fflushNULL="$define"
19551 if eval $compile; then
19553 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19554 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19556 fflush(NULL) seems to behave okay with input streams.
19558 fflushNULL="$define"
19561 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19563 fflushNULL="$undef"
19566 $rm -f core tryp.c tryp.core core.tryp.*
19569 Your fflush(NULL) isn't working (contrary to ANSI C).
19571 fflushNULL="$undef"
19574 Cannot figure out whether your fflush(NULL) works or not.
19575 I'm assuming it doesn't (contrary to ANSI C).
19577 fflushNULL="$undef"
19581 $define|true|[yY]*)
19582 fflushNULL="$define"
19585 fflushNULL="$undef"
19588 : check explicit looping only if NULL did not work, and if the pipe
19589 : bug does not show up on an explicit flush too
19590 case "$fflushNULL" in
19592 $cat >tryp.c <<EOCP
19595 main(int argc, char **argv)
19601 while ((i = getc(stdin)) != -1
19602 && (*bp++ = i) != '\n'
19603 && bp < &buf[1024])
19606 fprintf(stdout, "%s", buf);
19615 if eval $compile; then
19617 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19618 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19620 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19622 : now check for fflushall behaviour
19623 case "$fflushall" in
19624 '') set try -DTRY_FFLUSH_ALL $output
19625 if eval $compile; then
19627 (Now testing the other method--but note that this also may fail.)
19629 $run ./try 2>/dev/null
19632 if $test -s try.out -a "X$code" = X42; then
19633 fflushall="`$cat try.out`"
19637 case "$fflushall" in
19639 Whew. Flushing explicitly all the stdio streams works.
19641 fflushall="$define"
19644 Sigh. Flushing explicitly all the stdio streams doesn't work.
19649 Cannot figure out whether flushing stdio streams explicitly works or not.
19650 I'm assuming it doesn't.
19656 "$define"|true|[yY]*)
19657 fflushall="$define"
19665 All is futile. Even fflush(stdin) clobbers input pipes!
19672 $rm -f core tryp.c tryp.core core.tryp.*
19674 *) fflushall="$undef"
19678 case "$fflushNULL$fflushall" in
19681 OK, I give up. I cannot figure out how to flush pending stdio output.
19682 We won't be flushing handles at all before fork/exec/popen.
19688 : Store the full pathname to the ar program for use in the C program
19689 : Respect a hint or command line value for full_ar.
19694 : Store the full pathname to the sed program for use in the C program
19697 : see what type gids are declared as in the kernel
19699 echo "Looking for the type for group ids returned by getgid()."
19700 set gid_t gidtype xxx stdio.h sys/types.h
19704 xxx=`./findhdr sys/user.h`
19705 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19707 unsigned) dflt="$1 $2" ;;
19711 *) dflt="$gidtype";;
19714 gid_t) echo "gid_t found." ;;
19715 *) rp="What is the type for group ids returned by getgid()?"
19721 : Check the size of GID
19724 *_t) zzz="$gidtype" ;;
19727 echo "Checking the size of $zzz..." >&4
19729 #include <sys/types.h>
19731 #$i_stdlib I_STDLIB
19733 #include <stdlib.h>
19736 printf("%d\n", (int)sizeof($gidtype));
19741 if eval $compile_ok; then
19745 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19748 echo "Your $zzz is $gidsize bytes long."
19753 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19757 : Check if GID is signed
19760 *_t) zzz="$gidtype" ;;
19763 echo "Checking the sign of $zzz..." >&4
19765 #include <sys/types.h>
19776 if eval $compile; then
19780 echo "(I can't execute the test program--guessing unsigned.)" >&4
19784 1) echo "Your $zzz is unsigned." ;;
19785 -1) echo "Your $zzz is signed." ;;
19791 echo "(I can't compile the test program--guessing unsigned.)" >&4
19795 : Check 64bit sizes
19798 if $test X"$quadtype" != X; then
19800 echo "Checking how to print 64-bit integers..." >&4
19802 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19803 $cat >try.c <<'EOCP'
19804 #include <sys/types.h>
19807 int q = 12345678901;
19808 printf("%ld\n", q);
19812 if eval $compile; then
19816 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19817 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19818 echo "We will use %d."
19824 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19825 $cat >try.c <<'EOCP'
19826 #include <sys/types.h>
19829 long q = 12345678901;
19830 printf("%ld\n", q);
19834 if eval $compile; then
19838 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19839 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19840 echo "We will use %ld."
19846 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19847 $cat >try.c <<'EOCP'
19848 #include <sys/types.h>
19849 #include <inttypes.h>
19852 int64_t q = 12345678901;
19853 printf("%" PRId64 "\n", q);
19857 if eval $compile; then
19861 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19862 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19863 echo "We will use the C9X style."
19869 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19871 #include <sys/types.h>
19874 $quadtype q = 12345678901;
19875 printf("%Ld\n", q);
19879 if eval $compile; then
19883 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19884 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19885 echo "We will use %Ld."
19891 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19892 $cat >try.c <<'EOCP'
19893 #include <sys/types.h>
19896 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19897 printf("%lld\n", q);
19901 if eval $compile; then
19905 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19906 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19907 echo "We will use the %lld style."
19913 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19915 #include <sys/types.h>
19918 $quadtype q = 12345678901;
19919 printf("%qd\n", q);
19923 if eval $compile; then
19927 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19928 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19929 echo "We will use %qd."
19935 if $test X"$sPRId64" = X; then
19936 echo "Cannot figure out how to print 64-bit integers." >&4
19943 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19944 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19946 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19947 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19951 : Check format strings for internal types
19953 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19955 if $test X"$ivsize" = X8; then
19956 ivdformat="$sPRId64"
19957 uvuformat="$sPRIu64"
19958 uvoformat="$sPRIo64"
19959 uvxformat="$sPRIx64"
19960 uvXUformat="$sPRIXU64"
19962 if $test X"$ivsize" = X"$longsize"; then
19969 if $test X"$ivsize" = X"$intsize"; then
19977 if $test X"$ivsize" = X"$shortsize"; then
19988 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19989 nveformat="$sPRIeldbl"
19990 nvfformat="$sPRIfldbl"
19991 nvgformat="$sPRIgldbl"
19992 nvEUformat="$sPRIEUldbl"
19993 nvFUformat="$sPRIFUldbl"
19994 nvGUformat="$sPRIGUldbl"
20004 case "$ivdformat" in
20005 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
20010 : Check format string for GID
20013 $echo "Checking the format string to be used for gids..." >&4
20016 -1) if $test X"$gidsize" = X"$ivsize"; then
20017 gidformat="$ivdformat"
20019 if $test X"$gidsize" = X"$longsize"; then
20022 if $test X"$gidsize" = X"$intsize"; then
20025 if $test X"$gidsize" = X"$shortsize"; then
20032 *) if $test X"$gidsize" = X"$uvsize"; then
20033 gidformat="$uvuformat"
20035 if $test X"$gidsize" = X"$longsize"; then
20038 if $test X"$gidsize" = X"$intsize"; then
20041 if $test X"$gidsize" = X"$shortsize"; then
20050 : see if getgroups exists
20051 set getgroups d_getgrps
20054 : see if setgroups exists
20055 set setgroups d_setgrps
20058 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
20060 case "$d_getgrps$d_setgrps" in
20062 case "$groupstype" in
20063 '') dflt="$gidtype" ;;
20064 *) dflt="$groupstype" ;;
20067 What type of pointer is the second argument to getgroups() and setgroups()?
20068 Usually this is the same as group ids, $gidtype, but not always.
20071 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20075 *) groupstype="$gidtype";;
20078 : MAD = Misc Attribute Definition
20080 if $test $patchlevel -lt 9; then
20081 : MAD is not available in 5.8.x or earlier.
20085 $define|true|[yY]*) dflt='y' ;;
20090 Would you like to build with Misc Attribute Decoration? This is development
20091 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
20092 overhead on the interpreter.
20094 If this doesn't make any sense to you, just accept the default '$dflt'.
20096 rp='Build Perl with MAD?'
20101 madlyh='madly.h madly.act madly.tab'
20103 madlyobj="madly$_o" ;;
20112 : check whether make sets MAKE
20114 echo "Checking if your $make program sets \$(MAKE)..." >&4
20115 case "$make_set_make" in
20117 $sed 's/^X //' > testmake.mak << 'EOF'
20119 X @echo 'maketemp="$(MAKE)"'
20121 case "`$make -f testmake.mak 2>/dev/null`" in
20122 *maketemp=*) make_set_make='#' ;;
20123 *) make_set_make="MAKE=$make" ;;
20125 $rm -f testmake.mak
20128 case "$make_set_make" in
20129 '#') echo "Yup, it does.";;
20130 *) echo "Nope, it doesn't.";;
20133 : see what type is used for mode_t
20134 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20135 set mode_t modetype int stdio.h sys/types.h
20138 : see if we need va_copy
20140 case "$i_stdarg" in
20143 #include <stdarg.h>
20145 #$i_stdlib I_STDLIB
20147 #include <stdlib.h>
20149 #include <signal.h>
20152 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20154 return vfprintf(f, fmt, *valp);
20158 myvfprintf(FILE *f, const char *fmt, va_list val)
20160 return ivfprintf(f, fmt, &val);
20164 myprintf(char *fmt, ...)
20167 va_start(val, fmt);
20168 return myvfprintf(stdout, fmt, val);
20172 main(int ac, char **av)
20174 signal(SIGSEGV, exit);
20176 myprintf("%s%cs all right, then\n", "that", '\'');
20181 if eval $compile && $run ./try 2>&1 >/dev/null; then
20182 case "`$run ./try`" in
20183 "that's all right, then")
20189 yes) echo "It seems that you don't need va_copy()." >&4
20190 need_va_copy="$undef"
20192 *) echo "It seems that va_copy() or similar will be needed." >&4
20193 need_va_copy="$define"
20198 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20202 : see what type is used for size_t
20203 rp="What is the type used for the length parameter for string functions?"
20204 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20207 : check for type of arguments to gethostbyaddr.
20208 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20209 case "$d_gethbyaddr" in
20213 Checking to see what type of arguments are accepted by gethostbyaddr().
20215 hdrs="$define sys/types.h
20216 $d_socket sys/socket.h
20217 $i_niin netinet/in.h
20219 $i_unistd unistd.h"
20220 : The first arg can 'char *' or 'void *'
20221 : The second arg is some of integral type
20222 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20223 for yyy in size_t long int; do
20224 case "$netdb_host_type" in
20225 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20226 if ./protochk "$try" $hdrs; then
20227 echo "Your system accepts $xxx for the first arg."
20228 echo "...and $yyy for the second arg."
20229 netdb_host_type="$xxx"
20230 netdb_hlen_type="$yyy"
20236 : In case none of those worked, prompt the user.
20237 case "$netdb_host_type" in
20238 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20241 netdb_host_type=$ans
20242 rp='What is the type for the 2nd argument to gethostbyaddr?'
20245 netdb_hlen_type=$ans
20249 *) : no gethostbyaddr, so pick harmless defaults
20250 netdb_host_type='char *'
20251 netdb_hlen_type="$sizetype"
20254 # Remove the "const" if needed. -- but then we'll have a
20256 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20259 : check for type of argument to gethostbyname.
20260 if test "X$netdb_name_type" = X ; then
20261 case "$d_gethbyname" in
20265 Checking to see what type of argument is accepted by gethostbyname().
20267 hdrs="$define sys/types.h
20268 $d_socket sys/socket.h
20269 $i_niin netinet/in.h
20271 $i_unistd unistd.h"
20272 for xxx in "const char *" "char *"; do
20273 case "$netdb_name_type" in
20274 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20275 if ./protochk "$try" $hdrs; then
20276 echo "Your system accepts $xxx."
20277 netdb_name_type="$xxx"
20282 : In case none of those worked, prompt the user.
20283 case "$netdb_name_type" in
20284 '') rp='What is the type for the 1st argument to gethostbyname?'
20287 netdb_name_type=$ans
20291 *) : no gethostbyname, so pick harmless default
20292 netdb_name_type='char *'
20297 : check for type of 1st argument to getnetbyaddr.
20298 if test "X$netdb_net_type" = X ; then
20299 case "$d_getnbyaddr" in
20303 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20305 hdrs="$define sys/types.h
20306 $d_socket sys/socket.h
20307 $i_niin netinet/in.h
20309 $i_unistd unistd.h"
20310 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20311 case "$netdb_net_type" in
20312 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20313 if ./protochk "$try" $hdrs; then
20314 echo "Your system accepts $xxx."
20315 netdb_net_type="$xxx"
20320 : In case none of those worked, prompt the user.
20321 case "$netdb_net_type" in
20322 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20325 netdb_net_type=$ans
20329 *) : no getnetbyaddr, so pick harmless default
20330 netdb_net_type='long'
20334 : locate the preferred pager for this system
20341 [a-zA-Z]:/*) dflt=$pg;;
20345 [a-zA-Z]:/*) dflt=$more;;
20349 [a-zA-Z]:/*) dflt=$less;;
20352 '') dflt=/usr/ucb/more;;
20360 rp='What pager is used on your system?'
20364 : see what type pids are declared as in the kernel
20365 rp="What is the type of process ids on this system?"
20366 set pid_t pidtype int stdio.h sys/types.h
20369 : see if ar generates random libraries by itself
20371 echo "Checking how to generate random libraries on your machine..." >&4
20372 echo 'int bar1() { return bar2(); }' > bar1.c
20373 echo 'int bar2() { return 2; }' > bar2.c
20375 #$i_stdlib I_STDLIB
20377 #include <stdlib.h>
20379 int main() { printf("%d\n", bar1()); exit(0); }
20381 $cc $ccflags -c bar1.c >/dev/null 2>&1
20382 $cc $ccflags -c bar2.c >/dev/null 2>&1
20383 $cc $ccflags -c foo.c >/dev/null 2>&1
20384 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20385 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20386 $run ./foobar >/dev/null 2>&1; then
20387 echo "$ar appears to generate random libraries itself."
20389 if [ "X$ranlib" = "X" ]; then
20392 elif $ar s bar$_a >/dev/null 2>&1 &&
20393 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20394 $run ./foobar >/dev/null 2>&1; then
20395 echo "a table of contents needs to be added with '$ar s'."
20398 elif $ar ts 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 ts'."
20408 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20409 $test -f $ranlib || ranlib=''
20412 if $test -n "$ranlib"; then
20413 echo "your system has '$ranlib'; we'll use that."
20416 echo "your system doesn't seem to support random libraries"
20417 echo "so we'll use lorder and tsort to order the libraries."
20424 : see if this is a values.h system
20425 set values.h i_values
20428 : Check the max offset that gmtime and localtime accept
20429 echo "Checking max offsets that gmtime () accepts"
20432 define) yyy="#include <values.h>" ;;
20436 case "$sGMTIME_min/$sGMTIME_max" in
20439 #include <sys/types.h>
20448 void gm_check (time_t t, int min_year, int max_year)
20451 if ( tmp == NULL ||
20452 /* Check tm_year overflow */
20453 tmp->tm_year < min_year || tmp->tm_year > max_year)
20464 gm_check (MAXLONG, 69, 0x7fffffff);
20466 if (tmp == NULL || tmp->tm_year < 0) {
20467 for (i = 63; i >= 0; i--) {
20468 time_t x = pt | ((time_t)1 << i);
20469 if (x < 0 || x < pt) continue;
20470 gm_check (x, 69, 0x7fffffff);
20473 printf ("sGMTIME_max=%ld\n", pt);
20482 gm_check (MINLONG, -1900, 70);
20485 for (i = 36; i >= 0; i--) {
20486 time_t x = pt - ((time_t)1 << i);
20487 if (x > 0) continue;
20488 gm_check (x, -1900, 70);
20491 printf ("sGMTIME_min=%ld\n", pt);
20495 int main (int argc, char *argv[])
20497 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20504 if eval $compile; then
20507 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20513 echo "Checking max offsets that localtime () accepts"
20515 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20518 #include <sys/types.h>
20527 void local_check (time_t t, int min_year, int max_year)
20529 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20532 tmp = localtime (&t);
20533 if ( tmp == NULL ||
20534 /* Check tm_year overflow */
20535 tmp->tm_year < min_year || tmp->tm_year > max_year)
20539 } /* local_check */
20546 local_check (MAXLONG, 69, 0x7fffffff);
20548 if (tmp == NULL || tmp->tm_year < 0) {
20549 for (i = 63; i >= 0; i--) {
20550 time_t x = pt | ((time_t)1 << i);
20551 if (x < 0 || x < pt) continue;
20552 local_check (x, 69, 0x7fffffff);
20555 printf ("sLOCALTIME_max=%ld\n", pt);
20564 local_check (MINLONG, -1900, 70);
20567 for (i = 36; i >= 0; i--) {
20568 time_t x = pt - ((time_t)1 << i);
20569 if (x > 0) continue;
20570 local_check (x, -1900, 70);
20573 printf ("sLOCALTIME_min=%ld\n", pt);
20577 int main (int argc, char *argv[])
20585 if eval $compile; then
20588 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20594 : check for type of arguments to select.
20595 case "$selecttype" in
20596 '') case "$d_select" in
20600 Checking to see what type of arguments are accepted by select().
20602 hdrs="$define sys/types.h
20603 $i_systime sys/time.h
20604 $i_sysselct sys/select.h
20605 $d_socket sys/socket.h"
20606 : The first arg can be int, unsigned, or size_t
20607 : The last arg may or may not be 'const'
20609 : void pointer has been seen but using that
20610 : breaks the selectminbits test
20611 for xxx in 'fd_set *' 'int *'; do
20612 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20613 for tmo in 'struct timeval *' 'const struct timeval *'; do
20615 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20616 if ./protochk "$try" $hdrs; then
20617 echo "Your system accepts $xxx."
20626 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20627 case "$d_fd_set" in
20628 $define) dflt="fd_set *" ;;
20637 *) : no select, so pick a harmless default
20644 : check for the select 'width'
20645 case "$selectminbits" in
20646 '') safebits=`expr $ptrsize \* 8`
20647 case "$d_select" in
20651 Checking to see on how many bits at a time your select() operates...
20654 #include <sys/types.h>
20656 #$i_systime I_SYS_TIME
20657 #$i_systimek I_SYS_TIME_KERNEL
20662 # ifdef I_SYS_TIME_KERNEL
20665 # include <sys/time.h>
20666 # ifdef I_SYS_TIME_KERNEL
20670 #$i_sysselct I_SYS_SELECT
20671 #ifdef I_SYS_SELECT
20672 #include <sys/select.h>
20674 #$d_socket HAS_SOCKET
20676 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20679 #$i_stdlib I_STDLIB
20681 #include <stdlib.h>
20684 #define S sizeof(*(b))
20686 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20687 #define NBITS (NBYTES * 8)
20689 char *s = (char *)malloc(NBYTES);
20698 fp = fopen("try.c", "r");
20704 b = ($selecttype)s;
20705 for (i = 0; i < NBITS; i++)
20709 select(fd + 1, b, 0, 0, &t);
20710 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20712 printf("%d\n", i + 1);
20717 if eval $compile_ok; then
20718 selectminbits=`$run ./try`
20719 case "$selectminbits" in
20721 Cannot figure out on how many bits at a time your select() operates.
20722 I'll play safe and guess it is $safebits bits.
20724 selectminbits=$safebits
20725 bits="$safebits bits"
20728 *) bits="$selectminbits bits" ;;
20730 echo "Your select() operates on $bits at a time." >&4
20732 rp='What is the minimum number of bits your select() operates on?'
20733 case "$byteorder" in
20734 12345678) dflt=64 ;;
20740 selectminbits="$val"
20744 *) : no select, so pick a harmless default
20745 selectminbits=$safebits
20751 : Trace out the files included by signal.h, then look for SIGxxx names.
20752 if [ "X$fieldn" = X ]; then
20753 : Just make some guesses. We check them later.
20754 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20756 xxx=`echo '#include <signal.h>' |
20757 $cppstdin $cppminus $cppflags 2>/dev/null |
20758 $grep '^[ ]*#.*include' |
20759 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20760 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20763 for xx in $xxx /dev/null ; do
20764 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20766 case "$xxxfiles" in
20767 '') xxxfiles=`./findhdr signal.h` ;;
20770 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20771 print substr($2, 4, 20)
20773 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20774 print substr($3, 4, 20)
20776 : Append some common names just in case the awk scan failed.
20777 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20778 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20779 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20780 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20781 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20783 : generate a few handy files for later
20784 $cat > signal.c <<EOCP
20785 #include <sys/types.h>
20786 #include <signal.h>
20787 #$i_stdlib I_STDLIB
20789 #include <stdlib.h>
20794 /* Strange style to avoid deeply-nested #if/#else/#endif */
20797 # define NSIG (_NSIG)
20803 # define NSIG (SIGMAX+1)
20809 # define NSIG (SIG_MAX+1)
20815 # define NSIG (_SIG_MAX+1)
20821 # define NSIG (MAXSIG+1)
20827 # define NSIG (MAX_SIG+1)
20832 # ifdef SIGARRAYSIZE
20833 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20839 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20843 /* Default to some arbitrary number that's big enough to get most
20844 of the common signals.
20850 printf("NSIG %d\n", NSIG);
20856 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20858 printf "#ifdef SIG"; printf $1; printf "\n"
20859 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20860 printf $1; printf ");\n"
20864 printf "#endif /* JUST_NSIG */\n";
20865 printf "exit(0);\n}\n";
20868 $cat >signal.awk <<'EOP'
20869 BEGIN { ndups = 0 }
20870 $1 ~ /^NSIG$/ { nsig = $2 }
20871 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20872 if ($2 > maxsig) { maxsig = $2 }
20873 if (sig_name[$2]) {
20874 dup_name[ndups] = $1
20875 dup_num[ndups] = $2
20887 printf("NSIG %d\n", nsig);
20888 for (n = 1; n < nsig; n++) {
20890 printf("%s %d\n", sig_name[n], sig_num[n])
20893 printf("NUM%d %d\n", n, n)
20896 for (n = 0; n < ndups; n++) {
20897 printf("%s %d\n", dup_name[n], dup_num[n])
20901 $cat >signal_cmd <<EOS
20903 if $test -s signal.lst; then
20904 echo "Using your existing signal.lst file"
20909 $cat >>signal_cmd <<'EOS'
20912 if eval $compile_ok; then
20913 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20914 $uniq | $awk -f signal.awk >signal.lst
20916 echo "(I can't seem be able to compile the whole test program)" >&4
20917 echo "(I'll try it in little pieces.)" >&4
20918 set signal -DJUST_NSIG
20919 if eval $compile_ok; then
20920 $run ./signal$_exe > signal.nsg
20923 echo "I can't seem to figure out how many signals you have." >&4
20924 echo "Guessing 50." >&4
20925 echo 'NSIG 50' > signal.nsg
20927 : Now look at all the signal names, one at a time.
20928 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20929 $cat > signal.c <<EOCP
20930 #include <sys/types.h>
20931 #include <signal.h>
20934 printf("$xx %d\n", SIG${xx});
20939 if eval $compile; then
20940 echo "SIG${xx} found."
20941 $run ./signal$_exe >> signal.ls1
20943 echo "SIG${xx} NOT found."
20946 if $test -s signal.ls1; then
20947 $cat signal.nsg signal.ls1 |
20948 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20952 if $test -s signal.lst; then
20955 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20956 echo 'kill -l' >signal
20957 set X `csh -f <signal`
20961 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20963 echo $@ | $tr ' ' $trnl | \
20964 $awk '{ printf "%s %d\n", $1, ++s; }
20965 END { printf "NSIG %d\n", ++s }' >signal.lst
20967 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20969 chmod a+x signal_cmd
20970 $eunicefix signal_cmd
20972 : generate list of signal names
20974 case "$sig_name_init" in
20976 *) case "$sig_num_init" in
20977 ''|*,*) doinit=yes ;;
20982 echo "Generating a list of signal names and numbers..." >&4
20984 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20985 sig_name=`$awk 'BEGIN { printf "ZERO " }
20986 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20987 sig_num=`$awk 'BEGIN { printf "0 " }
20988 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20989 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20990 !/^NSIG/ { printf "\"%s\", ", $1 }
20991 END { printf "0\n" }' signal.lst`
20992 sig_num_init=`$awk 'BEGIN { printf "0, " }
20993 !/^NSIG/ { printf "%d, ", $2}
20994 END { printf "0\n"}' signal.lst`
20997 echo "The following $sig_count signals are available:"
20999 echo $sig_name | $awk \
21000 'BEGIN { linelen = 0 }
21002 for (i = 1; i <= NF; i++) {
21003 name = "SIG" $i " "
21004 linelen = linelen + length(name)
21005 if (linelen > 70) {
21007 linelen = length(name)
21013 sig_size=`echo $sig_name | awk '{print NF}'`
21014 $rm -f signal signal.c signal.awk signal.lst signal_cmd
21016 : Check size of size
21018 case "$sizetype" in
21019 *_t) zzz="$sizetype" ;;
21020 *) zzz="filesize" ;;
21022 echo "Checking the size of $zzz..." >&4
21024 #include <sys/types.h>
21026 #$i_stdlib I_STDLIB
21028 #include <stdlib.h>
21031 printf("%d\n", (int)sizeof($sizetype));
21036 if eval $compile_ok; then
21040 echo "(I can't execute the test program--guessing $sizesize.)" >&4
21043 echo "Your $zzz size is $sizesize bytes."
21048 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21052 : check for socklen_t
21054 echo "Checking to see if you have socklen_t..." >&4
21056 #include <sys/types.h>
21057 #$d_socket HAS_SOCKET
21059 #include <sys/socket.h>
21061 int main() { socklen_t x = 16; }
21064 if eval $compile; then
21066 echo "You have socklen_t."
21069 echo "You do not have socklen_t."
21070 case "$sizetype" in
21071 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21078 : see if this is a socks.h system
21079 set socks.h i_socks
21082 : check for type of the size argument to socket calls
21083 case "$d_socket" in
21087 Checking to see what type is the last argument of accept().
21090 case "$d_socklen_t" in
21091 "$define") yyy="$yyy socklen_t"
21093 yyy="$yyy $sizetype int long unsigned"
21094 for xxx in $yyy; do
21095 case "$socksizetype" in
21096 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21097 case "$usesocks" in
21099 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21100 echo "Your system accepts '$xxx *' for the last argument of accept()."
21101 socksizetype="$xxx"
21104 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21105 echo "Your system accepts '$xxx *' for the last argument of accept()."
21106 socksizetype="$xxx"
21113 : In case none of those worked, prompt the user.
21114 case "$socksizetype" in
21115 '') rp='What is the type for socket address structure sizes?'
21122 *) : no sockets, so pick relatively harmless default
21127 : see what type is used for signed size_t
21128 set ssize_t ssizetype int stdio.h sys/types.h
21133 #$i_stdlib I_STDLIB
21135 #include <stdlib.h>
21137 #include <sys/types.h>
21138 #define Size_t $sizetype
21139 #define SSize_t $dflt
21142 if (sizeof(Size_t) == sizeof(SSize_t))
21144 else if (sizeof(Size_t) == sizeof(int))
21153 if eval $compile_ok && $run ./try > /dev/null; then
21154 ssizetype=`$run ./try`
21155 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21158 Help! I can't compile and run the ssize_t test program: please enlighten me!
21159 (This is probably a misconfiguration in your system or libraries, and
21160 you really ought to fix it. Still, I'll try anyway.)
21162 I need a type that is the same size as $sizetype, but is guaranteed to
21163 be signed. Common values are ssize_t, int and long.
21166 rp="What signed type is the same size as $sizetype?"
21172 : see what type of char stdio uses.
21174 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21175 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21176 echo "Your stdio uses unsigned chars." >&4
21177 stdchar="unsigned char"
21179 echo "Your stdio uses signed chars." >&4
21184 : see what type uids are declared as in the kernel
21186 echo "Looking for the type for user ids returned by getuid()."
21187 set uid_t uidtype xxx stdio.h sys/types.h
21191 xxx=`./findhdr sys/user.h`
21192 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21194 unsigned) dflt="$1 $2" ;;
21198 *) dflt="$uidtype";;
21201 uid_t) echo "uid_t found." ;;
21202 *) rp="What is the type for user ids returned by getuid()?"
21208 : Check size of UID
21211 *_t) zzz="$uidtype" ;;
21214 echo "Checking the size of $zzz..." >&4
21216 #include <sys/types.h>
21218 #$i_stdlib I_STDLIB
21220 #include <stdlib.h>
21223 printf("%d\n", (int)sizeof($uidtype));
21228 if eval $compile_ok; then
21232 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21235 echo "Your $zzz is $uidsize bytes long."
21240 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21243 : Check if UID is signed
21246 *_t) zzz="$uidtype" ;;
21249 echo "Checking the sign of $zzz..." >&4
21251 #include <sys/types.h>
21262 if eval $compile; then
21266 echo "(I can't execute the test program--guessing unsigned.)" >&4
21270 1) echo "Your $zzz is unsigned." ;;
21271 -1) echo "Your $zzz is signed." ;;
21277 echo "(I can't compile the test program--guessing unsigned.)" >&4
21281 : Check format string for UID
21283 $echo "Checking the format string to be used for uids..." >&4
21286 -1) if $test X"$uidsize" = X"$ivsize"; then
21287 uidformat="$ivdformat"
21289 if $test X"$uidsize" = X"$longsize"; then
21292 if $test X"$uidsize" = X"$intsize"; then
21295 if $test X"$uidsize" = X"$shortsize"; then
21302 *) if $test X"$uidsize" = X"$uvsize"; then
21303 uidformat="$uvuformat"
21305 if $test X"$uidsize" = X"$longsize"; then
21308 if $test X"$uidsize" = X"$intsize"; then
21311 if $test X"$uidsize" = X"$shortsize"; then
21320 : Check if site customization support was requested
21321 case "$usesitecustomize" in
21322 $define|true|[Yy]*)
21323 usesitecustomize="$define"
21326 usesitecustomize="$undef"
21330 : see if prototypes support variable argument declarations
21332 case "$prototype$i_stdarg" in
21334 echo "It appears we'll be able to prototype varargs functions." >&4
21338 echo "Too bad... We won't be using prototyped varargs functions..." >&4
21345 : determine compiler compiler
21354 if $test -f "$byacc$_exe"; then
21356 comp="byacc or $comp"
21358 if $test -f "$bison$_exe"; then
21359 comp="$comp or bison -y"
21361 rp="Which compiler compiler ($comp) shall I use?"
21370 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
21376 : see if this is a assert.h system
21377 set assert.h i_assert
21380 : see if this is a fp.h system
21384 : see if this is a fp_class.h system
21385 set fp_class.h i_fp_class
21388 : see if gdbm.h is available
21393 : see if gdbm_open exists
21394 set gdbm_open d_gdbm_open
21396 case "$d_gdbm_open" in
21399 echo "We won't be including <gdbm.h>"
21408 : see if this is a ieeefp.h system
21409 case "$i_ieeefp" in
21410 '' ) set ieeefp.h i_ieeefp
21415 : see if this is a libutil.h system
21416 set libutil.h i_libutil
21419 : see if mach cthreads are available
21420 if test "X$usethreads" = "X$define"; then
21421 set mach/cthreads.h i_machcthr
21424 i_machcthr="$undef"
21427 : see if this is a mntent.h system
21428 set mntent.h i_mntent
21431 : see if net/errno.h is available
21433 set net/errno.h val
21436 : Unfortunately, it causes problems on some systems. Arrgh.
21439 cat > try.c <<'EOM'
21442 #include <net/errno.h>
21448 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21449 echo "We'll be including <net/errno.h>." >&4
21451 echo "We won't be including <net/errno.h>." >&4
21460 : see if netinet/tcp.h is available
21461 set netinet/tcp.h i_netinettcp
21464 : see if this is a poll.h system
21468 : see if this is a prot.h system
21472 : Preprocessor symbols
21474 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21475 $cat <<'EOSH' > Cppsym.know
21476 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21477 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21478 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21479 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21480 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21481 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21482 bull c cadmus clipper CMU COFF COMPILER_VERSION
21483 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21484 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21485 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21486 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21488 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21489 H3050R H3050RX hbullx20 hcx host_mips
21490 hp200 hp300 hp700 HP700 hp800 hp9000
21491 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21492 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21493 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21494 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21495 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21496 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21497 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21498 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21499 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21500 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21501 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21502 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21503 MATH_HAS_NO_SIDE_EFFECTS
21504 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21505 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21506 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21507 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21508 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21509 NetBSD news1500 news1700 news1800 news1900 news3700
21510 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21511 ns32016 ns32332 ns32k nsc32000
21512 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21513 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21514 pc532 pdp11 PGC PIC plexus PORTAR posix
21515 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21516 POSIX_C_SOURCE POSIX_SOURCE POWER
21517 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21518 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21519 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21520 sony sony_news sonyrisc sparc sparclite spectrum
21521 stardent stdc STDC_EXT stratos sun sun3 sun386
21522 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21523 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21524 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21525 sysV68 sysV88 Tek4132 Tek4300 titan
21526 TM3200 TM5400 TM5600
21527 tower tower32 tower32_200 tower32_600 tower32_700
21528 tower32_800 tower32_850 tss
21529 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21530 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21531 unix UNIX95 UNIX99 unixpc unos
21532 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21533 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21534 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21536 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21537 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21538 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21541 # Maybe put other stuff here too.
21542 cat <<EOSH >>Cppsym.know
21545 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21546 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21547 $cat Cppsym.know > Cppsym.c
21548 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21549 $rm -f Cppsym.a Cppsym.b Cppsym.c
21550 cat <<EOSH > Cppsym
21552 if $test \$# -gt 0; then
21553 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21554 if $test -s Cppsym.got; then
21561 $tr " " "$trnl" | ./Cppsym.try
21567 cat <<EOSH > Cppsym.try
21569 cat <<'EOCP' > try.c
21572 #define STRINGIFY(a) "a"
21574 #if cpp_stuff == 42
21575 #define StGiFy(a) #a
21576 #define STRINGIFY(a) StGiFy(a)
21578 #if $cpp_stuff != 1 && $cpp_stuff != 42
21579 # include "Bletch: How does this C preprocessor stringify macros?"
21585 cat <<'EOSH' >> Cppsym.try
21587 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21588 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21589 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21590 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21592 echo 'return 0;}' >> try.c
21594 cat <<EOSH >> Cppsym.try
21596 case "$osname-$gccversion" in
21597 irix-) ccflags="\$ccflags -woff 1178" ;;
21598 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21600 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21602 chmod +x Cppsym.try
21603 $eunicefix Cppsym.try
21604 ./Cppsym < Cppsym.know > Cppsym.true
21605 : Add in any linux cpp "predefined macros":
21606 case "$osname::$gccversion" in
21607 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
21609 rm -f $tHdrH'.h' $tHdrH
21611 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21612 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21613 if [ -s $tHdrH'_cppsym.real' ]; then
21614 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21617 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21620 : now check the C compiler for additional symbols
21621 postprocess_cc_v=''
21623 aix) postprocess_cc_v="|$tr , ' '" ;;
21630 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21633 -D*) echo "\$i" | $sed 's/^-D//';;
21634 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21639 postprocess_cc_v=''
21642 ./ccsym > ccsym1.raw
21643 if $test -s ccsym1.raw; then
21644 $sort ccsym1.raw | $uniq >ccsym.raw
21646 mv ccsym1.raw ccsym.raw
21649 $awk '/\=/ { print $0; next }
21650 { print $0"=1" }' ccsym.raw >ccsym.list
21651 $comm -13 Cppsym.true ccsym.list >ccsym.own
21652 $comm -12 Cppsym.true ccsym.list >ccsym.com
21653 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21655 if $test -z ccsym.raw; then
21656 echo "Your C compiler doesn't seem to define any symbols!" >&4
21658 echo "However, your C preprocessor defines the following symbols:"
21661 cppsymbols=`$cat Cppsym.true`
21662 cppsymbols=`echo $cppsymbols`
21663 cppccsymbols="$cppsymbols"
21665 if $test -s ccsym.com; then
21666 echo "Your C compiler and pre-processor define these symbols:"
21667 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
21670 cppccsymbols=`$cat ccsym.com`
21671 cppccsymbols=`echo $cppccsymbols`
21672 $test "$silent" || sleep 1
21674 if $test -s ccsym.cpp; then
21675 $test "$also" && echo " "
21676 echo "Your C pre-processor ${also}defines the following symbols:"
21677 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
21679 cppsymbols=`$cat ccsym.cpp`
21680 cppsymbols=`echo $cppsymbols`
21681 $test "$silent" || sleep 1
21683 if $test -s ccsym.own; then
21684 $test "$also" && echo " "
21685 echo "Your C compiler ${also}defines the following cpp symbols:"
21686 $sed -e 's/\(..*\)=1/\1/' ccsym.own
21687 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
21688 ccsymbols=`$cat ccsym.own`
21689 ccsymbols=`echo $ccsymbols`
21690 $test "$silent" || sleep 1
21694 : see if this is a termio system
21698 if $test `./findhdr termios.h`; then
21699 set tcsetattr i_termios
21705 "$define") echo "You have POSIX termios.h... good!" >&4;;
21706 *) if ./Cppsym pyr; then
21707 case "`/bin/universe`" in
21708 ucb) if $test `./findhdr sgtty.h`; then
21710 echo "<sgtty.h> found." >&4
21712 echo "System is pyramid with BSD universe."
21713 ./warn "<sgtty.h> not found--you could have problems."
21715 *) if $test `./findhdr termio.h`; then
21717 echo "<termio.h> found." >&4
21719 echo "System is pyramid with USG universe."
21720 ./warn "<termio.h> not found--you could have problems."
21724 if $test `./findhdr termio.h`; then
21725 echo "<termio.h> found." >&4
21727 elif $test `./findhdr sgtty.h`; then
21728 echo "<sgtty.h> found." >&4
21731 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
21734 if $test `./findhdr sgtty.h`; then
21735 echo "<sgtty.h> found." >&4
21737 elif $test `./findhdr termio.h`; then
21738 echo "<termio.h> found." >&4
21741 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
21745 set i_termio; eval $setvar
21746 val=$val2; set i_sgtty; eval $setvar
21747 val=$val3; set i_termios; eval $setvar
21749 : see if stddef is available
21750 set stddef.h i_stddef
21753 : see if sys/access.h is available
21754 set sys/access.h i_sysaccess
21757 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
21758 set sys/filio.h i_sysfilio
21761 if $test `./findhdr sys/ioctl.h`; then
21763 echo '<sys/ioctl.h> found.' >&4
21766 if $test $i_sysfilio = "$define"; then
21767 echo '<sys/ioctl.h> NOT found.' >&4
21769 $test $i_sgtty = "$define" && xxx="sgtty.h"
21770 $test $i_termio = "$define" && xxx="termio.h"
21771 $test $i_termios = "$define" && xxx="termios.h"
21772 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
21778 : see if socket ioctl defs are in sys/sockio.h
21780 xxx=`./findhdr sys/sockio.h`
21781 if $test "$xxx"; then
21782 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
21784 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
21787 echo "No socket ioctls found in <sys/sockio.h>." >&4
21792 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
21798 : see if this is a syslog.h system
21799 set syslog.h i_syslog
21802 : see if this is a sys/mode.h system
21803 set sys/mode.h i_sysmode
21806 : see if there is a sys/poll.h file
21807 set sys/poll.h i_syspoll
21810 : see if sys/resource.h has to be included
21811 set sys/resource.h i_sysresrc
21814 : see if sys/security.h is available
21815 set sys/security.h i_syssecrt
21818 : see if this is a sys/statvfs.h system
21819 set sys/statvfs.h i_sysstatvfs
21822 : see if this is a sys/un.h system
21823 set sys/un.h i_sysun
21826 : see if this is a sys/utsname.h system
21827 set sys/utsname.h i_sysutsname
21830 : see if this is a syswait system
21831 set sys/wait.h i_syswait
21834 : see if this is a ustat.h system
21835 set ustat.h i_ustat
21838 : see if this is an utime system
21839 set utime.h i_utime
21842 : see if this is a vfork system
21845 set vfork.h i_vfork
21855 echo "Looking for extensions..." >&4
21856 : If we are using the old config.sh, known_extensions may contain
21857 : old or inaccurate or duplicate values.
21858 known_extensions=''
21859 nonxs_extensions=''
21860 : We do not use find because it might not be available.
21861 : We do not just use MANIFEST because the user may have dropped
21862 : some additional extensions into the source tree and expect them
21865 : Function to recursively find available extensions, ignoring DynaLoader
21866 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21867 : In 5.10.1 and later, extensions are stored in directories
21868 : like File-Glob instead of the older File/Glob/.
21872 DynaLoader|dynaload) ;;
21874 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
21875 leaf=`echo $xxx | $sed -e s/.*-//`;
21876 if $test -d File; then
21877 if $test -f $xxx/$leaf.xs -o -f $xxx/$leaf.c; then
21878 known_extensions="$known_extensions $1$this_ext";
21879 elif $test -f $xxx/Makefile.PL; then
21880 nonxs_extensions="$nonxs_extensions $1$this_ext";
21882 if $test -d $xxx -a $# -lt 10; then
21885 eval $find_extensions;
21891 $ls -1 $xxx > $$.tmp;
21892 if $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
21893 known_extensions="$known_extensions $this_ext";
21894 elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then
21895 known_extensions="$known_extensions $this_ext";
21896 elif $test -d $xxx; then
21897 nonxs_extensions="$nonxs_extensions $this_ext";
21908 eval $find_extensions
21912 eval $find_extensions
21916 eval $find_extensions
21917 if $test -d File-Glob; then
21918 : All ext/ flattened
21920 # Special case: Add in modules that nest beyond the first level.
21921 # Currently threads/shared and Hash/Util/FieldHash, since they are
21922 # not picked up by the recursive find above (and adding in general
21923 # recursive finding breaks SDBM_File/sdbm).
21924 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
21925 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
21927 set X $known_extensions
21929 known_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
21930 set X $nonxs_extensions
21932 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
21935 : Now see which are supported on this system.
21937 for xxx in $known_extensions ; do
21941 $define) avail_ext="$avail_ext $xxx" ;;
21944 GDBM_File|gdbm_fil)
21946 $define) avail_ext="$avail_ext $xxx" ;;
21949 I18N/Langinfo|i18n_lan)
21950 case "$i_langinfo$d_nl_langinfo" in
21951 $define$define) avail_ext="$avail_ext $xxx" ;;
21955 : XXX Do we need a useipcsysv variable here
21956 case "${d_msg}${d_sem}${d_shm}" in
21957 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21960 NDBM_File|ndbm_fil)
21963 case "$osname-$use64bitint" in
21966 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21969 *) avail_ext="$avail_ext $xxx" ;;
21974 ODBM_File|odbm_fil)
21975 case "${i_dbm}${i_rpcsvcdbm}" in
21977 case "$d_cplusplus" in
21978 define) ;; # delete as a function name will not work
21979 *) case "$osname-$use64bitint" in
21982 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21985 *) avail_ext="$avail_ext $xxx" ;;
21993 case "$useopcode" in
21994 true|define|y) avail_ext="$avail_ext $xxx" ;;
21998 case "$useposix" in
21999 true|define|y) avail_ext="$avail_ext $xxx" ;;
22003 case "$d_socket" in
22006 beos) ;; # not unless BONE
22007 *) avail_ext="$avail_ext $xxx" ;;
22012 Sys/Syslog|sys/syslog)
22013 : XXX syslog requires socket
22014 case "$d_socket" in
22015 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22019 case "$usethreads" in
22021 case "$use5005threads" in
22022 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
22026 threads|threads/shared)
22027 # threads and threads::shared are special cases.
22028 # To stop people from asking "Perl 5.8.0 was supposed
22029 # to have this new fancy threads implementation but my
22030 # perl doesn't have it" and from people trying to
22031 # (re)install the threads module using CPAN.pm and
22032 # CPAN.pm then offering to reinstall Perl 5.8.0,
22033 # the threads.pm and threads/shared.pm will always be
22034 # there, croaking informatively ("you need to rebuild
22035 # all of Perl with threads, sorry") when threads haven't
22036 # been compiled in.
22038 avail_ext="$avail_ext $xxx"
22044 cygwin) avail_ext="$avail_ext $xxx" ;;
22047 XS/APItest|xs/apitest)
22048 # This is just for testing. Skip it unless we have dynamic loading.
22051 $define) avail_ext="$avail_ext $xxx" ;;
22054 XS/APItest/KeywordRPN|xs/apitest/keywordrpn)
22055 # This is just for testing. Skip it unless we have dynamic loading.
22058 $define) avail_ext="$avail_ext $xxx" ;;
22061 XS/Typemap|xs/typemap)
22062 # This is just for testing. Skip it unless we have dynamic loading.
22064 $define) avail_ext="$avail_ext $xxx" ;;
22067 *) avail_ext="$avail_ext $xxx"
22076 case "$onlyextensions" in
22078 *) keepextensions=''
22079 echo "You have requested that only certains extensions be included..." >&4
22080 for i in $onlyextensions; do
22081 case " $avail_ext " in
22083 echo "Keeping extension $i."
22084 keepextensions="$keepextensions $i"
22086 *) echo "Ignoring extension $i." ;;
22089 avail_ext="$keepextensions"
22093 case "$noextensions" in
22095 *) keepextensions=''
22096 echo "You have requested that certain extensions be ignored..." >&4
22097 for i in $avail_ext; do
22098 case " $noextensions " in
22099 *" $i "*) echo "Ignoring extension $i." ;;
22100 *) echo "Keeping extension $i.";
22101 keepextensions="$keepextensions $i"
22105 avail_ext="$keepextensions"
22109 : Now see which nonxs extensions are supported on this system.
22110 : For now assume all are.
22112 for xxx in $nonxs_extensions ; do
22114 *) nonxs_ext="$nonxs_ext $xxx"
22126 A number of extensions are supplied with $package. You may choose to
22127 compile these extensions for dynamic loading (the default), compile
22128 them into the $package executable (static loading), or not include
22129 them at all. Answer "none" to include no extensions.
22130 Note that DynaLoader is always built and need not be mentioned here.
22133 case "$dynamic_ext" in
22135 : Exclude those listed in static_ext
22137 for xxx in $avail_ext; do
22138 case " $static_ext " in
22140 *) dflt="$dflt $xxx" ;;
22147 *) dflt="$dynamic_ext"
22148 # Perhaps we are reusing an old out-of-date config.sh.
22151 if test X"$dynamic_ext" != X"$avail_ext"; then
22153 NOTICE: Your previous config.sh list may be incorrect.
22154 The extensions now available to you are
22156 but the default list from your previous config.sh is
22168 rp="What extensions do you wish to load dynamically?"
22171 none) dynamic_ext=' ' ;;
22172 *) dynamic_ext="$ans" ;;
22175 case "$static_ext" in
22177 : Exclude those already listed in dynamic linking
22179 for xxx in $avail_ext; do
22180 case " $dynamic_ext " in
22182 *) dflt="$dflt $xxx" ;;
22189 *) dflt="$static_ext"
22196 rp="What extensions do you wish to load statically?"
22199 none) static_ext=' ' ;;
22200 *) static_ext="$ans" ;;
22205 A number of extensions are supplied with $package. Answer "none"
22206 to include no extensions.
22207 Note that DynaLoader is always built and need not be mentioned here.
22210 case "$static_ext" in
22211 '') dflt="$avail_ext" ;;
22212 *) dflt="$static_ext"
22213 # Perhaps we are reusing an old out-of-date config.sh.
22216 if test X"$static_ext" != X"$avail_ext"; then
22218 NOTICE: Your previous config.sh list may be incorrect.
22219 The extensions now available to you are
22221 but the default list from your previous config.sh is
22230 : Exclude those that are not xs extensions
22234 rp="What extensions do you wish to include?"
22237 none) static_ext=' ' ;;
22238 *) static_ext="$ans" ;;
22243 # Encode is a special case. If we are building Encode as a static
22244 # extension, we need to explicitly list its subextensions as well.
22245 # For other nested extensions, this is handled automatically by
22246 # the appropriate Makefile.PL.
22247 case " $static_ext " in
22248 *" Encode "*) # Add the subextensions of Encode
22250 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22251 static_ext="$static_ext Encode/$xxx"
22257 set X $dynamic_ext $static_ext $nonxs_ext
22261 # Sanity check: We require an extension suitable for use with
22262 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22263 # should show up as failures in the test suite, but it's helpful to
22264 # catch them now.) The 'extensions' list is normally sorted
22265 # alphabetically, so we need to accept either
22266 # DB_File ... Fcntl ... IO ....
22267 # or something like
22268 # Fcntl ... NDBM_File ... IO ....
22269 case " $extensions" in
22270 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22271 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22272 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22273 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22274 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22278 : Remove libraries needed only for extensions
22279 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22280 : The exception is SunOS 4.x, which needs them.
22281 case "${osname}X${osvers}" in
22285 *) case "$usedl" in
22286 $define|true|[yY]*)
22287 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22291 *) perllibs="$libs"
22297 : Remove build directory name from cppstdin so it can be used from
22298 : either the present location or the final installed location.
22300 : Get out of the UU directory to get correct path name.
22302 case "$cppstdin" in
22304 echo "Stripping down cppstdin path name"
22310 : end of configuration questions
22312 echo "End of configuration questions."
22315 : back to where it started
22316 if test -d ../UU; then
22320 : configuration may be unconditionally patched via a 'config.arch' file
22321 if $test -f config.arch; then
22322 echo "I see a config.arch file, loading it." >&4
22326 : configuration may be patched via a 'config.over' file
22327 if $test -f config.over; then
22330 rp='I see a config.over file. Do you wish to load it?'
22333 n*) echo "OK, I'll ignore it.";;
22335 echo "Configuration override changes have been loaded."
22340 : in case they want portability, strip down executable paths
22341 case "$d_portable" in
22344 echo "Stripping down executable paths..." >&4
22345 for file in $loclist $trylist; do
22347 eval $file=`basename $temp`
22352 : create config.sh file
22354 echo "Creating config.sh..." >&4
22355 $spitshell <<EOT >config.sh
22358 # This file was produced by running the Configure script. It holds all the
22359 # definitions figured out by Configure. Should you modify one of these values,
22360 # do not forget to propagate your changes by running "Configure -der". You may
22361 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22364 # Package name : $package
22365 # Source directory : $src
22366 # Configuration time: $cf_time
22367 # Configured by : $cf_by
22368 # Target system : $myuname
22371 : Add in command line options if available
22372 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22374 $spitshell <<EOT >>config.sh
22383 Revision='$Revision'
22391 alignbytes='$alignbytes'
22392 ansi2knr='$ansi2knr'
22393 aphostname='$aphostname'
22394 api_revision='$api_revision'
22395 api_subversion='$api_subversion'
22396 api_version='$api_version'
22397 api_versionstring='$api_versionstring'
22400 archlibexp='$archlibexp'
22401 archname64='$archname64'
22402 archname='$archname'
22403 archobjs='$archobjs'
22404 asctime_r_proto='$asctime_r_proto'
22413 byteorder='$byteorder'
22415 castflags='$castflags'
22418 cccdlflags='$cccdlflags'
22419 ccdlflags='$ccdlflags'
22421 ccflags_uselargefiles='$ccflags_uselargefiles'
22423 ccsymbols='$ccsymbols'
22424 ccversion='$ccversion'
22426 cf_email='$cf_email'
22428 charbits='$charbits'
22429 charsize='$charsize'
22433 clocktype='$clocktype'
22435 compress='$compress'
22436 contains='$contains'
22440 cpp_stuff='$cpp_stuff'
22441 cppccsymbols='$cppccsymbols'
22442 cppflags='$cppflags'
22444 cppminus='$cppminus'
22446 cppstdin='$cppstdin'
22447 cppsymbols='$cppsymbols'
22448 crypt_r_proto='$crypt_r_proto'
22449 cryptlib='$cryptlib'
22451 ctermid_r_proto='$ctermid_r_proto'
22452 ctime_r_proto='$ctime_r_proto'
22453 d_Gconvert='$d_Gconvert'
22454 d_PRIEUldbl='$d_PRIEUldbl'
22455 d_PRIFUldbl='$d_PRIFUldbl'
22456 d_PRIGUldbl='$d_PRIGUldbl'
22457 d_PRIXU64='$d_PRIXU64'
22458 d_PRId64='$d_PRId64'
22459 d_PRIeldbl='$d_PRIeldbl'
22460 d_PRIfldbl='$d_PRIfldbl'
22461 d_PRIgldbl='$d_PRIgldbl'
22462 d_PRIi64='$d_PRIi64'
22463 d_PRIo64='$d_PRIo64'
22464 d_PRIu64='$d_PRIu64'
22465 d_PRIx64='$d_PRIx64'
22466 d_SCNfldbl='$d_SCNfldbl'
22467 d__fwalk='$d__fwalk'
22468 d_access='$d_access'
22469 d_accessx='$d_accessx'
22472 d_archlib='$d_archlib'
22473 d_asctime64='$d_asctime64'
22474 d_asctime_r='$d_asctime_r'
22477 d_attribute_deprecated='$d_attribute_deprecated'
22478 d_attribute_format='$d_attribute_format'
22479 d_attribute_malloc='$d_attribute_malloc'
22480 d_attribute_nonnull='$d_attribute_nonnull'
22481 d_attribute_noreturn='$d_attribute_noreturn'
22482 d_attribute_pure='$d_attribute_pure'
22483 d_attribute_unused='$d_attribute_unused'
22484 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22488 d_bsdgetpgrp='$d_bsdgetpgrp'
22489 d_bsdsetpgrp='$d_bsdsetpgrp'
22490 d_builtin_choose_expr='$d_builtin_choose_expr'
22491 d_builtin_expect='$d_builtin_expect'
22493 d_c99_variadic_macros='$d_c99_variadic_macros'
22494 d_casti32='$d_casti32'
22495 d_castneg='$d_castneg'
22496 d_charvspr='$d_charvspr'
22498 d_chroot='$d_chroot'
22499 d_chsize='$d_chsize'
22501 d_clearenv='$d_clearenv'
22502 d_closedir='$d_closedir'
22503 d_cmsghdr_s='$d_cmsghdr_s'
22505 d_copysignl='$d_copysignl'
22506 d_cplusplus='$d_cplusplus'
22508 d_crypt_r='$d_crypt_r'
22510 d_ctermid='$d_ctermid'
22511 d_ctermid_r='$d_ctermid_r'
22512 d_ctime64='$d_ctime64'
22513 d_ctime_r='$d_ctime_r'
22514 d_cuserid='$d_cuserid'
22515 d_dbl_dig='$d_dbl_dig'
22516 d_dbminitproto='$d_dbminitproto'
22517 d_difftime64='$d_difftime64'
22518 d_difftime='$d_difftime'
22519 d_dir_dd_fd='$d_dir_dd_fd'
22521 d_dirnamlen='$d_dirnamlen'
22522 d_dlerror='$d_dlerror'
22523 d_dlopen='$d_dlopen'
22524 d_dlsymun='$d_dlsymun'
22525 d_dosuid='$d_dosuid'
22526 d_drand48_r='$d_drand48_r'
22527 d_drand48proto='$d_drand48proto'
22529 d_eaccess='$d_eaccess'
22530 d_endgrent='$d_endgrent'
22531 d_endgrent_r='$d_endgrent_r'
22532 d_endhent='$d_endhent'
22533 d_endhostent_r='$d_endhostent_r'
22534 d_endnent='$d_endnent'
22535 d_endnetent_r='$d_endnetent_r'
22536 d_endpent='$d_endpent'
22537 d_endprotoent_r='$d_endprotoent_r'
22538 d_endpwent='$d_endpwent'
22539 d_endpwent_r='$d_endpwent_r'
22540 d_endsent='$d_endsent'
22541 d_endservent_r='$d_endservent_r'
22542 d_eofnblk='$d_eofnblk'
22543 d_eunice='$d_eunice'
22544 d_faststdio='$d_faststdio'
22545 d_fchdir='$d_fchdir'
22546 d_fchmod='$d_fchmod'
22547 d_fchown='$d_fchown'
22549 d_fcntl_can_lock='$d_fcntl_can_lock'
22550 d_fd_macros='$d_fd_macros'
22551 d_fd_set='$d_fd_set'
22552 d_fds_bits='$d_fds_bits'
22553 d_fgetpos='$d_fgetpos'
22554 d_finite='$d_finite'
22555 d_finitel='$d_finitel'
22556 d_flexfnam='$d_flexfnam'
22558 d_flockproto='$d_flockproto'
22560 d_fp_class='$d_fp_class'
22561 d_fpathconf='$d_fpathconf'
22562 d_fpclass='$d_fpclass'
22563 d_fpclassify='$d_fpclassify'
22564 d_fpclassl='$d_fpclassl'
22565 d_fpos64_t='$d_fpos64_t'
22566 d_frexpl='$d_frexpl'
22567 d_fs_data_s='$d_fs_data_s'
22568 d_fseeko='$d_fseeko'
22569 d_fsetpos='$d_fsetpos'
22570 d_fstatfs='$d_fstatfs'
22571 d_fstatvfs='$d_fstatvfs'
22573 d_ftello='$d_ftello'
22575 d_futimes='$d_futimes'
22576 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
22577 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
22578 d_getaddrinfo='$d_getaddrinfo'
22579 d_getcwd='$d_getcwd'
22580 d_getespwnam='$d_getespwnam'
22581 d_getfsstat='$d_getfsstat'
22582 d_getgrent='$d_getgrent'
22583 d_getgrent_r='$d_getgrent_r'
22584 d_getgrgid_r='$d_getgrgid_r'
22585 d_getgrnam_r='$d_getgrnam_r'
22586 d_getgrps='$d_getgrps'
22587 d_gethbyaddr='$d_gethbyaddr'
22588 d_gethbyname='$d_gethbyname'
22589 d_gethent='$d_gethent'
22590 d_gethname='$d_gethname'
22591 d_gethostbyaddr_r='$d_gethostbyaddr_r'
22592 d_gethostbyname_r='$d_gethostbyname_r'
22593 d_gethostent_r='$d_gethostent_r'
22594 d_gethostprotos='$d_gethostprotos'
22595 d_getitimer='$d_getitimer'
22596 d_getlogin='$d_getlogin'
22597 d_getlogin_r='$d_getlogin_r'
22598 d_getmnt='$d_getmnt'
22599 d_getmntent='$d_getmntent'
22600 d_getnameinfo='$d_getnameinfo'
22601 d_getnbyaddr='$d_getnbyaddr'
22602 d_getnbyname='$d_getnbyname'
22603 d_getnent='$d_getnent'
22604 d_getnetbyaddr_r='$d_getnetbyaddr_r'
22605 d_getnetbyname_r='$d_getnetbyname_r'
22606 d_getnetent_r='$d_getnetent_r'
22607 d_getnetprotos='$d_getnetprotos'
22608 d_getpagsz='$d_getpagsz'
22609 d_getpbyname='$d_getpbyname'
22610 d_getpbynumber='$d_getpbynumber'
22611 d_getpent='$d_getpent'
22612 d_getpgid='$d_getpgid'
22613 d_getpgrp2='$d_getpgrp2'
22614 d_getpgrp='$d_getpgrp'
22615 d_getppid='$d_getppid'
22616 d_getprior='$d_getprior'
22617 d_getprotobyname_r='$d_getprotobyname_r'
22618 d_getprotobynumber_r='$d_getprotobynumber_r'
22619 d_getprotoent_r='$d_getprotoent_r'
22620 d_getprotoprotos='$d_getprotoprotos'
22621 d_getprpwnam='$d_getprpwnam'
22622 d_getpwent='$d_getpwent'
22623 d_getpwent_r='$d_getpwent_r'
22624 d_getpwnam_r='$d_getpwnam_r'
22625 d_getpwuid_r='$d_getpwuid_r'
22626 d_getsbyname='$d_getsbyname'
22627 d_getsbyport='$d_getsbyport'
22628 d_getsent='$d_getsent'
22629 d_getservbyname_r='$d_getservbyname_r'
22630 d_getservbyport_r='$d_getservbyport_r'
22631 d_getservent_r='$d_getservent_r'
22632 d_getservprotos='$d_getservprotos'
22633 d_getspnam='$d_getspnam'
22634 d_getspnam_r='$d_getspnam_r'
22635 d_gettimeod='$d_gettimeod'
22636 d_gmtime64='$d_gmtime64'
22637 d_gmtime_r='$d_gmtime_r'
22638 d_gnulibc='$d_gnulibc'
22639 d_grpasswd='$d_grpasswd'
22640 d_hasmntopt='$d_hasmntopt'
22642 d_ilogbl='$d_ilogbl'
22643 d_inc_version_list='$d_inc_version_list'
22645 d_inetaton='$d_inetaton'
22646 d_inetntop='$d_inetntop'
22647 d_inetpton='$d_inetpton'
22648 d_int64_t='$d_int64_t'
22649 d_isascii='$d_isascii'
22650 d_isfinite='$d_isfinite'
22653 d_isnanl='$d_isnanl'
22654 d_killpg='$d_killpg'
22655 d_lchown='$d_lchown'
22656 d_ldbl_dig='$d_ldbl_dig'
22657 d_libm_lib_version='$d_libm_lib_version'
22659 d_localtime64='$d_localtime64'
22660 d_localtime_r='$d_localtime_r'
22661 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
22662 d_locconv='$d_locconv'
22664 d_longdbl='$d_longdbl'
22665 d_longlong='$d_longlong'
22666 d_lseekproto='$d_lseekproto'
22668 d_madvise='$d_madvise'
22669 d_malloc_good_size='$d_malloc_good_size'
22670 d_malloc_size='$d_malloc_size'
22672 d_mbstowcs='$d_mbstowcs'
22673 d_mbtowc='$d_mbtowc'
22674 d_memchr='$d_memchr'
22675 d_memcmp='$d_memcmp'
22676 d_memcpy='$d_memcpy'
22677 d_memmove='$d_memmove'
22678 d_memset='$d_memset'
22680 d_mkdtemp='$d_mkdtemp'
22681 d_mkfifo='$d_mkfifo'
22682 d_mkstemp='$d_mkstemp'
22683 d_mkstemps='$d_mkstemps'
22684 d_mktime64='$d_mktime64'
22685 d_mktime='$d_mktime'
22688 d_modfl_pow32_bug='$d_modfl_pow32_bug'
22689 d_modflproto='$d_modflproto'
22690 d_mprotect='$d_mprotect'
22692 d_msg_ctrunc='$d_msg_ctrunc'
22693 d_msg_dontroute='$d_msg_dontroute'
22694 d_msg_oob='$d_msg_oob'
22695 d_msg_peek='$d_msg_peek'
22696 d_msg_proxy='$d_msg_proxy'
22697 d_msgctl='$d_msgctl'
22698 d_msgget='$d_msgget'
22699 d_msghdr_s='$d_msghdr_s'
22700 d_msgrcv='$d_msgrcv'
22701 d_msgsnd='$d_msgsnd'
22703 d_munmap='$d_munmap'
22704 d_mymalloc='$d_mymalloc'
22706 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
22708 d_nl_langinfo='$d_nl_langinfo'
22709 d_nv_preserves_uv='$d_nv_preserves_uv'
22710 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
22711 d_off64_t='$d_off64_t'
22712 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
22713 d_oldpthreads='$d_oldpthreads'
22714 d_oldsock='$d_oldsock'
22716 d_pathconf='$d_pathconf'
22718 d_perl_otherlibdirs='$d_perl_otherlibdirs'
22719 d_phostname='$d_phostname'
22722 d_portable='$d_portable'
22724 d_prctl_set_name='$d_prctl_set_name'
22725 d_printf_format_null='$d_printf_format_null'
22726 d_procselfexe='$d_procselfexe'
22727 d_pseudofork='$d_pseudofork'
22728 d_pthread_atfork='$d_pthread_atfork'
22729 d_pthread_attr_setscope='$d_pthread_attr_setscope'
22730 d_pthread_yield='$d_pthread_yield'
22732 d_pwchange='$d_pwchange'
22733 d_pwclass='$d_pwclass'
22734 d_pwcomment='$d_pwcomment'
22735 d_pwexpire='$d_pwexpire'
22736 d_pwgecos='$d_pwgecos'
22737 d_pwpasswd='$d_pwpasswd'
22738 d_pwquota='$d_pwquota'
22741 d_random_r='$d_random_r'
22742 d_readdir64_r='$d_readdir64_r'
22743 d_readdir='$d_readdir'
22744 d_readdir_r='$d_readdir_r'
22745 d_readlink='$d_readlink'
22747 d_recvmsg='$d_recvmsg'
22748 d_rename='$d_rename'
22749 d_rewinddir='$d_rewinddir'
22751 d_safebcpy='$d_safebcpy'
22752 d_safemcpy='$d_safemcpy'
22753 d_sanemcmp='$d_sanemcmp'
22754 d_sbrkproto='$d_sbrkproto'
22755 d_scalbnl='$d_scalbnl'
22756 d_sched_yield='$d_sched_yield'
22757 d_scm_rights='$d_scm_rights'
22758 d_seekdir='$d_seekdir'
22759 d_select='$d_select'
22761 d_semctl='$d_semctl'
22762 d_semctl_semid_ds='$d_semctl_semid_ds'
22763 d_semctl_semun='$d_semctl_semun'
22764 d_semget='$d_semget'
22766 d_sendmsg='$d_sendmsg'
22767 d_setegid='$d_setegid'
22768 d_seteuid='$d_seteuid'
22769 d_setgrent='$d_setgrent'
22770 d_setgrent_r='$d_setgrent_r'
22771 d_setgrps='$d_setgrps'
22772 d_sethent='$d_sethent'
22773 d_sethostent_r='$d_sethostent_r'
22774 d_setitimer='$d_setitimer'
22775 d_setlinebuf='$d_setlinebuf'
22776 d_setlocale='$d_setlocale'
22777 d_setlocale_r='$d_setlocale_r'
22778 d_setnent='$d_setnent'
22779 d_setnetent_r='$d_setnetent_r'
22780 d_setpent='$d_setpent'
22781 d_setpgid='$d_setpgid'
22782 d_setpgrp2='$d_setpgrp2'
22783 d_setpgrp='$d_setpgrp'
22784 d_setprior='$d_setprior'
22785 d_setproctitle='$d_setproctitle'
22786 d_setprotoent_r='$d_setprotoent_r'
22787 d_setpwent='$d_setpwent'
22788 d_setpwent_r='$d_setpwent_r'
22789 d_setregid='$d_setregid'
22790 d_setresgid='$d_setresgid'
22791 d_setresuid='$d_setresuid'
22792 d_setreuid='$d_setreuid'
22793 d_setrgid='$d_setrgid'
22794 d_setruid='$d_setruid'
22795 d_setsent='$d_setsent'
22796 d_setservent_r='$d_setservent_r'
22797 d_setsid='$d_setsid'
22798 d_setvbuf='$d_setvbuf'
22802 d_shmatprototype='$d_shmatprototype'
22803 d_shmctl='$d_shmctl'
22805 d_shmget='$d_shmget'
22806 d_sigaction='$d_sigaction'
22807 d_signbit='$d_signbit'
22808 d_sigprocmask='$d_sigprocmask'
22809 d_sigsetjmp='$d_sigsetjmp'
22810 d_sitearch='$d_sitearch'
22811 d_snprintf='$d_snprintf'
22812 d_sockatmark='$d_sockatmark'
22813 d_sockatmarkproto='$d_sockatmarkproto'
22814 d_socket='$d_socket'
22815 d_socklen_t='$d_socklen_t'
22816 d_sockpair='$d_sockpair'
22817 d_socks5_init='$d_socks5_init'
22818 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
22820 d_srand48_r='$d_srand48_r'
22821 d_srandom_r='$d_srandom_r'
22822 d_sresgproto='$d_sresgproto'
22823 d_sresuproto='$d_sresuproto'
22824 d_statblks='$d_statblks'
22825 d_statfs_f_flags='$d_statfs_f_flags'
22826 d_statfs_s='$d_statfs_s'
22827 d_static_inline='$d_static_inline'
22828 d_statvfs='$d_statvfs'
22829 d_stdio_cnt_lval='$d_stdio_cnt_lval'
22830 d_stdio_ptr_lval='$d_stdio_ptr_lval'
22831 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
22832 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
22833 d_stdio_stream_array='$d_stdio_stream_array'
22834 d_stdiobase='$d_stdiobase'
22835 d_stdstdio='$d_stdstdio'
22836 d_strchr='$d_strchr'
22837 d_strcoll='$d_strcoll'
22838 d_strctcpy='$d_strctcpy'
22839 d_strerrm='$d_strerrm'
22840 d_strerror='$d_strerror'
22841 d_strerror_r='$d_strerror_r'
22842 d_strftime='$d_strftime'
22843 d_strlcat='$d_strlcat'
22844 d_strlcpy='$d_strlcpy'
22845 d_strtod='$d_strtod'
22846 d_strtol='$d_strtol'
22847 d_strtold='$d_strtold'
22848 d_strtoll='$d_strtoll'
22849 d_strtoq='$d_strtoq'
22850 d_strtoul='$d_strtoul'
22851 d_strtoull='$d_strtoull'
22852 d_strtouq='$d_strtouq'
22853 d_strxfrm='$d_strxfrm'
22854 d_suidsafe='$d_suidsafe'
22855 d_symlink='$d_symlink'
22856 d_syscall='$d_syscall'
22857 d_syscallproto='$d_syscallproto'
22858 d_sysconf='$d_sysconf'
22859 d_sysernlst='$d_sysernlst'
22860 d_syserrlst='$d_syserrlst'
22861 d_system='$d_system'
22862 d_tcgetpgrp='$d_tcgetpgrp'
22863 d_tcsetpgrp='$d_tcsetpgrp'
22864 d_telldir='$d_telldir'
22865 d_telldirproto='$d_telldirproto'
22867 d_timegm='$d_timegm'
22869 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
22870 d_tm_tm_zone='$d_tm_tm_zone'
22871 d_tmpnam_r='$d_tmpnam_r'
22872 d_truncate='$d_truncate'
22873 d_ttyname_r='$d_ttyname_r'
22874 d_tzname='$d_tzname'
22875 d_u32align='$d_u32align'
22876 d_ualarm='$d_ualarm'
22879 d_union_semun='$d_union_semun'
22880 d_unordered='$d_unordered'
22881 d_unsetenv='$d_unsetenv'
22882 d_usleep='$d_usleep'
22883 d_usleepproto='$d_usleepproto'
22885 d_vendorarch='$d_vendorarch'
22886 d_vendorbin='$d_vendorbin'
22887 d_vendorlib='$d_vendorlib'
22888 d_vendorscript='$d_vendorscript'
22890 d_void_closedir='$d_void_closedir'
22891 d_voidsig='$d_voidsig'
22892 d_voidtty='$d_voidtty'
22893 d_volatile='$d_volatile'
22894 d_vprintf='$d_vprintf'
22895 d_vsnprintf='$d_vsnprintf'
22897 d_waitpid='$d_waitpid'
22898 d_wcstombs='$d_wcstombs'
22899 d_wctomb='$d_wctomb'
22900 d_writev='$d_writev'
22903 db_hashtype='$db_hashtype'
22904 db_prefixtype='$db_prefixtype'
22905 db_version_major='$db_version_major'
22906 db_version_minor='$db_version_minor'
22907 db_version_patch='$db_version_patch'
22908 defvoidused='$defvoidused'
22909 direntrytype='$direntrytype'
22912 doublesize='$doublesize'
22914 drand48_r_proto='$drand48_r_proto'
22916 dynamic_ext='$dynamic_ext'
22922 endgrent_r_proto='$endgrent_r_proto'
22923 endhostent_r_proto='$endhostent_r_proto'
22924 endnetent_r_proto='$endnetent_r_proto'
22925 endprotoent_r_proto='$endprotoent_r_proto'
22926 endpwent_r_proto='$endpwent_r_proto'
22927 endservent_r_proto='$endservent_r_proto'
22928 eunicefix='$eunicefix'
22931 extensions='$extensions'
22932 extern_C='$extern_C'
22934 fflushNULL='$fflushNULL'
22935 fflushall='$fflushall'
22937 firstmakefile='$firstmakefile'
22939 fpossize='$fpossize'
22940 fpostype='$fpostype'
22941 freetype='$freetype'
22944 full_csh='$full_csh'
22945 full_sed='$full_sed'
22946 gccansipedantic='$gccansipedantic'
22947 gccosandvers='$gccosandvers'
22948 gccversion='$gccversion'
22949 getgrent_r_proto='$getgrent_r_proto'
22950 getgrgid_r_proto='$getgrgid_r_proto'
22951 getgrnam_r_proto='$getgrnam_r_proto'
22952 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22953 gethostbyname_r_proto='$gethostbyname_r_proto'
22954 gethostent_r_proto='$gethostent_r_proto'
22955 getlogin_r_proto='$getlogin_r_proto'
22956 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22957 getnetbyname_r_proto='$getnetbyname_r_proto'
22958 getnetent_r_proto='$getnetent_r_proto'
22959 getprotobyname_r_proto='$getprotobyname_r_proto'
22960 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22961 getprotoent_r_proto='$getprotoent_r_proto'
22962 getpwent_r_proto='$getpwent_r_proto'
22963 getpwnam_r_proto='$getpwnam_r_proto'
22964 getpwuid_r_proto='$getpwuid_r_proto'
22965 getservbyname_r_proto='$getservbyname_r_proto'
22966 getservbyport_r_proto='$getservbyport_r_proto'
22967 getservent_r_proto='$getservent_r_proto'
22968 getspnam_r_proto='$getspnam_r_proto'
22969 gidformat='$gidformat'
22975 gmtime_r_proto='$gmtime_r_proto'
22976 gnulibc_version='$gnulibc_version'
22978 groupcat='$groupcat'
22979 groupstype='$groupstype'
22982 h_sysfile='$h_sysfile'
22985 html1dir='$html1dir'
22986 html1direxp='$html1direxp'
22987 html3dir='$html3dir'
22988 html3direxp='$html3direxp'
22997 i_arpainet='$i_arpainet'
22998 i_assert='$i_assert'
22999 i_bsdioctl='$i_bsdioctl'
23003 i_dirent='$i_dirent'
23009 i_fp_class='$i_fp_class'
23011 i_gdbm_ndbm='$i_gdbm_ndbm'
23012 i_gdbmndbm='$i_gdbmndbm'
23014 i_ieeefp='$i_ieeefp'
23015 i_inttypes='$i_inttypes'
23016 i_langinfo='$i_langinfo'
23017 i_libutil='$i_libutil'
23018 i_limits='$i_limits'
23019 i_locale='$i_locale'
23020 i_machcthr='$i_machcthr'
23021 i_malloc='$i_malloc'
23022 i_mallocmalloc='$i_mallocmalloc'
23024 i_memory='$i_memory'
23025 i_mntent='$i_mntent'
23028 i_neterrno='$i_neterrno'
23029 i_netinettcp='$i_netinettcp'
23033 i_pthread='$i_pthread'
23035 i_rpcsvcdbm='$i_rpcsvcdbm'
23038 i_shadow='$i_shadow'
23040 i_stdarg='$i_stdarg'
23041 i_stddef='$i_stddef'
23042 i_stdlib='$i_stdlib'
23043 i_string='$i_string'
23044 i_sunmath='$i_sunmath'
23045 i_sysaccess='$i_sysaccess'
23046 i_sysdir='$i_sysdir'
23047 i_sysfile='$i_sysfile'
23048 i_sysfilio='$i_sysfilio'
23050 i_sysioctl='$i_sysioctl'
23051 i_syslog='$i_syslog'
23052 i_sysmman='$i_sysmman'
23053 i_sysmode='$i_sysmode'
23054 i_sysmount='$i_sysmount'
23055 i_sysndir='$i_sysndir'
23056 i_sysparam='$i_sysparam'
23057 i_syspoll='$i_syspoll'
23058 i_sysresrc='$i_sysresrc'
23059 i_syssecrt='$i_syssecrt'
23060 i_sysselct='$i_sysselct'
23061 i_syssockio='$i_syssockio'
23062 i_sysstat='$i_sysstat'
23063 i_sysstatfs='$i_sysstatfs'
23064 i_sysstatvfs='$i_sysstatvfs'
23065 i_systime='$i_systime'
23066 i_systimek='$i_systimek'
23067 i_systimes='$i_systimes'
23068 i_systypes='$i_systypes'
23069 i_sysuio='$i_sysuio'
23071 i_sysutsname='$i_sysutsname'
23072 i_sysvfs='$i_sysvfs'
23073 i_syswait='$i_syswait'
23074 i_termio='$i_termio'
23075 i_termios='$i_termios'
23077 i_unistd='$i_unistd'
23080 i_values='$i_values'
23081 i_varargs='$i_varargs'
23082 i_varhdr='$i_varhdr'
23084 ignore_versioned_solibs='$ignore_versioned_solibs'
23085 inc_version_list='$inc_version_list'
23086 inc_version_list_init='$inc_version_list_init'
23089 initialinstalllocation='$initialinstalllocation'
23090 installarchlib='$installarchlib'
23091 installbin='$installbin'
23092 installhtml1dir='$installhtml1dir'
23093 installhtml3dir='$installhtml3dir'
23094 installman1dir='$installman1dir'
23095 installman3dir='$installman3dir'
23096 installprefix='$installprefix'
23097 installprefixexp='$installprefixexp'
23098 installprivlib='$installprivlib'
23099 installscript='$installscript'
23100 installsitearch='$installsitearch'
23101 installsitebin='$installsitebin'
23102 installsitehtml1dir='$installsitehtml1dir'
23103 installsitehtml3dir='$installsitehtml3dir'
23104 installsitelib='$installsitelib'
23105 installsiteman1dir='$installsiteman1dir'
23106 installsiteman3dir='$installsiteman3dir'
23107 installsitescript='$installsitescript'
23108 installstyle='$installstyle'
23109 installusrbinperl='$installusrbinperl'
23110 installvendorarch='$installvendorarch'
23111 installvendorbin='$installvendorbin'
23112 installvendorhtml1dir='$installvendorhtml1dir'
23113 installvendorhtml3dir='$installvendorhtml3dir'
23114 installvendorlib='$installvendorlib'
23115 installvendorman1dir='$installvendorman1dir'
23116 installvendorman3dir='$installvendorman3dir'
23117 installvendorscript='$installvendorscript'
23119 issymlink='$issymlink'
23120 ivdformat='$ivdformat'
23123 known_extensions='$known_extensions'
23126 lddlflags='$lddlflags'
23128 ldflags_uselargefiles='$ldflags_uselargefiles'
23129 ldlibpthname='$ldlibpthname'
23136 libsdirs='$libsdirs'
23137 libsfiles='$libsfiles'
23138 libsfound='$libsfound'
23139 libspath='$libspath'
23140 libswanted='$libswanted'
23141 libswanted_uselargefiles='$libswanted_uselargefiles'
23147 localtime_r_proto='$localtime_r_proto'
23148 locincpth='$locincpth'
23149 loclibpth='$loclibpth'
23150 longdblsize='$longdblsize'
23151 longlongsize='$longlongsize'
23152 longsize='$longsize'
23156 lseeksize='$lseeksize'
23157 lseektype='$lseektype'
23160 madlyobj='$madlyobj'
23161 madlysrc='$madlysrc'
23165 make_set_make='$make_set_make'
23166 mallocobj='$mallocobj'
23167 mallocsrc='$mallocsrc'
23168 malloctype='$malloctype'
23170 man1direxp='$man1direxp'
23173 man3direxp='$man3direxp'
23175 mips_type='$mips_type'
23176 mistrustnm='$mistrustnm'
23178 mmaptype='$mmaptype'
23179 modetype='$modetype'
23181 multiarch='$multiarch'
23183 myarchname='$myarchname'
23184 mydomain='$mydomain'
23185 myhostname='$myhostname'
23188 need_va_copy='$need_va_copy'
23189 netdb_hlen_type='$netdb_hlen_type'
23190 netdb_host_type='$netdb_host_type'
23191 netdb_name_type='$netdb_name_type'
23192 netdb_net_type='$netdb_net_type'
23195 nm_so_opt='$nm_so_opt'
23196 nonxs_ext='$nonxs_ext'
23198 nvEUformat='$nvEUformat'
23199 nvFUformat='$nvFUformat'
23200 nvGUformat='$nvGUformat'
23201 nv_overflows_integers_at='$nv_overflows_integers_at'
23202 nv_preserves_uv_bits='$nv_preserves_uv_bits'
23203 nveformat='$nveformat'
23204 nvfformat='$nvfformat'
23205 nvgformat='$nvgformat'
23208 o_nonblock='$o_nonblock'
23210 old_pthread_create_joinable='$old_pthread_create_joinable'
23211 optimize='$optimize'
23212 orderlib='$orderlib'
23215 otherlibdirs='$otherlibdirs'
23219 patchlevel='$patchlevel'
23220 path_sep='$path_sep'
23223 perl_patchlevel='$perl_patchlevel'
23224 perl_static_inline='$perl_static_inline'
23225 perladmin='$perladmin'
23226 perllibs='$perllibs'
23227 perlpath='$perlpath'
23229 phostname='$phostname'
23235 prefixexp='$prefixexp'
23237 privlibexp='$privlibexp'
23238 procselfexe='$procselfexe'
23239 prototype='$prototype'
23241 quadkind='$quadkind'
23242 quadtype='$quadtype'
23243 randbits='$randbits'
23244 randfunc='$randfunc'
23245 random_r_proto='$random_r_proto'
23246 randseedtype='$randseedtype'
23248 rd_nodata='$rd_nodata'
23249 readdir64_r_proto='$readdir64_r_proto'
23250 readdir_r_proto='$readdir_r_proto'
23251 revision='$revision'
23257 sGMTIME_max='$sGMTIME_max'
23258 sGMTIME_min='$sGMTIME_min'
23259 sLOCALTIME_max='$sLOCALTIME_max'
23260 sLOCALTIME_min='$sLOCALTIME_min'
23261 sPRIEUldbl='$sPRIEUldbl'
23262 sPRIFUldbl='$sPRIFUldbl'
23263 sPRIGUldbl='$sPRIGUldbl'
23264 sPRIXU64='$sPRIXU64'
23266 sPRIeldbl='$sPRIeldbl'
23267 sPRIfldbl='$sPRIfldbl'
23268 sPRIgldbl='$sPRIgldbl'
23273 sSCNfldbl='$sSCNfldbl'
23274 sched_yield='$sched_yield'
23275 scriptdir='$scriptdir'
23276 scriptdirexp='$scriptdirexp'
23278 seedfunc='$seedfunc'
23279 selectminbits='$selectminbits'
23280 selecttype='$selecttype'
23281 sendmail='$sendmail'
23282 setgrent_r_proto='$setgrent_r_proto'
23283 sethostent_r_proto='$sethostent_r_proto'
23284 setlocale_r_proto='$setlocale_r_proto'
23285 setnetent_r_proto='$setnetent_r_proto'
23286 setprotoent_r_proto='$setprotoent_r_proto'
23287 setpwent_r_proto='$setpwent_r_proto'
23288 setservent_r_proto='$setservent_r_proto'
23291 sharpbang='$sharpbang'
23292 shmattype='$shmattype'
23293 shortsize='$shortsize'
23296 sig_count='$sig_count'
23297 sig_name='$sig_name'
23298 sig_name_init='$sig_name_init'
23300 sig_num_init='$sig_num_init'
23301 sig_size='$sig_size'
23302 signal_t='$signal_t'
23303 sitearch='$sitearch'
23304 sitearchexp='$sitearchexp'
23306 sitebinexp='$sitebinexp'
23307 sitehtml1dir='$sitehtml1dir'
23308 sitehtml1direxp='$sitehtml1direxp'
23309 sitehtml3dir='$sitehtml3dir'
23310 sitehtml3direxp='$sitehtml3direxp'
23312 sitelib_stem='$sitelib_stem'
23313 sitelibexp='$sitelibexp'
23314 siteman1dir='$siteman1dir'
23315 siteman1direxp='$siteman1direxp'
23316 siteman3dir='$siteman3dir'
23317 siteman3direxp='$siteman3direxp'
23318 siteprefix='$siteprefix'
23319 siteprefixexp='$siteprefixexp'
23320 sitescript='$sitescript'
23321 sitescriptexp='$sitescriptexp'
23322 sizesize='$sizesize'
23323 sizetype='$sizetype'
23327 sockethdr='$sockethdr'
23328 socketlib='$socketlib'
23329 socksizetype='$socksizetype'
23331 spackage='$spackage'
23332 spitshell='$spitshell'
23333 srand48_r_proto='$srand48_r_proto'
23334 srandom_r_proto='$srandom_r_proto'
23336 ssizetype='$ssizetype'
23337 startperl='$startperl'
23339 static_ext='$static_ext'
23341 stdio_base='$stdio_base'
23342 stdio_bufsiz='$stdio_bufsiz'
23343 stdio_cnt='$stdio_cnt'
23344 stdio_filbuf='$stdio_filbuf'
23345 stdio_ptr='$stdio_ptr'
23346 stdio_stream_array='$stdio_stream_array'
23347 strerror_r_proto='$strerror_r_proto'
23350 subversion='$subversion'
23354 targetarch='$targetarch'
23358 timeincl='$timeincl'
23359 timetype='$timetype'
23360 tmpnam_r_proto='$tmpnam_r_proto'
23366 ttyname_r_proto='$ttyname_r_proto'
23375 uidformat='$uidformat'
23381 uquadtype='$uquadtype'
23382 use5005threads='$use5005threads'
23383 use64bitall='$use64bitall'
23384 use64bitint='$use64bitint'
23385 usecrosscompile='$usecrosscompile'
23386 usedevel='$usedevel'
23388 usedtrace='$usedtrace'
23389 usefaststdio='$usefaststdio'
23390 useithreads='$useithreads'
23391 uselargefiles='$uselargefiles'
23392 uselongdouble='$uselongdouble'
23393 usemallocwrap='$usemallocwrap'
23394 usemorebits='$usemorebits'
23395 usemultiplicity='$usemultiplicity'
23396 usemymalloc='$usemymalloc'
23398 useopcode='$useopcode'
23399 useperlio='$useperlio'
23400 useposix='$useposix'
23401 usereentrant='$usereentrant'
23402 userelocatableinc='$userelocatableinc'
23404 useshrplib='$useshrplib'
23405 usesitecustomize='$usesitecustomize'
23406 usesocks='$usesocks'
23407 usethreads='$usethreads'
23408 usevendorprefix='$usevendorprefix'
23409 usevfork='$usevfork'
23412 uvXUformat='$uvXUformat'
23413 uvoformat='$uvoformat'
23416 uvuformat='$uvuformat'
23417 uvxformat='$uvxformat'
23419 vendorarch='$vendorarch'
23420 vendorarchexp='$vendorarchexp'
23421 vendorbin='$vendorbin'
23422 vendorbinexp='$vendorbinexp'
23423 vendorhtml1dir='$vendorhtml1dir'
23424 vendorhtml1direxp='$vendorhtml1direxp'
23425 vendorhtml3dir='$vendorhtml3dir'
23426 vendorhtml3direxp='$vendorhtml3direxp'
23427 vendorlib='$vendorlib'
23428 vendorlib_stem='$vendorlib_stem'
23429 vendorlibexp='$vendorlibexp'
23430 vendorman1dir='$vendorman1dir'
23431 vendorman1direxp='$vendorman1direxp'
23432 vendorman3dir='$vendorman3dir'
23433 vendorman3direxp='$vendorman3direxp'
23434 vendorprefix='$vendorprefix'
23435 vendorprefixexp='$vendorprefixexp'
23436 vendorscript='$vendorscript'
23437 vendorscriptexp='$vendorscriptexp'
23439 version_patchlevel_string='$version_patchlevel_string'
23440 versiononly='$versiononly'
23442 voidflags='$voidflags'
23445 yaccflags='$yaccflags'
23450 : add special variables
23451 $test -f $src/patchlevel.h && \
23452 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23453 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
23454 echo "PERL_CONFIG_SH=true" >>config.sh
23456 : propagate old symbols
23457 if $test -f UU/config.sh; then
23458 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23459 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23460 config.sh config.sh UU/oldconfig.sh |\
23461 $sort | $uniq -u >UU/oldsyms
23462 set X `cat UU/oldsyms`
23468 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23470 echo ": Variables propagated from previous config.sh file." >>config.sh
23471 for sym in `cat UU/oldsyms`; do
23472 echo " Propagating $hint variable "'$'"$sym..."
23473 eval 'tmp="$'"${sym}"'"'
23475 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23481 : Finish up by extracting the .SH files
23485 echo "Extraction done."
23495 If you'd like to make any changes to the config.sh file before I begin
23496 to configure things, do it as a shell escape now (e.g. !vi config.sh).
23499 rp="Press return or use a shell escape to edit config.sh:"
23504 *) : in case they cannot read
23505 sh 1>&4 -c "$ans";;
23510 : if this fails, just run all the .SH files by hand
23519 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
23526 Now you need to generate make dependencies by running "$make depend".
23527 You might prefer to run it in background: "$make depend > makedepend.out &"
23528 It can take a while, so you might not want to run it right now.
23533 rp="Run $make depend now?"
23537 $make depend && echo "Now you must run '$make'."
23540 echo "You must run '$make depend' then '$make'."
23543 elif test -f [Mm]akefile; then
23545 echo "Now you must run a $make."
23547 echo "Configure done."
23550 if $test -f Policy.sh; then
23553 If you compile $package on a different machine or from a different object
23554 directory, copy the Policy.sh file from this object directory to the
23555 new one before you run Configure -- this will help you with most of
23556 the policy defaults.
23560 if $test -f config.msg; then
23561 echo "Hmm. I also noted the following information while running:"
23563 $cat config.msg >&4
23566 $rm -f kit*isdone ark*isdone