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 Thu Aug 12 11:38:08 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 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4166 version_patchlevel_string="version $patchlevel subversion $subversion"
4167 case "$perl_patchlevel" in
4169 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4170 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4174 $echo "(You have $package $version_patchlevel_string.)"
4178 : XXX Should be a Configure test for double-dots in filenames.
4179 version=`echo $revision $patchlevel $subversion | \
4180 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4181 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4182 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4185 version=`echo $revision $patchlevel $subversion | \
4186 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4187 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4188 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4191 : Special case the 5.005_xx maintenance series, which used 5.005
4192 : without any subversion label as a subdirectory in $sitelib
4193 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4194 api_versionstring='5.005'
4197 : Do we want threads support and if so, what type
4198 case "$usethreads" in
4199 $define|true|[yY]*) dflt='y';;
4200 *) # Catch case where user specified ithreads or 5005threads but
4201 # forgot -Dusethreads (A.D. 4/2002)
4202 case "$useithreads$use5005threads" in
4204 case "$useperlio" in
4205 "$define") dflt='y' ;;
4215 Perl can be built to take advantage of threads on some systems.
4216 To do so, Configure can be run with -Dusethreads.
4218 Note that Perl built with threading support runs slightly slower
4219 and uses more memory than plain Perl. The current implementation
4220 is believed to be stable, but it is fairly new, and so should be
4221 treated with caution.
4223 If this doesn't make any sense to you, just accept the default '$dflt'.
4225 rp='Build a threading Perl?'
4228 y|Y) val="$define" ;;
4234 if $test $patchlevel -lt 9; then
4235 case "$usethreads" in
4239 Since release 5.6, Perl has had two different threading implementations,
4240 the newer interpreter-based version (ithreads) with one interpreter per
4241 thread, and the older 5.005 version (5005threads).
4242 The 5005threads version is effectively unmaintained and will probably be
4243 removed in Perl 5.10, so there should be no need to build a Perl using it
4244 unless needed for backwards compatibility with some existing 5.005threads
4248 : Default to ithreads unless overridden on command line or with
4251 case "$use5005threads" in
4252 $define|true|[yY]*) dflt='n';;
4254 case "$useithreads" in
4255 $undef|false|[nN]*) dflt='n';;
4257 rp='Use the newer interpreter-based ithreads?'
4260 y|Y) val="$define" ;;
4265 : Now set use5005threads to the opposite value.
4266 case "$useithreads" in
4267 $define) val="$undef" ;;
4274 useithreads="$undef"
4275 use5005threads="$undef"
4279 case "$useithreads$use5005threads" in
4283 You cannot have both the ithreads and the 5.005 threads enabled
4284 at the same time. Disabling the 5.005 threads since they are
4285 much less stable than the ithreads.
4288 use5005threads="$undef"
4293 : perl-5.9.x and later
4295 if test X"$usethreads" = "X$define"; then
4296 case "$use5005threads" in
4300 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4307 use5005threads="$undef"
4308 useithreads="$usethreads"
4311 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4314 *** To build with ithreads you must also use the PerlIO layer.
4315 *** Cannot continue, aborting.
4321 case "$d_oldpthreads" in
4322 '') : Configure tests would be welcome here. For now, assume undef.
4324 *) val="$d_oldpthreads" ;;
4330 : Look for a hint-file generated 'call-back-unit'. If the
4331 : user has specified that a threading perl is to be built,
4332 : we may need to set or change some other defaults.
4333 if $test -f usethreads.cbu; then
4334 echo "Your platform has some specific hints regarding threaded builds, using them..."
4337 case "$usethreads" in
4338 "$define"|true|[yY]*)
4340 (Your platform does not have any specific hints for threaded builds.
4341 Assuming POSIX threads, then.)
4347 : Check if multiplicity is required
4350 Perl can be built so that multiple Perl interpreters can coexist
4351 within the same Perl executable.
4354 case "$useithreads" in
4357 This multiple interpreter support is required for interpreter-based threads.
4361 *) case "$usemultiplicity" in
4362 $define|true|[yY]*) dflt='y';;
4366 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4367 rp='Build Perl for multiplicity?'
4370 y|Y) val="$define" ;;
4378 : Check if morebits is requested
4379 case "$usemorebits" in
4380 "$define"|true|[yY]*)
4381 use64bitint="$define"
4382 uselongdouble="$define"
4383 usemorebits="$define"
4385 *) usemorebits="$undef"
4389 : Determine the C compiler to be used
4395 rp="Use which C compiler?"
4399 : See whether they have no cc but they do have gcc
4401 if $test -f cc.cbu; then
4406 : make some quick guesses about what we are up against
4408 $echo $n "Hmm... $c"
4418 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4419 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4421 echo "Looks kind of like an OSF/1 system, but we'll see..."
4423 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4424 xxx=`./loc addbib blurfl $pth`
4425 if $test -f $xxx; then
4426 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4430 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4431 echo "Looks kind of like an extended USG system, but we'll see..."
4433 echo "Looks kind of like a USG system, but we'll see..."
4437 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4438 echo "Looks kind of like a BSD system, but we'll see..."
4442 echo "Looks kind of like a Version 7 system, but we'll see..."
4445 case "$eunicefix" in
4448 There is, however, a strange, musty smell in the air that reminds me of
4449 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4453 : it so happens the Eunice I know will not run shell scripts in Unix format
4457 echo "Congratulations. You aren't running Eunice."
4461 : Detect OS2. The p_ variable is set above in the Head.U unit.
4462 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4463 : semicolon as a patch separator
4468 I have the feeling something is not exactly right, however...don't tell me...
4469 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4470 (Or you may be running DOS with DJGPP.)
4475 if test -f /xenix; then
4476 echo "Actually, this looks more like a XENIX system..."
4481 echo "It's not Xenix..."
4486 if test -f /venix; then
4487 echo "Actually, this looks more like a VENIX system..."
4494 echo "Nor is it Venix..."
4497 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4498 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4501 : Check if we are using GNU gcc and what its version is
4503 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4507 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4509 printf("%s\n", __VERSION__);
4511 printf("%s\n", "1");
4517 if $cc -o try $ccflags $ldflags try.c; then
4518 gccversion=`$run ./try`
4519 case "$gccversion" in
4520 '') echo "You are not using GNU cc." ;;
4521 *) echo "You are using GNU cc $gccversion."
4527 echo "*** WHOA THERE!!! ***" >&4
4528 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4529 case "$knowitall" in
4531 echo " You'd better start hunting for one and let me know about it." >&4
4537 case "$gccversion" in
4538 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4540 case "$gccversion" in
4541 '') gccosandvers='' ;;
4542 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4543 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4545 case "$gccosandvers" in
4546 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4547 $osname$osvers) ;; # looking good
4548 $osname*) cat <<EOM >&4
4550 *** WHOA THERE!!! ***
4552 Your gcc has not been compiled for the exact release of
4553 your operating system ($gccosandvers versus $osname$osvers).
4555 In general it is a good idea to keep gcc synchronized with
4556 the operating system because otherwise serious problems
4557 may ensue when trying to compile software, like Perl.
4559 I'm trying to be optimistic here, though, and will continue.
4560 If later during the configuration and build icky compilation
4561 problems appear (headerfile conflicts being the most common
4562 manifestation), I suggest reinstalling the gcc to match
4563 your operating system release.
4567 *) gccosandvers='' ;; # failed to parse, better be silent
4575 # gcc 3.* complain about adding -Idirectories that they already know about,
4576 # so we will take those off from locincpth.
4577 case "$gccversion" in
4579 echo "main(){}">try.c
4580 for incdir in $locincpth; do
4581 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4582 grep '^c[cp]p*[01]: warning: changing search order '`
4583 if test "X$warn" != X; then
4584 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4590 : What should the include directory be ?
4592 $echo $n "Hmm... $c"
4596 if $test -f /bin/mips && /bin/mips; then
4597 echo "Looks like a MIPS system..."
4598 $cat >usr.c <<'EOCP'
4599 #ifdef SYSTYPE_BSD43
4603 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4604 dflt='/bsd43/usr/include'
4608 mips_type='System V'
4610 $rm -f usr.c usr.out
4611 echo "and you're compiling with the $mips_type compiler and libraries."
4615 echo "Doesn't look like a MIPS system."
4625 case "$xxx_prompt" in
4628 rp='Where are the include files you want to use?'
4636 : see how we invoke the C preprocessor
4638 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4639 cat <<'EOT' >testcpp.c
4645 if test ! -f cppstdin; then
4646 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4647 # AIX cc -E doesn't show the absolute headerfile
4648 # locations but we'll cheat by using the -M flag.
4649 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
4651 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4654 echo "Keeping your $hint cppstdin wrapper."
4657 wrapper=`pwd`/cppstdin
4661 if $test "X$cppstdin" != "X" && \
4662 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4663 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4665 echo "You used to use $cppstdin $cppminus so we'll use that again."
4667 '') echo "But let's see if we can live without a wrapper..." ;;
4669 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4670 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4672 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4675 echo "(However, $cpprun $cpplast does not work, let's see...)"
4683 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4690 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4691 $cc -E <testcpp.c >testcpp.out 2>&1; \
4692 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4693 echo "Yup, it does."
4696 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4697 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4698 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4699 echo "Yup, it does."
4702 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4703 $cc -P <testcpp.c >testcpp.out 2>&1; \
4704 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4705 echo "Yipee, that works!"
4708 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4709 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4710 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4711 echo "At long last!"
4714 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4715 $cpp <testcpp.c >testcpp.out 2>&1; \
4716 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4720 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4721 $cpp - <testcpp.c >testcpp.out 2>&1; \
4722 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4723 echo "Hooray, it works! I was beginning to wonder."
4726 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4727 $wrapper <testcpp.c >testcpp.out 2>&1; \
4728 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4734 rp="No dice. I can't find a C preprocessor. Name one:"
4738 $x_cpp <testcpp.c >testcpp.out 2>&1
4739 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4740 echo "OK, that will do." >&4
4742 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4757 echo "Perhaps can we force $cc -E using a wrapper..."
4758 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4759 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4765 echo "Nope, we'll have to live without it..."
4779 "$wrapper"|'cppstdin') ;;
4780 *) $rm -f $wrapper;;
4782 $rm -f testcpp.c testcpp.out
4784 : Set private lib path
4787 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4792 '') dlist="$loclibpth $plibpth $glibpth";;
4793 *) dlist="$libpth";;
4796 : Now check and see which directories actually exist, avoiding duplicates
4800 if $test -d $xxx; then
4803 *) libpth="$libpth $xxx";;
4809 Some systems have incompatible or broken versions of libraries. Among
4810 the directories listed in the question below, please remove any you
4811 know not to be holding relevant libraries, and add any that are needed.
4812 Say "none" for none.
4823 rp="Directories to use for library searches?"
4830 : compute shared library extension
4833 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4843 On some systems, shared libraries may be available. Answer 'none' if
4844 you want to suppress searching of shared libraries for the remainder
4845 of this configuration.
4848 rp='What is the file extension used for shared libraries?'
4852 : Define several unixisms.
4853 : Hints files or command line option can be used to override them.
4854 : The convoluted testing is in case hints files set either the old
4857 '') case "$exe_ext" in
4859 *) _exe="$exe_ext" ;;
4864 '') case "$lib_ext" in
4871 '') case "$obj_ext" in
4878 '') case "$path_sep" in
4889 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4891 : Which makefile gets called first. This is used by make depend.
4892 case "$firstmakefile" in
4893 '') firstmakefile='makefile';;
4896 : Check for uselongdouble support
4898 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4901 case "$uselongdouble" in
4902 $define|true|[yY]*) dflt='y';;
4907 Perl can be built to take advantage of long doubles which
4908 (if available) may give more accuracy and range for floating point numbers.
4910 If this doesn't make any sense to you, just accept the default '$dflt'.
4912 rp='Try to use long doubles if available?'
4915 y|Y) val="$define" ;;
4921 case "$uselongdouble" in
4922 true|[yY]*) uselongdouble="$define" ;;
4925 : Look for a hint-file generated 'call-back-unit'. If the
4926 : user has specified that long doubles should be used,
4927 : we may need to set or change some other defaults.
4928 if $test -f uselongdouble.cbu; then
4929 echo "Your platform has some specific hints regarding long doubles, using them..."
4930 . ./uselongdouble.cbu
4932 case "$uselongdouble" in
4935 (Your platform does not have any specific hints for long doubles.)
4941 : Looking for optional libraries
4943 echo "Checking for optional libraries..." >&4
4948 case "$libswanted" in
4949 '') libswanted='c_s';;
4952 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4958 for thisdir in $libpth $xlibpth; do
4959 test -d $thisdir && libspath="$libspath $thisdir"
4961 for thislib in $libswanted; do
4962 for thisdir in $libspath; do
4964 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4965 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4966 $test -f "$xxx" && eval $libscheck
4967 $test -f "$xxx" && libstyle=shared
4969 if test ! -f "$xxx"; then
4970 xxx=$thisdir/lib$thislib.$so
4971 $test -f "$xxx" && eval $libscheck
4972 $test -f "$xxx" && libstyle=shared
4974 if test ! -f "$xxx"; then
4975 xxx=$thisdir/lib$thislib$_a
4976 $test -f "$xxx" && eval $libscheck
4977 $test -f "$xxx" && libstyle=static
4979 if test ! -f "$xxx"; then
4980 xxx=$thisdir/$thislib$_a
4981 $test -f "$xxx" && eval $libscheck
4982 $test -f "$xxx" && libstyle=static
4984 if test ! -f "$xxx"; then
4985 xxx=$thisdir/lib${thislib}_s$_a
4986 $test -f "$xxx" && eval $libscheck
4987 $test -f "$xxx" && libstyle=static
4988 $test -f "$xxx" && thislib=${thislib}_s
4990 if test ! -f "$xxx"; then
4991 xxx=$thisdir/Slib$thislib$_a
4992 $test -f "$xxx" && eval $libscheck
4993 $test -f "$xxx" && libstyle=static
4995 if $test -f "$xxx"; then
4997 shared) echo "Found -l$thislib (shared)." ;;
4998 static) echo "Found -l$thislib." ;;
4999 *) echo "Found -l$thislib ($libstyle)." ;;
5003 *) dflt="$dflt -l$thislib"
5004 libsfound="$libsfound $xxx"
5006 libsfiles="$libsfiles $yyy"
5007 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5008 case " $libsdirs " in
5010 *) libsdirs="$libsdirs $yyy" ;;
5017 if $test ! -f "$xxx"; then
5018 echo "No -l$thislib."
5029 ' '|'') dflt='none';;
5034 In order to compile $package on your machine, a number of libraries
5035 are usually needed. Include any other special libraries here as well.
5036 Say "none" for none. The default list is almost always right.
5040 rp="What libraries to use?"
5047 : determine optimization, if desired, or use for debug flag also
5049 ' '|$undef) dflt='none';;
5051 *) dflt="$optimize";;
5055 By default, $package compiles with the -O flag to use the optimizer.
5056 Alternately, you might want to use the symbolic debugger, which uses
5057 the -g flag (on traditional Unix systems). Either flag can be
5058 specified here. To use neither flag, specify the word "none".
5061 rp="What optimizer/debugger flag should be used?"
5065 'none') optimize=" ";;
5068 : Check what DEBUGGING is required from the command line
5069 : -DEBUGGING or -DDEBUGGING or
5070 : -DEBUGGING=both = -g + -DDEBUGGING
5071 : -DEBUGGING=-g or -Doptimize=-g = -g
5072 : -DEBUGGING=none or -UDEBUGGING =
5073 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5076 *) DEBUGGING=$EBUGGING ;;
5079 case "$DEBUGGING" in
5083 *) optimize="$optimize -g" ;;
5087 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5095 case "$DEBUGGING" in
5096 both|$define) dflt='-DDEBUGGING'
5099 : argument order is deliberate, as the flag will start with - which set could
5100 : think is an option
5101 checkccflag='check=$1; flag=$2; callback=$3;
5103 echo "Checking if your compiler accepts $flag" 2>&1;
5104 echo "int main(void) { return 0; }" > gcctest.c;
5105 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5106 echo "Yes, it does." 2>&1;
5107 if $test -s gcctest.out ; then
5108 echo "But your platform does not like it:";
5113 echo "Leaving current flags $ccflags alone." 2>&1
5115 *) dflt="$dflt $flag";
5121 echo "Nope, it does not, but that is ok." 2>&1;
5125 : We will not override a previous value, but we might want to
5126 : augment a hint file
5128 default|recommended)
5129 case "$gccversion" in
5130 1*) dflt="$dflt -fpcc-struct-return" ;;
5132 case "$optimize:$DEBUGGING" in
5133 *-g*:old) dflt="$dflt -DDEBUGGING";;
5135 case "$gccversion" in
5136 2*) if $test -d /etc/conf/kconfig.d &&
5137 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5139 # Interactive Systems (ISC) POSIX mode.
5144 case "$gccversion" in
5147 ?*) set strict-aliasing -fno-strict-aliasing
5151 # For gcc, adding -pipe speeds up compilations for some, but apparently
5152 # some assemblers can't read from stdin. (It also slows down compilations
5153 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5154 case "$gccversion" in
5160 # on x86_64 (at least) we require an extra library (libssp) in the
5161 # link command line. This library is not named, so I infer that it is
5162 # an implementation detail that may change. Hence the safest approach
5163 # is to add the flag to the flags passed to the compiler at link time,
5164 # as that way the compiler can do the right implementation dependant
5166 case "$gccversion" in
5167 ?*) set stack-protector -fstack-protector
5174 case "$mips_type" in
5175 *BSD*|'') inclwanted="$locincpth $usrinc";;
5176 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5178 for thisincl in $inclwanted; do
5179 if $test -d $thisincl; then
5180 if $test x$thisincl != x$usrinc; then
5182 *" -I$thisincl "*);;
5183 *) dflt="$dflt -I$thisincl ";;
5189 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5191 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5199 *) dflt="$dflt -D$2";;
5203 set signal.h LANGUAGE_C; eval $inctest
5207 ccflags="$ccflags -DSOCKS"
5212 default|recommended) dflt="$ccflags $dflt" ;;
5213 *) dflt="$ccflags";;
5222 Your C compiler may want other flags. For this question you should include
5223 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5224 but you should NOT include libraries or ld flags like -lwhatever. If you
5225 want $package to honor its debug switch, you should include -DDEBUGGING here.
5226 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5228 To use no flags, specify the word "none".
5234 rp="Any additional cc flags?"
5241 : the following weeds options from ccflags that are of no interest to cpp
5243 '') cppflags="$ccflags" ;;
5244 *) cppflags="$cppflags $ccflags" ;;
5246 case "$gccversion" in
5247 1*) cppflags="$cppflags -D__GNUC__"
5249 case "$mips_type" in
5251 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5257 echo "Let me guess what the preprocessor flags are..." >&4
5271 *) ftry="$previous $flag";;
5273 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5274 >cpp1.out 2>/dev/null && \
5275 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5276 >cpp2.out 2>/dev/null && \
5277 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5278 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5280 cppflags="$cppflags $ftry"
5290 *-*) echo "They appear to be: $cppflags";;
5292 $rm -f cpp.c cpp?.out
5296 : flags used in final linking phase
5298 '') if ./venix; then
5304 *-posix*) dflt="$dflt -posix" ;;
5307 *) dflt="$ldflags";;
5309 # See note above about -fstack-protector
5311 *-fstack-protector*)
5313 *-fstack-protector*) ;; # Don't add it again
5314 *) dflt="$dflt -fstack-protector" ;;
5319 : Try to guess additional flags to pick up local libraries.
5320 for thislibdir in $libpth; do
5321 case " $loclibpth " in
5324 *"-L$thislibdir "*) ;;
5325 *) dflt="$dflt -L$thislibdir" ;;
5337 Your C linker may need flags. For this question you should
5338 include -L/whatever and any other flags used by the C linker, but you
5339 should NOT include libraries like -lwhatever.
5341 Make sure you include the appropriate -L/path flags if your C linker
5342 does not normally search all of the directories you specified above,
5345 To use no flags, specify the word "none".
5349 rp="Any additional ld flags (NOT including libraries)?"
5355 rmlist="$rmlist pdp11"
5359 echo "Checking your choice of C compiler and flags for coherency..." >&4
5360 $cat > try.c <<'EOF'
5362 int main() { printf("Ok\n"); return(0); }
5364 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5366 $cat >try.msg <<'EOM'
5367 I've tried to compile and run the following simple program:
5370 $cat try.c >> try.msg
5372 $cat >> try.msg <<EOM
5379 and I got the following output:
5383 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5384 if $sh -c "$run ./try " >>try.msg 2>&1; then
5388 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5391 cat >> try.msg <<'EOQS'
5392 If $libs contains -lsfio, and sfio is mis-configured, then it
5393 sometimes (apparently) runs and exits with a 0 status, but with no
5394 output! It may have to do with sfio's use of _exit vs. exit.
5397 rp="You have a big problem. Shall I abort Configure"
5404 echo "The program compiled OK, but exited with status $?." >>try.msg
5405 rp="You have a problem. Shall I abort Configure"
5409 echo "I can't compile the test program." >>try.msg
5410 rp="You have a BIG problem. Shall I abort Configure"
5416 case "$knowitall" in
5418 echo "(The supplied flags or libraries might be incorrect.)"
5426 *) echo "Ok. Stopping Configure." >&4
5431 n) echo "OK, that should do.";;
5433 $rm_try gcctest gcctest.out
5435 : define a shorthand compile call
5439 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5440 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5444 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5445 : define a shorthand compile call for compilations that should be ok.
5449 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5451 : determine filename position in cpp output
5453 echo "Computing filename position in cpp output for #include directives..." >&4
5455 vos) testaccess=-e ;;
5458 echo '#include <stdio.h>' > foo.c
5461 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5462 $grep '^[ ]*#.*stdio\.h' | \
5463 while read cline; do
5466 while $test \$# -gt 0; do
5467 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5472 pos=\`expr \$pos + 1\`
5484 *) pos="${fieldn}th";;
5486 echo "Your cpp writes the filename in the $pos field of the line."
5489 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5490 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5493 : locate header file
5498 for usrincdir in $usrinc
5500 if test -f \$usrincdir/\$wanted; then
5501 echo "\$usrincdir/\$wanted"
5505 awkprg='{ print \$$fieldn }'
5506 echo "#include <\$wanted>" > foo\$\$.c
5507 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5508 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5509 while read cline; do
5510 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5512 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5513 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5518 # status = 0: grep returned 0 lines, case statement not executed
5519 # status = 1: headerfile found
5520 # status = 2: while loop executed, no headerfile found
5524 if test \$status -eq 1; then
5531 : define an alternate in-header-list? function
5532 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5533 cont=true; xxf="echo \"<\$1> found.\" >&4";
5534 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5535 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5537 case $# in 4) instead=instead;; *) instead="at last";; esac;
5538 while $test "$cont"; do
5540 var=$2; eval "was=\$$2";
5541 if $test "$xxx" && $test -r "$xxx";
5543 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5546 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5547 set $yyy; shift; shift; yyy=$@;
5548 case $# in 0) cont="";;
5549 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5550 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5551 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5552 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5556 do set $yyy; var=$2; eval "was=\$$2";
5557 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5558 set $yyy; shift; shift; yyy=$@;
5561 : see if stdlib is available
5562 set stdlib.h i_stdlib
5565 : check for lengths of integral types
5569 echo "Checking to see how big your integers are..." >&4
5578 printf("intsize=%d;\n", (int)sizeof(int));
5579 printf("longsize=%d;\n", (int)sizeof(long));
5580 printf("shortsize=%d;\n", (int)sizeof(short));
5585 if eval $compile_ok && $run ./try > /dev/null; then
5587 echo "Your integers are $intsize bytes long."
5588 echo "Your long integers are $longsize bytes long."
5589 echo "Your short integers are $shortsize bytes long."
5593 Help! I can't compile and run the intsize test program: please enlighten me!
5594 (This is probably a misconfiguration in your system or libraries, and
5595 you really ought to fix it. Still, I'll try anyway.)
5599 rp="What is the size of an integer (in bytes)?"
5603 rp="What is the size of a long integer (in bytes)?"
5607 rp="What is the size of a short integer (in bytes)?"
5615 : check for long long
5617 echo "Checking to see if you have long long..." >&4
5618 echo 'int main() { long long x = 7; return 0; }' > try.c
5620 if eval $compile; then
5622 echo "You have long long."
5625 echo "You do not have long long."
5631 : check for length of long long
5632 case "${d_longlong}${longlongsize}" in
5635 echo "Checking to see how big your long longs are..." >&4
5636 $cat >try.c <<'EOCP'
5640 printf("%d\n", (int)sizeof(long long));
5645 if eval $compile_ok; then
5646 longlongsize=`$run ./try`
5647 echo "Your long longs are $longlongsize bytes long."
5651 echo "(I can't seem to compile the test program. Guessing...)"
5652 rp="What is the size of a long long (in bytes)?"
5656 if $test "X$longsize" = "X$longlongsize"; then
5657 echo "(That isn't any different from an ordinary long.)"
5663 : see if inttypes.h is available
5664 : we want a real compile instead of Inhdr because some systems
5665 : have an inttypes.h which includes non-existent headers
5668 #include <inttypes.h>
5670 static int32_t foo32 = 0x12345678;
5674 if eval $compile; then
5675 echo "<inttypes.h> found." >&4
5678 echo "<inttypes.h> NOT found." >&4
5687 echo "Checking to see if you have int64_t..." >&4
5689 #include <sys/types.h>
5690 #$i_inttypes I_INTTYPES
5692 #include <inttypes.h>
5694 int main() { int64_t x = 7; }
5697 if eval $compile; then
5699 echo "You have int64_t."
5702 echo "You do not have int64_t."
5708 : Check if 64bit ints have a quad type
5710 echo "Checking which 64-bit integer type we could use..." >&4
5716 val='"unsigned int"'
5721 *) case "$longsize" in
5725 val='"unsigned long"'
5730 *) case "$d_longlong:$longlongsize" in
5735 val='"unsigned long long"'
5740 *) case "$d_int64_t" in
5759 '') echo "Alas, no 64-bit integer types in sight." >&4
5762 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5767 : Do we want 64bit support
5768 case "$uselonglong" in
5769 "$define"|true|[yY]*)
5772 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5774 use64bitint="$define"
5777 case "$use64bits" in
5778 "$define"|true|[yY]*)
5781 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5783 use64bitint="$define"
5786 case "$use64bitints" in
5787 "$define"|true|[yY]*)
5790 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5792 use64bitint="$define"
5795 case "$use64bitsint" in
5796 "$define"|true|[yY]*)
5799 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5801 use64bitint="$define"
5804 case "$uselonglongs" in
5805 "$define"|true|[yY]*)
5808 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5810 use64bitint="$define"
5813 case "$use64bitsall" in
5814 "$define"|true|[yY]*)
5817 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5819 use64bitall="$define"
5824 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5826 case "$use64bitall" in
5827 "$define"|true|[yY]*) use64bitint="$define" ;;
5833 You have natively 64-bit long integers.
5837 *) case "$use64bitint" in
5838 "$define"|true|[yY]*) dflt='y';;
5847 Perl can be built to take advantage of 64-bit integer types
5848 on some systems. To do so, Configure can be run with -Duse64bitint.
5849 Choosing this option will most probably introduce binary incompatibilities.
5851 If this doesn't make any sense to you, just accept the default '$dflt'.
5852 (The default has been chosen based on your configuration.)
5854 rp='Try to use 64-bit integers, if available?'
5857 [yY]*) val="$define" ;;
5865 case "$use64bitall" in
5866 "$define"|true|[yY]*) dflt='y' ;;
5867 *) case "$longsize" in
5875 You may also choose to try maximal 64-bitness. It means using as much
5876 64-bitness as possible on the platform. This in turn means even more
5877 binary incompatibilities. On the other hand, your platform may not
5878 have any more 64-bitness available than what you already have chosen.
5880 If this doesn't make any sense to you, just accept the default '$dflt'.
5881 (The default has been chosen based on your configuration.)
5883 rp='Try to use maximal 64-bit support, if available?'
5886 [yY]*) val="$define" ;;
5891 case "$use64bitall" in
5893 case "$use64bitint" in
5897 Since you have chosen a maximally 64-bit build, I'm also turning on
5898 the use of 64-bit integers.
5900 use64bitint="$define" ;;
5905 : Look for a hint-file generated 'call-back-unit'. If the
5906 : user has specified that a 64-bit perl is to be built,
5907 : we may need to set or change some other defaults.
5908 if $test -f use64bitint.cbu; then
5909 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5912 case "$use64bitint" in
5913 "$define"|true|[yY]*)
5915 4) case "$archname64" in
5916 '') archname64=64int ;;
5923 : Look for a hint-file generated 'call-back-unit'. If the
5924 : user has specified that a maximally 64-bit perl is to be built,
5925 : we may need to set or change some other defaults.
5926 if $test -f use64bitall.cbu; then
5927 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5930 case "$use64bitall" in
5931 "$define"|true|[yY]*)
5933 4) case "$archname64" in
5934 ''|64int) archname64=64all ;;
5941 case "$d_quad:$use64bitint" in
5945 *** You have chosen to use 64-bit integers,
5946 *** but none can be found.
5947 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5948 *** Cannot continue, aborting.
5955 : check for length of double
5957 case "$doublesize" in
5959 echo "Checking to see how big your double precision numbers are..." >&4
5968 printf("%d\n", (int)sizeof(double));
5973 if eval $compile_ok; then
5974 doublesize=`$run ./try`
5975 echo "Your double is $doublesize bytes long."
5978 echo "(I can't seem to compile the test program. Guessing...)"
5979 rp="What is the size of a double precision number (in bytes)?"
5987 : check for long doubles
5989 echo "Checking to see if you have long double..." >&4
5990 echo 'int main() { long double x = 7.0; }' > try.c
5992 if eval $compile; then
5994 echo "You have long double."
5997 echo "You do not have long double."
6003 : check for length of long double
6004 case "${d_longdbl}${longdblsize}" in
6007 echo "Checking to see how big your long doubles are..." >&4
6008 $cat >try.c <<'EOCP'
6012 printf("%d\n", sizeof(long double));
6017 if eval $compile; then
6018 longdblsize=`$run ./try`
6019 echo "Your long doubles are $longdblsize bytes long."
6023 echo "(I can't seem to compile the test program. Guessing...)" >&4
6024 rp="What is the size of a long double (in bytes)?"
6028 if $test "X$doublesize" = "X$longdblsize"; then
6029 echo "That isn't any different from an ordinary double."
6030 echo "I'll keep your setting anyway, but you may see some"
6031 echo "harmless compilation warnings."
6037 : determine the architecture name
6039 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6040 tarch=`arch`"-$osname"
6041 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6042 if uname -m > tmparch 2>&1 ; then
6043 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6044 -e 's/$/'"-$osname/" tmparch`
6052 case "$myarchname" in
6055 echo "(Your architecture name used to be $myarchname.)"
6059 case "$targetarch" in
6061 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6066 *) dflt="$archname";;
6068 rp='What is your architecture name'
6071 case "$usethreads" in
6073 echo "Threads selected." >&4
6075 *-thread*) echo "...and architecture name already has -thread." >&4
6077 *) archname="$archname-thread"
6078 echo "...setting architecture name to $archname." >&4
6083 case "$usemultiplicity" in
6085 echo "Multiplicity selected." >&4
6087 *-multi*) echo "...and architecture name already has -multi." >&4
6089 *) archname="$archname-multi"
6090 echo "...setting architecture name to $archname." >&4
6095 case "$use64bitint$use64bitall" in
6097 case "$archname64" in
6099 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6102 case "$use64bitint" in
6103 "$define") echo "64 bit integers selected." >&4 ;;
6105 case "$use64bitall" in
6106 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6109 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6111 *) archname="$archname-$archname64"
6112 echo "...setting architecture name to $archname." >&4
6118 case "$uselongdouble" in
6120 echo "Long doubles selected." >&4
6121 case "$longdblsize" in
6123 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6127 *-ld*) echo "...and architecture name already has -ld." >&4
6129 *) archname="$archname-ld"
6130 echo "...setting architecture name to $archname." >&4
6137 case "$useperlio" in
6139 echo "Perlio selected." >&4
6142 echo "Perlio not selected, using stdio." >&4
6144 *-stdio*) echo "...and architecture name already has -stdio." >&4
6146 *) archname="$archname-stdio"
6147 echo "...setting architecture name to $archname." >&4
6152 if $test -f archname.cbu; then
6153 echo "Your platform has some specific hints for architecture name, using them..."
6157 : set the prefixit variable, to compute a suitable default value
6158 prefixit='case "$3" in
6160 case "$oldprefix" in
6161 "") eval "$1=\"\$$2\"";;
6168 ""|" ") eval "$1=\"\$$2\"";;
6174 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6176 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6177 /*-$oldprefix/*|\~*-$oldprefix/*)
6178 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6179 *) eval "$1=\"\$$2\"";;
6183 : determine installation style
6184 : For now, try to deduce it from prefix unless it is already set.
6185 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6186 case "$installstyle" in
6187 '') case "$prefix" in
6188 *perl*) dflt='lib';;
6189 *) dflt='lib/perl5' ;;
6192 *) dflt="$installstyle" ;;
6194 : Probably not worth prompting for this since we prompt for all
6195 : the directories individually, and the prompt would be too long and
6199 : determine where public executables go
6204 rp='Pathname where the public executables will reside?'
6206 if $test "X$ansexp" != "X$binexp"; then
6210 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6211 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6212 : this via initialinstalllocation
6215 case "$userelocatableinc" in
6216 $define|true|[yY]*) dflt='y' ;;
6221 Would you like to build Perl so that the installation is relocatable, so that
6222 library paths in @INC are determined relative to the path of the perl binary?
6223 This is not advised for system Perl installs, or if you need to run setid
6224 scripts or scripts under taint mode.
6226 If this doesn't make any sense to you, just accept the default '$dflt'.
6228 rp='Use relocatable @INC?'
6231 y|Y) val="$define" ;;
6234 set userelocatableinc
6237 initialinstalllocation="$binexp"
6238 : Default prefix is now "up one level from where the binaries are"
6239 case "$userelocatableinc" in
6245 installprefixexp=".../.."
6249 : determine where private library files go
6250 : Usual default is /usr/local/lib/perl5/$version.
6251 : Also allow things like /opt/perl/lib/$version, since
6252 : /opt/perl/lib/perl5... would be redundant.
6253 : The default "style" setting is made in installstyle.U
6254 case "$installstyle" in
6255 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6256 *) set dflt privlib lib/$version ;;
6261 There are some auxiliary files for $package that need to be put into a
6262 private library directory that is accessible by everyone.
6267 rp='Pathname where the private library files will reside?'
6272 : set the prefixup variable, to restore leading tilda escape
6273 prefixup='case "$prefixexp" in
6275 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6278 : determine where public architecture dependent libraries go
6281 : privlib default is /usr/local/lib/$package/$version
6282 : archlib default is /usr/local/lib/$package/$version/$archname
6283 : privlib may have an optional trailing /share.
6284 tdflt=`echo $privlib | $sed 's,/share$,,'`
6285 tdflt=$tdflt/$archname
6294 $spackage contains architecture-dependent library files. If you are
6295 sharing libraries in a heterogeneous environment, you might store
6296 these files in a separate location. Otherwise, you can just include
6297 them with the rest of the public library files.
6302 rp='Where do you want to put the public architecture-dependent libraries?'
6306 if $test X"$archlib" = X"$privlib"; then
6312 : see if setuid scripts can be secure
6315 Some kernels have a bug that prevents setuid #! scripts from being
6316 secure. Some sites have disabled setuid #! scripts because of this.
6318 First let's decide if your kernel supports secure setuid #! scripts.
6319 (If setuid #! scripts would be secure but have been disabled anyway,
6320 don't say that they are secure if asked.)
6325 if $test -d /dev/fd; then
6326 echo "#!$ls" >reflect
6327 chmod +x,u+s reflect
6328 ./reflect >flect 2>&1
6329 if $contains "/dev/fd" flect >/dev/null; then
6330 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6334 If you are not sure if they are secure, I can check but I'll need a
6335 username and password different from the one you are using right now.
6336 If you don't have such a username or don't want me to test, simply
6340 rp='Other username to test security of setuid scripts with?'
6345 case "$d_suidsafe" in
6346 '') echo "I'll assume setuid scripts are *not* secure." >&4
6349 echo "Well, the $hint value is *not* secure." >&4
6351 *) echo "Well, the $hint value *is* secure." >&4
6356 $rm -f reflect flect
6357 echo "#!$ls" >reflect
6358 chmod +x,u+s reflect
6361 echo '"su" will (probably) prompt you for '"$ans's password."
6362 su $ans -c './reflect >flect'
6363 if $contains "/dev/fd" flect >/dev/null; then
6364 echo "Okay, it looks like setuid scripts are secure." >&4
6367 echo "I don't think setuid scripts are secure." >&4
6372 rp='Does your kernel have *secure* setuid scripts?'
6375 [yY]*) val="$define";;
6380 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6381 echo "(That's for file descriptors, not floppy disks.)"
6387 $rm -f reflect flect
6389 : now see if they want to do setuid emulation
6390 if $test $patchlevel -lt 11; then
6393 case "$d_suidsafe" in
6396 echo "No need to emulate SUID scripts since they are secure here." >&4
6400 Some systems have disabled setuid scripts, especially systems where
6401 setuid scripts cannot be secure. On systems where setuid scripts have
6402 been disabled, the setuid/setgid bits on scripts are currently
6403 useless. It is possible for $package to detect those bits and emulate
6404 setuid/setgid in a secure fashion. This emulation will only work if
6405 setuid scripts have been disabled in your kernel.
6409 "$define") dflt=y ;;
6412 rp="Do you want to do setuid/setgid emulation?"
6415 [yY]*) val="$define";;
6427 SUID emulation has been removed for 5.12
6428 Please re-run Configure without -Dd_dosuid
6437 : Find perl5.005 or later.
6438 echo "Looking for a previously installed perl5.005 or later... "
6440 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6441 : Check if this perl is recent and can load a simple module
6442 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6445 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6455 '') echo "None found. That's ok.";;
6456 *) echo "Using $perl5." ;;
6459 : Set the siteprefix variables
6462 After $package is installed, you may wish to install various
6463 add-on modules and utilities. Typically, these add-ons will
6464 be installed under $prefix with the rest
6465 of this package. However, you may wish to install such add-ons
6466 elsewhere under a different prefix.
6468 If you do not wish to put everything under a single prefix, that's
6469 ok. You will be prompted for the individual locations; this siteprefix
6470 is only used to suggest the defaults.
6472 The default should be fine for most people.
6476 rp='Installation prefix to use for add-on modules and utilities?'
6477 : XXX Here might be another good place for an installstyle setting.
6478 case "$siteprefix" in
6480 *) dflt=$siteprefix ;;
6483 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6485 case "$siteprefix" in
6489 *) oldsiteprefix="$prefix";;
6494 siteprefixexp="$ansexp"
6496 : determine where site specific libraries go.
6497 : Usual default is /usr/local/lib/perl5/site_perl/$version
6498 : The default "style" setting is made in installstyle.U
6499 : XXX No longer works with Prefixit stuff.
6500 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6502 '') case "$installstyle" in
6503 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6504 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6512 The installation process will create a directory for
6513 site-specific extensions and modules. Most users find it convenient
6514 to place all site-specific files in this directory rather than in the
6515 main distribution directory.
6519 rp='Pathname for the site-specific library files?'
6523 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6525 : Determine list of previous versions to include in @INC
6526 $cat > getverlist <<EOPL
6529 \$api_versionstring = "$api_versionstring";
6530 \$version = "$version";
6531 \$stem = "$sitelib_stem";
6532 \$archname = "$archname";
6534 $cat >> getverlist <<'EOPL'
6535 # The list found is store twice for each entry: the original name, and
6536 # the binary broken down version as pack "sss", so sorting is easy and
6537 # unambiguous. This will work for all versions that have a maximum of
6538 # three digit groups, separate by '.'s or '_'s. Names are extended with
6539 # ".0.0" to ensure at least three elements for the pack.
6540 # -- H.Merijn Brand (m)'06 23-10-2006
6542 # Can't have leading @ because metaconfig interprets it as a command!
6543 ;@inc_version_list=();
6544 # XXX Redo to do opendir/readdir?
6547 ;@candidates = map {
6548 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6549 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
6555 ($pversion, $aversion, $vsn5005) = map {
6556 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6557 foreach $d (@candidates) {
6558 if ($d->[1] lt $pversion) {
6559 if ($d->[1] ge $aversion) {
6560 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6562 elsif ($d->[1] ge $vsn5005) {
6563 unshift(@inc_version_list, grep { -d } $d->[0]);
6567 # Skip newer version. I.e. don't look in
6568 # 5.7.0 if we're installing 5.6.1.
6572 if (@inc_version_list) {
6573 print join(' ', @inc_version_list);
6576 # Blank space to preserve value for next Configure run.
6581 case "$inc_version_list" in
6582 '') if test -x "$perl5$exe_ext"; then
6583 dflt=`$perl5 getverlist`
6588 $undef) dflt='none' ;;
6589 *) eval dflt=\"$inc_version_list\" ;;
6592 ''|' ') dflt=none ;;
6599 In order to ease the process of upgrading, this version of perl
6600 can be configured to use modules built and installed with earlier
6601 versions of perl that were installed under $prefix. Specify here
6602 the list of earlier versions that this version of perl should check.
6603 If Configure detected no earlier versions of perl installed under
6604 $prefix, then the list will be empty. Answer 'none' to tell perl
6605 to not search earlier versions.
6607 The default should almost always be sensible, so if you're not sure,
6608 just accept the default.
6611 rp='List of earlier versions to include in @INC?'
6614 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6615 *) inc_version_list="$ans" ;;
6617 case "$inc_version_list" in
6619 inc_version_list_init='0'
6620 d_inc_version_list="$undef"
6622 *) inc_version_list_init=`echo $inc_version_list |
6623 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6624 d_inc_version_list="$define"
6629 : see if malloc/malloc.h has to be included
6630 set malloc/malloc.h i_mallocmalloc
6633 : see if this is a malloc.h system
6634 : we want a real compile instead of Inhdr because some systems have a
6635 : malloc.h that just gives a compile error saying to use stdlib.h instead
6640 #$i_mallocmalloc I_MALLOCMALLOC
6641 #ifdef I_MALLOCMALLOC
6642 # include <malloc/malloc.h>
6645 int main () { return 0; }
6648 if eval $compile; then
6649 echo "<malloc.h> found." >&4
6652 echo "<malloc.h> NOT found." >&4
6659 : check for void type
6661 echo "Checking to see how well your C compiler groks the void type..." >&4
6662 case "$voidflags" in
6674 extern void moo(); /* function returning void */
6675 void (*goo)(); /* ptr to func returning void */
6677 void *hue; /* generic ptr */
6690 int main() { sub(); }
6692 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6693 voidflags=$defvoidused
6694 echo "Good. It appears to support void to the level $package wants.">&4
6695 if $contains warning .out >/dev/null 2>&1; then
6696 echo "However, you might get some warnings that look like this:"
6700 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6701 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6702 echo "It supports 1..."
6703 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6704 echo "It also supports 2..."
6705 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6707 echo "And it supports 4 but not 8 definitely."
6709 echo "It doesn't support 4..."
6710 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6712 echo "But it supports 8."
6715 echo "Neither does it support 8."
6719 echo "It does not support 2..."
6720 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6722 echo "But it supports 4 and 8."
6724 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6726 echo "And it supports 4 but has not heard about 8."
6728 echo "However it supports 8 but not 4."
6733 echo "There is no support at all for void."
6738 case "$voidflags" in
6741 Support flag bits are:
6742 1: basic void declarations.
6743 2: arrays of pointers to functions returning void.
6744 4: operations between pointers to and addresses of void functions.
6745 8: generic void pointers.
6748 rp="Your void support flags add up to what?"
6755 : check for length of pointer
6759 echo "Checking to see how big your pointers are..." >&4
6760 if test "$voidflags" -gt 7; then
6761 echo '#define VOID_PTR char *' > try.c
6763 echo '#define VOID_PTR void *' > try.c
6773 printf("%d\n", (int)sizeof(VOID_PTR));
6778 if eval $compile_ok; then
6779 ptrsize=`$run ./try`
6780 echo "Your pointers are $ptrsize bytes long."
6783 echo "(I can't seem to compile the test program. Guessing...)" >&4
6784 rp="What is the size of a pointer (in bytes)?"
6791 case "$use64bitall" in
6792 "$define"|true|[yY]*)
6796 *** You have chosen a maximally 64-bit build,
6797 *** but your pointers are only 4 bytes wide.
6798 *** Please rerun Configure without -Duse64bitall.
6803 *** Since you have quads, you could possibly try with -Duse64bitint.
6808 *** Cannot continue, aborting.
6819 : determine whether to use malloc wrapping
6821 case "$usemallocwrap" in
6822 [yY]*|true|$define) dflt='y' ;;
6823 [nN]*|false|$undef) dflt='n' ;;
6824 *) case "$usedevel" in
6825 [yY]*|true|$define) dflt='y' ;;
6830 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6832 usemallocwrap="$ans"
6835 usemallocwrap="$define" ;;
6837 usemallocwrap="$undef" ;;
6840 : determine which malloc to compile in
6842 case "$usemymalloc" in
6843 [yY]*|true|$define) dflt='y' ;;
6844 [nN]*|false|$undef) dflt='n' ;;
6845 *) case "$ptrsize" in
6851 rp="Do you wish to attempt to use the malloc that comes with $package?"
6857 mallocsrc='malloc.c'
6858 mallocobj="malloc$_o"
6859 d_mymalloc="$define"
6862 : Remove malloc from list of libraries to use
6863 echo "Removing unneeded -lmalloc from library list" >&4
6864 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6867 echo "libs = $libs" >&4
6879 : compute the return types of malloc and free
6881 $cat >malloc.c <<END
6885 #include <sys/types.h>
6899 case "$malloctype" in
6901 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6908 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6912 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6919 echo "Your system uses $freetype free(), it would seem." >&4
6921 : determine where site specific architecture-dependent libraries go.
6922 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6923 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6924 : sitelib may have an optional trailing /share.
6926 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6927 dflt="$dflt/$archname"
6932 set sitearch sitearch none
6936 The installation process will also create a directory for
6937 architecture-dependent site-specific extensions and modules.
6941 rp='Pathname for the site-specific architecture-dependent library files?'
6945 if $test X"$sitearch" = X"$sitelib"; then
6948 d_sitearch="$define"
6951 : Set the vendorprefix variables
6954 The installation process will also create a directory for
6955 vendor-supplied add-ons. Vendors who supply perl with their system
6956 may find it convenient to place all vendor-supplied files in this
6957 directory rather than in the main distribution directory. This will
6958 ease upgrades between binary-compatible maintenance versions of perl.
6960 Of course you may also use these directories in whatever way you see
6961 fit. For example, you might use them to access modules shared over a
6962 company-wide network.
6964 The default answer should be fine for most people.
6965 This causes further questions about vendor add-ons to be skipped
6966 and no vendor-specific directories will be configured for perl.
6969 rp='Do you want to configure vendor-specific add-on directories?'
6970 case "$usevendorprefix" in
6971 define|true|[yY]*) dflt=y ;;
6972 *) : User may have set vendorprefix directly on Configure command line.
6973 case "$vendorprefix" in
6982 rp='Installation prefix to use for vendor-supplied add-ons?'
6983 case "$vendorprefix" in
6985 *) dflt=$vendorprefix ;;
6988 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6990 case "$vendorprefix" in
6994 *) oldvendorprefix="$prefix";;
6998 usevendorprefix="$define"
7000 vendorprefixexp="$ansexp"
7002 *) usevendorprefix="$undef"
7008 : Set the vendorlib variables
7009 case "$vendorprefix" in
7010 '') d_vendorlib="$undef"
7014 *) d_vendorlib="$define"
7015 : determine where vendor-supplied modules go.
7016 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7017 case "$vendorlib" in
7019 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7020 case "$installstyle" in
7021 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7022 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7025 *) dflt="$vendorlib"
7029 rp='Pathname for the vendor-supplied library files?'
7032 vendorlibexp="$ansexp"
7035 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7039 : Set the vendorarch variables
7040 case "$vendorprefix" in
7041 '') d_vendorarch="$undef"
7045 *) d_vendorarch="$define"
7046 : determine where vendor-supplied architecture-dependent libraries go.
7047 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7048 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7049 : vendorlib may have an optional trailing /share.
7050 case "$vendorarch" in
7051 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7052 dflt="$dflt/$archname"
7054 *) dflt="$vendorarch" ;;
7057 rp='Pathname for vendor-supplied architecture-dependent files?'
7060 vendorarchexp="$ansexp"
7063 prefixvar=vendorarch
7065 if $test X"$vendorarch" = X"$vendorlib"; then
7066 d_vendorarch="$undef"
7068 d_vendorarch="$define"
7071 : Final catch-all directories to search
7074 Lastly, you can have perl look in other directories for extensions and
7075 modules in addition to those already specified.
7076 These directories will be searched after
7080 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7081 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7083 case "$otherlibdirs" in
7084 ''|' ') dflt='none' ;;
7085 *) dflt="$otherlibdirs" ;;
7088 Enter a colon-separated set of extra paths to include in perl's @INC
7089 search path, or enter 'none' for no extra paths.
7093 rp='Colon-separated list of additional directories for perl to search?'
7096 ' '|''|none) otherlibdirs=' ' ;;
7097 *) otherlibdirs="$ans" ;;
7099 case "$otherlibdirs" in
7103 set d_perl_otherlibdirs
7106 : Cruising for prototypes
7108 echo "Checking out function prototypes..." >&4
7109 $cat >prototype.c <<EOCP
7114 int main(int argc, char *argv[]) {
7117 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7118 echo "Your C compiler appears to support function prototypes."
7121 echo "Your C compiler doesn't seem to understand function prototypes."
7128 : Check if ansi2knr is required
7129 case "$prototype" in
7131 *) ansi2knr='ansi2knr'
7136 This version of $package can only be compiled by a compiler that
7137 understands function prototypes. Unfortunately, your C compiler
7139 doesn't seem to understand them. Sorry about that.
7141 If GNU cc is available for your system, perhaps you could try that instead.
7143 Eventually, we hope to support building Perl with pre-ANSI compilers.
7144 If you would like to help in that effort, please contact <perlbug@perl.org>.
7146 Aborting Configure now.
7153 dflt_dtrace='/usr/sbin/dtrace'
7154 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
7158 Perl can be built to support DTrace on platforms that support it.
7159 DTrace is a diagnosis and performance analysis tool from Sun.
7161 If this doesn't make any sense to you, just accept the default '$dflt'.
7165 case "$usedtrace" in
7171 dflt_dtrace=$usedtrace
7178 rp='Support DTrace if available?'
7181 y|Y) val="$define" ;;
7187 test "X$usedtrace" != "X$define" && break
7190 rp='Where is the dtrace executable?'
7199 if $dtrace -h -s ../perldtrace.d \
7200 -o perldtrace.tmp >/dev/null 2>&1 \
7201 && rm -f perldtrace.tmp
7204 echo "Good: your $dtrace knows about the -h flag."
7208 *** $me: Fatal Error: $dtrace doesn't support -h flag
7210 *** Your installed dtrace doesn't support the -h switch to compile a D
7211 *** program into a C header. Can't continue.
7223 *** $me: Fatal Error: $dtrace not found.
7230 echo "*** $dtrace was not found."
7236 : See if we want extra modules installed
7243 Perl can be built with extra modules or bundles of modules which
7244 will be fetched from the CPAN and installed alongside Perl.
7246 Notice that you will need access to the CPAN; either via the Internet,
7247 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7248 be asked later to configure the CPAN.pm module which will in turn do
7249 the installation of the rest of the extra modules or bundles.)
7251 Notice also that if the modules require any external software such as
7252 libraries and headers (the libz library and the zlib.h header for the
7253 Compress::Zlib module, for example) you MUST have any such software
7254 already installed, this configuration process will NOT install such
7257 If this doesn't make any sense to you, just accept the default '$dflt'.
7259 rp='Install any extra modules (y or n)?'
7265 Please list any extra modules or bundles to be installed from CPAN,
7266 with spaces between the names. The names can be in any format the
7267 'install' command of CPAN.pm will understand. (Answer 'none',
7268 without the quotes, to install no extra modules or bundles.)
7278 $rm -f ../extras.lst
7280 *) echo "(Saving the list of extras for later...)"
7281 echo "$extras" > ../extras.lst
7289 : determine where html pages for programs go
7290 set html1dir html1dir none
7294 If you wish to install html files for programs in $spackage, indicate
7295 the appropriate directory here. To skip installing html files,
7299 ''|none|$undef|' ') dflt=none ;;
7300 *) dflt=$html1dir ;;
7303 rp="Directory for the main $spackage html pages?"
7307 : Use ' ' for none so value is preserved next time through Configure
7308 $test X"$html1dir" = "X" && html1dir=' '
7310 : determine where html pages for libraries and modules go
7311 set html3dir html3dir none
7315 If you wish to install html files for modules associated with $spackage,
7316 indicate the appropriate directory here. To skip installing html files,
7319 : There is no obvious default. If they have specified html1dir, then
7320 : try to key off that, possibly changing .../html1 into .../html3.
7322 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7323 *) dflt=$html3dir ;;
7326 rp="Directory for the $spackage module html pages?"
7330 : Use ' ' for none so value is preserved next time through Configure
7331 $test X"$html3dir" = "X" && html3dir=' '
7333 : determine whether to install perl also as /usr/bin/perl
7336 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7338 Many scripts expect perl to be installed as /usr/bin/perl.
7340 If you want to, I can install the perl you are about to compile
7341 as /usr/bin/perl (in addition to $bin/perl).
7343 if test -f /usr/bin/perl; then
7346 However, please note that because you already have a /usr/bin/perl,
7347 overwriting that with a new Perl would very probably cause problems.
7348 Therefore I'm assuming you don't want to do that (unless you insist).
7351 case "$installusrbinperl" in
7352 "$define"|[yY]*) dflt='y';;
7358 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7361 case "$installusrbinperl" in
7362 "$undef"|[nN]*) dflt='n';;
7366 rp="Do you want to install perl as /usr/bin/perl?"
7369 [yY]*) val="$define";;
7375 set installusrbinperl
7378 : Check if we are using the GNU C library
7380 echo "Checking for GNU C Library..." >&4
7382 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7383 alone are insufficient to distinguish different versions, such as
7384 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7385 libc version 2.1.0. A. Dougherty, June 3, 2002.
7391 # ifdef __GLIBC_MINOR__
7392 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7393 # include <gnu/libc-version.h>
7394 printf("%s\n", gnu_get_libc_version());
7396 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7399 printf("%d\n", __GLIBC__);
7408 if eval $compile_ok && $run ./try > glibc.ver; then
7410 gnulibc_version=`$cat glibc.ver`
7411 echo "You are using the GNU C Library version $gnulibc_version"
7415 echo "You are not using the GNU C Library"
7421 : see if nm is to be used to determine whether a symbol is defined or not
7425 case "$d_gnulibc" in
7428 echo "nm probably won't work on the GNU C Library." >&4
7434 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7436 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7437 echo "'nm' won't be sufficient on this sytem." >&4
7443 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7444 if $test $dflt -gt 20; then
7454 true|$define) dflt=y;;
7461 I can use $nm to extract the symbols from your C libraries. This
7462 is a time consuming task which may generate huge output on the disk (up
7463 to 3 megabytes) but that should make the symbols extraction faster. The
7464 alternative is to skip the 'nm' extraction part and to compile a small
7465 test program instead to determine whether each symbol is present. If
7466 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7467 this may be the best solution.
7469 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7472 rp="Shall I use $nm to extract C symbols from the libraries?"
7475 [Nn]*) usenm=false;;
7484 : nm options which may be necessary
7486 '') if $test -f /mach_boot; then
7488 elif $test -d /usr/ccs/lib; then
7489 nm_opt='-p' # Solaris (and SunOS?)
7490 elif $test -f /dgux; then
7492 elif $test -f /lib64/rld; then
7493 nm_opt='-p' # 64-bit Irix
7499 : nm options which may be necessary for shared libraries but illegal
7500 : for archive libraries. Thank you, Linux.
7501 case "$nm_so_opt" in
7502 '') case "$myuname" in
7504 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7505 nm_so_opt='--dynamic'
7512 : Figure out where the libc is located
7515 : get list of predefined functions in a handy place
7520 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7526 *) for thislib in $libs; do
7529 : Handle C library specially below.
7532 thislib=`echo $thislib | $sed -e 's/^-l//'`
7533 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7535 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7537 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7539 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7541 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7543 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7545 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7550 libnames="$libnames $try"
7552 *) libnames="$libnames $thislib" ;;
7561 for xxx in $libpth; do
7562 $test -r $1 || set $xxx/libc.$so
7563 : The messy sed command sorts on library version numbers.
7565 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7566 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7568 s/[0-9][0-9]*/0000&/g
7569 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7572 $sort | $sed -e 's/^.* //'`
7575 $test -r $1 || set /usr/ccs/lib/libc.$so
7576 $test -r $1 || set /lib/libsys_s$_a
7582 if $test -r "$1"; then
7583 echo "Your (shared) C library seems to be in $1."
7585 elif $test -r /lib/libc && $test -r /lib/clib; then
7586 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7588 libc='/lib/clib /lib/libc'
7589 if $test -r /lib/syslib; then
7590 echo "(Your math library is in /lib/syslib.)"
7591 libc="$libc /lib/syslib"
7593 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7594 echo "Your C library seems to be in $libc, as you said before."
7595 elif $test -r $incpath/usr/lib/libc$_a; then
7596 libc=$incpath/usr/lib/libc$_a;
7597 echo "Your C library seems to be in $libc. That's fine."
7598 elif $test -r /lib/libc$_a; then
7600 echo "Your C library seems to be in $libc. You're normal."
7602 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7604 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7605 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7606 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7608 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7610 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7613 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7615 if $test -r "$tans"; then
7616 echo "Your C library seems to be in $tans, of all places."
7622 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7626 If the guess above is wrong (which it might be if you're using a strange
7627 compiler, or your machine supports multiple models), you can override it here.
7632 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7634 I can't seem to find your C library. I've looked in the following places:
7637 $sed 's/^/ /' libpath
7640 None of these seems to contain your C library. I need to get its name...
7645 rp='Where is your C library?'
7650 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7651 set X `cat libnames`
7654 case $# in 1) xxx=file; esac
7655 echo "Extracting names from the following $xxx for later perusal:" >&4
7657 $sed 's/^/ /' libnames >&4
7659 $echo $n "This may take a while...$c" >&4
7663 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7664 *) $nm $nm_opt $file 2>/dev/null;;
7669 $grep fprintf libc.tmp > libc.ptf
7670 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7671 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7673 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7675 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7677 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7679 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7681 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7683 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7685 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7687 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7689 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7691 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7693 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7695 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7697 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7698 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7700 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7702 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7704 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7706 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7708 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7710 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7712 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7714 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7716 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7718 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7720 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7722 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7724 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7726 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7728 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7731 $nm -p $* 2>/dev/null >libc.tmp
7732 $grep fprintf libc.tmp > libc.ptf
7733 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7734 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7740 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7742 if $ar t $libc > libc.tmp && \
7743 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7745 for thisname in $libnames $libc; do
7746 $ar t $thisname >>libc.tmp
7748 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7750 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7751 for thisname in $libnames $libc; do
7752 $ar tv $thisname >>libc.tmp
7753 emximp -o tmp.imp $thisname \
7755 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7756 < tmp.imp >>libc.tmp
7759 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7762 echo "$ar didn't seem to work right." >&4
7763 echo "Maybe this is a Cray...trying bld instead..." >&4
7765 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7768 for thisname in $libnames; do
7770 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7771 $ar t $thisname >>libc.tmp
7775 echo "That didn't work either. Giving up." >&4
7785 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7786 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7788 *) if $test -f /lib/syscalls.exp; then
7790 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7791 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7792 /lib/syscalls.exp >>libc.list
7798 $rm -f libnames libpath
7800 : see if dld is available
7804 : Check if we are using C++
7806 echo "Checking for C++..." >&4
7807 $cat >try.c <<'EOCP'
7819 if eval $compile_ok && $run ./try; then
7821 echo "You are using a C++ compiler."
7824 echo "You are not using a C++ compiler."
7830 : is a C symbol defined?
7833 -v) tf=libc.tmp; tdc="";;
7834 -a) tf=libc.tmp; tdc="[]";;
7835 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7837 case "$d_cplusplus" in
7838 $define) extern_C="extern \"C\"" ;;
7839 *) extern_C="extern" ;;
7842 case "$reuseval-$4" in
7844 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7849 if $test "$runnm" = true; then
7850 if $contains $tlook $tf >/dev/null 2>&1; then
7852 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7853 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7854 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7855 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7859 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7860 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7866 $define) tval=true;;
7873 : define an is-in-libc? function
7874 inlibc='echo " "; td=$define; tu=$undef;
7875 sym=$1; var=$2; eval "was=\$$2";
7877 case "$reuseval$was" in
7887 echo "$sym() found." >&4;
7888 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7890 echo "$sym() NOT found." >&4;
7891 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7895 $define) echo "$sym() found." >&4;;
7896 *) echo "$sym() NOT found." >&4;;
7900 : see if dlopen exists
7902 xxx_ccflags="$ccflags"
7904 : with g++ one needs -shared to get is-in-libc to work for dlopen
7905 case "$gccversion" in
7907 *) case "$d_cplusplus" in
7908 "$define") ccflags="$ccflags -shared" ;;
7915 ccflags="$xxx_ccflags"
7917 : see if this is a unistd.h system
7918 set unistd.h i_unistd
7921 : determine which dynamic loading, if any, to compile in
7923 dldir="ext/DynaLoader"
7936 $define) dflt='y' ;;
7939 $define) dflt='y' ;;
7941 : Does a dl_xxx.xs file exist for this operating system
7942 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7945 rp="Do you wish to use dynamic loading?"
7953 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7954 dflt="$dldir/dl_${osname}.xs"
7955 elif $test "$d_dlopen" = "$define" ; then
7956 dflt="$dldir/dl_dlopen.xs"
7957 elif $test "$i_dld" = "$define" ; then
7958 dflt="$dldir/dl_dld.xs"
7963 *) dflt="$dldir/$dlsrc"
7966 echo "The following dynamic loading files are available:"
7967 : Can not go over to $dldir because getfile has path hard-coded in.
7968 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7969 rp="Source file to use for dynamic loading"
7975 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7979 Some systems may require passing special flags to $cc -c to
7980 compile modules that will be used to create a shared library.
7981 To use no flags, say "none".
7984 case "$cccdlflags" in
7985 '') case "$gccversion" in
7986 '') case "$osname" in
7988 next) dflt='none' ;;
7989 irix*) dflt='-KPIC' ;;
7990 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7991 sunos) dflt='-pic' ;;
7995 *) case "$osname" in
7996 darwin) dflt='none' ;;
7997 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8002 *) dflt="$cccdlflags" ;;
8004 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8007 none) cccdlflags=' ' ;;
8008 *) cccdlflags="$ans" ;;
8013 Some systems use ld to create libraries that can be dynamically loaded,
8014 while other systems (such as those using ELF) use $cc.
8018 '') $cat >try.c <<EOM
8019 /* Test for whether ELF binaries are produced */
8031 int i = open("a.out",O_RDONLY);
8034 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8035 exit(0); /* succeed (yes, it's ELF) */
8040 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8042 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8047 echo "I'll use ld to build dynamic libraries."
8056 rp="What command should be used to create dynamic libraries?"
8062 Some systems may require passing special flags to $ld to create a
8063 library that can be dynamically loaded. If your ld flags include
8064 -L/other/path options to locate libraries outside your loader's normal
8065 search path, you may need to specify those -L options here as well. To
8066 use no flags, say "none".
8069 case "$lddlflags" in
8070 '') case "$osname" in
8071 beos) dflt='-nostart' ;;
8072 haiku) dflt='-shared' ;;
8074 case "$gccversion" in
8075 '') dflt="$dflt +vnocompatwarnings" ;;
8078 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8079 next) dflt='none' ;;
8080 solaris) dflt='-G' ;;
8081 sunos) dflt='-assert nodefinitions' ;;
8082 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8086 *) dflt="$lddlflags" ;;
8089 : Try to guess additional flags to pick up local libraries.
8090 : Be careful not to append to a plain 'none'
8094 for thisflag in $ldflags; do
8099 *) dflt="$dflt $thisflag" ;;
8106 ''|' ') dflt='none' ;;
8110 *-fstack-protector*)
8112 *-fstack-protector*) ;; # Don't add it again
8113 *) dflt="$dflt -fstack-protector" ;;
8119 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8122 none) lddlflags=' ' ;;
8123 *) lddlflags="$ans" ;;
8128 Some systems may require passing special flags to $cc to indicate that
8129 the resulting executable will use dynamic linking. To use no flags,
8133 case "$ccdlflags" in
8134 '') case "$osname" in
8135 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8136 next|sunos) dflt='none' ;;
8140 *) dflt="$ccdlflags" ;;
8142 rp="Any special flags to pass to $cc to use dynamic linking?"
8145 none) ccdlflags=' ' ;;
8146 *) ccdlflags="$ans" ;;
8157 : Do we want a shared libperl?
8161 # No dynamic loading being used, so don't bother even to prompt.
8164 *) case "$useshrplib" in
8165 '') case "$osname" in
8166 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|haiku|cygwin*)
8168 also='Building a shared libperl is required for dynamic loading to work on your system.'
8173 also='Building a shared libperl is needed for MAB support.'
8191 The perl executable is normally obtained by linking perlmain.c with
8192 libperl${_a}, any static extensions (usually just DynaLoader), and
8193 any other libraries needed on this system (such as -lm, etc.). Since
8194 your system supports dynamic loading, it is probably possible to build
8195 a shared libperl.$so. If you will have more than one executable linked
8196 to libperl.$so, this will significantly reduce the size of each
8197 executable, but it may have a noticeable effect on performance. The
8198 default is probably sensible for your system.
8202 rp="Build a shared libperl.$so (y/n)"
8206 useshrplib='true' ;;
8207 *) useshrplib='false' ;;
8212 case "$useshrplib" in
8214 case "$userelocatableinc" in
8216 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8217 echo "See INSTALL for an explanation why that won't work." >&4
8223 # Figure out a good name for libperl.so. Since it gets stored in
8224 # a version-specific architecture-dependent library, the version
8225 # number isn't really that important, except for making cc/ld happy.
8227 # A name such as libperl.so.10.1
8228 majmin="libperl.$so.$patchlevel.$subversion"
8229 # A name such as libperl.so.100
8230 majonly=`echo $patchlevel $subversion |
8231 $awk '{printf "%d%02d", $1, $2}'`
8232 majonly=libperl.$so.$majonly
8233 # I'd prefer to keep the os-specific stuff here to a minimum, and
8234 # rely on figuring it out from the naming of libc.
8235 case "${osname}${osvers}" in
8238 # XXX How handle the --version stuff for MAB?
8240 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8243 cygwin*) # ld links now against the dll directly
8244 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8245 majonly=`echo $patchlevel $subversion |
8246 $awk '{printf "%03d%03d", $1, $2}'`
8247 majonly=cygperl5.$majonly.$so
8250 *) # Try to guess based on whether libc has major.minor.
8252 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8253 *libc.$so.[0-9]*) dflt=$majonly ;;
8254 *) dflt=libperl.$so ;;
8264 I need to select a good name for the shared libperl. If your system uses
8265 library names with major and minor numbers, then you might want something
8266 like $majmin. Alternatively, if your system uses a single version
8267 number for shared libraries, then you might want to use $majonly.
8268 Or, your system might be quite happy with a simple libperl.$so.
8270 Since the shared libperl will get installed into a version-specific
8271 architecture-dependent directory, the version number of the shared perl
8272 library probably isn't important, so the default should be o.k.
8275 rp='What name do you want to give to the shared libperl?'
8278 echo "Ok, I'll use $libperl"
8281 libperl="libperl${_a}"
8285 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8289 WARNING: Use of the shrpdir variable for the installation location of
8290 the shared $libperl is not supported. It was never documented and
8291 will not work in this version. Let me (perlbug@perl.org)
8292 know of any problems this may cause.
8298 But your current setting of $shrpdir is
8299 the default anyway, so it's harmless.
8304 Further, your current attempted setting of $shrpdir
8305 conflicts with the value of $archlibexp/CORE
8306 that installperl will use.
8313 # How will the perl executable find the installed shared $libperl?
8314 # Add $xxx to ccdlflags.
8315 # If we can't figure out a command-line option, use $shrpenv to
8316 # set env LD_RUN_PATH. The main perl makefile uses this.
8317 shrpdir=$archlibexp/CORE
8320 if "$useshrplib"; then
8323 # We'll set it in Makefile.SH...
8328 freebsd|netbsd|openbsd|interix|dragonfly)
8329 xxx="-Wl,-R$shrpdir"
8331 bsdos|linux|irix*|dec_osf|gnu*)
8332 xxx="-Wl,-rpath,$shrpdir"
8335 # next doesn't like the default...
8338 # beos doesn't like the default, either.
8341 # Haiku doesn't like the default, either.
8344 # hpux doesn't like the default, either.
8345 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8348 # cygwin needs only ldlibpth
8351 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8357 # Only add $xxx if it isn't already in ccdlflags.
8358 case " $ccdlflags " in
8360 *) ccdlflags="$ccdlflags $xxx"
8363 Adding $xxx to the flags
8364 passed to $ld so that the perl executable will find the
8365 installed shared $libperl.
8373 # Fix ccdlflags in AIX for building external extensions.
8374 # (For building Perl itself bare -bE:perl.exp is needed,
8375 # Makefile.SH takes care of this.)
8377 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8379 # Respect a hint or command-line value.
8381 '') shrpenv="$tmp_shrpenv" ;;
8383 case "$ldlibpthname" in
8384 '') ldlibpthname=LD_LIBRARY_PATH ;;
8385 none) ldlibpthname='' ;;
8388 : determine where manual pages are on this system
8392 syspath='/usr/share/man/man1 /usr/man/man1'
8393 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8394 syspath="$syspath /usr/man/u_man/man1"
8395 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8396 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8397 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8398 sysman=`./loc . /usr/man/man1 $syspath`
8401 if $test -d "$sysman"; then
8402 echo "System manual is in $sysman." >&4
8404 echo "Could not find manual pages in source form." >&4
8407 : determine where manual pages go
8408 set man1dir man1dir none
8412 $spackage has manual pages available in source form.
8416 echo "However, you don't have nroff, so they're probably useless to you."
8418 '') man1dir="none";;
8421 echo "If you don't want the manual sources installed, answer 'none'."
8426 lookpath="$prefixexp/share/man/man1"
8427 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8428 lookpath="$lookpath $prefixexp/man/p_man/man1"
8429 lookpath="$lookpath $prefixexp/man/u_man/man1"
8430 lookpath="$lookpath $prefixexp/man/man.1"
8432 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8433 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8443 rp="Where do the main $spackage manual pages (source) go?"
8445 if $test "X$man1direxp" != "X$ansexp"; then
8456 : What suffix to use on installed man pages
8463 rp="What suffix should be used for the main $spackage man pages?"
8465 '') case "$man1dir" in
8479 *) dflt="$man1ext";;
8486 : see if we can have long filenames
8488 first=123456789abcdef
8490 if (echo hi >$first) 2>/dev/null; then
8491 if $test -f 123456789abcde; then
8492 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8495 echo 'You can have filenames longer than 14 characters.'>&4
8500 You can't have filenames longer than 14 chars.
8501 You can't even think about them!
8507 $rm -rf 123456789abcde*
8509 : determine where library module manual pages go
8510 set man3dir man3dir none
8514 $spackage has manual pages for many of the library modules.
8520 However, you don't have nroff, so they're probably useless to you.
8523 '') man3dir="none";;
8527 case "$d_flexfnam" in
8530 However, your system can't handle the long file names like File::Basename.3.
8533 '') man3dir="none";;
8537 echo "If you don't want the manual sources installed, answer 'none'."
8538 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8540 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8541 if $test -d "$privlib/man/man3"; then
8544 WARNING: Previous versions of perl installed man3 pages into
8545 $privlib/man/man3. This version will suggest a
8546 new default of $dflt.
8550 rp='Do you wish to preserve the old behavior?(y/n)'
8553 y*) dflt="$privlib/man/man3" ;;
8558 *) dflt="$man3dir" ;;
8565 rp="Where do the $package library man pages (source) go?"
8575 : What suffix to use on installed man pages
8581 rp="What suffix should be used for the $package library man pages?"
8583 '') case "$man3dir" in
8597 *) dflt="$man3ext";;
8604 : see if we have to deal with yellow pages, now NIS.
8605 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8606 if $test -f /usr/etc/nibindd; then
8608 echo "I'm fairly confident you're on a NeXT."
8610 rp='Do you get the hosts file via NetInfo?'
8619 y*) hostcat='nidump hosts .';;
8620 *) case "$hostcat" in
8621 nidump*) hostcat='';;
8631 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8639 rp='Are you getting the hosts file via yellow pages?'
8642 y*) hostcat='ypcat hosts';;
8643 *) hostcat='cat /etc/hosts';;
8649 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8652 '') test -f /etc/group && groupcat='cat /etc/group';;
8655 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8658 : now get the host name
8660 echo "Figuring out host name..." >&4
8661 case "$myhostname" in
8663 echo 'Maybe "hostname" will work...'
8664 if tans=`sh -c hostname 2>&1` ; then
8672 if $test "$cont"; then
8674 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8675 if tans=`cat /etc/systemid 2>&1` ; then
8677 phostname='cat /etc/systemid'
8678 echo "Whadyaknow. Xenix always was a bit strange..."
8681 elif $test -r /etc/systemid; then
8682 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8685 if $test "$cont"; then
8686 echo 'No, maybe "uuname -l" will work...'
8687 if tans=`sh -c 'uuname -l' 2>&1` ; then
8689 phostname='uuname -l'
8691 echo 'Strange. Maybe "uname -n" will work...'
8692 if tans=`sh -c 'uname -n' 2>&1` ; then
8694 phostname='uname -n'
8696 echo 'Oh well, maybe I can mine it out of whoami.h...'
8697 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8698 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8699 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8701 case "$myhostname" in
8702 '') echo "Does this machine have an identity crisis or something?"
8705 echo "Well, you said $myhostname before..."
8706 phostname='echo $myhostname';;
8712 case "$myhostname" in
8713 '') myhostname=noname ;;
8715 : you do not want to know about this
8720 if $test "$myhostname" ; then
8722 rp='Your host name appears to be "'$myhostname'".'" Right?"
8730 : bad guess or no guess
8731 while $test "X$myhostname" = X ; do
8733 rp="Please type the (one word) name of your host:"
8738 : translate upper to lower if necessary
8739 case "$myhostname" in
8741 echo "(Normalizing case in your host name)"
8742 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8746 case "$myhostname" in
8748 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8749 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8750 echo "(Trimming domain name from host name--host name is now $myhostname)"
8752 *) case "$mydomain" in
8755 test "X$hostcat" = "Xypcat hosts" &&
8756 ypmatch "$myhostname" hosts 2>/dev/null |\
8757 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8760 test "X$hostcat" != "X" &&
8761 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8762 /[ ]$myhostname[ . ]/p" > hosts
8765 if $test -f hosts; then
8766 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8767 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8768 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8769 hosts | $sort | $uniq | \
8770 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8771 case `$echo X$dflt` in
8772 X*\ *) echo "(Several hosts in the database matched hostname)"
8775 X.) echo "(You do not have fully-qualified names in the hosts database)"
8779 echo "(I cannot locate a hosts database anywhere)"
8784 tans=`./loc resolv.conf X /etc /usr/etc`
8785 if $test -f "$tans"; then
8786 echo "(Attempting domain name extraction from $tans)"
8787 dflt=.`$sed -n -e 's/ / /g' \
8788 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8791 .) dflt=.`$sed -n -e 's/ / /g' \
8792 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8800 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8801 dflt=.`sh -c domainname 2>/dev/null`
8804 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8808 case "$dflt$osname" in
8809 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8810 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8814 .) echo "(Lost all hope -- silly guess then)"
8820 *) dflt="$mydomain";;
8824 rp="What is your domain name?"
8834 : translate upper to lower if necessary
8837 echo "(Normalizing case in your domain name)"
8838 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8842 : a little sanity check here
8843 case "$phostname" in
8846 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8847 $myhostname$mydomain|$myhostname) ;;
8849 case "$phostname" in
8851 echo "(That doesn't agree with your whoami.h file, by the way.)"
8854 echo "(That doesn't agree with your $phostname command, by the way.)"
8862 : determine the e-mail address of the user who is running us
8865 I need to get your e-mail address in Internet format if possible, i.e.
8866 something like user@host.domain. Please answer accurately since I have
8867 no easy means to double check it. The default value provided below
8868 is most probably close to reality but may not be valid from outside
8869 your organization...
8873 while test "$cont"; do
8875 '') dflt="$cf_by@$myhostname$mydomain";;
8876 *) dflt="$cf_email";;
8878 rp='What is your e-mail address?'
8884 rp='Address does not look like an Internet one. Use it anyway?'
8898 : Ask e-mail of administrator
8901 If you or somebody else will be maintaining perl at your site, please
8902 fill in the correct e-mail address here so that they may be contacted
8903 if necessary. Currently, the "perlbug" program included with perl
8904 will send mail to this address in addition to perlbug@perl.org. You may
8905 enter "none" for no administrator.
8908 case "$perladmin" in
8909 '') dflt="$cf_email";;
8910 *) dflt="$perladmin";;
8912 rp='Perl administrator e-mail address'
8916 : determine whether to only install version-specific parts.
8919 Do you want to install only the version-specific parts of the perl
8920 distribution? Usually you do *not* want to do this.
8922 case "$versiononly" in
8923 "$define"|[Yy]*|true) dflt='y' ;;
8926 rp="Do you want to install only the version-specific parts of perl?"
8929 [yY]*) val="$define";;
8935 case "$versiononly" in
8936 "$define") inc_version_list=''
8937 inc_version_list_init=0
8941 : figure out how to guarantee perl startup
8942 : XXX Note that this currently takes advantage of the bug that binexp ignores
8943 : the Configure -Dinstallprefix setting, which in turn means that under
8944 : relocatable @INC, initialinstalllocation is what binexp started as.
8945 case "$startperl" in
8947 case "$sharpbang" in
8951 I can use the #! construct to start perl on your system. This will
8952 make startup of perl scripts faster, but may cause problems if you
8953 want to share those scripts and perl is not in a standard place
8954 ($initialinstalllocation/perl) on all your platforms. The alternative
8955 is to force a shell by starting the script with a single ':' character.
8958 case "$versiononly" in
8959 "$define") dflt="$initialinstalllocation/perl$version";;
8960 *) dflt="$initialinstalllocation/perl";;
8962 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8965 none) startperl=": # use perl";;
8966 *) startperl="#!$ans"
8967 if $test 30 -lt `echo "$ans" | wc -c`; then
8970 WARNING: Some systems limit the #! command to 32 characters.
8971 If you experience difficulty running Perl scripts with #!, try
8972 installing Perl in a directory with a shorter pathname.
8978 *) startperl=": # use perl"
8983 echo "I'll use $startperl to start perl scripts."
8985 : figure best path for perl in scripts
8988 case "$versiononly" in
8989 "$define") perlpath="$initialinstalllocation/perl$version";;
8990 *) perlpath="$initialinstalllocation/perl";;
8992 case "$startperl" in
8997 I will use the "eval 'exec'" idiom to start Perl on your system.
8998 I can use the full path of your Perl binary for this purpose, but
8999 doing so may cause problems if you want to share those scripts and
9000 Perl is not always in a standard place ($initialinstalllocation/perl).
9003 dflt="$initialinstalllocation/perl"
9004 rp="What path shall I use in \"eval 'exec'\"?"
9011 case "$startperl" in
9013 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9016 : determine where public executable scripts go
9017 set scriptdir scriptdir
9019 case "$scriptdir" in
9022 : guess some guesses
9023 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9024 $test -d /usr/share/bin && dflt=/usr/share/bin
9025 $test -d /usr/local/script && dflt=/usr/local/script
9026 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9027 $test -d $prefixexp/script && dflt=$prefixexp/script
9031 *) dflt="$scriptdir"
9036 Some installations have a separate directory just for executable scripts so
9037 that they can mount it across multiple architectures but keep the scripts in
9038 one spot. You might, for example, have a subdirectory of /usr/share for this.
9039 Or you might just lump your scripts in with all your other executables.
9043 rp='Where do you keep publicly executable scripts?'
9045 if $test "X$ansexp" != "X$scriptdirexp"; then
9051 : A little fix up for an irregularly named variable.
9052 installscript="$installscriptdir"
9054 : determine where add-on public executables go
9056 '') dflt=$siteprefix/bin ;;
9060 rp='Pathname where the add-on public executables should be installed?'
9065 : determine where add-on html pages go
9066 : There is no standard location, so try to copy the previously-selected
9067 : directory structure for the core html pages.
9068 case "$sitehtml1dir" in
9069 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9070 *) dflt=$sitehtml1dir ;;
9073 ''|' ') dflt=none ;;
9076 rp='Pathname where the site-specific html pages should be installed?'
9078 prefixvar=sitehtml1dir
9081 : determine where add-on library html pages go
9082 : There is no standard location, so try to copy the previously-selected
9083 : directory structure for the core html pages.
9084 case "$sitehtml3dir" in
9085 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9086 *) dflt=$sitehtml3dir ;;
9089 ''|' ') dflt=none ;;
9092 rp='Pathname where the site-specific library html pages should be installed?'
9094 prefixvar=sitehtml3dir
9097 : determine where add-on manual pages go
9098 case "$siteman1dir" in
9099 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9100 *) dflt=$siteman1dir ;;
9103 ''|' ') dflt=none ;;
9106 rp='Pathname where the site-specific manual pages should be installed?'
9108 prefixvar=siteman1dir
9111 : determine where add-on library man pages go
9112 case "$siteman3dir" in
9113 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9114 *) dflt=$siteman3dir ;;
9117 ''|' ') dflt=none ;;
9120 rp='Pathname where the site-specific library manual pages should be installed?'
9122 prefixvar=siteman3dir
9125 : determine where add-on public executable scripts go
9126 case "$sitescript" in
9127 '') dflt=$siteprefix/script
9128 $test -d $dflt || dflt=$sitebin ;;
9129 *) dflt="$sitescript" ;;
9132 rp='Pathname where add-on public executable scripts should be installed?'
9134 prefixvar=sitescript
9137 : Check if faststdio is requested and available
9138 case "$usefaststdio" in
9139 $define|true|[yY]*|'')
9140 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9150 Perl can be built to use 'fast stdio', which means using the stdio
9151 library but also directly manipulating the stdio buffers to enable
9152 faster I/O. Using stdio is better for backward compatibility (especially
9153 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9154 interface has been preferred instead of stdio.
9156 If this doesn't make any sense to you, just accept the default '$dflt'.
9158 rp='Use the "fast stdio" if available?'
9161 y|Y) val="$define" ;;
9168 : define an is-a-typedef? function
9169 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9171 "") inclist="sys/types.h";;
9173 eval "varval=\$$var";
9177 for inc in $inclist; do
9178 echo "#include <$inc>" >>temp.c;
9180 echo "#ifdef $type" >> temp.c;
9181 echo "printf(\"We have $type\");" >> temp.c;
9182 echo "#endif" >> temp.c;
9183 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9184 if $contains $type temp.E >/dev/null 2>&1; then
9190 *) eval "$var=\$varval";;
9193 : define an is-a-typedef? function that prompts if the type is not available.
9194 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9196 "") inclist="sys/types.h";;
9198 eval "varval=\$$var";
9202 for inc in $inclist; do
9203 echo "#include <$inc>" >>temp.c;
9205 echo "#ifdef $type" >> temp.c;
9206 echo "printf(\"We have $type\");" >> temp.c;
9207 echo "#endif" >> temp.c;
9208 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9210 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9211 if $contains $type temp.E >/dev/null 2>&1; then
9212 echo "$type found." >&4;
9215 echo "$type NOT found." >&4;
9221 *) eval "$var=\$varval";;
9224 : see what type lseek is declared as in the kernel
9225 rp="What is the type used for lseek's offset on this system?"
9226 set off_t lseektype long stdio.h sys/types.h
9230 echo "Checking to see how big your file offsets are..." >&4
9232 #include <sys/types.h>
9236 printf("%d\n", (int)sizeof($lseektype));
9241 if eval $compile_ok; then
9242 lseeksize=`$run ./try`
9243 echo "Your file offsets are $lseeksize bytes long."
9247 echo "(I can't seem to compile the test program. Guessing...)"
9248 rp="What is the size of your file offsets (in bytes)?"
9254 : see what type file positions are declared as in the library
9255 rp="What is the type for file position used by fsetpos()?"
9256 set fpos_t fpostype long stdio.h sys/types.h
9259 : Check size for Fpos_t
9262 *_t) zzz="$fpostype" ;;
9265 echo "Checking the size of $zzz..." >&4
9267 #include <sys/types.h>
9274 printf("%d\n", (int)sizeof($fpostype));
9279 if eval $compile_ok; then
9283 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9286 echo "Your $zzz is $fpossize bytes long."
9292 echo "(I can't compile the test program. Guessing...)" >&4
9293 rp="What is the size of your file positions (in bytes)?"
9298 : Check for large file support
9299 # Backward compatibility (uselfs is deprecated).
9301 "$define"|true|[yY]*)
9304 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9306 uselargefiles="$define"
9310 case "$lseeksize:$fpossize" in
9313 You can have files larger than 2 gigabytes.
9316 *) case "$uselargefiles" in
9317 "$undef"|false|[nN]*) dflt='n' ;;
9322 Perl can be built to understand large files (files larger than 2 gigabytes)
9323 on some systems. To do so, Configure can be run with -Duselargefiles.
9325 If this doesn't make any sense to you, just accept the default '$dflt'.
9327 rp='Try to understand large files, if available?'
9330 y|Y) val="$define" ;;
9337 : Look for a hint-file generated 'call-back-unit'. If the
9338 : user has specified that a large files perl is to be built,
9339 : we may need to set or change some other defaults.
9340 if $test -f uselargefiles.cbu; then
9341 echo "Your platform has some specific hints regarding large file builds, using them..."
9342 . ./uselargefiles.cbu
9344 case "$uselargefiles" in
9346 if $test -f uselargefiles.cbu; then
9348 echo "Rechecking to see how big your file offsets are..." >&4
9350 #include <sys/types.h>
9354 printf("%d\n", (int)sizeof($lseektype));
9359 if eval $compile_ok; then
9360 lseeksize=`$run ./try`
9361 $echo "Your file offsets are now $lseeksize bytes long."
9365 echo "(I can't seem to compile the test program. Guessing...)"
9366 rp="What is the size of your file offsets (in bytes)?"
9371 *_t) zzz="$fpostype" ;;
9374 $echo $n "Rechecking the size of $zzz...$c" >&4
9376 #include <sys/types.h>
9383 printf("%d\n", (int)sizeof($fpostype));
9388 if eval $compile_ok; then
9393 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9396 echo " $fpossize bytes." >&4
9402 echo "(I can't compile the test program. Guessing...)" >&4
9403 rp="What is the size of your file positions (in bytes)?"
9412 : Set the vendorbin variables
9413 case "$vendorprefix" in
9414 '') d_vendorbin="$undef"
9418 *) d_vendorbin="$define"
9419 : determine where vendor-supplied executables go.
9420 case "$vendorbin" in
9421 '') dflt=$vendorprefix/bin ;;
9422 *) dflt="$vendorbin" ;;
9425 rp='Pathname for the vendor-supplied executables directory?'
9428 vendorbinexp="$ansexp"
9434 : Set the vendorhtml1dir variables
9435 case "$vendorprefix" in
9436 '') vendorhtml1dir=''
9437 vendorhtml1direxp=''
9439 *) : determine where vendor-supplied html pages go.
9440 : There is no standard location, so try to copy the previously-selected
9441 : directory structure for the core html pages.
9442 : XXX Better default suggestions would be welcome.
9443 case "$vendorhtml1dir" in
9444 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9445 *) dflt=$vendorhtml1dir ;;
9448 ''|' ') dflt=none ;;
9451 rp='Pathname for the vendor-supplied html pages?'
9453 vendorhtml1dir="$ans"
9454 vendorhtml1direxp="$ansexp"
9457 : Use ' ' for none so value is preserved next time through Configure
9458 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9459 prefixvar=vendorhtml1dir
9462 : Set the vendorhtml3dir variables
9463 case "$vendorprefix" in
9464 '') vendorhtml3dir=''
9465 vendorhtml3direxp=''
9467 *) : determine where vendor-supplied module html pages go.
9468 : There is no standard location, so try to copy the previously-selected
9469 : directory structure for the core html pages.
9470 : XXX Better default suggestions would be welcome.
9471 case "$vendorhtml3dir" in
9472 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9473 *) dflt=$vendorhtml3dir ;;
9476 ''|' ') dflt=none ;;
9479 rp='Pathname for the vendor-supplied html pages?'
9481 vendorhtml3dir="$ans"
9482 vendorhtml3direxp="$ansexp"
9485 : Use ' ' for none so value is preserved next time through Configure
9486 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9487 prefixvar=vendorhtml3dir
9490 : Set the vendorman1dir variables
9491 case "$vendorprefix" in
9492 '') vendorman1dir=''
9495 *) : determine where vendor-supplied manual pages go.
9496 case "$vendorman1dir" in
9497 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9498 *) dflt=$vendorman1dir ;;
9501 ''|' ') dflt=none ;;
9504 rp='Pathname for the vendor-supplied manual section 1 pages?'
9506 vendorman1dir="$ans"
9507 vendorman1direxp="$ansexp"
9510 : Use ' ' for none so value is preserved next time through Configure
9511 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9512 prefixvar=vendorman1dir
9515 : Set the vendorman3dir variables
9516 case "$vendorprefix" in
9517 '') vendorman3dir=''
9520 *) : determine where vendor-supplied module manual pages go.
9521 case "$vendorman3dir" in
9522 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9523 *) dflt=$vendorman3dir ;;
9526 ''|' ') dflt=none ;;
9529 rp='Pathname for the vendor-supplied manual section 3 pages?'
9531 vendorman3dir="$ans"
9532 vendorman3direxp="$ansexp"
9535 : Use ' ' for none so value is preserved next time through Configure
9536 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9537 prefixvar=vendorman3dir
9540 : Set the vendorscript variables
9541 case "$vendorprefix" in
9542 '') d_vendorscript="$undef"
9546 *) d_vendorscript="$define"
9547 : determine where vendor-supplied scripts go.
9548 case "$vendorscript" in
9549 '') dflt=$vendorprefix/script
9550 $test -d $dflt || dflt=$vendorbin ;;
9551 *) dflt="$vendorscript" ;;
9555 The installation process will create a directory for
9556 vendor-supplied scripts.
9560 rp='Pathname for the vendor-supplied scripts directory?'
9563 vendorscriptexp="$ansexp"
9566 prefixvar=vendorscript
9569 : script used to emit important warnings
9572 if test \$# -gt 0; then
9577 echo "*** WARNING:" >&4
9578 sed -e 's/^/*** /' <msg >&4
9580 cat msg >>config.msg
9581 echo " " >>config.msg
9587 : see which of string.h or strings.h is needed
9589 strings=`./findhdr string.h`
9590 if $test "$strings" && $test -r "$strings"; then
9591 echo "Using <string.h> instead of <strings.h>." >&4
9595 strings=`./findhdr strings.h`
9596 if $test "$strings" && $test -r "$strings"; then
9597 echo "Using <strings.h> instead of <string.h>." >&4
9599 ./warn "No string header found -- You'll surely have problems."
9605 "$undef") strings=`./findhdr strings.h`;;
9606 *) strings=`./findhdr string.h`;;
9609 : see if qgcvt exists
9613 : Check print/scan long double stuff
9616 if $test X"$d_longdbl" = X"$define"; then
9618 echo "Checking how to print long doubles..." >&4
9620 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9621 $cat >try.c <<'EOCP'
9622 #include <sys/types.h>
9626 printf("%.3f\n", d);
9630 if eval $compile; then
9634 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9635 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9636 echo "We will use %f."
9642 if $test X"$sPRIfldbl" = X; then
9643 $cat >try.c <<'EOCP'
9644 #include <sys/types.h>
9647 long double d = 123.456;
9648 printf("%.3Lf\n", d);
9652 if eval $compile; then
9656 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9657 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9658 echo "We will use %Lf."
9664 if $test X"$sPRIfldbl" = X; then
9665 $cat >try.c <<'EOCP'
9666 #include <sys/types.h>
9669 long double d = 123.456;
9670 printf("%.3llf\n", d);
9674 if eval $compile; then
9678 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9679 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9680 echo "We will use %llf."
9686 if $test X"$sPRIfldbl" = X; then
9687 $cat >try.c <<'EOCP'
9688 #include <sys/types.h>
9691 long double d = 123.456;
9692 printf("%.3lf\n", d);
9696 if eval $compile; then
9700 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9701 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9702 echo "We will use %lf."
9708 if $test X"$sPRIfldbl" = X; then
9709 echo "Cannot figure out how to print long doubles." >&4
9711 sSCNfldbl=$sPRIfldbl # expect consistency
9718 case "$sPRIfldbl" in
9719 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9720 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9721 d_SCNfldbl="$undef";
9723 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9724 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9725 d_SCNfldbl="$define";
9729 : Check how to convert floats to strings.
9731 if test "X$d_Gconvert" = X; then
9734 echo "Checking for an efficient way to convert floats to strings."
9736 case "$uselongdouble" in
9737 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9739 case "$d_longdbl" in
9740 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9742 case "$d_PRIgldbl" in
9743 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9747 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9748 char *myname = "gconvert";
9751 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9752 char *myname = "gcvt";
9755 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9756 char *myname = "qgcvt";
9757 #define DOUBLETYPE long double
9760 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9762 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9764 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9767 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9769 char *myname = "sprintf";
9773 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9774 #define DOUBLETYPE long double
9776 #define DOUBLETYPE double
9788 # include <string.h>
9790 # include <strings.h>
9793 int checkit(char *expect, char *got)
9795 if (strcmp(expect, got)) {
9796 printf("%s oddity: Expected %s, got %s\n",
9797 myname, expect, got);
9807 /* This must be 1st test on (which?) platform */
9808 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9809 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9810 checkit("0.1", buf);
9812 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9813 checkit("0.01", buf);
9815 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9816 checkit("0.001", buf);
9818 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9819 checkit("0.0001", buf);
9821 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9822 if (strlen(buf) > 5)
9823 checkit("9e-005", buf); /* for Microsoft ?? */
9825 checkit("9e-05", buf);
9827 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9830 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9831 checkit("1.1", buf);
9833 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9834 checkit("1.01", buf);
9836 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9837 checkit("1.001", buf);
9839 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9840 checkit("1.0001", buf);
9842 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9843 checkit("1.00001", buf);
9845 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9846 checkit("1.000001", buf);
9848 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9851 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9854 /* Some Linux gcvt's give 1.e+5 here. */
9855 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9856 checkit("100000", buf);
9858 /* Some Linux gcvt's give -1.e+5 here. */
9859 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9860 checkit("-100000", buf);
9862 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9863 checkit("123.456", buf);
9865 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9866 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9867 /* 34 should be enough to scare even long double
9868 * places into using the e notation. */
9869 if (strlen(buf) > 5)
9870 checkit("1e+034", buf); /* for Microsoft */
9872 checkit("1e+34", buf);
9874 /* For Perl, if you add additional tests here, also add them to
9875 * t/base/num.t for benefit of platforms not using Configure or
9876 * overriding d_Gconvert */
9881 : first add preferred functions to our list
9883 for xxx_convert in $gconvert_preference; do
9884 case $xxx_convert in
9885 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9886 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9889 : then add any others
9890 for xxx_convert in gconvert gcvt sprintf; do
9893 *) xxx_list="$xxx_list $xxx_convert" ;;
9897 case "$d_longdbl$uselongdouble" in
9899 : again, add prefered functions to our list first
9901 for xxx_convert in $gconvert_ld_preference; do
9902 case $xxx_convert in
9903 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9904 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9907 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9908 for xxx_convert in qgcvt sprintf $xxx_list; do
9909 case "$xxx_ld_list" in
9910 $xxx_convert*|*" $xxx_convert"*) ;;
9911 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9914 : if sprintf cannot do long doubles, move it to the end
9915 if test "$d_PRIgldbl" != "$define"; then
9916 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9918 : if no qgcvt, remove it
9919 if test "$d_qgcvt" != "$define"; then
9920 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9923 xxx_list="$xxx_ld_list"
9927 for xxx_convert in $xxx_list; do
9928 echo "Trying $xxx_convert..."
9929 $rm -f try try$_o core
9930 set try -DTRY_$xxx_convert
9931 if eval $compile; then
9932 echo "$xxx_convert() found." >&4
9934 echo "I'll use $xxx_convert to convert floats into a string." >&4
9937 echo "...But $xxx_convert didn't work as I expected."
9941 echo "$xxx_convert NOT found." >&4
9945 if test X$xxx_convert = X; then
9946 echo "*** WHOA THERE!!! ***" >&4
9947 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9951 case "$xxx_convert" in
9952 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9953 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9954 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9955 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9956 "$define$define$define")
9957 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9958 "$define$define$undef")
9959 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9960 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9968 : see if _fwalk exists
9972 : Initialize h_fcntl
9975 : Initialize h_sysfile
9978 : access call always available on UNIX
9982 : locate the flags for 'access()'
9986 $cat >access.c <<EOCP
9987 #include <sys/types.h>
9992 #include <sys/file.h>
10005 : check sys/file.h first, no particular reason here
10006 if $test `./findhdr sys/file.h` && \
10007 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10009 echo "<sys/file.h> defines the *_OK access constants." >&4
10010 elif $test `./findhdr fcntl.h` && \
10011 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10013 echo "<fcntl.h> defines the *_OK access constants." >&4
10014 elif $test `./findhdr unistd.h` && \
10015 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10016 echo "<unistd.h> defines the *_OK access constants." >&4
10018 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10024 : see if accessx exists
10025 set accessx d_accessx
10028 : see if aintl exists
10032 : see if alarm exists
10036 : see if 64bit time functions exists
10038 set ctime64 d_ctime64
10041 set localtime64 d_localtime64
10044 set gmtime64 d_gmtime64
10047 set mktime64 d_mktime64
10050 set difftime64 d_difftime64
10053 set asctime64 d_asctime64
10056 : see if POSIX threads are available
10057 set pthread.h i_pthread
10060 : define a fucntion to check prototypes
10061 $cat > protochk <<EOSH
10064 optimize="$optimize"
10066 prototype="$prototype"
10069 usethreads=$usethreads
10070 i_pthread=$i_pthread
10071 pthread_h_first=$pthread_h_first
10074 $cat >> protochk <<'EOSH'
10079 while test $# -ge 2; do
10081 $define) echo "#include <$2>" >> try.c ;;
10082 literal) echo "$2" >> try.c ;;
10084 # Extra magic for the benefit of systems that need pthread.h
10085 # to be included early to correctly detect threadsafe functions.
10086 # Such functions must guarantee themselves, though, that the usethreads
10087 # and i_pthread have been defined, before calling protochk.
10088 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10089 echo "#include <pthread.h>" >> try.c
10094 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10095 cat >> try.c <<'EOCP'
10096 #ifdef CAN_PROTOTYPE
10097 #define _(args) args
10102 echo "$foo" >> try.c
10103 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10104 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10110 $eunicefix protochk
10112 : Define hasproto macro for Configure internal use
10113 hasproto='varname=$1; func=$2; shift; shift;
10114 while $test $# -ge 2; do
10116 $define) echo "#include <$2>";;
10120 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10121 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10122 echo "$func() prototype found.";
10125 echo "$func() prototype NOT found.";
10132 : see if sys/types.h has to be included
10133 set sys/types.h i_systypes
10136 : see if sys/select.h has to be included
10137 set sys/select.h i_sysselct
10140 : Define hasfield macro for Configure internal use
10141 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10142 while $test $# -ge 2; do
10144 $define) echo "#include <$2>";;
10148 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10150 if eval $compile; then
10159 : see if we should include time.h, sys/time.h, or both
10161 if test "X$timeincl" = X; then
10162 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10163 $echo $n "I'm now running the test program...$c"
10165 #include <sys/types.h>
10170 #ifdef SYSTIMEKERNEL
10173 #include <sys/time.h>
10176 #include <sys/select.h>
10178 #$i_stdlib I_STDLIB
10180 #include <stdlib.h>
10186 struct timeval bar;
10189 struct timezone tzp;
10191 if (foo.tm_sec == foo.tm_sec)
10194 if (bar.tv_sec == bar.tv_sec)
10201 for s_timezone in '-DS_TIMEZONE' ''; do
10203 for s_timeval in '-DS_TIMEVAL' ''; do
10204 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10205 for i_time in '' '-DI_TIME'; do
10206 for i_systime in '-DI_SYSTIME' ''; do
10209 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10210 if eval $compile; then
10211 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10215 $echo $n "Succeeded with $flags$c"
10227 *SYSTIMEKERNEL*) i_systimek="$define"
10228 timeincl=`./findhdr sys/time.h`
10229 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10230 *) i_systimek="$undef";;
10233 *I_TIME*) i_time="$define"
10234 timeincl=`./findhdr time.h`" $timeincl"
10235 echo "We'll include <time.h>." >&4;;
10236 *) i_time="$undef";;
10239 *I_SYSTIME*) i_systime="$define"
10240 timeincl=`./findhdr sys/time.h`" $timeincl"
10241 echo "We'll include <sys/time.h>." >&4;;
10242 *) i_systime="$undef";;
10246 : see if struct tm knows about tm_zone
10247 case "$i_systime$i_time" in
10250 echo "Checking to see if your struct tm has tm_zone field..." >&4
10251 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10259 case "$d_tm_tm_zone" in
10260 "$define") echo "Yes, it does." ;;
10261 *) echo "No, it doesn't." ;;
10263 : see if struct tm knows about tm_gmtoff
10264 case "$i_systime$i_time" in
10267 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10268 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10276 case "$d_tm_tm_gmtoff" in
10277 "$define") echo "Yes, it does." ;;
10278 *) echo "No, it doesn't." ;;
10281 : see if asctime_r exists
10282 set asctime_r d_asctime_r
10284 case "$d_asctime_r" in
10286 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10287 case "$d_asctime_r_proto:$usethreads" in
10288 ":define") d_asctime_r_proto=define
10289 set d_asctime_r_proto asctime_r $hdrs
10293 case "$d_asctime_r_proto" in
10295 case "$asctime_r_proto" in
10296 ''|0) try='char* asctime_r(const struct tm*, char*);'
10297 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10299 case "$asctime_r_proto" in
10300 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10301 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10303 case "$asctime_r_proto" in
10304 ''|0) try='int asctime_r(const struct tm*, char*);'
10305 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10307 case "$asctime_r_proto" in
10308 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10309 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10311 case "$asctime_r_proto" in
10312 ''|0) d_asctime_r=undef
10314 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10315 * ) case "$asctime_r_proto" in
10316 REENTRANT_PROTO*) ;;
10317 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10319 echo "Prototype: $try" ;;
10322 *) case "$usethreads" in
10323 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10330 *) asctime_r_proto=0
10334 : see if atolf exists
10338 : see if atoll exists
10342 : Look for GCC-style attribute format
10343 case "$d_attribute_format" in
10346 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10347 $cat >attrib.c <<'EOCP'
10349 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10351 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10352 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10353 echo "Your C compiler doesn't support __attribute__((format))."
10356 echo "Your C compiler supports __attribute__((format))."
10360 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10364 *) val="$d_attribute_format" ;;
10366 set d_attribute_format
10370 : Look for GCC-style attribute format with null format allowed
10371 case "$d_printf_format_null" in
10372 '') case "$d_attribute_format" in
10375 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10376 $cat >attrib.c <<EOCP
10378 #$i_stdlib I_STDLIB
10380 #include <stdlib.h>
10382 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10383 int null_printf (char* pat,...) { return (int)pat; }
10384 int main () { exit(null_printf(NULL)); }
10386 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10387 : run the executable in case it produces a run-time warning
10388 if $run ./attrib >>attrib.out 2>&1; then
10389 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10390 echo "Your C compiler doesn't allow __printf__ format to be null."
10393 echo "Your C compiler allows __printf__ format to be null."
10397 echo "Your C compiler executable failed with __printf__ format null."
10401 echo "Your C compiler fails with __printf__ format null."
10408 *) val="$d_printf_format_null" ;;
10410 set d_printf_format_null
10414 : Look for GCC-style attribute malloc
10415 case "$d_attribute_malloc" in
10418 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10419 $cat >attrib.c <<'EOCP'
10421 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10423 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10424 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10425 echo "Your C compiler doesn't support __attribute__((malloc))."
10428 echo "Your C compiler supports __attribute__((malloc))."
10432 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10436 *) val="$d_attribute_malloc" ;;
10438 set d_attribute_malloc
10442 : Look for GCC-style attribute nonnull
10443 case "$d_attribute_nonnull" in
10446 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10447 $cat >attrib.c <<'EOCP'
10449 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10451 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10452 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10453 echo "Your C compiler doesn't support __attribute__((nonnull))."
10456 echo "Your C compiler supports __attribute__((nonnull))."
10460 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10464 *) val="$d_attribute_nonnull" ;;
10466 set d_attribute_nonnull
10470 : Look for GCC-style attribute noreturn
10471 case "$d_attribute_noreturn" in
10474 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10475 $cat >attrib.c <<'EOCP'
10477 void fall_over_dead( void ) __attribute__((noreturn));
10479 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10480 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10481 echo "Your C compiler doesn't support __attribute__((noreturn))."
10484 echo "Your C compiler supports __attribute__((noreturn))."
10488 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10492 *) val="$d_attribute_noreturn" ;;
10494 set d_attribute_noreturn
10498 : Look for GCC-style attribute pure
10499 case "$d_attribute_pure" in
10502 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10503 $cat >attrib.c <<'EOCP'
10505 int square( int n ) __attribute__((pure));
10507 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10508 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10509 echo "Your C compiler doesn't support __attribute__((pure))."
10512 echo "Your C compiler supports __attribute__((pure))."
10516 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10520 *) val="$d_attribute_pure" ;;
10522 set d_attribute_pure
10526 : Look for GCC-style attribute unused
10527 case "$d_attribute_unused" in
10530 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10531 $cat >attrib.c <<'EOCP'
10533 int do_something( int dummy __attribute__((unused)), int n );
10535 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10536 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10537 echo "Your C compiler doesn't support __attribute__((unused))."
10540 echo "Your C compiler supports __attribute__((unused))."
10544 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10548 *) val="$d_attribute_unused" ;;
10550 set d_attribute_unused
10554 : Look for GCC-style attribute deprecated
10555 case "$d_attribute_deprecated" in
10558 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10559 $cat >attrib.c <<'EOCP'
10561 int I_am_deprecated(void) __attribute__((deprecated));
10563 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10564 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10565 echo "Your C compiler doesn't support __attribute__((deprecated))."
10568 echo "Your C compiler supports __attribute__((deprecated))."
10572 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10576 *) val="$d_attribute_deprecated" ;;
10578 set d_attribute_deprecated
10582 : Look for GCC-style attribute warn_unused_result
10583 case "$d_attribute_warn_unused_result" in
10586 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10587 $cat >attrib.c <<'EOCP'
10589 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10591 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10592 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10593 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10596 echo "Your C compiler supports __attribute__((warn_unused_result))."
10600 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10604 *) val="$d_attribute_warn_unused_result" ;;
10606 set d_attribute_warn_unused_result
10610 : see if bcmp exists
10614 : see if bcopy exists
10618 : see if getpgrp exists
10619 set getpgrp d_getpgrp
10622 case "$d_getpgrp" in
10625 echo "Checking to see which flavor of getpgrp is in use..."
10627 #$i_unistd I_UNISTD
10628 #include <sys/types.h>
10630 # include <unistd.h>
10632 #$i_stdlib I_STDLIB
10634 #include <stdlib.h>
10638 if (getuid() == 0) {
10639 printf("(I see you are running Configure as super-user...)\n");
10642 #ifdef TRY_BSD_PGRP
10643 if (getpgrp(1) == 0)
10652 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10653 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10655 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10656 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10659 echo "I can't seem to compile and run the test program."
10661 xxx="a USG one, i.e. you use getpgrp()."
10663 # SVR4 systems can appear rather BSD-ish.
10664 case "$i_unistd" in
10666 xxx="a BSD one, i.e. you use getpgrp(pid)."
10670 xxx="probably a USG one, i.e. you use getpgrp()."
10675 echo "Assuming your getpgrp is $xxx" >&4
10684 : see if setpgrp exists
10685 set setpgrp d_setpgrp
10688 case "$d_setpgrp" in
10691 echo "Checking to see which flavor of setpgrp is in use..."
10693 #$i_unistd I_UNISTD
10694 #include <sys/types.h>
10696 # include <unistd.h>
10698 #$i_stdlib I_STDLIB
10700 #include <stdlib.h>
10704 if (getuid() == 0) {
10705 printf("(I see you are running Configure as super-user...)\n");
10708 #ifdef TRY_BSD_PGRP
10709 if (-1 == setpgrp(1, 1))
10712 if (setpgrp() != -1)
10718 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10719 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10721 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10722 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10725 echo "(I can't seem to compile and run the test program.)"
10727 xxx="a USG one, i.e. you use setpgrp()."
10729 # SVR4 systems can appear rather BSD-ish.
10730 case "$i_unistd" in
10732 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10736 xxx="probably a USG one, i.e. you use setpgrp()."
10741 echo "Assuming your setpgrp is $xxx" >&4
10750 : Look for GCC-style __builtin_choose_expr
10751 case "$d_builtin_choose_expr" in
10754 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10755 $cat >try.c <<'EOCP'
10756 #include <assert.h>
10757 #include <stdlib.h>
10760 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10763 assert( SYRINX(1) == 2112 );
10764 assert( SYRINX(1) != 5150 );
10765 assert( SYRINX(0) == 5150 );
10766 assert( SYRINX(0) != 2112 );
10767 puts( "All good!" );
10773 if eval $compile && $run ./try; then
10774 echo "Your C compiler supports __builtin_choose_expr."
10777 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10781 *) val="$d_builtin_choose_expr" ;;
10784 set d_builtin_choose_expr
10788 : Look for GCC-style __builtin_expect
10789 case "$d_builtin_expect" in
10792 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10793 $cat >try.c <<'EOCP'
10796 if ( __builtin_expect(n, 0) ) n = 1;
10797 /* Remember shell exit code truth is 0, C truth is non-zero */
10802 if eval $compile && $run ./try; then
10803 echo "Your C compiler supports __builtin_expect."
10806 echo "Your C compiler doesn't seem to understand __builtin_expect."
10810 *) val="$d_builtin_expect" ;;
10813 set d_builtin_expect
10817 : see if bzero exists
10821 : see if stdarg is available
10823 if $test `./findhdr stdarg.h`; then
10824 echo "<stdarg.h> found." >&4
10827 echo "<stdarg.h> NOT found." >&4
10831 : see if varags is available
10833 if $test `./findhdr varargs.h`; then
10834 echo "<varargs.h> found." >&4
10836 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10839 : set up the varargs testing programs
10840 $cat > varargs.c <<EOP
10842 #include <stdarg.h>
10845 #include <varargs.h>
10849 int f(char *p, ...)
10863 p = va_arg(ap, char *);
10869 $cat > varargs <<EOP
10871 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10880 : now check which varargs header should be included
10885 if `./varargs I_STDARG`; then
10887 elif `./varargs I_VARARGS`; then
10892 if `./varargs I_VARARGS`; then
10899 echo "I could not find the definition for va_dcl... You have problems..." >&4
10900 val="$undef"; set i_stdarg; eval $setvar
10901 val="$undef"; set i_varargs; eval $setvar
10906 case "$i_varhdr" in
10908 val="$define"; set i_stdarg; eval $setvar
10909 val="$undef"; set i_varargs; eval $setvar
10912 val="$undef"; set i_stdarg; eval $setvar
10913 val="$define"; set i_varargs; eval $setvar
10916 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10920 : see if the Compiler supports C99 variadic macros
10921 case "$i_stdarg$i_stdlib" in
10923 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10926 #include <stdarg.h>
10928 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10932 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10938 if eval $compile && $run ./try 2>&1 >/dev/null; then
10939 case "`$run ./try`" in
10941 echo "You have C99 variadic macros." >&4
10942 d_c99_variadic_macros="$define"
10945 echo "You don't have functional C99 variadic macros." >&4
10946 d_c99_variadic_macros="$undef"
10950 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10951 d_c99_variadic_macros="$undef"
10956 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10957 d_c99_variadic_macros="$undef"
10961 : see if signal is declared as pointer to function returning int or void
10963 xxx=`./findhdr signal.h`
10964 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10965 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10966 echo "You have int (*signal())() instead of void." >&4
10968 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10969 echo "You have void (*signal())()." >&4
10971 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10972 echo "You have int (*signal())() instead of void." >&4
10974 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10975 echo "You have void (*signal())()." >&4
10978 case "$d_voidsig" in
10980 echo "I can't determine whether signal handler returns void or int..." >&4
10982 rp="What type does your signal handler return?"
10985 v*) val="$define";;
10989 echo "As you already told me, signal handler returns void." >&4
10992 *) echo "As you already told me, signal handler returns int." >&4
10999 case "$d_voidsig" in
11000 "$define") signal_t="void";;
11001 *) signal_t="int";;
11005 : check for ability to cast large floats to 32-bit ints.
11007 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11008 if $test "$intsize" -ge 4; then
11015 #$i_stdlib I_STDLIB
11017 #include <stdlib.h>
11019 #include <sys/types.h>
11020 #include <signal.h>
11021 $signal_t blech(int s) { exit(3); }
11028 signal(SIGFPE, blech);
11030 /* Don't let compiler optimize the test away. Store the number
11031 in a writable string for gcc to pass to sscanf under HP-UX.
11033 sprintf(str, "2147483647");
11034 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11038 /* x86 processors will probably give 0x8000 0000, which is a
11039 sign change. We don't want that. We want to mimic SPARC
11040 behavior here, which is to preserve the sign and give
11043 if (i32 != ($xxx) f)
11049 if eval $compile_ok; then
11053 echo "(I can't seem to compile the test program--assuming it can't)"
11058 echo "Yup, it can."
11061 echo "Nope, it can't."
11068 : check for ability to cast negative floats to unsigned
11070 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11073 #$i_stdlib I_STDLIB
11075 #include <stdlib.h>
11077 #include <sys/types.h>
11078 #include <signal.h>
11079 $signal_t blech(int s) { exit(7); }
11080 $signal_t blech_in_list(int s) { exit(4); }
11081 unsigned long dummy_long(unsigned long p) { return p; }
11082 unsigned int dummy_int(unsigned int p) { return p; }
11083 unsigned short dummy_short(unsigned short p) { return p; }
11087 unsigned long along;
11089 unsigned short ashort;
11093 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11094 a direct f = -123. assignment. gcc-2.8.0 reportedly
11095 optimized the whole file away
11097 /* Store the number in a writable string for gcc to pass to
11098 sscanf under HP-UX.
11100 sprintf(str, "-123");
11101 sscanf(str, "%lf", &f); /* f = -123.; */
11103 signal(SIGFPE, blech);
11104 along = (unsigned long)f;
11105 aint = (unsigned int)f;
11106 ashort = (unsigned short)f;
11107 if (along != (unsigned long)-123)
11109 if (aint != (unsigned int)-123)
11111 if (ashort != (unsigned short)-123)
11113 sprintf(str, "1073741824.");
11114 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11117 along = (unsigned long)f;
11118 if (along != 0x80000000)
11122 along = (unsigned long)f;
11123 if (along != 0x7fffffff)
11127 along = (unsigned long)f;
11128 if (along != 0x80000001)
11132 signal(SIGFPE, blech_in_list);
11133 sprintf(str, "123.");
11134 sscanf(str, "%lf", &f); /* f = 123.; */
11135 along = dummy_long((unsigned long)f);
11136 aint = dummy_int((unsigned int)f);
11137 ashort = dummy_short((unsigned short)f);
11138 if (along != (unsigned long)123)
11140 if (aint != (unsigned int)123)
11142 if (ashort != (unsigned short)123)
11149 if eval $compile_ok; then
11153 echo "(I can't seem to compile the test program--assuming it can't)"
11156 case "$castflags" in
11158 echo "Yup, it can."
11161 echo "Nope, it can't."
11168 : see if vprintf exists
11170 if set vprintf val -f d_vprintf; eval $csym; $val; then
11171 echo 'vprintf() found.' >&4
11174 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11175 #$i_varargs I_VARARGS
11177 #$i_stdlib I_STDLIB
11178 #$i_unistd I_UNISTD
11181 # include <stdarg.h>
11182 #else /* I_VARARGS */
11183 # include <varargs.h>
11187 # include <unistd.h>
11191 # include <stdlib.h>
11194 #include <stdio.h> /* vsprintf prototype */
11197 void xxx(int n, ...)
11202 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11204 int main() { xxx(1, "foo"); }
11206 #else /* I_VARARGS */
11214 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11216 int main() { xxx("foo"); }
11222 if eval $compile_ok; then
11223 if $run ./try; then
11224 echo "Your vsprintf() returns (int)." >&4
11227 echo "Your vsprintf() returns (char*)." >&4
11231 echo 'I am unable to compile the vsprintf() test program.' >&4
11232 # We shouldn't get here. If we do, assume the standard signature,
11233 # not the old BSD one.
11234 echo 'Guessing that vsprintf() returns (int).' >&4
11238 echo 'vprintf() NOT found.' >&4
11249 : see if chown exists
11253 : see if chroot exists
11254 set chroot d_chroot
11257 : see if chsize exists
11258 set chsize d_chsize
11261 : see if class exists
11265 : see if clearenv exists
11266 set clearenv d_clearenv
11269 : Define hasstruct macro for Configure internal use
11270 hasstruct='varname=$1; struct=$2; shift; shift;
11271 while $test $# -ge 2; do
11273 $define) echo "#include <$2>";;
11277 echo "int main () { struct $struct foo; }" >> try.c;
11279 if eval $compile; then
11288 : see whether socket exists
11292 $echo $n "Hmm... $c" >&4
11293 if set socket val -f d_socket; eval $csym; $val; then
11294 echo "Looks like you have Berkeley networking support." >&4
11296 if set setsockopt val -f; eval $csym; $val; then
11299 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11300 d_oldsock="$define"
11303 if $contains socklib libc.list >/dev/null 2>&1; then
11304 echo "Looks like you have Berkeley networking support." >&4
11306 : we will have to assume that it supports the 4.2 BSD interface
11309 echo "You don't have Berkeley networking in libc$_a..." >&4
11310 if test "X$d_socket" = "X$define"; then
11311 echo "...but you seem to believe that you have sockets." >&4
11313 for net in net socket
11315 if test -f /usr/lib/lib$net$_a; then
11316 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11317 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11318 if $contains socket libc.list >/dev/null 2>&1; then
11323 echo "...but the Wollongong group seems to have hacked it in." >&4
11324 sockethdr="-I/usr/netinclude"
11327 echo "Found Berkeley sockets interface in lib$net." >&4
11328 if $contains setsockopt libc.list >/dev/null 2>&1; then
11331 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11332 d_oldsock="$define"
11338 if test "X$d_socket" != "X$define"; then
11339 echo "or anywhere else I see." >&4
11347 : see if socketpair exists
11348 set socketpair d_sockpair
11353 echo "Checking the availability of certain socket constants..." >&4
11354 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11355 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11357 #include <sys/types.h>
11358 #include <sys/socket.h>
11364 set try; if eval $compile; then
11367 set d_${enum}; eval $setvar
11371 : see if this is a sys/uio.h system
11372 set sys/uio.h i_sysuio
11375 : Check for cmsghdr support
11377 echo "Checking to see if your system supports struct cmsghdr..." >&4
11378 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11380 case "$d_cmsghdr_s" in
11381 "$define") echo "Yes, it does." ;;
11382 *) echo "No, it doesn't." ;;
11386 : check for const keyword
11388 echo 'Checking to see if your C compiler knows about "const"...' >&4
11389 $cat >const.c <<'EOCP'
11390 typedef struct spug { int drokk; } spug;
11394 const spug y = { 0 };
11397 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11399 echo "Yup, it does."
11402 echo "Nope, it doesn't."
11407 : see if copysignl exists
11408 set copysignl d_copysignl
11411 : see if crypt exists
11416 $define) cryptlib='' ;;
11417 *) if set crypt val -f d_crypt; eval $csym; $val; then
11418 echo 'crypt() found.' >&4
11422 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11423 if $test -z "$cryptlib"; then
11424 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11428 if $test -z "$cryptlib"; then
11429 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11433 if $test -z "$cryptlib"; then
11434 cryptlib=`./loc libcrypt$_a "" $libpth`
11438 if $test -z "$cryptlib"; then
11439 echo 'crypt() NOT found.' >&4
11450 : see if this is a crypt.h system
11451 set crypt.h i_crypt
11454 : see if crypt_r exists
11455 set crypt_r d_crypt_r
11457 case "$d_crypt_r" in
11459 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11460 case "$d_crypt_r_proto:$usethreads" in
11461 ":define") d_crypt_r_proto=define
11462 set d_crypt_r_proto crypt_r $hdrs
11466 case "$d_crypt_r_proto" in
11468 case "$crypt_r_proto" in
11469 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11470 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11472 case "$crypt_r_proto" in
11473 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11474 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11476 case "$crypt_r_proto" in
11477 ''|0) d_crypt_r=undef
11479 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11480 * ) case "$crypt_r_proto" in
11481 REENTRANT_PROTO*) ;;
11482 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11484 echo "Prototype: $try" ;;
11487 *) case "$usethreads" in
11488 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11499 : get csh whereabouts
11501 'csh') val="$undef" ;;
11502 *) val="$define" ;;
11506 : Respect a hint or command line value for full_csh.
11507 case "$full_csh" in
11508 '') full_csh=$csh ;;
11511 : see if ctermid exists
11512 set ctermid d_ctermid
11515 : see if ctermid_r exists
11516 set ctermid_r d_ctermid_r
11518 case "$d_ctermid_r" in
11520 hdrs="$i_systypes sys/types.h define stdio.h "
11521 case "$d_ctermid_r_proto:$usethreads" in
11522 ":define") d_ctermid_r_proto=define
11523 set d_ctermid_r_proto ctermid_r $hdrs
11527 case "$d_ctermid_r_proto" in
11529 case "$ctermid_r_proto" in
11530 ''|0) try='char* ctermid_r(char*);'
11531 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11533 case "$ctermid_r_proto" in
11534 ''|0) d_ctermid_r=undef
11536 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11537 * ) case "$ctermid_r_proto" in
11538 REENTRANT_PROTO*) ;;
11539 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11541 echo "Prototype: $try" ;;
11544 *) case "$usethreads" in
11545 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11552 *) ctermid_r_proto=0
11556 : see if ctime_r exists
11557 set ctime_r d_ctime_r
11559 case "$d_ctime_r" in
11561 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11562 case "$d_ctime_r_proto:$usethreads" in
11563 ":define") d_ctime_r_proto=define
11564 set d_ctime_r_proto ctime_r $hdrs
11568 case "$d_ctime_r_proto" in
11570 case "$ctime_r_proto" in
11571 ''|0) try='char* ctime_r(const time_t*, char*);'
11572 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11574 case "$ctime_r_proto" in
11575 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11576 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11578 case "$ctime_r_proto" in
11579 ''|0) try='int ctime_r(const time_t*, char*);'
11580 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11582 case "$ctime_r_proto" in
11583 ''|0) try='int ctime_r(const time_t*, char*, int);'
11584 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11586 case "$ctime_r_proto" in
11587 ''|0) d_ctime_r=undef
11589 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11590 * ) case "$ctime_r_proto" in
11591 REENTRANT_PROTO*) ;;
11592 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11594 echo "Prototype: $try" ;;
11597 *) case "$usethreads" in
11598 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11609 : see if cuserid exists
11610 set cuserid d_cuserid
11613 : see if this is a limits.h system
11614 set limits.h i_limits
11617 : see if this is a float.h system
11618 set float.h i_float
11621 : See if number of significant digits in a double precision number is known
11623 $cat >dbl_dig.c <<EOM
11624 #$i_limits I_LIMITS
11627 #include <limits.h>
11633 printf("Contains DBL_DIG");
11636 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11637 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11638 echo "DBL_DIG found." >&4
11641 echo "DBL_DIG NOT found." >&4
11648 : see if dbm.h is available
11649 : see if dbmclose exists
11650 set dbmclose d_dbmclose
11653 case "$d_dbmclose" in
11663 *) set rpcsvc/dbm.h i_rpcsvcdbm
11668 *) echo "We won't be including <dbm.h>"
11678 : see if prototype for dbminit is available
11680 set d_dbminitproto dbminit $i_dbm dbm.h
11683 : see if difftime exists
11684 set difftime d_difftime
11687 : see if this is a dirent system
11689 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11691 echo "<dirent.h> found." >&4
11694 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11695 echo "<sys/dir.h> found." >&4
11698 xinc=`./findhdr sys/ndir.h`
11700 echo "<dirent.h> NOT found." >&4
11705 : Look for type of directory structure.
11707 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11709 case "$direntrytype" in
11711 case "$i_dirent" in
11712 $define) guess1='struct dirent' ;;
11713 *) guess1='struct direct' ;;
11716 *) guess1="$direntrytype"
11721 'struct dirent') guess2='struct direct' ;;
11722 *) guess2='struct dirent' ;;
11725 if $contains "$guess1" try.c >/dev/null 2>&1; then
11726 direntrytype="$guess1"
11727 echo "Your directory entries are $direntrytype." >&4
11728 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11729 direntrytype="$guess2"
11730 echo "Your directory entries seem to be $direntrytype." >&4
11732 echo "I don't recognize your system's directory entries." >&4
11733 rp="What type is used for directory entries on this system?"
11736 direntrytype="$ans"
11740 : see if the directory entry stores field length
11742 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11743 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11744 echo "Good, your directory entry keeps length information in d_namlen." >&4
11747 echo "Your directory entry does not know about the d_namlen field." >&4
11754 : Look for DIR.dd_fd
11755 case "$i_dirent" in
11757 echo "Checking to see if DIR has a dd_fd member variable" >&4
11759 #$i_stdlib I_STDLIB
11761 #include <stdlib.h>
11763 #include <dirent.h>
11773 if eval $compile; then
11774 echo "Yes, it does."
11777 echo "No, it does not."
11782 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11790 : see if this is an sysdir system
11791 set sys/dir.h i_sysdir
11794 : see if this is an sysndir system
11795 set sys/ndir.h i_sysndir
11800 $cat >dirfd.c <<EOM
11802 #$i_stdlib I_STDLIB
11804 #include <stdlib.h>
11806 #$i_dirent I_DIRENT /**/
11807 #$i_sysdir I_SYS_DIR /**/
11808 #$i_sysndir I_SYS_NDIR /**/
11809 #$i_systypes I_SYS_TYPES /**/
11810 #if defined(I_SYS_TYPES)
11811 #include <sys/types.h>
11813 #if defined(I_DIRENT)
11814 #include <dirent.h>
11815 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11816 #include <sys/dir.h>
11820 #include <sys/ndir.h>
11824 #include <ndir.h> /* may be wrong in the future */
11826 #include <sys/dir.h>
11832 DIR *dirp = opendir(".");
11833 if (dirfd(dirp) >= 0)
11841 if eval $compile; then
11845 $define) echo "dirfd() found." >&4 ;;
11846 *) echo "dirfd() NOT found." >&4 ;;
11852 : see if dlerror exists
11855 set dlerror d_dlerror
11859 : see if dlfcn is available
11860 set dlfcn.h i_dlfcn
11863 : Check what extension to use for shared libs
11868 On a few systems, the dynamically loaded modules that perl generates and uses
11869 will need a different extension than shared libs. The default will probably
11875 *) dflt="$dlext" ;;
11877 rp='What is the extension of dynamically loaded modules'
11886 : Check if dlsym need a leading underscore
11892 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11893 $cat >dyna.c <<'EOM'
11900 #$i_stdlib I_STDLIB
11902 #include <stdlib.h>
11906 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11908 #include <sys/types.h>
11913 extern int fred() ;
11922 int mode = RTLD_LAZY ;
11924 handle = dlopen("./dyna.$dlext", mode) ;
11925 if (handle == NULL) {
11930 symbol = dlsym(handle, "fred") ;
11931 if (symbol == NULL) {
11932 /* try putting a leading underscore */
11933 symbol = dlsym(handle, "_fred") ;
11934 if (symbol == NULL) {
11947 : Call the object file tmp-dyna.o in case dlext=o.
11948 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11949 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11950 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11951 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11954 1) echo "Test program failed using dlopen." >&4
11955 echo "Perhaps you should not use dynamic loading." >&4;;
11956 2) echo "Test program failed using dlsym." >&4
11957 echo "Perhaps you should not use dynamic loading." >&4;;
11958 3) echo "dlsym needs a leading underscore" >&4
11960 4) echo "dlsym doesn't need a leading underscore." >&4;;
11963 echo "I can't compile and run the test program." >&4
11964 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11969 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11974 : see if drand48_r exists
11975 set drand48_r d_drand48_r
11977 case "$d_drand48_r" in
11979 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11980 case "$d_drand48_r_proto:$usethreads" in
11981 ":define") d_drand48_r_proto=define
11982 set d_drand48_r_proto drand48_r $hdrs
11986 case "$d_drand48_r_proto" in
11988 case "$drand48_r_proto" in
11989 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11990 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
11992 case "$drand48_r_proto" in
11993 ''|0) d_drand48_r=undef
11995 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11996 * ) case "$drand48_r_proto" in
11997 REENTRANT_PROTO*) ;;
11998 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12000 echo "Prototype: $try" ;;
12003 *) case "$usethreads" in
12004 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12011 *) drand48_r_proto=0
12015 : see if prototype for drand48 is available
12017 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12020 : see if dup2 exists
12024 : see if eaccess exists
12025 set eaccess d_eaccess
12028 : see if endgrent exists
12029 set endgrent d_endgrent
12032 : see if this is an grp system
12038 xxx=`./findhdr grp.h`
12039 $cppstdin $cppflags $cppminus < $xxx >$$.h
12041 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12053 set d_grpasswd; eval $setvar
12057 : see if endgrent_r exists
12058 set endgrent_r d_endgrent_r
12060 case "$d_endgrent_r" in
12062 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12063 case "$d_endgrent_r_proto:$usethreads" in
12064 ":define") d_endgrent_r_proto=define
12065 set d_endgrent_r_proto endgrent_r $hdrs
12069 case "$d_endgrent_r_proto" in
12071 case "$endgrent_r_proto" in
12072 ''|0) try='int endgrent_r(FILE**);'
12073 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12075 case "$endgrent_r_proto" in
12076 ''|0) try='void endgrent_r(FILE**);'
12077 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12079 case "$endgrent_r_proto" in
12080 ''|0) d_endgrent_r=undef
12082 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12083 * ) case "$endgrent_r_proto" in
12084 REENTRANT_PROTO*) ;;
12085 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12087 echo "Prototype: $try" ;;
12090 *) case "$usethreads" in
12091 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12098 *) endgrent_r_proto=0
12102 : see if endhostent exists
12103 set endhostent d_endhent
12106 : see if this is a netdb.h system
12107 set netdb.h i_netdb
12110 : see if endhostent_r exists
12111 set endhostent_r d_endhostent_r
12113 case "$d_endhostent_r" in
12115 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12116 case "$d_endhostent_r_proto:$usethreads" in
12117 ":define") d_endhostent_r_proto=define
12118 set d_endhostent_r_proto endhostent_r $hdrs
12122 case "$d_endhostent_r_proto" in
12124 case "$endhostent_r_proto" in
12125 ''|0) try='int endhostent_r(struct hostent_data*);'
12126 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12128 case "$endhostent_r_proto" in
12129 ''|0) try='void endhostent_r(struct hostent_data*);'
12130 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12132 case "$endhostent_r_proto" in
12133 ''|0) d_endhostent_r=undef
12134 endhostent_r_proto=0
12135 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12136 * ) case "$endhostent_r_proto" in
12137 REENTRANT_PROTO*) ;;
12138 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12140 echo "Prototype: $try" ;;
12143 *) case "$usethreads" in
12144 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12146 d_endhostent_r=undef
12147 endhostent_r_proto=0
12151 *) endhostent_r_proto=0
12155 : see if endnetent exists
12156 set endnetent d_endnent
12159 : see if endnetent_r exists
12160 set endnetent_r d_endnetent_r
12162 case "$d_endnetent_r" in
12164 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12165 case "$d_endnetent_r_proto:$usethreads" in
12166 ":define") d_endnetent_r_proto=define
12167 set d_endnetent_r_proto endnetent_r $hdrs
12171 case "$d_endnetent_r_proto" in
12173 case "$endnetent_r_proto" in
12174 ''|0) try='int endnetent_r(struct netent_data*);'
12175 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12177 case "$endnetent_r_proto" in
12178 ''|0) try='void endnetent_r(struct netent_data*);'
12179 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12181 case "$endnetent_r_proto" in
12182 ''|0) d_endnetent_r=undef
12183 endnetent_r_proto=0
12184 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12185 * ) case "$endnetent_r_proto" in
12186 REENTRANT_PROTO*) ;;
12187 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12189 echo "Prototype: $try" ;;
12192 *) case "$usethreads" in
12193 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12195 d_endnetent_r=undef
12196 endnetent_r_proto=0
12200 *) endnetent_r_proto=0
12204 : see if endprotoent exists
12205 set endprotoent d_endpent
12208 : see if endprotoent_r exists
12209 set endprotoent_r d_endprotoent_r
12211 case "$d_endprotoent_r" in
12213 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12214 case "$d_endprotoent_r_proto:$usethreads" in
12215 ":define") d_endprotoent_r_proto=define
12216 set d_endprotoent_r_proto endprotoent_r $hdrs
12220 case "$d_endprotoent_r_proto" in
12222 case "$endprotoent_r_proto" in
12223 ''|0) try='int endprotoent_r(struct protoent_data*);'
12224 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12226 case "$endprotoent_r_proto" in
12227 ''|0) try='void endprotoent_r(struct protoent_data*);'
12228 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12230 case "$endprotoent_r_proto" in
12231 ''|0) d_endprotoent_r=undef
12232 endprotoent_r_proto=0
12233 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12234 * ) case "$endprotoent_r_proto" in
12235 REENTRANT_PROTO*) ;;
12236 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12238 echo "Prototype: $try" ;;
12241 *) case "$usethreads" in
12242 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12244 d_endprotoent_r=undef
12245 endprotoent_r_proto=0
12249 *) endprotoent_r_proto=0
12253 : see if endpwent exists
12254 set endpwent d_endpwent
12257 : see if this is a pwd.h system
12263 xxx=`./findhdr pwd.h`
12264 $cppstdin $cppflags $cppminus < $xxx >$$.h
12266 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12274 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12282 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12290 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12298 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12306 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12314 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12322 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12334 set d_pwquota; eval $setvar
12335 set d_pwage; eval $setvar
12336 set d_pwchange; eval $setvar
12337 set d_pwclass; eval $setvar
12338 set d_pwexpire; eval $setvar
12339 set d_pwcomment; eval $setvar
12340 set d_pwgecos; eval $setvar
12341 set d_pwpasswd; eval $setvar
12345 : see if endpwent_r exists
12346 set endpwent_r d_endpwent_r
12348 case "$d_endpwent_r" in
12350 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12351 case "$d_endpwent_r_proto:$usethreads" in
12352 ":define") d_endpwent_r_proto=define
12353 set d_endpwent_r_proto endpwent_r $hdrs
12357 case "$d_endpwent_r_proto" in
12359 case "$endpwent_r_proto" in
12360 ''|0) try='int endpwent_r(FILE**);'
12361 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12363 case "$endpwent_r_proto" in
12364 ''|0) try='void endpwent_r(FILE**);'
12365 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12367 case "$endpwent_r_proto" in
12368 ''|0) d_endpwent_r=undef
12370 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12371 * ) case "$endpwent_r_proto" in
12372 REENTRANT_PROTO*) ;;
12373 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12375 echo "Prototype: $try" ;;
12378 *) case "$usethreads" in
12379 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12386 *) endpwent_r_proto=0
12390 : see if endservent exists
12391 set endservent d_endsent
12394 : see if endservent_r exists
12395 set endservent_r d_endservent_r
12397 case "$d_endservent_r" in
12399 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12400 case "$d_endservent_r_proto:$usethreads" in
12401 ":define") d_endservent_r_proto=define
12402 set d_endservent_r_proto endservent_r $hdrs
12406 case "$d_endservent_r_proto" in
12408 case "$endservent_r_proto" in
12409 ''|0) try='int endservent_r(struct servent_data*);'
12410 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12412 case "$endservent_r_proto" in
12413 ''|0) try='void endservent_r(struct servent_data*);'
12414 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12416 case "$endservent_r_proto" in
12417 ''|0) d_endservent_r=undef
12418 endservent_r_proto=0
12419 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12420 * ) case "$endservent_r_proto" in
12421 REENTRANT_PROTO*) ;;
12422 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12424 echo "Prototype: $try" ;;
12427 *) case "$usethreads" in
12428 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12430 d_endservent_r=undef
12431 endservent_r_proto=0
12435 *) endservent_r_proto=0
12439 : Locate the flags for 'open()'
12442 #include <sys/types.h>
12447 #include <sys/file.h>
12449 #$i_stdlib I_STDLIB
12451 #include <stdlib.h>
12462 : check sys/file.h first to get FREAD on Sun
12463 if $test `./findhdr sys/file.h` && \
12464 set try -DI_SYS_FILE && eval $compile; then
12466 echo "<sys/file.h> defines the O_* constants..." >&4
12467 if $run ./try; then
12468 echo "and you have the 3 argument form of open()." >&4
12471 echo "but not the 3 argument form of open(). Oh, well." >&4
12474 elif $test `./findhdr fcntl.h` && \
12475 set try -DI_FCNTL && eval $compile; then
12477 echo "<fcntl.h> defines the O_* constants..." >&4
12478 if $run ./try; then
12479 echo "and you have the 3 argument form of open()." >&4
12482 echo "but not the 3 argument form of open(). Oh, well." >&4
12487 echo "I can't find the O_* constant definitions! You got problems." >&4
12493 : see if this is a sys/file.h system
12498 : do we need to include sys/file.h ?
12502 if $h_sysfile; then
12504 echo "We'll be including <sys/file.h>." >&4
12507 echo "We won't be including <sys/file.h>." >&4
12517 : see if fcntl.h is there
12522 : see if we can include fcntl.h
12528 echo "We'll be including <fcntl.h>." >&4
12531 if $h_sysfile; then
12532 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12534 echo "We won't be including <fcntl.h>." >&4
12546 : see if fork exists
12550 : see if pipe exists
12554 : check for non-blocking I/O stuff
12555 case "$h_sysfile" in
12556 true) echo "#include <sys/file.h>" > head.c;;
12559 true) echo "#include <fcntl.h>" > head.c;;
12560 *) echo "#include <sys/fcntl.h>" > head.c;;
12565 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12566 case "$o_nonblock" in
12568 $cat head.c > try.c
12569 $cat >>try.c <<EOCP
12571 #$i_stdlib I_STDLIB
12573 #include <stdlib.h>
12581 printf("O_NONBLOCK\n");
12585 printf("O_NDELAY\n");
12589 printf("FNDELAY\n");
12596 if eval $compile_ok; then
12597 o_nonblock=`$run ./try`
12598 case "$o_nonblock" in
12599 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12600 *) echo "Seems like we can use $o_nonblock.";;
12603 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12606 *) echo "Using $hint value $o_nonblock.";;
12611 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12614 case "$d_fork:$d_pipe" in
12616 $cat head.c > try.c
12617 $cat >>try.c <<EOCP
12619 #include <sys/types.h>
12620 #include <signal.h>
12622 #$i_stdlib I_STDLIB
12624 #include <stdlib.h>
12630 #define MY_O_NONBLOCK $o_nonblock
12631 #ifndef errno /* XXX need better Configure test */
12634 #$i_unistd I_UNISTD
12636 #include <unistd.h>
12638 #$i_string I_STRING
12640 #include <string.h>
12642 #include <strings.h>
12644 $signal_t blech(int x) { exit(3); }
12646 $cat >> try.c <<'EOCP'
12654 pipe(pd); /* Down: child -> parent */
12655 pipe(pu); /* Up: parent -> child */
12658 close(pd[1]); /* Parent reads from pd[0] */
12659 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12661 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12666 signal(SIGALRM, blech);
12668 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12670 sprintf(string, "%d\n", ret);
12671 write(2, string, strlen(string));
12674 if (errno == EAGAIN) {
12675 printf("EAGAIN\n");
12680 if (errno == EWOULDBLOCK)
12681 printf("EWOULDBLOCK\n");
12684 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12685 sleep(2); /* Give it time to close our pipe */
12687 ret = read(pd[0], buf, 1); /* Should read EOF */
12689 sprintf(string, "%d\n", ret);
12690 write(4, string, strlen(string));
12694 close(pd[0]); /* We write to pd[1] */
12695 close(pu[1]); /* We read from pu[0] */
12696 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12697 close(pd[1]); /* Pipe pd is now fully closed! */
12698 exit(0); /* Bye bye, thank you for playing! */
12702 if eval $compile_ok; then
12703 echo "$startsh" >mtry
12704 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12706 ./mtry >/dev/null 2>&1
12708 0) eagain=`$cat try.out`;;
12709 1) echo "Could not perform non-blocking setting!";;
12710 2) echo "I did a successful read() for something that was not there!";;
12711 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12712 4) echo "Could not find F_SETFL!";;
12713 *) echo "Something terribly wrong happened during testing.";;
12715 rd_nodata=`$cat try.ret`
12716 echo "A read() system call with no data present returns $rd_nodata."
12717 case "$rd_nodata" in
12720 echo "(That's peculiar, fixing that to be -1.)"
12726 echo "Forcing errno EAGAIN on read() with no data available."
12730 echo "Your read() sets errno to $eagain when no data is available."
12733 status=`$cat try.err`
12735 0) echo "And it correctly returns 0 to signal EOF.";;
12736 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12737 *) echo "However, your read() returns '$status' on EOF??";;
12740 if test "$status" = "$rd_nodata"; then
12741 echo "WARNING: you can't distinguish between EOF and no data!"
12745 echo "I can't compile the test program--assuming errno EAGAIN will do."
12749 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12758 echo "Using $hint value $eagain."
12759 echo "Your read() returns $rd_nodata when no data is present."
12760 case "$d_eofnblk" in
12761 "$define") echo "And you can see EOF because read() returns 0.";;
12762 "$undef") echo "But you can't see EOF status from read() returned value.";;
12764 echo "(Assuming you can't see EOF status from read anyway.)"
12770 $rm_try head.c mtry
12772 : see if _ptr and _cnt from stdio act std
12775 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12776 echo "(Looks like you have stdio.h from BSD.)"
12777 case "$stdio_ptr" in
12778 '') stdio_ptr='((fp)->_p)'
12781 *) ptr_lval=$d_stdio_ptr_lval;;
12783 case "$stdio_cnt" in
12784 '') stdio_cnt='((fp)->_r)'
12787 *) cnt_lval=$d_stdio_cnt_lval;;
12789 case "$stdio_base" in
12790 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12792 case "$stdio_bufsiz" in
12793 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12795 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12796 echo "(Looks like you have stdio.h from Linux.)"
12797 case "$stdio_ptr" in
12798 '') stdio_ptr='((fp)->_IO_read_ptr)'
12801 *) ptr_lval=$d_stdio_ptr_lval;;
12803 case "$stdio_cnt" in
12804 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12807 *) cnt_lval=$d_stdio_cnt_lval;;
12809 case "$stdio_base" in
12810 '') stdio_base='((fp)->_IO_read_base)';;
12812 case "$stdio_bufsiz" in
12813 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12816 case "$stdio_ptr" in
12817 '') stdio_ptr='((fp)->_ptr)'
12820 *) ptr_lval=$d_stdio_ptr_lval;;
12822 case "$stdio_cnt" in
12823 '') stdio_cnt='((fp)->_cnt)'
12826 *) cnt_lval=$d_stdio_cnt_lval;;
12828 case "$stdio_base" in
12829 '') stdio_base='((fp)->_base)';;
12831 case "$stdio_bufsiz" in
12832 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12836 : test whether _ptr and _cnt really work
12837 echo "Checking how std your stdio is..." >&4
12840 #$i_stdlib I_STDLIB
12842 #include <stdlib.h>
12844 #define FILE_ptr(fp) $stdio_ptr
12845 #define FILE_cnt(fp) $stdio_cnt
12847 FILE *fp = fopen("try.c", "r");
12850 18 <= FILE_cnt(fp) &&
12851 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12859 if eval $compile && $to try.c; then
12860 if $run ./try; then
12861 echo "Your stdio acts pretty std."
12864 echo "Your stdio isn't very std."
12867 echo "Your stdio doesn't appear very std."
12871 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12872 # direct buffer manipulation no longer works. The Configure tests
12873 # should be changed to correctly detect this, but until then,
12874 # the following check should at least let perl compile and run.
12875 # (This quick fix should be updated before 5.8.1.)
12876 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12877 # A. Dougherty, June 3, 2002.
12878 case "$d_gnulibc" in
12880 case "$gnulibc_version" in
12884 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12893 : Can _ptr be used as an lvalue?
12894 case "$d_stdstdio$ptr_lval" in
12895 $define$define) val=$define ;;
12898 set d_stdio_ptr_lval
12901 : Can _cnt be used as an lvalue?
12902 case "$d_stdstdio$cnt_lval" in
12903 $define$define) val=$define ;;
12906 set d_stdio_cnt_lval
12910 : test whether setting _ptr sets _cnt as a side effect
12911 d_stdio_ptr_lval_sets_cnt="$undef"
12912 d_stdio_ptr_lval_nochange_cnt="$undef"
12913 case "$d_stdio_ptr_lval$d_stdstdio" in
12915 echo "Checking to see what happens if we set the stdio ptr..." >&4
12918 /* Can we scream? */
12919 /* Eat dust sed :-) */
12920 /* In the buffer space, no one can hear you scream. */
12921 #$i_stdlib I_STDLIB
12923 #include <stdlib.h>
12925 #define FILE_ptr(fp) $stdio_ptr
12926 #define FILE_cnt(fp) $stdio_cnt
12927 #include <sys/types.h>
12929 FILE *fp = fopen("try.c", "r");
12934 puts("Fail even to read");
12937 c = getc(fp); /* Read away the first # */
12939 puts("Fail even to read");
12943 18 <= FILE_cnt(fp) &&
12944 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12946 puts("Fail even to read");
12949 ptr = (char*) FILE_ptr(fp);
12950 cnt = (size_t)FILE_cnt(fp);
12952 FILE_ptr(fp) += 42;
12954 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12955 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12958 if (FILE_cnt(fp) <= 20) {
12959 printf ("Fail (<20 chars to test)");
12962 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12963 puts("Fail compare");
12966 if (cnt == FILE_cnt(fp)) {
12967 puts("Pass_unchanged");
12970 if (FILE_cnt(fp) == (cnt - 42)) {
12971 puts("Pass_changed");
12974 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12980 if eval $compile && $to try.c; then
12981 case `$run ./try` in
12983 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12984 d_stdio_ptr_lval_sets_cnt="$define" ;;
12986 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12987 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12989 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12991 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12994 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13000 : see if _base is also standard
13002 case "$d_stdstdio" in
13006 #$i_stdlib I_STDLIB
13008 #include <stdlib.h>
13010 #define FILE_base(fp) $stdio_base
13011 #define FILE_bufsiz(fp) $stdio_bufsiz
13013 FILE *fp = fopen("try.c", "r");
13016 19 <= FILE_bufsiz(fp) &&
13017 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13024 if eval $compile && $to try.c; then
13025 if $run ./try; then
13026 echo "And its _base field acts std."
13029 echo "But its _base field isn't std."
13032 echo "However, it seems to be lacking the _base field."
13040 : see if fast_stdio exists
13042 case "$d_stdstdio:$d_stdio_ptr_lval" in
13044 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13046 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13057 : see if fchdir exists
13058 set fchdir d_fchdir
13061 : see if fchmod exists
13062 set fchmod d_fchmod
13065 : see if fchown exists
13066 set fchown d_fchown
13069 : see if this is an fcntl system
13073 : See if fcntl-based locking works.
13076 #$i_stdlib I_STDLIB
13078 #include <stdlib.h>
13080 #include <unistd.h>
13082 #include <signal.h>
13083 $signal_t blech(int x) { exit(3); }
13085 #if defined(F_SETLK) && defined(F_SETLKW)
13086 struct flock flock;
13088 fd = open("try.c", O_RDONLY);
13089 flock.l_type = F_RDLCK;
13090 flock.l_whence = SEEK_SET;
13091 flock.l_start = flock.l_len = 0;
13092 signal(SIGALRM, blech);
13094 retval = fcntl(fd, F_SETLK, &flock);
13096 (retval < 0 ? exit(2) : exit(0));
13102 echo "Checking if fcntl-based file locking works... "
13106 if eval $compile_ok; then
13107 if $run ./try; then
13108 echo "Yes, it seems to work."
13111 echo "Nope, it didn't work."
13116 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13117 *** This is (almost) impossible.
13118 *** If your NFS lock daemons are not feeling well, something like
13119 *** this may happen, please investigate. Cannot continue, aborting.
13127 echo "I'm unable to compile the test program, so I'll assume not."
13132 echo "Nope, since you don't even have fcntl()."
13135 set d_fcntl_can_lock
13139 : check for fd_set items
13142 Checking to see how well your C compiler handles fd_set and friends ...
13145 #$i_stdlib I_STDLIB
13147 #include <stdlib.h>
13149 #$i_systime I_SYS_TIME
13150 #$i_sysselct I_SYS_SELECT
13151 #$d_socket HAS_SOCKET
13152 #include <sys/types.h>
13154 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13157 #include <sys/time.h>
13159 #ifdef I_SYS_SELECT
13160 #include <sys/select.h>
13169 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13177 if eval $compile; then
13178 d_fds_bits="$define"
13180 echo "Well, your system knows about the normal fd_set typedef..." >&4
13181 if $run ./try; then
13182 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13183 d_fd_macros="$define"
13186 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13188 d_fd_macros="$undef"
13192 Hmm, your compiler has some difficulty with fd_set. Checking further...
13195 if eval $compile; then
13196 d_fds_bits="$undef"
13198 echo "Well, your system has some sort of fd_set available..." >&4
13199 if $run ./try; then
13200 echo "and you have the normal fd_set macros." >&4
13201 d_fd_macros="$define"
13204 but not the normal fd_set macros! Gross! More work for me...
13206 d_fd_macros="$undef"
13209 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13211 d_fds_bits="$undef"
13212 d_fd_macros="$undef"
13217 : see if fgetpos exists
13218 set fgetpos d_fgetpos
13221 : see if finite exists
13222 set finite d_finite
13225 : see if finitel exists
13226 set finitel d_finitel
13229 : see if flock exists
13233 : see if prototype for flock is available
13235 set d_flockproto flock $i_sysfile sys/file.h
13238 : see if fp_class exists
13239 set fp_class d_fp_class
13242 : see if pathconf exists
13243 set pathconf d_pathconf
13246 : see if fpathconf exists
13247 set fpathconf d_fpathconf
13250 : see if fpclass exists
13251 set fpclass d_fpclass
13254 : see if fpclassify exists
13255 set fpclassify d_fpclassify
13258 : see if fpclassl exists
13259 set fpclassl d_fpclassl
13262 : check for fpos64_t
13264 echo "Checking to see if you have fpos64_t..." >&4
13267 int main() { fpos64_t x = 7; }
13270 if eval $compile; then
13272 echo "You have fpos64_t."
13275 echo "You do not have fpos64_t."
13276 case "$fpossize" in
13277 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13284 : see if frexpl exists
13285 set frexpl d_frexpl
13288 : see if this is a sys/param system
13289 set sys/param.h i_sysparam
13292 : see if this is a sys/mount.h system
13293 set sys/mount.h i_sysmount
13296 : Check for fs_data_s
13298 echo "Checking to see if your system supports struct fs_data..." >&4
13299 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13301 case "$d_fs_data_s" in
13302 "$define") echo "Yes, it does." ;;
13303 *) echo "No, it doesn't." ;;
13306 : see if fseeko exists
13307 set fseeko d_fseeko
13309 case "$longsize" in
13310 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13313 : see if fsetpos exists
13314 set fsetpos d_fsetpos
13317 : see if fstatfs exists
13318 set fstatfs d_fstatfs
13321 : see if statvfs exists
13322 set statvfs d_statvfs
13325 : see if fstatvfs exists
13326 set fstatvfs d_fstatvfs
13330 : see if fsync exists
13334 : see if ftello exists
13335 set ftello d_ftello
13337 case "$longsize" in
13338 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13341 : check for a working futimes
13344 echo "Checking if you have a working futimes()" >&4
13347 #include <sys/time.h>
13354 fd = open ("try.c", O_RDWR);
13355 if (-1 == fd) exit (1);
13356 rv = futimes (fd, NULL);
13357 exit (rv == -1 ? errno : 0);
13361 if eval $compile; then
13365 0) echo "Yes, you have" >&4
13366 d_futimes="$define"
13368 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13372 echo "No, it does not (probably harmless)" >&4
13376 : see if ndbm.h is available
13379 : Compatibility location for RedHat 7.1
13380 set gdbm/ndbm.h i_gdbmndbm
13382 : Compatibility location for Debian 4.0
13383 set gdbm-ndbm.h i_gdbm_ndbm
13387 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13388 : see if dbm_open exists
13389 set dbm_open d_dbm_open
13391 case "$d_dbm_open" in
13394 i_gdbmndbm="$undef"
13395 i_gdbm_ndbm="$undef"
13396 echo "We won't be including <ndbm.h>"
13406 ndbm_hdr_protochk='name=$1; hdr=$2;
13407 eval "ihdr=\$""i_$name";
13409 if $test "$ihdr" = "$define"; then
13410 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13411 case "$d_cplusplus" in
13412 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13413 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13416 $define) $echo "Your <$hdr> seems to have prototypes";;
13417 *) $echo "Your <$hdr> does not seem to have prototypes";;
13420 set "d_${name}_h_uses_prototypes";
13424 eval $ndbm_hdr_protochk
13425 set gdbmndbm gdbm/ndbm.h
13426 eval $ndbm_hdr_protochk
13427 set gdbm_ndbm gdbm-ndbm.h
13428 eval $ndbm_hdr_protochk
13430 : see if getaddrinfo exists
13431 set getaddrinfo d_getaddrinfo
13434 : see if getcwd exists
13435 set getcwd d_getcwd
13438 : see if getespwnam exists
13439 set getespwnam d_getespwnam
13442 : see if getfsstat exists
13443 set getfsstat d_getfsstat
13446 : see if getgrent exists
13447 set getgrent d_getgrent
13450 : see if getgrent_r exists
13451 set getgrent_r d_getgrent_r
13453 case "$d_getgrent_r" in
13455 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13456 case "$d_getgrent_r_proto:$usethreads" in
13457 ":define") d_getgrent_r_proto=define
13458 set d_getgrent_r_proto getgrent_r $hdrs
13462 case "$d_getgrent_r_proto" in
13464 case "$getgrent_r_proto" in
13465 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13466 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13468 case "$getgrent_r_proto" in
13469 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13470 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13472 case "$getgrent_r_proto" in
13473 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13474 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13476 case "$getgrent_r_proto" in
13477 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13478 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13480 case "$getgrent_r_proto" in
13481 ''|0) try='int getgrent_r(struct group*, char*, int);'
13482 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13484 case "$getgrent_r_proto" in
13485 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13486 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13488 case "$getgrent_r_proto" in
13489 ''|0) d_getgrent_r=undef
13491 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13492 * ) case "$getgrent_r_proto" in
13493 REENTRANT_PROTO*) ;;
13494 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13496 echo "Prototype: $try" ;;
13499 *) case "$usethreads" in
13500 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13507 *) getgrent_r_proto=0
13511 : see if getgrgid_r exists
13512 set getgrgid_r d_getgrgid_r
13514 case "$d_getgrgid_r" in
13516 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13517 case "$d_getgrgid_r_proto:$usethreads" in
13518 ":define") d_getgrgid_r_proto=define
13519 set d_getgrgid_r_proto getgrgid_r $hdrs
13523 case "$d_getgrgid_r_proto" in
13525 case "$getgrgid_r_proto" in
13526 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13527 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13529 case "$getgrgid_r_proto" in
13530 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13531 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13533 case "$getgrgid_r_proto" in
13534 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13535 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13537 case "$getgrgid_r_proto" in
13538 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13539 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13541 case "$getgrgid_r_proto" in
13542 ''|0) d_getgrgid_r=undef
13544 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13545 * ) case "$getgrgid_r_proto" in
13546 REENTRANT_PROTO*) ;;
13547 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13549 echo "Prototype: $try" ;;
13552 *) case "$usethreads" in
13553 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13560 *) getgrgid_r_proto=0
13564 : see if getgrnam_r exists
13565 set getgrnam_r d_getgrnam_r
13567 case "$d_getgrnam_r" in
13569 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13570 case "$d_getgrnam_r_proto:$usethreads" in
13571 ":define") d_getgrnam_r_proto=define
13572 set d_getgrnam_r_proto getgrnam_r $hdrs
13576 case "$d_getgrnam_r_proto" in
13578 case "$getgrnam_r_proto" in
13579 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13580 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13582 case "$getgrnam_r_proto" in
13583 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13584 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13586 case "$getgrnam_r_proto" in
13587 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13588 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13590 case "$getgrnam_r_proto" in
13591 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13592 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13594 case "$getgrnam_r_proto" in
13595 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13596 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13598 case "$getgrnam_r_proto" in
13599 ''|0) d_getgrnam_r=undef
13601 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13602 * ) case "$getgrnam_r_proto" in
13603 REENTRANT_PROTO*) ;;
13604 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13606 echo "Prototype: $try" ;;
13609 *) case "$usethreads" in
13610 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13617 *) getgrnam_r_proto=0
13621 : see if gethostbyaddr exists
13622 set gethostbyaddr d_gethbyaddr
13625 : see if gethostbyname exists
13626 set gethostbyname d_gethbyname
13629 : see if gethostent exists
13630 set gethostent d_gethent
13633 : see how we will look up host name
13636 if set gethostname val -f d_gethname; eval $csym; $val; then
13637 echo 'gethostname() found.' >&4
13638 d_gethname="$define"
13641 if set uname val -f d_uname; eval $csym; $val; then
13644 uname() was found, but you're running xenix, and older versions of xenix
13645 have a broken uname(). If you don't really know whether your xenix is old
13646 enough to have a broken system call, use the default answer.
13651 "$define") dflt=n;;
13653 rp='Is your uname() broken?'
13656 n*) d_uname="$define"; call=uname;;
13659 echo 'uname() found.' >&4
13666 case "$d_gethname" in
13667 '') d_gethname="$undef";;
13670 '') d_uname="$undef";;
13672 case "$d_uname$d_gethname" in
13677 Every now and then someone has a $call() that lies about the hostname
13678 but can't be fixed for political or economic reasons. If you wish, I can
13679 pretend $call() isn't there and maybe compute hostname at run-time
13680 thanks to the '$phostname' command.
13683 rp="Shall I ignore $call() from now on?"
13686 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13689 case "$phostname" in
13690 '') aphostname='';;
13691 *) case "$aphostname" in
13693 *) set X $phostname
13697 file=`./loc $file $file $pth`
13698 aphostname=`echo $file $*`
13703 case "$d_uname$d_gethname" in
13706 case "$phostname" in
13708 echo "There will be no way for $package to get your hostname." >&4;;
13710 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13714 case "$d_phostname" in
13715 '') d_phostname="$undef";;
13718 : see if gethostbyaddr_r exists
13719 set gethostbyaddr_r d_gethostbyaddr_r
13721 case "$d_gethostbyaddr_r" in
13723 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13724 case "$d_gethostbyaddr_r_proto:$usethreads" in
13725 ":define") d_gethostbyaddr_r_proto=define
13726 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13730 case "$d_gethostbyaddr_r_proto" in
13732 case "$gethostbyaddr_r_proto" in
13733 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13734 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13736 case "$gethostbyaddr_r_proto" in
13737 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13738 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13740 case "$gethostbyaddr_r_proto" in
13741 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13742 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13744 case "$gethostbyaddr_r_proto" in
13745 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13746 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13748 case "$gethostbyaddr_r_proto" in
13749 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13750 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13752 case "$gethostbyaddr_r_proto" in
13753 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13754 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13756 case "$gethostbyaddr_r_proto" in
13757 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13758 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13760 case "$gethostbyaddr_r_proto" in
13761 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13762 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13764 case "$gethostbyaddr_r_proto" in
13765 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13766 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13768 case "$gethostbyaddr_r_proto" in
13769 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13770 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13772 case "$gethostbyaddr_r_proto" in
13773 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13774 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13776 case "$gethostbyaddr_r_proto" in
13777 ''|0) d_gethostbyaddr_r=undef
13778 gethostbyaddr_r_proto=0
13779 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13780 * ) case "$gethostbyaddr_r_proto" in
13781 REENTRANT_PROTO*) ;;
13782 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13784 echo "Prototype: $try" ;;
13787 *) case "$usethreads" in
13788 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13790 d_gethostbyaddr_r=undef
13791 gethostbyaddr_r_proto=0
13795 *) gethostbyaddr_r_proto=0
13799 : see if gethostbyname_r exists
13800 set gethostbyname_r d_gethostbyname_r
13802 case "$d_gethostbyname_r" in
13804 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13805 case "$d_gethostbyname_r_proto:$usethreads" in
13806 ":define") d_gethostbyname_r_proto=define
13807 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13811 case "$d_gethostbyname_r_proto" in
13813 case "$gethostbyname_r_proto" in
13814 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13815 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13817 case "$gethostbyname_r_proto" in
13818 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13819 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13821 case "$gethostbyname_r_proto" in
13822 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13823 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13825 case "$gethostbyname_r_proto" in
13826 ''|0) d_gethostbyname_r=undef
13827 gethostbyname_r_proto=0
13828 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13829 * ) case "$gethostbyname_r_proto" in
13830 REENTRANT_PROTO*) ;;
13831 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13833 echo "Prototype: $try" ;;
13836 *) case "$usethreads" in
13837 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13839 d_gethostbyname_r=undef
13840 gethostbyname_r_proto=0
13844 *) gethostbyname_r_proto=0
13848 : see if gethostent_r exists
13849 set gethostent_r d_gethostent_r
13851 case "$d_gethostent_r" in
13853 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13854 case "$d_gethostent_r_proto:$usethreads" in
13855 ":define") d_gethostent_r_proto=define
13856 set d_gethostent_r_proto gethostent_r $hdrs
13860 case "$d_gethostent_r_proto" in
13862 case "$gethostent_r_proto" in
13863 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13864 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13866 case "$gethostent_r_proto" in
13867 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13868 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13870 case "$gethostent_r_proto" in
13871 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13872 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13874 case "$gethostent_r_proto" in
13875 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13876 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
13878 case "$gethostent_r_proto" in
13879 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13880 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
13882 case "$gethostent_r_proto" in
13883 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13884 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
13886 case "$gethostent_r_proto" in
13887 ''|0) d_gethostent_r=undef
13888 gethostent_r_proto=0
13889 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13890 * ) case "$gethostent_r_proto" in
13891 REENTRANT_PROTO*) ;;
13892 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13894 echo "Prototype: $try" ;;
13897 *) case "$usethreads" in
13898 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13900 d_gethostent_r=undef
13901 gethostent_r_proto=0
13905 *) gethostent_r_proto=0
13909 : see if prototypes for various gethostxxx netdb.h functions are available
13911 set d_gethostprotos gethostent $i_netdb netdb.h
13914 : see if getitimer exists
13915 set getitimer d_getitimer
13918 : see if getlogin exists
13919 set getlogin d_getlogin
13922 : see if getlogin_r exists
13923 set getlogin_r d_getlogin_r
13925 case "$d_getlogin_r" in
13927 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13928 case "$d_getlogin_r_proto:$usethreads" in
13929 ":define") d_getlogin_r_proto=define
13930 set d_getlogin_r_proto getlogin_r $hdrs
13934 case "$d_getlogin_r_proto" in
13936 case "$getlogin_r_proto" in
13937 ''|0) try='int getlogin_r(char*, size_t);'
13938 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
13940 case "$getlogin_r_proto" in
13941 ''|0) try='int getlogin_r(char*, int);'
13942 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
13944 case "$getlogin_r_proto" in
13945 ''|0) try='char* getlogin_r(char*, size_t);'
13946 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
13948 case "$getlogin_r_proto" in
13949 ''|0) try='char* getlogin_r(char*, int);'
13950 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
13952 case "$getlogin_r_proto" in
13953 ''|0) d_getlogin_r=undef
13955 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13956 * ) case "$getlogin_r_proto" in
13957 REENTRANT_PROTO*) ;;
13958 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13960 echo "Prototype: $try" ;;
13963 *) case "$usethreads" in
13964 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13971 *) getlogin_r_proto=0
13975 : see if getmnt exists
13976 set getmnt d_getmnt
13979 : see if getmntent exists
13980 set getmntent d_getmntent
13983 : see if getnameinfo exists
13984 set getnameinfo d_getnameinfo
13987 : see if getnetbyaddr exists
13988 set getnetbyaddr d_getnbyaddr
13991 : see if getnetbyname exists
13992 set getnetbyname d_getnbyname
13995 : see if getnetent exists
13996 set getnetent d_getnent
13999 : see if getnetbyaddr_r exists
14000 set getnetbyaddr_r d_getnetbyaddr_r
14002 case "$d_getnetbyaddr_r" in
14004 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14005 case "$d_getnetbyaddr_r_proto:$usethreads" in
14006 ":define") d_getnetbyaddr_r_proto=define
14007 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14011 case "$d_getnetbyaddr_r_proto" in
14013 case "$getnetbyaddr_r_proto" in
14014 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14015 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14017 case "$getnetbyaddr_r_proto" in
14018 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14019 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14021 case "$getnetbyaddr_r_proto" in
14022 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14023 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14025 case "$getnetbyaddr_r_proto" in
14026 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14027 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14029 case "$getnetbyaddr_r_proto" in
14030 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14031 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14033 case "$getnetbyaddr_r_proto" in
14034 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14035 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14037 case "$getnetbyaddr_r_proto" in
14038 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14039 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14041 case "$getnetbyaddr_r_proto" in
14042 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14043 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14045 case "$getnetbyaddr_r_proto" in
14046 ''|0) d_getnetbyaddr_r=undef
14047 getnetbyaddr_r_proto=0
14048 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14049 * ) case "$getnetbyaddr_r_proto" in
14050 REENTRANT_PROTO*) ;;
14051 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14053 echo "Prototype: $try" ;;
14056 *) case "$usethreads" in
14057 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14059 d_getnetbyaddr_r=undef
14060 getnetbyaddr_r_proto=0
14064 *) getnetbyaddr_r_proto=0
14068 : see if getnetbyname_r exists
14069 set getnetbyname_r d_getnetbyname_r
14071 case "$d_getnetbyname_r" in
14073 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14074 case "$d_getnetbyname_r_proto:$usethreads" in
14075 ":define") d_getnetbyname_r_proto=define
14076 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14080 case "$d_getnetbyname_r_proto" in
14082 case "$getnetbyname_r_proto" in
14083 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14084 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14086 case "$getnetbyname_r_proto" in
14087 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14088 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14090 case "$getnetbyname_r_proto" in
14091 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14092 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14094 case "$getnetbyname_r_proto" in
14095 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14096 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14098 case "$getnetbyname_r_proto" in
14099 ''|0) d_getnetbyname_r=undef
14100 getnetbyname_r_proto=0
14101 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14102 * ) case "$getnetbyname_r_proto" in
14103 REENTRANT_PROTO*) ;;
14104 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14106 echo "Prototype: $try" ;;
14109 *) case "$usethreads" in
14110 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14112 d_getnetbyname_r=undef
14113 getnetbyname_r_proto=0
14117 *) getnetbyname_r_proto=0
14121 : see if getnetent_r exists
14122 set getnetent_r d_getnetent_r
14124 case "$d_getnetent_r" in
14126 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14127 case "$d_getnetent_r_proto:$usethreads" in
14128 ":define") d_getnetent_r_proto=define
14129 set d_getnetent_r_proto getnetent_r $hdrs
14133 case "$d_getnetent_r_proto" in
14135 case "$getnetent_r_proto" in
14136 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14137 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14139 case "$getnetent_r_proto" in
14140 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14141 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14143 case "$getnetent_r_proto" in
14144 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14145 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14147 case "$getnetent_r_proto" in
14148 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14149 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14151 case "$getnetent_r_proto" in
14152 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14153 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14155 case "$getnetent_r_proto" in
14156 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14157 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14159 case "$getnetent_r_proto" in
14160 ''|0) d_getnetent_r=undef
14161 getnetent_r_proto=0
14162 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14163 * ) case "$getnetent_r_proto" in
14164 REENTRANT_PROTO*) ;;
14165 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14167 echo "Prototype: $try" ;;
14170 *) case "$usethreads" in
14171 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14173 d_getnetent_r=undef
14174 getnetent_r_proto=0
14178 *) getnetent_r_proto=0
14182 : see if prototypes for various getnetxxx netdb.h functions are available
14184 set d_getnetprotos getnetent $i_netdb netdb.h
14187 : see if getpagesize exists
14188 set getpagesize d_getpagsz
14191 : Optional checks for getprotobyname and getprotobynumber
14193 : see if getprotobyname exists
14194 set getprotobyname d_getpbyname
14197 : see if getprotobynumber exists
14198 set getprotobynumber d_getpbynumber
14201 : see if getprotoent exists
14202 set getprotoent d_getpent
14205 : see if getpgid exists
14206 set getpgid d_getpgid
14209 : see if getpgrp2 exists
14210 set getpgrp2 d_getpgrp2
14213 : see if getppid exists
14214 set getppid d_getppid
14217 : see if getpriority exists
14218 set getpriority d_getprior
14221 : see if getprotobyname_r exists
14222 set getprotobyname_r d_getprotobyname_r
14224 case "$d_getprotobyname_r" in
14226 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14227 case "$d_getprotobyname_r_proto:$usethreads" in
14228 ":define") d_getprotobyname_r_proto=define
14229 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14233 case "$d_getprotobyname_r_proto" in
14235 case "$getprotobyname_r_proto" in
14236 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14237 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14239 case "$getprotobyname_r_proto" in
14240 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14241 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14243 case "$getprotobyname_r_proto" in
14244 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14245 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14247 case "$getprotobyname_r_proto" in
14248 ''|0) d_getprotobyname_r=undef
14249 getprotobyname_r_proto=0
14250 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14251 * ) case "$getprotobyname_r_proto" in
14252 REENTRANT_PROTO*) ;;
14253 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14255 echo "Prototype: $try" ;;
14258 *) case "$usethreads" in
14259 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14261 d_getprotobyname_r=undef
14262 getprotobyname_r_proto=0
14266 *) getprotobyname_r_proto=0
14270 : see if getprotobynumber_r exists
14271 set getprotobynumber_r d_getprotobynumber_r
14273 case "$d_getprotobynumber_r" in
14275 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14276 case "$d_getprotobynumber_r_proto:$usethreads" in
14277 ":define") d_getprotobynumber_r_proto=define
14278 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14282 case "$d_getprotobynumber_r_proto" in
14284 case "$getprotobynumber_r_proto" in
14285 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14286 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14288 case "$getprotobynumber_r_proto" in
14289 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14290 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14292 case "$getprotobynumber_r_proto" in
14293 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14294 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14296 case "$getprotobynumber_r_proto" in
14297 ''|0) d_getprotobynumber_r=undef
14298 getprotobynumber_r_proto=0
14299 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14300 * ) case "$getprotobynumber_r_proto" in
14301 REENTRANT_PROTO*) ;;
14302 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14304 echo "Prototype: $try" ;;
14307 *) case "$usethreads" in
14308 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14310 d_getprotobynumber_r=undef
14311 getprotobynumber_r_proto=0
14315 *) getprotobynumber_r_proto=0
14319 : see if getprotoent_r exists
14320 set getprotoent_r d_getprotoent_r
14322 case "$d_getprotoent_r" in
14324 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14325 case "$d_getprotoent_r_proto:$usethreads" in
14326 ":define") d_getprotoent_r_proto=define
14327 set d_getprotoent_r_proto getprotoent_r $hdrs
14331 case "$d_getprotoent_r_proto" in
14333 case "$getprotoent_r_proto" in
14334 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14335 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14337 case "$getprotoent_r_proto" in
14338 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14339 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14341 case "$getprotoent_r_proto" in
14342 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14343 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14345 case "$getprotoent_r_proto" in
14346 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14347 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14349 case "$getprotoent_r_proto" in
14350 ''|0) d_getprotoent_r=undef
14351 getprotoent_r_proto=0
14352 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14353 * ) case "$getprotoent_r_proto" in
14354 REENTRANT_PROTO*) ;;
14355 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14357 echo "Prototype: $try" ;;
14360 *) case "$usethreads" in
14361 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14363 d_getprotoent_r=undef
14364 getprotoent_r_proto=0
14368 *) getprotoent_r_proto=0
14372 : see if prototypes for various getprotoxxx netdb.h functions are available
14374 set d_getprotoprotos getprotoent $i_netdb netdb.h
14377 : see if getprpwnam exists
14378 set getprpwnam d_getprpwnam
14381 : see if getpwent exists
14382 set getpwent d_getpwent
14385 : see if getpwent_r exists
14386 set getpwent_r d_getpwent_r
14388 case "$d_getpwent_r" in
14390 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14391 case "$d_getpwent_r_proto:$usethreads" in
14392 ":define") d_getpwent_r_proto=define
14393 set d_getpwent_r_proto getpwent_r $hdrs
14397 case "$d_getpwent_r_proto" in
14399 case "$getpwent_r_proto" in
14400 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14401 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14403 case "$getpwent_r_proto" in
14404 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14405 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14407 case "$getpwent_r_proto" in
14408 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14409 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14411 case "$getpwent_r_proto" in
14412 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14413 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14415 case "$getpwent_r_proto" in
14416 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14417 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14419 case "$getpwent_r_proto" in
14420 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14421 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14423 case "$getpwent_r_proto" in
14424 ''|0) d_getpwent_r=undef
14426 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14427 * ) case "$getpwent_r_proto" in
14428 REENTRANT_PROTO*) ;;
14429 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14431 echo "Prototype: $try" ;;
14434 *) case "$usethreads" in
14435 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14442 *) getpwent_r_proto=0
14446 : see if getpwnam_r exists
14447 set getpwnam_r d_getpwnam_r
14449 case "$d_getpwnam_r" in
14451 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14452 case "$d_getpwnam_r_proto:$usethreads" in
14453 ":define") d_getpwnam_r_proto=define
14454 set d_getpwnam_r_proto getpwnam_r $hdrs
14458 case "$d_getpwnam_r_proto" in
14460 case "$getpwnam_r_proto" in
14461 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14462 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14464 case "$getpwnam_r_proto" in
14465 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14466 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14468 case "$getpwnam_r_proto" in
14469 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14470 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14472 case "$getpwnam_r_proto" in
14473 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14474 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14476 case "$getpwnam_r_proto" in
14477 ''|0) d_getpwnam_r=undef
14479 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14480 * ) case "$getpwnam_r_proto" in
14481 REENTRANT_PROTO*) ;;
14482 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14484 echo "Prototype: $try" ;;
14487 *) case "$usethreads" in
14488 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14495 *) getpwnam_r_proto=0
14499 : see if getpwuid_r exists
14500 set getpwuid_r d_getpwuid_r
14502 case "$d_getpwuid_r" in
14504 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14505 case "$d_getpwuid_r_proto:$usethreads" in
14506 ":define") d_getpwuid_r_proto=define
14507 set d_getpwuid_r_proto getpwuid_r $hdrs
14511 case "$d_getpwuid_r_proto" in
14513 case "$getpwuid_r_proto" in
14514 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14515 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14517 case "$getpwuid_r_proto" in
14518 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14519 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14521 case "$getpwuid_r_proto" in
14522 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14523 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14525 case "$getpwuid_r_proto" in
14526 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14527 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14529 case "$getpwuid_r_proto" in
14530 ''|0) d_getpwuid_r=undef
14532 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14533 * ) case "$getpwuid_r_proto" in
14534 REENTRANT_PROTO*) ;;
14535 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14537 echo "Prototype: $try" ;;
14540 *) case "$usethreads" in
14541 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14548 *) getpwuid_r_proto=0
14552 : Optional checks for getsbyname and getsbyport
14554 : see if getservbyname exists
14555 set getservbyname d_getsbyname
14558 : see if getservbyport exists
14559 set getservbyport d_getsbyport
14562 : see if getservent exists
14563 set getservent d_getsent
14566 : see if getservbyname_r exists
14567 set getservbyname_r d_getservbyname_r
14569 case "$d_getservbyname_r" in
14571 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14572 case "$d_getservbyname_r_proto:$usethreads" in
14573 ":define") d_getservbyname_r_proto=define
14574 set d_getservbyname_r_proto getservbyname_r $hdrs
14578 case "$d_getservbyname_r_proto" in
14580 case "$getservbyname_r_proto" in
14581 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14582 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14584 case "$getservbyname_r_proto" in
14585 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14586 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14588 case "$getservbyname_r_proto" in
14589 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14590 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14592 case "$getservbyname_r_proto" in
14593 ''|0) d_getservbyname_r=undef
14594 getservbyname_r_proto=0
14595 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14596 * ) case "$getservbyname_r_proto" in
14597 REENTRANT_PROTO*) ;;
14598 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14600 echo "Prototype: $try" ;;
14603 *) case "$usethreads" in
14604 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14606 d_getservbyname_r=undef
14607 getservbyname_r_proto=0
14611 *) getservbyname_r_proto=0
14615 : see if getservbyport_r exists
14616 set getservbyport_r d_getservbyport_r
14618 case "$d_getservbyport_r" in
14620 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14621 case "$d_getservbyport_r_proto:$usethreads" in
14622 ":define") d_getservbyport_r_proto=define
14623 set d_getservbyport_r_proto getservbyport_r $hdrs
14627 case "$d_getservbyport_r_proto" in
14629 case "$getservbyport_r_proto" in
14630 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14631 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14633 case "$getservbyport_r_proto" in
14634 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14635 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14637 case "$getservbyport_r_proto" in
14638 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14639 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14641 case "$getservbyport_r_proto" in
14642 ''|0) d_getservbyport_r=undef
14643 getservbyport_r_proto=0
14644 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14645 * ) case "$getservbyport_r_proto" in
14646 REENTRANT_PROTO*) ;;
14647 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14649 echo "Prototype: $try" ;;
14652 *) case "$usethreads" in
14653 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14655 d_getservbyport_r=undef
14656 getservbyport_r_proto=0
14660 *) getservbyport_r_proto=0
14664 : see if getservent_r exists
14665 set getservent_r d_getservent_r
14667 case "$d_getservent_r" in
14669 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14670 case "$d_getservent_r_proto:$usethreads" in
14671 ":define") d_getservent_r_proto=define
14672 set d_getservent_r_proto getservent_r $hdrs
14676 case "$d_getservent_r_proto" in
14678 case "$getservent_r_proto" in
14679 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14680 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14682 case "$getservent_r_proto" in
14683 ''|0) try='int getservent_r(struct servent*, char*, int);'
14684 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14686 case "$getservent_r_proto" in
14687 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14688 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14690 case "$getservent_r_proto" in
14691 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14692 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14694 case "$getservent_r_proto" in
14695 ''|0) d_getservent_r=undef
14696 getservent_r_proto=0
14697 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14698 * ) case "$getservent_r_proto" in
14699 REENTRANT_PROTO*) ;;
14700 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14702 echo "Prototype: $try" ;;
14705 *) case "$usethreads" in
14706 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14708 d_getservent_r=undef
14709 getservent_r_proto=0
14713 *) getservent_r_proto=0
14717 : see if prototypes for various getservxxx netdb.h functions are available
14719 set d_getservprotos getservent $i_netdb netdb.h
14722 : see if getspnam exists
14723 set getspnam d_getspnam
14726 : see if this is a shadow.h system
14727 set shadow.h i_shadow
14730 : see if getspnam_r exists
14731 set getspnam_r d_getspnam_r
14733 case "$d_getspnam_r" in
14735 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14736 case "$d_getspnam_r_proto:$usethreads" in
14737 ":define") d_getspnam_r_proto=define
14738 set d_getspnam_r_proto getspnam_r $hdrs
14742 case "$d_getspnam_r_proto" in
14744 case "$getspnam_r_proto" in
14745 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14746 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14748 case "$getspnam_r_proto" in
14749 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14750 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14752 case "$getspnam_r_proto" in
14753 ''|0) d_getspnam_r=undef
14755 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14756 * ) case "$getspnam_r_proto" in
14757 REENTRANT_PROTO*) ;;
14758 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14760 echo "Prototype: $try" ;;
14763 *) case "$usethreads" in
14764 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14771 *) getspnam_r_proto=0
14775 : see if gettimeofday or ftime exists
14776 set gettimeofday d_gettimeod
14778 case "$d_gettimeod" in
14784 val="$undef"; set d_ftime; eval $setvar
14787 case "$d_gettimeod$d_ftime" in
14790 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14794 : see if gmtime_r exists
14795 set gmtime_r d_gmtime_r
14797 case "$d_gmtime_r" in
14799 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14800 case "$d_gmtime_r_proto:$usethreads" in
14801 ":define") d_gmtime_r_proto=define
14802 set d_gmtime_r_proto gmtime_r $hdrs
14806 case "$d_gmtime_r_proto" in
14808 case "$gmtime_r_proto" in
14809 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14810 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
14812 case "$gmtime_r_proto" in
14813 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14814 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
14816 case "$gmtime_r_proto" in
14817 ''|0) d_gmtime_r=undef
14819 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14820 * ) case "$gmtime_r_proto" in
14821 REENTRANT_PROTO*) ;;
14822 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14824 echo "Prototype: $try" ;;
14827 *) case "$usethreads" in
14828 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14835 *) gmtime_r_proto=0
14839 : see if hasmntopt exists
14840 set hasmntopt d_hasmntopt
14843 : see if this is a netinet/in.h or sys/in.h system
14844 set netinet/in.h i_niin sys/in.h i_sysin
14847 : see if arpa/inet.h has to be included
14848 set arpa/inet.h i_arpainet
14851 : see if htonl --and friends-- exists
14856 : Maybe they are macros.
14859 $cat >htonl.c <<EOM
14861 #include <sys/types.h>
14862 #$i_niin I_NETINET_IN
14864 #$i_arpainet I_ARPA_INET
14865 #ifdef I_NETINET_IN
14866 #include <netinet/in.h>
14869 #include <sys/in.h>
14872 #include <arpa/inet.h>
14875 printf("Defined as a macro.");
14878 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14879 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14881 echo "But it seems to be defined as a macro." >&4
14889 : see if ilogbl exists
14890 set ilogbl d_ilogbl
14895 if set index val -f; eval $csym; $val; then
14896 if set strchr val -f d_strchr; eval $csym; $val; then
14897 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14900 echo "strchr() found." >&4
14904 echo "index() found." >&4
14909 echo "index() found." >&4
14912 if set strchr val -f d_strchr; eval $csym; $val; then
14915 echo "strchr() found." >&4
14917 echo "No index() or strchr() found!" >&4
14922 set d_strchr; eval $setvar
14924 set d_index; eval $setvar
14926 : check whether inet_aton exists
14927 set inet_aton d_inetaton
14930 : see if inet_ntop exists
14931 set inet_ntop d_inetntop
14934 : see if inet_pton exists
14935 set inet_pton d_inetpton
14940 $cat >isascii.c <<EOCP
14943 #$i_stdlib I_STDLIB
14945 #include <stdlib.h>
14956 if eval $compile; then
14957 echo "isascii() found." >&4
14960 echo "isascii() NOT found." >&4
14967 : see if isfinite exists
14968 set isfinite d_isfinite
14971 : see if isinf exists
14975 : see if isnan exists
14979 : see if isnanl exists
14980 set isnanl d_isnanl
14983 : see if killpg exists
14984 set killpg d_killpg
14987 : see if lchown exists
14989 $cat > try.c <<'EOCP'
14990 /* System header to define __stub macros and hopefully few prototypes,
14991 which can conflict with char lchown(); below. */
14992 #include <assert.h>
14993 /* Override any gcc2 internal prototype to avoid an error. */
14994 /* We use char because int might match the return type of a gcc2
14995 builtin and then its argument prototype would still apply. */
14998 /* The GNU C library defines this for functions which it implements
14999 to always fail with ENOSYS. Some functions are actually named
15000 something starting with __ and the normal name is an alias. */
15001 #if defined (__stub_lchown) || defined (__stub___lchown)
15009 if eval $compile; then
15010 $echo "lchown() found." >&4
15013 $echo "lchown() NOT found." >&4
15019 : See if number of significant digits in a double precision number is known
15021 $cat >ldbl_dig.c <<EOM
15022 #$i_limits I_LIMITS
15025 #include <limits.h>
15031 printf("Contains LDBL_DIG");
15034 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15035 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15036 echo "LDBL_DIG found." >&4
15039 echo "LDBL_DIG NOT found." >&4
15046 : see if this is a math.h system
15050 : check to see if math.h defines _LIB_VERSION
15051 d_libm_lib_version="$undef"
15055 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15057 #include <unistd.h>
15059 int main (int argc, char *argv[])
15061 printf ("%d\n", _LIB_VERSION);
15066 if eval $compile; then
15068 echo "Yes, it does ($foo)" >&4
15069 d_libm_lib_version="$define"
15071 echo "No, it does not (probably harmless)" >&4
15078 : see if link exists
15082 : see if localtime_r exists
15083 set localtime_r d_localtime_r
15085 case "$d_localtime_r" in
15087 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15088 case "$d_localtime_r_proto:$usethreads" in
15089 ":define") d_localtime_r_proto=define
15090 set d_localtime_r_proto localtime_r $hdrs
15094 case "$d_localtime_r_proto" in
15096 case "$localtime_r_proto" in
15097 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15098 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15100 case "$localtime_r_proto" in
15101 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15102 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15104 case "$localtime_r_proto" in
15105 ''|0) d_localtime_r=undef
15106 localtime_r_proto=0
15107 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15108 * ) case "$localtime_r_proto" in
15109 REENTRANT_PROTO*) ;;
15110 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15112 echo "Prototype: $try" ;;
15115 *) case "$usethreads" in
15116 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15118 d_localtime_r=undef
15119 localtime_r_proto=0
15123 *) localtime_r_proto=0
15127 : see if localtime_r calls tzset
15128 case "$localtime_r_proto" in
15131 /* Does our libc's localtime_r call tzset ?
15132 * return 0 if so, 1 otherwise.
15134 #$i_systypes I_SYS_TYPES
15135 #$i_unistd I_UNISTD
15137 #$i_stdlib I_STDLIB
15138 #$i_string I_STRING
15139 #$i_malloc I_MALLOC
15141 # include <sys/types.h>
15144 # include <unistd.h>
15150 #include <stdlib.h>
15153 # include <string.h>
15155 # include <strings.h>
15158 # include <malloc.h>
15162 time_t t = time(0L);
15163 char w_tz[]="TZ" "=GMT+5",
15164 e_tz[]="TZ" "=GMT-5",
15165 *tz_e = (char*)malloc(16),
15166 *tz_w = (char*)malloc(16);
15167 struct tm tm_e, tm_w;
15168 memset(&tm_e,'\0',sizeof(struct tm));
15169 memset(&tm_w,'\0',sizeof(struct tm));
15174 localtime_r(&t, &tm_e);
15177 localtime_r(&t, &tm_w);
15179 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15185 if eval $compile; then
15186 if $run ./try; then
15187 d_localtime_r_needs_tzset=undef;
15189 d_localtime_r_needs_tzset=define;
15192 d_localtime_r_needs_tzset=undef;
15196 d_localtime_r_needs_tzset=undef;
15201 : see if localeconv exists
15202 set localeconv d_locconv
15205 : see if lockf exists
15209 : see if prototype for lseek is available
15211 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15214 : see if lstat exists
15218 : see if madvise exists
15219 set madvise d_madvise
15222 : see if malloc_size exists
15223 set malloc_size d_malloc_size
15226 : see if malloc_size_good exists
15227 set malloc_good_size d_malloc_good_size
15230 : see if mblen exists
15234 : see if mbstowcs exists
15235 set mbstowcs d_mbstowcs
15238 : see if mbtowc exists
15239 set mbtowc d_mbtowc
15242 : see if memchr exists
15243 set memchr d_memchr
15246 : see if memcmp exists
15247 set memcmp d_memcmp
15250 : see if memcpy exists
15251 set memcpy d_memcpy
15254 : see if memmove exists
15255 set memmove d_memmove
15258 : see if memset exists
15259 set memset d_memset
15262 : see if mkdir exists
15266 : see if mkdtemp exists
15267 set mkdtemp d_mkdtemp
15270 : see if mkfifo exists
15271 set mkfifo d_mkfifo
15274 : see if mkstemp exists
15275 set mkstemp d_mkstemp
15278 : see if mkstemps exists
15279 set mkstemps d_mkstemps
15282 : see if mktime exists
15283 set mktime d_mktime
15286 : see if this is a sys/mman.h system
15287 set sys/mman.h i_sysmman
15290 : see if mmap exists
15293 : see what shmat returns
15294 : default to something harmless
15296 case "$i_sysmman$d_mmap" in
15298 $cat >mmap.c <<'END'
15299 #include <sys/mman.h>
15302 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15307 echo "and it returns ($mmaptype)." >&4
15313 : see if sqrtl exists
15317 : see if scalbnl exists
15318 set scalbnl d_scalbnl
15321 : see if modfl exists
15325 : see if prototype for modfl is available
15327 set d_modflproto modfl $i_math math.h
15330 d_modfl_pow32_bug="$undef"
15332 case "$d_longdbl$d_modfl" in
15335 Checking to see whether your modfl() is okay for large values...
15341 if $test "X$d_modflproto" != "X$define"; then
15342 $cat >>try.c <<EOCP
15343 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15344 long double modfl (long double, long double *);
15347 $cat >>try.c <<EOCP
15349 long double nv = 4294967303.15;
15355 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15359 case "$osname:$gccversion" in
15360 aix:) saveccflags="$ccflags"
15361 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15364 if eval $compile; then
15367 *" 4294967303.150000 1.150000 4294967302.000000")
15368 echo >&4 "Your modfl() is broken for large values."
15369 d_modfl_pow32_bug="$define"
15371 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15375 *" 4294967303.150000 0.150000 4294967303.000000")
15376 echo >&4 "Your modfl() seems okay for large values."
15378 *) echo >&4 "I don't understand your modfl() at all."
15384 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15387 case "$osname:$gccversion" in
15388 aix:) ccflags="$saveccflags" ;; # restore
15393 if $test "$uselongdouble" = "$define"; then
15395 if $test "$d_sqrtl" != "$define"; then
15396 message="$message sqrtl"
15398 if $test "$d_modfl" != "$define"; then
15399 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15400 echo "You have both aintl and copysignl, so I can emulate modfl."
15402 message="$message modfl"
15405 if $test "$d_frexpl" != "$define"; then
15406 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15407 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15409 message="$message frexpl"
15413 if $test "$message" != ""; then
15416 *** You requested the use of long doubles but you do not seem to have
15417 *** the following mathematical functions needed for long double support:
15419 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15420 *** Cannot continue, aborting.
15428 : see if mprotect exists
15429 set mprotect d_mprotect
15432 : see if msgctl exists
15433 set msgctl d_msgctl
15436 : see if msgget exists
15437 set msgget d_msgget
15440 : see if msgsnd exists
15441 set msgsnd d_msgsnd
15444 : see if msgrcv exists
15445 set msgrcv d_msgrcv
15448 : see how much of the 'msg*(2)' library is present.
15451 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15452 *"$undef"*) h_msg=false;;
15456 case "`ipcs 2>&1`" in
15457 "SVID messages"*"not configured"*)
15458 echo "Your $osname does not have the msg*(2) configured." >&4
15461 set msgctl d_msgctl
15463 set msgget d_msgget
15465 set msgsnd d_msgsnd
15467 set msgrcv d_msgrcv
15473 : we could also check for sys/ipc.h ...
15474 if $h_msg && $test `./findhdr sys/msg.h`; then
15475 echo "You have the full msg*(2) library." >&4
15478 echo "You don't have the full msg*(2) library." >&4
15484 : Check for msghdr_s
15486 echo "Checking to see if your system supports struct msghdr..." >&4
15487 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15489 case "$d_msghdr_s" in
15490 "$define") echo "Yes, it does." ;;
15491 *) echo "No, it doesn't." ;;
15495 : see if msync exists
15499 : see if munmap exists
15500 set munmap d_munmap
15503 : see if nice exists
15507 : see if this is a langinfo.h system
15508 set langinfo.h i_langinfo
15511 : see if nl_langinfo exists
15512 set nl_langinfo d_nl_langinfo
15515 : check for volatile keyword
15517 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15518 $cat >try.c <<'EOCP'
15521 typedef struct _goo_struct goo_struct;
15522 goo_struct * volatile goo = ((goo_struct *)0);
15523 struct _goo_struct {
15528 typedef unsigned short foo_t;
15529 char *volatile foo;
15531 volatile foo_t blech;
15535 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15537 echo "Yup, it does."
15540 echo "Nope, it doesn't."
15546 : Check basic sizes
15548 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15550 case "$use64bitint:$d_quad:$quadtype" in
15553 uvtype="$uquadtype"
15558 uvtype="unsigned long"
15564 case "$uselongdouble:$d_longdbl" in
15566 nvtype="long double"
15567 nvsize=$longdblsize
15574 $echo "(IV will be "$ivtype", $ivsize bytes)"
15575 $echo "(UV will be "$uvtype", $uvsize bytes)"
15576 $echo "(NV will be "$nvtype", $nvsize bytes)"
15579 #$i_inttypes I_INTTYPES
15581 #include <inttypes.h>
15586 int8_t i = INT8_MAX;
15587 uint8_t u = UINT8_MAX;
15588 printf("int8_t\n");
15591 int16_t i = INT16_MAX;
15592 uint16_t i = UINT16_MAX;
15593 printf("int16_t\n");
15596 int32_t i = INT32_MAX;
15597 uint32_t u = UINT32_MAX;
15598 printf("int32_t\n");
15603 i8type="signed char"
15604 u8type="unsigned char"
15609 '') case "$shortsize" in
15611 u16type="unsigned short"
15619 '') set try -DINT16
15620 if eval $compile; then
15621 case "`$run ./try`" in
15633 '') if $test $shortsize -ge 2; then
15635 u16type="unsigned short"
15643 '') case "$longsize" in
15645 u32type="unsigned long"
15649 *) case "$intsize" in
15651 u32type="unsigned int"
15661 '') set try -DINT32
15662 if eval $compile; then
15663 case "`$run ./try`" in
15675 '') if $test $intsize -ge 4; then
15677 u32type="unsigned int"
15685 '') case "$d_quad:$quadtype" in
15687 i64type="$quadtype"
15688 u64type="$uquadtype"
15696 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15697 : volatile so that the compiler has to store it out to memory.
15698 if test X"$d_volatile" = X"$define"; then
15703 #$i_stdlib I_STDLIB
15705 #include <stdlib.h>
15707 #include <sys/types.h>
15708 #include <signal.h>
15710 $volatile int bletched = 0;
15711 $signal_t blech(int s) { bletched = 1; }
15716 int n = 8 * $uvsize;
15719 signal(SIGFPE, blech);
15722 for (i = 0; i < n; i++) {
15723 u = u << 1 | ($uvtype)1;
15725 if (($uvtype)d != u)
15729 d = ($nvtype)(u - 1);
15730 if (($uvtype)d != (u - 1))
15737 printf("%d\n", ((i == n) ? -n : i));
15743 d_nv_preserves_uv="$undef"
15744 if eval $compile; then
15745 nv_preserves_uv_bits="`$run ./try`"
15747 case "$nv_preserves_uv_bits" in
15749 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15750 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15751 d_nv_preserves_uv="$define"
15753 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15754 d_nv_preserves_uv="$undef" ;;
15755 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15756 nv_preserves_uv_bits="0" ;;
15760 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15761 : volatile so that the compiler has to store it out to memory.
15762 if test X"$d_volatile" = X"$define"; then
15768 typedef $nvtype NV;
15775 while(count < 256) {
15776 $volatile NV up = value + 1.0;
15777 $volatile NV negated = -value;
15778 $volatile NV down = negated - 1.0;
15779 $volatile NV got_up = up - value;
15780 int up_good = got_up == 1.0;
15781 int got_down = down - negated;
15782 int down_good = got_down == -1.0;
15784 if (down_good != up_good) {
15786 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15787 up_good, (double) got_up, down_good, (double) got_down,
15788 count, (double) value);
15795 fputs("256.0", stdout);
15798 fputs("2.0", stdout);
15804 fputs("*", stdout);
15810 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15811 count, (double) value);
15817 nv_overflows_integers_at='0'
15818 if eval $compile; then
15824 The largest integer your NVs can preserve is equal to $xxx
15826 nv_overflows_integers_at="$xxx"
15829 Cannot determine the largest integer value your NVs can hold, unexpected output
15836 Cannot determine the largest integer value your NVs can hold
15843 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15844 : volatile so that the compiler has to store it out to memory.
15845 if test X"$d_volatile" = X"$define"; then
15850 #$i_stdlib I_STDLIB
15852 #include <stdlib.h>
15854 #$i_string I_STRING
15856 # include <string.h>
15858 # include <strings.h>
15860 #include <sys/types.h>
15861 #include <signal.h>
15863 $volatile int bletched = 0;
15864 $signal_t blech(int s) { bletched = 1; }
15867 int checkit($nvtype d, char *where) {
15868 unsigned char *p = (char *)&d;
15869 unsigned char *end = p + sizeof(d);
15879 printf("No - %s: 0x", where);
15881 printf ("%02X", *p++);
15886 int main(int argc, char **argv) {
15889 fail += checkit(d, "0.0");
15891 /* The compiler shouldn't be assuming that bletched is 0 */
15894 fail += checkit(d, "bleched");
15897 signal(SIGFPE, blech);
15900 /* Paranoia - the compiler should have no way of knowing that ANSI says
15901 that argv[argc] will always be NULL. Actually, if it did assume this it
15902 would be buggy, as this is C and main() can be called from elsewhere in
15904 d = argv[argc] ? 1 : 0;
15907 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15910 fail += checkit(d, "ternary");
15912 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15915 printf("No - memset doesn't give 0.0\n");
15916 /* This might just blow up: */
15917 printf("(gives %g)\n", d);
15923 printf("No - something bleched\n");
15928 printf("No - %d fail(s)\n", fail);
15937 d_nv_zero_is_allbits_zero="$undef"
15938 if eval $compile; then
15944 0.0 is represented as all bits zero in memory
15946 d_nv_zero_is_allbits_zero="$define"
15949 0.0 is not represented as all bits zero in memory
15951 d_nv_zero_is_allbits_zero="$undef"
15956 0.0 is not represented as all bits zero in memory
15958 d_nv_zero_is_allbits_zero="$undef"
15964 : check for off64_t
15966 echo "Checking to see if you have off64_t..." >&4
15968 #include <sys/types.h>
15969 #include <unistd.h>
15970 int main() { off64_t x = 7; }
15973 if eval $compile; then
15975 echo "You have off64_t."
15978 echo "You do not have off64_t."
15979 case "$lseeksize" in
15980 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15987 : how to create joinable pthreads
15988 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15990 echo "Checking what constant to use for creating joinable pthreads..." >&4
15991 $cat >try.c <<'EOCP'
15992 #include <pthread.h>
15994 int detachstate = JOINABLE;
15997 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15998 if eval $compile; then
15999 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16000 val="$undef" # Yes, undef.
16001 set d_old_pthread_create_joinable
16004 set old_pthread_create_joinable
16007 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16008 if eval $compile; then
16009 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16011 set d_old_pthread_create_joinable
16013 val=PTHREAD_CREATE_UNDETACHED
16014 set old_pthread_create_joinable
16017 set try -DJOINABLE=__UNDETACHED
16018 if eval $compile; then
16019 echo "You seem to use __UNDETACHED." >&4
16021 set d_old_pthread_create_joinable
16024 set old_pthread_create_joinable
16027 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16029 set d_old_pthread_create_joinable
16032 set old_pthread_create_joinable
16039 d_old_pthread_create_joinable="$undef"
16040 old_pthread_create_joinable=""
16043 : see if pause exists
16047 : see if poll exists
16051 : see if prctl exists
16055 : see if prctl supports PR_SET_NAME
16056 d_prctl_set_name=$undef
16060 #include <sys/prctl.h>
16062 int main (int argc, char *argv[])
16064 return (prctl (PR_SET_NAME, "Test"));
16068 if eval $compile_ok && $run ./try; then
16069 echo "Your prctl (PR_SET_NAME, ...) works"
16070 d_prctl_set_name=$define
16076 : see if readlink exists
16077 set readlink d_readlink
16080 : Check if exe is symlink to abs path of executing program
16084 case "$d_readlink" in
16086 if $issymlink /proc/self/exe ; then
16087 $ls -l /proc/self/exe > reflect
16088 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16089 echo "You have Linux-like /proc/self/exe."
16090 procselfexe='"/proc/self/exe"'
16094 if $issymlink /proc/curproc/file ; then
16095 $ls -l /proc/curproc/file > reflect
16096 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16097 echo "You have BSD-like /proc/curproc/file."
16098 procselfexe='"/proc/curproc/file"'
16108 : backward compatibility for d_hvfork
16109 if test X$d_hvfork != X; then
16110 d_vfork="$d_hvfork"
16113 : see if there is a vfork
16118 d_pseudofork=$undef
16120 : Ok, but do we want to use it. vfork is reportedly unreliable in
16121 : perl on Solaris 2.x, and probably elsewhere.
16125 case "$usevfork" in
16131 Perl can only use a vfork() that doesn't suffer from strict
16132 restrictions on calling functions or modifying global data in
16133 the child. For example, glibc-2.1 contains such a vfork()
16134 that is unsuitable. If your system provides a proper fork()
16135 call, chances are that you do NOT want perl to use vfork().
16138 rp="Do you still want to use vfork()?"
16143 echo "Ok, we won't use vfork()."
16152 $define) usevfork='true';;
16153 *) usevfork='false';;
16156 : see whether the pthread_atfork exists
16158 #include <pthread.h>
16161 #ifdef PTHREAD_ATFORK
16162 pthread_atfork(NULL,NULL,NULL);
16167 : see if pthread_atfork exists
16168 set try -DPTHREAD_ATFORK
16169 if eval $compile; then
16174 case "$usethreads" in
16177 $define) echo 'pthread_atfork found.' >&4 ;;
16178 *) echo 'pthread_atfork NOT found.' >&4 ;;
16181 set d_pthread_atfork
16184 : see if pthread_attr_setscope exists
16185 set pthread_attr_setscope d_pthread_attr_setscope
16188 : see whether the various POSIXish _yields exist
16190 #include <pthread.h>
16196 #ifdef PTHREAD_YIELD
16199 #ifdef PTHREAD_YIELD_NULL
16200 pthread_yield(NULL);
16206 : see if sched_yield exists
16207 set try -DSCHED_YIELD
16208 if eval $compile; then
16210 sched_yield='sched_yield()'
16214 case "$usethreads" in
16217 $define) echo 'sched_yield() found.' >&4 ;;
16218 *) echo 'sched_yield() NOT found.' >&4 ;;
16224 : see if pthread_yield exists
16225 set try -DPTHREAD_YIELD
16226 if eval $compile; then
16228 case "$sched_yield" in
16229 '') sched_yield='pthread_yield()' ;;
16232 set try -DPTHREAD_YIELD_NULL
16233 if eval $compile; then
16235 case "$sched_yield" in
16236 '') sched_yield='pthread_yield(NULL)' ;;
16242 case "$usethreads" in
16245 $define) echo 'pthread_yield() found.' >&4 ;;
16246 *) echo 'pthread_yield() NOT found.' >&4 ;;
16250 set d_pthread_yield
16252 case "$sched_yield" in
16253 '') sched_yield=undef ;;
16257 : see if random_r exists
16258 set random_r d_random_r
16260 case "$d_random_r" in
16262 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16263 case "$d_random_r_proto:$usethreads" in
16264 ":define") d_random_r_proto=define
16265 set d_random_r_proto random_r $hdrs
16269 case "$d_random_r_proto" in
16271 case "$random_r_proto" in
16272 ''|0) try='int random_r(int*, struct random_data*);'
16273 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16275 case "$random_r_proto" in
16276 ''|0) try='int random_r(long*, struct random_data*);'
16277 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16279 case "$random_r_proto" in
16280 ''|0) try='int random_r(struct random_data*, int32_t*);'
16281 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16283 case "$random_r_proto" in
16284 ''|0) d_random_r=undef
16286 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16287 * ) case "$random_r_proto" in
16288 REENTRANT_PROTO*) ;;
16289 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16291 echo "Prototype: $try" ;;
16294 *) case "$usethreads" in
16295 define) echo "random_r has no prototype, not using it." >&4 ;;
16302 *) random_r_proto=0
16306 : see if readdir and friends exist
16307 set readdir d_readdir
16309 set seekdir d_seekdir
16311 set telldir d_telldir
16313 set rewinddir d_rewinddir
16316 : see if readdir64_r exists
16317 set readdir64_r d_readdir64_r
16319 case "$d_readdir64_r" in
16321 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16322 case "$d_readdir64_r_proto:$usethreads" in
16323 ":define") d_readdir64_r_proto=define
16324 set d_readdir64_r_proto readdir64_r $hdrs
16328 case "$d_readdir64_r_proto" in
16330 case "$readdir64_r_proto" in
16331 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16332 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16334 case "$readdir64_r_proto" in
16335 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16336 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16338 case "$readdir64_r_proto" in
16339 ''|0) d_readdir64_r=undef
16340 readdir64_r_proto=0
16341 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16342 * ) case "$readdir64_r_proto" in
16343 REENTRANT_PROTO*) ;;
16344 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16346 echo "Prototype: $try" ;;
16349 *) case "$usethreads" in
16350 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16352 d_readdir64_r=undef
16353 readdir64_r_proto=0
16357 *) readdir64_r_proto=0
16361 : see if readdir_r exists
16362 set readdir_r d_readdir_r
16364 case "$d_readdir_r" in
16366 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16367 case "$d_readdir_r_proto:$usethreads" in
16368 ":define") d_readdir_r_proto=define
16369 set d_readdir_r_proto readdir_r $hdrs
16373 case "$d_readdir_r_proto" in
16375 case "$readdir_r_proto" in
16376 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16377 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16379 case "$readdir_r_proto" in
16380 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16381 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16383 case "$readdir_r_proto" in
16384 ''|0) d_readdir_r=undef
16386 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16387 * ) case "$readdir_r_proto" in
16388 REENTRANT_PROTO*) ;;
16389 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16391 echo "Prototype: $try" ;;
16394 *) case "$usethreads" in
16395 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16402 *) readdir_r_proto=0
16406 : see if readv exists
16410 : see if recvmsg exists
16411 set recvmsg d_recvmsg
16414 : see if rename exists
16415 set rename d_rename
16418 : see if rmdir exists
16422 : see if memory.h is available.
16427 : See if it conflicts with string.h
16433 $cppstdin $cppflags $cppminus < $strings > mem.h
16434 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16436 echo "We won't be including <memory.h>."
16446 : can bcopy handle overlapping blocks?
16449 case "$d_memmove" in
16450 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16451 *) case "$d_bcopy" in
16453 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16455 #$i_memory I_MEMORY
16456 #$i_stdlib I_STDLIB
16457 #$i_string I_STRING
16458 #$i_unistd I_UNISTD
16460 $cat >>try.c <<'EOCP'
16463 # include <memory.h>
16466 # include <stdlib.h>
16469 # include <string.h>
16471 # include <strings.h>
16474 # include <unistd.h> /* Needed for NetBSD */
16478 char buf[128], abc[128];
16484 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16485 try to store the string in read-only memory. */
16486 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16488 for (align = 7; align >= 0; align--) {
16489 for (len = 36; len; len--) {
16491 bcopy(abc, b, len);
16492 for (off = 1; off <= len; off++) {
16493 bcopy(b, b+off, len);
16494 bcopy(b+off, b, len);
16495 if (bcmp(b, abc, len))
16504 if eval $compile_ok; then
16505 if $run ./try 2>/dev/null; then
16506 echo "Yes, it can."
16509 echo "It can't, sorry."
16512 echo "(I can't compile the test program, so we'll assume not...)"
16522 : can memcpy handle overlapping blocks?
16525 case "$d_memmove" in
16526 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16527 *) case "$d_memcpy" in
16529 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16531 #$i_memory I_MEMORY
16532 #$i_stdlib I_STDLIB
16533 #$i_string I_STRING
16534 #$i_unistd I_UNISTD
16536 $cat >>try.c <<'EOCP'
16539 # include <memory.h>
16542 # include <stdlib.h>
16545 # include <string.h>
16547 # include <strings.h>
16550 # include <unistd.h> /* Needed for NetBSD */
16554 char buf[128], abc[128];
16560 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16561 try to store the string in read-only memory. */
16562 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16564 for (align = 7; align >= 0; align--) {
16565 for (len = 36; len; len--) {
16567 memcpy(b, abc, len);
16568 for (off = 1; off <= len; off++) {
16569 memcpy(b+off, b, len);
16570 memcpy(b, b+off, len);
16571 if (memcmp(b, abc, len))
16580 if eval $compile_ok; then
16581 if $run ./try 2>/dev/null; then
16582 echo "Yes, it can."
16585 echo "It can't, sorry."
16588 echo "(I can't compile the test program, so we'll assume not...)"
16598 : can memcmp be trusted to compare relative magnitude?
16600 case "$d_memcmp" in
16603 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16605 #$i_memory I_MEMORY
16606 #$i_stdlib I_STDLIB
16607 #$i_string I_STRING
16608 #$i_unistd I_UNISTD
16610 $cat >>try.c <<'EOCP'
16613 # include <memory.h>
16616 # include <stdlib.h>
16619 # include <string.h>
16621 # include <strings.h>
16624 # include <unistd.h> /* Needed for NetBSD */
16630 if ((a < b) && memcmp(&a, &b, 1) < 0)
16636 if eval $compile_ok; then
16637 if $run ./try 2>/dev/null; then
16638 echo "Yes, it can."
16641 echo "No, it can't (it uses signed chars)."
16644 echo "(I can't compile the test program, so we'll assume not...)"
16652 : see if prototype for sbrk is available
16654 set d_sbrkproto sbrk $i_unistd unistd.h
16657 : see if select exists
16658 set select d_select
16661 : see if semctl exists
16662 set semctl d_semctl
16665 : see if semget exists
16666 set semget d_semget
16669 : see if semop exists
16673 : see how much of the 'sem*(2)' library is present.
16676 case "$d_semctl$d_semget$d_semop" in
16677 *"$undef"*) h_sem=false;;
16681 case "`ipcs 2>&1`" in
16682 "SVID messages"*"not configured"*)
16683 echo "Your $osname does not have the sem*(2) configured." >&4
16686 set semctl d_semctl
16688 set semget d_semget
16696 : we could also check for sys/ipc.h ...
16697 if $h_sem && $test `./findhdr sys/sem.h`; then
16698 echo "You have the full sem*(2) library." >&4
16701 echo "You don't have the full sem*(2) library." >&4
16707 : see whether sys/sem.h defines union semun
16709 $cat > try.c <<'END'
16710 #include <sys/types.h>
16711 #include <sys/ipc.h>
16712 #include <sys/sem.h>
16713 int main () { union semun semun; semun.buf = 0; }
16716 if eval $compile; then
16717 echo "You have union semun in <sys/sem.h>." >&4
16720 echo "You do not have union semun in <sys/sem.h>." >&4
16727 : see how to do semctl IPC_STAT
16731 $cat > tryh.h <<END
16734 # define S_IRUSR S_IREAD
16735 # define S_IWUSR S_IWRITE
16736 # define S_IXUSR S_IEXEC
16738 # define S_IRUSR 0400
16739 # define S_IWUSR 0200
16740 # define S_IXUSR 0100
16742 # define S_IRGRP (S_IRUSR>>3)
16743 # define S_IWGRP (S_IWUSR>>3)
16744 # define S_IXGRP (S_IXUSR>>3)
16745 # define S_IROTH (S_IRUSR>>6)
16746 # define S_IWOTH (S_IWUSR>>6)
16747 # define S_IXOTH (S_IXUSR>>6)
16750 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16751 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16752 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16755 : see whether semctl IPC_STAT can use union semun
16756 case "$d_semctl_semun" in
16760 #include <sys/types.h>
16761 #include <sys/ipc.h>
16762 #include <sys/sem.h>
16763 #include <sys/stat.h>
16770 #$d_union_semun HAS_UNION_SEMUN
16773 #ifndef HAS_UNION_SEMUN
16776 struct semid_ds *buf;
16777 unsigned short *array;
16783 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16784 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16786 struct semid_ds argbuf;
16789 st = semctl(sem, 0, IPC_STAT, arg);
16793 # endif /* IPC_STAT */
16794 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16796 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16797 # endif /* IPC_RMID */
16798 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16800 #endif /* IPC_PRIVATE && ... */
16801 printf("semget failed: errno = %d\n", errno);
16806 if eval $compile; then
16809 semun) val="$define" ;;
16817 case "$d_semctl_semun" in
16819 echo "You can use union semun for semctl IPC_STAT." >&4
16822 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16827 : see whether semctl IPC_STAT can use struct semid_ds pointer
16828 case "$d_semctl_semid_ds" in
16831 $cat > try.c <<'END'
16832 #include <sys/types.h>
16833 #include <sys/ipc.h>
16834 #include <sys/sem.h>
16835 #include <sys/stat.h>
16843 struct semid_ds arg;
16846 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16847 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16850 st = semctl(sem, 0, IPC_STAT, &arg);
16852 printf("semid_ds\n");
16854 # endif /* IPC_STAT */
16855 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16857 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16858 # endif /* IPC_RMID */
16859 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16861 #endif /* IPC_PRIVATE && ... */
16862 printf("semget failed: errno = %d\n", errno);
16868 if eval $compile; then
16871 semid_ds) val="$define" ;;
16875 set d_semctl_semid_ds
16879 case "$d_semctl_semid_ds" in
16881 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16883 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16889 # We do not have the full sem*(2) library, so assume we can not
16895 set d_semctl_semid_ds
16901 : see if sendmsg exists
16902 set sendmsg d_sendmsg
16905 : see if setegid exists
16906 set setegid d_setegid
16909 : see if seteuid exists
16910 set seteuid d_seteuid
16913 : see if setgrent exists
16914 set setgrent d_setgrent
16917 : see if setgrent_r exists
16918 set setgrent_r d_setgrent_r
16920 case "$d_setgrent_r" in
16922 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16923 case "$d_setgrent_r_proto:$usethreads" in
16924 ":define") d_setgrent_r_proto=define
16925 set d_setgrent_r_proto setgrent_r $hdrs
16929 case "$d_setgrent_r_proto" in
16931 case "$setgrent_r_proto" in
16932 ''|0) try='int setgrent_r(FILE**);'
16933 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
16935 case "$setgrent_r_proto" in
16936 ''|0) try='void setgrent_r(FILE**);'
16937 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
16939 case "$setgrent_r_proto" in
16940 ''|0) d_setgrent_r=undef
16942 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16943 * ) case "$setgrent_r_proto" in
16944 REENTRANT_PROTO*) ;;
16945 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16947 echo "Prototype: $try" ;;
16950 *) case "$usethreads" in
16951 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16958 *) setgrent_r_proto=0
16962 : see if sethostent exists
16963 set sethostent d_sethent
16966 : see if sethostent_r exists
16967 set sethostent_r d_sethostent_r
16969 case "$d_sethostent_r" in
16971 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16972 case "$d_sethostent_r_proto:$usethreads" in
16973 ":define") d_sethostent_r_proto=define
16974 set d_sethostent_r_proto sethostent_r $hdrs
16978 case "$d_sethostent_r_proto" in
16980 case "$sethostent_r_proto" in
16981 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16982 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
16984 case "$sethostent_r_proto" in
16985 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16986 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
16988 case "$sethostent_r_proto" in
16989 ''|0) d_sethostent_r=undef
16990 sethostent_r_proto=0
16991 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16992 * ) case "$sethostent_r_proto" in
16993 REENTRANT_PROTO*) ;;
16994 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16996 echo "Prototype: $try" ;;
16999 *) case "$usethreads" in
17000 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17002 d_sethostent_r=undef
17003 sethostent_r_proto=0
17007 *) sethostent_r_proto=0
17011 : see if setitimer exists
17012 set setitimer d_setitimer
17015 : see if setlinebuf exists
17016 set setlinebuf d_setlinebuf
17019 : see if setlocale exists
17020 set setlocale d_setlocale
17023 : see if locale.h is available
17024 set locale.h i_locale
17027 : see if setlocale_r exists
17028 set setlocale_r d_setlocale_r
17030 case "$d_setlocale_r" in
17032 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17033 case "$d_setlocale_r_proto:$usethreads" in
17034 ":define") d_setlocale_r_proto=define
17035 set d_setlocale_r_proto setlocale_r $hdrs
17039 case "$d_setlocale_r_proto" in
17041 case "$setlocale_r_proto" in
17042 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17043 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17045 case "$setlocale_r_proto" in
17046 ''|0) d_setlocale_r=undef
17047 setlocale_r_proto=0
17048 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17049 * ) case "$setlocale_r_proto" in
17050 REENTRANT_PROTO*) ;;
17051 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17053 echo "Prototype: $try" ;;
17056 *) case "$usethreads" in
17057 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17059 d_setlocale_r=undef
17060 setlocale_r_proto=0
17064 *) setlocale_r_proto=0
17068 : see if setnetent exists
17069 set setnetent d_setnent
17072 : see if setnetent_r exists
17073 set setnetent_r d_setnetent_r
17075 case "$d_setnetent_r" in
17077 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17078 case "$d_setnetent_r_proto:$usethreads" in
17079 ":define") d_setnetent_r_proto=define
17080 set d_setnetent_r_proto setnetent_r $hdrs
17084 case "$d_setnetent_r_proto" in
17086 case "$setnetent_r_proto" in
17087 ''|0) try='int setnetent_r(int, struct netent_data*);'
17088 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17090 case "$setnetent_r_proto" in
17091 ''|0) try='void setnetent_r(int, struct netent_data*);'
17092 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17094 case "$setnetent_r_proto" in
17095 ''|0) d_setnetent_r=undef
17096 setnetent_r_proto=0
17097 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17098 * ) case "$setnetent_r_proto" in
17099 REENTRANT_PROTO*) ;;
17100 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17102 echo "Prototype: $try" ;;
17105 *) case "$usethreads" in
17106 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17108 d_setnetent_r=undef
17109 setnetent_r_proto=0
17113 *) setnetent_r_proto=0
17117 : see if setprotoent exists
17118 set setprotoent d_setpent
17121 : see if setpgid exists
17122 set setpgid d_setpgid
17125 : see if setpgrp2 exists
17126 set setpgrp2 d_setpgrp2
17129 : see if setpriority exists
17130 set setpriority d_setprior
17133 : see if setproctitle exists
17134 set setproctitle d_setproctitle
17137 : see if setprotoent_r exists
17138 set setprotoent_r d_setprotoent_r
17140 case "$d_setprotoent_r" in
17142 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17143 case "$d_setprotoent_r_proto:$usethreads" in
17144 ":define") d_setprotoent_r_proto=define
17145 set d_setprotoent_r_proto setprotoent_r $hdrs
17149 case "$d_setprotoent_r_proto" in
17151 case "$setprotoent_r_proto" in
17152 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17153 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17155 case "$setprotoent_r_proto" in
17156 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17157 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17159 case "$setprotoent_r_proto" in
17160 ''|0) d_setprotoent_r=undef
17161 setprotoent_r_proto=0
17162 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17163 * ) case "$setprotoent_r_proto" in
17164 REENTRANT_PROTO*) ;;
17165 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17167 echo "Prototype: $try" ;;
17170 *) case "$usethreads" in
17171 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17173 d_setprotoent_r=undef
17174 setprotoent_r_proto=0
17178 *) setprotoent_r_proto=0
17182 : see if setpwent exists
17183 set setpwent d_setpwent
17186 : see if setpwent_r exists
17187 set setpwent_r d_setpwent_r
17189 case "$d_setpwent_r" in
17191 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17192 case "$d_setpwent_r_proto:$usethreads" in
17193 ":define") d_setpwent_r_proto=define
17194 set d_setpwent_r_proto setpwent_r $hdrs
17198 case "$d_setpwent_r_proto" in
17200 case "$setpwent_r_proto" in
17201 ''|0) try='int setpwent_r(FILE**);'
17202 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17204 case "$setpwent_r_proto" in
17205 ''|0) try='void setpwent_r(FILE**);'
17206 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17208 case "$setpwent_r_proto" in
17209 ''|0) d_setpwent_r=undef
17211 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17212 * ) case "$setpwent_r_proto" in
17213 REENTRANT_PROTO*) ;;
17214 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17216 echo "Prototype: $try" ;;
17219 *) case "$usethreads" in
17220 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17227 *) setpwent_r_proto=0
17231 : see if setregid exists
17232 set setregid d_setregid
17234 set setresgid d_setresgid
17237 : see if setreuid exists
17238 set setreuid d_setreuid
17240 set setresuid d_setresuid
17243 : see if setrgid exists
17244 set setrgid d_setrgid
17247 : see if setruid exists
17248 set setruid d_setruid
17251 : see if setservent exists
17252 set setservent d_setsent
17255 : see if setservent_r exists
17256 set setservent_r d_setservent_r
17258 case "$d_setservent_r" in
17260 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17261 case "$d_setservent_r_proto:$usethreads" in
17262 ":define") d_setservent_r_proto=define
17263 set d_setservent_r_proto setservent_r $hdrs
17267 case "$d_setservent_r_proto" in
17269 case "$setservent_r_proto" in
17270 ''|0) try='int setservent_r(int, struct servent_data*);'
17271 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17273 case "$setservent_r_proto" in
17274 ''|0) try='void setservent_r(int, struct servent_data*);'
17275 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17277 case "$setservent_r_proto" in
17278 ''|0) d_setservent_r=undef
17279 setservent_r_proto=0
17280 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17281 * ) case "$setservent_r_proto" in
17282 REENTRANT_PROTO*) ;;
17283 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17285 echo "Prototype: $try" ;;
17288 *) case "$usethreads" in
17289 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17291 d_setservent_r=undef
17292 setservent_r_proto=0
17296 *) setservent_r_proto=0
17300 : see if setsid exists
17301 set setsid d_setsid
17304 : see if setvbuf exists
17305 set setvbuf d_setvbuf
17308 : see if sfio.h is available
17312 : see if sfio library is available
17323 : Ok, but do we want to use it.
17327 true|$define|[yY]*) dflt='y';;
17330 echo "$package can use the sfio library, but it is experimental."
17331 case "$useperlio" in
17333 echo "For sfio also the PerlIO abstraction layer is needed."
17334 echo "Earlier you said you wouldn't want that."
17337 rp="You seem to have sfio available, do you want to try using it?"
17340 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
17341 useperlio="$define"
17344 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17349 *) case "$usesfio" in
17350 true|$define|[yY]*)
17351 echo "Sorry, cannot find sfio on this machine." >&4
17352 echo "Ignoring your setting of usesfio=$usesfio." >&4
17361 $define) usesfio='true';;
17362 *) usesfio='false';;
17366 *) : Remove sfio from list of libraries to use
17369 echo "Removing unneeded -lsfio from library list" >&4
17370 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17373 echo "libs = $libs" >&4
17380 : see if shmctl exists
17381 set shmctl d_shmctl
17384 : see if shmget exists
17385 set shmget d_shmget
17388 : see if shmat exists
17391 : see what shmat returns
17394 $cat >shmat.c <<'END'
17395 #include <sys/shm.h>
17398 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17403 echo "and it returns ($shmattype)." >&4
17404 : see if a prototype for shmat is available
17405 xxx=`./findhdr sys/shm.h`
17406 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17407 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17418 set d_shmatprototype
17421 : see if shmdt exists
17425 : see how much of the 'shm*(2)' library is present.
17428 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17429 *"$undef"*) h_shm=false;;
17433 case "`ipcs 2>&1`" in
17434 "SVID shared memory"*"not configured"*)
17435 echo "Your $osname does not have the shm*(2) configured." >&4
17438 set shmctl d_shmctl
17440 set shmget d_shmget
17450 : we could also check for sys/ipc.h ...
17451 if $h_shm && $test `./findhdr sys/shm.h`; then
17452 echo "You have the full shm*(2) library." >&4
17455 echo "You don't have the full shm*(2) library." >&4
17461 : see if we have sigaction
17463 if set sigaction val -f d_sigaction; eval $csym; $val; then
17464 echo 'sigaction() found.' >&4
17467 #include <sys/types.h>
17468 #include <signal.h>
17469 #$i_stdlib I_STDLIB
17471 #include <stdlib.h>
17475 struct sigaction act, oact;
17477 oact.sa_handler = 0;
17478 /* so that act and oact are used */
17479 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17483 if eval $compile_ok; then
17486 echo "But you don't seem to have a useable struct sigaction." >&4
17490 echo 'sigaction NOT found.' >&4
17493 set d_sigaction; eval $setvar
17496 : see if this is a sunmath.h system
17497 set sunmath.h i_sunmath
17500 : see if signbit exists
17501 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17504 #$i_sunmath I_SUNMATH
17508 #ifdef I_SUNMATH /* Solaris special math library */
17509 # include <sunmath.h>
17512 int main(int argc, char **argv)
17516 if ((signbit(x) == 0) && (signbit(y) != 0))
17524 if eval $compile; then
17525 if $run ./try; then
17529 $echo "Signbit seems to be available, but doesn't work as I expected."
17530 $echo "I won't use it." >&4
17541 : see if sigprocmask exists
17542 set sigprocmask d_sigprocmask
17545 : see if sigsetjmp exists
17547 case "$d_sigsetjmp" in
17550 #include <setjmp.h>
17551 #$i_stdlib I_STDLIB
17553 #include <stdlib.h>
17559 if (sigsetjmp(env,1))
17562 siglongjmp(env, 1);
17567 if eval $compile; then
17568 if $run ./try >/dev/null 2>&1; then
17569 echo "POSIX sigsetjmp found." >&4
17573 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17579 echo "sigsetjmp not found." >&4
17583 *) val="$d_sigsetjmp"
17584 case "$d_sigsetjmp" in
17585 $define) echo "POSIX sigsetjmp found." >&4;;
17586 $undef) echo "sigsetjmp not found." >&4;;
17594 : see if snprintf exists
17595 set snprintf d_snprintf
17598 : see if vsnprintf exists
17599 set vsnprintf d_vsnprintf
17602 case "$d_snprintf-$d_vsnprintf" in
17605 Checking whether your snprintf() and vsnprintf() work okay...
17607 $cat >try.c <<'EOCP'
17608 /* v?snprintf testing logic courtesy of Russ Allbery.
17609 * According to C99:
17610 * - if the buffer is too short it still must be \0-terminated
17611 * - if the buffer is too short the potentially required length
17612 * must be returned and not -1
17613 * - if the buffer is NULL the potentially required length
17614 * must be returned and not -1 or core dump
17617 #include <stdarg.h>
17621 int test (char *format, ...)
17626 va_start (args, format);
17627 count = vsnprintf (buf, sizeof buf, format, args);
17634 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17635 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17639 if eval $compile; then
17642 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17644 Your snprintf() and snprintf() don't seem to be working okay.
17646 d_snprintf="$undef"
17647 d_vsnprintf="$undef"
17651 echo "(I can't seem to compile the test program--assuming they don't)"
17652 d_snprintf="$undef"
17653 d_vsnprintf="$undef"
17659 : see if sockatmark exists
17660 set sockatmark d_sockatmark
17663 : see if prototype for sockatmark is available
17665 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17668 : see if socks5_init exists
17669 set socks5_init d_socks5_init
17672 : see if sprintf returns the length of the string in the buffer as per ANSI
17673 $echo "Checking whether sprintf returns the length of the string..." >&4
17676 #$i_stdlib I_STDLIB
17678 #include <stdlib.h>
17680 #$i_string I_STRING
17682 # include <string.h>
17684 # include <strings.h>
17693 int check (size_t expect, int test) {
17694 size_t got = strlen(buffer);
17698 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17703 int main(int argc, char **argv) {
17706 check(sprintf(buffer, ""), ++test);
17707 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17708 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17715 if eval $compile; then
17719 sprintf returns the length of the string (as ANSI says it should)
17721 d_sprintf_returns_strlen="$define"
17724 sprintf does not return the length of the string (how old is this system?)
17726 d_sprintf_returns_strlen="$undef"
17730 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17731 d_sprintf_returns_strlen="$undef"
17735 : see if srand48_r exists
17736 set srand48_r d_srand48_r
17738 case "$d_srand48_r" in
17740 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17741 case "$d_srand48_r_proto:$usethreads" in
17742 ":define") d_srand48_r_proto=define
17743 set d_srand48_r_proto srand48_r $hdrs
17747 case "$d_srand48_r_proto" in
17749 case "$srand48_r_proto" in
17750 ''|0) try='int srand48_r(long, struct drand48_data*);'
17751 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17753 case "$srand48_r_proto" in
17754 ''|0) d_srand48_r=undef
17756 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17757 * ) case "$srand48_r_proto" in
17758 REENTRANT_PROTO*) ;;
17759 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17761 echo "Prototype: $try" ;;
17764 *) case "$usethreads" in
17765 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17772 *) srand48_r_proto=0
17776 : see if srandom_r exists
17777 set srandom_r d_srandom_r
17779 case "$d_srandom_r" in
17781 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17782 case "$d_srandom_r_proto:$usethreads" in
17783 ":define") d_srandom_r_proto=define
17784 set d_srandom_r_proto srandom_r $hdrs
17788 case "$d_srandom_r_proto" in
17790 case "$srandom_r_proto" in
17791 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17792 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
17794 case "$srandom_r_proto" in
17795 ''|0) d_srandom_r=undef
17797 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17798 * ) case "$srandom_r_proto" in
17799 REENTRANT_PROTO*) ;;
17800 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17802 echo "Prototype: $try" ;;
17805 *) case "$usethreads" in
17806 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17813 *) srandom_r_proto=0
17817 : see if prototype for setresgid is available
17819 set d_sresgproto setresgid $i_unistd unistd.h
17822 : see if prototype for setresuid is available
17824 set d_sresuproto setresuid $i_unistd unistd.h
17827 : see if sys/stat.h is available
17828 set sys/stat.h i_sysstat
17831 : see if stat knows about block sizes
17833 echo "Checking to see if your struct stat has st_blocks field..." >&4
17834 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17837 : see if this is a sys/vfs.h system
17838 set sys/vfs.h i_sysvfs
17841 : see if this is a sys/statfs.h system
17842 set sys/statfs.h i_sysstatfs
17845 : Check for statfs_s
17847 echo "Checking to see if your system supports struct statfs..." >&4
17848 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
17850 case "$d_statfs_s" in
17851 "$define") echo "Yes, it does." ;;
17852 *) echo "No, it doesn't." ;;
17856 : see if struct statfs knows about f_flags
17857 case "$d_statfs_s" in
17860 echo "Checking to see if your struct statfs has f_flags field..." >&4
17861 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
17865 set d_statfs_f_flags
17869 case "$d_statfs_f_flags" in
17870 "$define") echo "Yes, it does." ;;
17871 *) echo "No, it doesn't." ;;
17874 : see what flavor, if any, of static inline is supported
17876 echo "Checking to see if your system supports static inline..."
17877 $cat > try.c <<'EOCP'
17878 #include <stdlib.h>
17879 extern int f_via_a(int x);
17880 extern int f_via_b(int x);
17881 int main(int argc, char **argv)
17890 return EXIT_SUCCESS;
17893 return EXIT_FAILURE;
17897 $cat > a.c <<'EOCP'
17898 static INLINE int f(int x) {
17909 $cat > b.c <<'EOCP'
17910 extern int f(int x);
17918 # Respect a hint (or previous) value for perl_static_inline, if there is one.
17919 case "$perl_static_inline" in
17920 '') # Check the various possibilities, and break out on success.
17921 # For gcc, prefer __inline__, which will still permit
17922 # cflags.SH to add in -ansi.
17923 case "$gccversion" in
17924 '') xxx="inline __inline__ __inline _inline";;
17925 *) xxx="__inline__ inline __inline _inline";;
17927 for inline in $xxx; do
17928 set try -DINLINE=$inline a.c
17929 if eval $compile && $run ./try; then
17930 # Now make sure there is no external linkage of static
17932 set try -DINLINE=$inline -DUSE_B a.c b.c
17933 if eval $compile && $run ./try; then
17934 $echo "Your compiler supports static $inline, " >&4
17935 $echo "but it also creates an external definition," >&4
17936 $echo "so I won't use it." >&4
17939 $echo "Your compiler supports static $inline." >&4
17941 perl_static_inline="static $inline";
17945 $echo "Your compiler does NOT support static $inline." >&4
17950 *inline*) # Some variant of inline exists.
17951 echo "Keeping your $hint value of $perl_static_inline."
17954 static) # No inline capabilities
17955 echo "Keeping your $hint value of $perl_static_inline."
17958 *) # Unrecognized previous value -- blindly trust the supplied
17959 # value and hope it makes sense. Use old value for
17960 # d_static_inline, if there is one.
17961 echo "Keeping your $hint value of $perl_static_inline."
17962 case "$d_static_inline" in
17964 *) val=$d_static_inline ;;
17968 # Fallback to plain 'static' if nothing worked.
17969 case "$perl_static_inline" in
17971 perl_static_inline="static"
17975 set d_static_inline
17977 $rm -f a.[co] b.[co]
17980 : Check stream access
17982 Checking how to access stdio streams by file descriptor number...
17984 case "$stdio_stream_array" in
17985 '') $cat >try.c <<EOCP
17988 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17992 for s in _iob __iob __sF
17994 set try -DSTDIO_STREAM_ARRAY=$s
17995 if eval $compile; then
17996 case "`$run ./try`" in
17997 yes) stdio_stream_array=$s; break ;;
18003 case "$stdio_stream_array" in
18005 I can't figure out how to access stdio streams by file descriptor number.
18007 d_stdio_stream_array="$undef"
18010 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
18012 d_stdio_stream_array="$define"
18016 : see if strcoll exists
18017 set strcoll d_strcoll
18020 : check for structure copying
18022 echo "Checking to see if your C compiler can copy structs..." >&4
18023 $cat >try.c <<'EOCP'
18033 if $cc -c try.c >/dev/null 2>&1 ; then
18035 echo "Yup, it can."
18038 echo "Nope, it can't."
18044 : see if strerror and/or sys_errlist[] exist
18046 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
18047 if set strerror val -f d_strerror; eval $csym; $val; then
18048 echo 'strerror() found.' >&4
18049 d_strerror="$define"
18050 d_strerrm='strerror(e)'
18051 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18052 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
18053 d_syserrlst="$define"
18055 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
18056 d_syserrlst="$undef"
18058 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
18059 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
18060 echo 'strerror() found in string header.' >&4
18061 d_strerror="$define"
18062 d_strerrm='strerror(e)'
18063 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18064 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
18065 d_syserrlst="$define"
18067 echo "(You don't appear to have any sys_errlist[], how can this be?)"
18068 d_syserrlst="$undef"
18070 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
18071 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
18072 d_strerror="$undef"
18073 d_syserrlst="$define"
18074 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
18076 echo 'strerror() and sys_errlist[] NOT found.' >&4
18077 d_strerror="$undef"
18078 d_syserrlst="$undef"
18079 d_strerrm='"unknown"'
18083 : see if strerror_r exists
18084 set strerror_r d_strerror_r
18086 case "$d_strerror_r" in
18088 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
18089 case "$d_strerror_r_proto:$usethreads" in
18090 ":define") d_strerror_r_proto=define
18091 set d_strerror_r_proto strerror_r $hdrs
18095 case "$d_strerror_r_proto" in
18097 case "$strerror_r_proto" in
18098 ''|0) try='int strerror_r(int, char*, size_t);'
18099 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
18101 case "$strerror_r_proto" in
18102 ''|0) try='int strerror_r(int, char*, int);'
18103 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18105 case "$strerror_r_proto" in
18106 ''|0) try='char* strerror_r(int, char*, size_t);'
18107 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18109 case "$strerror_r_proto" in
18110 ''|0) d_strerror_r=undef
18112 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18113 * ) case "$strerror_r_proto" in
18114 REENTRANT_PROTO*) ;;
18115 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18117 echo "Prototype: $try" ;;
18120 *) case "$usethreads" in
18121 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18128 *) strerror_r_proto=0
18132 : see if strftime exists
18133 set strftime d_strftime
18136 : see if strlcat exists
18137 set strlcat d_strlcat
18140 : see if strlcpy exists
18141 set strlcpy d_strlcpy
18144 : see if strtod exists
18145 set strtod d_strtod
18148 : see if strtol exists
18149 set strtol d_strtol
18152 : see if strtold exists
18153 set strtold d_strtold
18156 : see if strtoll exists
18157 set strtoll d_strtoll
18160 case "$d_longlong-$d_strtoll" in
18163 Checking whether your strtoll() works okay...
18165 $cat >try.c <<'EOCP'
18168 #define strtoll __strtoll
18171 #define strtoll _strtoll
18174 extern long long int strtoll(char *s, char **, int);
18175 static int bad = 0;
18176 int check(char *s, long long ell, int een) {
18179 gll = strtoll(s, 0, 10);
18180 if (!((gll == ell) && (errno == een)))
18184 check(" 1", 1LL, 0);
18185 check(" 0", 0LL, 0);
18186 check("-1", -1LL, 0);
18187 check("-9223372036854775808", -9223372036854775808LL, 0);
18188 check("-9223372036854775808", -9223372036854775808LL, 0);
18189 check(" 9223372036854775807", 9223372036854775807LL, 0);
18190 check("-9223372036854775808", -9223372036854775808LL, 0);
18191 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18192 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18198 if eval $compile; then
18201 ok) echo "Your strtoll() seems to be working okay." ;;
18203 Your strtoll() doesn't seem to be working okay.
18209 echo "(I can't seem to compile the test program--assuming it doesn't)"
18215 : see if strtoq exists
18216 set strtoq d_strtoq
18219 : see if strtoul exists
18220 set strtoul d_strtoul
18223 case "$d_strtoul" in
18226 Checking whether your strtoul() works okay...
18228 $cat >try.c <<'EOCP'
18231 extern unsigned long int strtoul(char *s, char **, int);
18232 static int bad = 0;
18233 void check(char *s, unsigned long eul, int een) {
18236 gul = strtoul(s, 0, 10);
18237 if (!((gul == eul) && (errno == een)))
18241 check(" 1", 1L, 0);
18242 check(" 0", 0L, 0);
18244 case "$longsize" in
18246 $cat >>try.c <<'EOCP'
18247 check("18446744073709551615", 18446744073709551615UL, 0);
18248 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18249 #if 0 /* strtoul() for /^-/ strings is undefined. */
18250 check("-1", 18446744073709551615UL, 0);
18251 check("-18446744073709551614", 2, 0);
18252 check("-18446744073709551615", 1, 0);
18253 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18254 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18259 $cat >>try.c <<'EOCP'
18260 check("4294967295", 4294967295UL, 0);
18261 check("4294967296", 4294967295UL, ERANGE);
18262 #if 0 /* strtoul() for /^-/ strings is undefined. */
18263 check("-1", 4294967295UL, 0);
18264 check("-4294967294", 2, 0);
18265 check("-4294967295", 1, 0);
18266 check("-4294967296", 4294967295UL, ERANGE);
18267 check("-4294967297", 4294967295UL, ERANGE);
18272 : Should we write these tests to be more portable by sprintf-ing
18273 : ~0 and then manipulating that char string as input for strtol?
18276 $cat >>try.c <<'EOCP'
18283 if eval $compile; then
18284 case "`$run ./try`" in
18285 ok) echo "Your strtoul() seems to be working okay." ;;
18287 Your strtoul() doesn't seem to be working okay.
18293 echo "(I can't seem to compile the test program--assuming it doesn't)"
18299 : see if strtoull exists
18300 set strtoull d_strtoull
18303 case "$d_longlong-$d_strtoull" in
18306 Checking whether your strtoull() works okay...
18308 $cat >try.c <<'EOCP'
18311 #define strtoull __strtoull
18314 extern unsigned long long int strtoull(char *s, char **, int);
18315 static int bad = 0;
18316 int check(char *s, long long eull, int een) {
18319 gull = strtoull(s, 0, 10);
18320 if (!((gull == eull) && (errno == een)))
18324 check(" 1", 1LL, 0);
18325 check(" 0", 0LL, 0);
18326 check("18446744073709551615", 18446744073709551615ULL, 0);
18327 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18328 #if 0 /* strtoull() for /^-/ strings is undefined. */
18329 check("-1", 18446744073709551615ULL, 0);
18330 check("-18446744073709551614", 2LL, 0);
18331 check("-18446744073709551615", 1LL, 0);
18332 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18333 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18340 if eval $compile; then
18341 case "`$run ./try`" in
18342 ok) echo "Your strtoull() seems to be working okay." ;;
18344 Your strtoull() doesn't seem to be working okay.
18346 d_strtoull="$undef"
18350 echo "(I can't seem to compile the test program--assuming it doesn't)"
18351 d_strtoull="$undef"
18356 : see if strtouq exists
18357 set strtouq d_strtouq
18360 case "$d_strtouq" in
18363 Checking whether your strtouq() works okay...
18365 $cat >try.c <<'EOCP'
18368 extern unsigned long long int strtouq(char *s, char **, int);
18369 static int bad = 0;
18370 void check(char *s, unsigned long long eull, int een) {
18371 unsigned long long gull;
18373 gull = strtouq(s, 0, 10);
18374 if (!((gull == eull) && (errno == een)))
18378 check(" 1", 1LL, 0);
18379 check(" 0", 0LL, 0);
18380 check("18446744073709551615", 18446744073709551615ULL, 0);
18381 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18382 #if 0 /* strtouq() for /^-/ strings is undefined. */
18383 check("-1", 18446744073709551615ULL, 0);
18384 check("-18446744073709551614", 2LL, 0);
18385 check("-18446744073709551615", 1LL, 0);
18386 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18387 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18395 if eval $compile; then
18396 case "`$run ./try`" in
18397 ok) echo "Your strtouq() seems to be working okay." ;;
18399 Your strtouq() doesn't seem to be working okay.
18405 echo "(I can't seem to compile the test program--assuming it doesn't)"
18411 : see if strxfrm exists
18412 set strxfrm d_strxfrm
18415 : see if symlink exists
18416 set symlink d_symlink
18419 : see if syscall exists
18420 set syscall d_syscall
18423 : see if prototype for syscall is available
18425 set d_syscallproto syscall $i_unistd unistd.h
18428 : see if sysconf exists
18429 set sysconf d_sysconf
18432 : see if system exists
18433 set system d_system
18436 : see if tcgetpgrp exists
18437 set tcgetpgrp d_tcgetpgrp
18440 : see if tcsetpgrp exists
18441 set tcsetpgrp d_tcsetpgrp
18444 : see if prototype for telldir is available
18446 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18449 : see if time exists
18451 if test "X$d_time" = X -o X"$timetype" = X; then
18452 if set time val -f d_time; eval $csym; $val; then
18453 echo 'time() found.' >&4
18455 rp="What is the type returned by time() on this system?"
18456 set time_t timetype long stdio.h sys/types.h
18459 echo 'time() not found, hope that will do.' >&4
18467 : see if timegm exists
18468 set timegm d_timegm
18471 : see if this is a sys/times.h system
18472 set sys/times.h i_systimes
18475 : see if times exists
18477 if set times val -f d_times; eval $csym; $val; then
18478 echo 'times() found.' >&4
18481 case "$i_systimes" in
18482 "$define") inc='sys/times.h';;
18484 rp="What is the type returned by times() on this system?"
18485 set clock_t clocktype long stdio.h sys/types.h $inc
18488 echo 'times() NOT found, hope that will do.' >&4
18493 : see if tmpnam_r exists
18494 set tmpnam_r d_tmpnam_r
18496 case "$d_tmpnam_r" in
18498 hdrs="$i_systypes sys/types.h define stdio.h "
18499 case "$d_tmpnam_r_proto:$usethreads" in
18500 ":define") d_tmpnam_r_proto=define
18501 set d_tmpnam_r_proto tmpnam_r $hdrs
18505 case "$d_tmpnam_r_proto" in
18507 case "$tmpnam_r_proto" in
18508 ''|0) try='char* tmpnam_r(char*);'
18509 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18511 case "$tmpnam_r_proto" in
18512 ''|0) d_tmpnam_r=undef
18514 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18515 * ) case "$tmpnam_r_proto" in
18516 REENTRANT_PROTO*) ;;
18517 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18519 echo "Prototype: $try" ;;
18522 *) case "$usethreads" in
18523 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18530 *) tmpnam_r_proto=0
18534 : see if truncate exists
18535 set truncate d_truncate
18538 : see if ttyname_r exists
18539 set ttyname_r d_ttyname_r
18541 case "$d_ttyname_r" in
18543 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18544 case "$d_ttyname_r_proto:$usethreads" in
18545 ":define") d_ttyname_r_proto=define
18546 set d_ttyname_r_proto ttyname_r $hdrs
18550 case "$d_ttyname_r_proto" in
18552 case "$ttyname_r_proto" in
18553 ''|0) try='int ttyname_r(int, char*, size_t);'
18554 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18556 case "$ttyname_r_proto" in
18557 ''|0) try='int ttyname_r(int, char*, int);'
18558 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18560 case "$ttyname_r_proto" in
18561 ''|0) try='char* ttyname_r(int, char*, int);'
18562 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18564 case "$ttyname_r_proto" in
18565 ''|0) d_ttyname_r=undef
18567 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18568 * ) case "$ttyname_r_proto" in
18569 REENTRANT_PROTO*) ;;
18570 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18572 echo "Prototype: $try" ;;
18575 *) case "$usethreads" in
18576 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18583 *) ttyname_r_proto=0
18587 : see if tzname[] exists
18589 if set tzname val -a d_tzname; eval $csym; $val; then
18591 echo 'tzname[] found.' >&4
18594 echo 'tzname[] NOT found.' >&4
18599 : Check if is a multiplatform env
18601 next|rhapsody|darwin) multiarch="$define" ;;
18603 case "$multiarch" in
18604 ''|[nN]*) multiarch="$undef" ;;
18607 : check for ordering of bytes in a UV
18609 case "$usecrosscompile$multiarch" in
18612 You seem to be either cross-compiling or doing a multiarchitecture build,
18613 skipping the byteorder check.
18619 case "$byteorder" in
18622 In the following, larger digits indicate more significance. A big-endian
18623 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18624 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18625 machines may have weird orders like 3412. A Cray will report 87654321,
18626 an Alpha will report 12345678. If the test program works the default is
18628 I'm now running the test program...
18632 #$i_stdlib I_STDLIB
18634 #include <stdlib.h>
18636 #include <sys/types.h>
18637 typedef $uvtype UV;
18647 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18649 u.l = (UV)0x04030201;
18650 for (i = 0; i < $uvsize; i++)
18651 printf("%c", u.c[i]+'0');
18658 if eval $compile && $run ./try > /dev/null; then
18661 [1-4][1-4][1-4][1-4]|12345678|87654321)
18662 echo "(The test program ran ok.)"
18663 echo "byteorder=$dflt"
18666 ????|????????) echo "(The test program ran ok.)" ;;
18667 *) echo "(The test program didn't run right for some reason.)" ;;
18672 (I can't seem to compile the test program. Guessing big-endian...)
18675 case "$xxx_prompt" in
18677 rp="What is the order of bytes in $uvtype?"
18690 : Checking 32bit aligndness
18693 Checking to see whether you can access character data unalignedly...
18695 case "$d_u32align" in
18696 '') $cat >try.c <<EOCP
18698 #$i_stdlib I_STDLIB
18700 #include <stdlib.h>
18702 #define U32 $u32type
18703 #define BYTEORDER 0x$byteorder
18705 #include <signal.h>
18707 $signal_t bletch(int s) { exit(4); }
18710 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18711 volatile U8 buf[8];
18715 if (sizeof(U32) != 4) {
18716 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18723 signal(SIGBUS, bletch);
18735 for (i = 0; i < 4; i++) {
18736 up = (U32*)(buf + i);
18737 if (! ((*up == 1 << (8*i)) || /* big-endian */
18738 (*up == 1 << (8*(3-i))) /* little-endian */
18742 printf("read failed (%x)\n", *up);
18748 for (i = 0; i < 4; i++) {
18749 up = (U32*)(buf + i);
18751 if (*up != 0xBeef) {
18752 printf("write failed (%x)\n", *up);
18766 if eval $compile_ok; then
18767 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18768 $run ./try 2>&1 >/dev/null
18771 You can access character data pretty unalignedly.
18773 d_u32align="$undef"
18776 It seems that you must access character data in an aligned manner.
18778 d_u32align="$define"
18782 rp='Can you access character data at unaligned addresses?'
18786 [yY]*) d_u32align="$undef" ;;
18787 *) d_u32align="$define" ;;
18794 : see if ualarm exists
18795 set ualarm d_ualarm
18798 : see if umask exists
18802 : see if unordered exists
18803 set unordered d_unordered
18806 : see if unsetenv exists
18807 set unsetenv d_unsetenv
18810 : see if usleep exists
18811 set usleep d_usleep
18814 : see if prototype for usleep is available
18816 set d_usleepproto usleep $i_unistd unistd.h
18819 : see if ustat exists
18823 : see if closedir exists
18824 set closedir d_closedir
18827 case "$d_closedir" in
18830 echo "Checking whether closedir() returns a status..." >&4
18832 #$i_dirent I_DIRENT /**/
18833 #$i_sysdir I_SYS_DIR /**/
18834 #$i_sysndir I_SYS_NDIR /**/
18835 #$i_systypes I_SYS_TYPES /**/
18837 #if defined(I_SYS_TYPES)
18838 #include <sys/types.h>
18840 #if defined(I_DIRENT)
18841 #include <dirent.h>
18842 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18843 #include <sys/dir.h>
18847 #include <sys/ndir.h>
18851 #include <ndir.h> /* may be wrong in the future */
18853 #include <sys/dir.h>
18858 int main() { return closedir(opendir(".")); }
18861 if eval $compile_ok; then
18862 if $run ./try > /dev/null 2>&1 ; then
18863 echo "Yes, it does."
18866 echo "No, it doesn't."
18870 echo "(I can't seem to compile the test program--assuming it doesn't)"
18878 set d_void_closedir
18882 : see if there is a wait4
18886 : see if waitpid exists
18887 set waitpid d_waitpid
18890 : see if wcstombs exists
18891 set wcstombs d_wcstombs
18894 : see if wctomb exists
18895 set wctomb d_wctomb
18898 : see if writev exists
18899 set writev d_writev
18902 : preserve RCS keywords in files with variable substitution, grrr
18907 Revision='$Revision'
18909 : check for alignment requirements
18911 case "$usecrosscompile$multiarch" in
18914 You seem to be either cross-compiling or doing a multiarchitecture build,
18915 skipping the memory alignment check.
18918 case "$alignbytes" in
18919 '') alignbytes=8 ;;
18923 case "$alignbytes" in
18924 '') echo "Checking alignment constraints..." >&4
18925 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18926 $cat >try.c <<'EOCP'
18927 typedef long double NV;
18930 $cat >try.c <<'EOCP'
18934 $cat >>try.c <<'EOCP'
18942 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18947 if eval $compile_ok; then
18951 echo "(I can't seem to compile the test program...)"
18954 *) dflt="$alignbytes"
18957 rp="Doubles must be aligned on a how-many-byte boundary?"
18965 : set the base revision
18968 : length of character in bytes. Is always 1, otherwise it isnt C
18969 : This used to be a test using sizeof
18972 : Check for the number of bits in a character
18973 case "$charbits" in
18974 '') echo "Checking how long a character is (in bits)..." >&4
18981 for (c = 1, n = 0; c; c <<= 1, n++) ;
18982 printf ("%d\n", n);
18987 if eval $compile_ok; then
18991 echo "(I can't seem to compile the test program. Guessing...)"
18998 rp="What is the length of a character (in bits)?"
19002 case "$charbits" in
19005 Your system has an unsigned character size of $charbits bits, which
19006 is rather unusual (normally it is 8 bits). Perl likely will not work
19007 correctly on your system, with subtle bugs in various places.
19009 rp='Do you really want to continue?'
19013 [yY]) echo >&4 "Okay, continuing." ;;
19018 : how do we concatenate cpp tokens here?
19020 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
19021 $cat >cpp_stuff.c <<'EOCP'
19022 #define RCAT(a,b)a/**/b
19023 #define ACAT(a,b)a ## b
19027 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
19028 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
19029 echo "Oh! Smells like ANSI's been here." >&4
19030 echo "We can catify or stringify, separately or together!"
19032 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
19033 echo "Ah, yes! The good old days!" >&4
19034 echo "However, in the good old days we don't know how to stringify and"
19035 echo "catify at the same time."
19039 Hmm, I don't seem to be able to concatenate tokens with your cpp.
19040 You're going to have to edit the values of CAT[2-5] in config.h...
19042 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
19046 : see if this is a db.h system
19052 : Check db version.
19054 echo "Checking Berkeley DB version ..." >&4
19060 #include <sys/types.h>
19062 #$i_stdlib I_STDLIB
19064 #include <stdlib.h>
19067 int main(int argc, char *argv[])
19069 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
19070 int Major, Minor, Patch ;
19071 unsigned long Version ;
19072 (void)db_version(&Major, &Minor, &Patch) ;
19074 printf("%d %d %d %d %d %d\n",
19075 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19076 Major, Minor, Patch);
19079 printf("You have Berkeley DB Version 2 or greater.\n");
19081 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19082 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19083 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19084 Major, Minor, Patch) ;
19086 /* check that db.h & libdb are compatible */
19087 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19088 printf("db.h and libdb are incompatible.\n") ;
19092 printf("db.h and libdb are compatible.\n") ;
19094 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19095 + DB_VERSION_PATCH ;
19097 /* needs to be >= 2.3.4 */
19098 if (Version < 2003004) {
19099 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19100 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19106 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19111 printf("You have Berkeley DB Version 1.\n");
19112 exit(0); /* DB version < 2: the coast is clear. */
19114 exit(1); /* <db.h> not Berkeley DB? */
19120 if eval $compile_ok && $run ./try; then
19121 echo 'Looks OK.' >&4
19123 db_version_major=$1
19124 db_version_minor=$2
19125 db_version_patch=$3
19127 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19131 : Remove db from list of libraries to use
19132 echo "Removing unusable -ldb from library list" >&4
19133 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19136 echo "libs = $libs" >&4
19146 : Check the return type needed for hash
19148 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19154 #include <sys/types.h>
19157 #ifndef DB_VERSION_MAJOR
19158 u_int32_t hash_cb (ptr, size)
19166 info.hash = hash_cb;
19170 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19171 if $contains warning try.out >>/dev/null 2>&1 ; then
19174 db_hashtype='u_int32_t'
19177 : XXX Maybe we should just give up here.
19178 db_hashtype=u_int32_t
19180 echo "Help: I can't seem to compile the db test program." >&4
19181 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19184 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19186 *) db_hashtype=u_int32_t
19191 : Check the return type needed for prefix
19193 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19199 #include <sys/types.h>
19202 #ifndef DB_VERSION_MAJOR
19203 size_t prefix_cb (key1, key2)
19211 info.prefix = prefix_cb;
19215 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19216 if $contains warning try.out >>/dev/null 2>&1 ; then
19217 db_prefixtype='int'
19219 db_prefixtype='size_t'
19222 db_prefixtype='size_t'
19223 : XXX Maybe we should just give up here.
19225 echo "Help: I can't seem to compile the db test program." >&4
19226 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19229 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19231 *) db_prefixtype='size_t'
19235 : How can we generate normalized random numbers ?
19237 echo "Looking for a random number function..." >&4
19238 case "$randfunc" in
19240 if set drand48 val -f; eval $csym; $val; then
19242 echo "Good, found drand48()." >&4
19243 elif set random val -f; eval $csym; $val; then
19245 echo "OK, found random()." >&4
19248 echo "Yick, looks like I have to use rand()." >&4
19259 *-Dmy_rand=*|*-Dmy_srand=*)
19260 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19261 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19262 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19263 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19267 while $test "$cont"; do
19268 rp="Use which function to generate random numbers?"
19270 if $test "$ans" = "$dflt"; then
19276 if set $ans val -f; eval $csym; $val; then
19280 rp="I cannot find function $ans. Use that name anyway?"
19289 case "$randfunc" in
19291 drand01="drand48()"
19297 case "$randbits" in
19299 echo "Checking to see how many bits your $randfunc() function produces..." >&4
19301 #$i_unistd I_UNISTD
19302 #$i_stdlib I_STDLIB
19305 # include <unistd.h>
19308 # include <stdlib.h>
19313 register unsigned long tmp;
19314 register unsigned long max = 0L;
19316 for (i = 1000; i; i--) {
19317 tmp = (unsigned long) $randfunc();
19318 if (tmp > max) max = tmp;
19320 for (i = 0; max; i++)
19326 if eval $compile_ok; then
19330 echo "(I can't seem to compile the test program...)"
19337 rp="How many bits does your $randfunc() function produce?"
19341 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19342 seedfunc="s$randfunc"
19343 randseedtype=unsigned
19347 rp="How many bits does your $randfunc() function produce?"
19350 seedfunc="s$randfunc"
19351 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19352 if set $seedfunc val -f; eval $csym; $val; then
19353 echo "(Using $seedfunc() to seed random generator)"
19355 echo "(Warning: no $seedfunc() to seed random generator)"
19358 randseedtype=unsigned
19365 : Determine if this is an EBCDIC system
19367 echo "Determining whether or not we are on an EBCDIC system..." >&4
19368 $cat >try.c <<'EOM'
19371 if ('M'==0xd4) return 0;
19378 if eval $compile_ok; then
19379 if $run ./try; then
19380 echo "You seem to speak EBCDIC." >&4
19383 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19386 echo "I'm unable to compile the test program." >&4
19387 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19393 : Check how to flush
19396 Checking how to flush all pending stdio output...
19398 # I only know how to find the first 32 possibly open files on SunOS.
19399 # See also hints/sunos_4_1.sh and util.c --AD
19401 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19403 $cat >>try.c <<EOCP
19405 #$i_stdlib I_STDLIB
19407 #include <stdlib.h>
19409 #$i_unistd I_UNISTD
19411 # include <unistd.h>
19413 #$d_sysconf HAS_SYSCONF
19414 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19415 #ifdef HAS_STDIO_STREAM_ARRAY
19416 # define STDIO_STREAM_ARRAY $stdio_stream_array
19421 p = fopen("try.out", "w");
19425 # ifdef TRY_FPRINTF
19429 #ifdef TRY_FFLUSH_NULL
19432 #ifdef TRY_FFLUSH_ALL
19434 long open_max = -1;
19435 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19436 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19438 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19439 open_max = sysconf(_SC_OPEN_MAX);
19442 open_max = FOPEN_MAX;
19445 open_max = OPEN_MAX;
19454 # ifdef HAS_STDIO_STREAM_ARRAY
19455 if (open_max > 0) {
19457 for (i = 0; i < open_max; i++)
19458 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19459 STDIO_STREAM_ARRAY[i]._file < open_max &&
19460 STDIO_STREAM_ARRAY[i]._flag)
19461 fflush(&STDIO_STREAM_ARRAY[i]);
19469 : first we have to find out how _not_ to flush
19471 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19473 set try -DTRY_FPUTC
19474 if eval $compile; then
19475 $run ./try 2>/dev/null
19478 if $test ! -s try.out -a "X$code" = X42; then
19484 set try -DTRY_FPRINTF
19485 if eval $compile; then
19486 $run ./try 2>/dev/null
19489 if $test ! -s try.out -a "X$code" = X42; then
19490 output=-DTRY_FPRINTF
19496 : check for fflush NULL behaviour
19497 case "$fflushNULL" in
19498 '') set try -DTRY_FFLUSH_NULL $output
19499 if eval $compile; then
19500 $run ./try 2>/dev/null
19503 if $test -s try.out -a "X$code" = X42; then
19504 fflushNULL="`$cat try.out`"
19506 if $test "X$code" != X42; then
19508 (If this test failed, don't worry, we'll try another method shortly.)
19513 $rm -f core try.core core.try.*
19514 case "$fflushNULL" in
19516 Your fflush(NULL) works okay for output streams.
19517 Let's see if it clobbers input pipes...
19519 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19520 # bug that improperly flushes the input end of pipes. So we avoid the
19521 # autoflush on fork/system/exec support for now. :-(
19522 $cat >tryp.c <<EOCP
19525 main(int argc, char **argv)
19531 while ((i = getc(stdin)) != -1
19532 && (*bp++ = i) != '\n'
19533 && bp < &buf[1024])
19536 fprintf(stdout, "%s", buf);
19544 fflushNULL="$define"
19546 if eval $compile; then
19548 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19549 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19551 fflush(NULL) seems to behave okay with input streams.
19553 fflushNULL="$define"
19556 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19558 fflushNULL="$undef"
19561 $rm -f core tryp.c tryp.core core.tryp.*
19564 Your fflush(NULL) isn't working (contrary to ANSI C).
19566 fflushNULL="$undef"
19569 Cannot figure out whether your fflush(NULL) works or not.
19570 I'm assuming it doesn't (contrary to ANSI C).
19572 fflushNULL="$undef"
19576 $define|true|[yY]*)
19577 fflushNULL="$define"
19580 fflushNULL="$undef"
19583 : check explicit looping only if NULL did not work, and if the pipe
19584 : bug does not show up on an explicit flush too
19585 case "$fflushNULL" in
19587 $cat >tryp.c <<EOCP
19590 main(int argc, char **argv)
19596 while ((i = getc(stdin)) != -1
19597 && (*bp++ = i) != '\n'
19598 && bp < &buf[1024])
19601 fprintf(stdout, "%s", buf);
19610 if eval $compile; then
19612 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19613 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19615 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19617 : now check for fflushall behaviour
19618 case "$fflushall" in
19619 '') set try -DTRY_FFLUSH_ALL $output
19620 if eval $compile; then
19622 (Now testing the other method--but note that this also may fail.)
19624 $run ./try 2>/dev/null
19627 if $test -s try.out -a "X$code" = X42; then
19628 fflushall="`$cat try.out`"
19632 case "$fflushall" in
19634 Whew. Flushing explicitly all the stdio streams works.
19636 fflushall="$define"
19639 Sigh. Flushing explicitly all the stdio streams doesn't work.
19644 Cannot figure out whether flushing stdio streams explicitly works or not.
19645 I'm assuming it doesn't.
19651 "$define"|true|[yY]*)
19652 fflushall="$define"
19660 All is futile. Even fflush(stdin) clobbers input pipes!
19667 $rm -f core tryp.c tryp.core core.tryp.*
19669 *) fflushall="$undef"
19673 case "$fflushNULL$fflushall" in
19676 OK, I give up. I cannot figure out how to flush pending stdio output.
19677 We won't be flushing handles at all before fork/exec/popen.
19683 : Store the full pathname to the ar program for use in the C program
19684 : Respect a hint or command line value for full_ar.
19689 : Store the full pathname to the sed program for use in the C program
19692 : see what type gids are declared as in the kernel
19694 echo "Looking for the type for group ids returned by getgid()."
19695 set gid_t gidtype xxx stdio.h sys/types.h
19699 xxx=`./findhdr sys/user.h`
19700 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19702 unsigned) dflt="$1 $2" ;;
19706 *) dflt="$gidtype";;
19709 gid_t) echo "gid_t found." ;;
19710 *) rp="What is the type for group ids returned by getgid()?"
19716 : Check the size of GID
19719 *_t) zzz="$gidtype" ;;
19722 echo "Checking the size of $zzz..." >&4
19724 #include <sys/types.h>
19726 #$i_stdlib I_STDLIB
19728 #include <stdlib.h>
19731 printf("%d\n", (int)sizeof($gidtype));
19736 if eval $compile_ok; then
19740 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19743 echo "Your $zzz is $gidsize bytes long."
19748 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19752 : Check if GID is signed
19755 *_t) zzz="$gidtype" ;;
19758 echo "Checking the sign of $zzz..." >&4
19760 #include <sys/types.h>
19771 if eval $compile; then
19775 echo "(I can't execute the test program--guessing unsigned.)" >&4
19779 1) echo "Your $zzz is unsigned." ;;
19780 -1) echo "Your $zzz is signed." ;;
19786 echo "(I can't compile the test program--guessing unsigned.)" >&4
19790 : Check 64bit sizes
19793 if $test X"$quadtype" != X; then
19795 echo "Checking how to print 64-bit integers..." >&4
19797 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19798 $cat >try.c <<'EOCP'
19799 #include <sys/types.h>
19802 int q = 12345678901;
19803 printf("%ld\n", q);
19807 if eval $compile; then
19811 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19812 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19813 echo "We will use %d."
19819 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19820 $cat >try.c <<'EOCP'
19821 #include <sys/types.h>
19824 long q = 12345678901;
19825 printf("%ld\n", q);
19829 if eval $compile; then
19833 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19834 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19835 echo "We will use %ld."
19841 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19842 $cat >try.c <<'EOCP'
19843 #include <sys/types.h>
19844 #include <inttypes.h>
19847 int64_t q = 12345678901;
19848 printf("%" PRId64 "\n", q);
19852 if eval $compile; then
19856 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19857 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19858 echo "We will use the C9X style."
19864 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19866 #include <sys/types.h>
19869 $quadtype q = 12345678901;
19870 printf("%Ld\n", q);
19874 if eval $compile; then
19878 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19879 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19880 echo "We will use %Ld."
19886 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19887 $cat >try.c <<'EOCP'
19888 #include <sys/types.h>
19891 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19892 printf("%lld\n", q);
19896 if eval $compile; then
19900 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19901 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19902 echo "We will use the %lld style."
19908 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19910 #include <sys/types.h>
19913 $quadtype q = 12345678901;
19914 printf("%qd\n", q);
19918 if eval $compile; then
19922 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19923 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19924 echo "We will use %qd."
19930 if $test X"$sPRId64" = X; then
19931 echo "Cannot figure out how to print 64-bit integers." >&4
19938 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19939 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19941 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19942 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19946 : Check format strings for internal types
19948 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19950 if $test X"$ivsize" = X8; then
19951 ivdformat="$sPRId64"
19952 uvuformat="$sPRIu64"
19953 uvoformat="$sPRIo64"
19954 uvxformat="$sPRIx64"
19955 uvXUformat="$sPRIXU64"
19957 if $test X"$ivsize" = X"$longsize"; then
19964 if $test X"$ivsize" = X"$intsize"; then
19972 if $test X"$ivsize" = X"$shortsize"; then
19983 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19984 nveformat="$sPRIeldbl"
19985 nvfformat="$sPRIfldbl"
19986 nvgformat="$sPRIgldbl"
19987 nvEUformat="$sPRIEUldbl"
19988 nvFUformat="$sPRIFUldbl"
19989 nvGUformat="$sPRIGUldbl"
19999 case "$ivdformat" in
20000 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
20005 : Check format string for GID
20008 $echo "Checking the format string to be used for gids..." >&4
20011 -1) if $test X"$gidsize" = X"$ivsize"; then
20012 gidformat="$ivdformat"
20014 if $test X"$gidsize" = X"$longsize"; then
20017 if $test X"$gidsize" = X"$intsize"; then
20020 if $test X"$gidsize" = X"$shortsize"; then
20027 *) if $test X"$gidsize" = X"$uvsize"; then
20028 gidformat="$uvuformat"
20030 if $test X"$gidsize" = X"$longsize"; then
20033 if $test X"$gidsize" = X"$intsize"; then
20036 if $test X"$gidsize" = X"$shortsize"; then
20045 : see if getgroups exists
20046 set getgroups d_getgrps
20049 : see if setgroups exists
20050 set setgroups d_setgrps
20053 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
20055 case "$d_getgrps$d_setgrps" in
20057 case "$groupstype" in
20058 '') dflt="$gidtype" ;;
20059 *) dflt="$groupstype" ;;
20062 What type of pointer is the second argument to getgroups() and setgroups()?
20063 Usually this is the same as group ids, $gidtype, but not always.
20066 rp='What type pointer is the second argument to getgroups() and setgroups()?'
20070 *) groupstype="$gidtype";;
20073 : MAD = Misc Attribute Definition
20075 if $test $patchlevel -lt 9; then
20076 : MAD is not available in 5.8.x or earlier.
20080 $define|true|[yY]*) dflt='y' ;;
20085 Would you like to build with Misc Attribute Decoration? This is development
20086 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
20087 overhead on the interpreter.
20089 If this doesn't make any sense to you, just accept the default '$dflt'.
20091 rp='Build Perl with MAD?'
20096 madlyh='madly.h madly.act madly.tab'
20098 madlyobj="madly$_o" ;;
20107 : check whether make sets MAKE
20109 echo "Checking if your $make program sets \$(MAKE)..." >&4
20110 case "$make_set_make" in
20112 $sed 's/^X //' > testmake.mak << 'EOF'
20114 X @echo 'maketemp="$(MAKE)"'
20116 case "`$make -f testmake.mak 2>/dev/null`" in
20117 *maketemp=*) make_set_make='#' ;;
20118 *) make_set_make="MAKE=$make" ;;
20120 $rm -f testmake.mak
20123 case "$make_set_make" in
20124 '#') echo "Yup, it does.";;
20125 *) echo "Nope, it doesn't.";;
20128 : see what type is used for mode_t
20129 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20130 set mode_t modetype int stdio.h sys/types.h
20133 : see if we need va_copy
20135 case "$i_stdarg" in
20138 #include <stdarg.h>
20140 #$i_stdlib I_STDLIB
20142 #include <stdlib.h>
20144 #include <signal.h>
20147 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20149 return vfprintf(f, fmt, *valp);
20153 myvfprintf(FILE *f, const char *fmt, va_list val)
20155 return ivfprintf(f, fmt, &val);
20159 myprintf(char *fmt, ...)
20162 va_start(val, fmt);
20163 return myvfprintf(stdout, fmt, val);
20167 main(int ac, char **av)
20169 signal(SIGSEGV, exit);
20171 myprintf("%s%cs all right, then\n", "that", '\'');
20176 if eval $compile && $run ./try 2>&1 >/dev/null; then
20177 case "`$run ./try`" in
20178 "that's all right, then")
20184 yes) echo "It seems that you don't need va_copy()." >&4
20185 need_va_copy="$undef"
20187 *) echo "It seems that va_copy() or similar will be needed." >&4
20188 need_va_copy="$define"
20193 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20197 : see what type is used for size_t
20198 rp="What is the type used for the length parameter for string functions?"
20199 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20202 : check for type of arguments to gethostbyaddr.
20203 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20204 case "$d_gethbyaddr" in
20208 Checking to see what type of arguments are accepted by gethostbyaddr().
20210 hdrs="$define sys/types.h
20211 $d_socket sys/socket.h
20212 $i_niin netinet/in.h
20214 $i_unistd unistd.h"
20215 : The first arg can 'char *' or 'void *'
20216 : The second arg is some of integral type
20217 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20218 for yyy in size_t long int; do
20219 case "$netdb_host_type" in
20220 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20221 if ./protochk "$try" $hdrs; then
20222 echo "Your system accepts $xxx for the first arg."
20223 echo "...and $yyy for the second arg."
20224 netdb_host_type="$xxx"
20225 netdb_hlen_type="$yyy"
20231 : In case none of those worked, prompt the user.
20232 case "$netdb_host_type" in
20233 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20236 netdb_host_type=$ans
20237 rp='What is the type for the 2nd argument to gethostbyaddr?'
20240 netdb_hlen_type=$ans
20244 *) : no gethostbyaddr, so pick harmless defaults
20245 netdb_host_type='char *'
20246 netdb_hlen_type="$sizetype"
20249 # Remove the "const" if needed. -- but then we'll have a
20251 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20254 : check for type of argument to gethostbyname.
20255 if test "X$netdb_name_type" = X ; then
20256 case "$d_gethbyname" in
20260 Checking to see what type of argument is accepted by gethostbyname().
20262 hdrs="$define sys/types.h
20263 $d_socket sys/socket.h
20264 $i_niin netinet/in.h
20266 $i_unistd unistd.h"
20267 for xxx in "const char *" "char *"; do
20268 case "$netdb_name_type" in
20269 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20270 if ./protochk "$try" $hdrs; then
20271 echo "Your system accepts $xxx."
20272 netdb_name_type="$xxx"
20277 : In case none of those worked, prompt the user.
20278 case "$netdb_name_type" in
20279 '') rp='What is the type for the 1st argument to gethostbyname?'
20282 netdb_name_type=$ans
20286 *) : no gethostbyname, so pick harmless default
20287 netdb_name_type='char *'
20292 : check for type of 1st argument to getnetbyaddr.
20293 if test "X$netdb_net_type" = X ; then
20294 case "$d_getnbyaddr" in
20298 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20300 hdrs="$define sys/types.h
20301 $d_socket sys/socket.h
20302 $i_niin netinet/in.h
20304 $i_unistd unistd.h"
20305 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20306 case "$netdb_net_type" in
20307 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20308 if ./protochk "$try" $hdrs; then
20309 echo "Your system accepts $xxx."
20310 netdb_net_type="$xxx"
20315 : In case none of those worked, prompt the user.
20316 case "$netdb_net_type" in
20317 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20320 netdb_net_type=$ans
20324 *) : no getnetbyaddr, so pick harmless default
20325 netdb_net_type='long'
20329 : locate the preferred pager for this system
20336 [a-zA-Z]:/*) dflt=$pg;;
20340 [a-zA-Z]:/*) dflt=$more;;
20344 [a-zA-Z]:/*) dflt=$less;;
20347 '') dflt=/usr/ucb/more;;
20355 rp='What pager is used on your system?'
20359 : see what type pids are declared as in the kernel
20360 rp="What is the type of process ids on this system?"
20361 set pid_t pidtype int stdio.h sys/types.h
20364 : see if ar generates random libraries by itself
20366 echo "Checking how to generate random libraries on your machine..." >&4
20367 echo 'int bar1() { return bar2(); }' > bar1.c
20368 echo 'int bar2() { return 2; }' > bar2.c
20370 #$i_stdlib I_STDLIB
20372 #include <stdlib.h>
20374 int main() { printf("%d\n", bar1()); exit(0); }
20376 $cc $ccflags -c bar1.c >/dev/null 2>&1
20377 $cc $ccflags -c bar2.c >/dev/null 2>&1
20378 $cc $ccflags -c foo.c >/dev/null 2>&1
20379 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20380 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20381 $run ./foobar >/dev/null 2>&1; then
20382 echo "$ar appears to generate random libraries itself."
20384 if [ "X$ranlib" = "X" ]; then
20387 elif $ar s bar$_a >/dev/null 2>&1 &&
20388 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20389 $run ./foobar >/dev/null 2>&1; then
20390 echo "a table of contents needs to be added with '$ar s'."
20393 elif $ar ts bar$_a >/dev/null 2>&1 &&
20394 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20395 $run ./foobar >/dev/null 2>&1; then
20396 echo "a table of contents needs to be added with '$ar ts'."
20403 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20404 $test -f $ranlib || ranlib=''
20407 if $test -n "$ranlib"; then
20408 echo "your system has '$ranlib'; we'll use that."
20411 echo "your system doesn't seem to support random libraries"
20412 echo "so we'll use lorder and tsort to order the libraries."
20419 : see if this is a values.h system
20420 set values.h i_values
20423 : Check the max offset that gmtime and localtime accept
20424 echo "Checking max offsets that gmtime () accepts"
20427 define) yyy="#include <values.h>" ;;
20431 case "$sGMTIME_min/$sGMTIME_max" in
20434 #include <sys/types.h>
20443 void gm_check (time_t t, int min_year, int max_year)
20446 if ( tmp == NULL ||
20447 /* Check tm_year overflow */
20448 tmp->tm_year < min_year || tmp->tm_year > max_year)
20459 gm_check (MAXLONG, 69, 0x7fffffff);
20461 if (tmp == NULL || tmp->tm_year < 0) {
20462 for (i = 63; i >= 0; i--) {
20463 time_t x = pt | ((time_t)1 << i);
20464 if (x < 0 || x < pt) continue;
20465 gm_check (x, 69, 0x7fffffff);
20468 printf ("sGMTIME_max=%ld\n", pt);
20477 gm_check (MINLONG, -1900, 70);
20480 for (i = 36; i >= 0; i--) {
20481 time_t x = pt - ((time_t)1 << i);
20482 if (x > 0) continue;
20483 gm_check (x, -1900, 70);
20486 printf ("sGMTIME_min=%ld\n", pt);
20490 int main (int argc, char *argv[])
20492 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20499 if eval $compile; then
20502 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20508 echo "Checking max offsets that localtime () accepts"
20510 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20513 #include <sys/types.h>
20522 void local_check (time_t t, int min_year, int max_year)
20524 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20527 tmp = localtime (&t);
20528 if ( tmp == NULL ||
20529 /* Check tm_year overflow */
20530 tmp->tm_year < min_year || tmp->tm_year > max_year)
20534 } /* local_check */
20541 local_check (MAXLONG, 69, 0x7fffffff);
20543 if (tmp == NULL || tmp->tm_year < 0) {
20544 for (i = 63; i >= 0; i--) {
20545 time_t x = pt | ((time_t)1 << i);
20546 if (x < 0 || x < pt) continue;
20547 local_check (x, 69, 0x7fffffff);
20550 printf ("sLOCALTIME_max=%ld\n", pt);
20559 local_check (MINLONG, -1900, 70);
20562 for (i = 36; i >= 0; i--) {
20563 time_t x = pt - ((time_t)1 << i);
20564 if (x > 0) continue;
20565 local_check (x, -1900, 70);
20568 printf ("sLOCALTIME_min=%ld\n", pt);
20572 int main (int argc, char *argv[])
20580 if eval $compile; then
20583 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20589 : check for type of arguments to select.
20590 case "$selecttype" in
20591 '') case "$d_select" in
20595 Checking to see what type of arguments are accepted by select().
20597 hdrs="$define sys/types.h
20598 $i_systime sys/time.h
20599 $i_sysselct sys/select.h
20600 $d_socket sys/socket.h"
20601 : The first arg can be int, unsigned, or size_t
20602 : The last arg may or may not be 'const'
20604 : void pointer has been seen but using that
20605 : breaks the selectminbits test
20606 for xxx in 'fd_set *' 'int *'; do
20607 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20608 for tmo in 'struct timeval *' 'const struct timeval *'; do
20610 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20611 if ./protochk "$try" $hdrs; then
20612 echo "Your system accepts $xxx."
20621 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20622 case "$d_fd_set" in
20623 $define) dflt="fd_set *" ;;
20632 *) : no select, so pick a harmless default
20639 : check for the select 'width'
20640 case "$selectminbits" in
20641 '') safebits=`expr $ptrsize \* 8`
20642 case "$d_select" in
20646 Checking to see on how many bits at a time your select() operates...
20649 #include <sys/types.h>
20651 #$i_systime I_SYS_TIME
20652 #$i_systimek I_SYS_TIME_KERNEL
20657 # ifdef I_SYS_TIME_KERNEL
20660 # include <sys/time.h>
20661 # ifdef I_SYS_TIME_KERNEL
20665 #$i_sysselct I_SYS_SELECT
20666 #ifdef I_SYS_SELECT
20667 #include <sys/select.h>
20669 #$d_socket HAS_SOCKET
20671 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20674 #$i_stdlib I_STDLIB
20676 #include <stdlib.h>
20679 #define S sizeof(*(b))
20681 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20682 #define NBITS (NBYTES * 8)
20684 char *s = (char *)malloc(NBYTES);
20693 fp = fopen("try.c", "r");
20699 b = ($selecttype)s;
20700 for (i = 0; i < NBITS; i++)
20704 select(fd + 1, b, 0, 0, &t);
20705 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20707 printf("%d\n", i + 1);
20712 if eval $compile_ok; then
20713 selectminbits=`$run ./try`
20714 case "$selectminbits" in
20716 Cannot figure out on how many bits at a time your select() operates.
20717 I'll play safe and guess it is $safebits bits.
20719 selectminbits=$safebits
20720 bits="$safebits bits"
20723 *) bits="$selectminbits bits" ;;
20725 echo "Your select() operates on $bits at a time." >&4
20727 rp='What is the minimum number of bits your select() operates on?'
20728 case "$byteorder" in
20729 12345678) dflt=64 ;;
20735 selectminbits="$val"
20739 *) : no select, so pick a harmless default
20740 selectminbits=$safebits
20746 : Trace out the files included by signal.h, then look for SIGxxx names.
20747 if [ "X$fieldn" = X ]; then
20748 : Just make some guesses. We check them later.
20749 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20751 xxx=`echo '#include <signal.h>' |
20752 $cppstdin $cppminus $cppflags 2>/dev/null |
20753 $grep '^[ ]*#.*include' |
20754 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20755 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20758 for xx in $xxx /dev/null ; do
20759 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20761 case "$xxxfiles" in
20762 '') xxxfiles=`./findhdr signal.h` ;;
20765 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20766 print substr($2, 4, 20)
20768 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20769 print substr($3, 4, 20)
20771 : Append some common names just in case the awk scan failed.
20772 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20773 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20774 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20775 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20776 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20778 : generate a few handy files for later
20779 $cat > signal.c <<EOCP
20780 #include <sys/types.h>
20781 #include <signal.h>
20782 #$i_stdlib I_STDLIB
20784 #include <stdlib.h>
20789 /* Strange style to avoid deeply-nested #if/#else/#endif */
20792 # define NSIG (_NSIG)
20798 # define NSIG (SIGMAX+1)
20804 # define NSIG (SIG_MAX+1)
20810 # define NSIG (_SIG_MAX+1)
20816 # define NSIG (MAXSIG+1)
20822 # define NSIG (MAX_SIG+1)
20827 # ifdef SIGARRAYSIZE
20828 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20834 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20838 /* Default to some arbitrary number that's big enough to get most
20839 of the common signals.
20845 printf("NSIG %d\n", NSIG);
20851 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20853 printf "#ifdef SIG"; printf $1; printf "\n"
20854 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20855 printf $1; printf ");\n"
20859 printf "#endif /* JUST_NSIG */\n";
20860 printf "exit(0);\n}\n";
20863 $cat >signal.awk <<'EOP'
20864 BEGIN { ndups = 0 }
20865 $1 ~ /^NSIG$/ { nsig = $2 }
20866 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20867 if ($2 > maxsig) { maxsig = $2 }
20868 if (sig_name[$2]) {
20869 dup_name[ndups] = $1
20870 dup_num[ndups] = $2
20882 printf("NSIG %d\n", nsig);
20883 for (n = 1; n < nsig; n++) {
20885 printf("%s %d\n", sig_name[n], sig_num[n])
20888 printf("NUM%d %d\n", n, n)
20891 for (n = 0; n < ndups; n++) {
20892 printf("%s %d\n", dup_name[n], dup_num[n])
20896 $cat >signal_cmd <<EOS
20898 if $test -s signal.lst; then
20899 echo "Using your existing signal.lst file"
20904 $cat >>signal_cmd <<'EOS'
20907 if eval $compile_ok; then
20908 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20909 $uniq | $awk -f signal.awk >signal.lst
20911 echo "(I can't seem be able to compile the whole test program)" >&4
20912 echo "(I'll try it in little pieces.)" >&4
20913 set signal -DJUST_NSIG
20914 if eval $compile_ok; then
20915 $run ./signal$_exe > signal.nsg
20918 echo "I can't seem to figure out how many signals you have." >&4
20919 echo "Guessing 50." >&4
20920 echo 'NSIG 50' > signal.nsg
20922 : Now look at all the signal names, one at a time.
20923 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20924 $cat > signal.c <<EOCP
20925 #include <sys/types.h>
20926 #include <signal.h>
20929 printf("$xx %d\n", SIG${xx});
20934 if eval $compile; then
20935 echo "SIG${xx} found."
20936 $run ./signal$_exe >> signal.ls1
20938 echo "SIG${xx} NOT found."
20941 if $test -s signal.ls1; then
20942 $cat signal.nsg signal.ls1 |
20943 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20947 if $test -s signal.lst; then
20950 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20951 echo 'kill -l' >signal
20952 set X `csh -f <signal`
20956 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20958 echo $@ | $tr ' ' $trnl | \
20959 $awk '{ printf "%s %d\n", $1, ++s; }
20960 END { printf "NSIG %d\n", ++s }' >signal.lst
20962 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20964 chmod a+x signal_cmd
20965 $eunicefix signal_cmd
20967 : generate list of signal names
20969 case "$sig_name_init" in
20971 *) case "$sig_num_init" in
20972 ''|*,*) doinit=yes ;;
20977 echo "Generating a list of signal names and numbers..." >&4
20979 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20980 sig_name=`$awk 'BEGIN { printf "ZERO " }
20981 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20982 sig_num=`$awk 'BEGIN { printf "0 " }
20983 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20984 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20985 !/^NSIG/ { printf "\"%s\", ", $1 }
20986 END { printf "0\n" }' signal.lst`
20987 sig_num_init=`$awk 'BEGIN { printf "0, " }
20988 !/^NSIG/ { printf "%d, ", $2}
20989 END { printf "0\n"}' signal.lst`
20992 echo "The following $sig_count signals are available:"
20994 echo $sig_name | $awk \
20995 'BEGIN { linelen = 0 }
20997 for (i = 1; i <= NF; i++) {
20998 name = "SIG" $i " "
20999 linelen = linelen + length(name)
21000 if (linelen > 70) {
21002 linelen = length(name)
21008 sig_size=`echo $sig_name | awk '{print NF}'`
21009 $rm -f signal signal.c signal.awk signal.lst signal_cmd
21011 : Check size of size
21013 case "$sizetype" in
21014 *_t) zzz="$sizetype" ;;
21015 *) zzz="filesize" ;;
21017 echo "Checking the size of $zzz..." >&4
21019 #include <sys/types.h>
21021 #$i_stdlib I_STDLIB
21023 #include <stdlib.h>
21026 printf("%d\n", (int)sizeof($sizetype));
21031 if eval $compile_ok; then
21035 echo "(I can't execute the test program--guessing $sizesize.)" >&4
21038 echo "Your $zzz size is $sizesize bytes."
21043 echo "(I can't compile the test program--guessing $sizesize.)" >&4
21047 : check for socklen_t
21049 echo "Checking to see if you have socklen_t..." >&4
21051 #include <sys/types.h>
21052 #$d_socket HAS_SOCKET
21054 #include <sys/socket.h>
21056 int main() { socklen_t x = 16; }
21059 if eval $compile; then
21061 echo "You have socklen_t."
21064 echo "You do not have socklen_t."
21065 case "$sizetype" in
21066 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21073 : see if this is a socks.h system
21074 set socks.h i_socks
21077 : check for type of the size argument to socket calls
21078 case "$d_socket" in
21082 Checking to see what type is the last argument of accept().
21085 case "$d_socklen_t" in
21086 "$define") yyy="$yyy socklen_t"
21088 yyy="$yyy $sizetype int long unsigned"
21089 for xxx in $yyy; do
21090 case "$socksizetype" in
21091 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21092 case "$usesocks" in
21094 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21095 echo "Your system accepts '$xxx *' for the last argument of accept()."
21096 socksizetype="$xxx"
21099 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21100 echo "Your system accepts '$xxx *' for the last argument of accept()."
21101 socksizetype="$xxx"
21108 : In case none of those worked, prompt the user.
21109 case "$socksizetype" in
21110 '') rp='What is the type for socket address structure sizes?'
21117 *) : no sockets, so pick relatively harmless default
21122 : see what type is used for signed size_t
21123 set ssize_t ssizetype int stdio.h sys/types.h
21128 #$i_stdlib I_STDLIB
21130 #include <stdlib.h>
21132 #include <sys/types.h>
21133 #define Size_t $sizetype
21134 #define SSize_t $dflt
21137 if (sizeof(Size_t) == sizeof(SSize_t))
21139 else if (sizeof(Size_t) == sizeof(int))
21148 if eval $compile_ok && $run ./try > /dev/null; then
21149 ssizetype=`$run ./try`
21150 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21153 Help! I can't compile and run the ssize_t test program: please enlighten me!
21154 (This is probably a misconfiguration in your system or libraries, and
21155 you really ought to fix it. Still, I'll try anyway.)
21157 I need a type that is the same size as $sizetype, but is guaranteed to
21158 be signed. Common values are ssize_t, int and long.
21161 rp="What signed type is the same size as $sizetype?"
21167 : see what type of char stdio uses.
21169 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21170 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21171 echo "Your stdio uses unsigned chars." >&4
21172 stdchar="unsigned char"
21174 echo "Your stdio uses signed chars." >&4
21179 : see what type uids are declared as in the kernel
21181 echo "Looking for the type for user ids returned by getuid()."
21182 set uid_t uidtype xxx stdio.h sys/types.h
21186 xxx=`./findhdr sys/user.h`
21187 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21189 unsigned) dflt="$1 $2" ;;
21193 *) dflt="$uidtype";;
21196 uid_t) echo "uid_t found." ;;
21197 *) rp="What is the type for user ids returned by getuid()?"
21203 : Check size of UID
21206 *_t) zzz="$uidtype" ;;
21209 echo "Checking the size of $zzz..." >&4
21211 #include <sys/types.h>
21213 #$i_stdlib I_STDLIB
21215 #include <stdlib.h>
21218 printf("%d\n", (int)sizeof($uidtype));
21223 if eval $compile_ok; then
21227 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21230 echo "Your $zzz is $uidsize bytes long."
21235 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21238 : Check if UID is signed
21241 *_t) zzz="$uidtype" ;;
21244 echo "Checking the sign of $zzz..." >&4
21246 #include <sys/types.h>
21257 if eval $compile; then
21261 echo "(I can't execute the test program--guessing unsigned.)" >&4
21265 1) echo "Your $zzz is unsigned." ;;
21266 -1) echo "Your $zzz is signed." ;;
21272 echo "(I can't compile the test program--guessing unsigned.)" >&4
21276 : Check format string for UID
21278 $echo "Checking the format string to be used for uids..." >&4
21281 -1) if $test X"$uidsize" = X"$ivsize"; then
21282 uidformat="$ivdformat"
21284 if $test X"$uidsize" = X"$longsize"; then
21287 if $test X"$uidsize" = X"$intsize"; then
21290 if $test X"$uidsize" = X"$shortsize"; then
21297 *) if $test X"$uidsize" = X"$uvsize"; then
21298 uidformat="$uvuformat"
21300 if $test X"$uidsize" = X"$longsize"; then
21303 if $test X"$uidsize" = X"$intsize"; then
21306 if $test X"$uidsize" = X"$shortsize"; then
21315 : Check if site customization support was requested
21316 case "$usesitecustomize" in
21317 $define|true|[Yy]*)
21318 usesitecustomize="$define"
21321 usesitecustomize="$undef"
21325 : see if prototypes support variable argument declarations
21327 case "$prototype$i_stdarg" in
21329 echo "It appears we'll be able to prototype varargs functions." >&4
21333 echo "Too bad... We won't be using prototyped varargs functions..." >&4
21340 : determine compiler compiler
21349 if $test -f "$byacc$_exe"; then
21351 comp="byacc or $comp"
21353 if $test -f "$bison$_exe"; then
21354 comp="$comp or bison -y"
21356 rp="Which compiler compiler ($comp) shall I use?"
21365 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
21371 : see if this is a assert.h system
21372 set assert.h i_assert
21375 : see if this is a fp.h system
21379 : see if this is a fp_class.h system
21380 set fp_class.h i_fp_class
21383 : see if gdbm.h is available
21388 : see if gdbm_open exists
21389 set gdbm_open d_gdbm_open
21391 case "$d_gdbm_open" in
21394 echo "We won't be including <gdbm.h>"
21403 : see if this is a ieeefp.h system
21404 case "$i_ieeefp" in
21405 '' ) set ieeefp.h i_ieeefp
21410 : see if this is a libutil.h system
21411 set libutil.h i_libutil
21414 : see if mach cthreads are available
21415 if test "X$usethreads" = "X$define"; then
21416 set mach/cthreads.h i_machcthr
21419 i_machcthr="$undef"
21422 : see if this is a mntent.h system
21423 set mntent.h i_mntent
21426 : see if net/errno.h is available
21428 set net/errno.h val
21431 : Unfortunately, it causes problems on some systems. Arrgh.
21434 cat > try.c <<'EOM'
21437 #include <net/errno.h>
21443 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21444 echo "We'll be including <net/errno.h>." >&4
21446 echo "We won't be including <net/errno.h>." >&4
21455 : see if netinet/tcp.h is available
21456 set netinet/tcp.h i_netinettcp
21459 : see if this is a poll.h system
21463 : see if this is a prot.h system
21467 : Preprocessor symbols
21469 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21470 $cat <<'EOSH' > Cppsym.know
21471 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21472 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21473 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21474 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21475 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21476 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21477 bull c cadmus clipper CMU COFF COMPILER_VERSION
21478 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21479 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21480 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21481 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21483 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21484 H3050R H3050RX hbullx20 hcx host_mips
21485 hp200 hp300 hp700 HP700 hp800 hp9000
21486 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21487 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21488 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21489 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21490 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21491 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21492 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21493 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21494 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21495 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21496 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21497 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21498 MATH_HAS_NO_SIDE_EFFECTS
21499 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21500 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21501 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21502 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21503 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21504 NetBSD news1500 news1700 news1800 news1900 news3700
21505 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21506 ns32016 ns32332 ns32k nsc32000
21507 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21508 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21509 pc532 pdp11 PGC PIC plexus PORTAR posix
21510 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21511 POSIX_C_SOURCE POSIX_SOURCE POWER
21512 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21513 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21514 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21515 sony sony_news sonyrisc sparc sparclite spectrum
21516 stardent stdc STDC_EXT stratos sun sun3 sun386
21517 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21518 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21519 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21520 sysV68 sysV88 Tek4132 Tek4300 titan
21521 TM3200 TM5400 TM5600
21522 tower tower32 tower32_200 tower32_600 tower32_700
21523 tower32_800 tower32_850 tss
21524 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21525 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21526 unix UNIX95 UNIX99 unixpc unos
21527 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21528 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21529 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21531 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21532 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21533 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21536 # Maybe put other stuff here too.
21537 cat <<EOSH >>Cppsym.know
21540 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21541 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21542 $cat Cppsym.know > Cppsym.c
21543 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21544 $rm -f Cppsym.a Cppsym.b Cppsym.c
21545 cat <<EOSH > Cppsym
21547 if $test \$# -gt 0; then
21548 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21549 if $test -s Cppsym.got; then
21556 $tr " " "$trnl" | ./Cppsym.try
21562 cat <<EOSH > Cppsym.try
21564 cat <<'EOCP' > try.c
21567 #define STRINGIFY(a) "a"
21569 #if cpp_stuff == 42
21570 #define StGiFy(a) #a
21571 #define STRINGIFY(a) StGiFy(a)
21573 #if $cpp_stuff != 1 && $cpp_stuff != 42
21574 # include "Bletch: How does this C preprocessor stringify macros?"
21580 cat <<'EOSH' >> Cppsym.try
21582 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21583 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21584 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21585 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21587 echo 'return 0;}' >> try.c
21589 cat <<EOSH >> Cppsym.try
21591 case "$osname-$gccversion" in
21592 irix-) ccflags="\$ccflags -woff 1178" ;;
21593 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21595 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21597 chmod +x Cppsym.try
21598 $eunicefix Cppsym.try
21599 ./Cppsym < Cppsym.know > Cppsym.true
21600 : Add in any linux cpp "predefined macros":
21601 case "$osname::$gccversion" in
21602 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
21604 rm -f $tHdrH'.h' $tHdrH
21606 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21607 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21608 if [ -s $tHdrH'_cppsym.real' ]; then
21609 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21612 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21615 : now check the C compiler for additional symbols
21616 postprocess_cc_v=''
21618 aix) postprocess_cc_v="|$tr , ' '" ;;
21625 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21628 -D*) echo "\$i" | $sed 's/^-D//';;
21629 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21634 postprocess_cc_v=''
21637 ./ccsym > ccsym1.raw
21638 if $test -s ccsym1.raw; then
21639 $sort ccsym1.raw | $uniq >ccsym.raw
21641 mv ccsym1.raw ccsym.raw
21644 $awk '/\=/ { print $0; next }
21645 { print $0"=1" }' ccsym.raw >ccsym.list
21646 $comm -13 Cppsym.true ccsym.list >ccsym.own
21647 $comm -12 Cppsym.true ccsym.list >ccsym.com
21648 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21650 if $test -z ccsym.raw; then
21651 echo "Your C compiler doesn't seem to define any symbols!" >&4
21653 echo "However, your C preprocessor defines the following symbols:"
21656 cppsymbols=`$cat Cppsym.true`
21657 cppsymbols=`echo $cppsymbols`
21658 cppccsymbols="$cppsymbols"
21660 if $test -s ccsym.com; then
21661 echo "Your C compiler and pre-processor define these symbols:"
21662 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
21665 cppccsymbols=`$cat ccsym.com`
21666 cppccsymbols=`echo $cppccsymbols`
21667 $test "$silent" || sleep 1
21669 if $test -s ccsym.cpp; then
21670 $test "$also" && echo " "
21671 echo "Your C pre-processor ${also}defines the following symbols:"
21672 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
21674 cppsymbols=`$cat ccsym.cpp`
21675 cppsymbols=`echo $cppsymbols`
21676 $test "$silent" || sleep 1
21678 if $test -s ccsym.own; then
21679 $test "$also" && echo " "
21680 echo "Your C compiler ${also}defines the following cpp symbols:"
21681 $sed -e 's/\(..*\)=1/\1/' ccsym.own
21682 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
21683 ccsymbols=`$cat ccsym.own`
21684 ccsymbols=`echo $ccsymbols`
21685 $test "$silent" || sleep 1
21689 : see if this is a termio system
21693 if $test `./findhdr termios.h`; then
21694 set tcsetattr i_termios
21700 "$define") echo "You have POSIX termios.h... good!" >&4;;
21701 *) if ./Cppsym pyr; then
21702 case "`/bin/universe`" in
21703 ucb) if $test `./findhdr sgtty.h`; then
21705 echo "<sgtty.h> found." >&4
21707 echo "System is pyramid with BSD universe."
21708 ./warn "<sgtty.h> not found--you could have problems."
21710 *) if $test `./findhdr termio.h`; then
21712 echo "<termio.h> found." >&4
21714 echo "System is pyramid with USG universe."
21715 ./warn "<termio.h> not found--you could have problems."
21719 if $test `./findhdr termio.h`; then
21720 echo "<termio.h> found." >&4
21722 elif $test `./findhdr sgtty.h`; then
21723 echo "<sgtty.h> found." >&4
21726 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
21729 if $test `./findhdr sgtty.h`; then
21730 echo "<sgtty.h> found." >&4
21732 elif $test `./findhdr termio.h`; then
21733 echo "<termio.h> found." >&4
21736 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
21740 set i_termio; eval $setvar
21741 val=$val2; set i_sgtty; eval $setvar
21742 val=$val3; set i_termios; eval $setvar
21744 : see if stddef is available
21745 set stddef.h i_stddef
21748 : see if sys/access.h is available
21749 set sys/access.h i_sysaccess
21752 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
21753 set sys/filio.h i_sysfilio
21756 if $test `./findhdr sys/ioctl.h`; then
21758 echo '<sys/ioctl.h> found.' >&4
21761 if $test $i_sysfilio = "$define"; then
21762 echo '<sys/ioctl.h> NOT found.' >&4
21764 $test $i_sgtty = "$define" && xxx="sgtty.h"
21765 $test $i_termio = "$define" && xxx="termio.h"
21766 $test $i_termios = "$define" && xxx="termios.h"
21767 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
21773 : see if socket ioctl defs are in sys/sockio.h
21775 xxx=`./findhdr sys/sockio.h`
21776 if $test "$xxx"; then
21777 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
21779 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
21782 echo "No socket ioctls found in <sys/sockio.h>." >&4
21787 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
21793 : see if this is a syslog.h system
21794 set syslog.h i_syslog
21797 : see if this is a sys/mode.h system
21798 set sys/mode.h i_sysmode
21801 : see if there is a sys/poll.h file
21802 set sys/poll.h i_syspoll
21805 : see if sys/resource.h has to be included
21806 set sys/resource.h i_sysresrc
21809 : see if sys/security.h is available
21810 set sys/security.h i_syssecrt
21813 : see if this is a sys/statvfs.h system
21814 set sys/statvfs.h i_sysstatvfs
21817 : see if this is a sys/un.h system
21818 set sys/un.h i_sysun
21821 : see if this is a sys/utsname.h system
21822 set sys/utsname.h i_sysutsname
21825 : see if this is a syswait system
21826 set sys/wait.h i_syswait
21829 : see if this is a ustat.h system
21830 set ustat.h i_ustat
21833 : see if this is an utime system
21834 set utime.h i_utime
21837 : see if this is a vfork system
21840 set vfork.h i_vfork
21850 echo "Looking for extensions..." >&4
21851 : If we are using the old config.sh, known_extensions may contain
21852 : old or inaccurate or duplicate values.
21853 known_extensions=''
21854 nonxs_extensions=''
21855 : We do not use find because it might not be available.
21856 : We do not just use MANIFEST because the user may have dropped
21857 : some additional extensions into the source tree and expect them
21860 : Function to recursively find available extensions, ignoring DynaLoader
21861 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21862 : In 5.10.1 and later, extensions are stored in directories
21863 : like File-Glob instead of the older File/Glob/.
21867 DynaLoader|dynaload) ;;
21869 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
21870 leaf=`echo $xxx | $sed -e s/.*-//`;
21871 if $test -d File; then
21872 if $test -f $xxx/$leaf.xs -o -f $xxx/$leaf.c; then
21873 known_extensions="$known_extensions $1$this_ext";
21874 elif $test -f $xxx/Makefile.PL; then
21875 nonxs_extensions="$nonxs_extensions $1$this_ext";
21877 if $test -d $xxx -a $# -lt 10; then
21880 eval $find_extensions;
21886 $ls -1 $xxx > $$.tmp;
21887 if $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
21888 known_extensions="$known_extensions $this_ext";
21889 elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then
21890 known_extensions="$known_extensions $this_ext";
21891 elif $test -d $xxx; then
21892 nonxs_extensions="$nonxs_extensions $this_ext";
21903 eval $find_extensions
21907 eval $find_extensions
21911 eval $find_extensions
21912 if $test -d File-Glob; then
21913 : All ext/ flattened
21915 # Special case: Add in modules that nest beyond the first level.
21916 # Currently threads/shared and Hash/Util/FieldHash, since they are
21917 # not picked up by the recursive find above (and adding in general
21918 # recursive finding breaks SDBM_File/sdbm).
21919 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
21920 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
21922 set X $known_extensions
21924 known_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
21925 set X $nonxs_extensions
21927 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
21930 : Now see which are supported on this system.
21932 for xxx in $known_extensions ; do
21936 $define) avail_ext="$avail_ext $xxx" ;;
21939 GDBM_File|gdbm_fil)
21941 $define) avail_ext="$avail_ext $xxx" ;;
21944 I18N/Langinfo|i18n_lan)
21945 case "$i_langinfo$d_nl_langinfo" in
21946 $define$define) avail_ext="$avail_ext $xxx" ;;
21950 : XXX Do we need a useipcsysv variable here
21951 case "${d_msg}${d_sem}${d_shm}" in
21952 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21955 NDBM_File|ndbm_fil)
21958 case "$osname-$use64bitint" in
21961 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21964 *) avail_ext="$avail_ext $xxx" ;;
21969 ODBM_File|odbm_fil)
21970 case "${i_dbm}${i_rpcsvcdbm}" in
21972 case "$d_cplusplus" in
21973 define) ;; # delete as a function name will not work
21974 *) case "$osname-$use64bitint" in
21977 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21980 *) avail_ext="$avail_ext $xxx" ;;
21988 case "$useopcode" in
21989 true|define|y) avail_ext="$avail_ext $xxx" ;;
21993 case "$useposix" in
21994 true|define|y) avail_ext="$avail_ext $xxx" ;;
21998 case "$d_socket" in
22001 beos) ;; # not unless BONE
22002 *) avail_ext="$avail_ext $xxx" ;;
22007 Sys/Syslog|sys/syslog)
22008 : XXX syslog requires socket
22009 case "$d_socket" in
22010 true|$define|y) avail_ext="$avail_ext $xxx" ;;
22014 case "$usethreads" in
22016 case "$use5005threads" in
22017 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
22021 threads|threads/shared)
22022 # threads and threads::shared are special cases.
22023 # To stop people from asking "Perl 5.8.0 was supposed
22024 # to have this new fancy threads implementation but my
22025 # perl doesn't have it" and from people trying to
22026 # (re)install the threads module using CPAN.pm and
22027 # CPAN.pm then offering to reinstall Perl 5.8.0,
22028 # the threads.pm and threads/shared.pm will always be
22029 # there, croaking informatively ("you need to rebuild
22030 # all of Perl with threads, sorry") when threads haven't
22031 # been compiled in.
22033 avail_ext="$avail_ext $xxx"
22039 cygwin) avail_ext="$avail_ext $xxx" ;;
22042 XS/APItest|xs/apitest)
22043 # This is just for testing. Skip it unless we have dynamic loading.
22046 $define) avail_ext="$avail_ext $xxx" ;;
22049 XS/Typemap|xs/typemap)
22050 # This is just for testing. Skip it unless we have dynamic loading.
22052 $define) avail_ext="$avail_ext $xxx" ;;
22055 *) avail_ext="$avail_ext $xxx"
22064 case "$onlyextensions" in
22066 *) keepextensions=''
22067 echo "You have requested that only certains extensions be included..." >&4
22068 for i in $onlyextensions; do
22069 case " $avail_ext " in
22071 echo "Keeping extension $i."
22072 keepextensions="$keepextensions $i"
22074 *) echo "Ignoring extension $i." ;;
22077 avail_ext="$keepextensions"
22081 case "$noextensions" in
22083 *) keepextensions=''
22084 echo "You have requested that certain extensions be ignored..." >&4
22085 for i in $avail_ext; do
22086 case " $noextensions " in
22087 *" $i "*) echo "Ignoring extension $i." ;;
22088 *) echo "Keeping extension $i.";
22089 keepextensions="$keepextensions $i"
22093 avail_ext="$keepextensions"
22097 : Now see which nonxs extensions are supported on this system.
22098 : For now assume all are.
22100 for xxx in $nonxs_extensions ; do
22102 *) nonxs_ext="$nonxs_ext $xxx"
22114 A number of extensions are supplied with $package. You may choose to
22115 compile these extensions for dynamic loading (the default), compile
22116 them into the $package executable (static loading), or not include
22117 them at all. Answer "none" to include no extensions.
22118 Note that DynaLoader is always built and need not be mentioned here.
22121 case "$dynamic_ext" in
22123 : Exclude those listed in static_ext
22125 for xxx in $avail_ext; do
22126 case " $static_ext " in
22128 *) dflt="$dflt $xxx" ;;
22135 *) dflt="$dynamic_ext"
22136 # Perhaps we are reusing an old out-of-date config.sh.
22139 if test X"$dynamic_ext" != X"$avail_ext"; then
22141 NOTICE: Your previous config.sh list may be incorrect.
22142 The extensions now available to you are
22144 but the default list from your previous config.sh is
22156 rp="What extensions do you wish to load dynamically?"
22159 none) dynamic_ext=' ' ;;
22160 *) dynamic_ext="$ans" ;;
22163 case "$static_ext" in
22165 : Exclude those already listed in dynamic linking
22167 for xxx in $avail_ext; do
22168 case " $dynamic_ext " in
22170 *) dflt="$dflt $xxx" ;;
22177 *) dflt="$static_ext"
22184 rp="What extensions do you wish to load statically?"
22187 none) static_ext=' ' ;;
22188 *) static_ext="$ans" ;;
22193 A number of extensions are supplied with $package. Answer "none"
22194 to include no extensions.
22195 Note that DynaLoader is always built and need not be mentioned here.
22198 case "$static_ext" in
22199 '') dflt="$avail_ext" ;;
22200 *) dflt="$static_ext"
22201 # Perhaps we are reusing an old out-of-date config.sh.
22204 if test X"$static_ext" != X"$avail_ext"; then
22206 NOTICE: Your previous config.sh list may be incorrect.
22207 The extensions now available to you are
22209 but the default list from your previous config.sh is
22218 : Exclude those that are not xs extensions
22222 rp="What extensions do you wish to include?"
22225 none) static_ext=' ' ;;
22226 *) static_ext="$ans" ;;
22231 # Encode is a special case. If we are building Encode as a static
22232 # extension, we need to explicitly list its subextensions as well.
22233 # For other nested extensions, this is handled automatically by
22234 # the appropriate Makefile.PL.
22235 case " $static_ext " in
22236 *" Encode "*) # Add the subextensions of Encode
22238 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22239 static_ext="$static_ext Encode/$xxx"
22245 set X $dynamic_ext $static_ext $nonxs_ext
22249 # Sanity check: We require an extension suitable for use with
22250 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22251 # should show up as failures in the test suite, but it's helpful to
22252 # catch them now.) The 'extensions' list is normally sorted
22253 # alphabetically, so we need to accept either
22254 # DB_File ... Fcntl ... IO ....
22255 # or something like
22256 # Fcntl ... NDBM_File ... IO ....
22257 case " $extensions" in
22258 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22259 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22260 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22261 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22262 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22266 : Remove libraries needed only for extensions
22267 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22268 : The exception is SunOS 4.x, which needs them.
22269 case "${osname}X${osvers}" in
22273 *) case "$usedl" in
22274 $define|true|[yY]*)
22275 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22279 *) perllibs="$libs"
22285 : Remove build directory name from cppstdin so it can be used from
22286 : either the present location or the final installed location.
22288 : Get out of the UU directory to get correct path name.
22290 case "$cppstdin" in
22292 echo "Stripping down cppstdin path name"
22298 : end of configuration questions
22300 echo "End of configuration questions."
22303 : back to where it started
22304 if test -d ../UU; then
22308 : configuration may be unconditionally patched via a 'config.arch' file
22309 if $test -f config.arch; then
22310 echo "I see a config.arch file, loading it." >&4
22314 : configuration may be patched via a 'config.over' file
22315 if $test -f config.over; then
22318 rp='I see a config.over file. Do you wish to load it?'
22321 n*) echo "OK, I'll ignore it.";;
22323 echo "Configuration override changes have been loaded."
22328 : in case they want portability, strip down executable paths
22329 case "$d_portable" in
22332 echo "Stripping down executable paths..." >&4
22333 for file in $loclist $trylist; do
22335 eval $file=`basename $temp`
22340 : create config.sh file
22342 echo "Creating config.sh..." >&4
22343 $spitshell <<EOT >config.sh
22346 # This file was produced by running the Configure script. It holds all the
22347 # definitions figured out by Configure. Should you modify one of these values,
22348 # do not forget to propagate your changes by running "Configure -der". You may
22349 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22352 # Package name : $package
22353 # Source directory : $src
22354 # Configuration time: $cf_time
22355 # Configured by : $cf_by
22356 # Target system : $myuname
22359 : Add in command line options if available
22360 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22362 $spitshell <<EOT >>config.sh
22371 Revision='$Revision'
22379 alignbytes='$alignbytes'
22380 ansi2knr='$ansi2knr'
22381 aphostname='$aphostname'
22382 api_revision='$api_revision'
22383 api_subversion='$api_subversion'
22384 api_version='$api_version'
22385 api_versionstring='$api_versionstring'
22388 archlibexp='$archlibexp'
22389 archname64='$archname64'
22390 archname='$archname'
22391 archobjs='$archobjs'
22392 asctime_r_proto='$asctime_r_proto'
22401 byteorder='$byteorder'
22403 castflags='$castflags'
22406 cccdlflags='$cccdlflags'
22407 ccdlflags='$ccdlflags'
22409 ccflags_uselargefiles='$ccflags_uselargefiles'
22411 ccsymbols='$ccsymbols'
22412 ccversion='$ccversion'
22414 cf_email='$cf_email'
22416 charbits='$charbits'
22417 charsize='$charsize'
22421 clocktype='$clocktype'
22423 compress='$compress'
22424 contains='$contains'
22428 cpp_stuff='$cpp_stuff'
22429 cppccsymbols='$cppccsymbols'
22430 cppflags='$cppflags'
22432 cppminus='$cppminus'
22434 cppstdin='$cppstdin'
22435 cppsymbols='$cppsymbols'
22436 crypt_r_proto='$crypt_r_proto'
22437 cryptlib='$cryptlib'
22439 ctermid_r_proto='$ctermid_r_proto'
22440 ctime_r_proto='$ctime_r_proto'
22441 d_Gconvert='$d_Gconvert'
22442 d_PRIEUldbl='$d_PRIEUldbl'
22443 d_PRIFUldbl='$d_PRIFUldbl'
22444 d_PRIGUldbl='$d_PRIGUldbl'
22445 d_PRIXU64='$d_PRIXU64'
22446 d_PRId64='$d_PRId64'
22447 d_PRIeldbl='$d_PRIeldbl'
22448 d_PRIfldbl='$d_PRIfldbl'
22449 d_PRIgldbl='$d_PRIgldbl'
22450 d_PRIi64='$d_PRIi64'
22451 d_PRIo64='$d_PRIo64'
22452 d_PRIu64='$d_PRIu64'
22453 d_PRIx64='$d_PRIx64'
22454 d_SCNfldbl='$d_SCNfldbl'
22455 d__fwalk='$d__fwalk'
22456 d_access='$d_access'
22457 d_accessx='$d_accessx'
22460 d_archlib='$d_archlib'
22461 d_asctime64='$d_asctime64'
22462 d_asctime_r='$d_asctime_r'
22465 d_attribute_deprecated='$d_attribute_deprecated'
22466 d_attribute_format='$d_attribute_format'
22467 d_attribute_malloc='$d_attribute_malloc'
22468 d_attribute_nonnull='$d_attribute_nonnull'
22469 d_attribute_noreturn='$d_attribute_noreturn'
22470 d_attribute_pure='$d_attribute_pure'
22471 d_attribute_unused='$d_attribute_unused'
22472 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22476 d_bsdgetpgrp='$d_bsdgetpgrp'
22477 d_bsdsetpgrp='$d_bsdsetpgrp'
22478 d_builtin_choose_expr='$d_builtin_choose_expr'
22479 d_builtin_expect='$d_builtin_expect'
22481 d_c99_variadic_macros='$d_c99_variadic_macros'
22482 d_casti32='$d_casti32'
22483 d_castneg='$d_castneg'
22484 d_charvspr='$d_charvspr'
22486 d_chroot='$d_chroot'
22487 d_chsize='$d_chsize'
22489 d_clearenv='$d_clearenv'
22490 d_closedir='$d_closedir'
22491 d_cmsghdr_s='$d_cmsghdr_s'
22493 d_copysignl='$d_copysignl'
22494 d_cplusplus='$d_cplusplus'
22496 d_crypt_r='$d_crypt_r'
22498 d_ctermid='$d_ctermid'
22499 d_ctermid_r='$d_ctermid_r'
22500 d_ctime64='$d_ctime64'
22501 d_ctime_r='$d_ctime_r'
22502 d_cuserid='$d_cuserid'
22503 d_dbl_dig='$d_dbl_dig'
22504 d_dbminitproto='$d_dbminitproto'
22505 d_difftime64='$d_difftime64'
22506 d_difftime='$d_difftime'
22507 d_dir_dd_fd='$d_dir_dd_fd'
22509 d_dirnamlen='$d_dirnamlen'
22510 d_dlerror='$d_dlerror'
22511 d_dlopen='$d_dlopen'
22512 d_dlsymun='$d_dlsymun'
22513 d_dosuid='$d_dosuid'
22514 d_drand48_r='$d_drand48_r'
22515 d_drand48proto='$d_drand48proto'
22517 d_eaccess='$d_eaccess'
22518 d_endgrent='$d_endgrent'
22519 d_endgrent_r='$d_endgrent_r'
22520 d_endhent='$d_endhent'
22521 d_endhostent_r='$d_endhostent_r'
22522 d_endnent='$d_endnent'
22523 d_endnetent_r='$d_endnetent_r'
22524 d_endpent='$d_endpent'
22525 d_endprotoent_r='$d_endprotoent_r'
22526 d_endpwent='$d_endpwent'
22527 d_endpwent_r='$d_endpwent_r'
22528 d_endsent='$d_endsent'
22529 d_endservent_r='$d_endservent_r'
22530 d_eofnblk='$d_eofnblk'
22531 d_eunice='$d_eunice'
22532 d_faststdio='$d_faststdio'
22533 d_fchdir='$d_fchdir'
22534 d_fchmod='$d_fchmod'
22535 d_fchown='$d_fchown'
22537 d_fcntl_can_lock='$d_fcntl_can_lock'
22538 d_fd_macros='$d_fd_macros'
22539 d_fd_set='$d_fd_set'
22540 d_fds_bits='$d_fds_bits'
22541 d_fgetpos='$d_fgetpos'
22542 d_finite='$d_finite'
22543 d_finitel='$d_finitel'
22544 d_flexfnam='$d_flexfnam'
22546 d_flockproto='$d_flockproto'
22548 d_fp_class='$d_fp_class'
22549 d_fpathconf='$d_fpathconf'
22550 d_fpclass='$d_fpclass'
22551 d_fpclassify='$d_fpclassify'
22552 d_fpclassl='$d_fpclassl'
22553 d_fpos64_t='$d_fpos64_t'
22554 d_frexpl='$d_frexpl'
22555 d_fs_data_s='$d_fs_data_s'
22556 d_fseeko='$d_fseeko'
22557 d_fsetpos='$d_fsetpos'
22558 d_fstatfs='$d_fstatfs'
22559 d_fstatvfs='$d_fstatvfs'
22561 d_ftello='$d_ftello'
22563 d_futimes='$d_futimes'
22564 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
22565 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
22566 d_getaddrinfo='$d_getaddrinfo'
22567 d_getcwd='$d_getcwd'
22568 d_getespwnam='$d_getespwnam'
22569 d_getfsstat='$d_getfsstat'
22570 d_getgrent='$d_getgrent'
22571 d_getgrent_r='$d_getgrent_r'
22572 d_getgrgid_r='$d_getgrgid_r'
22573 d_getgrnam_r='$d_getgrnam_r'
22574 d_getgrps='$d_getgrps'
22575 d_gethbyaddr='$d_gethbyaddr'
22576 d_gethbyname='$d_gethbyname'
22577 d_gethent='$d_gethent'
22578 d_gethname='$d_gethname'
22579 d_gethostbyaddr_r='$d_gethostbyaddr_r'
22580 d_gethostbyname_r='$d_gethostbyname_r'
22581 d_gethostent_r='$d_gethostent_r'
22582 d_gethostprotos='$d_gethostprotos'
22583 d_getitimer='$d_getitimer'
22584 d_getlogin='$d_getlogin'
22585 d_getlogin_r='$d_getlogin_r'
22586 d_getmnt='$d_getmnt'
22587 d_getmntent='$d_getmntent'
22588 d_getnameinfo='$d_getnameinfo'
22589 d_getnbyaddr='$d_getnbyaddr'
22590 d_getnbyname='$d_getnbyname'
22591 d_getnent='$d_getnent'
22592 d_getnetbyaddr_r='$d_getnetbyaddr_r'
22593 d_getnetbyname_r='$d_getnetbyname_r'
22594 d_getnetent_r='$d_getnetent_r'
22595 d_getnetprotos='$d_getnetprotos'
22596 d_getpagsz='$d_getpagsz'
22597 d_getpbyname='$d_getpbyname'
22598 d_getpbynumber='$d_getpbynumber'
22599 d_getpent='$d_getpent'
22600 d_getpgid='$d_getpgid'
22601 d_getpgrp2='$d_getpgrp2'
22602 d_getpgrp='$d_getpgrp'
22603 d_getppid='$d_getppid'
22604 d_getprior='$d_getprior'
22605 d_getprotobyname_r='$d_getprotobyname_r'
22606 d_getprotobynumber_r='$d_getprotobynumber_r'
22607 d_getprotoent_r='$d_getprotoent_r'
22608 d_getprotoprotos='$d_getprotoprotos'
22609 d_getprpwnam='$d_getprpwnam'
22610 d_getpwent='$d_getpwent'
22611 d_getpwent_r='$d_getpwent_r'
22612 d_getpwnam_r='$d_getpwnam_r'
22613 d_getpwuid_r='$d_getpwuid_r'
22614 d_getsbyname='$d_getsbyname'
22615 d_getsbyport='$d_getsbyport'
22616 d_getsent='$d_getsent'
22617 d_getservbyname_r='$d_getservbyname_r'
22618 d_getservbyport_r='$d_getservbyport_r'
22619 d_getservent_r='$d_getservent_r'
22620 d_getservprotos='$d_getservprotos'
22621 d_getspnam='$d_getspnam'
22622 d_getspnam_r='$d_getspnam_r'
22623 d_gettimeod='$d_gettimeod'
22624 d_gmtime64='$d_gmtime64'
22625 d_gmtime_r='$d_gmtime_r'
22626 d_gnulibc='$d_gnulibc'
22627 d_grpasswd='$d_grpasswd'
22628 d_hasmntopt='$d_hasmntopt'
22630 d_ilogbl='$d_ilogbl'
22631 d_inc_version_list='$d_inc_version_list'
22633 d_inetaton='$d_inetaton'
22634 d_inetntop='$d_inetntop'
22635 d_inetpton='$d_inetpton'
22636 d_int64_t='$d_int64_t'
22637 d_isascii='$d_isascii'
22638 d_isfinite='$d_isfinite'
22641 d_isnanl='$d_isnanl'
22642 d_killpg='$d_killpg'
22643 d_lchown='$d_lchown'
22644 d_ldbl_dig='$d_ldbl_dig'
22645 d_libm_lib_version='$d_libm_lib_version'
22647 d_localtime64='$d_localtime64'
22648 d_localtime_r='$d_localtime_r'
22649 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
22650 d_locconv='$d_locconv'
22652 d_longdbl='$d_longdbl'
22653 d_longlong='$d_longlong'
22654 d_lseekproto='$d_lseekproto'
22656 d_madvise='$d_madvise'
22657 d_malloc_good_size='$d_malloc_good_size'
22658 d_malloc_size='$d_malloc_size'
22660 d_mbstowcs='$d_mbstowcs'
22661 d_mbtowc='$d_mbtowc'
22662 d_memchr='$d_memchr'
22663 d_memcmp='$d_memcmp'
22664 d_memcpy='$d_memcpy'
22665 d_memmove='$d_memmove'
22666 d_memset='$d_memset'
22668 d_mkdtemp='$d_mkdtemp'
22669 d_mkfifo='$d_mkfifo'
22670 d_mkstemp='$d_mkstemp'
22671 d_mkstemps='$d_mkstemps'
22672 d_mktime64='$d_mktime64'
22673 d_mktime='$d_mktime'
22676 d_modfl_pow32_bug='$d_modfl_pow32_bug'
22677 d_modflproto='$d_modflproto'
22678 d_mprotect='$d_mprotect'
22680 d_msg_ctrunc='$d_msg_ctrunc'
22681 d_msg_dontroute='$d_msg_dontroute'
22682 d_msg_oob='$d_msg_oob'
22683 d_msg_peek='$d_msg_peek'
22684 d_msg_proxy='$d_msg_proxy'
22685 d_msgctl='$d_msgctl'
22686 d_msgget='$d_msgget'
22687 d_msghdr_s='$d_msghdr_s'
22688 d_msgrcv='$d_msgrcv'
22689 d_msgsnd='$d_msgsnd'
22691 d_munmap='$d_munmap'
22692 d_mymalloc='$d_mymalloc'
22694 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
22696 d_nl_langinfo='$d_nl_langinfo'
22697 d_nv_preserves_uv='$d_nv_preserves_uv'
22698 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
22699 d_off64_t='$d_off64_t'
22700 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
22701 d_oldpthreads='$d_oldpthreads'
22702 d_oldsock='$d_oldsock'
22704 d_pathconf='$d_pathconf'
22706 d_perl_otherlibdirs='$d_perl_otherlibdirs'
22707 d_phostname='$d_phostname'
22710 d_portable='$d_portable'
22712 d_prctl_set_name='$d_prctl_set_name'
22713 d_printf_format_null='$d_printf_format_null'
22714 d_procselfexe='$d_procselfexe'
22715 d_pseudofork='$d_pseudofork'
22716 d_pthread_atfork='$d_pthread_atfork'
22717 d_pthread_attr_setscope='$d_pthread_attr_setscope'
22718 d_pthread_yield='$d_pthread_yield'
22720 d_pwchange='$d_pwchange'
22721 d_pwclass='$d_pwclass'
22722 d_pwcomment='$d_pwcomment'
22723 d_pwexpire='$d_pwexpire'
22724 d_pwgecos='$d_pwgecos'
22725 d_pwpasswd='$d_pwpasswd'
22726 d_pwquota='$d_pwquota'
22729 d_random_r='$d_random_r'
22730 d_readdir64_r='$d_readdir64_r'
22731 d_readdir='$d_readdir'
22732 d_readdir_r='$d_readdir_r'
22733 d_readlink='$d_readlink'
22735 d_recvmsg='$d_recvmsg'
22736 d_rename='$d_rename'
22737 d_rewinddir='$d_rewinddir'
22739 d_safebcpy='$d_safebcpy'
22740 d_safemcpy='$d_safemcpy'
22741 d_sanemcmp='$d_sanemcmp'
22742 d_sbrkproto='$d_sbrkproto'
22743 d_scalbnl='$d_scalbnl'
22744 d_sched_yield='$d_sched_yield'
22745 d_scm_rights='$d_scm_rights'
22746 d_seekdir='$d_seekdir'
22747 d_select='$d_select'
22749 d_semctl='$d_semctl'
22750 d_semctl_semid_ds='$d_semctl_semid_ds'
22751 d_semctl_semun='$d_semctl_semun'
22752 d_semget='$d_semget'
22754 d_sendmsg='$d_sendmsg'
22755 d_setegid='$d_setegid'
22756 d_seteuid='$d_seteuid'
22757 d_setgrent='$d_setgrent'
22758 d_setgrent_r='$d_setgrent_r'
22759 d_setgrps='$d_setgrps'
22760 d_sethent='$d_sethent'
22761 d_sethostent_r='$d_sethostent_r'
22762 d_setitimer='$d_setitimer'
22763 d_setlinebuf='$d_setlinebuf'
22764 d_setlocale='$d_setlocale'
22765 d_setlocale_r='$d_setlocale_r'
22766 d_setnent='$d_setnent'
22767 d_setnetent_r='$d_setnetent_r'
22768 d_setpent='$d_setpent'
22769 d_setpgid='$d_setpgid'
22770 d_setpgrp2='$d_setpgrp2'
22771 d_setpgrp='$d_setpgrp'
22772 d_setprior='$d_setprior'
22773 d_setproctitle='$d_setproctitle'
22774 d_setprotoent_r='$d_setprotoent_r'
22775 d_setpwent='$d_setpwent'
22776 d_setpwent_r='$d_setpwent_r'
22777 d_setregid='$d_setregid'
22778 d_setresgid='$d_setresgid'
22779 d_setresuid='$d_setresuid'
22780 d_setreuid='$d_setreuid'
22781 d_setrgid='$d_setrgid'
22782 d_setruid='$d_setruid'
22783 d_setsent='$d_setsent'
22784 d_setservent_r='$d_setservent_r'
22785 d_setsid='$d_setsid'
22786 d_setvbuf='$d_setvbuf'
22790 d_shmatprototype='$d_shmatprototype'
22791 d_shmctl='$d_shmctl'
22793 d_shmget='$d_shmget'
22794 d_sigaction='$d_sigaction'
22795 d_signbit='$d_signbit'
22796 d_sigprocmask='$d_sigprocmask'
22797 d_sigsetjmp='$d_sigsetjmp'
22798 d_sitearch='$d_sitearch'
22799 d_snprintf='$d_snprintf'
22800 d_sockatmark='$d_sockatmark'
22801 d_sockatmarkproto='$d_sockatmarkproto'
22802 d_socket='$d_socket'
22803 d_socklen_t='$d_socklen_t'
22804 d_sockpair='$d_sockpair'
22805 d_socks5_init='$d_socks5_init'
22806 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
22808 d_srand48_r='$d_srand48_r'
22809 d_srandom_r='$d_srandom_r'
22810 d_sresgproto='$d_sresgproto'
22811 d_sresuproto='$d_sresuproto'
22812 d_statblks='$d_statblks'
22813 d_statfs_f_flags='$d_statfs_f_flags'
22814 d_statfs_s='$d_statfs_s'
22815 d_static_inline='$d_static_inline'
22816 d_statvfs='$d_statvfs'
22817 d_stdio_cnt_lval='$d_stdio_cnt_lval'
22818 d_stdio_ptr_lval='$d_stdio_ptr_lval'
22819 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
22820 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
22821 d_stdio_stream_array='$d_stdio_stream_array'
22822 d_stdiobase='$d_stdiobase'
22823 d_stdstdio='$d_stdstdio'
22824 d_strchr='$d_strchr'
22825 d_strcoll='$d_strcoll'
22826 d_strctcpy='$d_strctcpy'
22827 d_strerrm='$d_strerrm'
22828 d_strerror='$d_strerror'
22829 d_strerror_r='$d_strerror_r'
22830 d_strftime='$d_strftime'
22831 d_strlcat='$d_strlcat'
22832 d_strlcpy='$d_strlcpy'
22833 d_strtod='$d_strtod'
22834 d_strtol='$d_strtol'
22835 d_strtold='$d_strtold'
22836 d_strtoll='$d_strtoll'
22837 d_strtoq='$d_strtoq'
22838 d_strtoul='$d_strtoul'
22839 d_strtoull='$d_strtoull'
22840 d_strtouq='$d_strtouq'
22841 d_strxfrm='$d_strxfrm'
22842 d_suidsafe='$d_suidsafe'
22843 d_symlink='$d_symlink'
22844 d_syscall='$d_syscall'
22845 d_syscallproto='$d_syscallproto'
22846 d_sysconf='$d_sysconf'
22847 d_sysernlst='$d_sysernlst'
22848 d_syserrlst='$d_syserrlst'
22849 d_system='$d_system'
22850 d_tcgetpgrp='$d_tcgetpgrp'
22851 d_tcsetpgrp='$d_tcsetpgrp'
22852 d_telldir='$d_telldir'
22853 d_telldirproto='$d_telldirproto'
22855 d_timegm='$d_timegm'
22857 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
22858 d_tm_tm_zone='$d_tm_tm_zone'
22859 d_tmpnam_r='$d_tmpnam_r'
22860 d_truncate='$d_truncate'
22861 d_ttyname_r='$d_ttyname_r'
22862 d_tzname='$d_tzname'
22863 d_u32align='$d_u32align'
22864 d_ualarm='$d_ualarm'
22867 d_union_semun='$d_union_semun'
22868 d_unordered='$d_unordered'
22869 d_unsetenv='$d_unsetenv'
22870 d_usleep='$d_usleep'
22871 d_usleepproto='$d_usleepproto'
22873 d_vendorarch='$d_vendorarch'
22874 d_vendorbin='$d_vendorbin'
22875 d_vendorlib='$d_vendorlib'
22876 d_vendorscript='$d_vendorscript'
22878 d_void_closedir='$d_void_closedir'
22879 d_voidsig='$d_voidsig'
22880 d_voidtty='$d_voidtty'
22881 d_volatile='$d_volatile'
22882 d_vprintf='$d_vprintf'
22883 d_vsnprintf='$d_vsnprintf'
22885 d_waitpid='$d_waitpid'
22886 d_wcstombs='$d_wcstombs'
22887 d_wctomb='$d_wctomb'
22888 d_writev='$d_writev'
22891 db_hashtype='$db_hashtype'
22892 db_prefixtype='$db_prefixtype'
22893 db_version_major='$db_version_major'
22894 db_version_minor='$db_version_minor'
22895 db_version_patch='$db_version_patch'
22896 defvoidused='$defvoidused'
22897 direntrytype='$direntrytype'
22900 doublesize='$doublesize'
22902 drand48_r_proto='$drand48_r_proto'
22904 dynamic_ext='$dynamic_ext'
22910 endgrent_r_proto='$endgrent_r_proto'
22911 endhostent_r_proto='$endhostent_r_proto'
22912 endnetent_r_proto='$endnetent_r_proto'
22913 endprotoent_r_proto='$endprotoent_r_proto'
22914 endpwent_r_proto='$endpwent_r_proto'
22915 endservent_r_proto='$endservent_r_proto'
22916 eunicefix='$eunicefix'
22919 extensions='$extensions'
22920 extern_C='$extern_C'
22922 fflushNULL='$fflushNULL'
22923 fflushall='$fflushall'
22925 firstmakefile='$firstmakefile'
22927 fpossize='$fpossize'
22928 fpostype='$fpostype'
22929 freetype='$freetype'
22932 full_csh='$full_csh'
22933 full_sed='$full_sed'
22934 gccansipedantic='$gccansipedantic'
22935 gccosandvers='$gccosandvers'
22936 gccversion='$gccversion'
22937 getgrent_r_proto='$getgrent_r_proto'
22938 getgrgid_r_proto='$getgrgid_r_proto'
22939 getgrnam_r_proto='$getgrnam_r_proto'
22940 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22941 gethostbyname_r_proto='$gethostbyname_r_proto'
22942 gethostent_r_proto='$gethostent_r_proto'
22943 getlogin_r_proto='$getlogin_r_proto'
22944 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22945 getnetbyname_r_proto='$getnetbyname_r_proto'
22946 getnetent_r_proto='$getnetent_r_proto'
22947 getprotobyname_r_proto='$getprotobyname_r_proto'
22948 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22949 getprotoent_r_proto='$getprotoent_r_proto'
22950 getpwent_r_proto='$getpwent_r_proto'
22951 getpwnam_r_proto='$getpwnam_r_proto'
22952 getpwuid_r_proto='$getpwuid_r_proto'
22953 getservbyname_r_proto='$getservbyname_r_proto'
22954 getservbyport_r_proto='$getservbyport_r_proto'
22955 getservent_r_proto='$getservent_r_proto'
22956 getspnam_r_proto='$getspnam_r_proto'
22957 gidformat='$gidformat'
22963 gmtime_r_proto='$gmtime_r_proto'
22964 gnulibc_version='$gnulibc_version'
22966 groupcat='$groupcat'
22967 groupstype='$groupstype'
22970 h_sysfile='$h_sysfile'
22973 html1dir='$html1dir'
22974 html1direxp='$html1direxp'
22975 html3dir='$html3dir'
22976 html3direxp='$html3direxp'
22985 i_arpainet='$i_arpainet'
22986 i_assert='$i_assert'
22987 i_bsdioctl='$i_bsdioctl'
22991 i_dirent='$i_dirent'
22997 i_fp_class='$i_fp_class'
22999 i_gdbm_ndbm='$i_gdbm_ndbm'
23000 i_gdbmndbm='$i_gdbmndbm'
23002 i_ieeefp='$i_ieeefp'
23003 i_inttypes='$i_inttypes'
23004 i_langinfo='$i_langinfo'
23005 i_libutil='$i_libutil'
23006 i_limits='$i_limits'
23007 i_locale='$i_locale'
23008 i_machcthr='$i_machcthr'
23009 i_malloc='$i_malloc'
23010 i_mallocmalloc='$i_mallocmalloc'
23012 i_memory='$i_memory'
23013 i_mntent='$i_mntent'
23016 i_neterrno='$i_neterrno'
23017 i_netinettcp='$i_netinettcp'
23021 i_pthread='$i_pthread'
23023 i_rpcsvcdbm='$i_rpcsvcdbm'
23026 i_shadow='$i_shadow'
23028 i_stdarg='$i_stdarg'
23029 i_stddef='$i_stddef'
23030 i_stdlib='$i_stdlib'
23031 i_string='$i_string'
23032 i_sunmath='$i_sunmath'
23033 i_sysaccess='$i_sysaccess'
23034 i_sysdir='$i_sysdir'
23035 i_sysfile='$i_sysfile'
23036 i_sysfilio='$i_sysfilio'
23038 i_sysioctl='$i_sysioctl'
23039 i_syslog='$i_syslog'
23040 i_sysmman='$i_sysmman'
23041 i_sysmode='$i_sysmode'
23042 i_sysmount='$i_sysmount'
23043 i_sysndir='$i_sysndir'
23044 i_sysparam='$i_sysparam'
23045 i_syspoll='$i_syspoll'
23046 i_sysresrc='$i_sysresrc'
23047 i_syssecrt='$i_syssecrt'
23048 i_sysselct='$i_sysselct'
23049 i_syssockio='$i_syssockio'
23050 i_sysstat='$i_sysstat'
23051 i_sysstatfs='$i_sysstatfs'
23052 i_sysstatvfs='$i_sysstatvfs'
23053 i_systime='$i_systime'
23054 i_systimek='$i_systimek'
23055 i_systimes='$i_systimes'
23056 i_systypes='$i_systypes'
23057 i_sysuio='$i_sysuio'
23059 i_sysutsname='$i_sysutsname'
23060 i_sysvfs='$i_sysvfs'
23061 i_syswait='$i_syswait'
23062 i_termio='$i_termio'
23063 i_termios='$i_termios'
23065 i_unistd='$i_unistd'
23068 i_values='$i_values'
23069 i_varargs='$i_varargs'
23070 i_varhdr='$i_varhdr'
23072 ignore_versioned_solibs='$ignore_versioned_solibs'
23073 inc_version_list='$inc_version_list'
23074 inc_version_list_init='$inc_version_list_init'
23077 initialinstalllocation='$initialinstalllocation'
23078 installarchlib='$installarchlib'
23079 installbin='$installbin'
23080 installhtml1dir='$installhtml1dir'
23081 installhtml3dir='$installhtml3dir'
23082 installman1dir='$installman1dir'
23083 installman3dir='$installman3dir'
23084 installprefix='$installprefix'
23085 installprefixexp='$installprefixexp'
23086 installprivlib='$installprivlib'
23087 installscript='$installscript'
23088 installsitearch='$installsitearch'
23089 installsitebin='$installsitebin'
23090 installsitehtml1dir='$installsitehtml1dir'
23091 installsitehtml3dir='$installsitehtml3dir'
23092 installsitelib='$installsitelib'
23093 installsiteman1dir='$installsiteman1dir'
23094 installsiteman3dir='$installsiteman3dir'
23095 installsitescript='$installsitescript'
23096 installstyle='$installstyle'
23097 installusrbinperl='$installusrbinperl'
23098 installvendorarch='$installvendorarch'
23099 installvendorbin='$installvendorbin'
23100 installvendorhtml1dir='$installvendorhtml1dir'
23101 installvendorhtml3dir='$installvendorhtml3dir'
23102 installvendorlib='$installvendorlib'
23103 installvendorman1dir='$installvendorman1dir'
23104 installvendorman3dir='$installvendorman3dir'
23105 installvendorscript='$installvendorscript'
23107 issymlink='$issymlink'
23108 ivdformat='$ivdformat'
23111 known_extensions='$known_extensions'
23114 lddlflags='$lddlflags'
23116 ldflags_uselargefiles='$ldflags_uselargefiles'
23117 ldlibpthname='$ldlibpthname'
23124 libsdirs='$libsdirs'
23125 libsfiles='$libsfiles'
23126 libsfound='$libsfound'
23127 libspath='$libspath'
23128 libswanted='$libswanted'
23129 libswanted_uselargefiles='$libswanted_uselargefiles'
23135 localtime_r_proto='$localtime_r_proto'
23136 locincpth='$locincpth'
23137 loclibpth='$loclibpth'
23138 longdblsize='$longdblsize'
23139 longlongsize='$longlongsize'
23140 longsize='$longsize'
23144 lseeksize='$lseeksize'
23145 lseektype='$lseektype'
23148 madlyobj='$madlyobj'
23149 madlysrc='$madlysrc'
23153 make_set_make='$make_set_make'
23154 mallocobj='$mallocobj'
23155 mallocsrc='$mallocsrc'
23156 malloctype='$malloctype'
23158 man1direxp='$man1direxp'
23161 man3direxp='$man3direxp'
23163 mips_type='$mips_type'
23164 mistrustnm='$mistrustnm'
23166 mmaptype='$mmaptype'
23167 modetype='$modetype'
23169 multiarch='$multiarch'
23171 myarchname='$myarchname'
23172 mydomain='$mydomain'
23173 myhostname='$myhostname'
23176 need_va_copy='$need_va_copy'
23177 netdb_hlen_type='$netdb_hlen_type'
23178 netdb_host_type='$netdb_host_type'
23179 netdb_name_type='$netdb_name_type'
23180 netdb_net_type='$netdb_net_type'
23183 nm_so_opt='$nm_so_opt'
23184 nonxs_ext='$nonxs_ext'
23186 nvEUformat='$nvEUformat'
23187 nvFUformat='$nvFUformat'
23188 nvGUformat='$nvGUformat'
23189 nv_overflows_integers_at='$nv_overflows_integers_at'
23190 nv_preserves_uv_bits='$nv_preserves_uv_bits'
23191 nveformat='$nveformat'
23192 nvfformat='$nvfformat'
23193 nvgformat='$nvgformat'
23196 o_nonblock='$o_nonblock'
23198 old_pthread_create_joinable='$old_pthread_create_joinable'
23199 optimize='$optimize'
23200 orderlib='$orderlib'
23203 otherlibdirs='$otherlibdirs'
23207 patchlevel='$patchlevel'
23208 path_sep='$path_sep'
23211 perl_patchlevel='$perl_patchlevel'
23212 perl_static_inline='$perl_static_inline'
23213 perladmin='$perladmin'
23214 perllibs='$perllibs'
23215 perlpath='$perlpath'
23217 phostname='$phostname'
23223 prefixexp='$prefixexp'
23225 privlibexp='$privlibexp'
23226 procselfexe='$procselfexe'
23227 prototype='$prototype'
23229 quadkind='$quadkind'
23230 quadtype='$quadtype'
23231 randbits='$randbits'
23232 randfunc='$randfunc'
23233 random_r_proto='$random_r_proto'
23234 randseedtype='$randseedtype'
23236 rd_nodata='$rd_nodata'
23237 readdir64_r_proto='$readdir64_r_proto'
23238 readdir_r_proto='$readdir_r_proto'
23239 revision='$revision'
23245 sGMTIME_max='$sGMTIME_max'
23246 sGMTIME_min='$sGMTIME_min'
23247 sLOCALTIME_max='$sLOCALTIME_max'
23248 sLOCALTIME_min='$sLOCALTIME_min'
23249 sPRIEUldbl='$sPRIEUldbl'
23250 sPRIFUldbl='$sPRIFUldbl'
23251 sPRIGUldbl='$sPRIGUldbl'
23252 sPRIXU64='$sPRIXU64'
23254 sPRIeldbl='$sPRIeldbl'
23255 sPRIfldbl='$sPRIfldbl'
23256 sPRIgldbl='$sPRIgldbl'
23261 sSCNfldbl='$sSCNfldbl'
23262 sched_yield='$sched_yield'
23263 scriptdir='$scriptdir'
23264 scriptdirexp='$scriptdirexp'
23266 seedfunc='$seedfunc'
23267 selectminbits='$selectminbits'
23268 selecttype='$selecttype'
23269 sendmail='$sendmail'
23270 setgrent_r_proto='$setgrent_r_proto'
23271 sethostent_r_proto='$sethostent_r_proto'
23272 setlocale_r_proto='$setlocale_r_proto'
23273 setnetent_r_proto='$setnetent_r_proto'
23274 setprotoent_r_proto='$setprotoent_r_proto'
23275 setpwent_r_proto='$setpwent_r_proto'
23276 setservent_r_proto='$setservent_r_proto'
23279 sharpbang='$sharpbang'
23280 shmattype='$shmattype'
23281 shortsize='$shortsize'
23284 sig_count='$sig_count'
23285 sig_name='$sig_name'
23286 sig_name_init='$sig_name_init'
23288 sig_num_init='$sig_num_init'
23289 sig_size='$sig_size'
23290 signal_t='$signal_t'
23291 sitearch='$sitearch'
23292 sitearchexp='$sitearchexp'
23294 sitebinexp='$sitebinexp'
23295 sitehtml1dir='$sitehtml1dir'
23296 sitehtml1direxp='$sitehtml1direxp'
23297 sitehtml3dir='$sitehtml3dir'
23298 sitehtml3direxp='$sitehtml3direxp'
23300 sitelib_stem='$sitelib_stem'
23301 sitelibexp='$sitelibexp'
23302 siteman1dir='$siteman1dir'
23303 siteman1direxp='$siteman1direxp'
23304 siteman3dir='$siteman3dir'
23305 siteman3direxp='$siteman3direxp'
23306 siteprefix='$siteprefix'
23307 siteprefixexp='$siteprefixexp'
23308 sitescript='$sitescript'
23309 sitescriptexp='$sitescriptexp'
23310 sizesize='$sizesize'
23311 sizetype='$sizetype'
23315 sockethdr='$sockethdr'
23316 socketlib='$socketlib'
23317 socksizetype='$socksizetype'
23319 spackage='$spackage'
23320 spitshell='$spitshell'
23321 srand48_r_proto='$srand48_r_proto'
23322 srandom_r_proto='$srandom_r_proto'
23324 ssizetype='$ssizetype'
23325 startperl='$startperl'
23327 static_ext='$static_ext'
23329 stdio_base='$stdio_base'
23330 stdio_bufsiz='$stdio_bufsiz'
23331 stdio_cnt='$stdio_cnt'
23332 stdio_filbuf='$stdio_filbuf'
23333 stdio_ptr='$stdio_ptr'
23334 stdio_stream_array='$stdio_stream_array'
23335 strerror_r_proto='$strerror_r_proto'
23338 subversion='$subversion'
23342 targetarch='$targetarch'
23346 timeincl='$timeincl'
23347 timetype='$timetype'
23348 tmpnam_r_proto='$tmpnam_r_proto'
23354 ttyname_r_proto='$ttyname_r_proto'
23363 uidformat='$uidformat'
23369 uquadtype='$uquadtype'
23370 use5005threads='$use5005threads'
23371 use64bitall='$use64bitall'
23372 use64bitint='$use64bitint'
23373 usecrosscompile='$usecrosscompile'
23374 usedevel='$usedevel'
23376 usedtrace='$usedtrace'
23377 usefaststdio='$usefaststdio'
23378 useithreads='$useithreads'
23379 uselargefiles='$uselargefiles'
23380 uselongdouble='$uselongdouble'
23381 usemallocwrap='$usemallocwrap'
23382 usemorebits='$usemorebits'
23383 usemultiplicity='$usemultiplicity'
23384 usemymalloc='$usemymalloc'
23386 useopcode='$useopcode'
23387 useperlio='$useperlio'
23388 useposix='$useposix'
23389 usereentrant='$usereentrant'
23390 userelocatableinc='$userelocatableinc'
23392 useshrplib='$useshrplib'
23393 usesitecustomize='$usesitecustomize'
23394 usesocks='$usesocks'
23395 usethreads='$usethreads'
23396 usevendorprefix='$usevendorprefix'
23397 usevfork='$usevfork'
23400 uvXUformat='$uvXUformat'
23401 uvoformat='$uvoformat'
23404 uvuformat='$uvuformat'
23405 uvxformat='$uvxformat'
23407 vendorarch='$vendorarch'
23408 vendorarchexp='$vendorarchexp'
23409 vendorbin='$vendorbin'
23410 vendorbinexp='$vendorbinexp'
23411 vendorhtml1dir='$vendorhtml1dir'
23412 vendorhtml1direxp='$vendorhtml1direxp'
23413 vendorhtml3dir='$vendorhtml3dir'
23414 vendorhtml3direxp='$vendorhtml3direxp'
23415 vendorlib='$vendorlib'
23416 vendorlib_stem='$vendorlib_stem'
23417 vendorlibexp='$vendorlibexp'
23418 vendorman1dir='$vendorman1dir'
23419 vendorman1direxp='$vendorman1direxp'
23420 vendorman3dir='$vendorman3dir'
23421 vendorman3direxp='$vendorman3direxp'
23422 vendorprefix='$vendorprefix'
23423 vendorprefixexp='$vendorprefixexp'
23424 vendorscript='$vendorscript'
23425 vendorscriptexp='$vendorscriptexp'
23427 version_patchlevel_string='$version_patchlevel_string'
23428 versiononly='$versiononly'
23430 voidflags='$voidflags'
23433 yaccflags='$yaccflags'
23438 : add special variables
23439 $test -f $src/patchlevel.h && \
23440 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23441 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
23442 echo "PERL_CONFIG_SH=true" >>config.sh
23444 : propagate old symbols
23445 if $test -f UU/config.sh; then
23446 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23447 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23448 config.sh config.sh UU/oldconfig.sh |\
23449 $sort | $uniq -u >UU/oldsyms
23450 set X `cat UU/oldsyms`
23456 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23458 echo ": Variables propagated from previous config.sh file." >>config.sh
23459 for sym in `cat UU/oldsyms`; do
23460 echo " Propagating $hint variable "'$'"$sym..."
23461 eval 'tmp="$'"${sym}"'"'
23463 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23469 : Finish up by extracting the .SH files
23473 echo "Extraction done."
23483 If you'd like to make any changes to the config.sh file before I begin
23484 to configure things, do it as a shell escape now (e.g. !vi config.sh).
23487 rp="Press return or use a shell escape to edit config.sh:"
23492 *) : in case they cannot read
23493 sh 1>&4 -c "$ans";;
23498 : if this fails, just run all the .SH files by hand
23507 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
23514 Now you need to generate make dependencies by running "$make depend".
23515 You might prefer to run it in background: "$make depend > makedepend.out &"
23516 It can take a while, so you might not want to run it right now.
23521 rp="Run $make depend now?"
23525 $make depend && echo "Now you must run '$make'."
23528 echo "You must run '$make depend' then '$make'."
23531 elif test -f [Mm]akefile; then
23533 echo "Now you must run a $make."
23535 echo "Configure done."
23538 if $test -f Policy.sh; then
23541 If you compile $package on a different machine or from a different object
23542 directory, copy the Policy.sh file from this object directory to the
23543 new one before you run Configure -- this will help you with most of
23544 the policy defaults.
23548 if $test -f config.msg; then
23549 echo "Hmm. I also noted the following information while running:"
23551 $cat config.msg >&4
23554 $rm -f kit*isdone ark*isdone