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 Fri Nov 6 07:43:05 CET 2009 [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=''
633 d_old_pthread_create_joinable=''
634 old_pthread_create_joinable=''
636 d_pthread_attr_setscope=''
675 sethostent_r_proto=''
692 setprotoent_r_proto=''
704 setservent_r_proto=''
738 d_sprintf_returns_strlen=''
753 d_stdio_ptr_lval_nochange_cnt=''
754 d_stdio_ptr_lval_sets_cnt=''
898 d_gdbm_ndbm_h_uses_prototypes=''
899 d_gdbmndbm_h_uses_prototypes=''
901 d_ndbm_h_uses_prototypes=''
975 d_inc_version_list=''
977 inc_version_list_init=''
996 ignore_versioned_solibs=''
1060 d_perl_otherlibdirs=''
1068 api_versionstring=''
1074 version_patchlevel_string=''
1078 d_nv_preserves_uv=''
1079 d_nv_zero_is_allbits_zero=''
1090 nv_overflows_integers_at=''
1091 nv_preserves_uv_bits=''
1163 installsitehtml1dir=''
1166 installsitehtml3dir=''
1173 installsiteman1dir=''
1176 installsiteman3dir=''
1181 installsitescript=''
1196 d_stdio_stream_array=''
1197 stdio_stream_array=''
1214 ccflags_uselargefiles=''
1215 ldflags_uselargefiles=''
1216 libswanted_uselargefiles=''
1236 installvendorarch=''
1243 installvendorhtml1dir=''
1245 vendorhtml1direxp=''
1246 installvendorhtml3dir=''
1248 vendorhtml3direxp=''
1254 installvendorman1dir=''
1257 installvendorman3dir=''
1264 installvendorscript=''
1277 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1280 : We must find out about Eunice early
1282 if test -f /etc/unixtovms; then
1283 eunicefix=/etc/unixtovms
1285 if test -f /etc/unixtovms.exe; then
1286 eunicefix=/etc/unixtovms.exe
1289 : Set executable suffix now -- needed before hints available
1290 if test -f "/libs/version.library"; then
1293 elif test -f "/system/gnu_library/bin/ar.pm"; then
1296 elif test -n "$DJGPP"; then
1299 elif test -d c:/. -o -n "$is_os2" ; then
1306 : Trailing extension. Override this in a hint file, if needed.
1307 : Extra object files, if any, needed on this platform.
1311 : change the next line if compiling for Xenix/286 on Xenix/386
1312 xlibpth='/usr/lib/386 /lib/386'
1313 : Possible local library directories to search.
1314 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1315 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1317 : general looking path for locating libraries
1318 glibpth="/lib /usr/lib $xlibpth"
1319 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1320 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1321 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1322 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1324 : Private path used by Configure to find libraries. Its value
1325 : is prepended to libpth. This variable takes care of special
1326 : machines, like the mips. Usually, it should be empty.
1329 : default library list
1331 : some systems want to use only the non-versioned libso:s
1332 ignore_versioned_solibs=''
1333 : set usethreads on the Configure command line to enable threads.
1334 usereentrant='undef'
1335 : full support for void wanted by default
1338 : Possible local include directories to search.
1339 : Set locincpth to "" in a hint file to defeat local include searches.
1340 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1341 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1343 : no include file wanted by default
1346 : Enable -DEBUGGING and -DDEBUGGING from the command line
1353 : set useposix=false in your hint file to disable the POSIX extension.
1355 : set useopcode=false in your hint file to disable the Opcode extension.
1358 ccflags_uselargefiles=''
1359 ldflags_uselargefiles=''
1360 libswanted_uselargefiles=''
1361 : set usemultiplicity on the Configure command line to enable multiplicity.
1362 : set usesocks on the Configure command line to enable socks.
1363 : List of libraries we want.
1364 : If anyone needs extra -lxxx, put those in a hint file.
1365 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1366 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1367 : We probably want to search /usr/shlib before most other libraries.
1368 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1369 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1370 glibpth="/usr/shlib $glibpth"
1371 : Do not use vfork unless overridden by a hint file.
1374 : Find the basic shell for Bourne shell scripts
1378 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1381 if test -f "$xxx"; then
1384 : Build up a list and do a single loop so we can 'break' out.
1385 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1386 for xxx in sh bash ksh pdksh ash; do
1388 try="$try ${p}/${xxx}"
1392 if test -f "$xxx"; then
1395 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1398 elif test -f "$xxx.exe"; then
1409 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1411 Usually it's in /bin/sh. How did you even get this far?
1412 Please contact me (Perl Maintainers) at perlbug@perl.org and
1413 we'll try to straighten this all out.
1419 : see if sh knows # comments
1420 if `$sh -c '#' >/dev/null 2>&1`; then
1424 test -f $xcat$_exe || xcat=/usr/bin/cat
1425 if test ! -f $xcat$_exe; then
1426 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1427 if test -f $p/cat$_exe; then
1432 if test ! -f $xcat$_exe; then
1433 echo "Can't find cat anywhere!"
1437 echo "#!$xcat" >sharp
1440 ./sharp > today 2>/dev/null
1441 if test -s today; then
1444 echo "#! $xcat" > sharp
1447 ./sharp > today 2>/dev/null
1448 if test -s today; then
1456 echo "Your $sh doesn't grok # comments--I will strip them later on."
1459 echo "exec grep -v '^[ ]*#'" >spitshell
1461 $eunicefix spitshell
1462 spitshell=`pwd`/spitshell
1464 echo "I presume that if # doesn't work, #! won't work either!"
1469 : figure out how to guarantee sh startup
1471 '') startsh=${sharpbang}${sh} ;;
1483 : echo "Yup, it does."
1485 echo "Hmm... '$startsh' does not guarantee sh startup..."
1486 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1490 : Save command line options in file UU/cmdline.opt for later use in
1491 : generating config.sh.
1492 cat > cmdline.opt <<EOSH
1493 : Configure command line arguments.
1502 cat >>cmdline.opt <<EOSH
1503 config_arg$argn='$arg'
1505 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1508 arg_exp=`cat cmdl.opt`
1509 args_exp="$args_exp$args_sep'$arg_exp'"
1510 argn=`expr $argn + 1`
1515 : produce awk script to parse command line options
1516 cat >options.awk <<'EOF'
1518 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1520 len = length(optstr);
1521 for (i = 1; i <= len; i++) {
1522 c = substr(optstr, i, 1);
1523 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1534 if (substr(str, 1, 1) != "-") {
1535 printf("'%s'\n", str);
1539 for (i = 2; i <= len; i++) {
1540 c = substr(str, i, 1);
1542 printf("-%s\n", substr(str, i));
1548 printf("'%s'\n", substr(str, i + 1));
1561 : process the command line options
1562 set X `for arg in "$@"; do echo "X$arg"; done |
1563 sed -e s/X// | awk -f options.awk`
1568 : set up default values
1578 rm -f optdef.sh posthint.sh
1579 cat >optdef.sh <<EOS
1585 while test $# -gt 0; do
1587 -d) shift; fastread=yes;;
1588 -e) shift; alldone=cont;;
1592 if test -r "$1"; then
1595 echo "$me: cannot read config file $1." >&2
1601 -h) shift; error=true;;
1602 -r) shift; reuseval=true;;
1603 -s) shift; silent=true; realsilent=true;;
1604 -E) shift; alldone=exit;;
1605 -K) shift; knowitall=true;;
1606 -O) shift; override=true;;
1607 -S) shift; silent=true; extractsh=true;;
1612 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1613 echo "$me: ignoring -D $1" >&2
1616 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1617 *) echo "$1='define'" >> optdef.sh;;
1624 *=) echo "$1" >> optdef.sh;;
1626 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1627 echo "$me: ignoring -U $1" >&2
1629 *) echo "$1='undef'" >> optdef.sh;;
1640 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1644 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1645 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1651 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1652 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1653 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1654 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1655 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1656 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1662 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1664 echo "$yyy=''" >> posthint.sh ;;
1669 echo "$yyy='$zzz'" >> posthint.sh ;;
1671 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1673 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1678 echo "$yyy=$zzz" >> posthint.sh ;;
1679 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1683 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1686 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1694 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1695 [-U symbol] [-U symbol=] [-A command:symbol...]
1696 -d : use defaults for all answers.
1697 -e : go on without questioning past the production of config.sh.
1698 -f : specify an alternate default configuration file.
1699 -h : print this help message and exit (with an error status).
1700 -r : reuse C symbols value if possible (skips costly nm extraction).
1701 -s : silent mode, only echoes questions and essential information.
1702 -D : define symbol to have some value:
1703 -D symbol symbol gets the value 'define'
1704 -D symbol=value symbol gets the value 'value'
1705 common used examples (see INSTALL for more info):
1706 -Duse64bitint use 64bit integers
1707 -Duse64bitall use 64bit integers and pointers
1708 -Dusethreads use thread support
1709 -Dinc_version_list=none do not include older perl trees in @INC
1710 -DEBUGGING=none DEBUGGING options
1711 -Dcc=gcc choose your compiler
1712 -Dprefix=/opt/perl5 choose your destination
1713 -E : stop at the end of questions, after having produced config.sh.
1714 -K : do not use unless you know what you are doing.
1715 -O : let -D and -U override definitions from loaded configuration file.
1716 -S : perform variable substitutions on all .SH files (can mix with -f)
1717 -U : undefine symbol:
1718 -U symbol symbol gets the value 'undef'
1719 -U symbol= symbol gets completely empty
1721 -A : manipulate symbol after the platform specific hints have been applied:
1722 -A append:symbol=value append value to symbol
1723 -A symbol=value like append:, but with a separating space
1724 -A define:symbol=value define symbol to have value
1725 -A clear:symbol define symbol to be ''
1726 -A define:symbol define symbol to be 'define'
1727 -A eval:symbol=value define symbol to be eval of value
1728 -A prepend:symbol=value prepend value to symbol
1729 -A undef:symbol define symbol to be 'undef'
1730 -A undef:symbol= define symbol to be ''
1731 e.g.: -A prepend:libswanted='cl pthread '
1732 -A ccflags=-DSOME_MACRO
1733 -V : print version number and exit (with a zero status).
1740 case "$fastread$alldone" in
1743 case "$extractsh" in
1746 if test ! -t 0; then
1747 echo "Say 'sh Configure', not 'sh <Configure'"
1757 true) exec 1>/dev/null;;
1760 : run the defines and the undefines, if any, but leave the file out there...
1763 : create the posthint manipulation script and leave the file out there...
1768 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1769 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1770 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1771 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1772 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1775 : Some greps do not return status, grrr.
1776 echo "grimblepritz" >grimble
1777 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1779 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1785 : the following should work in any shell
1789 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1790 cat >contains <<'EOSS'
1791 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1796 : Find the path to the source tree
1799 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1803 *) src=`cd ../$src && pwd` ;;
1816 if test -f $rsrc/Configure && \
1817 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1819 : found it, so we are ok.
1822 for src in . .. ../.. ../../.. ../../../..; do
1823 if test -f ../$src/Configure && \
1824 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1835 Sorry, I can't seem to locate the source dir for $package. Please start
1836 Configure with an explicit path -- i.e. /some/path/Configure.
1844 echo "Sources for $package found in \"$src\"." >&4
1848 : script used to extract .SH files with variable substitutions
1849 cat >extract <<'EOS'
1851 echo "Doing variable substitutions on .SH files..."
1852 if test -f MANIFEST; then
1853 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1855 echo "(Looking for .SH files under the source directory.)"
1856 set x `(cd "$src"; find . -name "*.SH" -print)`
1860 0) set x `(cd "$src"; echo *.SH)`; shift;;
1862 if test ! -f "$src/$1"; then
1868 while test $name; do
1869 if test ! -d "$name"; then
1870 create="$name $create";
1871 name=`echo $name | sed -e "s|^[^/]*$||"`;
1872 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1877 for file in $create; do
1886 dir=`expr X$file : 'X\(.*\)/'`
1887 file=`expr X$file : 'X.*/\(.*\)'`
1888 (cd "$dir" && . ./$file)
1898 dir=`expr X$file : 'X\(.*\)/'`
1899 file=`expr X$file : 'X.*/\(.*\)'`
1900 (set x $dir; shift; eval $mkdir_p)
1901 sh <"$src/$dir/$file"
1910 if test -f "$src/config_h.SH"; then
1911 if test ! -f config.h; then
1912 : oops, they left it out of MANIFEST, probably, so do it anyway.
1913 . "$src/config_h.SH"
1918 : extract files and exit if asked to do so
1919 case "$extractsh" in
1921 case "$realsilent" in
1925 case "$config_sh" in
1926 '') config_sh='config.sh';;
1929 echo "Fetching answers from $config_sh..."
1932 test "$override" && . ./optdef.sh
1936 echo "Extraction done."
1941 : Eunice requires " " instead of "", can you believe it
1944 echo "Beginning of configuration questions for $package."
1946 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1948 : first determine how to suppress newline on echo command
1950 echo "Checking echo to see how to suppress newlines..."
1951 (echo "hi there\c" ; echo " ") >.echotmp
1952 if $contains c .echotmp >/dev/null 2>&1 ; then
1963 echo $n "The star should be here-->$c"
1967 : Now test for existence of everything in MANIFEST
1969 if test -f "$rsrc/MANIFEST"; then
1970 echo "First let's make sure your kit is complete. Checking..." >&4
1971 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1972 (split -l 50 2>/dev/null || split -50)
1975 for filelist in x??; do
1976 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1977 >/dev/null 2>>"$tmppwd/missing")
1979 if test -s missing; then
1983 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1985 You have the option of continuing the configuration process, despite the
1986 distinct possibility that your kit is damaged, by typing 'y'es. If you
1987 do, don't blame me if something goes wrong. I advise you to type 'n'o
1988 and contact the author (perlbug@perl.org).
1991 echo $n "Continue? [n] $c" >&4
1995 echo "Continuing..." >&4
1999 echo "ABORTING..." >&4
2004 echo "Looks good..."
2007 echo "There is no MANIFEST file. I hope your kit is complete !"
2011 : Find the appropriate value for a newline for tr
2013 if test -n "$DJGPP"; then
2016 if test X"$trnl" = X; then
2017 case "`echo foo|tr '\n' x 2>/dev/null`" in
2021 if test X"$trnl" = X; then
2022 case "`echo foo|tr '\012' x 2>/dev/null`" in
2023 foox) trnl='\012' ;;
2026 if test X"$trnl" = X; then
2027 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2028 fooxy) trnl='\n\r' ;;
2031 if test X"$trnl" = X; then
2034 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2040 : compute the number of columns on the terminal for proper question formatting
2045 : set up the echo used in my read
2046 myecho="case \"\$xxxm\" in
2047 '') echo $n \"\$rp $c\" >&4;;
2049 '') echo $n \"[\$xxxm] $c\";;
2051 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2053 echo $n \"[\$xxxm] $c\" >&4
2055 echo $n \"\$rp [\$xxxm] $c\" >&4
2061 : now set up to do reads with possible shell escape and default assignment
2067 case "\$fastread" in
2068 yes) case "\$dflt" in
2071 case "\$silent-\$rp" in
2076 *) case "\$silent" in
2077 true) case "\$rp" in
2082 while expr "X\$ans" : "X!" >/dev/null; do
2086 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2094 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2103 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2108 echo "(OK, I'll run with -d after this question.)" >&4
2111 echo "*** Sorry, \$1 not supported yet." >&4
2121 echo "*** Substitution done -- please confirm."
2123 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2128 echo "*** Error -- try again."
2135 case "\$ans\$xxxm\$nostick" in
2147 : create .config dir to save info across Configure sessions
2148 test -d ../.config || mkdir ../.config
2149 cat >../.config/README <<EOF
2150 This directory created by Configure to save information that should
2151 persist across sessions for $package.
2153 You may safely delete it if you wish.
2156 : See if we are using a devel version and want that
2157 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2160 usedevel="$define" ;;
2161 *) case "$xversion" in
2164 *** WHOA THERE!!! ***
2166 This is an UNSTABLE DEVELOPMENT release.
2167 The version of this $package distribution is $xversion, that is, odd,
2168 (as opposed to even) and that signifies a development release.
2169 If you want a maintenance release, you want an even-numbered version.
2171 Do ***NOT*** install this into production use.
2172 Data corruption and crashes are possible.
2174 It is most seriously suggested that you do not continue any further
2175 unless you want to help in developing and debugging Perl.
2177 If you *still* want to build perl, you can answer 'y' now,
2178 or pass -Dusedevel to Configure.
2181 rp='Do you really want to continue?'
2185 [yY]) echo >&4 "Okay, continuing."
2186 usedevel="$define" ;;
2187 *) echo >&4 "Okay, bye."
2198 case "$versiononly" in
2199 '') versiononly="$define" ;;
2201 case "$installusrbinperl" in
2202 '') installusrbinperl="$undef" ;;
2207 : general instructions
2210 user=`(logname) 2>/dev/null`
2212 '') user=`whoami 2>&1`;;
2214 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2217 rp='Would you like to see the instructions?'
2228 This installation shell script will examine your system and ask you questions
2229 to determine how the perl5 package should be installed. If you get
2230 stuck on a question, you may use a ! shell escape to start a subshell or
2231 execute a command. Many of the questions will have default answers in square
2232 brackets; typing carriage return will give you the default.
2234 On some of the questions which ask for file or directory names you are allowed
2235 to use the ~name construct to specify the login directory belonging to "name",
2236 even if you don't have a shell which knows about that. Questions where this is
2237 allowed will be marked "(~name ok)".
2241 dflt='Type carriage return to continue'
2245 The prompter used in this script allows you to use shell variables and
2246 backticks in your answers. You may use $1, $2, etc... to refer to the words
2247 in the default answer, as if the default line was a set of arguments given to a
2248 script shell. This means you may also use $* to repeat the whole default line,
2249 so you do not have to re-type everything to add something to the default.
2251 Everytime there is a substitution, you will have to confirm. If there is an
2252 error (e.g. an unmatched backtick), the default answer will remain unchanged
2253 and you will be prompted again.
2255 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2256 the questions and use the computed defaults (or the previous answers if there
2257 was already a config.sh file). Type 'Configure -h' for a list of options.
2258 You may also start interactively and then answer '& -d' at any prompt to turn
2259 on the non-interactive behaviour for the remainder of the execution.
2265 Much effort has been expended to ensure that this shell script will run on any
2266 Unix system. If despite that it blows up on yours, your best bet is to edit
2267 Configure and run it again. If you can't run Configure for some reason,
2268 you'll have to generate a config.sh file by hand. Whatever problems you
2269 have, let me (perlbug@perl.org) know how I blew it.
2271 This installation script affects things in two ways:
2273 1) it may do direct variable substitutions on some of the files included
2275 2) it builds a config.h file for inclusion in C programs. You may edit
2276 any of these files as the need arises after running this script.
2278 If you make a mistake on a question, there is no easy way to back up to it
2279 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2280 files. Configure will offer to let you do this before it runs the SH files.
2283 dflt='Type carriage return to continue'
2285 case "$firsttime" in
2286 true) echo $user >>../.config/instruct;;
2290 : find out where common programs are
2292 echo "Locating common programs..." >&4
2305 if test -d \$dir/\$thing; then
2311 for thisthing in \$dir/\$thing; do
2312 : just loop through to pick last item
2314 if test -f \$thisthing; then
2317 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2320 elif test -f \$dir/\$thing.exe; then
2321 if test -n "$DJGPP"; then
2322 echo \$dir/\$thing.exe
2323 elif test "$eunicefix" != ":"; then
2324 : on Eunice apparently
2376 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2377 pth="$pth /lib /usr/lib"
2378 for file in $loclist; do
2382 if test -f "$xxx"; then
2385 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2386 xxx=`./loc $file $file $pth`
2389 '') xxx=`./loc $file $file $pth`;;
2390 *) xxx=`./loc $xxx $xxx $pth`;;
2392 eval $file=$xxx$_exe
2396 echo $file is in $xxx.
2399 echo $file is in $xxx.
2402 echo "I don't know where '$file' is, and my life depends on it." >&4
2403 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2409 echo "Don't worry if any of the following aren't found..."
2411 for file in $trylist; do
2415 if test -f "$xxx"; then
2418 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2419 xxx=`./loc $file $file $pth`
2422 '') xxx=`./loc $file $file $pth`;;
2423 *) xxx=`./loc $xxx $xxx $pth`;;
2425 eval $file=$xxx$_exe
2429 echo $file is in $xxx.
2432 echo $file is in $xxx.
2435 echo "I don't see $file out there, $say."
2442 echo "Substituting grep for egrep."
2449 echo "Substituting cp for ln."
2458 echo "I can't find make or gmake, and my life depends on it." >&4
2459 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2467 *) # We can't have osname yet.
2468 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2469 # Assume that gmake, if found, is definitely GNU make
2470 # and prefer it over the system make.
2471 echo "Substituting gmake for make."
2479 echo "Hopefully test is built into your sh."
2482 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2483 echo "Using the test built into your sh."
2491 echo "Hopefully echo is built into your sh."
2496 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2497 $echo $n "hi there$c" >foo1
2498 echo $n "hi there$c" >foo2
2499 if cmp foo1 foo2 >/dev/null 2>&1; then
2500 echo "They are compatible. In fact, they may be identical."
2507 They are not compatible! You are probably running ksh on a non-USG system.
2508 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2509 have echo built in and we may have to run some Bourne shell scripts. That
2510 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2513 $echo $n "The star should be here-->$c"
2520 # This question was auctioned at YAPC::Europe-2007 in Vienna
2521 # I never promised you could answer it. I only auctioned the question.
2523 The following message is sponsored by
2525 Dresden.pm<--The stars should be here.
2527 Dear Perl user, system administrator or package
2528 maintainer, the Perl community sends greetings to
2529 you. Do you (emblematical) greet back [Y/n]? n
2533 : Check what type of C compiler we use
2537 cat <<'EOSC' >>trygcc
2542 int main(int argc, char *argv[]) {
2546 if $cc -o try $ccflags $ldflags try.c; then
2549 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2555 # Skip this test because it gives a false match on output like:
2556 # ./trygcc: line 23: cc: command not found
2557 # case "`$cc -v -c try.c 2>&1`" in
2558 # *gcc*) trygcc=no ;;
2560 if $test X"$trygcc" = Xyes; then
2561 if gcc -o try -c try.c; then
2563 echo "You seem to have a working gcc, though." >&4
2564 # Switching compilers may undo the work of hints files.
2565 # The most common problem is -D_REENTRANT for threads.
2566 # This heuristic catches that case, but gets false positives
2567 # if -Dusethreads was not actually specified. Better to
2568 # bail out here with a useful message than fail
2569 # mysteriously later. Should we perhaps just try to
2570 # re-invoke Configure -Dcc=gcc config_args ?
2571 if $test -f usethreads.cbu; then
2574 *** However, any setting of the C compiler flags (e.g. for thread support)
2575 *** will be lost. It may be necessary for you to restart Configure and
2576 *** add -Dcc=gcc to your Configure command line.
2579 rp="Would you like to go ahead and try gcc anyway?"
2582 rp="Would you like to use it?"
2585 if $test -f myread; then
2588 if $test -f UU/myread; then
2591 echo "Cannot find myread, sorry. Aborting." >&2
2596 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2609 cat <<'EOSC' >>checkcc
2614 int main(int argc, char *argv[]) {
2618 if $cc -o try $ccflags $ldflags try.c; then
2621 if $test X"$despair" = Xyes; then
2622 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2625 You need to find a working C compiler.
2626 Either (purchase and) install the C compiler supplied by your OS vendor,
2627 or for a free C compiler try http://gcc.gnu.org/
2628 I cannot continue any further, aborting.
2637 : determine whether symbolic links are supported
2640 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2641 echo "Symbolic links are supported." >&4
2644 echo "Symbolic links are NOT supported." >&4
2649 : determine whether symbolic links are supported
2653 echo "Checking how to test for symbolic links..." >&4
2655 if $test "X$issymlink" = X; then
2657 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2658 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2660 if test $? = 0; then
2663 echo "Your builtin 'test -h' may be broken." >&4
2666 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2669 if test -f "$p/$test"; then
2678 echo "Trying external '$test -h'." >&4
2679 issymlink="$test -h"
2680 if $test ! -h sym >/dev/null 2>&1; then
2681 echo "External '$test -h' is broken, too." >&4
2689 if $test "X$issymlink" = X; then
2690 if $test -L sym 2>/dev/null; then
2691 issymlink="$test -L"
2692 echo "The builtin '$test -L' worked." >&4
2695 if $test "X$issymlink" != X; then
2696 echo "You can test for symbolic links with '$issymlink'." >&4
2698 echo "I do not know how you can test for symbolic links." >&4
2702 *) echo "No symbolic links, so not testing for their testing..." >&4
2707 : Make symlinks util
2708 case "$mksymlinks" in
2711 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2714 *) case "$lns:$issymlink" in
2715 *"ln"*" -s:"*"test -"?)
2716 echo "Creating the symbolic links..." >&4
2717 echo "(First creating the subdirectories...)" >&4
2719 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2721 test -z "$directory" && break
2725 if test ! -d t/base; then
2726 echo "Failed to create the subdirectories. Aborting." >&4
2729 echo "(Then creating the symlinks...)" >&4
2730 awk '{print $1}' $src/MANIFEST | while true; do
2732 test -z "$filename" && break
2733 if test -f $filename; then
2734 if $issymlink $filename; then
2738 if test -f $filename; then
2739 echo "$filename already exists, not symlinking."
2741 ln -s $src/$filename $filename
2745 if test ! -f t/base/lex.t; then
2746 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2751 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2759 : Check for Cross-Compilation
2760 case "$usecrosscompile" in
2762 $echo "Cross-compiling..."
2765 *-*-gcc) # A cross-compiling gcc, probably.
2766 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2768 # leave out ld, choosing it is more complex
2770 ranlib=$targetarch-ranlib
2771 $echo 'extern int foo;' > try.c
2772 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2774 if $test $# -gt 0; then
2776 incpth="`$echo $incpth|$sed 's/^ //'`"
2777 echo "Guessing incpth '$incpth'." >&4
2779 j="`$echo $i|$sed 's,/include$,/lib,'`"
2780 if $test -d $j; then
2784 libpth="`$echo $libpth|$sed 's/^ //'`"
2785 echo "Guessing libpth '$libpth'." >&4
2790 case "$targetarch" in
2791 '') echo "Targetarch not defined." >&4; croak=y ;;
2792 *) echo "Using targetarch $targetarch." >&4 ;;
2795 '') echo "Incpth not defined." >&4; croak=y ;;
2796 *) echo "Using incpth '$incpth'." >&4 ;;
2799 '') echo "Libpth not defined." >&4; croak=y ;;
2800 *) echo "Using libpth '$libpth'." >&4 ;;
2803 '') for i in $incpth; do
2804 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2806 echo "Guessing usrinc $usrinc." >&4
2811 '') echo "Usrinc not defined." >&4; croak=y ;;
2814 *) echo "Using usrinc $usrinc." >&4 ;;
2816 case "$targethost" in
2817 '') echo "Targethost not defined." >&4; croak=y ;;
2818 *) echo "Using targethost $targethost." >&4
2823 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2826 /*) run=$src/Cross/run
2827 targetmkdir=$src/Cross/mkdir
2829 from=$src/Cross/from
2831 *) pwd=`$test -f ../Configure & cd ..; pwd`
2833 targetmkdir=$pwd/Cross/mkdir
2835 from=$pwd/Cross/from
2838 case "$targetrun" in
2839 '') targetrun=ssh ;;
2844 case "$targetfrom" in
2845 '') targetfrom=scp ;;
2849 from=$from-$targetfrom
2850 case "$targetdir" in
2852 echo "Guessing targetdir $targetdir." >&4
2855 case "$targetuser" in
2857 echo "Guessing targetuser $targetuser." >&4
2860 case "$targetfrom" in
2864 case "$targetrun" in
2876 '') cwd=$targetdir ;;
2880 if $test ! -f \$exe.xok; then
2884 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2887 *) echo "Unknown targetrun '$targetrun'" >&4
2891 case "$targetmkdir" in
2893 cat >$targetmkdir <<EOF
2895 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2897 $chmod a+rx $targetmkdir
2899 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2911 $targetmkdir \`dirname \$f\`
2912 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2915 $targetmkdir $targetdir/\`dirname \$f\`
2916 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2929 $mkdir -p $targetdir/\`dirname \$f\`
2930 $cp \$f $targetdir/\$f || exit 1
2933 $targetmkdir $targetdir/\`dirname \$f\`
2934 $cp \$f $targetdir/\$f || exit 1
2941 *) echo "Unknown targetto '$targetto'" >&4
2945 case "$targetfrom" in
2952 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2957 cp) cat >$from <<EOF
2962 cp $targetdir/\$f . || exit 1
2967 *) echo "Unknown targetfrom '$targetfrom'" >&4
2971 if $test ! -f $run; then
2972 echo "Target 'run' script '$run' not found." >&4
2976 if $test ! -f $to; then
2977 echo "Target 'to' script '$to' not found." >&4
2981 if $test ! -f $from; then
2982 echo "Target 'from' script '$from' not found." >&4
2986 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2990 Using '$run' for remote execution,
2991 and '$from' and '$to'
2992 for remote file transfer.
2998 usecrosscompile='undef'
3003 : see whether [:lower:] and [:upper:] are supported character classes
3005 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3007 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3011 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3012 # (0xd9 and 0xe2), therefore that is a nice testing point.
3013 if test "X$up" = X -o "X$low" = X; then
3014 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3020 if test "X$up" = X -o "X$low" = X; then
3021 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3027 if test "X$up" = X -o "X$low" = X; then
3028 case "`echo RS | od -x 2>/dev/null`" in
3030 echo "Hey, this might be EBCDIC." >&4
3031 if test "X$up" = X -o "X$low" = X; then
3032 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3033 rs) up='[A-IJ-RS-Z]'
3038 if test "X$up" = X -o "X$low" = X; then
3039 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3049 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3051 echo "Using $up and $low to convert case." >&4
3054 echo "I don't know how to translate letters from upper to lower case." >&4
3055 echo "Your tr is not acting any way I know of." >&4
3059 : set up the translation script tr, must be called with ./tr of course
3063 '[A-Z][a-z]') exec $tr '$up' '$low';;
3064 '[a-z][A-Z]') exec $tr '$low' '$up';;
3071 : Try to determine whether config.sh was made on this system
3072 case "$config_sh" in
3074 myuname=`$uname -a 2>/dev/null`
3075 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3076 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3077 # because the A-Z/a-z are not consecutive.
3078 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3079 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3080 newmyuname="$myuname"
3082 case "$knowitall" in
3084 if test -f ../config.sh; then
3085 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3086 eval "`grep myuname= ../config.sh`"
3088 if test "X$myuname" = "X$newmyuname"; then
3096 : Get old answers from old config file if Configure was run on the
3097 : same system, otherwise use the hints.
3100 if test -f config.sh; then
3102 rp="I see a config.sh file. Shall I use it to set the defaults?"
3105 n*|N*) echo "OK, I'll ignore it."
3106 mv config.sh config.sh.old
3107 myuname="$newmyuname"
3109 *) echo "Fetching default answers from your old config.sh file..." >&4
3117 : Older versions did not always set $sh. Catch re-use of such
3127 if test ! -f config.sh; then
3130 First time through, eh? I have some defaults handy for some systems
3131 that need some extra help getting the Configure answers right:
3134 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3136 : Half the following guesses are probably wrong... If you have better
3137 : tests or hints, please send them to perlbug@perl.org
3138 : The metaconfig authors would also appreciate a copy...
3139 $test -f /irix && osname=irix
3140 $test -f /xenix && osname=sco_xenix
3141 $test -f /dynix && osname=dynix
3142 $test -f /dnix && osname=dnix
3143 $test -f /lynx.os && osname=lynxos
3144 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3145 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3146 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3147 $test -f /bin/mips && /bin/mips && osname=mips
3148 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3149 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3150 $test -d /usr/apollo/bin && osname=apollo
3151 $test -f /etc/saf/_sactab && osname=svr4
3152 $test -d /usr/include/minix && osname=minix
3153 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3154 if $test -d /MachTen -o -d /MachTen_Folder; then
3156 if $test -x /sbin/version; then
3157 osvers=`/sbin/version | $awk '{print $2}' |
3158 $sed -e 's/[A-Za-z]$//'`
3159 elif $test -x /usr/etc/version; then
3160 osvers=`/usr/etc/version | $awk '{print $2}' |
3161 $sed -e 's/[A-Za-z]$//'`
3167 $test -f /sys/posix.dll &&
3168 $test -f /usr/bin/what &&
3169 set X `/usr/bin/what /sys/posix.dll` &&
3170 $test "$3" = UWIN &&
3174 if $test -f $uname; then
3182 umips) osname=umips ;;
3185 [23]100) osname=mips ;;
3186 next*) osname=next ;;
3188 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3189 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3192 elif $test -f /etc/kconfig; then
3194 if test "$lns" = "$ln -s"; then
3196 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3198 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3205 if test -n "$DJGPP"; then
3214 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3216 # oslevel can fail with:
3217 # oslevel: Unable to acquire lock.
3218 *not\ found) osvers="$4"."$3" ;;
3219 '<3240'|'<>3240') osvers=3.2.0 ;;
3220 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3221 '=3250'|'>3250') osvers=3.2.5 ;;
3225 bsd386) osname=bsd386
3228 cygwin*) osname=cygwin
3231 *dc.osx) osname=dcosx
3237 domainos) osname=apollo
3243 dragonfly) osname=dragonfly
3246 dynixptx*) osname=dynixptx
3247 osvers=`echo "$4"|sed 's/^v//'`
3249 freebsd) osname=freebsd
3251 genix) osname=genix ;;
3255 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3271 netbsd*) osname=netbsd
3274 news-os) osvers="$3"
3276 4*) osname=newsos4 ;;
3280 next*) osname=next ;;
3281 nonstop-ux) osname=nonstopux ;;
3282 openbsd) osname=openbsd
3288 POSIX-BC | posix-bc ) osname=posix-bc
3291 powerux | power_ux | powermax_os | powermaxos | \
3292 powerunix | power_unix) osname=powerux
3298 solaris) osname=solaris
3300 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3307 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3311 titanos) osname=titanos
3320 ultrix) osname=ultrix
3323 osf1|mls+) case "$5" in
3326 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3329 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3332 hp*) osname=hp_osf1 ;;
3333 mips) osname=mips_osf1 ;;
3336 # UnixWare 7.1.2 is known as Open UNIX 8
3337 openunix|unixware) osname=svr5
3345 $2) case "$osname" in
3349 : svr4.x or possibly later
3359 if test -f /stand/boot ; then
3360 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3361 if test -n "$INITPROG" -a -f "$INITPROG"; then
3362 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3363 if test -n "$isesix"; then
3371 *) if test -f /etc/systemid; then
3373 set `echo $3 | $sed 's/\./ /g'` $4
3374 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3376 elif $test -f $src/hints/sco_$1_$2.sh; then
3378 elif $test -f $src/hints/sco_$1.sh; then
3383 '') : Still unknown. Probably a generic Sys V.
3392 *) case "$osname" in
3393 '') : Still unknown. Probably a generic BSD.
3401 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3402 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3403 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3406 $rm -f UU/kernel.what
3407 elif test -d c:/. -o -n "$is_os2" ; then
3414 case "$targetarch" in
3417 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3422 : Now look for a hint file osname_osvers, unless one has been
3423 : specified already.
3426 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3427 : Also try without trailing minor version numbers.
3428 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3429 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3430 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3431 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3434 *) case "$osvers" in
3437 *) if $test -f $src/hints/$file.sh ; then
3439 elif $test -f $src/hints/$xfile.sh ; then
3441 elif $test -f $src/hints/$xxfile.sh ; then
3443 elif $test -f $src/hints/$xxxfile.sh ; then
3445 elif $test -f $src/hints/$xxxxfile.sh ; then
3447 elif $test -f "$src/hints/${osname}.sh" ; then
3456 if $test -f Policy.sh ; then
3459 none) dflt="Policy" ;;
3460 *) dflt="Policy $dflt" ;;
3465 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3469 if $test -f Policy.sh ; then
3472 There's also a Policy hint file available, which should make the
3473 site-specific (policy) questions easier to answer.
3480 You may give one or more space-separated answers, or "none" if appropriate.
3481 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3482 previous run of Configure, you may specify it as well as or instead of
3483 OS-specific hints. If hints are provided for your OS, you should use them:
3484 although Perl can probably be built without hints on many platforms, using
3485 hints often improve performance and may enable features that Configure can't
3486 set up on its own. If there are no hints that match your OS, specify "none";
3487 DO NOT give a wrong version or a wrong OS.
3491 rp="Which of these apply, if any?"
3494 for file in $tans; do
3495 if $test X$file = XPolicy -a -f Policy.sh; then
3497 $cat Policy.sh >> UU/config.sh
3498 elif $test -f $src/hints/$file.sh; then
3499 . $src/hints/$file.sh
3500 $cat $src/hints/$file.sh >> UU/config.sh
3501 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3504 : Give one chance to correct a possible typo.
3505 echo "$file.sh does not exist"
3507 rp="hint to use instead?"
3509 for file in $ans; do
3510 if $test -f "$src/hints/$file.sh"; then
3511 . $src/hints/$file.sh
3512 $cat $src/hints/$file.sh >> UU/config.sh
3513 elif $test X$ans = X -o X$ans = Xnone ; then
3516 echo "$file.sh does not exist -- ignored."
3523 : Remember our hint file for later.
3524 if $test -f "$src/hints/$file.sh" ; then
3534 echo "Fetching default answers from $config_sh..." >&4
3538 cp $config_sh config.sh 2>/dev/null
3548 test "$override" && . ./optdef.sh
3550 : Restore computed paths
3551 for file in $loclist $trylist; do
3552 eval $file="\$_$file"
3557 Configure uses the operating system name and version to set some defaults.
3558 The default value is probably right if the name rings a bell. Otherwise,
3559 since spelling matters for me, either accept the default or answer "none"
3566 ''|' '|none) dflt=none ;;
3567 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3570 *) dflt="$osname" ;;
3572 rp="Operating system name?"
3576 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3582 ''|' '|none) dflt=none ;;
3583 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3584 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3586 ''|' ') dflt=none ;;
3591 *) dflt="$osvers" ;;
3593 rp="Operating system version?"
3603 : who configured the system
3604 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3607 cf_by=`(logname) 2>/dev/null`
3610 cf_by=`(whoami) 2>/dev/null`
3612 "") cf_by=unknown ;;
3617 : decide how portable to be. Allow command line overrides.
3618 case "$d_portable" in
3620 *) d_portable="$define" ;;
3623 : set up shell script to do ~ expansion
3629 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3632 if $test -f /bin/csh; then
3633 /bin/csh -f -c "glob \$1"
3638 name=\`$expr x\$1 : '..\([^/]*\)'\`
3639 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3640 if $test ! -d "\$dir"; then
3642 echo "\$me: can't locate home directory for: \$name" >&2
3647 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3663 : now set up to get a file name
3667 cat <<'EOSC' >>getfile
3683 : getfile will accept an answer from the comma-separated list
3684 : enclosed in parentheses even if it does not meet other criteria.
3685 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3686 fn=`echo $fn | sed 's/(.*)//'`
3692 loc_file=`expr $fn : '.*:\(.*\)'`
3693 fn=`expr $fn : '\(.*\):.*'`
3701 */*) fullpath=true;;
3710 *e*) exp_file=true;;
3713 *p*) nopath_ok=true;;
3718 *d*) type='Directory';;
3719 *l*) type='Locate';;
3724 Locate) what='File';;
3729 case "$d_portable" in
3737 while test "$type"; do
3742 true) rp="$rp (~name ok)";;
3745 if test -f UU/getfile.ok && \
3746 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3765 value=`UU/filexp $ans`
3768 if test "$ans" != "$value"; then
3769 echo "(That expands to $value on this system.)"
3783 /*) value="$ansexp" ;;
3784 [a-zA-Z]:/*) value="$ansexp" ;;
3789 echo "I shall only accept a full path name, as in /bin/ls." >&4
3790 echo "Use a ! shell escape if you wish to check pathnames." >&4
3793 echo "Please give a full path name, starting with slash." >&4
3796 echo "Note that using ~name is ok provided it expands well." >&4
3809 for fp in $gfpth; do
3810 if test "X$fp" = X.; then
3815 if test -f "$pf"; then
3817 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3819 echo "($value is not a plain file, but that's ok.)"
3822 if test X"$type" = X; then
3829 for fp in $gfpth; do
3830 if test "X$fp" = X.; then
3835 direxp="$fp/$ansexp"
3837 if test -d "$direxp"; then
3845 if test -d "$ansexp"; then
3846 echo "(Looking for $loc_file in directory $value.)"
3847 value="$value/$loc_file"
3848 ansexp="$ansexp/$loc_file"
3850 if test -f "$ansexp"; then
3853 case "$nopath_ok" in
3854 true) case "$value" in
3856 *) echo "Assuming $value will be in people's path."
3872 if test "$fastread" = yes; then
3877 rp="$what $value doesn't exist. Use that name anyway?"
3896 test "X$gfpthkeep" != Xy && gfpth=""
3899 : determine root of directory hierarchy where package will be installed.
3902 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3905 dflt=`echo "$prefix" | sed 's/.$//'`
3913 By default, $package will be installed in $dflt/bin, manual pages
3914 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3915 installation directories. Typically this is something like /usr/local.
3916 If you wish to have binaries under /usr/bin but other parts of the
3917 installation under /usr/local, that's ok: you will be prompted
3918 separately for each of the installation directories, the prefix being
3919 only used to set the defaults.
3923 rp='Installation prefix to use?'
3931 *) oldprefix="$prefix";;
3938 : allow them to override the AFS root
3941 *) afsroot=$afsroot ;;
3947 $define|true) afs=true ;;
3948 $undef|false) afs=false ;;
3949 *) if $test -d $afsroot; then
3957 echo "AFS may be running... I'll be extra cautious then..." >&4
3959 echo "AFS does not seem to be running..." >&4
3962 : determine installation prefix for where package is to be installed.
3966 Since you are running AFS, I need to distinguish the directory in which
3967 files will reside from the directory in which they are installed (and from
3968 which they are presumably copied to the former directory by occult means).
3971 case "$installprefix" in
3972 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3973 *) dflt="$installprefix";;
3978 In some special cases, particularly when building $package for distribution,
3979 it is convenient to distinguish the directory in which files should be
3980 installed from the directory ($prefix) in which they will
3981 eventually reside. For most users, these two directories are the same.
3984 case "$installprefix" in
3986 *) dflt=$installprefix;;
3990 rp='What installation prefix should I use for installing files?'
3992 installprefix="$ans"
3993 installprefixexp="$ansexp"
3995 : Perform the prefixexp/installprefixexp correction if necessary
3996 cat <<EOS >installprefix
3999 cat <<'EOSC' >>installprefix
4000 : Change installation prefix, if necessary.
4001 if $test X"$prefix" != X"$installprefix"; then
4002 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4004 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4007 chmod +x installprefix
4008 $eunicefix installprefix
4010 : Set variables such as privlib and privlibexp from the output of ./getfile
4011 : performing the prefixexp/installprefixexp correction if necessary.
4012 cat <<EOS >setprefixvar
4015 cat <<'EOSC' >>setprefixvar
4016 eval "${prefixvar}=\"\$ans\""
4017 eval "${prefixvar}exp=\"\$ansexp\""
4020 chmod +x setprefixvar
4021 $eunicefix setprefixvar
4023 : set up the script used to warn in case of inconsistency
4032 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4034 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4035 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4040 echo "*** WHOA THERE!!! ***" >&4
4041 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4044 rp=" Keep the $hint value?"
4047 y) td=$was; tu=$was;;
4051 : function used to set '$1' to '$val'
4052 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4054 $define$undef) . ./whoa; eval "$var=\$td";;
4055 $undef$define) . ./whoa; eval "$var=\$tu";;
4056 *) eval "$var=$val";;
4059 : Check is we will use socks
4061 $define|true|[yY]*) dflt='y';;
4066 Perl can be built to use the SOCKS proxy protocol library. To do so,
4067 Configure must be run with -Dusesocks. If you use SOCKS you also need
4068 to use the PerlIO abstraction layer, this will be implicitly selected.
4070 If this doesn't make any sense to you, just accept the default '$dflt'.
4072 rp='Build Perl for SOCKS?'
4075 y|Y) val="$define" ;;
4082 $define|true|[yY]*) useperlio="$define";;
4085 : Check if we want perlio
4086 case "$useperlio" in
4087 $define|true|[yY]*|'') dflt='y';;
4092 Previous version of $package used the standard IO mechanisms as
4093 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4094 alternate IO mechanisms via the PerlIO abstraction layer, but the
4095 stdio mechanism is still available if needed. The abstraction layer
4096 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4097 Using PerlIO with sfio may cause problems with some extension modules.
4099 If this doesn't make any sense to you, just accept the default '$dflt'.
4101 rp='Use the PerlIO abstraction layer?'
4108 echo "Ok, doing things the stdio way."
4117 case "$useperlio" in
4118 $define|true|[yY]*) ;;
4121 You are using the SOCKS proxy protocol library which means that you
4122 should also use the PerlIO layer. You may be headed for trouble.
4130 : get the patchlevel
4132 echo "Getting the current patchlevel..." >&4
4133 if $test -r $rsrc/patchlevel.h;then
4134 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4135 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4136 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4137 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4138 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4139 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4140 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4149 $echo "(You do not have patchlevel.h. Eek.)"
4151 if $test -r $rsrc/.patch ; then
4152 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
4153 perl_patchlevel=`cat $rsrc/.patch`
4156 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4157 version_patchlevel_string="version $patchlevel subversion $subversion"
4158 case "$perl_patchlevel" in
4160 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4161 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4165 $echo "(You have $package $version_patchlevel_string.)"
4169 : XXX Should be a Configure test for double-dots in filenames.
4170 version=`echo $revision $patchlevel $subversion | \
4171 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4172 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4173 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4176 version=`echo $revision $patchlevel $subversion | \
4177 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4178 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4179 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4182 : Special case the 5.005_xx maintenance series, which used 5.005
4183 : without any subversion label as a subdirectory in $sitelib
4184 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4185 api_versionstring='5.005'
4188 : Do we want threads support and if so, what type
4189 case "$usethreads" in
4190 $define|true|[yY]*) dflt='y';;
4191 *) # Catch case where user specified ithreads or 5005threads but
4192 # forgot -Dusethreads (A.D. 4/2002)
4193 case "$useithreads$use5005threads" in
4195 case "$useperlio" in
4196 "$define") dflt='y' ;;
4206 Perl can be built to take advantage of threads on some systems.
4207 To do so, Configure can be run with -Dusethreads.
4209 Note that Perl built with threading support runs slightly slower
4210 and uses more memory than plain Perl. The current implementation
4211 is believed to be stable, but it is fairly new, and so should be
4212 treated with caution.
4214 If this doesn't make any sense to you, just accept the default '$dflt'.
4216 rp='Build a threading Perl?'
4219 y|Y) val="$define" ;;
4225 if $test $patchlevel -lt 9; then
4226 case "$usethreads" in
4230 Since release 5.6, Perl has had two different threading implementations,
4231 the newer interpreter-based version (ithreads) with one interpreter per
4232 thread, and the older 5.005 version (5005threads).
4233 The 5005threads version is effectively unmaintained and will probably be
4234 removed in Perl 5.10, so there should be no need to build a Perl using it
4235 unless needed for backwards compatibility with some existing 5.005threads
4239 : Default to ithreads unless overridden on command line or with
4242 case "$use5005threads" in
4243 $define|true|[yY]*) dflt='n';;
4245 case "$useithreads" in
4246 $undef|false|[nN]*) dflt='n';;
4248 rp='Use the newer interpreter-based ithreads?'
4251 y|Y) val="$define" ;;
4256 : Now set use5005threads to the opposite value.
4257 case "$useithreads" in
4258 $define) val="$undef" ;;
4265 useithreads="$undef"
4266 use5005threads="$undef"
4270 case "$useithreads$use5005threads" in
4274 You cannot have both the ithreads and the 5.005 threads enabled
4275 at the same time. Disabling the 5.005 threads since they are
4276 much less stable than the ithreads.
4279 use5005threads="$undef"
4284 : perl-5.9.x and later
4286 if test X"$usethreads" = "X$define"; then
4287 case "$use5005threads" in
4291 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4298 use5005threads="$undef"
4299 useithreads="$usethreads"
4302 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4305 *** To build with ithreads you must also use the PerlIO layer.
4306 *** Cannot continue, aborting.
4312 case "$d_oldpthreads" in
4313 '') : Configure tests would be welcome here. For now, assume undef.
4315 *) val="$d_oldpthreads" ;;
4321 : Look for a hint-file generated 'call-back-unit'. If the
4322 : user has specified that a threading perl is to be built,
4323 : we may need to set or change some other defaults.
4324 if $test -f usethreads.cbu; then
4325 echo "Your platform has some specific hints regarding threaded builds, using them..."
4328 case "$usethreads" in
4329 "$define"|true|[yY]*)
4331 (Your platform does not have any specific hints for threaded builds.
4332 Assuming POSIX threads, then.)
4338 : Check if multiplicity is required
4341 Perl can be built so that multiple Perl interpreters can coexist
4342 within the same Perl executable.
4345 case "$useithreads" in
4348 This multiple interpreter support is required for interpreter-based threads.
4352 *) case "$usemultiplicity" in
4353 $define|true|[yY]*) dflt='y';;
4357 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4358 rp='Build Perl for multiplicity?'
4361 y|Y) val="$define" ;;
4369 : Check if morebits is requested
4370 case "$usemorebits" in
4371 "$define"|true|[yY]*)
4372 use64bitint="$define"
4373 uselongdouble="$define"
4374 usemorebits="$define"
4376 *) usemorebits="$undef"
4380 : Determine the C compiler to be used
4386 rp="Use which C compiler?"
4390 : See whether they have no cc but they do have gcc
4392 if $test -f cc.cbu; then
4397 : make some quick guesses about what we are up against
4399 $echo $n "Hmm... $c"
4409 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4410 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4412 echo "Looks kind of like an OSF/1 system, but we'll see..."
4414 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4415 xxx=`./loc addbib blurfl $pth`
4416 if $test -f $xxx; then
4417 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4421 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4422 echo "Looks kind of like an extended USG system, but we'll see..."
4424 echo "Looks kind of like a USG system, but we'll see..."
4428 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4429 echo "Looks kind of like a BSD system, but we'll see..."
4433 echo "Looks kind of like a Version 7 system, but we'll see..."
4436 case "$eunicefix" in
4439 There is, however, a strange, musty smell in the air that reminds me of
4440 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4444 : it so happens the Eunice I know will not run shell scripts in Unix format
4448 echo "Congratulations. You aren't running Eunice."
4452 : Detect OS2. The p_ variable is set above in the Head.U unit.
4453 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4454 : semicolon as a patch separator
4459 I have the feeling something is not exactly right, however...don't tell me...
4460 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4461 (Or you may be running DOS with DJGPP.)
4466 if test -f /xenix; then
4467 echo "Actually, this looks more like a XENIX system..."
4472 echo "It's not Xenix..."
4477 if test -f /venix; then
4478 echo "Actually, this looks more like a VENIX system..."
4485 echo "Nor is it Venix..."
4488 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4489 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4492 : Check if we are using GNU gcc and what its version is
4494 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4498 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4500 printf("%s\n", __VERSION__);
4502 printf("%s\n", "1");
4508 if $cc -o try $ccflags $ldflags try.c; then
4509 gccversion=`$run ./try`
4510 case "$gccversion" in
4511 '') echo "You are not using GNU cc." ;;
4512 *) echo "You are using GNU cc $gccversion."
4518 echo "*** WHOA THERE!!! ***" >&4
4519 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4520 case "$knowitall" in
4522 echo " You'd better start hunting for one and let me know about it." >&4
4528 case "$gccversion" in
4529 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4531 case "$gccversion" in
4532 '') gccosandvers='' ;;
4533 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4534 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4536 case "$gccosandvers" in
4537 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4538 $osname$osvers) ;; # looking good
4539 $osname*) cat <<EOM >&4
4541 *** WHOA THERE!!! ***
4543 Your gcc has not been compiled for the exact release of
4544 your operating system ($gccosandvers versus $osname$osvers).
4546 In general it is a good idea to keep gcc synchronized with
4547 the operating system because otherwise serious problems
4548 may ensue when trying to compile software, like Perl.
4550 I'm trying to be optimistic here, though, and will continue.
4551 If later during the configuration and build icky compilation
4552 problems appear (headerfile conflicts being the most common
4553 manifestation), I suggest reinstalling the gcc to match
4554 your operating system release.
4558 *) gccosandvers='' ;; # failed to parse, better be silent
4566 # gcc 3.* complain about adding -Idirectories that they already know about,
4567 # so we will take those off from locincpth.
4568 case "$gccversion" in
4570 echo "main(){}">try.c
4571 for incdir in $locincpth; do
4572 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4573 grep '^c[cp]p*[01]: warning: changing search order '`
4574 if test "X$warn" != X; then
4575 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4581 : What should the include directory be ?
4583 $echo $n "Hmm... $c"
4587 if $test -f /bin/mips && /bin/mips; then
4588 echo "Looks like a MIPS system..."
4589 $cat >usr.c <<'EOCP'
4590 #ifdef SYSTYPE_BSD43
4594 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4595 dflt='/bsd43/usr/include'
4599 mips_type='System V'
4601 $rm -f usr.c usr.out
4602 echo "and you're compiling with the $mips_type compiler and libraries."
4606 echo "Doesn't look like a MIPS system."
4616 case "$xxx_prompt" in
4619 rp='Where are the include files you want to use?'
4627 : see how we invoke the C preprocessor
4629 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4630 cat <<'EOT' >testcpp.c
4636 if test ! -f cppstdin; then
4637 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4638 # AIX cc -E doesn't show the absolute headerfile
4639 # locations but we'll cheat by using the -M flag.
4640 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
4642 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4645 echo "Keeping your $hint cppstdin wrapper."
4648 wrapper=`pwd`/cppstdin
4652 if $test "X$cppstdin" != "X" && \
4653 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4654 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4656 echo "You used to use $cppstdin $cppminus so we'll use that again."
4658 '') echo "But let's see if we can live without a wrapper..." ;;
4660 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4661 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4663 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4666 echo "(However, $cpprun $cpplast does not work, let's see...)"
4674 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4681 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4682 $cc -E <testcpp.c >testcpp.out 2>&1; \
4683 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4684 echo "Yup, it does."
4687 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4688 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4689 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4690 echo "Yup, it does."
4693 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4694 $cc -P <testcpp.c >testcpp.out 2>&1; \
4695 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4696 echo "Yipee, that works!"
4699 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4700 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4701 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4702 echo "At long last!"
4705 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4706 $cpp <testcpp.c >testcpp.out 2>&1; \
4707 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4711 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4712 $cpp - <testcpp.c >testcpp.out 2>&1; \
4713 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4714 echo "Hooray, it works! I was beginning to wonder."
4717 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4718 $wrapper <testcpp.c >testcpp.out 2>&1; \
4719 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4725 rp="No dice. I can't find a C preprocessor. Name one:"
4729 $x_cpp <testcpp.c >testcpp.out 2>&1
4730 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4731 echo "OK, that will do." >&4
4733 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4748 echo "Perhaps can we force $cc -E using a wrapper..."
4749 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4750 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4756 echo "Nope, we'll have to live without it..."
4770 "$wrapper"|'cppstdin') ;;
4771 *) $rm -f $wrapper;;
4773 $rm -f testcpp.c testcpp.out
4775 : Set private lib path
4778 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4783 '') dlist="$loclibpth $plibpth $glibpth";;
4784 *) dlist="$libpth";;
4787 : Now check and see which directories actually exist, avoiding duplicates
4791 if $test -d $xxx; then
4794 *) libpth="$libpth $xxx";;
4800 Some systems have incompatible or broken versions of libraries. Among
4801 the directories listed in the question below, please remove any you
4802 know not to be holding relevant libraries, and add any that are needed.
4803 Say "none" for none.
4814 rp="Directories to use for library searches?"
4821 : compute shared library extension
4824 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4834 On some systems, shared libraries may be available. Answer 'none' if
4835 you want to suppress searching of shared libraries for the remainder
4836 of this configuration.
4839 rp='What is the file extension used for shared libraries?'
4843 : Define several unixisms.
4844 : Hints files or command line option can be used to override them.
4845 : The convoluted testing is in case hints files set either the old
4848 '') case "$exe_ext" in
4850 *) _exe="$exe_ext" ;;
4855 '') case "$lib_ext" in
4862 '') case "$obj_ext" in
4869 '') case "$path_sep" in
4880 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4882 : Which makefile gets called first. This is used by make depend.
4883 case "$firstmakefile" in
4884 '') firstmakefile='makefile';;
4887 : Check for uselongdouble support
4889 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4892 case "$uselongdouble" in
4893 $define|true|[yY]*) dflt='y';;
4898 Perl can be built to take advantage of long doubles which
4899 (if available) may give more accuracy and range for floating point numbers.
4901 If this doesn't make any sense to you, just accept the default '$dflt'.
4903 rp='Try to use long doubles if available?'
4906 y|Y) val="$define" ;;
4912 case "$uselongdouble" in
4913 true|[yY]*) uselongdouble="$define" ;;
4916 : Look for a hint-file generated 'call-back-unit'. If the
4917 : user has specified that long doubles should be used,
4918 : we may need to set or change some other defaults.
4919 if $test -f uselongdouble.cbu; then
4920 echo "Your platform has some specific hints regarding long doubles, using them..."
4921 . ./uselongdouble.cbu
4923 case "$uselongdouble" in
4926 (Your platform does not have any specific hints for long doubles.)
4932 : Looking for optional libraries
4934 echo "Checking for optional libraries..." >&4
4939 case "$libswanted" in
4940 '') libswanted='c_s';;
4943 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4949 for thisdir in $libpth $xlibpth; do
4950 test -d $thisdir && libspath="$libspath $thisdir"
4952 for thislib in $libswanted; do
4953 for thisdir in $libspath; do
4955 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4956 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4957 $test -f "$xxx" && eval $libscheck
4958 $test -f "$xxx" && libstyle=shared
4960 if test ! -f "$xxx"; then
4961 xxx=$thisdir/lib$thislib.$so
4962 $test -f "$xxx" && eval $libscheck
4963 $test -f "$xxx" && libstyle=shared
4965 if test ! -f "$xxx"; then
4966 xxx=$thisdir/lib$thislib$_a
4967 $test -f "$xxx" && eval $libscheck
4968 $test -f "$xxx" && libstyle=static
4970 if test ! -f "$xxx"; then
4971 xxx=$thisdir/$thislib$_a
4972 $test -f "$xxx" && eval $libscheck
4973 $test -f "$xxx" && libstyle=static
4975 if test ! -f "$xxx"; then
4976 xxx=$thisdir/lib${thislib}_s$_a
4977 $test -f "$xxx" && eval $libscheck
4978 $test -f "$xxx" && libstyle=static
4979 $test -f "$xxx" && thislib=${thislib}_s
4981 if test ! -f "$xxx"; then
4982 xxx=$thisdir/Slib$thislib$_a
4983 $test -f "$xxx" && eval $libscheck
4984 $test -f "$xxx" && libstyle=static
4986 if $test -f "$xxx"; then
4988 shared) echo "Found -l$thislib (shared)." ;;
4989 static) echo "Found -l$thislib." ;;
4990 *) echo "Found -l$thislib ($libstyle)." ;;
4994 *) dflt="$dflt -l$thislib"
4995 libsfound="$libsfound $xxx"
4997 libsfiles="$libsfiles $yyy"
4998 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4999 case " $libsdirs " in
5001 *) libsdirs="$libsdirs $yyy" ;;
5008 if $test ! -f "$xxx"; then
5009 echo "No -l$thislib."
5020 ' '|'') dflt='none';;
5025 In order to compile $package on your machine, a number of libraries
5026 are usually needed. Include any other special libraries here as well.
5027 Say "none" for none. The default list is almost always right.
5031 rp="What libraries to use?"
5038 : determine optimization, if desired, or use for debug flag also
5040 ' '|$undef) dflt='none';;
5042 *) dflt="$optimize";;
5046 By default, $package compiles with the -O flag to use the optimizer.
5047 Alternately, you might want to use the symbolic debugger, which uses
5048 the -g flag (on traditional Unix systems). Either flag can be
5049 specified here. To use neither flag, specify the word "none".
5052 rp="What optimizer/debugger flag should be used?"
5056 'none') optimize=" ";;
5059 : Check what DEBUGGING is required from the command line
5060 : -DEBUGGING or -DDEBUGGING or
5061 : -DEBUGGING=both = -g + -DDEBUGGING
5062 : -DEBUGGING=-g or -Doptimize=-g = -g
5063 : -DEBUGGING=none or -UDEBUGGING =
5064 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5067 *) DEBUGGING=$EBUGGING ;;
5070 case "$DEBUGGING" in
5074 *) optimize="$optimize -g" ;;
5078 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5086 case "$DEBUGGING" in
5087 both|$define) dflt='-DDEBUGGING'
5090 : argument order is deliberate, as the flag will start with - which set could
5091 : think is an option
5092 checkccflag='check=$1; flag=$2; callback=$3;
5094 echo "Checking if your compiler accepts $flag" 2>&1;
5095 echo "int main(void) { return 0; }" > gcctest.c;
5096 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5097 echo "Yes, it does." 2>&1;
5098 if $test -s gcctest.out ; then
5099 echo "But your platform does not like it:";
5104 echo "Leaving current flags $ccflags alone." 2>&1
5106 *) dflt="$dflt $flag";
5112 echo "Nope, it does not, but that is ok." 2>&1;
5116 : We will not override a previous value, but we might want to
5117 : augment a hint file
5119 default|recommended)
5120 case "$gccversion" in
5121 1*) dflt="$dflt -fpcc-struct-return" ;;
5123 case "$optimize:$DEBUGGING" in
5124 *-g*:old) dflt="$dflt -DDEBUGGING";;
5126 case "$gccversion" in
5127 2*) if $test -d /etc/conf/kconfig.d &&
5128 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5130 # Interactive Systems (ISC) POSIX mode.
5135 case "$gccversion" in
5138 ?*) set strict-aliasing -fno-strict-aliasing
5142 # For gcc, adding -pipe speeds up compilations for some, but apparently
5143 # some assemblers can't read from stdin. (It also slows down compilations
5144 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5145 case "$gccversion" in
5151 # on x86_64 (at least) we require an extra library (libssp) in the
5152 # link command line. This library is not named, so I infer that it is
5153 # an implementation detail that may change. Hence the safest approach
5154 # is to add the flag to the flags passed to the compiler at link time,
5155 # as that way the compiler can do the right implementation dependant
5157 case "$gccversion" in
5158 ?*) set stack-protector -fstack-protector
5165 case "$mips_type" in
5166 *BSD*|'') inclwanted="$locincpth $usrinc";;
5167 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5169 for thisincl in $inclwanted; do
5170 if $test -d $thisincl; then
5171 if $test x$thisincl != x$usrinc; then
5173 *" -I$thisincl "*);;
5174 *) dflt="$dflt -I$thisincl ";;
5180 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5182 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5190 *) dflt="$dflt -D$2";;
5194 set signal.h LANGUAGE_C; eval $inctest
5198 ccflags="$ccflags -DSOCKS"
5203 default|recommended) dflt="$ccflags $dflt" ;;
5204 *) dflt="$ccflags";;
5213 Your C compiler may want other flags. For this question you should include
5214 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5215 but you should NOT include libraries or ld flags like -lwhatever. If you
5216 want $package to honor its debug switch, you should include -DDEBUGGING here.
5217 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5219 To use no flags, specify the word "none".
5225 rp="Any additional cc flags?"
5232 : the following weeds options from ccflags that are of no interest to cpp
5234 '') cppflags="$ccflags" ;;
5235 *) cppflags="$cppflags $ccflags" ;;
5237 case "$gccversion" in
5238 1*) cppflags="$cppflags -D__GNUC__"
5240 case "$mips_type" in
5242 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5248 echo "Let me guess what the preprocessor flags are..." >&4
5262 *) ftry="$previous $flag";;
5264 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5265 >cpp1.out 2>/dev/null && \
5266 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5267 >cpp2.out 2>/dev/null && \
5268 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5269 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5271 cppflags="$cppflags $ftry"
5281 *-*) echo "They appear to be: $cppflags";;
5283 $rm -f cpp.c cpp?.out
5287 : flags used in final linking phase
5289 '') if ./venix; then
5295 *-posix*) dflt="$dflt -posix" ;;
5298 *) dflt="$ldflags";;
5300 # See note above about -fstack-protector
5302 *-fstack-protector*)
5304 *-fstack-protector*) ;; # Don't add it again
5305 *) dflt="$dflt -fstack-protector" ;;
5310 : Try to guess additional flags to pick up local libraries.
5311 for thislibdir in $libpth; do
5312 case " $loclibpth " in
5315 *"-L$thislibdir "*) ;;
5316 *) dflt="$dflt -L$thislibdir" ;;
5328 Your C linker may need flags. For this question you should
5329 include -L/whatever and any other flags used by the C linker, but you
5330 should NOT include libraries like -lwhatever.
5332 Make sure you include the appropriate -L/path flags if your C linker
5333 does not normally search all of the directories you specified above,
5336 To use no flags, specify the word "none".
5340 rp="Any additional ld flags (NOT including libraries)?"
5346 rmlist="$rmlist pdp11"
5350 echo "Checking your choice of C compiler and flags for coherency..." >&4
5351 $cat > try.c <<'EOF'
5353 int main() { printf("Ok\n"); return(0); }
5355 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5357 $cat >try.msg <<'EOM'
5358 I've tried to compile and run the following simple program:
5361 $cat try.c >> try.msg
5363 $cat >> try.msg <<EOM
5370 and I got the following output:
5374 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5375 if $sh -c "$run ./try " >>try.msg 2>&1; then
5379 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5382 cat >> try.msg <<'EOQS'
5383 If $libs contains -lsfio, and sfio is mis-configured, then it
5384 sometimes (apparently) runs and exits with a 0 status, but with no
5385 output! It may have to do with sfio's use of _exit vs. exit.
5388 rp="You have a big problem. Shall I abort Configure"
5395 echo "The program compiled OK, but exited with status $?." >>try.msg
5396 rp="You have a problem. Shall I abort Configure"
5400 echo "I can't compile the test program." >>try.msg
5401 rp="You have a BIG problem. Shall I abort Configure"
5407 case "$knowitall" in
5409 echo "(The supplied flags or libraries might be incorrect.)"
5417 *) echo "Ok. Stopping Configure." >&4
5422 n) echo "OK, that should do.";;
5424 $rm_try gcctest gcctest.out
5426 : define a shorthand compile call
5430 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5431 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5435 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5436 : define a shorthand compile call for compilations that should be ok.
5440 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5442 : determine filename position in cpp output
5444 echo "Computing filename position in cpp output for #include directives..." >&4
5446 vos) testaccess=-e ;;
5449 echo '#include <stdio.h>' > foo.c
5452 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5453 $grep '^[ ]*#.*stdio\.h' | \
5454 while read cline; do
5457 while $test \$# -gt 0; do
5458 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5463 pos=\`expr \$pos + 1\`
5475 *) pos="${fieldn}th";;
5477 echo "Your cpp writes the filename in the $pos field of the line."
5480 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5481 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5484 : locate header file
5489 for usrincdir in $usrinc
5491 if test -f \$usrincdir/\$wanted; then
5492 echo "\$usrincdir/\$wanted"
5496 awkprg='{ print \$$fieldn }'
5497 echo "#include <\$wanted>" > foo\$\$.c
5498 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5499 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5500 while read cline; do
5501 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5503 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5504 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5509 # status = 0: grep returned 0 lines, case statement not executed
5510 # status = 1: headerfile found
5511 # status = 2: while loop executed, no headerfile found
5515 if test \$status -eq 1; then
5522 : define an alternate in-header-list? function
5523 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5524 cont=true; xxf="echo \"<\$1> found.\" >&4";
5525 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5526 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5528 case $# in 4) instead=instead;; *) instead="at last";; esac;
5529 while $test "$cont"; do
5531 var=$2; eval "was=\$$2";
5532 if $test "$xxx" && $test -r "$xxx";
5534 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5537 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5538 set $yyy; shift; shift; yyy=$@;
5539 case $# in 0) cont="";;
5540 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5541 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5542 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5543 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5547 do set $yyy; var=$2; eval "was=\$$2";
5548 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5549 set $yyy; shift; shift; yyy=$@;
5552 : see if stdlib is available
5553 set stdlib.h i_stdlib
5556 : check for lengths of integral types
5560 echo "Checking to see how big your integers are..." >&4
5569 printf("intsize=%d;\n", (int)sizeof(int));
5570 printf("longsize=%d;\n", (int)sizeof(long));
5571 printf("shortsize=%d;\n", (int)sizeof(short));
5576 if eval $compile_ok && $run ./try > /dev/null; then
5578 echo "Your integers are $intsize bytes long."
5579 echo "Your long integers are $longsize bytes long."
5580 echo "Your short integers are $shortsize bytes long."
5584 Help! I can't compile and run the intsize test program: please enlighten me!
5585 (This is probably a misconfiguration in your system or libraries, and
5586 you really ought to fix it. Still, I'll try anyway.)
5590 rp="What is the size of an integer (in bytes)?"
5594 rp="What is the size of a long integer (in bytes)?"
5598 rp="What is the size of a short integer (in bytes)?"
5606 : check for long long
5608 echo "Checking to see if you have long long..." >&4
5609 echo 'int main() { long long x = 7; return 0; }' > try.c
5611 if eval $compile; then
5613 echo "You have long long."
5616 echo "You do not have long long."
5622 : check for length of long long
5623 case "${d_longlong}${longlongsize}" in
5626 echo "Checking to see how big your long longs are..." >&4
5627 $cat >try.c <<'EOCP'
5631 printf("%d\n", (int)sizeof(long long));
5636 if eval $compile_ok; then
5637 longlongsize=`$run ./try`
5638 echo "Your long longs are $longlongsize bytes long."
5642 echo "(I can't seem to compile the test program. Guessing...)"
5643 rp="What is the size of a long long (in bytes)?"
5647 if $test "X$longsize" = "X$longlongsize"; then
5648 echo "(That isn't any different from an ordinary long.)"
5654 : see if inttypes.h is available
5655 : we want a real compile instead of Inhdr because some systems
5656 : have an inttypes.h which includes non-existent headers
5659 #include <inttypes.h>
5661 static int32_t foo32 = 0x12345678;
5665 if eval $compile; then
5666 echo "<inttypes.h> found." >&4
5669 echo "<inttypes.h> NOT found." >&4
5678 echo "Checking to see if you have int64_t..." >&4
5680 #include <sys/types.h>
5681 #$i_inttypes I_INTTYPES
5683 #include <inttypes.h>
5685 int main() { int64_t x = 7; }
5688 if eval $compile; then
5690 echo "You have int64_t."
5693 echo "You do not have int64_t."
5699 : Check if 64bit ints have a quad type
5701 echo "Checking which 64-bit integer type we could use..." >&4
5707 val='"unsigned int"'
5712 *) case "$longsize" in
5716 val='"unsigned long"'
5721 *) case "$d_longlong:$longlongsize" in
5726 val='"unsigned long long"'
5731 *) case "$d_int64_t" in
5750 '') echo "Alas, no 64-bit integer types in sight." >&4
5753 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5758 : Do we want 64bit support
5759 case "$uselonglong" in
5760 "$define"|true|[yY]*)
5763 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5765 use64bitint="$define"
5768 case "$use64bits" in
5769 "$define"|true|[yY]*)
5772 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5774 use64bitint="$define"
5777 case "$use64bitints" in
5778 "$define"|true|[yY]*)
5781 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5783 use64bitint="$define"
5786 case "$use64bitsint" in
5787 "$define"|true|[yY]*)
5790 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5792 use64bitint="$define"
5795 case "$uselonglongs" in
5796 "$define"|true|[yY]*)
5799 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5801 use64bitint="$define"
5804 case "$use64bitsall" in
5805 "$define"|true|[yY]*)
5808 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5810 use64bitall="$define"
5815 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5817 case "$use64bitall" in
5818 "$define"|true|[yY]*) use64bitint="$define" ;;
5824 You have natively 64-bit long integers.
5828 *) case "$use64bitint" in
5829 "$define"|true|[yY]*) dflt='y';;
5838 Perl can be built to take advantage of 64-bit integer types
5839 on some systems. To do so, Configure can be run with -Duse64bitint.
5840 Choosing this option will most probably introduce binary incompatibilities.
5842 If this doesn't make any sense to you, just accept the default '$dflt'.
5843 (The default has been chosen based on your configuration.)
5845 rp='Try to use 64-bit integers, if available?'
5848 [yY]*) val="$define" ;;
5856 case "$use64bitall" in
5857 "$define"|true|[yY]*) dflt='y' ;;
5858 *) case "$longsize" in
5866 You may also choose to try maximal 64-bitness. It means using as much
5867 64-bitness as possible on the platform. This in turn means even more
5868 binary incompatibilities. On the other hand, your platform may not
5869 have any more 64-bitness available than what you already have chosen.
5871 If this doesn't make any sense to you, just accept the default '$dflt'.
5872 (The default has been chosen based on your configuration.)
5874 rp='Try to use maximal 64-bit support, if available?'
5877 [yY]*) val="$define" ;;
5882 case "$use64bitall" in
5884 case "$use64bitint" in
5888 Since you have chosen a maximally 64-bit build, I'm also turning on
5889 the use of 64-bit integers.
5891 use64bitint="$define" ;;
5896 : Look for a hint-file generated 'call-back-unit'. If the
5897 : user has specified that a 64-bit perl is to be built,
5898 : we may need to set or change some other defaults.
5899 if $test -f use64bitint.cbu; then
5900 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5903 case "$use64bitint" in
5904 "$define"|true|[yY]*)
5906 4) case "$archname64" in
5907 '') archname64=64int ;;
5914 : Look for a hint-file generated 'call-back-unit'. If the
5915 : user has specified that a maximally 64-bit perl is to be built,
5916 : we may need to set or change some other defaults.
5917 if $test -f use64bitall.cbu; then
5918 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5921 case "$use64bitall" in
5922 "$define"|true|[yY]*)
5924 4) case "$archname64" in
5925 ''|64int) archname64=64all ;;
5932 case "$d_quad:$use64bitint" in
5936 *** You have chosen to use 64-bit integers,
5937 *** but none can be found.
5938 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5939 *** Cannot continue, aborting.
5946 : check for length of double
5948 case "$doublesize" in
5950 echo "Checking to see how big your double precision numbers are..." >&4
5959 printf("%d\n", (int)sizeof(double));
5964 if eval $compile_ok; then
5965 doublesize=`$run ./try`
5966 echo "Your double is $doublesize bytes long."
5969 echo "(I can't seem to compile the test program. Guessing...)"
5970 rp="What is the size of a double precision number (in bytes)?"
5978 : check for long doubles
5980 echo "Checking to see if you have long double..." >&4
5981 echo 'int main() { long double x = 7.0; }' > try.c
5983 if eval $compile; then
5985 echo "You have long double."
5988 echo "You do not have long double."
5994 : check for length of long double
5995 case "${d_longdbl}${longdblsize}" in
5998 echo "Checking to see how big your long doubles are..." >&4
5999 $cat >try.c <<'EOCP'
6003 printf("%d\n", sizeof(long double));
6008 if eval $compile; then
6009 longdblsize=`$run ./try`
6010 echo "Your long doubles are $longdblsize bytes long."
6014 echo "(I can't seem to compile the test program. Guessing...)" >&4
6015 rp="What is the size of a long double (in bytes)?"
6019 if $test "X$doublesize" = "X$longdblsize"; then
6020 echo "That isn't any different from an ordinary double."
6021 echo "I'll keep your setting anyway, but you may see some"
6022 echo "harmless compilation warnings."
6028 : determine the architecture name
6030 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6031 tarch=`arch`"-$osname"
6032 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6033 if uname -m > tmparch 2>&1 ; then
6034 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6035 -e 's/$/'"-$osname/" tmparch`
6043 case "$myarchname" in
6046 echo "(Your architecture name used to be $myarchname.)"
6050 case "$targetarch" in
6052 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6057 *) dflt="$archname";;
6059 rp='What is your architecture name'
6062 case "$usethreads" in
6064 echo "Threads selected." >&4
6066 *-thread*) echo "...and architecture name already has -thread." >&4
6068 *) archname="$archname-thread"
6069 echo "...setting architecture name to $archname." >&4
6074 case "$usemultiplicity" in
6076 echo "Multiplicity selected." >&4
6078 *-multi*) echo "...and architecture name already has -multi." >&4
6080 *) archname="$archname-multi"
6081 echo "...setting architecture name to $archname." >&4
6086 case "$use64bitint$use64bitall" in
6088 case "$archname64" in
6090 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6093 case "$use64bitint" in
6094 "$define") echo "64 bit integers selected." >&4 ;;
6096 case "$use64bitall" in
6097 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6100 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6102 *) archname="$archname-$archname64"
6103 echo "...setting architecture name to $archname." >&4
6109 case "$uselongdouble" in
6111 echo "Long doubles selected." >&4
6112 case "$longdblsize" in
6114 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6118 *-ld*) echo "...and architecture name already has -ld." >&4
6120 *) archname="$archname-ld"
6121 echo "...setting architecture name to $archname." >&4
6128 case "$useperlio" in
6130 echo "Perlio selected." >&4
6133 echo "Perlio not selected, using stdio." >&4
6135 *-stdio*) echo "...and architecture name already has -stdio." >&4
6137 *) archname="$archname-stdio"
6138 echo "...setting architecture name to $archname." >&4
6143 if $test -f archname.cbu; then
6144 echo "Your platform has some specific hints for architecture name, using them..."
6148 : set the prefixit variable, to compute a suitable default value
6149 prefixit='case "$3" in
6151 case "$oldprefix" in
6152 "") eval "$1=\"\$$2\"";;
6159 ""|" ") eval "$1=\"\$$2\"";;
6165 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6167 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6168 /*-$oldprefix/*|\~*-$oldprefix/*)
6169 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6170 *) eval "$1=\"\$$2\"";;
6174 : determine installation style
6175 : For now, try to deduce it from prefix unless it is already set.
6176 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6177 case "$installstyle" in
6178 '') case "$prefix" in
6179 *perl*) dflt='lib';;
6180 *) dflt='lib/perl5' ;;
6183 *) dflt="$installstyle" ;;
6185 : Probably not worth prompting for this since we prompt for all
6186 : the directories individually, and the prompt would be too long and
6190 : determine where public executables go
6195 rp='Pathname where the public executables will reside?'
6197 if $test "X$ansexp" != "X$binexp"; then
6201 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6202 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6203 : this via initialinstalllocation
6206 case "$userelocatableinc" in
6207 $define|true|[yY]*) dflt='y' ;;
6212 Would you like to build Perl so that the installation is relocatable, so that
6213 library paths in @INC are determined relative to the path of the perl binary?
6214 This is not advised for system Perl installs, or if you need to run setid
6215 scripts or scripts under taint mode.
6217 If this doesn't make any sense to you, just accept the default '$dflt'.
6219 rp='Use relocatable @INC?'
6222 y|Y) val="$define" ;;
6225 set userelocatableinc
6228 initialinstalllocation="$binexp"
6229 : Default prefix is now "up one level from where the binaries are"
6230 case "$userelocatableinc" in
6236 installprefixexp=".../.."
6240 : determine where private library files go
6241 : Usual default is /usr/local/lib/perl5/$version.
6242 : Also allow things like /opt/perl/lib/$version, since
6243 : /opt/perl/lib/perl5... would be redundant.
6244 : The default "style" setting is made in installstyle.U
6245 case "$installstyle" in
6246 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6247 *) set dflt privlib lib/$version ;;
6252 There are some auxiliary files for $package that need to be put into a
6253 private library directory that is accessible by everyone.
6258 rp='Pathname where the private library files will reside?'
6263 : set the prefixup variable, to restore leading tilda escape
6264 prefixup='case "$prefixexp" in
6266 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6269 : determine where public architecture dependent libraries go
6272 : privlib default is /usr/local/lib/$package/$version
6273 : archlib default is /usr/local/lib/$package/$version/$archname
6274 : privlib may have an optional trailing /share.
6275 tdflt=`echo $privlib | $sed 's,/share$,,'`
6276 tdflt=$tdflt/$archname
6285 $spackage contains architecture-dependent library files. If you are
6286 sharing libraries in a heterogeneous environment, you might store
6287 these files in a separate location. Otherwise, you can just include
6288 them with the rest of the public library files.
6293 rp='Where do you want to put the public architecture-dependent libraries?'
6297 if $test X"$archlib" = X"$privlib"; then
6303 : see if setuid scripts can be secure
6306 Some kernels have a bug that prevents setuid #! scripts from being
6307 secure. Some sites have disabled setuid #! scripts because of this.
6309 First let's decide if your kernel supports secure setuid #! scripts.
6310 (If setuid #! scripts would be secure but have been disabled anyway,
6311 don't say that they are secure if asked.)
6316 if $test -d /dev/fd; then
6317 echo "#!$ls" >reflect
6318 chmod +x,u+s reflect
6319 ./reflect >flect 2>&1
6320 if $contains "/dev/fd" flect >/dev/null; then
6321 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6325 If you are not sure if they are secure, I can check but I'll need a
6326 username and password different from the one you are using right now.
6327 If you don't have such a username or don't want me to test, simply
6331 rp='Other username to test security of setuid scripts with?'
6336 case "$d_suidsafe" in
6337 '') echo "I'll assume setuid scripts are *not* secure." >&4
6340 echo "Well, the $hint value is *not* secure." >&4
6342 *) echo "Well, the $hint value *is* secure." >&4
6347 $rm -f reflect flect
6348 echo "#!$ls" >reflect
6349 chmod +x,u+s reflect
6352 echo '"su" will (probably) prompt you for '"$ans's password."
6353 su $ans -c './reflect >flect'
6354 if $contains "/dev/fd" flect >/dev/null; then
6355 echo "Okay, it looks like setuid scripts are secure." >&4
6358 echo "I don't think setuid scripts are secure." >&4
6363 rp='Does your kernel have *secure* setuid scripts?'
6366 [yY]*) val="$define";;
6371 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6372 echo "(That's for file descriptors, not floppy disks.)"
6378 $rm -f reflect flect
6380 : now see if they want to do setuid emulation
6381 if $test $patchlevel -lt 11; then
6384 case "$d_suidsafe" in
6387 echo "No need to emulate SUID scripts since they are secure here." >&4
6391 Some systems have disabled setuid scripts, especially systems where
6392 setuid scripts cannot be secure. On systems where setuid scripts have
6393 been disabled, the setuid/setgid bits on scripts are currently
6394 useless. It is possible for $package to detect those bits and emulate
6395 setuid/setgid in a secure fashion. This emulation will only work if
6396 setuid scripts have been disabled in your kernel.
6400 "$define") dflt=y ;;
6403 rp="Do you want to do setuid/setgid emulation?"
6406 [yY]*) val="$define";;
6418 SUID emulation has been removed for 5.12
6419 Please re-run Configure without -Dd_dosuid
6428 : Find perl5.005 or later.
6429 echo "Looking for a previously installed perl5.005 or later... "
6431 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6432 : Check if this perl is recent and can load a simple module
6433 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6436 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6446 '') echo "None found. That's ok.";;
6447 *) echo "Using $perl5." ;;
6450 : Set the siteprefix variables
6453 After $package is installed, you may wish to install various
6454 add-on modules and utilities. Typically, these add-ons will
6455 be installed under $prefix with the rest
6456 of this package. However, you may wish to install such add-ons
6457 elsewhere under a different prefix.
6459 If you do not wish to put everything under a single prefix, that's
6460 ok. You will be prompted for the individual locations; this siteprefix
6461 is only used to suggest the defaults.
6463 The default should be fine for most people.
6467 rp='Installation prefix to use for add-on modules and utilities?'
6468 : XXX Here might be another good place for an installstyle setting.
6469 case "$siteprefix" in
6471 *) dflt=$siteprefix ;;
6474 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6476 case "$siteprefix" in
6480 *) oldsiteprefix="$prefix";;
6485 siteprefixexp="$ansexp"
6487 : determine where site specific libraries go.
6488 : Usual default is /usr/local/lib/perl5/site_perl/$version
6489 : The default "style" setting is made in installstyle.U
6490 : XXX No longer works with Prefixit stuff.
6491 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6493 '') case "$installstyle" in
6494 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6495 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6503 The installation process will create a directory for
6504 site-specific extensions and modules. Most users find it convenient
6505 to place all site-specific files in this directory rather than in the
6506 main distribution directory.
6510 rp='Pathname for the site-specific library files?'
6514 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6516 : Determine list of previous versions to include in @INC
6517 $cat > getverlist <<EOPL
6520 \$api_versionstring = "$api_versionstring";
6521 \$version = "$version";
6522 \$stem = "$sitelib_stem";
6523 \$archname = "$archname";
6525 $cat >> getverlist <<'EOPL'
6526 # The list found is store twice for each entry: the original name, and
6527 # the binary broken down version as pack "sss", so sorting is easy and
6528 # unambiguous. This will work for all versions that have a maximum of
6529 # three digit groups, separate by '.'s or '_'s. Names are extended with
6530 # ".0.0" to ensure at least three elements for the pack.
6531 # -- H.Merijn Brand (m)'06 23-10-2006
6533 # Can't have leading @ because metaconfig interprets it as a command!
6534 ;@inc_version_list=();
6535 # XXX Redo to do opendir/readdir?
6538 ;@candidates = map {
6539 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6540 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
6546 ($pversion, $aversion, $vsn5005) = map {
6547 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6548 foreach $d (@candidates) {
6549 if ($d->[1] lt $pversion) {
6550 if ($d->[1] ge $aversion) {
6551 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6553 elsif ($d->[1] ge $vsn5005) {
6554 unshift(@inc_version_list, grep { -d } $d->[0]);
6558 # Skip newer version. I.e. don't look in
6559 # 5.7.0 if we're installing 5.6.1.
6563 if (@inc_version_list) {
6564 print join(' ', @inc_version_list);
6567 # Blank space to preserve value for next Configure run.
6572 case "$inc_version_list" in
6573 '') if test -x "$perl5$exe_ext"; then
6574 dflt=`$perl5 getverlist`
6579 $undef) dflt='none' ;;
6580 *) eval dflt=\"$inc_version_list\" ;;
6583 ''|' ') dflt=none ;;
6590 In order to ease the process of upgrading, this version of perl
6591 can be configured to use modules built and installed with earlier
6592 versions of perl that were installed under $prefix. Specify here
6593 the list of earlier versions that this version of perl should check.
6594 If Configure detected no earlier versions of perl installed under
6595 $prefix, then the list will be empty. Answer 'none' to tell perl
6596 to not search earlier versions.
6598 The default should almost always be sensible, so if you're not sure,
6599 just accept the default.
6602 rp='List of earlier versions to include in @INC?'
6605 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6606 *) inc_version_list="$ans" ;;
6608 case "$inc_version_list" in
6610 inc_version_list_init='0'
6611 d_inc_version_list="$undef"
6613 *) inc_version_list_init=`echo $inc_version_list |
6614 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6615 d_inc_version_list="$define"
6620 : see if malloc/malloc.h has to be included
6621 set malloc/malloc.h i_mallocmalloc
6624 : see if this is a malloc.h system
6625 : we want a real compile instead of Inhdr because some systems have a
6626 : malloc.h that just gives a compile error saying to use stdlib.h instead
6631 #$i_mallocmalloc I_MALLOCMALLOC
6632 #ifdef I_MALLOCMALLOC
6633 # include <malloc/malloc.h>
6636 int main () { return 0; }
6639 if eval $compile; then
6640 echo "<malloc.h> found." >&4
6643 echo "<malloc.h> NOT found." >&4
6650 : check for void type
6652 echo "Checking to see how well your C compiler groks the void type..." >&4
6653 case "$voidflags" in
6665 extern void moo(); /* function returning void */
6666 void (*goo)(); /* ptr to func returning void */
6668 void *hue; /* generic ptr */
6681 int main() { sub(); }
6683 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6684 voidflags=$defvoidused
6685 echo "Good. It appears to support void to the level $package wants.">&4
6686 if $contains warning .out >/dev/null 2>&1; then
6687 echo "However, you might get some warnings that look like this:"
6691 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6692 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6693 echo "It supports 1..."
6694 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6695 echo "It also supports 2..."
6696 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6698 echo "And it supports 4 but not 8 definitely."
6700 echo "It doesn't support 4..."
6701 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6703 echo "But it supports 8."
6706 echo "Neither does it support 8."
6710 echo "It does not support 2..."
6711 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6713 echo "But it supports 4 and 8."
6715 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6717 echo "And it supports 4 but has not heard about 8."
6719 echo "However it supports 8 but not 4."
6724 echo "There is no support at all for void."
6729 case "$voidflags" in
6732 Support flag bits are:
6733 1: basic void declarations.
6734 2: arrays of pointers to functions returning void.
6735 4: operations between pointers to and addresses of void functions.
6736 8: generic void pointers.
6739 rp="Your void support flags add up to what?"
6746 : check for length of pointer
6750 echo "Checking to see how big your pointers are..." >&4
6751 if test "$voidflags" -gt 7; then
6752 echo '#define VOID_PTR char *' > try.c
6754 echo '#define VOID_PTR void *' > try.c
6764 printf("%d\n", (int)sizeof(VOID_PTR));
6769 if eval $compile_ok; then
6770 ptrsize=`$run ./try`
6771 echo "Your pointers are $ptrsize bytes long."
6774 echo "(I can't seem to compile the test program. Guessing...)" >&4
6775 rp="What is the size of a pointer (in bytes)?"
6782 case "$use64bitall" in
6783 "$define"|true|[yY]*)
6787 *** You have chosen a maximally 64-bit build,
6788 *** but your pointers are only 4 bytes wide.
6789 *** Please rerun Configure without -Duse64bitall.
6794 *** Since you have quads, you could possibly try with -Duse64bitint.
6799 *** Cannot continue, aborting.
6810 : determine whether to use malloc wrapping
6812 case "$usemallocwrap" in
6813 [yY]*|true|$define) dflt='y' ;;
6814 [nN]*|false|$undef) dflt='n' ;;
6815 *) case "$usedevel" in
6816 [yY]*|true|$define) dflt='y' ;;
6821 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6823 usemallocwrap="$ans"
6826 usemallocwrap="$define" ;;
6828 usemallocwrap="$undef" ;;
6831 : determine which malloc to compile in
6833 case "$usemymalloc" in
6834 [yY]*|true|$define) dflt='y' ;;
6835 [nN]*|false|$undef) dflt='n' ;;
6836 *) case "$ptrsize" in
6842 rp="Do you wish to attempt to use the malloc that comes with $package?"
6848 mallocsrc='malloc.c'
6849 mallocobj="malloc$_o"
6850 d_mymalloc="$define"
6853 : Remove malloc from list of libraries to use
6854 echo "Removing unneeded -lmalloc from library list" >&4
6855 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6858 echo "libs = $libs" >&4
6870 : compute the return types of malloc and free
6872 $cat >malloc.c <<END
6876 #include <sys/types.h>
6890 case "$malloctype" in
6892 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6899 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6903 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6910 echo "Your system uses $freetype free(), it would seem." >&4
6912 : determine where site specific architecture-dependent libraries go.
6913 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6914 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6915 : sitelib may have an optional trailing /share.
6917 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6918 dflt="$dflt/$archname"
6923 set sitearch sitearch none
6927 The installation process will also create a directory for
6928 architecture-dependent site-specific extensions and modules.
6932 rp='Pathname for the site-specific architecture-dependent library files?'
6936 if $test X"$sitearch" = X"$sitelib"; then
6939 d_sitearch="$define"
6942 : Set the vendorprefix variables
6945 The installation process will also create a directory for
6946 vendor-supplied add-ons. Vendors who supply perl with their system
6947 may find it convenient to place all vendor-supplied files in this
6948 directory rather than in the main distribution directory. This will
6949 ease upgrades between binary-compatible maintenance versions of perl.
6951 Of course you may also use these directories in whatever way you see
6952 fit. For example, you might use them to access modules shared over a
6953 company-wide network.
6955 The default answer should be fine for most people.
6956 This causes further questions about vendor add-ons to be skipped
6957 and no vendor-specific directories will be configured for perl.
6960 rp='Do you want to configure vendor-specific add-on directories?'
6961 case "$usevendorprefix" in
6962 define|true|[yY]*) dflt=y ;;
6963 *) : User may have set vendorprefix directly on Configure command line.
6964 case "$vendorprefix" in
6973 rp='Installation prefix to use for vendor-supplied add-ons?'
6974 case "$vendorprefix" in
6976 *) dflt=$vendorprefix ;;
6979 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6981 case "$vendorprefix" in
6985 *) oldvendorprefix="$prefix";;
6989 usevendorprefix="$define"
6991 vendorprefixexp="$ansexp"
6993 *) usevendorprefix="$undef"
6999 : Set the vendorlib variables
7000 case "$vendorprefix" in
7001 '') d_vendorlib="$undef"
7005 *) d_vendorlib="$define"
7006 : determine where vendor-supplied modules go.
7007 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7008 case "$vendorlib" in
7010 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7011 case "$installstyle" in
7012 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7013 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7016 *) dflt="$vendorlib"
7020 rp='Pathname for the vendor-supplied library files?'
7023 vendorlibexp="$ansexp"
7026 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7030 : Set the vendorarch variables
7031 case "$vendorprefix" in
7032 '') d_vendorarch="$undef"
7036 *) d_vendorarch="$define"
7037 : determine where vendor-supplied architecture-dependent libraries go.
7038 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7039 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7040 : vendorlib may have an optional trailing /share.
7041 case "$vendorarch" in
7042 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7043 dflt="$dflt/$archname"
7045 *) dflt="$vendorarch" ;;
7048 rp='Pathname for vendor-supplied architecture-dependent files?'
7051 vendorarchexp="$ansexp"
7054 prefixvar=vendorarch
7056 if $test X"$vendorarch" = X"$vendorlib"; then
7057 d_vendorarch="$undef"
7059 d_vendorarch="$define"
7062 : Final catch-all directories to search
7065 Lastly, you can have perl look in other directories for extensions and
7066 modules in addition to those already specified.
7067 These directories will be searched after
7071 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7072 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7074 case "$otherlibdirs" in
7075 ''|' ') dflt='none' ;;
7076 *) dflt="$otherlibdirs" ;;
7079 Enter a colon-separated set of extra paths to include in perl's @INC
7080 search path, or enter 'none' for no extra paths.
7084 rp='Colon-separated list of additional directories for perl to search?'
7087 ' '|''|none) otherlibdirs=' ' ;;
7088 *) otherlibdirs="$ans" ;;
7090 case "$otherlibdirs" in
7094 set d_perl_otherlibdirs
7097 : Cruising for prototypes
7099 echo "Checking out function prototypes..." >&4
7100 $cat >prototype.c <<EOCP
7105 int main(int argc, char *argv[]) {
7108 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7109 echo "Your C compiler appears to support function prototypes."
7112 echo "Your C compiler doesn't seem to understand function prototypes."
7119 : Check if ansi2knr is required
7120 case "$prototype" in
7122 *) ansi2knr='ansi2knr'
7127 This version of $package can only be compiled by a compiler that
7128 understands function prototypes. Unfortunately, your C compiler
7130 doesn't seem to understand them. Sorry about that.
7132 If GNU cc is available for your system, perhaps you could try that instead.
7134 Eventually, we hope to support building Perl with pre-ANSI compilers.
7135 If you would like to help in that effort, please contact <perlbug@perl.org>.
7137 Aborting Configure now.
7144 dflt_dtrace='/usr/sbin/dtrace'
7147 Perl can be built to support DTrace on platforms that support it.
7148 DTrace is a diagnosis and performance analysis tool from Sun.
7150 If this doesn't make any sense to you, just accept the default '$dflt'.
7154 case "$usedtrace" in
7160 dflt_dtrace=$usedtrace
7167 rp='Support DTrace if available?'
7170 y|Y) val="$define" ;;
7176 test "X$usedtrace" != "X$define" && break
7179 rp='Where is the dtrace executable?'
7188 if $dtrace -h -s ../perldtrace.d \
7189 -o perldtrace.tmp >/dev/null 2>&1 \
7190 && rm -f perldtrace.tmp
7193 echo "Good: your $dtrace knows about the -h flag."
7197 *** $me: Fatal Error: $dtrace doesn't support -h flag
7199 *** Your installed dtrace doesn't support the -h switch to compile a D
7200 *** program into a C header. Can't continue.
7212 *** $me: Fatal Error: $dtrace not found.
7219 echo "*** $dtrace was not found."
7225 : See if we want extra modules installed
7232 Perl can be built with extra modules or bundles of modules which
7233 will be fetched from the CPAN and installed alongside Perl.
7235 Notice that you will need access to the CPAN; either via the Internet,
7236 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7237 be asked later to configure the CPAN.pm module which will in turn do
7238 the installation of the rest of the extra modules or bundles.)
7240 Notice also that if the modules require any external software such as
7241 libraries and headers (the libz library and the zlib.h header for the
7242 Compress::Zlib module, for example) you MUST have any such software
7243 already installed, this configuration process will NOT install such
7246 If this doesn't make any sense to you, just accept the default '$dflt'.
7248 rp='Install any extra modules (y or n)?'
7254 Please list any extra modules or bundles to be installed from CPAN,
7255 with spaces between the names. The names can be in any format the
7256 'install' command of CPAN.pm will understand. (Answer 'none',
7257 without the quotes, to install no extra modules or bundles.)
7267 $rm -f ../extras.lst
7269 *) echo "(Saving the list of extras for later...)"
7270 echo "$extras" > ../extras.lst
7278 : determine where html pages for programs go
7279 set html1dir html1dir none
7283 If you wish to install html files for programs in $spackage, indicate
7284 the appropriate directory here. To skip installing html files,
7288 ''|none|$undef|' ') dflt=none ;;
7289 *) dflt=$html1dir ;;
7292 rp="Directory for the main $spackage html pages?"
7296 : Use ' ' for none so value is preserved next time through Configure
7297 $test X"$html1dir" = "X" && html1dir=' '
7299 : determine where html pages for libraries and modules go
7300 set html3dir html3dir none
7304 If you wish to install html files for modules associated with $spackage,
7305 indicate the appropriate directory here. To skip installing html files,
7308 : There is no obvious default. If they have specified html1dir, then
7309 : try to key off that, possibly changing .../html1 into .../html3.
7311 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7312 *) dflt=$html3dir ;;
7315 rp="Directory for the $spackage module html pages?"
7319 : Use ' ' for none so value is preserved next time through Configure
7320 $test X"$html3dir" = "X" && html3dir=' '
7322 : determine whether to install perl also as /usr/bin/perl
7325 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7327 Many scripts expect perl to be installed as /usr/bin/perl.
7329 If you want to, I can install the perl you are about to compile
7330 as /usr/bin/perl (in addition to $bin/perl).
7332 if test -f /usr/bin/perl; then
7335 However, please note that because you already have a /usr/bin/perl,
7336 overwriting that with a new Perl would very probably cause problems.
7337 Therefore I'm assuming you don't want to do that (unless you insist).
7340 case "$installusrbinperl" in
7341 "$define"|[yY]*) dflt='y';;
7347 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7350 case "$installusrbinperl" in
7351 "$undef"|[nN]*) dflt='n';;
7355 rp="Do you want to install perl as /usr/bin/perl?"
7358 [yY]*) val="$define";;
7364 set installusrbinperl
7367 : Check if we are using the GNU C library
7369 echo "Checking for GNU C Library..." >&4
7371 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7372 alone are insufficient to distinguish different versions, such as
7373 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7374 libc version 2.1.0. A. Dougherty, June 3, 2002.
7380 # ifdef __GLIBC_MINOR__
7381 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7382 # include <gnu/libc-version.h>
7383 printf("%s\n", gnu_get_libc_version());
7385 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7388 printf("%d\n", __GLIBC__);
7397 if eval $compile_ok && $run ./try > glibc.ver; then
7399 gnulibc_version=`$cat glibc.ver`
7400 echo "You are using the GNU C Library version $gnulibc_version"
7404 echo "You are not using the GNU C Library"
7410 : see if nm is to be used to determine whether a symbol is defined or not
7414 case "$d_gnulibc" in
7417 echo "nm probably won't work on the GNU C Library." >&4
7423 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7425 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7426 echo "'nm' won't be sufficient on this sytem." >&4
7432 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7433 if $test $dflt -gt 20; then
7443 true|$define) dflt=y;;
7450 I can use $nm to extract the symbols from your C libraries. This
7451 is a time consuming task which may generate huge output on the disk (up
7452 to 3 megabytes) but that should make the symbols extraction faster. The
7453 alternative is to skip the 'nm' extraction part and to compile a small
7454 test program instead to determine whether each symbol is present. If
7455 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7456 this may be the best solution.
7458 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7461 rp="Shall I use $nm to extract C symbols from the libraries?"
7464 [Nn]*) usenm=false;;
7473 : nm options which may be necessary
7475 '') if $test -f /mach_boot; then
7477 elif $test -d /usr/ccs/lib; then
7478 nm_opt='-p' # Solaris (and SunOS?)
7479 elif $test -f /dgux; then
7481 elif $test -f /lib64/rld; then
7482 nm_opt='-p' # 64-bit Irix
7488 : nm options which may be necessary for shared libraries but illegal
7489 : for archive libraries. Thank you, Linux.
7490 case "$nm_so_opt" in
7491 '') case "$myuname" in
7493 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7494 nm_so_opt='--dynamic'
7501 : Figure out where the libc is located
7504 : get list of predefined functions in a handy place
7509 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7515 *) for thislib in $libs; do
7518 : Handle C library specially below.
7521 thislib=`echo $thislib | $sed -e 's/^-l//'`
7522 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7524 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7526 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7528 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7530 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7532 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7534 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7539 libnames="$libnames $try"
7541 *) libnames="$libnames $thislib" ;;
7550 for xxx in $libpth; do
7551 $test -r $1 || set $xxx/libc.$so
7552 : The messy sed command sorts on library version numbers.
7554 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7555 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7557 s/[0-9][0-9]*/0000&/g
7558 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7561 $sort | $sed -e 's/^.* //'`
7564 $test -r $1 || set /usr/ccs/lib/libc.$so
7565 $test -r $1 || set /lib/libsys_s$_a
7571 if $test -r "$1"; then
7572 echo "Your (shared) C library seems to be in $1."
7574 elif $test -r /lib/libc && $test -r /lib/clib; then
7575 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7577 libc='/lib/clib /lib/libc'
7578 if $test -r /lib/syslib; then
7579 echo "(Your math library is in /lib/syslib.)"
7580 libc="$libc /lib/syslib"
7582 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7583 echo "Your C library seems to be in $libc, as you said before."
7584 elif $test -r $incpath/usr/lib/libc$_a; then
7585 libc=$incpath/usr/lib/libc$_a;
7586 echo "Your C library seems to be in $libc. That's fine."
7587 elif $test -r /lib/libc$_a; then
7589 echo "Your C library seems to be in $libc. You're normal."
7591 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7593 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7594 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7595 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7597 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7599 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7602 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7604 if $test -r "$tans"; then
7605 echo "Your C library seems to be in $tans, of all places."
7611 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7615 If the guess above is wrong (which it might be if you're using a strange
7616 compiler, or your machine supports multiple models), you can override it here.
7621 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7623 I can't seem to find your C library. I've looked in the following places:
7626 $sed 's/^/ /' libpath
7629 None of these seems to contain your C library. I need to get its name...
7634 rp='Where is your C library?'
7639 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7640 set X `cat libnames`
7643 case $# in 1) xxx=file; esac
7644 echo "Extracting names from the following $xxx for later perusal:" >&4
7646 $sed 's/^/ /' libnames >&4
7648 $echo $n "This may take a while...$c" >&4
7652 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7653 *) $nm $nm_opt $file 2>/dev/null;;
7658 $grep fprintf libc.tmp > libc.ptf
7659 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7660 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7662 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7664 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7666 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7668 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7670 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7672 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7674 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7676 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7678 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7680 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7682 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7684 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7686 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7687 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7689 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7691 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7693 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7695 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7697 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7699 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7701 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7703 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7705 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7707 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7709 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7711 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7713 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7715 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7717 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7720 $nm -p $* 2>/dev/null >libc.tmp
7721 $grep fprintf libc.tmp > libc.ptf
7722 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7723 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7729 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7731 if $ar t $libc > libc.tmp && \
7732 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7734 for thisname in $libnames $libc; do
7735 $ar t $thisname >>libc.tmp
7737 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7739 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7740 for thisname in $libnames $libc; do
7741 $ar tv $thisname >>libc.tmp
7742 emximp -o tmp.imp $thisname \
7744 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7745 < tmp.imp >>libc.tmp
7748 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7751 echo "$ar didn't seem to work right." >&4
7752 echo "Maybe this is a Cray...trying bld instead..." >&4
7754 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7757 for thisname in $libnames; do
7759 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7760 $ar t $thisname >>libc.tmp
7764 echo "That didn't work either. Giving up." >&4
7774 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7775 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7777 *) if $test -f /lib/syscalls.exp; then
7779 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7780 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7781 /lib/syscalls.exp >>libc.list
7787 $rm -f libnames libpath
7789 : see if dld is available
7793 : Check if we are using C++
7795 echo "Checking for C++..." >&4
7796 $cat >try.c <<'EOCP'
7808 if eval $compile_ok && $run ./try; then
7810 echo "You are using a C++ compiler."
7813 echo "You are not using a C++ compiler."
7819 : is a C symbol defined?
7822 -v) tf=libc.tmp; tdc="";;
7823 -a) tf=libc.tmp; tdc="[]";;
7824 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7826 case "$d_cplusplus" in
7827 $define) extern_C="extern \"C\"" ;;
7828 *) extern_C="extern" ;;
7831 case "$reuseval-$4" in
7833 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7838 if $test "$runnm" = true; then
7839 if $contains $tlook $tf >/dev/null 2>&1; then
7841 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7842 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7843 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7844 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7848 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7849 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7855 $define) tval=true;;
7862 : define an is-in-libc? function
7863 inlibc='echo " "; td=$define; tu=$undef;
7864 sym=$1; var=$2; eval "was=\$$2";
7866 case "$reuseval$was" in
7876 echo "$sym() found." >&4;
7877 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7879 echo "$sym() NOT found." >&4;
7880 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7884 $define) echo "$sym() found." >&4;;
7885 *) echo "$sym() NOT found." >&4;;
7889 : see if dlopen exists
7891 xxx_ccflags="$ccflags"
7893 : with g++ one needs -shared to get is-in-libc to work for dlopen
7894 case "$gccversion" in
7896 *) case "$d_cplusplus" in
7897 "$define") ccflags="$ccflags -shared" ;;
7904 ccflags="$xxx_ccflags"
7906 : see if this is a unistd.h system
7907 set unistd.h i_unistd
7910 : determine which dynamic loading, if any, to compile in
7912 dldir="ext/DynaLoader"
7925 $define) dflt='y' ;;
7928 $define) dflt='y' ;;
7930 : Does a dl_xxx.xs file exist for this operating system
7931 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7934 rp="Do you wish to use dynamic loading?"
7942 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7943 dflt="$dldir/dl_${osname}.xs"
7944 elif $test "$d_dlopen" = "$define" ; then
7945 dflt="$dldir/dl_dlopen.xs"
7946 elif $test "$i_dld" = "$define" ; then
7947 dflt="$dldir/dl_dld.xs"
7952 *) dflt="$dldir/$dlsrc"
7955 echo "The following dynamic loading files are available:"
7956 : Can not go over to $dldir because getfile has path hard-coded in.
7957 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7958 rp="Source file to use for dynamic loading"
7964 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7968 Some systems may require passing special flags to $cc -c to
7969 compile modules that will be used to create a shared library.
7970 To use no flags, say "none".
7973 case "$cccdlflags" in
7974 '') case "$gccversion" in
7975 '') case "$osname" in
7977 next) dflt='none' ;;
7978 irix*) dflt='-KPIC' ;;
7979 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7980 sunos) dflt='-pic' ;;
7984 *) case "$osname" in
7985 darwin) dflt='none' ;;
7986 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7991 *) dflt="$cccdlflags" ;;
7993 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7996 none) cccdlflags=' ' ;;
7997 *) cccdlflags="$ans" ;;
8002 Some systems use ld to create libraries that can be dynamically loaded,
8003 while other systems (such as those using ELF) use $cc.
8007 '') $cat >try.c <<EOM
8008 /* Test for whether ELF binaries are produced */
8020 int i = open("a.out",O_RDONLY);
8023 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8024 exit(0); /* succeed (yes, it's ELF) */
8029 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8031 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8036 echo "I'll use ld to build dynamic libraries."
8045 rp="What command should be used to create dynamic libraries?"
8051 Some systems may require passing special flags to $ld to create a
8052 library that can be dynamically loaded. If your ld flags include
8053 -L/other/path options to locate libraries outside your loader's normal
8054 search path, you may need to specify those -L options here as well. To
8055 use no flags, say "none".
8058 case "$lddlflags" in
8059 '') case "$osname" in
8060 beos) dflt='-nostart' ;;
8061 haiku) dflt='-shared' ;;
8063 case "$gccversion" in
8064 '') dflt="$dflt +vnocompatwarnings" ;;
8067 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8068 next) dflt='none' ;;
8069 solaris) dflt='-G' ;;
8070 sunos) dflt='-assert nodefinitions' ;;
8071 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8075 *) dflt="$lddlflags" ;;
8078 : Try to guess additional flags to pick up local libraries.
8079 : Be careful not to append to a plain 'none'
8083 for thisflag in $ldflags; do
8088 *) dflt="$dflt $thisflag" ;;
8095 ''|' ') dflt='none' ;;
8099 *-fstack-protector*)
8101 *-fstack-protector*) ;; # Don't add it again
8102 *) dflt="$dflt -fstack-protector" ;;
8108 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8111 none) lddlflags=' ' ;;
8112 *) lddlflags="$ans" ;;
8117 Some systems may require passing special flags to $cc to indicate that
8118 the resulting executable will use dynamic linking. To use no flags,
8122 case "$ccdlflags" in
8123 '') case "$osname" in
8124 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8125 next|sunos) dflt='none' ;;
8129 *) dflt="$ccdlflags" ;;
8131 rp="Any special flags to pass to $cc to use dynamic linking?"
8134 none) ccdlflags=' ' ;;
8135 *) ccdlflags="$ans" ;;
8146 : Do we want a shared libperl?
8150 # No dynamic loading being used, so don't bother even to prompt.
8153 *) case "$useshrplib" in
8154 '') case "$osname" in
8155 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|haiku|cygwin*)
8157 also='Building a shared libperl is required for dynamic loading to work on your system.'
8162 also='Building a shared libperl is needed for MAB support.'
8180 The perl executable is normally obtained by linking perlmain.c with
8181 libperl${_a}, any static extensions (usually just DynaLoader), and
8182 any other libraries needed on this system (such as -lm, etc.). Since
8183 your system supports dynamic loading, it is probably possible to build
8184 a shared libperl.$so. If you will have more than one executable linked
8185 to libperl.$so, this will significantly reduce the size of each
8186 executable, but it may have a noticeable effect on performance. The
8187 default is probably sensible for your system.
8191 rp="Build a shared libperl.$so (y/n)"
8195 useshrplib='true' ;;
8196 *) useshrplib='false' ;;
8201 case "$useshrplib" in
8203 case "$userelocatableinc" in
8205 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8206 echo "See INSTALL for an explanation why that won't work." >&4
8212 # Figure out a good name for libperl.so. Since it gets stored in
8213 # a version-specific architecture-dependent library, the version
8214 # number isn't really that important, except for making cc/ld happy.
8216 # A name such as libperl.so.10.1
8217 majmin="libperl.$so.$patchlevel.$subversion"
8218 # A name such as libperl.so.100
8219 majonly=`echo $patchlevel $subversion |
8220 $awk '{printf "%d%02d", $1, $2}'`
8221 majonly=libperl.$so.$majonly
8222 # I'd prefer to keep the os-specific stuff here to a minimum, and
8223 # rely on figuring it out from the naming of libc.
8224 case "${osname}${osvers}" in
8227 # XXX How handle the --version stuff for MAB?
8229 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8232 cygwin*) # ld links now against the dll directly
8233 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8234 majonly=`echo $patchlevel $subversion |
8235 $awk '{printf "%03d%03d", $1, $2}'`
8236 majonly=cygperl5.$majonly.$so
8239 *) # Try to guess based on whether libc has major.minor.
8241 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8242 *libc.$so.[0-9]*) dflt=$majonly ;;
8243 *) dflt=libperl.$so ;;
8253 I need to select a good name for the shared libperl. If your system uses
8254 library names with major and minor numbers, then you might want something
8255 like $majmin. Alternatively, if your system uses a single version
8256 number for shared libraries, then you might want to use $majonly.
8257 Or, your system might be quite happy with a simple libperl.$so.
8259 Since the shared libperl will get installed into a version-specific
8260 architecture-dependent directory, the version number of the shared perl
8261 library probably isn't important, so the default should be o.k.
8264 rp='What name do you want to give to the shared libperl?'
8267 echo "Ok, I'll use $libperl"
8270 libperl="libperl${_a}"
8274 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8278 WARNING: Use of the shrpdir variable for the installation location of
8279 the shared $libperl is not supported. It was never documented and
8280 will not work in this version. Let me (perlbug@perl.org)
8281 know of any problems this may cause.
8287 But your current setting of $shrpdir is
8288 the default anyway, so it's harmless.
8293 Further, your current attempted setting of $shrpdir
8294 conflicts with the value of $archlibexp/CORE
8295 that installperl will use.
8302 # How will the perl executable find the installed shared $libperl?
8303 # Add $xxx to ccdlflags.
8304 # If we can't figure out a command-line option, use $shrpenv to
8305 # set env LD_RUN_PATH. The main perl makefile uses this.
8306 shrpdir=$archlibexp/CORE
8309 if "$useshrplib"; then
8312 # We'll set it in Makefile.SH...
8317 freebsd|netbsd|openbsd|interix|dragonfly)
8318 xxx="-Wl,-R$shrpdir"
8320 bsdos|linux|irix*|dec_osf|gnu*)
8321 xxx="-Wl,-rpath,$shrpdir"
8324 # next doesn't like the default...
8327 # beos doesn't like the default, either.
8330 # Haiku doesn't like the default, either.
8333 # hpux doesn't like the default, either.
8334 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8337 # cygwin needs only ldlibpth
8340 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8346 # Only add $xxx if it isn't already in ccdlflags.
8347 case " $ccdlflags " in
8349 *) ccdlflags="$ccdlflags $xxx"
8352 Adding $xxx to the flags
8353 passed to $ld so that the perl executable will find the
8354 installed shared $libperl.
8362 # Fix ccdlflags in AIX for building external extensions.
8363 # (For building Perl itself bare -bE:perl.exp is needed,
8364 # Makefile.SH takes care of this.)
8366 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8368 # Respect a hint or command-line value.
8370 '') shrpenv="$tmp_shrpenv" ;;
8372 case "$ldlibpthname" in
8373 '') ldlibpthname=LD_LIBRARY_PATH ;;
8374 none) ldlibpthname='' ;;
8377 : determine where manual pages are on this system
8381 syspath='/usr/share/man/man1 /usr/man/man1'
8382 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8383 syspath="$syspath /usr/man/u_man/man1"
8384 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8385 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8386 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8387 sysman=`./loc . /usr/man/man1 $syspath`
8390 if $test -d "$sysman"; then
8391 echo "System manual is in $sysman." >&4
8393 echo "Could not find manual pages in source form." >&4
8396 : determine where manual pages go
8397 set man1dir man1dir none
8401 $spackage has manual pages available in source form.
8405 echo "However, you don't have nroff, so they're probably useless to you."
8407 '') man1dir="none";;
8410 echo "If you don't want the manual sources installed, answer 'none'."
8415 lookpath="$prefixexp/share/man/man1"
8416 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8417 lookpath="$lookpath $prefixexp/man/p_man/man1"
8418 lookpath="$lookpath $prefixexp/man/u_man/man1"
8419 lookpath="$lookpath $prefixexp/man/man.1"
8421 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8422 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8432 rp="Where do the main $spackage manual pages (source) go?"
8434 if $test "X$man1direxp" != "X$ansexp"; then
8445 : What suffix to use on installed man pages
8452 rp="What suffix should be used for the main $spackage man pages?"
8454 '') case "$man1dir" in
8468 *) dflt="$man1ext";;
8475 : see if we can have long filenames
8477 first=123456789abcdef
8479 if (echo hi >$first) 2>/dev/null; then
8480 if $test -f 123456789abcde; then
8481 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8484 echo 'You can have filenames longer than 14 characters.'>&4
8489 You can't have filenames longer than 14 chars.
8490 You can't even think about them!
8496 $rm -rf 123456789abcde*
8498 : determine where library module manual pages go
8499 set man3dir man3dir none
8503 $spackage has manual pages for many of the library modules.
8509 However, you don't have nroff, so they're probably useless to you.
8512 '') man3dir="none";;
8516 case "$d_flexfnam" in
8519 However, your system can't handle the long file names like File::Basename.3.
8522 '') man3dir="none";;
8526 echo "If you don't want the manual sources installed, answer 'none'."
8527 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8529 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8530 if $test -d "$privlib/man/man3"; then
8533 WARNING: Previous versions of perl installed man3 pages into
8534 $privlib/man/man3. This version will suggest a
8535 new default of $dflt.
8539 rp='Do you wish to preserve the old behavior?(y/n)'
8542 y*) dflt="$privlib/man/man3" ;;
8547 *) dflt="$man3dir" ;;
8554 rp="Where do the $package library man pages (source) go?"
8564 : What suffix to use on installed man pages
8570 rp="What suffix should be used for the $package library man pages?"
8572 '') case "$man3dir" in
8586 *) dflt="$man3ext";;
8593 : see if we have to deal with yellow pages, now NIS.
8594 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8595 if $test -f /usr/etc/nibindd; then
8597 echo "I'm fairly confident you're on a NeXT."
8599 rp='Do you get the hosts file via NetInfo?'
8608 y*) hostcat='nidump hosts .';;
8609 *) case "$hostcat" in
8610 nidump*) hostcat='';;
8620 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8628 rp='Are you getting the hosts file via yellow pages?'
8631 y*) hostcat='ypcat hosts';;
8632 *) hostcat='cat /etc/hosts';;
8638 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8641 '') test -f /etc/group && groupcat='cat /etc/group';;
8644 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8647 : now get the host name
8649 echo "Figuring out host name..." >&4
8650 case "$myhostname" in
8652 echo 'Maybe "hostname" will work...'
8653 if tans=`sh -c hostname 2>&1` ; then
8661 if $test "$cont"; then
8663 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8664 if tans=`cat /etc/systemid 2>&1` ; then
8666 phostname='cat /etc/systemid'
8667 echo "Whadyaknow. Xenix always was a bit strange..."
8670 elif $test -r /etc/systemid; then
8671 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8674 if $test "$cont"; then
8675 echo 'No, maybe "uuname -l" will work...'
8676 if tans=`sh -c 'uuname -l' 2>&1` ; then
8678 phostname='uuname -l'
8680 echo 'Strange. Maybe "uname -n" will work...'
8681 if tans=`sh -c 'uname -n' 2>&1` ; then
8683 phostname='uname -n'
8685 echo 'Oh well, maybe I can mine it out of whoami.h...'
8686 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8687 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8688 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8690 case "$myhostname" in
8691 '') echo "Does this machine have an identity crisis or something?"
8694 echo "Well, you said $myhostname before..."
8695 phostname='echo $myhostname';;
8701 case "$myhostname" in
8702 '') myhostname=noname ;;
8704 : you do not want to know about this
8709 if $test "$myhostname" ; then
8711 rp='Your host name appears to be "'$myhostname'".'" Right?"
8719 : bad guess or no guess
8720 while $test "X$myhostname" = X ; do
8722 rp="Please type the (one word) name of your host:"
8727 : translate upper to lower if necessary
8728 case "$myhostname" in
8730 echo "(Normalizing case in your host name)"
8731 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8735 case "$myhostname" in
8737 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8738 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8739 echo "(Trimming domain name from host name--host name is now $myhostname)"
8741 *) case "$mydomain" in
8744 test "X$hostcat" = "Xypcat hosts" &&
8745 ypmatch "$myhostname" hosts 2>/dev/null |\
8746 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8749 test "X$hostcat" != "X" &&
8750 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8751 /[ ]$myhostname[ . ]/p" > hosts
8754 if $test -f hosts; then
8755 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8756 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8757 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8758 hosts | $sort | $uniq | \
8759 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8760 case `$echo X$dflt` in
8761 X*\ *) echo "(Several hosts in the database matched hostname)"
8764 X.) echo "(You do not have fully-qualified names in the hosts database)"
8768 echo "(I cannot locate a hosts database anywhere)"
8773 tans=`./loc resolv.conf X /etc /usr/etc`
8774 if $test -f "$tans"; then
8775 echo "(Attempting domain name extraction from $tans)"
8776 dflt=.`$sed -n -e 's/ / /g' \
8777 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8780 .) dflt=.`$sed -n -e 's/ / /g' \
8781 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8789 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8790 dflt=.`sh -c domainname 2>/dev/null`
8793 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8797 case "$dflt$osname" in
8798 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8799 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8803 .) echo "(Lost all hope -- silly guess then)"
8809 *) dflt="$mydomain";;
8813 rp="What is your domain name?"
8823 : translate upper to lower if necessary
8826 echo "(Normalizing case in your domain name)"
8827 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8831 : a little sanity check here
8832 case "$phostname" in
8835 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8836 $myhostname$mydomain|$myhostname) ;;
8838 case "$phostname" in
8840 echo "(That doesn't agree with your whoami.h file, by the way.)"
8843 echo "(That doesn't agree with your $phostname command, by the way.)"
8851 : determine the e-mail address of the user who is running us
8854 I need to get your e-mail address in Internet format if possible, i.e.
8855 something like user@host.domain. Please answer accurately since I have
8856 no easy means to double check it. The default value provided below
8857 is most probably close to reality but may not be valid from outside
8858 your organization...
8862 while test "$cont"; do
8864 '') dflt="$cf_by@$myhostname$mydomain";;
8865 *) dflt="$cf_email";;
8867 rp='What is your e-mail address?'
8873 rp='Address does not look like an Internet one. Use it anyway?'
8887 : Ask e-mail of administrator
8890 If you or somebody else will be maintaining perl at your site, please
8891 fill in the correct e-mail address here so that they may be contacted
8892 if necessary. Currently, the "perlbug" program included with perl
8893 will send mail to this address in addition to perlbug@perl.org. You may
8894 enter "none" for no administrator.
8897 case "$perladmin" in
8898 '') dflt="$cf_email";;
8899 *) dflt="$perladmin";;
8901 rp='Perl administrator e-mail address'
8905 : determine whether to only install version-specific parts.
8908 Do you want to install only the version-specific parts of the perl
8909 distribution? Usually you do *not* want to do this.
8911 case "$versiononly" in
8912 "$define"|[Yy]*|true) dflt='y' ;;
8915 rp="Do you want to install only the version-specific parts of perl?"
8918 [yY]*) val="$define";;
8924 case "$versiononly" in
8925 "$define") inc_version_list=''
8926 inc_version_list_init=0
8930 : figure out how to guarantee perl startup
8931 : XXX Note that this currently takes advantage of the bug that binexp ignores
8932 : the Configure -Dinstallprefix setting, which in turn means that under
8933 : relocatable @INC, initialinstalllocation is what binexp started as.
8934 case "$startperl" in
8936 case "$sharpbang" in
8940 I can use the #! construct to start perl on your system. This will
8941 make startup of perl scripts faster, but may cause problems if you
8942 want to share those scripts and perl is not in a standard place
8943 ($initialinstalllocation/perl) on all your platforms. The alternative
8944 is to force a shell by starting the script with a single ':' character.
8947 case "$versiononly" in
8948 "$define") dflt="$initialinstalllocation/perl$version";;
8949 *) dflt="$initialinstalllocation/perl";;
8951 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8954 none) startperl=": # use perl";;
8955 *) startperl="#!$ans"
8956 if $test 30 -lt `echo "$ans" | wc -c`; then
8959 WARNING: Some systems limit the #! command to 32 characters.
8960 If you experience difficulty running Perl scripts with #!, try
8961 installing Perl in a directory with a shorter pathname.
8967 *) startperl=": # use perl"
8972 echo "I'll use $startperl to start perl scripts."
8974 : figure best path for perl in scripts
8977 case "$versiononly" in
8978 "$define") perlpath="$initialinstalllocation/perl$version";;
8979 *) perlpath="$initialinstalllocation/perl";;
8981 case "$startperl" in
8986 I will use the "eval 'exec'" idiom to start Perl on your system.
8987 I can use the full path of your Perl binary for this purpose, but
8988 doing so may cause problems if you want to share those scripts and
8989 Perl is not always in a standard place ($initialinstalllocation/perl).
8992 dflt="$initialinstalllocation/perl"
8993 rp="What path shall I use in \"eval 'exec'\"?"
9000 case "$startperl" in
9002 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9005 : determine where public executable scripts go
9006 set scriptdir scriptdir
9008 case "$scriptdir" in
9011 : guess some guesses
9012 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9013 $test -d /usr/share/bin && dflt=/usr/share/bin
9014 $test -d /usr/local/script && dflt=/usr/local/script
9015 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9016 $test -d $prefixexp/script && dflt=$prefixexp/script
9020 *) dflt="$scriptdir"
9025 Some installations have a separate directory just for executable scripts so
9026 that they can mount it across multiple architectures but keep the scripts in
9027 one spot. You might, for example, have a subdirectory of /usr/share for this.
9028 Or you might just lump your scripts in with all your other executables.
9032 rp='Where do you keep publicly executable scripts?'
9034 if $test "X$ansexp" != "X$scriptdirexp"; then
9040 : A little fix up for an irregularly named variable.
9041 installscript="$installscriptdir"
9043 : determine where add-on public executables go
9045 '') dflt=$siteprefix/bin ;;
9049 rp='Pathname where the add-on public executables should be installed?'
9054 : determine where add-on html pages go
9055 : There is no standard location, so try to copy the previously-selected
9056 : directory structure for the core html pages.
9057 case "$sitehtml1dir" in
9058 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9059 *) dflt=$sitehtml1dir ;;
9062 ''|' ') dflt=none ;;
9065 rp='Pathname where the site-specific html pages should be installed?'
9067 prefixvar=sitehtml1dir
9070 : determine where add-on library html pages go
9071 : There is no standard location, so try to copy the previously-selected
9072 : directory structure for the core html pages.
9073 case "$sitehtml3dir" in
9074 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9075 *) dflt=$sitehtml3dir ;;
9078 ''|' ') dflt=none ;;
9081 rp='Pathname where the site-specific library html pages should be installed?'
9083 prefixvar=sitehtml3dir
9086 : determine where add-on manual pages go
9087 case "$siteman1dir" in
9088 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9089 *) dflt=$siteman1dir ;;
9092 ''|' ') dflt=none ;;
9095 rp='Pathname where the site-specific manual pages should be installed?'
9097 prefixvar=siteman1dir
9100 : determine where add-on library man pages go
9101 case "$siteman3dir" in
9102 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9103 *) dflt=$siteman3dir ;;
9106 ''|' ') dflt=none ;;
9109 rp='Pathname where the site-specific library manual pages should be installed?'
9111 prefixvar=siteman3dir
9114 : determine where add-on public executable scripts go
9115 case "$sitescript" in
9116 '') dflt=$siteprefix/script
9117 $test -d $dflt || dflt=$sitebin ;;
9118 *) dflt="$sitescript" ;;
9121 rp='Pathname where add-on public executable scripts should be installed?'
9123 prefixvar=sitescript
9126 : Check if faststdio is requested and available
9127 case "$usefaststdio" in
9128 $define|true|[yY]*|'')
9129 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9139 Perl can be built to use 'fast stdio', which means using the stdio
9140 library but also directly manipulating the stdio buffers to enable
9141 faster I/O. Using stdio is better for backward compatibility (especially
9142 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9143 interface has been preferred instead of stdio.
9145 If this doesn't make any sense to you, just accept the default '$dflt'.
9147 rp='Use the "fast stdio" if available?'
9150 y|Y) val="$define" ;;
9157 : define an is-a-typedef? function
9158 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9160 "") inclist="sys/types.h";;
9162 eval "varval=\$$var";
9166 for inc in $inclist; do
9167 echo "#include <$inc>" >>temp.c;
9169 echo "#ifdef $type" >> temp.c;
9170 echo "printf(\"We have $type\");" >> temp.c;
9171 echo "#endif" >> temp.c;
9172 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9173 if $contains $type temp.E >/dev/null 2>&1; then
9179 *) eval "$var=\$varval";;
9182 : define an is-a-typedef? function that prompts if the type is not available.
9183 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9185 "") inclist="sys/types.h";;
9187 eval "varval=\$$var";
9191 for inc in $inclist; do
9192 echo "#include <$inc>" >>temp.c;
9194 echo "#ifdef $type" >> temp.c;
9195 echo "printf(\"We have $type\");" >> temp.c;
9196 echo "#endif" >> temp.c;
9197 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9199 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9200 if $contains $type temp.E >/dev/null 2>&1; then
9201 echo "$type found." >&4;
9204 echo "$type NOT found." >&4;
9210 *) eval "$var=\$varval";;
9213 : see what type lseek is declared as in the kernel
9214 rp="What is the type used for lseek's offset on this system?"
9215 set off_t lseektype long stdio.h sys/types.h
9219 echo "Checking to see how big your file offsets are..." >&4
9221 #include <sys/types.h>
9225 printf("%d\n", (int)sizeof($lseektype));
9230 if eval $compile_ok; then
9231 lseeksize=`$run ./try`
9232 echo "Your file offsets are $lseeksize bytes long."
9236 echo "(I can't seem to compile the test program. Guessing...)"
9237 rp="What is the size of your file offsets (in bytes)?"
9243 : see what type file positions are declared as in the library
9244 rp="What is the type for file position used by fsetpos()?"
9245 set fpos_t fpostype long stdio.h sys/types.h
9248 : Check size for Fpos_t
9251 *_t) zzz="$fpostype" ;;
9254 echo "Checking the size of $zzz..." >&4
9256 #include <sys/types.h>
9263 printf("%d\n", (int)sizeof($fpostype));
9268 if eval $compile_ok; then
9272 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9275 echo "Your $zzz is $fpossize bytes long."
9281 echo "(I can't compile the test program. Guessing...)" >&4
9282 rp="What is the size of your file positions (in bytes)?"
9287 : Check for large file support
9288 # Backward compatibility (uselfs is deprecated).
9290 "$define"|true|[yY]*)
9293 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9295 uselargefiles="$define"
9299 case "$lseeksize:$fpossize" in
9302 You can have files larger than 2 gigabytes.
9305 *) case "$uselargefiles" in
9306 "$undef"|false|[nN]*) dflt='n' ;;
9311 Perl can be built to understand large files (files larger than 2 gigabytes)
9312 on some systems. To do so, Configure can be run with -Duselargefiles.
9314 If this doesn't make any sense to you, just accept the default '$dflt'.
9316 rp='Try to understand large files, if available?'
9319 y|Y) val="$define" ;;
9326 : Look for a hint-file generated 'call-back-unit'. If the
9327 : user has specified that a large files perl is to be built,
9328 : we may need to set or change some other defaults.
9329 if $test -f uselargefiles.cbu; then
9330 echo "Your platform has some specific hints regarding large file builds, using them..."
9331 . ./uselargefiles.cbu
9333 case "$uselargefiles" in
9335 if $test -f uselargefiles.cbu; then
9337 echo "Rechecking to see how big your file offsets are..." >&4
9339 #include <sys/types.h>
9343 printf("%d\n", (int)sizeof($lseektype));
9348 if eval $compile_ok; then
9349 lseeksize=`$run ./try`
9350 $echo "Your file offsets are now $lseeksize bytes long."
9354 echo "(I can't seem to compile the test program. Guessing...)"
9355 rp="What is the size of your file offsets (in bytes)?"
9360 *_t) zzz="$fpostype" ;;
9363 $echo $n "Rechecking the size of $zzz...$c" >&4
9365 #include <sys/types.h>
9372 printf("%d\n", (int)sizeof($fpostype));
9377 if eval $compile_ok; then
9382 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9385 echo " $fpossize bytes." >&4
9391 echo "(I can't compile the test program. Guessing...)" >&4
9392 rp="What is the size of your file positions (in bytes)?"
9401 : Set the vendorbin variables
9402 case "$vendorprefix" in
9403 '') d_vendorbin="$undef"
9407 *) d_vendorbin="$define"
9408 : determine where vendor-supplied executables go.
9409 case "$vendorbin" in
9410 '') dflt=$vendorprefix/bin ;;
9411 *) dflt="$vendorbin" ;;
9414 rp='Pathname for the vendor-supplied executables directory?'
9417 vendorbinexp="$ansexp"
9423 : Set the vendorhtml1dir variables
9424 case "$vendorprefix" in
9425 '') vendorhtml1dir=''
9426 vendorhtml1direxp=''
9428 *) : determine where vendor-supplied html pages go.
9429 : There is no standard location, so try to copy the previously-selected
9430 : directory structure for the core html pages.
9431 : XXX Better default suggestions would be welcome.
9432 case "$vendorhtml1dir" in
9433 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9434 *) dflt=$vendorhtml1dir ;;
9437 ''|' ') dflt=none ;;
9440 rp='Pathname for the vendor-supplied html pages?'
9442 vendorhtml1dir="$ans"
9443 vendorhtml1direxp="$ansexp"
9446 : Use ' ' for none so value is preserved next time through Configure
9447 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9448 prefixvar=vendorhtml1dir
9451 : Set the vendorhtml3dir variables
9452 case "$vendorprefix" in
9453 '') vendorhtml3dir=''
9454 vendorhtml3direxp=''
9456 *) : determine where vendor-supplied module html pages go.
9457 : There is no standard location, so try to copy the previously-selected
9458 : directory structure for the core html pages.
9459 : XXX Better default suggestions would be welcome.
9460 case "$vendorhtml3dir" in
9461 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9462 *) dflt=$vendorhtml3dir ;;
9465 ''|' ') dflt=none ;;
9468 rp='Pathname for the vendor-supplied html pages?'
9470 vendorhtml3dir="$ans"
9471 vendorhtml3direxp="$ansexp"
9474 : Use ' ' for none so value is preserved next time through Configure
9475 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9476 prefixvar=vendorhtml3dir
9479 : Set the vendorman1dir variables
9480 case "$vendorprefix" in
9481 '') vendorman1dir=''
9484 *) : determine where vendor-supplied manual pages go.
9485 case "$vendorman1dir" in
9486 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9487 *) dflt=$vendorman1dir ;;
9490 ''|' ') dflt=none ;;
9493 rp='Pathname for the vendor-supplied manual section 1 pages?'
9495 vendorman1dir="$ans"
9496 vendorman1direxp="$ansexp"
9499 : Use ' ' for none so value is preserved next time through Configure
9500 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9501 prefixvar=vendorman1dir
9504 : Set the vendorman3dir variables
9505 case "$vendorprefix" in
9506 '') vendorman3dir=''
9509 *) : determine where vendor-supplied module manual pages go.
9510 case "$vendorman3dir" in
9511 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9512 *) dflt=$vendorman3dir ;;
9515 ''|' ') dflt=none ;;
9518 rp='Pathname for the vendor-supplied manual section 3 pages?'
9520 vendorman3dir="$ans"
9521 vendorman3direxp="$ansexp"
9524 : Use ' ' for none so value is preserved next time through Configure
9525 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9526 prefixvar=vendorman3dir
9529 : Set the vendorscript variables
9530 case "$vendorprefix" in
9531 '') d_vendorscript="$undef"
9535 *) d_vendorscript="$define"
9536 : determine where vendor-supplied scripts go.
9537 case "$vendorscript" in
9538 '') dflt=$vendorprefix/script
9539 $test -d $dflt || dflt=$vendorbin ;;
9540 *) dflt="$vendorscript" ;;
9544 The installation process will create a directory for
9545 vendor-supplied scripts.
9549 rp='Pathname for the vendor-supplied scripts directory?'
9552 vendorscriptexp="$ansexp"
9555 prefixvar=vendorscript
9558 : script used to emit important warnings
9561 if test \$# -gt 0; then
9566 echo "*** WARNING:" >&4
9567 sed -e 's/^/*** /' <msg >&4
9569 cat msg >>config.msg
9570 echo " " >>config.msg
9576 : see which of string.h or strings.h is needed
9578 strings=`./findhdr string.h`
9579 if $test "$strings" && $test -r "$strings"; then
9580 echo "Using <string.h> instead of <strings.h>." >&4
9584 strings=`./findhdr strings.h`
9585 if $test "$strings" && $test -r "$strings"; then
9586 echo "Using <strings.h> instead of <string.h>." >&4
9588 ./warn "No string header found -- You'll surely have problems."
9594 "$undef") strings=`./findhdr strings.h`;;
9595 *) strings=`./findhdr string.h`;;
9598 : see if qgcvt exists
9602 : Check print/scan long double stuff
9605 if $test X"$d_longdbl" = X"$define"; then
9607 echo "Checking how to print long doubles..." >&4
9609 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9610 $cat >try.c <<'EOCP'
9611 #include <sys/types.h>
9615 printf("%.3f\n", d);
9619 if eval $compile; then
9623 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9624 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9625 echo "We will use %f."
9631 if $test X"$sPRIfldbl" = X; then
9632 $cat >try.c <<'EOCP'
9633 #include <sys/types.h>
9636 long double d = 123.456;
9637 printf("%.3Lf\n", d);
9641 if eval $compile; then
9645 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9646 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9647 echo "We will use %Lf."
9653 if $test X"$sPRIfldbl" = X; then
9654 $cat >try.c <<'EOCP'
9655 #include <sys/types.h>
9658 long double d = 123.456;
9659 printf("%.3llf\n", d);
9663 if eval $compile; then
9667 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9668 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9669 echo "We will use %llf."
9675 if $test X"$sPRIfldbl" = X; then
9676 $cat >try.c <<'EOCP'
9677 #include <sys/types.h>
9680 long double d = 123.456;
9681 printf("%.3lf\n", d);
9685 if eval $compile; then
9689 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9690 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9691 echo "We will use %lf."
9697 if $test X"$sPRIfldbl" = X; then
9698 echo "Cannot figure out how to print long doubles." >&4
9700 sSCNfldbl=$sPRIfldbl # expect consistency
9707 case "$sPRIfldbl" in
9708 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9709 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9710 d_SCNfldbl="$undef";
9712 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9713 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9714 d_SCNfldbl="$define";
9718 : Check how to convert floats to strings.
9720 if test "X$d_Gconvert" = X; then
9723 echo "Checking for an efficient way to convert floats to strings."
9725 case "$uselongdouble" in
9726 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9728 case "$d_longdbl" in
9729 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9731 case "$d_PRIgldbl" in
9732 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9736 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9737 char *myname = "gconvert";
9740 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9741 char *myname = "gcvt";
9744 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9745 char *myname = "qgcvt";
9746 #define DOUBLETYPE long double
9749 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9751 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9753 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9756 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9758 char *myname = "sprintf";
9762 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9763 #define DOUBLETYPE long double
9765 #define DOUBLETYPE double
9777 # include <string.h>
9779 # include <strings.h>
9782 int checkit(char *expect, char *got)
9784 if (strcmp(expect, got)) {
9785 printf("%s oddity: Expected %s, got %s\n",
9786 myname, expect, got);
9796 /* This must be 1st test on (which?) platform */
9797 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9798 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9799 checkit("0.1", buf);
9801 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9802 checkit("0.01", buf);
9804 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9805 checkit("0.001", buf);
9807 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9808 checkit("0.0001", buf);
9810 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9811 if (strlen(buf) > 5)
9812 checkit("9e-005", buf); /* for Microsoft ?? */
9814 checkit("9e-05", buf);
9816 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9819 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9820 checkit("1.1", buf);
9822 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9823 checkit("1.01", buf);
9825 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9826 checkit("1.001", buf);
9828 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9829 checkit("1.0001", buf);
9831 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9832 checkit("1.00001", buf);
9834 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9835 checkit("1.000001", buf);
9837 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9840 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9843 /* Some Linux gcvt's give 1.e+5 here. */
9844 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9845 checkit("100000", buf);
9847 /* Some Linux gcvt's give -1.e+5 here. */
9848 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9849 checkit("-100000", buf);
9851 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9852 checkit("123.456", buf);
9854 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9855 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9856 /* 34 should be enough to scare even long double
9857 * places into using the e notation. */
9858 if (strlen(buf) > 5)
9859 checkit("1e+034", buf); /* for Microsoft */
9861 checkit("1e+34", buf);
9863 /* For Perl, if you add additional tests here, also add them to
9864 * t/base/num.t for benefit of platforms not using Configure or
9865 * overriding d_Gconvert */
9870 : first add preferred functions to our list
9872 for xxx_convert in $gconvert_preference; do
9873 case $xxx_convert in
9874 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9875 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9878 : then add any others
9879 for xxx_convert in gconvert gcvt sprintf; do
9882 *) xxx_list="$xxx_list $xxx_convert" ;;
9886 case "$d_longdbl$uselongdouble" in
9888 : again, add prefered functions to our list first
9890 for xxx_convert in $gconvert_ld_preference; do
9891 case $xxx_convert in
9892 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9893 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9896 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9897 for xxx_convert in qgcvt sprintf $xxx_list; do
9898 case "$xxx_ld_list" in
9899 $xxx_convert*|*" $xxx_convert"*) ;;
9900 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9903 : if sprintf cannot do long doubles, move it to the end
9904 if test "$d_PRIgldbl" != "$define"; then
9905 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9907 : if no qgcvt, remove it
9908 if test "$d_qgcvt" != "$define"; then
9909 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9912 xxx_list="$xxx_ld_list"
9916 for xxx_convert in $xxx_list; do
9917 echo "Trying $xxx_convert..."
9918 $rm -f try try$_o core
9919 set try -DTRY_$xxx_convert
9920 if eval $compile; then
9921 echo "$xxx_convert() found." >&4
9923 echo "I'll use $xxx_convert to convert floats into a string." >&4
9926 echo "...But $xxx_convert didn't work as I expected."
9930 echo "$xxx_convert NOT found." >&4
9934 if test X$xxx_convert = X; then
9935 echo "*** WHOA THERE!!! ***" >&4
9936 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9940 case "$xxx_convert" in
9941 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9942 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9943 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9944 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9945 "$define$define$define")
9946 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9947 "$define$define$undef")
9948 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9949 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9957 : see if _fwalk exists
9961 : Initialize h_fcntl
9964 : Initialize h_sysfile
9967 : access call always available on UNIX
9971 : locate the flags for 'access()'
9975 $cat >access.c <<EOCP
9976 #include <sys/types.h>
9981 #include <sys/file.h>
9994 : check sys/file.h first, no particular reason here
9995 if $test `./findhdr sys/file.h` && \
9996 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9998 echo "<sys/file.h> defines the *_OK access constants." >&4
9999 elif $test `./findhdr fcntl.h` && \
10000 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10002 echo "<fcntl.h> defines the *_OK access constants." >&4
10003 elif $test `./findhdr unistd.h` && \
10004 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10005 echo "<unistd.h> defines the *_OK access constants." >&4
10007 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10013 : see if accessx exists
10014 set accessx d_accessx
10017 : see if aintl exists
10021 : see if alarm exists
10025 : see if 64bit time functions exists
10027 set ctime64 d_ctime64
10030 set localtime64 d_localtime64
10033 set gmtime64 d_gmtime64
10036 set mktime64 d_mktime64
10039 set difftime64 d_difftime64
10042 set asctime64 d_asctime64
10045 : see if POSIX threads are available
10046 set pthread.h i_pthread
10049 : define a fucntion to check prototypes
10050 $cat > protochk <<EOSH
10053 optimize="$optimize"
10055 prototype="$prototype"
10058 usethreads=$usethreads
10059 i_pthread=$i_pthread
10060 pthread_h_first=$pthread_h_first
10063 $cat >> protochk <<'EOSH'
10068 while test $# -ge 2; do
10070 $define) echo "#include <$2>" >> try.c ;;
10071 literal) echo "$2" >> try.c ;;
10073 # Extra magic for the benefit of systems that need pthread.h
10074 # to be included early to correctly detect threadsafe functions.
10075 # Such functions must guarantee themselves, though, that the usethreads
10076 # and i_pthread have been defined, before calling protochk.
10077 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10078 echo "#include <pthread.h>" >> try.c
10083 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10084 cat >> try.c <<'EOCP'
10085 #ifdef CAN_PROTOTYPE
10086 #define _(args) args
10091 echo "$foo" >> try.c
10092 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10093 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10099 $eunicefix protochk
10101 : Define hasproto macro for Configure internal use
10102 hasproto='varname=$1; func=$2; shift; shift;
10103 while $test $# -ge 2; do
10105 $define) echo "#include <$2>";;
10109 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10110 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10111 echo "$func() prototype found.";
10114 echo "$func() prototype NOT found.";
10121 : see if sys/types.h has to be included
10122 set sys/types.h i_systypes
10125 : see if sys/select.h has to be included
10126 set sys/select.h i_sysselct
10129 : Define hasfield macro for Configure internal use
10130 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10131 while $test $# -ge 2; do
10133 $define) echo "#include <$2>";;
10137 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10139 if eval $compile; then
10148 : see if we should include time.h, sys/time.h, or both
10150 if test "X$timeincl" = X; then
10151 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10152 $echo $n "I'm now running the test program...$c"
10154 #include <sys/types.h>
10159 #ifdef SYSTIMEKERNEL
10162 #include <sys/time.h>
10165 #include <sys/select.h>
10167 #$i_stdlib I_STDLIB
10169 #include <stdlib.h>
10175 struct timeval bar;
10178 struct timezone tzp;
10180 if (foo.tm_sec == foo.tm_sec)
10183 if (bar.tv_sec == bar.tv_sec)
10190 for s_timezone in '-DS_TIMEZONE' ''; do
10192 for s_timeval in '-DS_TIMEVAL' ''; do
10193 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10194 for i_time in '' '-DI_TIME'; do
10195 for i_systime in '-DI_SYSTIME' ''; do
10198 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10199 if eval $compile; then
10200 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10204 $echo $n "Succeeded with $flags$c"
10216 *SYSTIMEKERNEL*) i_systimek="$define"
10217 timeincl=`./findhdr sys/time.h`
10218 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10219 *) i_systimek="$undef";;
10222 *I_TIME*) i_time="$define"
10223 timeincl=`./findhdr time.h`" $timeincl"
10224 echo "We'll include <time.h>." >&4;;
10225 *) i_time="$undef";;
10228 *I_SYSTIME*) i_systime="$define"
10229 timeincl=`./findhdr sys/time.h`" $timeincl"
10230 echo "We'll include <sys/time.h>." >&4;;
10231 *) i_systime="$undef";;
10235 : see if struct tm knows about tm_zone
10236 case "$i_systime$i_time" in
10239 echo "Checking to see if your struct tm has tm_zone field..." >&4
10240 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10248 case "$d_tm_tm_zone" in
10249 "$define") echo "Yes, it does." ;;
10250 *) echo "No, it doesn't." ;;
10252 : see if struct tm knows about tm_gmtoff
10253 case "$i_systime$i_time" in
10256 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10257 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10265 case "$d_tm_tm_gmtoff" in
10266 "$define") echo "Yes, it does." ;;
10267 *) echo "No, it doesn't." ;;
10270 : see if asctime_r exists
10271 set asctime_r d_asctime_r
10273 case "$d_asctime_r" in
10275 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10276 case "$d_asctime_r_proto:$usethreads" in
10277 ":define") d_asctime_r_proto=define
10278 set d_asctime_r_proto asctime_r $hdrs
10282 case "$d_asctime_r_proto" in
10284 case "$asctime_r_proto" in
10285 ''|0) try='char* asctime_r(const struct tm*, char*);'
10286 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10288 case "$asctime_r_proto" in
10289 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10290 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10292 case "$asctime_r_proto" in
10293 ''|0) try='int asctime_r(const struct tm*, char*);'
10294 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10296 case "$asctime_r_proto" in
10297 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10298 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10300 case "$asctime_r_proto" in
10301 ''|0) d_asctime_r=undef
10303 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10304 * ) case "$asctime_r_proto" in
10305 REENTRANT_PROTO*) ;;
10306 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10308 echo "Prototype: $try" ;;
10311 *) case "$usethreads" in
10312 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10319 *) asctime_r_proto=0
10323 : see if atolf exists
10327 : see if atoll exists
10331 : Look for GCC-style attribute format
10332 case "$d_attribute_format" in
10335 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10336 $cat >attrib.c <<'EOCP'
10338 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10340 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10341 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10342 echo "Your C compiler doesn't support __attribute__((format))."
10345 echo "Your C compiler supports __attribute__((format))."
10349 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10353 *) val="$d_attribute_format" ;;
10355 set d_attribute_format
10359 : Look for GCC-style attribute format with null format allowed
10360 case "$d_printf_format_null" in
10361 '') case "$d_attribute_format" in
10364 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10365 $cat >attrib.c <<EOCP
10367 #$i_stdlib I_STDLIB
10369 #include <stdlib.h>
10371 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10372 int null_printf (char* pat,...) { return (int)pat; }
10373 int main () { exit(null_printf(NULL)); }
10375 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10376 : run the executable in case it produces a run-time warning
10377 if $run ./attrib >>attrib.out 2>&1; then
10378 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10379 echo "Your C compiler doesn't allow __printf__ format to be null."
10382 echo "Your C compiler allows __printf__ format to be null."
10386 echo "Your C compiler executable failed with __printf__ format null."
10390 echo "Your C compiler fails with __printf__ format null."
10397 *) val="$d_printf_format_null" ;;
10399 set d_printf_format_null
10403 : Look for GCC-style attribute malloc
10404 case "$d_attribute_malloc" in
10407 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10408 $cat >attrib.c <<'EOCP'
10410 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10412 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10413 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10414 echo "Your C compiler doesn't support __attribute__((malloc))."
10417 echo "Your C compiler supports __attribute__((malloc))."
10421 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10425 *) val="$d_attribute_malloc" ;;
10427 set d_attribute_malloc
10431 : Look for GCC-style attribute nonnull
10432 case "$d_attribute_nonnull" in
10435 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10436 $cat >attrib.c <<'EOCP'
10438 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10440 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10441 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10442 echo "Your C compiler doesn't support __attribute__((nonnull))."
10445 echo "Your C compiler supports __attribute__((nonnull))."
10449 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10453 *) val="$d_attribute_nonnull" ;;
10455 set d_attribute_nonnull
10459 : Look for GCC-style attribute noreturn
10460 case "$d_attribute_noreturn" in
10463 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10464 $cat >attrib.c <<'EOCP'
10466 void fall_over_dead( void ) __attribute__((noreturn));
10468 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10469 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10470 echo "Your C compiler doesn't support __attribute__((noreturn))."
10473 echo "Your C compiler supports __attribute__((noreturn))."
10477 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10481 *) val="$d_attribute_noreturn" ;;
10483 set d_attribute_noreturn
10487 : Look for GCC-style attribute pure
10488 case "$d_attribute_pure" in
10491 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10492 $cat >attrib.c <<'EOCP'
10494 int square( int n ) __attribute__((pure));
10496 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10497 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10498 echo "Your C compiler doesn't support __attribute__((pure))."
10501 echo "Your C compiler supports __attribute__((pure))."
10505 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10509 *) val="$d_attribute_pure" ;;
10511 set d_attribute_pure
10515 : Look for GCC-style attribute unused
10516 case "$d_attribute_unused" in
10519 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10520 $cat >attrib.c <<'EOCP'
10522 int do_something( int dummy __attribute__((unused)), int n );
10524 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10525 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10526 echo "Your C compiler doesn't support __attribute__((unused))."
10529 echo "Your C compiler supports __attribute__((unused))."
10533 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10537 *) val="$d_attribute_unused" ;;
10539 set d_attribute_unused
10543 : Look for GCC-style attribute deprecated
10544 case "$d_attribute_deprecated" in
10547 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10548 $cat >attrib.c <<'EOCP'
10550 int I_am_deprecated(void) __attribute__((deprecated));
10552 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10553 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10554 echo "Your C compiler doesn't support __attribute__((deprecated))."
10557 echo "Your C compiler supports __attribute__((deprecated))."
10561 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10565 *) val="$d_attribute_deprecated" ;;
10567 set d_attribute_deprecated
10571 : Look for GCC-style attribute warn_unused_result
10572 case "$d_attribute_warn_unused_result" in
10575 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10576 $cat >attrib.c <<'EOCP'
10578 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10580 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10581 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10582 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10585 echo "Your C compiler supports __attribute__((warn_unused_result))."
10589 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10593 *) val="$d_attribute_warn_unused_result" ;;
10595 set d_attribute_warn_unused_result
10599 : see if bcmp exists
10603 : see if bcopy exists
10607 : see if getpgrp exists
10608 set getpgrp d_getpgrp
10611 case "$d_getpgrp" in
10614 echo "Checking to see which flavor of getpgrp is in use..."
10616 #$i_unistd I_UNISTD
10617 #include <sys/types.h>
10619 # include <unistd.h>
10621 #$i_stdlib I_STDLIB
10623 #include <stdlib.h>
10627 if (getuid() == 0) {
10628 printf("(I see you are running Configure as super-user...)\n");
10631 #ifdef TRY_BSD_PGRP
10632 if (getpgrp(1) == 0)
10641 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10642 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10644 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10645 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10648 echo "I can't seem to compile and run the test program."
10650 xxx="a USG one, i.e. you use getpgrp()."
10652 # SVR4 systems can appear rather BSD-ish.
10653 case "$i_unistd" in
10655 xxx="a BSD one, i.e. you use getpgrp(pid)."
10659 xxx="probably a USG one, i.e. you use getpgrp()."
10664 echo "Assuming your getpgrp is $xxx" >&4
10673 : see if setpgrp exists
10674 set setpgrp d_setpgrp
10677 case "$d_setpgrp" in
10680 echo "Checking to see which flavor of setpgrp is in use..."
10682 #$i_unistd I_UNISTD
10683 #include <sys/types.h>
10685 # include <unistd.h>
10687 #$i_stdlib I_STDLIB
10689 #include <stdlib.h>
10693 if (getuid() == 0) {
10694 printf("(I see you are running Configure as super-user...)\n");
10697 #ifdef TRY_BSD_PGRP
10698 if (-1 == setpgrp(1, 1))
10701 if (setpgrp() != -1)
10707 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10708 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10710 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10711 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10714 echo "(I can't seem to compile and run the test program.)"
10716 xxx="a USG one, i.e. you use setpgrp()."
10718 # SVR4 systems can appear rather BSD-ish.
10719 case "$i_unistd" in
10721 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10725 xxx="probably a USG one, i.e. you use setpgrp()."
10730 echo "Assuming your setpgrp is $xxx" >&4
10739 : Look for GCC-style __builtin_choose_expr
10740 case "$d_builtin_choose_expr" in
10743 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10744 $cat >try.c <<'EOCP'
10745 #include <assert.h>
10746 #include <stdlib.h>
10749 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10752 assert( SYRINX(1) == 2112 );
10753 assert( SYRINX(1) != 5150 );
10754 assert( SYRINX(0) == 5150 );
10755 assert( SYRINX(0) != 2112 );
10756 puts( "All good!" );
10762 if eval $compile && $run ./try; then
10763 echo "Your C compiler supports __builtin_choose_expr."
10766 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10770 *) val="$d_builtin_choose_expr" ;;
10773 set d_builtin_choose_expr
10777 : Look for GCC-style __builtin_expect
10778 case "$d_builtin_expect" in
10781 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10782 $cat >try.c <<'EOCP'
10785 if ( __builtin_expect(n, 0) ) n = 1;
10786 /* Remember shell exit code truth is 0, C truth is non-zero */
10791 if eval $compile && $run ./try; then
10792 echo "Your C compiler supports __builtin_expect."
10795 echo "Your C compiler doesn't seem to understand __builtin_expect."
10799 *) val="$d_builtin_expect" ;;
10802 set d_builtin_expect
10806 : see if bzero exists
10810 : see if stdarg is available
10812 if $test `./findhdr stdarg.h`; then
10813 echo "<stdarg.h> found." >&4
10816 echo "<stdarg.h> NOT found." >&4
10820 : see if varags is available
10822 if $test `./findhdr varargs.h`; then
10823 echo "<varargs.h> found." >&4
10825 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10828 : set up the varargs testing programs
10829 $cat > varargs.c <<EOP
10831 #include <stdarg.h>
10834 #include <varargs.h>
10838 int f(char *p, ...)
10852 p = va_arg(ap, char *);
10858 $cat > varargs <<EOP
10860 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10869 : now check which varargs header should be included
10874 if `./varargs I_STDARG`; then
10876 elif `./varargs I_VARARGS`; then
10881 if `./varargs I_VARARGS`; then
10888 echo "I could not find the definition for va_dcl... You have problems..." >&4
10889 val="$undef"; set i_stdarg; eval $setvar
10890 val="$undef"; set i_varargs; eval $setvar
10895 case "$i_varhdr" in
10897 val="$define"; set i_stdarg; eval $setvar
10898 val="$undef"; set i_varargs; eval $setvar
10901 val="$undef"; set i_stdarg; eval $setvar
10902 val="$define"; set i_varargs; eval $setvar
10905 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10909 : see if the Compiler supports C99 variadic macros
10910 case "$i_stdarg$i_stdlib" in
10912 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10915 #include <stdarg.h>
10917 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10921 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10927 if eval $compile && $run ./try 2>&1 >/dev/null; then
10928 case "`$run ./try`" in
10930 echo "You have C99 variadic macros." >&4
10931 d_c99_variadic_macros="$define"
10934 echo "You don't have functional C99 variadic macros." >&4
10935 d_c99_variadic_macros="$undef"
10939 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10940 d_c99_variadic_macros="$undef"
10945 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10946 d_c99_variadic_macros="$undef"
10950 : see if signal is declared as pointer to function returning int or void
10952 xxx=`./findhdr signal.h`
10953 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10954 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10955 echo "You have int (*signal())() instead of void." >&4
10957 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10958 echo "You have void (*signal())()." >&4
10960 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10961 echo "You have int (*signal())() instead of void." >&4
10963 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10964 echo "You have void (*signal())()." >&4
10967 case "$d_voidsig" in
10969 echo "I can't determine whether signal handler returns void or int..." >&4
10971 rp="What type does your signal handler return?"
10974 v*) val="$define";;
10978 echo "As you already told me, signal handler returns void." >&4
10981 *) echo "As you already told me, signal handler returns int." >&4
10988 case "$d_voidsig" in
10989 "$define") signal_t="void";;
10990 *) signal_t="int";;
10994 : check for ability to cast large floats to 32-bit ints.
10996 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10997 if $test "$intsize" -ge 4; then
11004 #$i_stdlib I_STDLIB
11006 #include <stdlib.h>
11008 #include <sys/types.h>
11009 #include <signal.h>
11010 $signal_t blech(int s) { exit(3); }
11017 signal(SIGFPE, blech);
11019 /* Don't let compiler optimize the test away. Store the number
11020 in a writable string for gcc to pass to sscanf under HP-UX.
11022 sprintf(str, "2147483647");
11023 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11027 /* x86 processors will probably give 0x8000 0000, which is a
11028 sign change. We don't want that. We want to mimic SPARC
11029 behavior here, which is to preserve the sign and give
11032 if (i32 != ($xxx) f)
11038 if eval $compile_ok; then
11042 echo "(I can't seem to compile the test program--assuming it can't)"
11047 echo "Yup, it can."
11050 echo "Nope, it can't."
11057 : check for ability to cast negative floats to unsigned
11059 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11062 #$i_stdlib I_STDLIB
11064 #include <stdlib.h>
11066 #include <sys/types.h>
11067 #include <signal.h>
11068 $signal_t blech(int s) { exit(7); }
11069 $signal_t blech_in_list(int s) { exit(4); }
11070 unsigned long dummy_long(unsigned long p) { return p; }
11071 unsigned int dummy_int(unsigned int p) { return p; }
11072 unsigned short dummy_short(unsigned short p) { return p; }
11076 unsigned long along;
11078 unsigned short ashort;
11082 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11083 a direct f = -123. assignment. gcc-2.8.0 reportedly
11084 optimized the whole file away
11086 /* Store the number in a writable string for gcc to pass to
11087 sscanf under HP-UX.
11089 sprintf(str, "-123");
11090 sscanf(str, "%lf", &f); /* f = -123.; */
11092 signal(SIGFPE, blech);
11093 along = (unsigned long)f;
11094 aint = (unsigned int)f;
11095 ashort = (unsigned short)f;
11096 if (along != (unsigned long)-123)
11098 if (aint != (unsigned int)-123)
11100 if (ashort != (unsigned short)-123)
11102 sprintf(str, "1073741824.");
11103 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11106 along = (unsigned long)f;
11107 if (along != 0x80000000)
11111 along = (unsigned long)f;
11112 if (along != 0x7fffffff)
11116 along = (unsigned long)f;
11117 if (along != 0x80000001)
11121 signal(SIGFPE, blech_in_list);
11122 sprintf(str, "123.");
11123 sscanf(str, "%lf", &f); /* f = 123.; */
11124 along = dummy_long((unsigned long)f);
11125 aint = dummy_int((unsigned int)f);
11126 ashort = dummy_short((unsigned short)f);
11127 if (along != (unsigned long)123)
11129 if (aint != (unsigned int)123)
11131 if (ashort != (unsigned short)123)
11138 if eval $compile_ok; then
11142 echo "(I can't seem to compile the test program--assuming it can't)"
11145 case "$castflags" in
11147 echo "Yup, it can."
11150 echo "Nope, it can't."
11157 : see if vprintf exists
11159 if set vprintf val -f d_vprintf; eval $csym; $val; then
11160 echo 'vprintf() found.' >&4
11163 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11164 #$i_varargs I_VARARGS
11166 #$i_stdlib I_STDLIB
11167 #$i_unistd I_UNISTD
11170 # include <stdarg.h>
11171 #else /* I_VARARGS */
11172 # include <varargs.h>
11176 # include <unistd.h>
11180 # include <stdlib.h>
11183 #include <stdio.h> /* vsprintf prototype */
11186 void xxx(int n, ...)
11191 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11193 int main() { xxx(1, "foo"); }
11195 #else /* I_VARARGS */
11203 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11205 int main() { xxx("foo"); }
11211 if eval $compile_ok; then
11212 if $run ./try; then
11213 echo "Your vsprintf() returns (int)." >&4
11216 echo "Your vsprintf() returns (char*)." >&4
11220 echo 'I am unable to compile the vsprintf() test program.' >&4
11221 # We shouldn't get here. If we do, assume the standard signature,
11222 # not the old BSD one.
11223 echo 'Guessing that vsprintf() returns (int).' >&4
11227 echo 'vprintf() NOT found.' >&4
11238 : see if chown exists
11242 : see if chroot exists
11243 set chroot d_chroot
11246 : see if chsize exists
11247 set chsize d_chsize
11250 : see if class exists
11254 : see if clearenv exists
11255 set clearenv d_clearenv
11258 : Define hasstruct macro for Configure internal use
11259 hasstruct='varname=$1; struct=$2; shift; shift;
11260 while $test $# -ge 2; do
11262 $define) echo "#include <$2>";;
11266 echo "int main () { struct $struct foo; }" >> try.c;
11268 if eval $compile; then
11277 : see whether socket exists
11281 $echo $n "Hmm... $c" >&4
11282 if set socket val -f d_socket; eval $csym; $val; then
11283 echo "Looks like you have Berkeley networking support." >&4
11285 if set setsockopt val -f; eval $csym; $val; then
11288 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11289 d_oldsock="$define"
11292 if $contains socklib libc.list >/dev/null 2>&1; then
11293 echo "Looks like you have Berkeley networking support." >&4
11295 : we will have to assume that it supports the 4.2 BSD interface
11298 echo "You don't have Berkeley networking in libc$_a..." >&4
11299 if test "X$d_socket" = "X$define"; then
11300 echo "...but you seem to believe that you have sockets." >&4
11302 for net in net socket
11304 if test -f /usr/lib/lib$net$_a; then
11305 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11306 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11307 if $contains socket libc.list >/dev/null 2>&1; then
11312 echo "...but the Wollongong group seems to have hacked it in." >&4
11313 sockethdr="-I/usr/netinclude"
11316 echo "Found Berkeley sockets interface in lib$net." >&4
11317 if $contains setsockopt libc.list >/dev/null 2>&1; then
11320 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11321 d_oldsock="$define"
11327 if test "X$d_socket" != "X$define"; then
11328 echo "or anywhere else I see." >&4
11336 : see if socketpair exists
11337 set socketpair d_sockpair
11342 echo "Checking the availability of certain socket constants..." >&4
11343 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11344 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11346 #include <sys/types.h>
11347 #include <sys/socket.h>
11353 set try; if eval $compile; then
11356 set d_${enum}; eval $setvar
11360 : see if this is a sys/uio.h system
11361 set sys/uio.h i_sysuio
11364 : Check for cmsghdr support
11366 echo "Checking to see if your system supports struct cmsghdr..." >&4
11367 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11369 case "$d_cmsghdr_s" in
11370 "$define") echo "Yes, it does." ;;
11371 *) echo "No, it doesn't." ;;
11375 : check for const keyword
11377 echo 'Checking to see if your C compiler knows about "const"...' >&4
11378 $cat >const.c <<'EOCP'
11379 typedef struct spug { int drokk; } spug;
11383 const spug y = { 0 };
11386 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11388 echo "Yup, it does."
11391 echo "Nope, it doesn't."
11396 : see if copysignl exists
11397 set copysignl d_copysignl
11400 : see if crypt exists
11405 $define) cryptlib='' ;;
11406 *) if set crypt val -f d_crypt; eval $csym; $val; then
11407 echo 'crypt() found.' >&4
11411 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11412 if $test -z "$cryptlib"; then
11413 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11417 if $test -z "$cryptlib"; then
11418 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11422 if $test -z "$cryptlib"; then
11423 cryptlib=`./loc libcrypt$_a "" $libpth`
11427 if $test -z "$cryptlib"; then
11428 echo 'crypt() NOT found.' >&4
11439 : see if this is a crypt.h system
11440 set crypt.h i_crypt
11443 : see if crypt_r exists
11444 set crypt_r d_crypt_r
11446 case "$d_crypt_r" in
11448 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11449 case "$d_crypt_r_proto:$usethreads" in
11450 ":define") d_crypt_r_proto=define
11451 set d_crypt_r_proto crypt_r $hdrs
11455 case "$d_crypt_r_proto" in
11457 case "$crypt_r_proto" in
11458 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11459 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11461 case "$crypt_r_proto" in
11462 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11463 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11465 case "$crypt_r_proto" in
11466 ''|0) d_crypt_r=undef
11468 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11469 * ) case "$crypt_r_proto" in
11470 REENTRANT_PROTO*) ;;
11471 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11473 echo "Prototype: $try" ;;
11476 *) case "$usethreads" in
11477 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11488 : get csh whereabouts
11490 'csh') val="$undef" ;;
11491 *) val="$define" ;;
11495 : Respect a hint or command line value for full_csh.
11496 case "$full_csh" in
11497 '') full_csh=$csh ;;
11500 : see if ctermid exists
11501 set ctermid d_ctermid
11504 : see if ctermid_r exists
11505 set ctermid_r d_ctermid_r
11507 case "$d_ctermid_r" in
11509 hdrs="$i_systypes sys/types.h define stdio.h "
11510 case "$d_ctermid_r_proto:$usethreads" in
11511 ":define") d_ctermid_r_proto=define
11512 set d_ctermid_r_proto ctermid_r $hdrs
11516 case "$d_ctermid_r_proto" in
11518 case "$ctermid_r_proto" in
11519 ''|0) try='char* ctermid_r(char*);'
11520 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11522 case "$ctermid_r_proto" in
11523 ''|0) d_ctermid_r=undef
11525 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11526 * ) case "$ctermid_r_proto" in
11527 REENTRANT_PROTO*) ;;
11528 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11530 echo "Prototype: $try" ;;
11533 *) case "$usethreads" in
11534 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11541 *) ctermid_r_proto=0
11545 : see if ctime_r exists
11546 set ctime_r d_ctime_r
11548 case "$d_ctime_r" in
11550 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11551 case "$d_ctime_r_proto:$usethreads" in
11552 ":define") d_ctime_r_proto=define
11553 set d_ctime_r_proto ctime_r $hdrs
11557 case "$d_ctime_r_proto" in
11559 case "$ctime_r_proto" in
11560 ''|0) try='char* ctime_r(const time_t*, char*);'
11561 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11563 case "$ctime_r_proto" in
11564 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11565 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11567 case "$ctime_r_proto" in
11568 ''|0) try='int ctime_r(const time_t*, char*);'
11569 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11571 case "$ctime_r_proto" in
11572 ''|0) try='int ctime_r(const time_t*, char*, int);'
11573 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11575 case "$ctime_r_proto" in
11576 ''|0) d_ctime_r=undef
11578 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11579 * ) case "$ctime_r_proto" in
11580 REENTRANT_PROTO*) ;;
11581 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11583 echo "Prototype: $try" ;;
11586 *) case "$usethreads" in
11587 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11598 : see if cuserid exists
11599 set cuserid d_cuserid
11602 : see if this is a limits.h system
11603 set limits.h i_limits
11606 : see if this is a float.h system
11607 set float.h i_float
11610 : See if number of significant digits in a double precision number is known
11612 $cat >dbl_dig.c <<EOM
11613 #$i_limits I_LIMITS
11616 #include <limits.h>
11622 printf("Contains DBL_DIG");
11625 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11626 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11627 echo "DBL_DIG found." >&4
11630 echo "DBL_DIG NOT found." >&4
11637 : see if dbm.h is available
11638 : see if dbmclose exists
11639 set dbmclose d_dbmclose
11642 case "$d_dbmclose" in
11652 *) set rpcsvc/dbm.h i_rpcsvcdbm
11657 *) echo "We won't be including <dbm.h>"
11667 : see if prototype for dbminit is available
11669 set d_dbminitproto dbminit $i_dbm dbm.h
11672 : see if difftime exists
11673 set difftime d_difftime
11676 : see if this is a dirent system
11678 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11680 echo "<dirent.h> found." >&4
11683 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11684 echo "<sys/dir.h> found." >&4
11687 xinc=`./findhdr sys/ndir.h`
11689 echo "<dirent.h> NOT found." >&4
11694 : Look for type of directory structure.
11696 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11698 case "$direntrytype" in
11700 case "$i_dirent" in
11701 $define) guess1='struct dirent' ;;
11702 *) guess1='struct direct' ;;
11705 *) guess1="$direntrytype"
11710 'struct dirent') guess2='struct direct' ;;
11711 *) guess2='struct dirent' ;;
11714 if $contains "$guess1" try.c >/dev/null 2>&1; then
11715 direntrytype="$guess1"
11716 echo "Your directory entries are $direntrytype." >&4
11717 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11718 direntrytype="$guess2"
11719 echo "Your directory entries seem to be $direntrytype." >&4
11721 echo "I don't recognize your system's directory entries." >&4
11722 rp="What type is used for directory entries on this system?"
11725 direntrytype="$ans"
11729 : see if the directory entry stores field length
11731 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11732 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11733 echo "Good, your directory entry keeps length information in d_namlen." >&4
11736 echo "Your directory entry does not know about the d_namlen field." >&4
11743 : Look for DIR.dd_fd
11744 case "$i_dirent" in
11746 echo "Checking to see if DIR has a dd_fd member variable" >&4
11748 #$i_stdlib I_STDLIB
11750 #include <stdlib.h>
11752 #include <dirent.h>
11762 if eval $compile; then
11763 echo "Yes, it does."
11766 echo "No, it does not."
11771 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11779 : see if this is an sysdir system
11780 set sys/dir.h i_sysdir
11783 : see if this is an sysndir system
11784 set sys/ndir.h i_sysndir
11789 $cat >dirfd.c <<EOM
11791 #$i_stdlib I_STDLIB
11793 #include <stdlib.h>
11795 #$i_dirent I_DIRENT /**/
11796 #$i_sysdir I_SYS_DIR /**/
11797 #$i_sysndir I_SYS_NDIR /**/
11798 #$i_systypes I_SYS_TYPES /**/
11799 #if defined(I_SYS_TYPES)
11800 #include <sys/types.h>
11802 #if defined(I_DIRENT)
11803 #include <dirent.h>
11804 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11805 #include <sys/dir.h>
11809 #include <sys/ndir.h>
11813 #include <ndir.h> /* may be wrong in the future */
11815 #include <sys/dir.h>
11821 DIR *dirp = opendir(".");
11822 if (dirfd(dirp) >= 0)
11830 if eval $compile; then
11834 $define) echo "dirfd() found." >&4 ;;
11835 *) echo "dirfd() NOT found." >&4 ;;
11841 : see if dlerror exists
11844 set dlerror d_dlerror
11848 : see if dlfcn is available
11849 set dlfcn.h i_dlfcn
11852 : Check what extension to use for shared libs
11857 On a few systems, the dynamically loaded modules that perl generates and uses
11858 will need a different extension than shared libs. The default will probably
11864 *) dflt="$dlext" ;;
11866 rp='What is the extension of dynamically loaded modules'
11875 : Check if dlsym need a leading underscore
11881 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11882 $cat >dyna.c <<'EOM'
11889 #$i_stdlib I_STDLIB
11891 #include <stdlib.h>
11895 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11897 #include <sys/types.h>
11902 extern int fred() ;
11911 int mode = RTLD_LAZY ;
11913 handle = dlopen("./dyna.$dlext", mode) ;
11914 if (handle == NULL) {
11919 symbol = dlsym(handle, "fred") ;
11920 if (symbol == NULL) {
11921 /* try putting a leading underscore */
11922 symbol = dlsym(handle, "_fred") ;
11923 if (symbol == NULL) {
11936 : Call the object file tmp-dyna.o in case dlext=o.
11937 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11938 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11939 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11940 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11943 1) echo "Test program failed using dlopen." >&4
11944 echo "Perhaps you should not use dynamic loading." >&4;;
11945 2) echo "Test program failed using dlsym." >&4
11946 echo "Perhaps you should not use dynamic loading." >&4;;
11947 3) echo "dlsym needs a leading underscore" >&4
11949 4) echo "dlsym doesn't need a leading underscore." >&4;;
11952 echo "I can't compile and run the test program." >&4
11953 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11958 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11963 : see if drand48_r exists
11964 set drand48_r d_drand48_r
11966 case "$d_drand48_r" in
11968 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11969 case "$d_drand48_r_proto:$usethreads" in
11970 ":define") d_drand48_r_proto=define
11971 set d_drand48_r_proto drand48_r $hdrs
11975 case "$d_drand48_r_proto" in
11977 case "$drand48_r_proto" in
11978 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11979 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
11981 case "$drand48_r_proto" in
11982 ''|0) d_drand48_r=undef
11984 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11985 * ) case "$drand48_r_proto" in
11986 REENTRANT_PROTO*) ;;
11987 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11989 echo "Prototype: $try" ;;
11992 *) case "$usethreads" in
11993 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12000 *) drand48_r_proto=0
12004 : see if prototype for drand48 is available
12006 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12009 : see if dup2 exists
12013 : see if eaccess exists
12014 set eaccess d_eaccess
12017 : see if endgrent exists
12018 set endgrent d_endgrent
12021 : see if this is an grp system
12027 xxx=`./findhdr grp.h`
12028 $cppstdin $cppflags $cppminus < $xxx >$$.h
12030 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12042 set d_grpasswd; eval $setvar
12046 : see if endgrent_r exists
12047 set endgrent_r d_endgrent_r
12049 case "$d_endgrent_r" in
12051 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12052 case "$d_endgrent_r_proto:$usethreads" in
12053 ":define") d_endgrent_r_proto=define
12054 set d_endgrent_r_proto endgrent_r $hdrs
12058 case "$d_endgrent_r_proto" in
12060 case "$endgrent_r_proto" in
12061 ''|0) try='int endgrent_r(FILE**);'
12062 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12064 case "$endgrent_r_proto" in
12065 ''|0) try='void endgrent_r(FILE**);'
12066 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12068 case "$endgrent_r_proto" in
12069 ''|0) d_endgrent_r=undef
12071 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12072 * ) case "$endgrent_r_proto" in
12073 REENTRANT_PROTO*) ;;
12074 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12076 echo "Prototype: $try" ;;
12079 *) case "$usethreads" in
12080 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12087 *) endgrent_r_proto=0
12091 : see if endhostent exists
12092 set endhostent d_endhent
12095 : see if this is a netdb.h system
12096 set netdb.h i_netdb
12099 : see if endhostent_r exists
12100 set endhostent_r d_endhostent_r
12102 case "$d_endhostent_r" in
12104 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12105 case "$d_endhostent_r_proto:$usethreads" in
12106 ":define") d_endhostent_r_proto=define
12107 set d_endhostent_r_proto endhostent_r $hdrs
12111 case "$d_endhostent_r_proto" in
12113 case "$endhostent_r_proto" in
12114 ''|0) try='int endhostent_r(struct hostent_data*);'
12115 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12117 case "$endhostent_r_proto" in
12118 ''|0) try='void endhostent_r(struct hostent_data*);'
12119 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12121 case "$endhostent_r_proto" in
12122 ''|0) d_endhostent_r=undef
12123 endhostent_r_proto=0
12124 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12125 * ) case "$endhostent_r_proto" in
12126 REENTRANT_PROTO*) ;;
12127 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12129 echo "Prototype: $try" ;;
12132 *) case "$usethreads" in
12133 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12135 d_endhostent_r=undef
12136 endhostent_r_proto=0
12140 *) endhostent_r_proto=0
12144 : see if endnetent exists
12145 set endnetent d_endnent
12148 : see if endnetent_r exists
12149 set endnetent_r d_endnetent_r
12151 case "$d_endnetent_r" in
12153 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12154 case "$d_endnetent_r_proto:$usethreads" in
12155 ":define") d_endnetent_r_proto=define
12156 set d_endnetent_r_proto endnetent_r $hdrs
12160 case "$d_endnetent_r_proto" in
12162 case "$endnetent_r_proto" in
12163 ''|0) try='int endnetent_r(struct netent_data*);'
12164 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12166 case "$endnetent_r_proto" in
12167 ''|0) try='void endnetent_r(struct netent_data*);'
12168 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12170 case "$endnetent_r_proto" in
12171 ''|0) d_endnetent_r=undef
12172 endnetent_r_proto=0
12173 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12174 * ) case "$endnetent_r_proto" in
12175 REENTRANT_PROTO*) ;;
12176 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12178 echo "Prototype: $try" ;;
12181 *) case "$usethreads" in
12182 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12184 d_endnetent_r=undef
12185 endnetent_r_proto=0
12189 *) endnetent_r_proto=0
12193 : see if endprotoent exists
12194 set endprotoent d_endpent
12197 : see if endprotoent_r exists
12198 set endprotoent_r d_endprotoent_r
12200 case "$d_endprotoent_r" in
12202 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12203 case "$d_endprotoent_r_proto:$usethreads" in
12204 ":define") d_endprotoent_r_proto=define
12205 set d_endprotoent_r_proto endprotoent_r $hdrs
12209 case "$d_endprotoent_r_proto" in
12211 case "$endprotoent_r_proto" in
12212 ''|0) try='int endprotoent_r(struct protoent_data*);'
12213 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12215 case "$endprotoent_r_proto" in
12216 ''|0) try='void endprotoent_r(struct protoent_data*);'
12217 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12219 case "$endprotoent_r_proto" in
12220 ''|0) d_endprotoent_r=undef
12221 endprotoent_r_proto=0
12222 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12223 * ) case "$endprotoent_r_proto" in
12224 REENTRANT_PROTO*) ;;
12225 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12227 echo "Prototype: $try" ;;
12230 *) case "$usethreads" in
12231 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12233 d_endprotoent_r=undef
12234 endprotoent_r_proto=0
12238 *) endprotoent_r_proto=0
12242 : see if endpwent exists
12243 set endpwent d_endpwent
12246 : see if this is a pwd.h system
12252 xxx=`./findhdr pwd.h`
12253 $cppstdin $cppflags $cppminus < $xxx >$$.h
12255 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12263 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12271 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12279 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12287 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12295 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12303 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12311 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12323 set d_pwquota; eval $setvar
12324 set d_pwage; eval $setvar
12325 set d_pwchange; eval $setvar
12326 set d_pwclass; eval $setvar
12327 set d_pwexpire; eval $setvar
12328 set d_pwcomment; eval $setvar
12329 set d_pwgecos; eval $setvar
12330 set d_pwpasswd; eval $setvar
12334 : see if endpwent_r exists
12335 set endpwent_r d_endpwent_r
12337 case "$d_endpwent_r" in
12339 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12340 case "$d_endpwent_r_proto:$usethreads" in
12341 ":define") d_endpwent_r_proto=define
12342 set d_endpwent_r_proto endpwent_r $hdrs
12346 case "$d_endpwent_r_proto" in
12348 case "$endpwent_r_proto" in
12349 ''|0) try='int endpwent_r(FILE**);'
12350 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12352 case "$endpwent_r_proto" in
12353 ''|0) try='void endpwent_r(FILE**);'
12354 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12356 case "$endpwent_r_proto" in
12357 ''|0) d_endpwent_r=undef
12359 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12360 * ) case "$endpwent_r_proto" in
12361 REENTRANT_PROTO*) ;;
12362 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12364 echo "Prototype: $try" ;;
12367 *) case "$usethreads" in
12368 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12375 *) endpwent_r_proto=0
12379 : see if endservent exists
12380 set endservent d_endsent
12383 : see if endservent_r exists
12384 set endservent_r d_endservent_r
12386 case "$d_endservent_r" in
12388 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12389 case "$d_endservent_r_proto:$usethreads" in
12390 ":define") d_endservent_r_proto=define
12391 set d_endservent_r_proto endservent_r $hdrs
12395 case "$d_endservent_r_proto" in
12397 case "$endservent_r_proto" in
12398 ''|0) try='int endservent_r(struct servent_data*);'
12399 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12401 case "$endservent_r_proto" in
12402 ''|0) try='void endservent_r(struct servent_data*);'
12403 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12405 case "$endservent_r_proto" in
12406 ''|0) d_endservent_r=undef
12407 endservent_r_proto=0
12408 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12409 * ) case "$endservent_r_proto" in
12410 REENTRANT_PROTO*) ;;
12411 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12413 echo "Prototype: $try" ;;
12416 *) case "$usethreads" in
12417 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12419 d_endservent_r=undef
12420 endservent_r_proto=0
12424 *) endservent_r_proto=0
12428 : Locate the flags for 'open()'
12431 #include <sys/types.h>
12436 #include <sys/file.h>
12438 #$i_stdlib I_STDLIB
12440 #include <stdlib.h>
12451 : check sys/file.h first to get FREAD on Sun
12452 if $test `./findhdr sys/file.h` && \
12453 set try -DI_SYS_FILE && eval $compile; then
12455 echo "<sys/file.h> defines the O_* constants..." >&4
12456 if $run ./try; then
12457 echo "and you have the 3 argument form of open()." >&4
12460 echo "but not the 3 argument form of open(). Oh, well." >&4
12463 elif $test `./findhdr fcntl.h` && \
12464 set try -DI_FCNTL && eval $compile; then
12466 echo "<fcntl.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
12476 echo "I can't find the O_* constant definitions! You got problems." >&4
12482 : see if this is a sys/file.h system
12487 : do we need to include sys/file.h ?
12491 if $h_sysfile; then
12493 echo "We'll be including <sys/file.h>." >&4
12496 echo "We won't be including <sys/file.h>." >&4
12506 : see if fcntl.h is there
12511 : see if we can include fcntl.h
12517 echo "We'll be including <fcntl.h>." >&4
12520 if $h_sysfile; then
12521 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12523 echo "We won't be including <fcntl.h>." >&4
12535 : see if fork exists
12539 : see if pipe exists
12543 : check for non-blocking I/O stuff
12544 case "$h_sysfile" in
12545 true) echo "#include <sys/file.h>" > head.c;;
12548 true) echo "#include <fcntl.h>" > head.c;;
12549 *) echo "#include <sys/fcntl.h>" > head.c;;
12554 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12555 case "$o_nonblock" in
12557 $cat head.c > try.c
12558 $cat >>try.c <<EOCP
12560 #$i_stdlib I_STDLIB
12562 #include <stdlib.h>
12570 printf("O_NONBLOCK\n");
12574 printf("O_NDELAY\n");
12578 printf("FNDELAY\n");
12585 if eval $compile_ok; then
12586 o_nonblock=`$run ./try`
12587 case "$o_nonblock" in
12588 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12589 *) echo "Seems like we can use $o_nonblock.";;
12592 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12595 *) echo "Using $hint value $o_nonblock.";;
12600 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12603 case "$d_fork:$d_pipe" in
12605 $cat head.c > try.c
12606 $cat >>try.c <<EOCP
12608 #include <sys/types.h>
12609 #include <signal.h>
12611 #$i_stdlib I_STDLIB
12613 #include <stdlib.h>
12619 #define MY_O_NONBLOCK $o_nonblock
12620 #ifndef errno /* XXX need better Configure test */
12623 #$i_unistd I_UNISTD
12625 #include <unistd.h>
12627 #$i_string I_STRING
12629 #include <string.h>
12631 #include <strings.h>
12633 $signal_t blech(int x) { exit(3); }
12635 $cat >> try.c <<'EOCP'
12643 pipe(pd); /* Down: child -> parent */
12644 pipe(pu); /* Up: parent -> child */
12647 close(pd[1]); /* Parent reads from pd[0] */
12648 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12650 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12655 signal(SIGALRM, blech);
12657 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12659 sprintf(string, "%d\n", ret);
12660 write(2, string, strlen(string));
12663 if (errno == EAGAIN) {
12664 printf("EAGAIN\n");
12669 if (errno == EWOULDBLOCK)
12670 printf("EWOULDBLOCK\n");
12673 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12674 sleep(2); /* Give it time to close our pipe */
12676 ret = read(pd[0], buf, 1); /* Should read EOF */
12678 sprintf(string, "%d\n", ret);
12679 write(4, string, strlen(string));
12683 close(pd[0]); /* We write to pd[1] */
12684 close(pu[1]); /* We read from pu[0] */
12685 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12686 close(pd[1]); /* Pipe pd is now fully closed! */
12687 exit(0); /* Bye bye, thank you for playing! */
12691 if eval $compile_ok; then
12692 echo "$startsh" >mtry
12693 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12695 ./mtry >/dev/null 2>&1
12697 0) eagain=`$cat try.out`;;
12698 1) echo "Could not perform non-blocking setting!";;
12699 2) echo "I did a successful read() for something that was not there!";;
12700 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12701 4) echo "Could not find F_SETFL!";;
12702 *) echo "Something terribly wrong happened during testing.";;
12704 rd_nodata=`$cat try.ret`
12705 echo "A read() system call with no data present returns $rd_nodata."
12706 case "$rd_nodata" in
12709 echo "(That's peculiar, fixing that to be -1.)"
12715 echo "Forcing errno EAGAIN on read() with no data available."
12719 echo "Your read() sets errno to $eagain when no data is available."
12722 status=`$cat try.err`
12724 0) echo "And it correctly returns 0 to signal EOF.";;
12725 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12726 *) echo "However, your read() returns '$status' on EOF??";;
12729 if test "$status" = "$rd_nodata"; then
12730 echo "WARNING: you can't distinguish between EOF and no data!"
12734 echo "I can't compile the test program--assuming errno EAGAIN will do."
12738 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12747 echo "Using $hint value $eagain."
12748 echo "Your read() returns $rd_nodata when no data is present."
12749 case "$d_eofnblk" in
12750 "$define") echo "And you can see EOF because read() returns 0.";;
12751 "$undef") echo "But you can't see EOF status from read() returned value.";;
12753 echo "(Assuming you can't see EOF status from read anyway.)"
12759 $rm_try head.c mtry
12761 : see if _ptr and _cnt from stdio act std
12764 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12765 echo "(Looks like you have stdio.h from BSD.)"
12766 case "$stdio_ptr" in
12767 '') stdio_ptr='((fp)->_p)'
12770 *) ptr_lval=$d_stdio_ptr_lval;;
12772 case "$stdio_cnt" in
12773 '') stdio_cnt='((fp)->_r)'
12776 *) cnt_lval=$d_stdio_cnt_lval;;
12778 case "$stdio_base" in
12779 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12781 case "$stdio_bufsiz" in
12782 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12784 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12785 echo "(Looks like you have stdio.h from Linux.)"
12786 case "$stdio_ptr" in
12787 '') stdio_ptr='((fp)->_IO_read_ptr)'
12790 *) ptr_lval=$d_stdio_ptr_lval;;
12792 case "$stdio_cnt" in
12793 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12796 *) cnt_lval=$d_stdio_cnt_lval;;
12798 case "$stdio_base" in
12799 '') stdio_base='((fp)->_IO_read_base)';;
12801 case "$stdio_bufsiz" in
12802 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12805 case "$stdio_ptr" in
12806 '') stdio_ptr='((fp)->_ptr)'
12809 *) ptr_lval=$d_stdio_ptr_lval;;
12811 case "$stdio_cnt" in
12812 '') stdio_cnt='((fp)->_cnt)'
12815 *) cnt_lval=$d_stdio_cnt_lval;;
12817 case "$stdio_base" in
12818 '') stdio_base='((fp)->_base)';;
12820 case "$stdio_bufsiz" in
12821 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12825 : test whether _ptr and _cnt really work
12826 echo "Checking how std your stdio is..." >&4
12829 #$i_stdlib I_STDLIB
12831 #include <stdlib.h>
12833 #define FILE_ptr(fp) $stdio_ptr
12834 #define FILE_cnt(fp) $stdio_cnt
12836 FILE *fp = fopen("try.c", "r");
12839 18 <= FILE_cnt(fp) &&
12840 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12848 if eval $compile && $to try.c; then
12849 if $run ./try; then
12850 echo "Your stdio acts pretty std."
12853 echo "Your stdio isn't very std."
12856 echo "Your stdio doesn't appear very std."
12860 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12861 # direct buffer manipulation no longer works. The Configure tests
12862 # should be changed to correctly detect this, but until then,
12863 # the following check should at least let perl compile and run.
12864 # (This quick fix should be updated before 5.8.1.)
12865 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12866 # A. Dougherty, June 3, 2002.
12867 case "$d_gnulibc" in
12869 case "$gnulibc_version" in
12873 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12882 : Can _ptr be used as an lvalue?
12883 case "$d_stdstdio$ptr_lval" in
12884 $define$define) val=$define ;;
12887 set d_stdio_ptr_lval
12890 : Can _cnt be used as an lvalue?
12891 case "$d_stdstdio$cnt_lval" in
12892 $define$define) val=$define ;;
12895 set d_stdio_cnt_lval
12899 : test whether setting _ptr sets _cnt as a side effect
12900 d_stdio_ptr_lval_sets_cnt="$undef"
12901 d_stdio_ptr_lval_nochange_cnt="$undef"
12902 case "$d_stdio_ptr_lval$d_stdstdio" in
12904 echo "Checking to see what happens if we set the stdio ptr..." >&4
12907 /* Can we scream? */
12908 /* Eat dust sed :-) */
12909 /* In the buffer space, no one can hear you scream. */
12910 #$i_stdlib I_STDLIB
12912 #include <stdlib.h>
12914 #define FILE_ptr(fp) $stdio_ptr
12915 #define FILE_cnt(fp) $stdio_cnt
12916 #include <sys/types.h>
12918 FILE *fp = fopen("try.c", "r");
12923 puts("Fail even to read");
12926 c = getc(fp); /* Read away the first # */
12928 puts("Fail even to read");
12932 18 <= FILE_cnt(fp) &&
12933 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12935 puts("Fail even to read");
12938 ptr = (char*) FILE_ptr(fp);
12939 cnt = (size_t)FILE_cnt(fp);
12941 FILE_ptr(fp) += 42;
12943 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12944 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12947 if (FILE_cnt(fp) <= 20) {
12948 printf ("Fail (<20 chars to test)");
12951 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12952 puts("Fail compare");
12955 if (cnt == FILE_cnt(fp)) {
12956 puts("Pass_unchanged");
12959 if (FILE_cnt(fp) == (cnt - 42)) {
12960 puts("Pass_changed");
12963 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12969 if eval $compile && $to try.c; then
12970 case `$run ./try` in
12972 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12973 d_stdio_ptr_lval_sets_cnt="$define" ;;
12975 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12976 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12978 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12980 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12983 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12989 : see if _base is also standard
12991 case "$d_stdstdio" in
12995 #$i_stdlib I_STDLIB
12997 #include <stdlib.h>
12999 #define FILE_base(fp) $stdio_base
13000 #define FILE_bufsiz(fp) $stdio_bufsiz
13002 FILE *fp = fopen("try.c", "r");
13005 19 <= FILE_bufsiz(fp) &&
13006 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13013 if eval $compile && $to try.c; then
13014 if $run ./try; then
13015 echo "And its _base field acts std."
13018 echo "But its _base field isn't std."
13021 echo "However, it seems to be lacking the _base field."
13029 : see if fast_stdio exists
13031 case "$d_stdstdio:$d_stdio_ptr_lval" in
13033 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13035 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13046 : see if fchdir exists
13047 set fchdir d_fchdir
13050 : see if fchmod exists
13051 set fchmod d_fchmod
13054 : see if fchown exists
13055 set fchown d_fchown
13058 : see if this is an fcntl system
13062 : See if fcntl-based locking works.
13065 #$i_stdlib I_STDLIB
13067 #include <stdlib.h>
13069 #include <unistd.h>
13071 #include <signal.h>
13072 $signal_t blech(int x) { exit(3); }
13074 #if defined(F_SETLK) && defined(F_SETLKW)
13075 struct flock flock;
13077 fd = open("try.c", O_RDONLY);
13078 flock.l_type = F_RDLCK;
13079 flock.l_whence = SEEK_SET;
13080 flock.l_start = flock.l_len = 0;
13081 signal(SIGALRM, blech);
13083 retval = fcntl(fd, F_SETLK, &flock);
13085 (retval < 0 ? exit(2) : exit(0));
13091 echo "Checking if fcntl-based file locking works... "
13095 if eval $compile_ok; then
13096 if $run ./try; then
13097 echo "Yes, it seems to work."
13100 echo "Nope, it didn't work."
13105 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13106 *** This is (almost) impossible.
13107 *** If your NFS lock daemons are not feeling well, something like
13108 *** this may happen, please investigate. Cannot continue, aborting.
13116 echo "I'm unable to compile the test program, so I'll assume not."
13121 echo "Nope, since you don't even have fcntl()."
13124 set d_fcntl_can_lock
13128 : check for fd_set items
13131 Checking to see how well your C compiler handles fd_set and friends ...
13134 #$i_stdlib I_STDLIB
13136 #include <stdlib.h>
13138 #$i_systime I_SYS_TIME
13139 #$i_sysselct I_SYS_SELECT
13140 #$d_socket HAS_SOCKET
13141 #include <sys/types.h>
13143 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13146 #include <sys/time.h>
13148 #ifdef I_SYS_SELECT
13149 #include <sys/select.h>
13158 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13166 if eval $compile; then
13167 d_fds_bits="$define"
13169 echo "Well, your system knows about the normal fd_set typedef..." >&4
13170 if $run ./try; then
13171 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13172 d_fd_macros="$define"
13175 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13177 d_fd_macros="$undef"
13181 Hmm, your compiler has some difficulty with fd_set. Checking further...
13184 if eval $compile; then
13185 d_fds_bits="$undef"
13187 echo "Well, your system has some sort of fd_set available..." >&4
13188 if $run ./try; then
13189 echo "and you have the normal fd_set macros." >&4
13190 d_fd_macros="$define"
13193 but not the normal fd_set macros! Gross! More work for me...
13195 d_fd_macros="$undef"
13198 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13200 d_fds_bits="$undef"
13201 d_fd_macros="$undef"
13206 : see if fgetpos exists
13207 set fgetpos d_fgetpos
13210 : see if finite exists
13211 set finite d_finite
13214 : see if finitel exists
13215 set finitel d_finitel
13218 : see if flock exists
13222 : see if prototype for flock is available
13224 set d_flockproto flock $i_sysfile sys/file.h
13227 : see if fp_class exists
13228 set fp_class d_fp_class
13231 : see if pathconf exists
13232 set pathconf d_pathconf
13235 : see if fpathconf exists
13236 set fpathconf d_fpathconf
13239 : see if fpclass exists
13240 set fpclass d_fpclass
13243 : see if fpclassify exists
13244 set fpclassify d_fpclassify
13247 : see if fpclassl exists
13248 set fpclassl d_fpclassl
13251 : check for fpos64_t
13253 echo "Checking to see if you have fpos64_t..." >&4
13256 int main() { fpos64_t x = 7; }
13259 if eval $compile; then
13261 echo "You have fpos64_t."
13264 echo "You do not have fpos64_t."
13265 case "$fpossize" in
13266 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13273 : see if frexpl exists
13274 set frexpl d_frexpl
13277 : see if this is a sys/param system
13278 set sys/param.h i_sysparam
13281 : see if this is a sys/mount.h system
13282 set sys/mount.h i_sysmount
13285 : Check for fs_data_s
13287 echo "Checking to see if your system supports struct fs_data..." >&4
13288 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13290 case "$d_fs_data_s" in
13291 "$define") echo "Yes, it does." ;;
13292 *) echo "No, it doesn't." ;;
13295 : see if fseeko exists
13296 set fseeko d_fseeko
13298 case "$longsize" in
13299 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13302 : see if fsetpos exists
13303 set fsetpos d_fsetpos
13306 : see if fstatfs exists
13307 set fstatfs d_fstatfs
13310 : see if statvfs exists
13311 set statvfs d_statvfs
13314 : see if fstatvfs exists
13315 set fstatvfs d_fstatvfs
13319 : see if fsync exists
13323 : see if ftello exists
13324 set ftello d_ftello
13326 case "$longsize" in
13327 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13330 : check for a working futimes
13333 echo "Checking if you have a working futimes()" >&4
13336 #include <sys/time.h>
13343 fd = open ("try.c", O_RDWR);
13344 if (-1 == fd) exit (1);
13345 rv = futimes (fd, NULL);
13346 exit (rv == -1 ? errno : 0);
13350 if eval $compile; then
13354 0) echo "Yes, you have" >&4
13355 d_futimes="$define"
13357 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13361 echo "No, it does not (probably harmless)" >&4
13365 : see if ndbm.h is available
13368 : Compatibility location for RedHat 7.1
13369 set gdbm/ndbm.h i_gdbmndbm
13371 : Compatibility location for Debian 4.0
13372 set gdbm-ndbm.h i_gdbm_ndbm
13376 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13377 : see if dbm_open exists
13378 set dbm_open d_dbm_open
13380 case "$d_dbm_open" in
13383 i_gdbmndbm="$undef"
13384 i_gdbm_ndbm="$undef"
13385 echo "We won't be including <ndbm.h>"
13395 ndbm_hdr_protochk='name=$1; hdr=$2;
13396 eval "ihdr=\$""i_$name";
13398 if $test "$ihdr" = "$define"; then
13399 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13400 case "$d_cplusplus" in
13401 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13402 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13405 $define) $echo "Your <$hdr> seems to have prototypes";;
13406 *) $echo "Your <$hdr> does not seem to have prototypes";;
13409 set "d_${name}_h_uses_prototypes";
13413 eval $ndbm_hdr_protochk
13414 set gdbmndbm gdbm/ndbm.h
13415 eval $ndbm_hdr_protochk
13416 set gdbm_ndbm gdbm-ndbm.h
13417 eval $ndbm_hdr_protochk
13419 : see if getaddrinfo exists
13420 set getaddrinfo d_getaddrinfo
13423 : see if getcwd exists
13424 set getcwd d_getcwd
13427 : see if getespwnam exists
13428 set getespwnam d_getespwnam
13431 : see if getfsstat exists
13432 set getfsstat d_getfsstat
13435 : see if getgrent exists
13436 set getgrent d_getgrent
13439 : see if getgrent_r exists
13440 set getgrent_r d_getgrent_r
13442 case "$d_getgrent_r" in
13444 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13445 case "$d_getgrent_r_proto:$usethreads" in
13446 ":define") d_getgrent_r_proto=define
13447 set d_getgrent_r_proto getgrent_r $hdrs
13451 case "$d_getgrent_r_proto" in
13453 case "$getgrent_r_proto" in
13454 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13455 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13457 case "$getgrent_r_proto" in
13458 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13459 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13461 case "$getgrent_r_proto" in
13462 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13463 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13465 case "$getgrent_r_proto" in
13466 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13467 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13469 case "$getgrent_r_proto" in
13470 ''|0) try='int getgrent_r(struct group*, char*, int);'
13471 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13473 case "$getgrent_r_proto" in
13474 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13475 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13477 case "$getgrent_r_proto" in
13478 ''|0) d_getgrent_r=undef
13480 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13481 * ) case "$getgrent_r_proto" in
13482 REENTRANT_PROTO*) ;;
13483 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13485 echo "Prototype: $try" ;;
13488 *) case "$usethreads" in
13489 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13496 *) getgrent_r_proto=0
13500 : see if getgrgid_r exists
13501 set getgrgid_r d_getgrgid_r
13503 case "$d_getgrgid_r" in
13505 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13506 case "$d_getgrgid_r_proto:$usethreads" in
13507 ":define") d_getgrgid_r_proto=define
13508 set d_getgrgid_r_proto getgrgid_r $hdrs
13512 case "$d_getgrgid_r_proto" in
13514 case "$getgrgid_r_proto" in
13515 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13516 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13518 case "$getgrgid_r_proto" in
13519 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13520 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13522 case "$getgrgid_r_proto" in
13523 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13524 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13526 case "$getgrgid_r_proto" in
13527 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13528 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13530 case "$getgrgid_r_proto" in
13531 ''|0) d_getgrgid_r=undef
13533 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13534 * ) case "$getgrgid_r_proto" in
13535 REENTRANT_PROTO*) ;;
13536 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13538 echo "Prototype: $try" ;;
13541 *) case "$usethreads" in
13542 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13549 *) getgrgid_r_proto=0
13553 : see if getgrnam_r exists
13554 set getgrnam_r d_getgrnam_r
13556 case "$d_getgrnam_r" in
13558 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13559 case "$d_getgrnam_r_proto:$usethreads" in
13560 ":define") d_getgrnam_r_proto=define
13561 set d_getgrnam_r_proto getgrnam_r $hdrs
13565 case "$d_getgrnam_r_proto" in
13567 case "$getgrnam_r_proto" in
13568 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13569 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13571 case "$getgrnam_r_proto" in
13572 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13573 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13575 case "$getgrnam_r_proto" in
13576 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13577 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13579 case "$getgrnam_r_proto" in
13580 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13581 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13583 case "$getgrnam_r_proto" in
13584 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13585 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13587 case "$getgrnam_r_proto" in
13588 ''|0) d_getgrnam_r=undef
13590 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13591 * ) case "$getgrnam_r_proto" in
13592 REENTRANT_PROTO*) ;;
13593 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13595 echo "Prototype: $try" ;;
13598 *) case "$usethreads" in
13599 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13606 *) getgrnam_r_proto=0
13610 : see if gethostbyaddr exists
13611 set gethostbyaddr d_gethbyaddr
13614 : see if gethostbyname exists
13615 set gethostbyname d_gethbyname
13618 : see if gethostent exists
13619 set gethostent d_gethent
13622 : see how we will look up host name
13625 if set gethostname val -f d_gethname; eval $csym; $val; then
13626 echo 'gethostname() found.' >&4
13627 d_gethname="$define"
13630 if set uname val -f d_uname; eval $csym; $val; then
13633 uname() was found, but you're running xenix, and older versions of xenix
13634 have a broken uname(). If you don't really know whether your xenix is old
13635 enough to have a broken system call, use the default answer.
13640 "$define") dflt=n;;
13642 rp='Is your uname() broken?'
13645 n*) d_uname="$define"; call=uname;;
13648 echo 'uname() found.' >&4
13655 case "$d_gethname" in
13656 '') d_gethname="$undef";;
13659 '') d_uname="$undef";;
13661 case "$d_uname$d_gethname" in
13666 Every now and then someone has a $call() that lies about the hostname
13667 but can't be fixed for political or economic reasons. If you wish, I can
13668 pretend $call() isn't there and maybe compute hostname at run-time
13669 thanks to the '$phostname' command.
13672 rp="Shall I ignore $call() from now on?"
13675 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13678 case "$phostname" in
13679 '') aphostname='';;
13680 *) case "$aphostname" in
13682 *) set X $phostname
13686 file=`./loc $file $file $pth`
13687 aphostname=`echo $file $*`
13692 case "$d_uname$d_gethname" in
13695 case "$phostname" in
13697 echo "There will be no way for $package to get your hostname." >&4;;
13699 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13703 case "$d_phostname" in
13704 '') d_phostname="$undef";;
13707 : see if gethostbyaddr_r exists
13708 set gethostbyaddr_r d_gethostbyaddr_r
13710 case "$d_gethostbyaddr_r" in
13712 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13713 case "$d_gethostbyaddr_r_proto:$usethreads" in
13714 ":define") d_gethostbyaddr_r_proto=define
13715 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13719 case "$d_gethostbyaddr_r_proto" in
13721 case "$gethostbyaddr_r_proto" in
13722 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13723 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13725 case "$gethostbyaddr_r_proto" in
13726 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13727 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13729 case "$gethostbyaddr_r_proto" in
13730 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13731 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13733 case "$gethostbyaddr_r_proto" in
13734 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13735 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13737 case "$gethostbyaddr_r_proto" in
13738 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13739 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13741 case "$gethostbyaddr_r_proto" in
13742 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13743 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13745 case "$gethostbyaddr_r_proto" in
13746 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13747 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13749 case "$gethostbyaddr_r_proto" in
13750 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13751 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13753 case "$gethostbyaddr_r_proto" in
13754 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13755 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13757 case "$gethostbyaddr_r_proto" in
13758 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13759 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13761 case "$gethostbyaddr_r_proto" in
13762 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13763 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13765 case "$gethostbyaddr_r_proto" in
13766 ''|0) d_gethostbyaddr_r=undef
13767 gethostbyaddr_r_proto=0
13768 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13769 * ) case "$gethostbyaddr_r_proto" in
13770 REENTRANT_PROTO*) ;;
13771 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13773 echo "Prototype: $try" ;;
13776 *) case "$usethreads" in
13777 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13779 d_gethostbyaddr_r=undef
13780 gethostbyaddr_r_proto=0
13784 *) gethostbyaddr_r_proto=0
13788 : see if gethostbyname_r exists
13789 set gethostbyname_r d_gethostbyname_r
13791 case "$d_gethostbyname_r" in
13793 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13794 case "$d_gethostbyname_r_proto:$usethreads" in
13795 ":define") d_gethostbyname_r_proto=define
13796 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13800 case "$d_gethostbyname_r_proto" in
13802 case "$gethostbyname_r_proto" in
13803 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13804 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13806 case "$gethostbyname_r_proto" in
13807 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13808 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13810 case "$gethostbyname_r_proto" in
13811 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13812 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13814 case "$gethostbyname_r_proto" in
13815 ''|0) d_gethostbyname_r=undef
13816 gethostbyname_r_proto=0
13817 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13818 * ) case "$gethostbyname_r_proto" in
13819 REENTRANT_PROTO*) ;;
13820 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13822 echo "Prototype: $try" ;;
13825 *) case "$usethreads" in
13826 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13828 d_gethostbyname_r=undef
13829 gethostbyname_r_proto=0
13833 *) gethostbyname_r_proto=0
13837 : see if gethostent_r exists
13838 set gethostent_r d_gethostent_r
13840 case "$d_gethostent_r" in
13842 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13843 case "$d_gethostent_r_proto:$usethreads" in
13844 ":define") d_gethostent_r_proto=define
13845 set d_gethostent_r_proto gethostent_r $hdrs
13849 case "$d_gethostent_r_proto" in
13851 case "$gethostent_r_proto" in
13852 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13853 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13855 case "$gethostent_r_proto" in
13856 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13857 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13859 case "$gethostent_r_proto" in
13860 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13861 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13863 case "$gethostent_r_proto" in
13864 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13865 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
13867 case "$gethostent_r_proto" in
13868 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13869 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
13871 case "$gethostent_r_proto" in
13872 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13873 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
13875 case "$gethostent_r_proto" in
13876 ''|0) d_gethostent_r=undef
13877 gethostent_r_proto=0
13878 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13879 * ) case "$gethostent_r_proto" in
13880 REENTRANT_PROTO*) ;;
13881 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13883 echo "Prototype: $try" ;;
13886 *) case "$usethreads" in
13887 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13889 d_gethostent_r=undef
13890 gethostent_r_proto=0
13894 *) gethostent_r_proto=0
13898 : see if prototypes for various gethostxxx netdb.h functions are available
13900 set d_gethostprotos gethostent $i_netdb netdb.h
13903 : see if getitimer exists
13904 set getitimer d_getitimer
13907 : see if getlogin exists
13908 set getlogin d_getlogin
13911 : see if getlogin_r exists
13912 set getlogin_r d_getlogin_r
13914 case "$d_getlogin_r" in
13916 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13917 case "$d_getlogin_r_proto:$usethreads" in
13918 ":define") d_getlogin_r_proto=define
13919 set d_getlogin_r_proto getlogin_r $hdrs
13923 case "$d_getlogin_r_proto" in
13925 case "$getlogin_r_proto" in
13926 ''|0) try='int getlogin_r(char*, size_t);'
13927 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
13929 case "$getlogin_r_proto" in
13930 ''|0) try='int getlogin_r(char*, int);'
13931 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
13933 case "$getlogin_r_proto" in
13934 ''|0) try='char* getlogin_r(char*, size_t);'
13935 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
13937 case "$getlogin_r_proto" in
13938 ''|0) try='char* getlogin_r(char*, int);'
13939 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
13941 case "$getlogin_r_proto" in
13942 ''|0) d_getlogin_r=undef
13944 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13945 * ) case "$getlogin_r_proto" in
13946 REENTRANT_PROTO*) ;;
13947 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13949 echo "Prototype: $try" ;;
13952 *) case "$usethreads" in
13953 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13960 *) getlogin_r_proto=0
13964 : see if getmnt exists
13965 set getmnt d_getmnt
13968 : see if getmntent exists
13969 set getmntent d_getmntent
13972 : see if getnameinfo exists
13973 set getnameinfo d_getnameinfo
13976 : see if getnetbyaddr exists
13977 set getnetbyaddr d_getnbyaddr
13980 : see if getnetbyname exists
13981 set getnetbyname d_getnbyname
13984 : see if getnetent exists
13985 set getnetent d_getnent
13988 : see if getnetbyaddr_r exists
13989 set getnetbyaddr_r d_getnetbyaddr_r
13991 case "$d_getnetbyaddr_r" in
13993 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13994 case "$d_getnetbyaddr_r_proto:$usethreads" in
13995 ":define") d_getnetbyaddr_r_proto=define
13996 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14000 case "$d_getnetbyaddr_r_proto" in
14002 case "$getnetbyaddr_r_proto" in
14003 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14004 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14006 case "$getnetbyaddr_r_proto" in
14007 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14008 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14010 case "$getnetbyaddr_r_proto" in
14011 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14012 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14014 case "$getnetbyaddr_r_proto" in
14015 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14016 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14018 case "$getnetbyaddr_r_proto" in
14019 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14020 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14022 case "$getnetbyaddr_r_proto" in
14023 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14024 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14026 case "$getnetbyaddr_r_proto" in
14027 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14028 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14030 case "$getnetbyaddr_r_proto" in
14031 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14032 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14034 case "$getnetbyaddr_r_proto" in
14035 ''|0) d_getnetbyaddr_r=undef
14036 getnetbyaddr_r_proto=0
14037 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14038 * ) case "$getnetbyaddr_r_proto" in
14039 REENTRANT_PROTO*) ;;
14040 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14042 echo "Prototype: $try" ;;
14045 *) case "$usethreads" in
14046 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14048 d_getnetbyaddr_r=undef
14049 getnetbyaddr_r_proto=0
14053 *) getnetbyaddr_r_proto=0
14057 : see if getnetbyname_r exists
14058 set getnetbyname_r d_getnetbyname_r
14060 case "$d_getnetbyname_r" in
14062 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14063 case "$d_getnetbyname_r_proto:$usethreads" in
14064 ":define") d_getnetbyname_r_proto=define
14065 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14069 case "$d_getnetbyname_r_proto" in
14071 case "$getnetbyname_r_proto" in
14072 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14073 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14075 case "$getnetbyname_r_proto" in
14076 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14077 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14079 case "$getnetbyname_r_proto" in
14080 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14081 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14083 case "$getnetbyname_r_proto" in
14084 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14085 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14087 case "$getnetbyname_r_proto" in
14088 ''|0) d_getnetbyname_r=undef
14089 getnetbyname_r_proto=0
14090 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14091 * ) case "$getnetbyname_r_proto" in
14092 REENTRANT_PROTO*) ;;
14093 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14095 echo "Prototype: $try" ;;
14098 *) case "$usethreads" in
14099 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14101 d_getnetbyname_r=undef
14102 getnetbyname_r_proto=0
14106 *) getnetbyname_r_proto=0
14110 : see if getnetent_r exists
14111 set getnetent_r d_getnetent_r
14113 case "$d_getnetent_r" in
14115 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14116 case "$d_getnetent_r_proto:$usethreads" in
14117 ":define") d_getnetent_r_proto=define
14118 set d_getnetent_r_proto getnetent_r $hdrs
14122 case "$d_getnetent_r_proto" in
14124 case "$getnetent_r_proto" in
14125 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14126 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14128 case "$getnetent_r_proto" in
14129 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14130 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14132 case "$getnetent_r_proto" in
14133 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14134 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14136 case "$getnetent_r_proto" in
14137 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14138 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14140 case "$getnetent_r_proto" in
14141 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14142 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14144 case "$getnetent_r_proto" in
14145 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14146 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14148 case "$getnetent_r_proto" in
14149 ''|0) d_getnetent_r=undef
14150 getnetent_r_proto=0
14151 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14152 * ) case "$getnetent_r_proto" in
14153 REENTRANT_PROTO*) ;;
14154 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14156 echo "Prototype: $try" ;;
14159 *) case "$usethreads" in
14160 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14162 d_getnetent_r=undef
14163 getnetent_r_proto=0
14167 *) getnetent_r_proto=0
14171 : see if prototypes for various getnetxxx netdb.h functions are available
14173 set d_getnetprotos getnetent $i_netdb netdb.h
14176 : see if getpagesize exists
14177 set getpagesize d_getpagsz
14180 : Optional checks for getprotobyname and getprotobynumber
14182 : see if getprotobyname exists
14183 set getprotobyname d_getpbyname
14186 : see if getprotobynumber exists
14187 set getprotobynumber d_getpbynumber
14190 : see if getprotoent exists
14191 set getprotoent d_getpent
14194 : see if getpgid exists
14195 set getpgid d_getpgid
14198 : see if getpgrp2 exists
14199 set getpgrp2 d_getpgrp2
14202 : see if getppid exists
14203 set getppid d_getppid
14206 : see if getpriority exists
14207 set getpriority d_getprior
14210 : see if getprotobyname_r exists
14211 set getprotobyname_r d_getprotobyname_r
14213 case "$d_getprotobyname_r" in
14215 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14216 case "$d_getprotobyname_r_proto:$usethreads" in
14217 ":define") d_getprotobyname_r_proto=define
14218 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14222 case "$d_getprotobyname_r_proto" in
14224 case "$getprotobyname_r_proto" in
14225 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14226 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14228 case "$getprotobyname_r_proto" in
14229 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14230 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14232 case "$getprotobyname_r_proto" in
14233 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14234 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14236 case "$getprotobyname_r_proto" in
14237 ''|0) d_getprotobyname_r=undef
14238 getprotobyname_r_proto=0
14239 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14240 * ) case "$getprotobyname_r_proto" in
14241 REENTRANT_PROTO*) ;;
14242 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14244 echo "Prototype: $try" ;;
14247 *) case "$usethreads" in
14248 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14250 d_getprotobyname_r=undef
14251 getprotobyname_r_proto=0
14255 *) getprotobyname_r_proto=0
14259 : see if getprotobynumber_r exists
14260 set getprotobynumber_r d_getprotobynumber_r
14262 case "$d_getprotobynumber_r" in
14264 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14265 case "$d_getprotobynumber_r_proto:$usethreads" in
14266 ":define") d_getprotobynumber_r_proto=define
14267 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14271 case "$d_getprotobynumber_r_proto" in
14273 case "$getprotobynumber_r_proto" in
14274 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14275 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14277 case "$getprotobynumber_r_proto" in
14278 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14279 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14281 case "$getprotobynumber_r_proto" in
14282 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14283 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14285 case "$getprotobynumber_r_proto" in
14286 ''|0) d_getprotobynumber_r=undef
14287 getprotobynumber_r_proto=0
14288 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14289 * ) case "$getprotobynumber_r_proto" in
14290 REENTRANT_PROTO*) ;;
14291 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14293 echo "Prototype: $try" ;;
14296 *) case "$usethreads" in
14297 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14299 d_getprotobynumber_r=undef
14300 getprotobynumber_r_proto=0
14304 *) getprotobynumber_r_proto=0
14308 : see if getprotoent_r exists
14309 set getprotoent_r d_getprotoent_r
14311 case "$d_getprotoent_r" in
14313 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14314 case "$d_getprotoent_r_proto:$usethreads" in
14315 ":define") d_getprotoent_r_proto=define
14316 set d_getprotoent_r_proto getprotoent_r $hdrs
14320 case "$d_getprotoent_r_proto" in
14322 case "$getprotoent_r_proto" in
14323 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14324 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14326 case "$getprotoent_r_proto" in
14327 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14328 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14330 case "$getprotoent_r_proto" in
14331 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14332 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14334 case "$getprotoent_r_proto" in
14335 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14336 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14338 case "$getprotoent_r_proto" in
14339 ''|0) d_getprotoent_r=undef
14340 getprotoent_r_proto=0
14341 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14342 * ) case "$getprotoent_r_proto" in
14343 REENTRANT_PROTO*) ;;
14344 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14346 echo "Prototype: $try" ;;
14349 *) case "$usethreads" in
14350 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14352 d_getprotoent_r=undef
14353 getprotoent_r_proto=0
14357 *) getprotoent_r_proto=0
14361 : see if prototypes for various getprotoxxx netdb.h functions are available
14363 set d_getprotoprotos getprotoent $i_netdb netdb.h
14366 : see if getprpwnam exists
14367 set getprpwnam d_getprpwnam
14370 : see if getpwent exists
14371 set getpwent d_getpwent
14374 : see if getpwent_r exists
14375 set getpwent_r d_getpwent_r
14377 case "$d_getpwent_r" in
14379 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14380 case "$d_getpwent_r_proto:$usethreads" in
14381 ":define") d_getpwent_r_proto=define
14382 set d_getpwent_r_proto getpwent_r $hdrs
14386 case "$d_getpwent_r_proto" in
14388 case "$getpwent_r_proto" in
14389 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14390 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14392 case "$getpwent_r_proto" in
14393 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14394 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14396 case "$getpwent_r_proto" in
14397 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14398 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14400 case "$getpwent_r_proto" in
14401 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14402 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14404 case "$getpwent_r_proto" in
14405 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14406 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14408 case "$getpwent_r_proto" in
14409 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14410 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14412 case "$getpwent_r_proto" in
14413 ''|0) d_getpwent_r=undef
14415 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14416 * ) case "$getpwent_r_proto" in
14417 REENTRANT_PROTO*) ;;
14418 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14420 echo "Prototype: $try" ;;
14423 *) case "$usethreads" in
14424 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14431 *) getpwent_r_proto=0
14435 : see if getpwnam_r exists
14436 set getpwnam_r d_getpwnam_r
14438 case "$d_getpwnam_r" in
14440 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14441 case "$d_getpwnam_r_proto:$usethreads" in
14442 ":define") d_getpwnam_r_proto=define
14443 set d_getpwnam_r_proto getpwnam_r $hdrs
14447 case "$d_getpwnam_r_proto" in
14449 case "$getpwnam_r_proto" in
14450 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14451 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14453 case "$getpwnam_r_proto" in
14454 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14455 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14457 case "$getpwnam_r_proto" in
14458 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14459 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14461 case "$getpwnam_r_proto" in
14462 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14463 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14465 case "$getpwnam_r_proto" in
14466 ''|0) d_getpwnam_r=undef
14468 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14469 * ) case "$getpwnam_r_proto" in
14470 REENTRANT_PROTO*) ;;
14471 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14473 echo "Prototype: $try" ;;
14476 *) case "$usethreads" in
14477 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14484 *) getpwnam_r_proto=0
14488 : see if getpwuid_r exists
14489 set getpwuid_r d_getpwuid_r
14491 case "$d_getpwuid_r" in
14493 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14494 case "$d_getpwuid_r_proto:$usethreads" in
14495 ":define") d_getpwuid_r_proto=define
14496 set d_getpwuid_r_proto getpwuid_r $hdrs
14500 case "$d_getpwuid_r_proto" in
14502 case "$getpwuid_r_proto" in
14503 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14504 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14506 case "$getpwuid_r_proto" in
14507 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14508 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14510 case "$getpwuid_r_proto" in
14511 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14512 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14514 case "$getpwuid_r_proto" in
14515 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14516 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14518 case "$getpwuid_r_proto" in
14519 ''|0) d_getpwuid_r=undef
14521 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14522 * ) case "$getpwuid_r_proto" in
14523 REENTRANT_PROTO*) ;;
14524 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14526 echo "Prototype: $try" ;;
14529 *) case "$usethreads" in
14530 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14537 *) getpwuid_r_proto=0
14541 : Optional checks for getsbyname and getsbyport
14543 : see if getservbyname exists
14544 set getservbyname d_getsbyname
14547 : see if getservbyport exists
14548 set getservbyport d_getsbyport
14551 : see if getservent exists
14552 set getservent d_getsent
14555 : see if getservbyname_r exists
14556 set getservbyname_r d_getservbyname_r
14558 case "$d_getservbyname_r" in
14560 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14561 case "$d_getservbyname_r_proto:$usethreads" in
14562 ":define") d_getservbyname_r_proto=define
14563 set d_getservbyname_r_proto getservbyname_r $hdrs
14567 case "$d_getservbyname_r_proto" in
14569 case "$getservbyname_r_proto" in
14570 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14571 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14573 case "$getservbyname_r_proto" in
14574 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14575 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14577 case "$getservbyname_r_proto" in
14578 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14579 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14581 case "$getservbyname_r_proto" in
14582 ''|0) d_getservbyname_r=undef
14583 getservbyname_r_proto=0
14584 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14585 * ) case "$getservbyname_r_proto" in
14586 REENTRANT_PROTO*) ;;
14587 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14589 echo "Prototype: $try" ;;
14592 *) case "$usethreads" in
14593 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14595 d_getservbyname_r=undef
14596 getservbyname_r_proto=0
14600 *) getservbyname_r_proto=0
14604 : see if getservbyport_r exists
14605 set getservbyport_r d_getservbyport_r
14607 case "$d_getservbyport_r" in
14609 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14610 case "$d_getservbyport_r_proto:$usethreads" in
14611 ":define") d_getservbyport_r_proto=define
14612 set d_getservbyport_r_proto getservbyport_r $hdrs
14616 case "$d_getservbyport_r_proto" in
14618 case "$getservbyport_r_proto" in
14619 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14620 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14622 case "$getservbyport_r_proto" in
14623 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14624 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14626 case "$getservbyport_r_proto" in
14627 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14628 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14630 case "$getservbyport_r_proto" in
14631 ''|0) d_getservbyport_r=undef
14632 getservbyport_r_proto=0
14633 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14634 * ) case "$getservbyport_r_proto" in
14635 REENTRANT_PROTO*) ;;
14636 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14638 echo "Prototype: $try" ;;
14641 *) case "$usethreads" in
14642 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14644 d_getservbyport_r=undef
14645 getservbyport_r_proto=0
14649 *) getservbyport_r_proto=0
14653 : see if getservent_r exists
14654 set getservent_r d_getservent_r
14656 case "$d_getservent_r" in
14658 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14659 case "$d_getservent_r_proto:$usethreads" in
14660 ":define") d_getservent_r_proto=define
14661 set d_getservent_r_proto getservent_r $hdrs
14665 case "$d_getservent_r_proto" in
14667 case "$getservent_r_proto" in
14668 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14669 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14671 case "$getservent_r_proto" in
14672 ''|0) try='int getservent_r(struct servent*, char*, int);'
14673 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14675 case "$getservent_r_proto" in
14676 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14677 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14679 case "$getservent_r_proto" in
14680 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14681 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14683 case "$getservent_r_proto" in
14684 ''|0) d_getservent_r=undef
14685 getservent_r_proto=0
14686 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14687 * ) case "$getservent_r_proto" in
14688 REENTRANT_PROTO*) ;;
14689 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14691 echo "Prototype: $try" ;;
14694 *) case "$usethreads" in
14695 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14697 d_getservent_r=undef
14698 getservent_r_proto=0
14702 *) getservent_r_proto=0
14706 : see if prototypes for various getservxxx netdb.h functions are available
14708 set d_getservprotos getservent $i_netdb netdb.h
14711 : see if getspnam exists
14712 set getspnam d_getspnam
14715 : see if this is a shadow.h system
14716 set shadow.h i_shadow
14719 : see if getspnam_r exists
14720 set getspnam_r d_getspnam_r
14722 case "$d_getspnam_r" in
14724 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14725 case "$d_getspnam_r_proto:$usethreads" in
14726 ":define") d_getspnam_r_proto=define
14727 set d_getspnam_r_proto getspnam_r $hdrs
14731 case "$d_getspnam_r_proto" in
14733 case "$getspnam_r_proto" in
14734 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14735 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14737 case "$getspnam_r_proto" in
14738 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14739 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14741 case "$getspnam_r_proto" in
14742 ''|0) d_getspnam_r=undef
14744 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14745 * ) case "$getspnam_r_proto" in
14746 REENTRANT_PROTO*) ;;
14747 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14749 echo "Prototype: $try" ;;
14752 *) case "$usethreads" in
14753 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14760 *) getspnam_r_proto=0
14764 : see if gettimeofday or ftime exists
14765 set gettimeofday d_gettimeod
14767 case "$d_gettimeod" in
14773 val="$undef"; set d_ftime; eval $setvar
14776 case "$d_gettimeod$d_ftime" in
14779 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14783 : see if gmtime_r exists
14784 set gmtime_r d_gmtime_r
14786 case "$d_gmtime_r" in
14788 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14789 case "$d_gmtime_r_proto:$usethreads" in
14790 ":define") d_gmtime_r_proto=define
14791 set d_gmtime_r_proto gmtime_r $hdrs
14795 case "$d_gmtime_r_proto" in
14797 case "$gmtime_r_proto" in
14798 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14799 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
14801 case "$gmtime_r_proto" in
14802 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14803 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
14805 case "$gmtime_r_proto" in
14806 ''|0) d_gmtime_r=undef
14808 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14809 * ) case "$gmtime_r_proto" in
14810 REENTRANT_PROTO*) ;;
14811 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14813 echo "Prototype: $try" ;;
14816 *) case "$usethreads" in
14817 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14824 *) gmtime_r_proto=0
14828 : see if hasmntopt exists
14829 set hasmntopt d_hasmntopt
14832 : see if this is a netinet/in.h or sys/in.h system
14833 set netinet/in.h i_niin sys/in.h i_sysin
14836 : see if arpa/inet.h has to be included
14837 set arpa/inet.h i_arpainet
14840 : see if htonl --and friends-- exists
14845 : Maybe they are macros.
14848 $cat >htonl.c <<EOM
14850 #include <sys/types.h>
14851 #$i_niin I_NETINET_IN
14853 #$i_arpainet I_ARPA_INET
14854 #ifdef I_NETINET_IN
14855 #include <netinet/in.h>
14858 #include <sys/in.h>
14861 #include <arpa/inet.h>
14864 printf("Defined as a macro.");
14867 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14868 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14870 echo "But it seems to be defined as a macro." >&4
14878 : see if ilogbl exists
14879 set ilogbl d_ilogbl
14884 if set index val -f; eval $csym; $val; then
14885 if set strchr val -f d_strchr; eval $csym; $val; then
14886 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14889 echo "strchr() found." >&4
14893 echo "index() found." >&4
14898 echo "index() found." >&4
14901 if set strchr val -f d_strchr; eval $csym; $val; then
14904 echo "strchr() found." >&4
14906 echo "No index() or strchr() found!" >&4
14911 set d_strchr; eval $setvar
14913 set d_index; eval $setvar
14915 : check whether inet_aton exists
14916 set inet_aton d_inetaton
14919 : see if inet_ntop exists
14920 set inet_ntop d_inetntop
14923 : see if inet_pton exists
14924 set inet_pton d_inetpton
14929 $cat >isascii.c <<EOCP
14932 #$i_stdlib I_STDLIB
14934 #include <stdlib.h>
14945 if eval $compile; then
14946 echo "isascii() found." >&4
14949 echo "isascii() NOT found." >&4
14956 : see if isfinite exists
14957 set isfinite d_isfinite
14960 : see if isinf exists
14964 : see if isnan exists
14968 : see if isnanl exists
14969 set isnanl d_isnanl
14972 : see if killpg exists
14973 set killpg d_killpg
14976 : see if lchown exists
14978 $cat > try.c <<'EOCP'
14979 /* System header to define __stub macros and hopefully few prototypes,
14980 which can conflict with char lchown(); below. */
14981 #include <assert.h>
14982 /* Override any gcc2 internal prototype to avoid an error. */
14983 /* We use char because int might match the return type of a gcc2
14984 builtin and then its argument prototype would still apply. */
14987 /* The GNU C library defines this for functions which it implements
14988 to always fail with ENOSYS. Some functions are actually named
14989 something starting with __ and the normal name is an alias. */
14990 #if defined (__stub_lchown) || defined (__stub___lchown)
14998 if eval $compile; then
14999 $echo "lchown() found." >&4
15002 $echo "lchown() NOT found." >&4
15008 : See if number of significant digits in a double precision number is known
15010 $cat >ldbl_dig.c <<EOM
15011 #$i_limits I_LIMITS
15014 #include <limits.h>
15020 printf("Contains LDBL_DIG");
15023 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15024 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15025 echo "LDBL_DIG found." >&4
15028 echo "LDBL_DIG NOT found." >&4
15035 : see if this is a math.h system
15039 : check to see if math.h defines _LIB_VERSION
15040 d_libm_lib_version="$undef"
15044 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15046 #include <unistd.h>
15048 int main (int argc, char *argv[])
15050 printf ("%d\n", _LIB_VERSION);
15055 if eval $compile; then
15057 echo "Yes, it does ($foo)" >&4
15058 d_libm_lib_version="$define"
15060 echo "No, it does not (probably harmless)" >&4
15067 : see if link exists
15071 : see if localtime_r exists
15072 set localtime_r d_localtime_r
15074 case "$d_localtime_r" in
15076 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15077 case "$d_localtime_r_proto:$usethreads" in
15078 ":define") d_localtime_r_proto=define
15079 set d_localtime_r_proto localtime_r $hdrs
15083 case "$d_localtime_r_proto" in
15085 case "$localtime_r_proto" in
15086 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15087 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15089 case "$localtime_r_proto" in
15090 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15091 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15093 case "$localtime_r_proto" in
15094 ''|0) d_localtime_r=undef
15095 localtime_r_proto=0
15096 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15097 * ) case "$localtime_r_proto" in
15098 REENTRANT_PROTO*) ;;
15099 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15101 echo "Prototype: $try" ;;
15104 *) case "$usethreads" in
15105 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15107 d_localtime_r=undef
15108 localtime_r_proto=0
15112 *) localtime_r_proto=0
15116 : see if localtime_r calls tzset
15117 case "$localtime_r_proto" in
15120 /* Does our libc's localtime_r call tzset ?
15121 * return 0 if so, 1 otherwise.
15123 #$i_systypes I_SYS_TYPES
15124 #$i_unistd I_UNISTD
15126 #$i_stdlib I_STDLIB
15127 #$i_string I_STRING
15128 #$i_malloc I_MALLOC
15130 # include <sys/types.h>
15133 # include <unistd.h>
15139 #include <stdlib.h>
15142 # include <string.h>
15144 # include <strings.h>
15147 # include <malloc.h>
15151 time_t t = time(0L);
15152 char w_tz[]="TZ" "=GMT+5",
15153 e_tz[]="TZ" "=GMT-5",
15154 *tz_e = (char*)malloc(16),
15155 *tz_w = (char*)malloc(16);
15156 struct tm tm_e, tm_w;
15157 memset(&tm_e,'\0',sizeof(struct tm));
15158 memset(&tm_w,'\0',sizeof(struct tm));
15163 localtime_r(&t, &tm_e);
15166 localtime_r(&t, &tm_w);
15168 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15174 if eval $compile; then
15175 if $run ./try; then
15176 d_localtime_r_needs_tzset=undef;
15178 d_localtime_r_needs_tzset=define;
15181 d_localtime_r_needs_tzset=undef;
15185 d_localtime_r_needs_tzset=undef;
15190 : see if localeconv exists
15191 set localeconv d_locconv
15194 : see if lockf exists
15198 : see if prototype for lseek is available
15200 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15203 : see if lstat exists
15207 : see if madvise exists
15208 set madvise d_madvise
15211 : see if malloc_size exists
15212 set malloc_size d_malloc_size
15215 : see if malloc_size_good exists
15216 set malloc_good_size d_malloc_good_size
15219 : see if mblen exists
15223 : see if mbstowcs exists
15224 set mbstowcs d_mbstowcs
15227 : see if mbtowc exists
15228 set mbtowc d_mbtowc
15231 : see if memchr exists
15232 set memchr d_memchr
15235 : see if memcmp exists
15236 set memcmp d_memcmp
15239 : see if memcpy exists
15240 set memcpy d_memcpy
15243 : see if memmove exists
15244 set memmove d_memmove
15247 : see if memset exists
15248 set memset d_memset
15251 : see if mkdir exists
15255 : see if mkdtemp exists
15256 set mkdtemp d_mkdtemp
15259 : see if mkfifo exists
15260 set mkfifo d_mkfifo
15263 : see if mkstemp exists
15264 set mkstemp d_mkstemp
15267 : see if mkstemps exists
15268 set mkstemps d_mkstemps
15271 : see if mktime exists
15272 set mktime d_mktime
15275 : see if this is a sys/mman.h system
15276 set sys/mman.h i_sysmman
15279 : see if mmap exists
15282 : see what shmat returns
15283 : default to something harmless
15285 case "$i_sysmman$d_mmap" in
15287 $cat >mmap.c <<'END'
15288 #include <sys/mman.h>
15291 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15296 echo "and it returns ($mmaptype)." >&4
15302 : see if sqrtl exists
15306 : see if scalbnl exists
15307 set scalbnl d_scalbnl
15310 : see if modfl exists
15314 : see if prototype for modfl is available
15316 set d_modflproto modfl $i_math math.h
15319 d_modfl_pow32_bug="$undef"
15321 case "$d_longdbl$d_modfl" in
15324 Checking to see whether your modfl() is okay for large values...
15330 if $test "X$d_modflproto" != "X$define"; then
15331 $cat >>try.c <<EOCP
15332 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15333 long double modfl (long double, long double *);
15336 $cat >>try.c <<EOCP
15338 long double nv = 4294967303.15;
15344 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15348 case "$osname:$gccversion" in
15349 aix:) saveccflags="$ccflags"
15350 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15353 if eval $compile; then
15356 *" 4294967303.150000 1.150000 4294967302.000000")
15357 echo >&4 "Your modfl() is broken for large values."
15358 d_modfl_pow32_bug="$define"
15360 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15364 *" 4294967303.150000 0.150000 4294967303.000000")
15365 echo >&4 "Your modfl() seems okay for large values."
15367 *) echo >&4 "I don't understand your modfl() at all."
15373 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15376 case "$osname:$gccversion" in
15377 aix:) ccflags="$saveccflags" ;; # restore
15382 if $test "$uselongdouble" = "$define"; then
15384 if $test "$d_sqrtl" != "$define"; then
15385 message="$message sqrtl"
15387 if $test "$d_modfl" != "$define"; then
15388 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15389 echo "You have both aintl and copysignl, so I can emulate modfl."
15391 message="$message modfl"
15394 if $test "$d_frexpl" != "$define"; then
15395 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15396 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15398 message="$message frexpl"
15402 if $test "$message" != ""; then
15405 *** You requested the use of long doubles but you do not seem to have
15406 *** the following mathematical functions needed for long double support:
15408 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15409 *** Cannot continue, aborting.
15417 : see if mprotect exists
15418 set mprotect d_mprotect
15421 : see if msgctl exists
15422 set msgctl d_msgctl
15425 : see if msgget exists
15426 set msgget d_msgget
15429 : see if msgsnd exists
15430 set msgsnd d_msgsnd
15433 : see if msgrcv exists
15434 set msgrcv d_msgrcv
15437 : see how much of the 'msg*(2)' library is present.
15440 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15441 *"$undef"*) h_msg=false;;
15445 case "`ipcs 2>&1`" in
15446 "SVID messages"*"not configured"*)
15447 echo "Your $osname does not have the msg*(2) configured." >&4
15450 set msgctl d_msgctl
15452 set msgget d_msgget
15454 set msgsnd d_msgsnd
15456 set msgrcv d_msgrcv
15462 : we could also check for sys/ipc.h ...
15463 if $h_msg && $test `./findhdr sys/msg.h`; then
15464 echo "You have the full msg*(2) library." >&4
15467 echo "You don't have the full msg*(2) library." >&4
15473 : Check for msghdr_s
15475 echo "Checking to see if your system supports struct msghdr..." >&4
15476 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15478 case "$d_msghdr_s" in
15479 "$define") echo "Yes, it does." ;;
15480 *) echo "No, it doesn't." ;;
15484 : see if msync exists
15488 : see if munmap exists
15489 set munmap d_munmap
15492 : see if nice exists
15496 : see if this is a langinfo.h system
15497 set langinfo.h i_langinfo
15500 : see if nl_langinfo exists
15501 set nl_langinfo d_nl_langinfo
15504 : check for volatile keyword
15506 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15507 $cat >try.c <<'EOCP'
15510 typedef struct _goo_struct goo_struct;
15511 goo_struct * volatile goo = ((goo_struct *)0);
15512 struct _goo_struct {
15517 typedef unsigned short foo_t;
15518 char *volatile foo;
15520 volatile foo_t blech;
15524 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15526 echo "Yup, it does."
15529 echo "Nope, it doesn't."
15535 : Check basic sizes
15537 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15539 case "$use64bitint:$d_quad:$quadtype" in
15542 uvtype="$uquadtype"
15547 uvtype="unsigned long"
15553 case "$uselongdouble:$d_longdbl" in
15555 nvtype="long double"
15556 nvsize=$longdblsize
15563 $echo "(IV will be "$ivtype", $ivsize bytes)"
15564 $echo "(UV will be "$uvtype", $uvsize bytes)"
15565 $echo "(NV will be "$nvtype", $nvsize bytes)"
15568 #$i_inttypes I_INTTYPES
15570 #include <inttypes.h>
15575 int8_t i = INT8_MAX;
15576 uint8_t u = UINT8_MAX;
15577 printf("int8_t\n");
15580 int16_t i = INT16_MAX;
15581 uint16_t i = UINT16_MAX;
15582 printf("int16_t\n");
15585 int32_t i = INT32_MAX;
15586 uint32_t u = UINT32_MAX;
15587 printf("int32_t\n");
15592 i8type="signed char"
15593 u8type="unsigned char"
15598 '') case "$shortsize" in
15600 u16type="unsigned short"
15608 '') set try -DINT16
15609 if eval $compile; then
15610 case "`$run ./try`" in
15622 '') if $test $shortsize -ge 2; then
15624 u16type="unsigned short"
15632 '') case "$longsize" in
15634 u32type="unsigned long"
15638 *) case "$intsize" in
15640 u32type="unsigned int"
15650 '') set try -DINT32
15651 if eval $compile; then
15652 case "`$run ./try`" in
15664 '') if $test $intsize -ge 4; then
15666 u32type="unsigned int"
15674 '') case "$d_quad:$quadtype" in
15676 i64type="$quadtype"
15677 u64type="$uquadtype"
15685 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15686 : volatile so that the compiler has to store it out to memory.
15687 if test X"$d_volatile" = X"$define"; then
15692 #$i_stdlib I_STDLIB
15694 #include <stdlib.h>
15696 #include <sys/types.h>
15697 #include <signal.h>
15699 $volatile int bletched = 0;
15700 $signal_t blech(int s) { bletched = 1; }
15705 int n = 8 * $uvsize;
15708 signal(SIGFPE, blech);
15711 for (i = 0; i < n; i++) {
15712 u = u << 1 | ($uvtype)1;
15714 if (($uvtype)d != u)
15718 d = ($nvtype)(u - 1);
15719 if (($uvtype)d != (u - 1))
15726 printf("%d\n", ((i == n) ? -n : i));
15732 d_nv_preserves_uv="$undef"
15733 if eval $compile; then
15734 nv_preserves_uv_bits="`$run ./try`"
15736 case "$nv_preserves_uv_bits" in
15738 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15739 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15740 d_nv_preserves_uv="$define"
15742 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15743 d_nv_preserves_uv="$undef" ;;
15744 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15745 nv_preserves_uv_bits="0" ;;
15749 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15750 : volatile so that the compiler has to store it out to memory.
15751 if test X"$d_volatile" = X"$define"; then
15757 typedef $nvtype NV;
15764 while(count < 256) {
15765 $volatile NV up = value + 1.0;
15766 $volatile NV negated = -value;
15767 $volatile NV down = negated - 1.0;
15768 $volatile NV got_up = up - value;
15769 int up_good = got_up == 1.0;
15770 int got_down = down - negated;
15771 int down_good = got_down == -1.0;
15773 if (down_good != up_good) {
15775 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15776 up_good, (double) got_up, down_good, (double) got_down,
15777 count, (double) value);
15784 fputs("256.0", stdout);
15787 fputs("2.0", stdout);
15793 fputs("*", stdout);
15799 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15800 count, (double) value);
15806 nv_overflows_integers_at='0'
15807 if eval $compile; then
15813 The largest integer your NVs can preserve is equal to $xxx
15815 nv_overflows_integers_at="$xxx"
15818 Cannot determine the largest integer value your NVs can hold, unexpected output
15825 Cannot determine the largest integer value your NVs can hold
15832 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15833 : volatile so that the compiler has to store it out to memory.
15834 if test X"$d_volatile" = X"$define"; then
15839 #$i_stdlib I_STDLIB
15841 #include <stdlib.h>
15843 #$i_string I_STRING
15845 # include <string.h>
15847 # include <strings.h>
15849 #include <sys/types.h>
15850 #include <signal.h>
15852 $volatile int bletched = 0;
15853 $signal_t blech(int s) { bletched = 1; }
15856 int checkit($nvtype d, char *where) {
15857 unsigned char *p = (char *)&d;
15858 unsigned char *end = p + sizeof(d);
15868 printf("No - %s: 0x", where);
15870 printf ("%02X", *p++);
15875 int main(int argc, char **argv) {
15878 fail += checkit(d, "0.0");
15880 /* The compiler shouldn't be assuming that bletched is 0 */
15883 fail += checkit(d, "bleched");
15886 signal(SIGFPE, blech);
15889 /* Paranoia - the compiler should have no way of knowing that ANSI says
15890 that argv[argc] will always be NULL. Actually, if it did assume this it
15891 would be buggy, as this is C and main() can be called from elsewhere in
15893 d = argv[argc] ? 1 : 0;
15896 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15899 fail += checkit(d, "ternary");
15901 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15904 printf("No - memset doesn't give 0.0\n");
15905 /* This might just blow up: */
15906 printf("(gives %g)\n", d);
15912 printf("No - something bleched\n");
15917 printf("No - %d fail(s)\n", fail);
15926 d_nv_zero_is_allbits_zero="$undef"
15927 if eval $compile; then
15933 0.0 is represented as all bits zero in memory
15935 d_nv_zero_is_allbits_zero="$define"
15938 0.0 is not represented as all bits zero in memory
15940 d_nv_zero_is_allbits_zero="$undef"
15945 0.0 is not represented as all bits zero in memory
15947 d_nv_zero_is_allbits_zero="$undef"
15953 : check for off64_t
15955 echo "Checking to see if you have off64_t..." >&4
15957 #include <sys/types.h>
15958 #include <unistd.h>
15959 int main() { off64_t x = 7; }
15962 if eval $compile; then
15964 echo "You have off64_t."
15967 echo "You do not have off64_t."
15968 case "$lseeksize" in
15969 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15976 : how to create joinable pthreads
15977 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15979 echo "Checking what constant to use for creating joinable pthreads..." >&4
15980 $cat >try.c <<'EOCP'
15981 #include <pthread.h>
15983 int detachstate = JOINABLE;
15986 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15987 if eval $compile; then
15988 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15989 val="$undef" # Yes, undef.
15990 set d_old_pthread_create_joinable
15993 set old_pthread_create_joinable
15996 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15997 if eval $compile; then
15998 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16000 set d_old_pthread_create_joinable
16002 val=PTHREAD_CREATE_UNDETACHED
16003 set old_pthread_create_joinable
16006 set try -DJOINABLE=__UNDETACHED
16007 if eval $compile; then
16008 echo "You seem to use __UNDETACHED." >&4
16010 set d_old_pthread_create_joinable
16013 set old_pthread_create_joinable
16016 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16018 set d_old_pthread_create_joinable
16021 set old_pthread_create_joinable
16028 d_old_pthread_create_joinable="$undef"
16029 old_pthread_create_joinable=""
16032 : see if pause exists
16036 : see if poll exists
16040 : see if readlink exists
16041 set readlink d_readlink
16044 : Check if exe is symlink to abs path of executing program
16048 case "$d_readlink" in
16050 if $issymlink /proc/self/exe ; then
16051 $ls -l /proc/self/exe > reflect
16052 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16053 echo "You have Linux-like /proc/self/exe."
16054 procselfexe='"/proc/self/exe"'
16058 if $issymlink /proc/curproc/file ; then
16059 $ls -l /proc/curproc/file > reflect
16060 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16061 echo "You have BSD-like /proc/curproc/file."
16062 procselfexe='"/proc/curproc/file"'
16072 : backward compatibility for d_hvfork
16073 if test X$d_hvfork != X; then
16074 d_vfork="$d_hvfork"
16077 : see if there is a vfork
16082 d_pseudofork=$undef
16084 : Ok, but do we want to use it. vfork is reportedly unreliable in
16085 : perl on Solaris 2.x, and probably elsewhere.
16089 case "$usevfork" in
16095 Perl can only use a vfork() that doesn't suffer from strict
16096 restrictions on calling functions or modifying global data in
16097 the child. For example, glibc-2.1 contains such a vfork()
16098 that is unsuitable. If your system provides a proper fork()
16099 call, chances are that you do NOT want perl to use vfork().
16102 rp="Do you still want to use vfork()?"
16107 echo "Ok, we won't use vfork()."
16116 $define) usevfork='true';;
16117 *) usevfork='false';;
16120 : see whether the pthread_atfork exists
16122 #include <pthread.h>
16125 #ifdef PTHREAD_ATFORK
16126 pthread_atfork(NULL,NULL,NULL);
16131 : see if pthread_atfork exists
16132 set try -DPTHREAD_ATFORK
16133 if eval $compile; then
16138 case "$usethreads" in
16141 $define) echo 'pthread_atfork found.' >&4 ;;
16142 *) echo 'pthread_atfork NOT found.' >&4 ;;
16145 set d_pthread_atfork
16148 : see if pthread_attr_setscope exists
16149 set pthread_attr_setscope d_pthread_attr_setscope
16152 : see whether the various POSIXish _yields exist
16154 #include <pthread.h>
16160 #ifdef PTHREAD_YIELD
16163 #ifdef PTHREAD_YIELD_NULL
16164 pthread_yield(NULL);
16170 : see if sched_yield exists
16171 set try -DSCHED_YIELD
16172 if eval $compile; then
16174 sched_yield='sched_yield()'
16178 case "$usethreads" in
16181 $define) echo 'sched_yield() found.' >&4 ;;
16182 *) echo 'sched_yield() NOT found.' >&4 ;;
16188 : see if pthread_yield exists
16189 set try -DPTHREAD_YIELD
16190 if eval $compile; then
16192 case "$sched_yield" in
16193 '') sched_yield='pthread_yield()' ;;
16196 set try -DPTHREAD_YIELD_NULL
16197 if eval $compile; then
16199 case "$sched_yield" in
16200 '') sched_yield='pthread_yield(NULL)' ;;
16206 case "$usethreads" in
16209 $define) echo 'pthread_yield() found.' >&4 ;;
16210 *) echo 'pthread_yield() NOT found.' >&4 ;;
16214 set d_pthread_yield
16216 case "$sched_yield" in
16217 '') sched_yield=undef ;;
16221 : see if random_r exists
16222 set random_r d_random_r
16224 case "$d_random_r" in
16226 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16227 case "$d_random_r_proto:$usethreads" in
16228 ":define") d_random_r_proto=define
16229 set d_random_r_proto random_r $hdrs
16233 case "$d_random_r_proto" in
16235 case "$random_r_proto" in
16236 ''|0) try='int random_r(int*, struct random_data*);'
16237 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16239 case "$random_r_proto" in
16240 ''|0) try='int random_r(long*, struct random_data*);'
16241 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16243 case "$random_r_proto" in
16244 ''|0) try='int random_r(struct random_data*, int32_t*);'
16245 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16247 case "$random_r_proto" in
16248 ''|0) d_random_r=undef
16250 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16251 * ) case "$random_r_proto" in
16252 REENTRANT_PROTO*) ;;
16253 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16255 echo "Prototype: $try" ;;
16258 *) case "$usethreads" in
16259 define) echo "random_r has no prototype, not using it." >&4 ;;
16266 *) random_r_proto=0
16270 : see if readdir and friends exist
16271 set readdir d_readdir
16273 set seekdir d_seekdir
16275 set telldir d_telldir
16277 set rewinddir d_rewinddir
16280 : see if readdir64_r exists
16281 set readdir64_r d_readdir64_r
16283 case "$d_readdir64_r" in
16285 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16286 case "$d_readdir64_r_proto:$usethreads" in
16287 ":define") d_readdir64_r_proto=define
16288 set d_readdir64_r_proto readdir64_r $hdrs
16292 case "$d_readdir64_r_proto" in
16294 case "$readdir64_r_proto" in
16295 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16296 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16298 case "$readdir64_r_proto" in
16299 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16300 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16302 case "$readdir64_r_proto" in
16303 ''|0) d_readdir64_r=undef
16304 readdir64_r_proto=0
16305 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16306 * ) case "$readdir64_r_proto" in
16307 REENTRANT_PROTO*) ;;
16308 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16310 echo "Prototype: $try" ;;
16313 *) case "$usethreads" in
16314 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16316 d_readdir64_r=undef
16317 readdir64_r_proto=0
16321 *) readdir64_r_proto=0
16325 : see if readdir_r exists
16326 set readdir_r d_readdir_r
16328 case "$d_readdir_r" in
16330 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16331 case "$d_readdir_r_proto:$usethreads" in
16332 ":define") d_readdir_r_proto=define
16333 set d_readdir_r_proto readdir_r $hdrs
16337 case "$d_readdir_r_proto" in
16339 case "$readdir_r_proto" in
16340 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16341 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16343 case "$readdir_r_proto" in
16344 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16345 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16347 case "$readdir_r_proto" in
16348 ''|0) d_readdir_r=undef
16350 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16351 * ) case "$readdir_r_proto" in
16352 REENTRANT_PROTO*) ;;
16353 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16355 echo "Prototype: $try" ;;
16358 *) case "$usethreads" in
16359 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16366 *) readdir_r_proto=0
16370 : see if readv exists
16374 : see if recvmsg exists
16375 set recvmsg d_recvmsg
16378 : see if rename exists
16379 set rename d_rename
16382 : see if rmdir exists
16386 : see if memory.h is available.
16391 : See if it conflicts with string.h
16397 $cppstdin $cppflags $cppminus < $strings > mem.h
16398 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16400 echo "We won't be including <memory.h>."
16410 : can bcopy handle overlapping blocks?
16413 case "$d_memmove" in
16414 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16415 *) case "$d_bcopy" in
16417 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16419 #$i_memory I_MEMORY
16420 #$i_stdlib I_STDLIB
16421 #$i_string I_STRING
16422 #$i_unistd I_UNISTD
16424 $cat >>try.c <<'EOCP'
16427 # include <memory.h>
16430 # include <stdlib.h>
16433 # include <string.h>
16435 # include <strings.h>
16438 # include <unistd.h> /* Needed for NetBSD */
16442 char buf[128], abc[128];
16448 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16449 try to store the string in read-only memory. */
16450 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16452 for (align = 7; align >= 0; align--) {
16453 for (len = 36; len; len--) {
16455 bcopy(abc, b, len);
16456 for (off = 1; off <= len; off++) {
16457 bcopy(b, b+off, len);
16458 bcopy(b+off, b, len);
16459 if (bcmp(b, abc, len))
16468 if eval $compile_ok; then
16469 if $run ./try 2>/dev/null; then
16470 echo "Yes, it can."
16473 echo "It can't, sorry."
16476 echo "(I can't compile the test program, so we'll assume not...)"
16486 : can memcpy handle overlapping blocks?
16489 case "$d_memmove" in
16490 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16491 *) case "$d_memcpy" in
16493 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16495 #$i_memory I_MEMORY
16496 #$i_stdlib I_STDLIB
16497 #$i_string I_STRING
16498 #$i_unistd I_UNISTD
16500 $cat >>try.c <<'EOCP'
16503 # include <memory.h>
16506 # include <stdlib.h>
16509 # include <string.h>
16511 # include <strings.h>
16514 # include <unistd.h> /* Needed for NetBSD */
16518 char buf[128], abc[128];
16524 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16525 try to store the string in read-only memory. */
16526 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16528 for (align = 7; align >= 0; align--) {
16529 for (len = 36; len; len--) {
16531 memcpy(b, abc, len);
16532 for (off = 1; off <= len; off++) {
16533 memcpy(b+off, b, len);
16534 memcpy(b, b+off, len);
16535 if (memcmp(b, abc, len))
16544 if eval $compile_ok; then
16545 if $run ./try 2>/dev/null; then
16546 echo "Yes, it can."
16549 echo "It can't, sorry."
16552 echo "(I can't compile the test program, so we'll assume not...)"
16562 : can memcmp be trusted to compare relative magnitude?
16564 case "$d_memcmp" in
16567 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16569 #$i_memory I_MEMORY
16570 #$i_stdlib I_STDLIB
16571 #$i_string I_STRING
16572 #$i_unistd I_UNISTD
16574 $cat >>try.c <<'EOCP'
16577 # include <memory.h>
16580 # include <stdlib.h>
16583 # include <string.h>
16585 # include <strings.h>
16588 # include <unistd.h> /* Needed for NetBSD */
16594 if ((a < b) && memcmp(&a, &b, 1) < 0)
16600 if eval $compile_ok; then
16601 if $run ./try 2>/dev/null; then
16602 echo "Yes, it can."
16605 echo "No, it can't (it uses signed chars)."
16608 echo "(I can't compile the test program, so we'll assume not...)"
16616 : see if prototype for sbrk is available
16618 set d_sbrkproto sbrk $i_unistd unistd.h
16621 : see if select exists
16622 set select d_select
16625 : see if semctl exists
16626 set semctl d_semctl
16629 : see if semget exists
16630 set semget d_semget
16633 : see if semop exists
16637 : see how much of the 'sem*(2)' library is present.
16640 case "$d_semctl$d_semget$d_semop" in
16641 *"$undef"*) h_sem=false;;
16645 case "`ipcs 2>&1`" in
16646 "SVID messages"*"not configured"*)
16647 echo "Your $osname does not have the sem*(2) configured." >&4
16650 set semctl d_semctl
16652 set semget d_semget
16660 : we could also check for sys/ipc.h ...
16661 if $h_sem && $test `./findhdr sys/sem.h`; then
16662 echo "You have the full sem*(2) library." >&4
16665 echo "You don't have the full sem*(2) library." >&4
16671 : see whether sys/sem.h defines union semun
16673 $cat > try.c <<'END'
16674 #include <sys/types.h>
16675 #include <sys/ipc.h>
16676 #include <sys/sem.h>
16677 int main () { union semun semun; semun.buf = 0; }
16680 if eval $compile; then
16681 echo "You have union semun in <sys/sem.h>." >&4
16684 echo "You do not have union semun in <sys/sem.h>." >&4
16691 : see how to do semctl IPC_STAT
16695 $cat > tryh.h <<END
16698 # define S_IRUSR S_IREAD
16699 # define S_IWUSR S_IWRITE
16700 # define S_IXUSR S_IEXEC
16702 # define S_IRUSR 0400
16703 # define S_IWUSR 0200
16704 # define S_IXUSR 0100
16706 # define S_IRGRP (S_IRUSR>>3)
16707 # define S_IWGRP (S_IWUSR>>3)
16708 # define S_IXGRP (S_IXUSR>>3)
16709 # define S_IROTH (S_IRUSR>>6)
16710 # define S_IWOTH (S_IWUSR>>6)
16711 # define S_IXOTH (S_IXUSR>>6)
16714 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16715 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16716 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16719 : see whether semctl IPC_STAT can use union semun
16720 case "$d_semctl_semun" in
16724 #include <sys/types.h>
16725 #include <sys/ipc.h>
16726 #include <sys/sem.h>
16727 #include <sys/stat.h>
16734 #$d_union_semun HAS_UNION_SEMUN
16737 #ifndef HAS_UNION_SEMUN
16740 struct semid_ds *buf;
16741 unsigned short *array;
16747 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16748 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16750 struct semid_ds argbuf;
16753 st = semctl(sem, 0, IPC_STAT, arg);
16757 # endif /* IPC_STAT */
16758 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16760 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16761 # endif /* IPC_RMID */
16762 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16764 #endif /* IPC_PRIVATE && ... */
16765 printf("semget failed: errno = %d\n", errno);
16770 if eval $compile; then
16773 semun) val="$define" ;;
16781 case "$d_semctl_semun" in
16783 echo "You can use union semun for semctl IPC_STAT." >&4
16786 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16791 : see whether semctl IPC_STAT can use struct semid_ds pointer
16792 case "$d_semctl_semid_ds" in
16795 $cat > try.c <<'END'
16796 #include <sys/types.h>
16797 #include <sys/ipc.h>
16798 #include <sys/sem.h>
16799 #include <sys/stat.h>
16807 struct semid_ds arg;
16810 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16811 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16814 st = semctl(sem, 0, IPC_STAT, &arg);
16816 printf("semid_ds\n");
16818 # endif /* IPC_STAT */
16819 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16821 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16822 # endif /* IPC_RMID */
16823 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16825 #endif /* IPC_PRIVATE && ... */
16826 printf("semget failed: errno = %d\n", errno);
16832 if eval $compile; then
16835 semid_ds) val="$define" ;;
16839 set d_semctl_semid_ds
16843 case "$d_semctl_semid_ds" in
16845 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16847 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16853 # We do not have the full sem*(2) library, so assume we can not
16859 set d_semctl_semid_ds
16865 : see if sendmsg exists
16866 set sendmsg d_sendmsg
16869 : see if setegid exists
16870 set setegid d_setegid
16873 : see if seteuid exists
16874 set seteuid d_seteuid
16877 : see if setgrent exists
16878 set setgrent d_setgrent
16881 : see if setgrent_r exists
16882 set setgrent_r d_setgrent_r
16884 case "$d_setgrent_r" in
16886 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16887 case "$d_setgrent_r_proto:$usethreads" in
16888 ":define") d_setgrent_r_proto=define
16889 set d_setgrent_r_proto setgrent_r $hdrs
16893 case "$d_setgrent_r_proto" in
16895 case "$setgrent_r_proto" in
16896 ''|0) try='int setgrent_r(FILE**);'
16897 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
16899 case "$setgrent_r_proto" in
16900 ''|0) try='void setgrent_r(FILE**);'
16901 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
16903 case "$setgrent_r_proto" in
16904 ''|0) d_setgrent_r=undef
16906 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16907 * ) case "$setgrent_r_proto" in
16908 REENTRANT_PROTO*) ;;
16909 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16911 echo "Prototype: $try" ;;
16914 *) case "$usethreads" in
16915 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16922 *) setgrent_r_proto=0
16926 : see if sethostent exists
16927 set sethostent d_sethent
16930 : see if sethostent_r exists
16931 set sethostent_r d_sethostent_r
16933 case "$d_sethostent_r" in
16935 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16936 case "$d_sethostent_r_proto:$usethreads" in
16937 ":define") d_sethostent_r_proto=define
16938 set d_sethostent_r_proto sethostent_r $hdrs
16942 case "$d_sethostent_r_proto" in
16944 case "$sethostent_r_proto" in
16945 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16946 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
16948 case "$sethostent_r_proto" in
16949 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16950 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
16952 case "$sethostent_r_proto" in
16953 ''|0) d_sethostent_r=undef
16954 sethostent_r_proto=0
16955 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16956 * ) case "$sethostent_r_proto" in
16957 REENTRANT_PROTO*) ;;
16958 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16960 echo "Prototype: $try" ;;
16963 *) case "$usethreads" in
16964 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16966 d_sethostent_r=undef
16967 sethostent_r_proto=0
16971 *) sethostent_r_proto=0
16975 : see if setitimer exists
16976 set setitimer d_setitimer
16979 : see if setlinebuf exists
16980 set setlinebuf d_setlinebuf
16983 : see if setlocale exists
16984 set setlocale d_setlocale
16987 : see if locale.h is available
16988 set locale.h i_locale
16991 : see if setlocale_r exists
16992 set setlocale_r d_setlocale_r
16994 case "$d_setlocale_r" in
16996 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16997 case "$d_setlocale_r_proto:$usethreads" in
16998 ":define") d_setlocale_r_proto=define
16999 set d_setlocale_r_proto setlocale_r $hdrs
17003 case "$d_setlocale_r_proto" in
17005 case "$setlocale_r_proto" in
17006 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17007 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17009 case "$setlocale_r_proto" in
17010 ''|0) d_setlocale_r=undef
17011 setlocale_r_proto=0
17012 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17013 * ) case "$setlocale_r_proto" in
17014 REENTRANT_PROTO*) ;;
17015 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17017 echo "Prototype: $try" ;;
17020 *) case "$usethreads" in
17021 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17023 d_setlocale_r=undef
17024 setlocale_r_proto=0
17028 *) setlocale_r_proto=0
17032 : see if setnetent exists
17033 set setnetent d_setnent
17036 : see if setnetent_r exists
17037 set setnetent_r d_setnetent_r
17039 case "$d_setnetent_r" in
17041 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17042 case "$d_setnetent_r_proto:$usethreads" in
17043 ":define") d_setnetent_r_proto=define
17044 set d_setnetent_r_proto setnetent_r $hdrs
17048 case "$d_setnetent_r_proto" in
17050 case "$setnetent_r_proto" in
17051 ''|0) try='int setnetent_r(int, struct netent_data*);'
17052 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17054 case "$setnetent_r_proto" in
17055 ''|0) try='void setnetent_r(int, struct netent_data*);'
17056 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17058 case "$setnetent_r_proto" in
17059 ''|0) d_setnetent_r=undef
17060 setnetent_r_proto=0
17061 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17062 * ) case "$setnetent_r_proto" in
17063 REENTRANT_PROTO*) ;;
17064 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17066 echo "Prototype: $try" ;;
17069 *) case "$usethreads" in
17070 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17072 d_setnetent_r=undef
17073 setnetent_r_proto=0
17077 *) setnetent_r_proto=0
17081 : see if setprotoent exists
17082 set setprotoent d_setpent
17085 : see if setpgid exists
17086 set setpgid d_setpgid
17089 : see if setpgrp2 exists
17090 set setpgrp2 d_setpgrp2
17093 : see if setpriority exists
17094 set setpriority d_setprior
17097 : see if setproctitle exists
17098 set setproctitle d_setproctitle
17101 : see if setprotoent_r exists
17102 set setprotoent_r d_setprotoent_r
17104 case "$d_setprotoent_r" in
17106 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17107 case "$d_setprotoent_r_proto:$usethreads" in
17108 ":define") d_setprotoent_r_proto=define
17109 set d_setprotoent_r_proto setprotoent_r $hdrs
17113 case "$d_setprotoent_r_proto" in
17115 case "$setprotoent_r_proto" in
17116 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17117 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17119 case "$setprotoent_r_proto" in
17120 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17121 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17123 case "$setprotoent_r_proto" in
17124 ''|0) d_setprotoent_r=undef
17125 setprotoent_r_proto=0
17126 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17127 * ) case "$setprotoent_r_proto" in
17128 REENTRANT_PROTO*) ;;
17129 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17131 echo "Prototype: $try" ;;
17134 *) case "$usethreads" in
17135 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17137 d_setprotoent_r=undef
17138 setprotoent_r_proto=0
17142 *) setprotoent_r_proto=0
17146 : see if setpwent exists
17147 set setpwent d_setpwent
17150 : see if setpwent_r exists
17151 set setpwent_r d_setpwent_r
17153 case "$d_setpwent_r" in
17155 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17156 case "$d_setpwent_r_proto:$usethreads" in
17157 ":define") d_setpwent_r_proto=define
17158 set d_setpwent_r_proto setpwent_r $hdrs
17162 case "$d_setpwent_r_proto" in
17164 case "$setpwent_r_proto" in
17165 ''|0) try='int setpwent_r(FILE**);'
17166 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17168 case "$setpwent_r_proto" in
17169 ''|0) try='void setpwent_r(FILE**);'
17170 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17172 case "$setpwent_r_proto" in
17173 ''|0) d_setpwent_r=undef
17175 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17176 * ) case "$setpwent_r_proto" in
17177 REENTRANT_PROTO*) ;;
17178 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17180 echo "Prototype: $try" ;;
17183 *) case "$usethreads" in
17184 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17191 *) setpwent_r_proto=0
17195 : see if setregid exists
17196 set setregid d_setregid
17198 set setresgid d_setresgid
17201 : see if setreuid exists
17202 set setreuid d_setreuid
17204 set setresuid d_setresuid
17207 : see if setrgid exists
17208 set setrgid d_setrgid
17211 : see if setruid exists
17212 set setruid d_setruid
17215 : see if setservent exists
17216 set setservent d_setsent
17219 : see if setservent_r exists
17220 set setservent_r d_setservent_r
17222 case "$d_setservent_r" in
17224 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17225 case "$d_setservent_r_proto:$usethreads" in
17226 ":define") d_setservent_r_proto=define
17227 set d_setservent_r_proto setservent_r $hdrs
17231 case "$d_setservent_r_proto" in
17233 case "$setservent_r_proto" in
17234 ''|0) try='int setservent_r(int, struct servent_data*);'
17235 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17237 case "$setservent_r_proto" in
17238 ''|0) try='void setservent_r(int, struct servent_data*);'
17239 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17241 case "$setservent_r_proto" in
17242 ''|0) d_setservent_r=undef
17243 setservent_r_proto=0
17244 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17245 * ) case "$setservent_r_proto" in
17246 REENTRANT_PROTO*) ;;
17247 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17249 echo "Prototype: $try" ;;
17252 *) case "$usethreads" in
17253 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17255 d_setservent_r=undef
17256 setservent_r_proto=0
17260 *) setservent_r_proto=0
17264 : see if setsid exists
17265 set setsid d_setsid
17268 : see if setvbuf exists
17269 set setvbuf d_setvbuf
17272 : see if sfio.h is available
17276 : see if sfio library is available
17287 : Ok, but do we want to use it.
17291 true|$define|[yY]*) dflt='y';;
17294 echo "$package can use the sfio library, but it is experimental."
17295 case "$useperlio" in
17297 echo "For sfio also the PerlIO abstraction layer is needed."
17298 echo "Earlier you said you wouldn't want that."
17301 rp="You seem to have sfio available, do you want to try using it?"
17304 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
17305 useperlio="$define"
17308 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17313 *) case "$usesfio" in
17314 true|$define|[yY]*)
17315 echo "Sorry, cannot find sfio on this machine." >&4
17316 echo "Ignoring your setting of usesfio=$usesfio." >&4
17325 $define) usesfio='true';;
17326 *) usesfio='false';;
17330 *) : Remove sfio from list of libraries to use
17333 echo "Removing unneeded -lsfio from library list" >&4
17334 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17337 echo "libs = $libs" >&4
17344 : see if shmctl exists
17345 set shmctl d_shmctl
17348 : see if shmget exists
17349 set shmget d_shmget
17352 : see if shmat exists
17355 : see what shmat returns
17358 $cat >shmat.c <<'END'
17359 #include <sys/shm.h>
17362 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17367 echo "and it returns ($shmattype)." >&4
17368 : see if a prototype for shmat is available
17369 xxx=`./findhdr sys/shm.h`
17370 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17371 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17382 set d_shmatprototype
17385 : see if shmdt exists
17389 : see how much of the 'shm*(2)' library is present.
17392 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17393 *"$undef"*) h_shm=false;;
17397 case "`ipcs 2>&1`" in
17398 "SVID shared memory"*"not configured"*)
17399 echo "Your $osname does not have the shm*(2) configured." >&4
17402 set shmctl d_shmctl
17404 set shmget d_shmget
17414 : we could also check for sys/ipc.h ...
17415 if $h_shm && $test `./findhdr sys/shm.h`; then
17416 echo "You have the full shm*(2) library." >&4
17419 echo "You don't have the full shm*(2) library." >&4
17425 : see if we have sigaction
17427 if set sigaction val -f d_sigaction; eval $csym; $val; then
17428 echo 'sigaction() found.' >&4
17431 #include <sys/types.h>
17432 #include <signal.h>
17433 #$i_stdlib I_STDLIB
17435 #include <stdlib.h>
17439 struct sigaction act, oact;
17441 oact.sa_handler = 0;
17442 /* so that act and oact are used */
17443 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17447 if eval $compile_ok; then
17450 echo "But you don't seem to have a useable struct sigaction." >&4
17454 echo 'sigaction NOT found.' >&4
17457 set d_sigaction; eval $setvar
17460 : see if this is a sunmath.h system
17461 set sunmath.h i_sunmath
17464 : see if signbit exists
17465 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17468 #$i_sunmath I_SUNMATH
17472 #ifdef I_SUNMATH /* Solaris special math library */
17473 # include <sunmath.h>
17476 int main(int argc, char **argv)
17480 if ((signbit(x) == 0) && (signbit(y) != 0))
17488 if eval $compile; then
17489 if $run ./try; then
17493 $echo "Signbit seems to be available, but doesn't work as I expected."
17494 $echo "I won't use it." >&4
17505 : see if sigprocmask exists
17506 set sigprocmask d_sigprocmask
17509 : see if sigsetjmp exists
17511 case "$d_sigsetjmp" in
17514 #include <setjmp.h>
17515 #$i_stdlib I_STDLIB
17517 #include <stdlib.h>
17523 if (sigsetjmp(env,1))
17526 siglongjmp(env, 1);
17531 if eval $compile; then
17532 if $run ./try >/dev/null 2>&1; then
17533 echo "POSIX sigsetjmp found." >&4
17537 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17543 echo "sigsetjmp not found." >&4
17547 *) val="$d_sigsetjmp"
17548 case "$d_sigsetjmp" in
17549 $define) echo "POSIX sigsetjmp found." >&4;;
17550 $undef) echo "sigsetjmp not found." >&4;;
17558 : see if snprintf exists
17559 set snprintf d_snprintf
17562 : see if vsnprintf exists
17563 set vsnprintf d_vsnprintf
17566 case "$d_snprintf-$d_vsnprintf" in
17569 Checking whether your snprintf() and vsnprintf() work okay...
17571 $cat >try.c <<'EOCP'
17572 /* v?snprintf testing logic courtesy of Russ Allbery.
17573 * According to C99:
17574 * - if the buffer is too short it still must be \0-terminated
17575 * - if the buffer is too short the potentially required length
17576 * must be returned and not -1
17577 * - if the buffer is NULL the potentially required length
17578 * must be returned and not -1 or core dump
17581 #include <stdarg.h>
17585 int test (char *format, ...)
17590 va_start (args, format);
17591 count = vsnprintf (buf, sizeof buf, format, args);
17598 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17599 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17603 if eval $compile; then
17606 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17608 Your snprintf() and snprintf() don't seem to be working okay.
17610 d_snprintf="$undef"
17611 d_vsnprintf="$undef"
17615 echo "(I can't seem to compile the test program--assuming they don't)"
17616 d_snprintf="$undef"
17617 d_vsnprintf="$undef"
17623 : see if sockatmark exists
17624 set sockatmark d_sockatmark
17627 : see if prototype for sockatmark is available
17629 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17632 : see if socks5_init exists
17633 set socks5_init d_socks5_init
17636 : see if sprintf returns the length of the string in the buffer as per ANSI
17637 $echo "Checking whether sprintf returns the length of the string..." >&4
17640 #$i_stdlib I_STDLIB
17642 #include <stdlib.h>
17644 #$i_string I_STRING
17646 # include <string.h>
17648 # include <strings.h>
17657 int check (size_t expect, int test) {
17658 size_t got = strlen(buffer);
17662 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17667 int main(int argc, char **argv) {
17670 check(sprintf(buffer, ""), ++test);
17671 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17672 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17679 if eval $compile; then
17683 sprintf returns the length of the string (as ANSI says it should)
17685 d_sprintf_returns_strlen="$define"
17688 sprintf does not return the length of the string (how old is this system?)
17690 d_sprintf_returns_strlen="$undef"
17694 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17695 d_sprintf_returns_strlen="$undef"
17699 : see if srand48_r exists
17700 set srand48_r d_srand48_r
17702 case "$d_srand48_r" in
17704 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17705 case "$d_srand48_r_proto:$usethreads" in
17706 ":define") d_srand48_r_proto=define
17707 set d_srand48_r_proto srand48_r $hdrs
17711 case "$d_srand48_r_proto" in
17713 case "$srand48_r_proto" in
17714 ''|0) try='int srand48_r(long, struct drand48_data*);'
17715 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17717 case "$srand48_r_proto" in
17718 ''|0) d_srand48_r=undef
17720 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17721 * ) case "$srand48_r_proto" in
17722 REENTRANT_PROTO*) ;;
17723 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17725 echo "Prototype: $try" ;;
17728 *) case "$usethreads" in
17729 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17736 *) srand48_r_proto=0
17740 : see if srandom_r exists
17741 set srandom_r d_srandom_r
17743 case "$d_srandom_r" in
17745 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17746 case "$d_srandom_r_proto:$usethreads" in
17747 ":define") d_srandom_r_proto=define
17748 set d_srandom_r_proto srandom_r $hdrs
17752 case "$d_srandom_r_proto" in
17754 case "$srandom_r_proto" in
17755 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17756 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
17758 case "$srandom_r_proto" in
17759 ''|0) d_srandom_r=undef
17761 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17762 * ) case "$srandom_r_proto" in
17763 REENTRANT_PROTO*) ;;
17764 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17766 echo "Prototype: $try" ;;
17769 *) case "$usethreads" in
17770 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17777 *) srandom_r_proto=0
17781 : see if prototype for setresgid is available
17783 set d_sresgproto setresgid $i_unistd unistd.h
17786 : see if prototype for setresuid is available
17788 set d_sresuproto setresuid $i_unistd unistd.h
17791 : see if sys/stat.h is available
17792 set sys/stat.h i_sysstat
17795 : see if stat knows about block sizes
17797 echo "Checking to see if your struct stat has st_blocks field..." >&4
17798 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17801 : see if this is a sys/vfs.h system
17802 set sys/vfs.h i_sysvfs
17805 : see if this is a sys/statfs.h system
17806 set sys/statfs.h i_sysstatfs
17809 : Check for statfs_s
17811 echo "Checking to see if your system supports struct statfs..." >&4
17812 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
17814 case "$d_statfs_s" in
17815 "$define") echo "Yes, it does." ;;
17816 *) echo "No, it doesn't." ;;
17820 : see if struct statfs knows about f_flags
17821 case "$d_statfs_s" in
17824 echo "Checking to see if your struct statfs has f_flags field..." >&4
17825 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
17829 set d_statfs_f_flags
17833 case "$d_statfs_f_flags" in
17834 "$define") echo "Yes, it does." ;;
17835 *) echo "No, it doesn't." ;;
17838 : Check stream access
17840 Checking how to access stdio streams by file descriptor number...
17842 case "$stdio_stream_array" in
17843 '') $cat >try.c <<EOCP
17846 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17850 for s in _iob __iob __sF
17852 set try -DSTDIO_STREAM_ARRAY=$s
17853 if eval $compile; then
17854 case "`$run ./try`" in
17855 yes) stdio_stream_array=$s; break ;;
17861 case "$stdio_stream_array" in
17863 I can't figure out how to access stdio streams by file descriptor number.
17865 d_stdio_stream_array="$undef"
17868 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17870 d_stdio_stream_array="$define"
17874 : see if strcoll exists
17875 set strcoll d_strcoll
17878 : check for structure copying
17880 echo "Checking to see if your C compiler can copy structs..." >&4
17881 $cat >try.c <<'EOCP'
17891 if $cc -c try.c >/dev/null 2>&1 ; then
17893 echo "Yup, it can."
17896 echo "Nope, it can't."
17902 : see if strerror and/or sys_errlist[] exist
17904 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17905 if set strerror val -f d_strerror; eval $csym; $val; then
17906 echo 'strerror() found.' >&4
17907 d_strerror="$define"
17908 d_strerrm='strerror(e)'
17909 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17910 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17911 d_syserrlst="$define"
17913 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17914 d_syserrlst="$undef"
17916 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17917 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17918 echo 'strerror() found in string header.' >&4
17919 d_strerror="$define"
17920 d_strerrm='strerror(e)'
17921 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17922 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17923 d_syserrlst="$define"
17925 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17926 d_syserrlst="$undef"
17928 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17929 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17930 d_strerror="$undef"
17931 d_syserrlst="$define"
17932 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17934 echo 'strerror() and sys_errlist[] NOT found.' >&4
17935 d_strerror="$undef"
17936 d_syserrlst="$undef"
17937 d_strerrm='"unknown"'
17941 : see if strerror_r exists
17942 set strerror_r d_strerror_r
17944 case "$d_strerror_r" in
17946 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17947 case "$d_strerror_r_proto:$usethreads" in
17948 ":define") d_strerror_r_proto=define
17949 set d_strerror_r_proto strerror_r $hdrs
17953 case "$d_strerror_r_proto" in
17955 case "$strerror_r_proto" in
17956 ''|0) try='int strerror_r(int, char*, size_t);'
17957 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
17959 case "$strerror_r_proto" in
17960 ''|0) try='int strerror_r(int, char*, int);'
17961 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
17963 case "$strerror_r_proto" in
17964 ''|0) try='char* strerror_r(int, char*, size_t);'
17965 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
17967 case "$strerror_r_proto" in
17968 ''|0) d_strerror_r=undef
17970 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17971 * ) case "$strerror_r_proto" in
17972 REENTRANT_PROTO*) ;;
17973 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17975 echo "Prototype: $try" ;;
17978 *) case "$usethreads" in
17979 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17986 *) strerror_r_proto=0
17990 : see if strftime exists
17991 set strftime d_strftime
17994 : see if strlcat exists
17995 set strlcat d_strlcat
17998 : see if strlcpy exists
17999 set strlcpy d_strlcpy
18002 : see if strtod exists
18003 set strtod d_strtod
18006 : see if strtol exists
18007 set strtol d_strtol
18010 : see if strtold exists
18011 set strtold d_strtold
18014 : see if strtoll exists
18015 set strtoll d_strtoll
18018 case "$d_longlong-$d_strtoll" in
18021 Checking whether your strtoll() works okay...
18023 $cat >try.c <<'EOCP'
18026 #define strtoll __strtoll
18029 #define strtoll _strtoll
18032 extern long long int strtoll(char *s, char **, int);
18033 static int bad = 0;
18034 int check(char *s, long long ell, int een) {
18037 gll = strtoll(s, 0, 10);
18038 if (!((gll == ell) && (errno == een)))
18042 check(" 1", 1LL, 0);
18043 check(" 0", 0LL, 0);
18044 check("-1", -1LL, 0);
18045 check("-9223372036854775808", -9223372036854775808LL, 0);
18046 check("-9223372036854775808", -9223372036854775808LL, 0);
18047 check(" 9223372036854775807", 9223372036854775807LL, 0);
18048 check("-9223372036854775808", -9223372036854775808LL, 0);
18049 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18050 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18056 if eval $compile; then
18059 ok) echo "Your strtoll() seems to be working okay." ;;
18061 Your strtoll() doesn't seem to be working okay.
18067 echo "(I can't seem to compile the test program--assuming it doesn't)"
18073 : see if strtoq exists
18074 set strtoq d_strtoq
18077 : see if strtoul exists
18078 set strtoul d_strtoul
18081 case "$d_strtoul" in
18084 Checking whether your strtoul() works okay...
18086 $cat >try.c <<'EOCP'
18089 extern unsigned long int strtoul(char *s, char **, int);
18090 static int bad = 0;
18091 void check(char *s, unsigned long eul, int een) {
18094 gul = strtoul(s, 0, 10);
18095 if (!((gul == eul) && (errno == een)))
18099 check(" 1", 1L, 0);
18100 check(" 0", 0L, 0);
18102 case "$longsize" in
18104 $cat >>try.c <<'EOCP'
18105 check("18446744073709551615", 18446744073709551615UL, 0);
18106 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18107 #if 0 /* strtoul() for /^-/ strings is undefined. */
18108 check("-1", 18446744073709551615UL, 0);
18109 check("-18446744073709551614", 2, 0);
18110 check("-18446744073709551615", 1, 0);
18111 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18112 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18117 $cat >>try.c <<'EOCP'
18118 check("4294967295", 4294967295UL, 0);
18119 check("4294967296", 4294967295UL, ERANGE);
18120 #if 0 /* strtoul() for /^-/ strings is undefined. */
18121 check("-1", 4294967295UL, 0);
18122 check("-4294967294", 2, 0);
18123 check("-4294967295", 1, 0);
18124 check("-4294967296", 4294967295UL, ERANGE);
18125 check("-4294967297", 4294967295UL, ERANGE);
18130 : Should we write these tests to be more portable by sprintf-ing
18131 : ~0 and then manipulating that char string as input for strtol?
18134 $cat >>try.c <<'EOCP'
18141 if eval $compile; then
18142 case "`$run ./try`" in
18143 ok) echo "Your strtoul() seems to be working okay." ;;
18145 Your strtoul() doesn't seem to be working okay.
18151 echo "(I can't seem to compile the test program--assuming it doesn't)"
18157 : see if strtoull exists
18158 set strtoull d_strtoull
18161 case "$d_longlong-$d_strtoull" in
18164 Checking whether your strtoull() works okay...
18166 $cat >try.c <<'EOCP'
18169 #define strtoull __strtoull
18172 extern unsigned long long int strtoull(char *s, char **, int);
18173 static int bad = 0;
18174 int check(char *s, long long eull, int een) {
18177 gull = strtoull(s, 0, 10);
18178 if (!((gull == eull) && (errno == een)))
18182 check(" 1", 1LL, 0);
18183 check(" 0", 0LL, 0);
18184 check("18446744073709551615", 18446744073709551615ULL, 0);
18185 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18186 #if 0 /* strtoull() for /^-/ strings is undefined. */
18187 check("-1", 18446744073709551615ULL, 0);
18188 check("-18446744073709551614", 2LL, 0);
18189 check("-18446744073709551615", 1LL, 0);
18190 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18191 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18198 if eval $compile; then
18199 case "`$run ./try`" in
18200 ok) echo "Your strtoull() seems to be working okay." ;;
18202 Your strtoull() doesn't seem to be working okay.
18204 d_strtoull="$undef"
18208 echo "(I can't seem to compile the test program--assuming it doesn't)"
18209 d_strtoull="$undef"
18214 : see if strtouq exists
18215 set strtouq d_strtouq
18218 case "$d_strtouq" in
18221 Checking whether your strtouq() works okay...
18223 $cat >try.c <<'EOCP'
18226 extern unsigned long long int strtouq(char *s, char **, int);
18227 static int bad = 0;
18228 void check(char *s, unsigned long long eull, int een) {
18229 unsigned long long gull;
18231 gull = strtouq(s, 0, 10);
18232 if (!((gull == eull) && (errno == een)))
18236 check(" 1", 1LL, 0);
18237 check(" 0", 0LL, 0);
18238 check("18446744073709551615", 18446744073709551615ULL, 0);
18239 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18240 #if 0 /* strtouq() for /^-/ strings is undefined. */
18241 check("-1", 18446744073709551615ULL, 0);
18242 check("-18446744073709551614", 2LL, 0);
18243 check("-18446744073709551615", 1LL, 0);
18244 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18245 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18253 if eval $compile; then
18254 case "`$run ./try`" in
18255 ok) echo "Your strtouq() seems to be working okay." ;;
18257 Your strtouq() doesn't seem to be working okay.
18263 echo "(I can't seem to compile the test program--assuming it doesn't)"
18269 : see if strxfrm exists
18270 set strxfrm d_strxfrm
18273 : see if symlink exists
18274 set symlink d_symlink
18277 : see if syscall exists
18278 set syscall d_syscall
18281 : see if prototype for syscall is available
18283 set d_syscallproto syscall $i_unistd unistd.h
18286 : see if sysconf exists
18287 set sysconf d_sysconf
18290 : see if system exists
18291 set system d_system
18294 : see if tcgetpgrp exists
18295 set tcgetpgrp d_tcgetpgrp
18298 : see if tcsetpgrp exists
18299 set tcsetpgrp d_tcsetpgrp
18302 : see if prototype for telldir is available
18304 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18307 : see if time exists
18309 if test "X$d_time" = X -o X"$timetype" = X; then
18310 if set time val -f d_time; eval $csym; $val; then
18311 echo 'time() found.' >&4
18313 rp="What is the type returned by time() on this system?"
18314 set time_t timetype long stdio.h sys/types.h
18317 echo 'time() not found, hope that will do.' >&4
18325 : see if timegm exists
18326 set timegm d_timegm
18329 : see if this is a sys/times.h system
18330 set sys/times.h i_systimes
18333 : see if times exists
18335 if set times val -f d_times; eval $csym; $val; then
18336 echo 'times() found.' >&4
18339 case "$i_systimes" in
18340 "$define") inc='sys/times.h';;
18342 rp="What is the type returned by times() on this system?"
18343 set clock_t clocktype long stdio.h sys/types.h $inc
18346 echo 'times() NOT found, hope that will do.' >&4
18351 : see if tmpnam_r exists
18352 set tmpnam_r d_tmpnam_r
18354 case "$d_tmpnam_r" in
18356 hdrs="$i_systypes sys/types.h define stdio.h "
18357 case "$d_tmpnam_r_proto:$usethreads" in
18358 ":define") d_tmpnam_r_proto=define
18359 set d_tmpnam_r_proto tmpnam_r $hdrs
18363 case "$d_tmpnam_r_proto" in
18365 case "$tmpnam_r_proto" in
18366 ''|0) try='char* tmpnam_r(char*);'
18367 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18369 case "$tmpnam_r_proto" in
18370 ''|0) d_tmpnam_r=undef
18372 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18373 * ) case "$tmpnam_r_proto" in
18374 REENTRANT_PROTO*) ;;
18375 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18377 echo "Prototype: $try" ;;
18380 *) case "$usethreads" in
18381 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18388 *) tmpnam_r_proto=0
18392 : see if truncate exists
18393 set truncate d_truncate
18396 : see if ttyname_r exists
18397 set ttyname_r d_ttyname_r
18399 case "$d_ttyname_r" in
18401 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18402 case "$d_ttyname_r_proto:$usethreads" in
18403 ":define") d_ttyname_r_proto=define
18404 set d_ttyname_r_proto ttyname_r $hdrs
18408 case "$d_ttyname_r_proto" in
18410 case "$ttyname_r_proto" in
18411 ''|0) try='int ttyname_r(int, char*, size_t);'
18412 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18414 case "$ttyname_r_proto" in
18415 ''|0) try='int ttyname_r(int, char*, int);'
18416 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18418 case "$ttyname_r_proto" in
18419 ''|0) try='char* ttyname_r(int, char*, int);'
18420 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18422 case "$ttyname_r_proto" in
18423 ''|0) d_ttyname_r=undef
18425 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18426 * ) case "$ttyname_r_proto" in
18427 REENTRANT_PROTO*) ;;
18428 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18430 echo "Prototype: $try" ;;
18433 *) case "$usethreads" in
18434 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18441 *) ttyname_r_proto=0
18445 : see if tzname[] exists
18447 if set tzname val -a d_tzname; eval $csym; $val; then
18449 echo 'tzname[] found.' >&4
18452 echo 'tzname[] NOT found.' >&4
18457 : Check if is a multiplatform env
18459 next|rhapsody|darwin) multiarch="$define" ;;
18461 case "$multiarch" in
18462 ''|[nN]*) multiarch="$undef" ;;
18465 : check for ordering of bytes in a UV
18467 case "$usecrosscompile$multiarch" in
18470 You seem to be either cross-compiling or doing a multiarchitecture build,
18471 skipping the byteorder check.
18477 case "$byteorder" in
18480 In the following, larger digits indicate more significance. A big-endian
18481 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18482 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18483 machines may have weird orders like 3412. A Cray will report 87654321,
18484 an Alpha will report 12345678. If the test program works the default is
18486 I'm now running the test program...
18490 #$i_stdlib I_STDLIB
18492 #include <stdlib.h>
18494 #include <sys/types.h>
18495 typedef $uvtype UV;
18505 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18507 u.l = (UV)0x04030201;
18508 for (i = 0; i < $uvsize; i++)
18509 printf("%c", u.c[i]+'0');
18516 if eval $compile && $run ./try > /dev/null; then
18519 [1-4][1-4][1-4][1-4]|12345678|87654321)
18520 echo "(The test program ran ok.)"
18521 echo "byteorder=$dflt"
18524 ????|????????) echo "(The test program ran ok.)" ;;
18525 *) echo "(The test program didn't run right for some reason.)" ;;
18530 (I can't seem to compile the test program. Guessing big-endian...)
18533 case "$xxx_prompt" in
18535 rp="What is the order of bytes in $uvtype?"
18548 : Checking 32bit aligndness
18551 Checking to see whether you can access character data unalignedly...
18553 case "$d_u32align" in
18554 '') $cat >try.c <<EOCP
18556 #$i_stdlib I_STDLIB
18558 #include <stdlib.h>
18560 #define U32 $u32type
18561 #define BYTEORDER 0x$byteorder
18563 #include <signal.h>
18565 $signal_t bletch(int s) { exit(4); }
18568 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18573 if (sizeof(U32) != 4) {
18574 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18581 signal(SIGBUS, bletch);
18593 for (i = 0; i < 4; i++) {
18594 up = (U32*)(buf + i);
18595 if (! ((*up == 1 << (8*i)) || /* big-endian */
18596 (*up == 1 << (8*(3-i))) /* little-endian */
18600 printf("read failed (%x)\n", *up);
18606 for (i = 0; i < 4; i++) {
18607 up = (U32*)(buf + i);
18609 if (*up != 0xBeef) {
18610 printf("write failed (%x)\n", *up);
18624 if eval $compile_ok; then
18625 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18626 $run ./try 2>&1 >/dev/null
18629 You can access character data pretty unalignedly.
18631 d_u32align="$undef"
18634 It seems that you must access character data in an aligned manner.
18636 d_u32align="$define"
18640 rp='Can you access character data at unaligned addresses?'
18644 [yY]*) d_u32align="$undef" ;;
18645 *) d_u32align="$define" ;;
18652 : see if ualarm exists
18653 set ualarm d_ualarm
18656 : see if umask exists
18660 : see if unordered exists
18661 set unordered d_unordered
18664 : see if unsetenv exists
18665 set unsetenv d_unsetenv
18668 : see if usleep exists
18669 set usleep d_usleep
18672 : see if prototype for usleep is available
18674 set d_usleepproto usleep $i_unistd unistd.h
18677 : see if ustat exists
18681 : see if closedir exists
18682 set closedir d_closedir
18685 case "$d_closedir" in
18688 echo "Checking whether closedir() returns a status..." >&4
18690 #$i_dirent I_DIRENT /**/
18691 #$i_sysdir I_SYS_DIR /**/
18692 #$i_sysndir I_SYS_NDIR /**/
18693 #$i_systypes I_SYS_TYPES /**/
18695 #if defined(I_SYS_TYPES)
18696 #include <sys/types.h>
18698 #if defined(I_DIRENT)
18699 #include <dirent.h>
18700 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18701 #include <sys/dir.h>
18705 #include <sys/ndir.h>
18709 #include <ndir.h> /* may be wrong in the future */
18711 #include <sys/dir.h>
18716 int main() { return closedir(opendir(".")); }
18719 if eval $compile_ok; then
18720 if $run ./try > /dev/null 2>&1 ; then
18721 echo "Yes, it does."
18724 echo "No, it doesn't."
18728 echo "(I can't seem to compile the test program--assuming it doesn't)"
18736 set d_void_closedir
18740 : see if there is a wait4
18744 : see if waitpid exists
18745 set waitpid d_waitpid
18748 : see if wcstombs exists
18749 set wcstombs d_wcstombs
18752 : see if wctomb exists
18753 set wctomb d_wctomb
18756 : see if writev exists
18757 set writev d_writev
18760 : preserve RCS keywords in files with variable substitution, grrr
18765 Revision='$Revision'
18767 : check for alignment requirements
18769 case "$usecrosscompile$multiarch" in
18772 You seem to be either cross-compiling or doing a multiarchitecture build,
18773 skipping the memory alignment check.
18776 case "$alignbytes" in
18777 '') alignbytes=8 ;;
18781 case "$alignbytes" in
18782 '') echo "Checking alignment constraints..." >&4
18783 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18784 $cat >try.c <<'EOCP'
18785 typedef long double NV;
18788 $cat >try.c <<'EOCP'
18792 $cat >>try.c <<'EOCP'
18800 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18805 if eval $compile_ok; then
18809 echo "(I can't seem to compile the test program...)"
18812 *) dflt="$alignbytes"
18815 rp="Doubles must be aligned on a how-many-byte boundary?"
18823 : set the base revision
18826 : check for length of character
18828 case "$charsize" in
18830 echo "Checking to see how big your characters are (hey, you never know)..." >&4
18833 #$i_stdlib I_STDLIB
18835 #include <stdlib.h>
18839 printf("%d\n", (int)sizeof(char));
18844 if eval $compile_ok; then
18848 echo "(I can't seem to compile the test program. Guessing...)"
18855 rp="What is the size of a character (in bytes)?"
18860 : Check for the number of bits in a character
18861 case "$charbits" in
18862 '') echo "Checking how long a character is (in bits)..." >&4
18869 for (c = 1, n = 0; c; c <<= 1, n++) ;
18870 printf ("%d\n", n);
18875 if eval $compile_ok; then
18879 echo "(I can't seem to compile the test program. Guessing...)"
18886 rp="What is the length of a character (in bits)?"
18890 case "$charbits" in
18893 Your system has an unsigned character size of $charbits bits, which
18894 is rather unusual (normally it is 8 bits). Perl likely will not work
18895 correctly on your system, with subtle bugs in various places.
18897 rp='Do you really want to continue?'
18901 [yY]) echo >&4 "Okay, continuing." ;;
18906 : how do we concatenate cpp tokens here?
18908 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18909 $cat >cpp_stuff.c <<'EOCP'
18910 #define RCAT(a,b)a/**/b
18911 #define ACAT(a,b)a ## b
18915 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18916 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18917 echo "Oh! Smells like ANSI's been here." >&4
18918 echo "We can catify or stringify, separately or together!"
18920 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18921 echo "Ah, yes! The good old days!" >&4
18922 echo "However, in the good old days we don't know how to stringify and"
18923 echo "catify at the same time."
18927 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18928 You're going to have to edit the values of CAT[2-5] in config.h...
18930 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18934 : see if this is a db.h system
18940 : Check db version.
18942 echo "Checking Berkeley DB version ..." >&4
18948 #include <sys/types.h>
18950 #$i_stdlib I_STDLIB
18952 #include <stdlib.h>
18955 int main(int argc, char *argv[])
18957 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18958 int Major, Minor, Patch ;
18959 unsigned long Version ;
18960 (void)db_version(&Major, &Minor, &Patch) ;
18962 printf("%d %d %d %d %d %d\n",
18963 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18964 Major, Minor, Patch);
18967 printf("You have Berkeley DB Version 2 or greater.\n");
18969 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18970 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18971 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18972 Major, Minor, Patch) ;
18974 /* check that db.h & libdb are compatible */
18975 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18976 printf("db.h and libdb are incompatible.\n") ;
18980 printf("db.h and libdb are compatible.\n") ;
18982 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18983 + DB_VERSION_PATCH ;
18985 /* needs to be >= 2.3.4 */
18986 if (Version < 2003004) {
18987 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18988 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18994 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18999 printf("You have Berkeley DB Version 1.\n");
19000 exit(0); /* DB version < 2: the coast is clear. */
19002 exit(1); /* <db.h> not Berkeley DB? */
19008 if eval $compile_ok && $run ./try; then
19009 echo 'Looks OK.' >&4
19011 db_version_major=$1
19012 db_version_minor=$2
19013 db_version_patch=$3
19015 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19019 : Remove db from list of libraries to use
19020 echo "Removing unusable -ldb from library list" >&4
19021 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19024 echo "libs = $libs" >&4
19034 : Check the return type needed for hash
19036 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19042 #include <sys/types.h>
19045 #ifndef DB_VERSION_MAJOR
19046 u_int32_t hash_cb (ptr, size)
19054 info.hash = hash_cb;
19058 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19059 if $contains warning try.out >>/dev/null 2>&1 ; then
19062 db_hashtype='u_int32_t'
19065 : XXX Maybe we should just give up here.
19066 db_hashtype=u_int32_t
19068 echo "Help: I can't seem to compile the db test program." >&4
19069 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19072 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19074 *) db_hashtype=u_int32_t
19079 : Check the return type needed for prefix
19081 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19087 #include <sys/types.h>
19090 #ifndef DB_VERSION_MAJOR
19091 size_t prefix_cb (key1, key2)
19099 info.prefix = prefix_cb;
19103 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19104 if $contains warning try.out >>/dev/null 2>&1 ; then
19105 db_prefixtype='int'
19107 db_prefixtype='size_t'
19110 db_prefixtype='size_t'
19111 : XXX Maybe we should just give up here.
19113 echo "Help: I can't seem to compile the db test program." >&4
19114 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19117 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19119 *) db_prefixtype='size_t'
19123 : How can we generate normalized random numbers ?
19125 echo "Looking for a random number function..." >&4
19126 case "$randfunc" in
19128 if set drand48 val -f; eval $csym; $val; then
19130 echo "Good, found drand48()." >&4
19131 elif set random val -f; eval $csym; $val; then
19133 echo "OK, found random()." >&4
19136 echo "Yick, looks like I have to use rand()." >&4
19147 *-Dmy_rand=*|*-Dmy_srand=*)
19148 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19149 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19150 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19151 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19155 while $test "$cont"; do
19156 rp="Use which function to generate random numbers?"
19158 if $test "$ans" = "$dflt"; then
19164 if set $ans val -f; eval $csym; $val; then
19168 rp="I cannot find function $ans. Use that name anyway?"
19177 case "$randfunc" in
19179 drand01="drand48()"
19185 case "$randbits" in
19187 echo "Checking to see how many bits your $randfunc() function produces..." >&4
19189 #$i_unistd I_UNISTD
19190 #$i_stdlib I_STDLIB
19193 # include <unistd.h>
19196 # include <stdlib.h>
19201 register unsigned long tmp;
19202 register unsigned long max = 0L;
19204 for (i = 1000; i; i--) {
19205 tmp = (unsigned long) $randfunc();
19206 if (tmp > max) max = tmp;
19208 for (i = 0; max; i++)
19214 if eval $compile_ok; then
19218 echo "(I can't seem to compile the test program...)"
19225 rp="How many bits does your $randfunc() function produce?"
19229 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19230 seedfunc="s$randfunc"
19231 randseedtype=unsigned
19235 rp="How many bits does your $randfunc() function produce?"
19238 seedfunc="s$randfunc"
19239 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19240 if set $seedfunc val -f; eval $csym; $val; then
19241 echo "(Using $seedfunc() to seed random generator)"
19243 echo "(Warning: no $seedfunc() to seed random generator)"
19246 randseedtype=unsigned
19253 : Determine if this is an EBCDIC system
19255 echo "Determining whether or not we are on an EBCDIC system..." >&4
19256 $cat >try.c <<'EOM'
19259 if ('M'==0xd4) return 0;
19266 if eval $compile_ok; then
19267 if $run ./try; then
19268 echo "You seem to speak EBCDIC." >&4
19271 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19274 echo "I'm unable to compile the test program." >&4
19275 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19281 : Check how to flush
19284 Checking how to flush all pending stdio output...
19286 # I only know how to find the first 32 possibly open files on SunOS.
19287 # See also hints/sunos_4_1.sh and util.c --AD
19289 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19291 $cat >>try.c <<EOCP
19293 #$i_stdlib I_STDLIB
19295 #include <stdlib.h>
19297 #$i_unistd I_UNISTD
19299 # include <unistd.h>
19301 #$d_sysconf HAS_SYSCONF
19302 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19303 #ifdef HAS_STDIO_STREAM_ARRAY
19304 # define STDIO_STREAM_ARRAY $stdio_stream_array
19309 p = fopen("try.out", "w");
19313 # ifdef TRY_FPRINTF
19317 #ifdef TRY_FFLUSH_NULL
19320 #ifdef TRY_FFLUSH_ALL
19322 long open_max = -1;
19323 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19324 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19326 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19327 open_max = sysconf(_SC_OPEN_MAX);
19330 open_max = FOPEN_MAX;
19333 open_max = OPEN_MAX;
19342 # ifdef HAS_STDIO_STREAM_ARRAY
19343 if (open_max > 0) {
19345 for (i = 0; i < open_max; i++)
19346 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19347 STDIO_STREAM_ARRAY[i]._file < open_max &&
19348 STDIO_STREAM_ARRAY[i]._flag)
19349 fflush(&STDIO_STREAM_ARRAY[i]);
19357 : first we have to find out how _not_ to flush
19359 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19361 set try -DTRY_FPUTC
19362 if eval $compile; then
19363 $run ./try 2>/dev/null
19366 if $test ! -s try.out -a "X$code" = X42; then
19372 set try -DTRY_FPRINTF
19373 if eval $compile; then
19374 $run ./try 2>/dev/null
19377 if $test ! -s try.out -a "X$code" = X42; then
19378 output=-DTRY_FPRINTF
19384 : check for fflush NULL behaviour
19385 case "$fflushNULL" in
19386 '') set try -DTRY_FFLUSH_NULL $output
19387 if eval $compile; then
19388 $run ./try 2>/dev/null
19391 if $test -s try.out -a "X$code" = X42; then
19392 fflushNULL="`$cat try.out`"
19394 if $test "X$code" != X42; then
19396 (If this test failed, don't worry, we'll try another method shortly.)
19401 $rm -f core try.core core.try.*
19402 case "$fflushNULL" in
19404 Your fflush(NULL) works okay for output streams.
19405 Let's see if it clobbers input pipes...
19407 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19408 # bug that improperly flushes the input end of pipes. So we avoid the
19409 # autoflush on fork/system/exec support for now. :-(
19410 $cat >tryp.c <<EOCP
19413 main(int argc, char **argv)
19419 while ((i = getc(stdin)) != -1
19420 && (*bp++ = i) != '\n'
19421 && bp < &buf[1024])
19424 fprintf(stdout, "%s", buf);
19432 fflushNULL="$define"
19434 if eval $compile; then
19436 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19437 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19439 fflush(NULL) seems to behave okay with input streams.
19441 fflushNULL="$define"
19444 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19446 fflushNULL="$undef"
19449 $rm -f core tryp.c tryp.core core.tryp.*
19452 Your fflush(NULL) isn't working (contrary to ANSI C).
19454 fflushNULL="$undef"
19457 Cannot figure out whether your fflush(NULL) works or not.
19458 I'm assuming it doesn't (contrary to ANSI C).
19460 fflushNULL="$undef"
19464 $define|true|[yY]*)
19465 fflushNULL="$define"
19468 fflushNULL="$undef"
19471 : check explicit looping only if NULL did not work, and if the pipe
19472 : bug does not show up on an explicit flush too
19473 case "$fflushNULL" in
19475 $cat >tryp.c <<EOCP
19478 main(int argc, char **argv)
19484 while ((i = getc(stdin)) != -1
19485 && (*bp++ = i) != '\n'
19486 && bp < &buf[1024])
19489 fprintf(stdout, "%s", buf);
19498 if eval $compile; then
19500 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19501 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19503 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19505 : now check for fflushall behaviour
19506 case "$fflushall" in
19507 '') set try -DTRY_FFLUSH_ALL $output
19508 if eval $compile; then
19510 (Now testing the other method--but note that this also may fail.)
19512 $run ./try 2>/dev/null
19515 if $test -s try.out -a "X$code" = X42; then
19516 fflushall="`$cat try.out`"
19520 case "$fflushall" in
19522 Whew. Flushing explicitly all the stdio streams works.
19524 fflushall="$define"
19527 Sigh. Flushing explicitly all the stdio streams doesn't work.
19532 Cannot figure out whether flushing stdio streams explicitly works or not.
19533 I'm assuming it doesn't.
19539 "$define"|true|[yY]*)
19540 fflushall="$define"
19548 All is futile. Even fflush(stdin) clobbers input pipes!
19555 $rm -f core tryp.c tryp.core core.tryp.*
19557 *) fflushall="$undef"
19561 case "$fflushNULL$fflushall" in
19564 OK, I give up. I cannot figure out how to flush pending stdio output.
19565 We won't be flushing handles at all before fork/exec/popen.
19571 : Store the full pathname to the ar program for use in the C program
19572 : Respect a hint or command line value for full_ar.
19577 : Store the full pathname to the sed program for use in the C program
19580 : see what type gids are declared as in the kernel
19582 echo "Looking for the type for group ids returned by getgid()."
19583 set gid_t gidtype xxx stdio.h sys/types.h
19587 xxx=`./findhdr sys/user.h`
19588 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19590 unsigned) dflt="$1 $2" ;;
19594 *) dflt="$gidtype";;
19597 gid_t) echo "gid_t found." ;;
19598 *) rp="What is the type for group ids returned by getgid()?"
19604 : Check the size of GID
19607 *_t) zzz="$gidtype" ;;
19610 echo "Checking the size of $zzz..." >&4
19612 #include <sys/types.h>
19614 #$i_stdlib I_STDLIB
19616 #include <stdlib.h>
19619 printf("%d\n", (int)sizeof($gidtype));
19624 if eval $compile_ok; then
19628 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19631 echo "Your $zzz is $gidsize bytes long."
19636 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19640 : Check if GID is signed
19643 *_t) zzz="$gidtype" ;;
19646 echo "Checking the sign of $zzz..." >&4
19648 #include <sys/types.h>
19659 if eval $compile; then
19663 echo "(I can't execute the test program--guessing unsigned.)" >&4
19667 1) echo "Your $zzz is unsigned." ;;
19668 -1) echo "Your $zzz is signed." ;;
19674 echo "(I can't compile the test program--guessing unsigned.)" >&4
19678 : Check 64bit sizes
19681 if $test X"$quadtype" != X; then
19683 echo "Checking how to print 64-bit integers..." >&4
19685 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19686 $cat >try.c <<'EOCP'
19687 #include <sys/types.h>
19690 int q = 12345678901;
19691 printf("%ld\n", q);
19695 if eval $compile; then
19699 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19700 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19701 echo "We will use %d."
19707 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19708 $cat >try.c <<'EOCP'
19709 #include <sys/types.h>
19712 long q = 12345678901;
19713 printf("%ld\n", q);
19717 if eval $compile; then
19721 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19722 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19723 echo "We will use %ld."
19729 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19730 $cat >try.c <<'EOCP'
19731 #include <sys/types.h>
19732 #include <inttypes.h>
19735 int64_t q = 12345678901;
19736 printf("%" PRId64 "\n", q);
19740 if eval $compile; then
19744 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19745 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19746 echo "We will use the C9X style."
19752 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19754 #include <sys/types.h>
19757 $quadtype q = 12345678901;
19758 printf("%Ld\n", q);
19762 if eval $compile; then
19766 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19767 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19768 echo "We will use %Ld."
19774 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19775 $cat >try.c <<'EOCP'
19776 #include <sys/types.h>
19779 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19780 printf("%lld\n", q);
19784 if eval $compile; then
19788 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19789 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19790 echo "We will use the %lld style."
19796 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19798 #include <sys/types.h>
19801 $quadtype q = 12345678901;
19802 printf("%qd\n", q);
19806 if eval $compile; then
19810 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19811 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19812 echo "We will use %qd."
19818 if $test X"$sPRId64" = X; then
19819 echo "Cannot figure out how to print 64-bit integers." >&4
19826 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19827 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19829 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19830 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19834 : Check format strings for internal types
19836 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19838 if $test X"$ivsize" = X8; then
19839 ivdformat="$sPRId64"
19840 uvuformat="$sPRIu64"
19841 uvoformat="$sPRIo64"
19842 uvxformat="$sPRIx64"
19843 uvXUformat="$sPRIXU64"
19845 if $test X"$ivsize" = X"$longsize"; then
19852 if $test X"$ivsize" = X"$intsize"; then
19860 if $test X"$ivsize" = X"$shortsize"; then
19871 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19872 nveformat="$sPRIeldbl"
19873 nvfformat="$sPRIfldbl"
19874 nvgformat="$sPRIgldbl"
19875 nvEUformat="$sPRIEUldbl"
19876 nvFUformat="$sPRIFUldbl"
19877 nvGUformat="$sPRIGUldbl"
19887 case "$ivdformat" in
19888 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19893 : Check format string for GID
19896 $echo "Checking the format string to be used for gids..." >&4
19899 -1) if $test X"$gidsize" = X"$ivsize"; then
19900 gidformat="$ivdformat"
19902 if $test X"$gidsize" = X"$longsize"; then
19905 if $test X"$gidsize" = X"$intsize"; then
19908 if $test X"$gidsize" = X"$shortsize"; then
19915 *) if $test X"$gidsize" = X"$uvsize"; then
19916 gidformat="$uvuformat"
19918 if $test X"$gidsize" = X"$longsize"; then
19921 if $test X"$gidsize" = X"$intsize"; then
19924 if $test X"$gidsize" = X"$shortsize"; then
19933 : see if getgroups exists
19934 set getgroups d_getgrps
19937 : see if setgroups exists
19938 set setgroups d_setgrps
19941 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19943 case "$d_getgrps$d_setgrps" in
19945 case "$groupstype" in
19946 '') dflt="$gidtype" ;;
19947 *) dflt="$groupstype" ;;
19950 What type of pointer is the second argument to getgroups() and setgroups()?
19951 Usually this is the same as group ids, $gidtype, but not always.
19954 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19958 *) groupstype="$gidtype";;
19961 : MAD = Misc Attribute Definition
19963 if $test $patchlevel -lt 9; then
19964 : MAD is not available in 5.8.x or earlier.
19968 $define|true|[yY]*) dflt='y' ;;
19973 Would you like to build with Misc Attribute Decoration? This is development
19974 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19975 overhead on the interpreter.
19977 If this doesn't make any sense to you, just accept the default '$dflt'.
19979 rp='Build Perl with MAD?'
19984 madlyh='madly.h madly.act madly.tab'
19986 madlyobj="madly$_o" ;;
19995 : check whether make sets MAKE
19997 echo "Checking if your $make program sets \$(MAKE)..." >&4
19998 case "$make_set_make" in
20000 $sed 's/^X //' > testmake.mak << 'EOF'
20002 X @echo 'maketemp="$(MAKE)"'
20004 case "`$make -f testmake.mak 2>/dev/null`" in
20005 *maketemp=*) make_set_make='#' ;;
20006 *) make_set_make="MAKE=$make" ;;
20008 $rm -f testmake.mak
20011 case "$make_set_make" in
20012 '#') echo "Yup, it does.";;
20013 *) echo "Nope, it doesn't.";;
20016 : see what type is used for mode_t
20017 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20018 set mode_t modetype int stdio.h sys/types.h
20021 : see if we need va_copy
20023 case "$i_stdarg" in
20026 #include <stdarg.h>
20028 #$i_stdlib I_STDLIB
20030 #include <stdlib.h>
20032 #include <signal.h>
20035 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20037 return vfprintf(f, fmt, *valp);
20041 myvfprintf(FILE *f, const char *fmt, va_list val)
20043 return ivfprintf(f, fmt, &val);
20047 myprintf(char *fmt, ...)
20050 va_start(val, fmt);
20051 return myvfprintf(stdout, fmt, val);
20055 main(int ac, char **av)
20057 signal(SIGSEGV, exit);
20059 myprintf("%s%cs all right, then\n", "that", '\'');
20064 if eval $compile && $run ./try 2>&1 >/dev/null; then
20065 case "`$run ./try`" in
20066 "that's all right, then")
20072 yes) echo "It seems that you don't need va_copy()." >&4
20073 need_va_copy="$undef"
20075 *) echo "It seems that va_copy() or similar will be needed." >&4
20076 need_va_copy="$define"
20081 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20085 : see what type is used for size_t
20086 rp="What is the type used for the length parameter for string functions?"
20087 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20090 : check for type of arguments to gethostbyaddr.
20091 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20092 case "$d_gethbyaddr" in
20096 Checking to see what type of arguments are accepted by gethostbyaddr().
20098 hdrs="$define sys/types.h
20099 $d_socket sys/socket.h
20100 $i_niin netinet/in.h
20102 $i_unistd unistd.h"
20103 : The first arg can 'char *' or 'void *'
20104 : The second arg is some of integral type
20105 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20106 for yyy in size_t long int; do
20107 case "$netdb_host_type" in
20108 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20109 if ./protochk "$try" $hdrs; then
20110 echo "Your system accepts $xxx for the first arg."
20111 echo "...and $yyy for the second arg."
20112 netdb_host_type="$xxx"
20113 netdb_hlen_type="$yyy"
20119 : In case none of those worked, prompt the user.
20120 case "$netdb_host_type" in
20121 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20124 netdb_host_type=$ans
20125 rp='What is the type for the 2nd argument to gethostbyaddr?'
20128 netdb_hlen_type=$ans
20132 *) : no gethostbyaddr, so pick harmless defaults
20133 netdb_host_type='char *'
20134 netdb_hlen_type="$sizetype"
20137 # Remove the "const" if needed. -- but then we'll have a
20139 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20142 : check for type of argument to gethostbyname.
20143 if test "X$netdb_name_type" = X ; then
20144 case "$d_gethbyname" in
20148 Checking to see what type of argument is accepted by gethostbyname().
20150 hdrs="$define sys/types.h
20151 $d_socket sys/socket.h
20152 $i_niin netinet/in.h
20154 $i_unistd unistd.h"
20155 for xxx in "const char *" "char *"; do
20156 case "$netdb_name_type" in
20157 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20158 if ./protochk "$try" $hdrs; then
20159 echo "Your system accepts $xxx."
20160 netdb_name_type="$xxx"
20165 : In case none of those worked, prompt the user.
20166 case "$netdb_name_type" in
20167 '') rp='What is the type for the 1st argument to gethostbyname?'
20170 netdb_name_type=$ans
20174 *) : no gethostbyname, so pick harmless default
20175 netdb_name_type='char *'
20180 : check for type of 1st argument to getnetbyaddr.
20181 if test "X$netdb_net_type" = X ; then
20182 case "$d_getnbyaddr" in
20186 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20188 hdrs="$define sys/types.h
20189 $d_socket sys/socket.h
20190 $i_niin netinet/in.h
20192 $i_unistd unistd.h"
20193 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20194 case "$netdb_net_type" in
20195 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20196 if ./protochk "$try" $hdrs; then
20197 echo "Your system accepts $xxx."
20198 netdb_net_type="$xxx"
20203 : In case none of those worked, prompt the user.
20204 case "$netdb_net_type" in
20205 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20208 netdb_net_type=$ans
20212 *) : no getnetbyaddr, so pick harmless default
20213 netdb_net_type='long'
20217 : locate the preferred pager for this system
20224 [a-zA-Z]:/*) dflt=$pg;;
20228 [a-zA-Z]:/*) dflt=$more;;
20232 [a-zA-Z]:/*) dflt=$less;;
20235 '') dflt=/usr/ucb/more;;
20243 rp='What pager is used on your system?'
20247 : see what type pids are declared as in the kernel
20248 rp="What is the type of process ids on this system?"
20249 set pid_t pidtype int stdio.h sys/types.h
20252 : see if ar generates random libraries by itself
20254 echo "Checking how to generate random libraries on your machine..." >&4
20255 echo 'int bar1() { return bar2(); }' > bar1.c
20256 echo 'int bar2() { return 2; }' > bar2.c
20258 #$i_stdlib I_STDLIB
20260 #include <stdlib.h>
20262 int main() { printf("%d\n", bar1()); exit(0); }
20264 $cc $ccflags -c bar1.c >/dev/null 2>&1
20265 $cc $ccflags -c bar2.c >/dev/null 2>&1
20266 $cc $ccflags -c foo.c >/dev/null 2>&1
20267 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20268 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20269 $run ./foobar >/dev/null 2>&1; then
20270 echo "$ar appears to generate random libraries itself."
20272 if [ "X$ranlib" = "X" ]; then
20275 elif $ar s bar$_a >/dev/null 2>&1 &&
20276 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20277 $run ./foobar >/dev/null 2>&1; then
20278 echo "a table of contents needs to be added with '$ar s'."
20281 elif $ar ts bar$_a >/dev/null 2>&1 &&
20282 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20283 $run ./foobar >/dev/null 2>&1; then
20284 echo "a table of contents needs to be added with '$ar ts'."
20291 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20292 $test -f $ranlib || ranlib=''
20295 if $test -n "$ranlib"; then
20296 echo "your system has '$ranlib'; we'll use that."
20299 echo "your system doesn't seem to support random libraries"
20300 echo "so we'll use lorder and tsort to order the libraries."
20307 : see if this is a values.h system
20308 set values.h i_values
20311 : Check the max offset that gmtime and localtime accept
20312 echo "Checking max offsets that gmtime () accepts"
20315 define) yyy="#include <values.h>" ;;
20319 case "$sGMTIME_min/$sGMTIME_max" in
20322 #include <sys/types.h>
20331 void gm_check (time_t t, int min_year, int max_year)
20334 if ( tmp == NULL ||
20335 /* Check tm_year overflow */
20336 tmp->tm_year < min_year || tmp->tm_year > max_year)
20347 gm_check (MAXLONG, 69, 0x7fffffff);
20349 if (tmp == NULL || tmp->tm_year < 0) {
20350 for (i = 63; i >= 0; i--) {
20351 time_t x = pt | ((time_t)1 << i);
20352 if (x < 0 || x < pt) continue;
20353 gm_check (x, 69, 0x7fffffff);
20356 printf ("sGMTIME_max=%ld\n", pt);
20365 gm_check (MINLONG, -1900, 70);
20368 for (i = 36; i >= 0; i--) {
20369 time_t x = pt - ((time_t)1 << i);
20370 if (x > 0) continue;
20371 gm_check (x, -1900, 70);
20374 printf ("sGMTIME_min=%ld\n", pt);
20378 int main (int argc, char *argv[])
20380 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20387 if eval $compile; then
20390 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20396 echo "Checking max offsets that localtime () accepts"
20398 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20401 #include <sys/types.h>
20410 void local_check (time_t t, int min_year, int max_year)
20412 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20415 tmp = localtime (&t);
20416 if ( tmp == NULL ||
20417 /* Check tm_year overflow */
20418 tmp->tm_year < min_year || tmp->tm_year > max_year)
20422 } /* local_check */
20429 local_check (MAXLONG, 69, 0x7fffffff);
20431 if (tmp == NULL || tmp->tm_year < 0) {
20432 for (i = 63; i >= 0; i--) {
20433 time_t x = pt | ((time_t)1 << i);
20434 if (x < 0 || x < pt) continue;
20435 local_check (x, 69, 0x7fffffff);
20438 printf ("sLOCALTIME_max=%ld\n", pt);
20447 local_check (MINLONG, -1900, 70);
20450 for (i = 36; i >= 0; i--) {
20451 time_t x = pt - ((time_t)1 << i);
20452 if (x > 0) continue;
20453 local_check (x, -1900, 70);
20456 printf ("sLOCALTIME_min=%ld\n", pt);
20460 int main (int argc, char *argv[])
20468 if eval $compile; then
20471 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20477 : check for type of arguments to select.
20478 case "$selecttype" in
20479 '') case "$d_select" in
20483 Checking to see what type of arguments are accepted by select().
20485 hdrs="$define sys/types.h
20486 $i_systime sys/time.h
20487 $i_sysselct sys/select.h
20488 $d_socket sys/socket.h"
20489 : The first arg can be int, unsigned, or size_t
20490 : The last arg may or may not be 'const'
20492 : void pointer has been seen but using that
20493 : breaks the selectminbits test
20494 for xxx in 'fd_set *' 'int *'; do
20495 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20496 for tmo in 'struct timeval *' 'const struct timeval *'; do
20498 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20499 if ./protochk "$try" $hdrs; then
20500 echo "Your system accepts $xxx."
20509 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20510 case "$d_fd_set" in
20511 $define) dflt="fd_set *" ;;
20520 *) : no select, so pick a harmless default
20527 : check for the select 'width'
20528 case "$selectminbits" in
20529 '') safebits=`expr $ptrsize \* 8`
20530 case "$d_select" in
20534 Checking to see on how many bits at a time your select() operates...
20537 #include <sys/types.h>
20539 #$i_systime I_SYS_TIME
20540 #$i_systimek I_SYS_TIME_KERNEL
20545 # ifdef I_SYS_TIME_KERNEL
20548 # include <sys/time.h>
20549 # ifdef I_SYS_TIME_KERNEL
20553 #$i_sysselct I_SYS_SELECT
20554 #ifdef I_SYS_SELECT
20555 #include <sys/select.h>
20557 #$d_socket HAS_SOCKET
20559 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20562 #$i_stdlib I_STDLIB
20564 #include <stdlib.h>
20567 #define S sizeof(*(b))
20569 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20570 #define NBITS (NBYTES * 8)
20572 char *s = (char *)malloc(NBYTES);
20581 fp = fopen("try.c", "r");
20587 b = ($selecttype)s;
20588 for (i = 0; i < NBITS; i++)
20592 select(fd + 1, b, 0, 0, &t);
20593 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20595 printf("%d\n", i + 1);
20600 if eval $compile_ok; then
20601 selectminbits=`$run ./try`
20602 case "$selectminbits" in
20604 Cannot figure out on how many bits at a time your select() operates.
20605 I'll play safe and guess it is $safebits bits.
20607 selectminbits=$safebits
20608 bits="$safebits bits"
20611 *) bits="$selectminbits bits" ;;
20613 echo "Your select() operates on $bits at a time." >&4
20615 rp='What is the minimum number of bits your select() operates on?'
20616 case "$byteorder" in
20617 12345678) dflt=64 ;;
20623 selectminbits="$val"
20627 *) : no select, so pick a harmless default
20628 selectminbits=$safebits
20634 : Trace out the files included by signal.h, then look for SIGxxx names.
20635 if [ "X$fieldn" = X ]; then
20636 : Just make some guesses. We check them later.
20637 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20639 xxx=`echo '#include <signal.h>' |
20640 $cppstdin $cppminus $cppflags 2>/dev/null |
20641 $grep '^[ ]*#.*include' |
20642 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20643 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20646 for xx in $xxx /dev/null ; do
20647 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20649 case "$xxxfiles" in
20650 '') xxxfiles=`./findhdr signal.h` ;;
20653 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20654 print substr($2, 4, 20)
20656 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20657 print substr($3, 4, 20)
20659 : Append some common names just in case the awk scan failed.
20660 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20661 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20662 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20663 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20664 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20666 : generate a few handy files for later
20667 $cat > signal.c <<EOCP
20668 #include <sys/types.h>
20669 #include <signal.h>
20670 #$i_stdlib I_STDLIB
20672 #include <stdlib.h>
20677 /* Strange style to avoid deeply-nested #if/#else/#endif */
20680 # define NSIG (_NSIG)
20686 # define NSIG (SIGMAX+1)
20692 # define NSIG (SIG_MAX+1)
20698 # define NSIG (_SIG_MAX+1)
20704 # define NSIG (MAXSIG+1)
20710 # define NSIG (MAX_SIG+1)
20715 # ifdef SIGARRAYSIZE
20716 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20722 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20726 /* Default to some arbitrary number that's big enough to get most
20727 of the common signals.
20733 printf("NSIG %d\n", NSIG);
20739 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20741 printf "#ifdef SIG"; printf $1; printf "\n"
20742 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20743 printf $1; printf ");\n"
20747 printf "#endif /* JUST_NSIG */\n";
20748 printf "exit(0);\n}\n";
20751 $cat >signal.awk <<'EOP'
20752 BEGIN { ndups = 0 }
20753 $1 ~ /^NSIG$/ { nsig = $2 }
20754 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20755 if ($2 > maxsig) { maxsig = $2 }
20756 if (sig_name[$2]) {
20757 dup_name[ndups] = $1
20758 dup_num[ndups] = $2
20770 printf("NSIG %d\n", nsig);
20771 for (n = 1; n < nsig; n++) {
20773 printf("%s %d\n", sig_name[n], sig_num[n])
20776 printf("NUM%d %d\n", n, n)
20779 for (n = 0; n < ndups; n++) {
20780 printf("%s %d\n", dup_name[n], dup_num[n])
20784 $cat >signal_cmd <<EOS
20786 if $test -s signal.lst; then
20787 echo "Using your existing signal.lst file"
20792 $cat >>signal_cmd <<'EOS'
20795 if eval $compile_ok; then
20796 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20797 $uniq | $awk -f signal.awk >signal.lst
20799 echo "(I can't seem be able to compile the whole test program)" >&4
20800 echo "(I'll try it in little pieces.)" >&4
20801 set signal -DJUST_NSIG
20802 if eval $compile_ok; then
20803 $run ./signal$_exe > signal.nsg
20806 echo "I can't seem to figure out how many signals you have." >&4
20807 echo "Guessing 50." >&4
20808 echo 'NSIG 50' > signal.nsg
20810 : Now look at all the signal names, one at a time.
20811 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20812 $cat > signal.c <<EOCP
20813 #include <sys/types.h>
20814 #include <signal.h>
20817 printf("$xx %d\n", SIG${xx});
20822 if eval $compile; then
20823 echo "SIG${xx} found."
20824 $run ./signal$_exe >> signal.ls1
20826 echo "SIG${xx} NOT found."
20829 if $test -s signal.ls1; then
20830 $cat signal.nsg signal.ls1 |
20831 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20835 if $test -s signal.lst; then
20838 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20839 echo 'kill -l' >signal
20840 set X `csh -f <signal`
20844 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20846 echo $@ | $tr ' ' $trnl | \
20847 $awk '{ printf "%s %d\n", $1, ++s; }
20848 END { printf "NSIG %d\n", ++s }' >signal.lst
20850 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20852 chmod a+x signal_cmd
20853 $eunicefix signal_cmd
20855 : generate list of signal names
20857 case "$sig_name_init" in
20859 *) case "$sig_num_init" in
20860 ''|*,*) doinit=yes ;;
20865 echo "Generating a list of signal names and numbers..." >&4
20867 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20868 sig_name=`$awk 'BEGIN { printf "ZERO " }
20869 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20870 sig_num=`$awk 'BEGIN { printf "0 " }
20871 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20872 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20873 !/^NSIG/ { printf "\"%s\", ", $1 }
20874 END { printf "0\n" }' signal.lst`
20875 sig_num_init=`$awk 'BEGIN { printf "0, " }
20876 !/^NSIG/ { printf "%d, ", $2}
20877 END { printf "0\n"}' signal.lst`
20880 echo "The following $sig_count signals are available:"
20882 echo $sig_name | $awk \
20883 'BEGIN { linelen = 0 }
20885 for (i = 1; i <= NF; i++) {
20886 name = "SIG" $i " "
20887 linelen = linelen + length(name)
20888 if (linelen > 70) {
20890 linelen = length(name)
20896 sig_size=`echo $sig_name | awk '{print NF}'`
20897 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20899 : Check size of size
20901 case "$sizetype" in
20902 *_t) zzz="$sizetype" ;;
20903 *) zzz="filesize" ;;
20905 echo "Checking the size of $zzz..." >&4
20907 #include <sys/types.h>
20909 #$i_stdlib I_STDLIB
20911 #include <stdlib.h>
20914 printf("%d\n", (int)sizeof($sizetype));
20919 if eval $compile_ok; then
20923 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20926 echo "Your $zzz size is $sizesize bytes."
20931 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20935 : check for socklen_t
20937 echo "Checking to see if you have socklen_t..." >&4
20939 #include <sys/types.h>
20940 #$d_socket HAS_SOCKET
20942 #include <sys/socket.h>
20944 int main() { socklen_t x = 16; }
20947 if eval $compile; then
20949 echo "You have socklen_t."
20952 echo "You do not have socklen_t."
20953 case "$sizetype" in
20954 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20961 : see if this is a socks.h system
20962 set socks.h i_socks
20965 : check for type of the size argument to socket calls
20966 case "$d_socket" in
20970 Checking to see what type is the last argument of accept().
20973 case "$d_socklen_t" in
20974 "$define") yyy="$yyy socklen_t"
20976 yyy="$yyy $sizetype int long unsigned"
20977 for xxx in $yyy; do
20978 case "$socksizetype" in
20979 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
20980 case "$usesocks" in
20982 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20983 echo "Your system accepts '$xxx *' for the last argument of accept()."
20984 socksizetype="$xxx"
20987 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20988 echo "Your system accepts '$xxx *' for the last argument of accept()."
20989 socksizetype="$xxx"
20996 : In case none of those worked, prompt the user.
20997 case "$socksizetype" in
20998 '') rp='What is the type for socket address structure sizes?'
21005 *) : no sockets, so pick relatively harmless default
21010 : see what type is used for signed size_t
21011 set ssize_t ssizetype int stdio.h sys/types.h
21016 #$i_stdlib I_STDLIB
21018 #include <stdlib.h>
21020 #include <sys/types.h>
21021 #define Size_t $sizetype
21022 #define SSize_t $dflt
21025 if (sizeof(Size_t) == sizeof(SSize_t))
21027 else if (sizeof(Size_t) == sizeof(int))
21036 if eval $compile_ok && $run ./try > /dev/null; then
21037 ssizetype=`$run ./try`
21038 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21041 Help! I can't compile and run the ssize_t test program: please enlighten me!
21042 (This is probably a misconfiguration in your system or libraries, and
21043 you really ought to fix it. Still, I'll try anyway.)
21045 I need a type that is the same size as $sizetype, but is guaranteed to
21046 be signed. Common values are ssize_t, int and long.
21049 rp="What signed type is the same size as $sizetype?"
21055 : see what type of char stdio uses.
21057 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21058 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21059 echo "Your stdio uses unsigned chars." >&4
21060 stdchar="unsigned char"
21062 echo "Your stdio uses signed chars." >&4
21067 : see what type uids are declared as in the kernel
21069 echo "Looking for the type for user ids returned by getuid()."
21070 set uid_t uidtype xxx stdio.h sys/types.h
21074 xxx=`./findhdr sys/user.h`
21075 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21077 unsigned) dflt="$1 $2" ;;
21081 *) dflt="$uidtype";;
21084 uid_t) echo "uid_t found." ;;
21085 *) rp="What is the type for user ids returned by getuid()?"
21091 : Check size of UID
21094 *_t) zzz="$uidtype" ;;
21097 echo "Checking the size of $zzz..." >&4
21099 #include <sys/types.h>
21101 #$i_stdlib I_STDLIB
21103 #include <stdlib.h>
21106 printf("%d\n", (int)sizeof($uidtype));
21111 if eval $compile_ok; then
21115 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21118 echo "Your $zzz is $uidsize bytes long."
21123 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21126 : Check if UID is signed
21129 *_t) zzz="$uidtype" ;;
21132 echo "Checking the sign of $zzz..." >&4
21134 #include <sys/types.h>
21145 if eval $compile; then
21149 echo "(I can't execute the test program--guessing unsigned.)" >&4
21153 1) echo "Your $zzz is unsigned." ;;
21154 -1) echo "Your $zzz is signed." ;;
21160 echo "(I can't compile the test program--guessing unsigned.)" >&4
21164 : Check format string for UID
21166 $echo "Checking the format string to be used for uids..." >&4
21169 -1) if $test X"$uidsize" = X"$ivsize"; then
21170 uidformat="$ivdformat"
21172 if $test X"$uidsize" = X"$longsize"; then
21175 if $test X"$uidsize" = X"$intsize"; then
21178 if $test X"$uidsize" = X"$shortsize"; then
21185 *) if $test X"$uidsize" = X"$uvsize"; then
21186 uidformat="$uvuformat"
21188 if $test X"$uidsize" = X"$longsize"; then
21191 if $test X"$uidsize" = X"$intsize"; then
21194 if $test X"$uidsize" = X"$shortsize"; then
21203 : Check if site customization support was requested
21204 case "$usesitecustomize" in
21205 $define|true|[Yy]*)
21206 usesitecustomize="$define"
21209 usesitecustomize="$undef"
21213 : determine compiler compiler
21222 if $test -f "$byacc$_exe"; then
21224 comp="byacc or $comp"
21226 if $test -f "$bison$_exe"; then
21227 comp="$comp or bison -y"
21229 rp="Which compiler compiler ($comp) shall I use?"
21238 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
21244 : see if this is a assert.h system
21245 set assert.h i_assert
21248 : see if this is a fp.h system
21252 : see if this is a fp_class.h system
21253 set fp_class.h i_fp_class
21256 : see if gdbm.h is available
21261 : see if gdbm_open exists
21262 set gdbm_open d_gdbm_open
21264 case "$d_gdbm_open" in
21267 echo "We won't be including <gdbm.h>"
21276 : see if this is a ieeefp.h system
21277 case "$i_ieeefp" in
21278 '' ) set ieeefp.h i_ieeefp
21283 : see if this is a libutil.h system
21284 set libutil.h i_libutil
21287 : see if mach cthreads are available
21288 if test "X$usethreads" = "X$define"; then
21289 set mach/cthreads.h i_machcthr
21292 i_machcthr="$undef"
21295 : see if this is a mntent.h system
21296 set mntent.h i_mntent
21299 : see if net/errno.h is available
21301 set net/errno.h val
21304 : Unfortunately, it causes problems on some systems. Arrgh.
21307 cat > try.c <<'EOM'
21310 #include <net/errno.h>
21316 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21317 echo "We'll be including <net/errno.h>." >&4
21319 echo "We won't be including <net/errno.h>." >&4
21328 : see if netinet/tcp.h is available
21329 set netinet/tcp.h i_netinettcp
21332 : see if this is a poll.h system
21336 : see if this is a prot.h system
21340 : Preprocessor symbols
21342 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21343 $cat <<'EOSH' > Cppsym.know
21344 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21345 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21346 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21347 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21348 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21349 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21350 bull c cadmus clipper CMU COFF COMPILER_VERSION
21351 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21352 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21353 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21354 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21356 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21357 H3050R H3050RX hbullx20 hcx host_mips
21358 hp200 hp300 hp700 HP700 hp800 hp9000
21359 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21360 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21361 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21362 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21363 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21364 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21365 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21366 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21367 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21368 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21369 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21370 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21371 MATH_HAS_NO_SIDE_EFFECTS
21372 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21373 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21374 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21375 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21376 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21377 NetBSD news1500 news1700 news1800 news1900 news3700
21378 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21379 ns32016 ns32332 ns32k nsc32000
21380 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21381 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21382 pc532 pdp11 PGC PIC plexus PORTAR posix
21383 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21384 POSIX_C_SOURCE POSIX_SOURCE POWER
21385 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21386 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21387 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21388 sony sony_news sonyrisc sparc sparclite spectrum
21389 stardent stdc STDC_EXT stratos sun sun3 sun386
21390 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21391 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21392 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21393 sysV68 sysV88 Tek4132 Tek4300 titan
21394 TM3200 TM5400 TM5600
21395 tower tower32 tower32_200 tower32_600 tower32_700
21396 tower32_800 tower32_850 tss
21397 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21398 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21399 unix UNIX95 UNIX99 unixpc unos
21400 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21401 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21402 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21404 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21405 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21406 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21409 # Maybe put other stuff here too.
21410 cat <<EOSH >>Cppsym.know
21413 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21414 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21415 $cat Cppsym.know > Cppsym.c
21416 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21417 $rm -f Cppsym.a Cppsym.b Cppsym.c
21418 cat <<EOSH > Cppsym
21420 if $test \$# -gt 0; then
21421 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21422 if $test -s Cppsym.got; then
21429 $tr " " "$trnl" | ./Cppsym.try
21435 cat <<EOSH > Cppsym.try
21437 cat <<'EOCP' > try.c
21440 #define STRINGIFY(a) "a"
21442 #if cpp_stuff == 42
21443 #define StGiFy(a) #a
21444 #define STRINGIFY(a) StGiFy(a)
21446 #if $cpp_stuff != 1 && $cpp_stuff != 42
21447 # include "Bletch: How does this C preprocessor stringify macros?"
21453 cat <<'EOSH' >> Cppsym.try
21455 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21456 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21457 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21458 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21460 echo 'return 0;}' >> try.c
21462 cat <<EOSH >> Cppsym.try
21464 case "$osname-$gccversion" in
21465 irix-) ccflags="\$ccflags -woff 1178" ;;
21466 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21468 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21470 chmod +x Cppsym.try
21471 $eunicefix Cppsym.try
21472 ./Cppsym < Cppsym.know > Cppsym.true
21473 : Add in any linux cpp "predefined macros":
21474 case "$osname::$gccversion" in
21475 *linux*::*.*|*gnukfreebsd*::*.*)
21477 rm -f $tHdrH'.h' $tHdrH
21479 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21480 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21481 if [ -s $tHdrH'_cppsym.real' ]; then
21482 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21485 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21488 : now check the C compiler for additional symbols
21489 postprocess_cc_v=''
21491 aix) postprocess_cc_v="|$tr , ' '" ;;
21498 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21501 -D*) echo "\$i" | $sed 's/^-D//';;
21502 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21507 postprocess_cc_v=''
21510 ./ccsym > ccsym1.raw
21511 if $test -s ccsym1.raw; then
21512 $sort ccsym1.raw | $uniq >ccsym.raw
21514 mv ccsym1.raw ccsym.raw
21517 $awk '/\=/ { print $0; next }
21518 { print $0"=1" }' ccsym.raw >ccsym.list
21519 $comm -13 Cppsym.true ccsym.list >ccsym.own
21520 $comm -12 Cppsym.true ccsym.list >ccsym.com
21521 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21523 if $test -z ccsym.raw; then
21524 echo "Your C compiler doesn't seem to define any symbols!" >&4
21526 echo "However, your C preprocessor defines the following symbols:"
21529 cppsymbols=`$cat Cppsym.true`
21530 cppsymbols=`echo $cppsymbols`
21531 cppccsymbols="$cppsymbols"
21533 if $test -s ccsym.com; then
21534 echo "Your C compiler and pre-processor define these symbols:"
21535 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
21538 cppccsymbols=`$cat ccsym.com`
21539 cppccsymbols=`echo $cppccsymbols`
21540 $test "$silent" || sleep 1
21542 if $test -s ccsym.cpp; then
21543 $test "$also" && echo " "
21544 echo "Your C pre-processor ${also}defines the following symbols:"
21545 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
21547 cppsymbols=`$cat ccsym.cpp`
21548 cppsymbols=`echo $cppsymbols`
21549 $test "$silent" || sleep 1
21551 if $test -s ccsym.own; then
21552 $test "$also" && echo " "
21553 echo "Your C compiler ${also}defines the following cpp symbols:"
21554 $sed -e 's/\(..*\)=1/\1/' ccsym.own
21555 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
21556 ccsymbols=`$cat ccsym.own`
21557 ccsymbols=`echo $ccsymbols`
21558 $test "$silent" || sleep 1
21562 : see if this is a termio system
21566 if $test `./findhdr termios.h`; then
21567 set tcsetattr i_termios
21573 "$define") echo "You have POSIX termios.h... good!" >&4;;
21574 *) if ./Cppsym pyr; then
21575 case "`/bin/universe`" in
21576 ucb) if $test `./findhdr sgtty.h`; then
21578 echo "<sgtty.h> found." >&4
21580 echo "System is pyramid with BSD universe."
21581 ./warn "<sgtty.h> not found--you could have problems."
21583 *) if $test `./findhdr termio.h`; then
21585 echo "<termio.h> found." >&4
21587 echo "System is pyramid with USG universe."
21588 ./warn "<termio.h> not found--you could have problems."
21592 if $test `./findhdr termio.h`; then
21593 echo "<termio.h> found." >&4
21595 elif $test `./findhdr sgtty.h`; then
21596 echo "<sgtty.h> found." >&4
21599 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
21602 if $test `./findhdr sgtty.h`; then
21603 echo "<sgtty.h> found." >&4
21605 elif $test `./findhdr termio.h`; then
21606 echo "<termio.h> found." >&4
21609 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
21613 set i_termio; eval $setvar
21614 val=$val2; set i_sgtty; eval $setvar
21615 val=$val3; set i_termios; eval $setvar
21617 : see if stddef is available
21618 set stddef.h i_stddef
21621 : see if sys/access.h is available
21622 set sys/access.h i_sysaccess
21625 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
21626 set sys/filio.h i_sysfilio
21629 if $test `./findhdr sys/ioctl.h`; then
21631 echo '<sys/ioctl.h> found.' >&4
21634 if $test $i_sysfilio = "$define"; then
21635 echo '<sys/ioctl.h> NOT found.' >&4
21637 $test $i_sgtty = "$define" && xxx="sgtty.h"
21638 $test $i_termio = "$define" && xxx="termio.h"
21639 $test $i_termios = "$define" && xxx="termios.h"
21640 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
21646 : see if socket ioctl defs are in sys/sockio.h
21648 xxx=`./findhdr sys/sockio.h`
21649 if $test "$xxx"; then
21650 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
21652 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
21655 echo "No socket ioctls found in <sys/sockio.h>." >&4
21660 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
21666 : see if this is a syslog.h system
21667 set syslog.h i_syslog
21670 : see if this is a sys/mode.h system
21671 set sys/mode.h i_sysmode
21674 : see if there is a sys/poll.h file
21675 set sys/poll.h i_syspoll
21678 : see if sys/resource.h has to be included
21679 set sys/resource.h i_sysresrc
21682 : see if sys/security.h is available
21683 set sys/security.h i_syssecrt
21686 : see if this is a sys/statvfs.h system
21687 set sys/statvfs.h i_sysstatvfs
21690 : see if this is a sys/un.h system
21691 set sys/un.h i_sysun
21694 : see if this is a sys/utsname.h system
21695 set sys/utsname.h i_sysutsname
21698 : see if this is a syswait system
21699 set sys/wait.h i_syswait
21702 : see if this is a ustat.h system
21703 set ustat.h i_ustat
21706 : see if this is an utime system
21707 set utime.h i_utime
21710 : see if this is a vfork system
21713 set vfork.h i_vfork
21723 echo "Looking for extensions..." >&4
21724 : If we are using the old config.sh, known_extensions may contain
21725 : old or inaccurate or duplicate values.
21726 known_extensions=''
21727 nonxs_extensions=''
21728 : We do not use find because it might not be available.
21729 : We do not just use MANIFEST because the user may have dropped
21730 : some additional extensions into the source tree and expect them
21733 : Function to recursively find available extensions, ignoring DynaLoader
21734 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21735 : In 5.10.1 and later, extensions are stored in directories
21736 : like File-Glob instead of the older File/Glob/.
21740 DynaLoader|dynaload) ;;
21742 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
21743 leaf=`echo $xxx | $sed -e s/.*-//`;
21744 if $test -d File; then
21745 if $test -f $xxx/$leaf.xs -o -f $xxx/$leaf.c; then
21746 known_extensions="$known_extensions $1$this_ext";
21747 elif $test -f $xxx/Makefile.PL; then
21748 nonxs_extensions="$nonxs_extensions $1$this_ext";
21750 if $test -d $xxx -a $# -lt 10; then
21753 eval $find_extensions;
21759 $ls -1 $xxx > $$.tmp;
21760 if $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
21761 known_extensions="$known_extensions $this_ext";
21762 elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then
21763 known_extensions="$known_extensions $this_ext";
21764 elif $test -d $xxx; then
21765 nonxs_extensions="$nonxs_extensions $this_ext";
21776 eval $find_extensions
21780 eval $find_extensions
21784 eval $find_extensions
21785 if $test -d File-Glob; then
21786 : All ext/ flattened
21788 # Special case: Add in modules that nest beyond the first level.
21789 # Currently threads/shared and Hash/Util/FieldHash, since they are
21790 # not picked up by the recursive find above (and adding in general
21791 # recursive finding breaks SDBM_File/sdbm).
21792 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
21793 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
21795 set X $known_extensions
21797 known_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
21798 set X $nonxs_extensions
21800 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
21803 : Now see which are supported on this system.
21805 for xxx in $known_extensions ; do
21809 $define) avail_ext="$avail_ext $xxx" ;;
21812 GDBM_File|gdbm_fil)
21814 $define) avail_ext="$avail_ext $xxx" ;;
21817 I18N/Langinfo|i18n_lan)
21818 case "$i_langinfo$d_nl_langinfo" in
21819 $define$define) avail_ext="$avail_ext $xxx" ;;
21823 : XXX Do we need a useipcsysv variable here
21824 case "${d_msg}${d_sem}${d_shm}" in
21825 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21828 NDBM_File|ndbm_fil)
21831 case "$osname-$use64bitint" in
21834 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21837 *) avail_ext="$avail_ext $xxx" ;;
21842 ODBM_File|odbm_fil)
21843 case "${i_dbm}${i_rpcsvcdbm}" in
21845 case "$d_cplusplus" in
21846 define) ;; # delete as a function name will not work
21847 *) case "$osname-$use64bitint" in
21850 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21853 *) avail_ext="$avail_ext $xxx" ;;
21861 case "$useopcode" in
21862 true|define|y) avail_ext="$avail_ext $xxx" ;;
21866 case "$useposix" in
21867 true|define|y) avail_ext="$avail_ext $xxx" ;;
21871 case "$d_socket" in
21874 beos) ;; # not unless BONE
21875 *) avail_ext="$avail_ext $xxx" ;;
21880 Sys/Syslog|sys/syslog)
21881 : XXX syslog requires socket
21882 case "$d_socket" in
21883 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21887 case "$usethreads" in
21889 case "$use5005threads" in
21890 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
21894 threads|threads/shared)
21895 # threads and threads::shared are special cases.
21896 # To stop people from asking "Perl 5.8.0 was supposed
21897 # to have this new fancy threads implementation but my
21898 # perl doesn't have it" and from people trying to
21899 # (re)install the threads module using CPAN.pm and
21900 # CPAN.pm then offering to reinstall Perl 5.8.0,
21901 # the threads.pm and threads/shared.pm will always be
21902 # there, croaking informatively ("you need to rebuild
21903 # all of Perl with threads, sorry") when threads haven't
21904 # been compiled in.
21906 avail_ext="$avail_ext $xxx"
21912 cygwin) avail_ext="$avail_ext $xxx" ;;
21915 XS/APItest|xs/apitest)
21916 # This is just for testing. Skip it unless we have dynamic loading.
21919 $define) avail_ext="$avail_ext $xxx" ;;
21922 XS/APItest/KeywordRPN|xs/apitest/keywordrpn)
21923 # This is just for testing. Skip it unless we have dynamic loading.
21926 $define) avail_ext="$avail_ext $xxx" ;;
21929 XS/Typemap|xs/typemap)
21930 # This is just for testing. Skip it unless we have dynamic loading.
21932 $define) avail_ext="$avail_ext $xxx" ;;
21935 *) avail_ext="$avail_ext $xxx"
21944 case "$onlyextensions" in
21946 *) keepextensions=''
21947 echo "You have requested that only certains extensions be included..." >&4
21948 for i in $onlyextensions; do
21949 case " $avail_ext " in
21951 echo "Keeping extension $i."
21952 keepextensions="$keepextensions $i"
21954 *) echo "Ignoring extension $i." ;;
21957 avail_ext="$keepextensions"
21961 case "$noextensions" in
21963 *) keepextensions=''
21964 echo "You have requested that certain extensions be ignored..." >&4
21965 for i in $avail_ext; do
21966 case " $noextensions " in
21967 *" $i "*) echo "Ignoring extension $i." ;;
21968 *) echo "Keeping extension $i.";
21969 keepextensions="$keepextensions $i"
21973 avail_ext="$keepextensions"
21977 : Now see which nonxs extensions are supported on this system.
21978 : For now assume all are.
21980 for xxx in $nonxs_extensions ; do
21982 *) nonxs_ext="$nonxs_ext $xxx"
21994 A number of extensions are supplied with $package. You may choose to
21995 compile these extensions for dynamic loading (the default), compile
21996 them into the $package executable (static loading), or not include
21997 them at all. Answer "none" to include no extensions.
21998 Note that DynaLoader is always built and need not be mentioned here.
22001 case "$dynamic_ext" in
22003 : Exclude those listed in static_ext
22005 for xxx in $avail_ext; do
22006 case " $static_ext " in
22008 *) dflt="$dflt $xxx" ;;
22015 *) dflt="$dynamic_ext"
22016 # Perhaps we are reusing an old out-of-date config.sh.
22019 if test X"$dynamic_ext" != X"$avail_ext"; then
22021 NOTICE: Your previous config.sh list may be incorrect.
22022 The extensions now available to you are
22024 but the default list from your previous config.sh is
22036 rp="What extensions do you wish to load dynamically?"
22039 none) dynamic_ext=' ' ;;
22040 *) dynamic_ext="$ans" ;;
22043 case "$static_ext" in
22045 : Exclude those already listed in dynamic linking
22047 for xxx in $avail_ext; do
22048 case " $dynamic_ext " in
22050 *) dflt="$dflt $xxx" ;;
22057 *) dflt="$static_ext"
22064 rp="What extensions do you wish to load statically?"
22067 none) static_ext=' ' ;;
22068 *) static_ext="$ans" ;;
22073 A number of extensions are supplied with $package. Answer "none"
22074 to include no extensions.
22075 Note that DynaLoader is always built and need not be mentioned here.
22078 case "$static_ext" in
22079 '') dflt="$avail_ext" ;;
22080 *) dflt="$static_ext"
22081 # Perhaps we are reusing an old out-of-date config.sh.
22084 if test X"$static_ext" != X"$avail_ext"; then
22086 NOTICE: Your previous config.sh list may be incorrect.
22087 The extensions now available to you are
22089 but the default list from your previous config.sh is
22098 : Exclude those that are not xs extensions
22102 rp="What extensions do you wish to include?"
22105 none) static_ext=' ' ;;
22106 *) static_ext="$ans" ;;
22111 # Encode is a special case. If we are building Encode as a static
22112 # extension, we need to explicitly list its subextensions as well.
22113 # For other nested extensions, this is handled automatically by
22114 # the appropriate Makefile.PL.
22115 case " $static_ext " in
22116 *" Encode "*) # Add the subextensions of Encode
22118 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22119 static_ext="$static_ext Encode/$xxx"
22125 set X $dynamic_ext $static_ext $nonxs_ext
22129 # Sanity check: We require an extension suitable for use with
22130 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22131 # should show up as failures in the test suite, but it's helpful to
22132 # catch them now.) The 'extensions' list is normally sorted
22133 # alphabetically, so we need to accept either
22134 # DB_File ... Fcntl ... IO ....
22135 # or something like
22136 # Fcntl ... NDBM_File ... IO ....
22137 case " $extensions" in
22138 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22139 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22140 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22141 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22142 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22146 : Remove libraries needed only for extensions
22147 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22148 : The exception is SunOS 4.x, which needs them.
22149 case "${osname}X${osvers}" in
22153 *) case "$usedl" in
22154 $define|true|[yY]*)
22155 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22159 *) perllibs="$libs"
22165 : Remove build directory name from cppstdin so it can be used from
22166 : either the present location or the final installed location.
22168 : Get out of the UU directory to get correct path name.
22170 case "$cppstdin" in
22172 echo "Stripping down cppstdin path name"
22178 : end of configuration questions
22180 echo "End of configuration questions."
22183 : back to where it started
22184 if test -d ../UU; then
22188 : configuration may be unconditionally patched via a 'config.arch' file
22189 if $test -f config.arch; then
22190 echo "I see a config.arch file, loading it." >&4
22194 : configuration may be patched via a 'config.over' file
22195 if $test -f config.over; then
22198 rp='I see a config.over file. Do you wish to load it?'
22201 n*) echo "OK, I'll ignore it.";;
22203 echo "Configuration override changes have been loaded."
22208 : in case they want portability, strip down executable paths
22209 case "$d_portable" in
22212 echo "Stripping down executable paths..." >&4
22213 for file in $loclist $trylist; do
22215 eval $file=`basename $temp`
22220 : create config.sh file
22222 echo "Creating config.sh..." >&4
22223 $spitshell <<EOT >config.sh
22226 # This file was produced by running the Configure script. It holds all the
22227 # definitions figured out by Configure. Should you modify one of these values,
22228 # do not forget to propagate your changes by running "Configure -der". You may
22229 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22232 # Package name : $package
22233 # Source directory : $src
22234 # Configuration time: $cf_time
22235 # Configured by : $cf_by
22236 # Target system : $myuname
22239 : Add in command line options if available
22240 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22242 $spitshell <<EOT >>config.sh
22251 Revision='$Revision'
22259 alignbytes='$alignbytes'
22260 ansi2knr='$ansi2knr'
22261 aphostname='$aphostname'
22262 api_revision='$api_revision'
22263 api_subversion='$api_subversion'
22264 api_version='$api_version'
22265 api_versionstring='$api_versionstring'
22268 archlibexp='$archlibexp'
22269 archname64='$archname64'
22270 archname='$archname'
22271 archobjs='$archobjs'
22272 asctime_r_proto='$asctime_r_proto'
22281 byteorder='$byteorder'
22283 castflags='$castflags'
22286 cccdlflags='$cccdlflags'
22287 ccdlflags='$ccdlflags'
22289 ccflags_uselargefiles='$ccflags_uselargefiles'
22291 ccsymbols='$ccsymbols'
22292 ccversion='$ccversion'
22294 cf_email='$cf_email'
22296 charbits='$charbits'
22297 charsize='$charsize'
22301 clocktype='$clocktype'
22303 compress='$compress'
22304 contains='$contains'
22308 cpp_stuff='$cpp_stuff'
22309 cppccsymbols='$cppccsymbols'
22310 cppflags='$cppflags'
22312 cppminus='$cppminus'
22314 cppstdin='$cppstdin'
22315 cppsymbols='$cppsymbols'
22316 crypt_r_proto='$crypt_r_proto'
22317 cryptlib='$cryptlib'
22319 ctermid_r_proto='$ctermid_r_proto'
22320 ctime_r_proto='$ctime_r_proto'
22321 d_Gconvert='$d_Gconvert'
22322 d_PRIEUldbl='$d_PRIEUldbl'
22323 d_PRIFUldbl='$d_PRIFUldbl'
22324 d_PRIGUldbl='$d_PRIGUldbl'
22325 d_PRIXU64='$d_PRIXU64'
22326 d_PRId64='$d_PRId64'
22327 d_PRIeldbl='$d_PRIeldbl'
22328 d_PRIfldbl='$d_PRIfldbl'
22329 d_PRIgldbl='$d_PRIgldbl'
22330 d_PRIi64='$d_PRIi64'
22331 d_PRIo64='$d_PRIo64'
22332 d_PRIu64='$d_PRIu64'
22333 d_PRIx64='$d_PRIx64'
22334 d_SCNfldbl='$d_SCNfldbl'
22335 d__fwalk='$d__fwalk'
22336 d_access='$d_access'
22337 d_accessx='$d_accessx'
22340 d_archlib='$d_archlib'
22341 d_asctime64='$d_asctime64'
22342 d_asctime_r='$d_asctime_r'
22345 d_attribute_deprecated='$d_attribute_deprecated'
22346 d_attribute_format='$d_attribute_format'
22347 d_attribute_malloc='$d_attribute_malloc'
22348 d_attribute_nonnull='$d_attribute_nonnull'
22349 d_attribute_noreturn='$d_attribute_noreturn'
22350 d_attribute_pure='$d_attribute_pure'
22351 d_attribute_unused='$d_attribute_unused'
22352 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22356 d_bsdgetpgrp='$d_bsdgetpgrp'
22357 d_bsdsetpgrp='$d_bsdsetpgrp'
22358 d_builtin_choose_expr='$d_builtin_choose_expr'
22359 d_builtin_expect='$d_builtin_expect'
22361 d_c99_variadic_macros='$d_c99_variadic_macros'
22362 d_casti32='$d_casti32'
22363 d_castneg='$d_castneg'
22364 d_charvspr='$d_charvspr'
22366 d_chroot='$d_chroot'
22367 d_chsize='$d_chsize'
22369 d_clearenv='$d_clearenv'
22370 d_closedir='$d_closedir'
22371 d_cmsghdr_s='$d_cmsghdr_s'
22373 d_copysignl='$d_copysignl'
22374 d_cplusplus='$d_cplusplus'
22376 d_crypt_r='$d_crypt_r'
22378 d_ctermid='$d_ctermid'
22379 d_ctermid_r='$d_ctermid_r'
22380 d_ctime64='$d_ctime64'
22381 d_ctime_r='$d_ctime_r'
22382 d_cuserid='$d_cuserid'
22383 d_dbl_dig='$d_dbl_dig'
22384 d_dbminitproto='$d_dbminitproto'
22385 d_difftime64='$d_difftime64'
22386 d_difftime='$d_difftime'
22387 d_dir_dd_fd='$d_dir_dd_fd'
22389 d_dirnamlen='$d_dirnamlen'
22390 d_dlerror='$d_dlerror'
22391 d_dlopen='$d_dlopen'
22392 d_dlsymun='$d_dlsymun'
22393 d_dosuid='$d_dosuid'
22394 d_drand48_r='$d_drand48_r'
22395 d_drand48proto='$d_drand48proto'
22397 d_eaccess='$d_eaccess'
22398 d_endgrent='$d_endgrent'
22399 d_endgrent_r='$d_endgrent_r'
22400 d_endhent='$d_endhent'
22401 d_endhostent_r='$d_endhostent_r'
22402 d_endnent='$d_endnent'
22403 d_endnetent_r='$d_endnetent_r'
22404 d_endpent='$d_endpent'
22405 d_endprotoent_r='$d_endprotoent_r'
22406 d_endpwent='$d_endpwent'
22407 d_endpwent_r='$d_endpwent_r'
22408 d_endsent='$d_endsent'
22409 d_endservent_r='$d_endservent_r'
22410 d_eofnblk='$d_eofnblk'
22411 d_eunice='$d_eunice'
22412 d_faststdio='$d_faststdio'
22413 d_fchdir='$d_fchdir'
22414 d_fchmod='$d_fchmod'
22415 d_fchown='$d_fchown'
22417 d_fcntl_can_lock='$d_fcntl_can_lock'
22418 d_fd_macros='$d_fd_macros'
22419 d_fd_set='$d_fd_set'
22420 d_fds_bits='$d_fds_bits'
22421 d_fgetpos='$d_fgetpos'
22422 d_finite='$d_finite'
22423 d_finitel='$d_finitel'
22424 d_flexfnam='$d_flexfnam'
22426 d_flockproto='$d_flockproto'
22428 d_fp_class='$d_fp_class'
22429 d_fpathconf='$d_fpathconf'
22430 d_fpclass='$d_fpclass'
22431 d_fpclassify='$d_fpclassify'
22432 d_fpclassl='$d_fpclassl'
22433 d_fpos64_t='$d_fpos64_t'
22434 d_frexpl='$d_frexpl'
22435 d_fs_data_s='$d_fs_data_s'
22436 d_fseeko='$d_fseeko'
22437 d_fsetpos='$d_fsetpos'
22438 d_fstatfs='$d_fstatfs'
22439 d_fstatvfs='$d_fstatvfs'
22441 d_ftello='$d_ftello'
22443 d_futimes='$d_futimes'
22444 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
22445 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
22446 d_getaddrinfo='$d_getaddrinfo'
22447 d_getcwd='$d_getcwd'
22448 d_getespwnam='$d_getespwnam'
22449 d_getfsstat='$d_getfsstat'
22450 d_getgrent='$d_getgrent'
22451 d_getgrent_r='$d_getgrent_r'
22452 d_getgrgid_r='$d_getgrgid_r'
22453 d_getgrnam_r='$d_getgrnam_r'
22454 d_getgrps='$d_getgrps'
22455 d_gethbyaddr='$d_gethbyaddr'
22456 d_gethbyname='$d_gethbyname'
22457 d_gethent='$d_gethent'
22458 d_gethname='$d_gethname'
22459 d_gethostbyaddr_r='$d_gethostbyaddr_r'
22460 d_gethostbyname_r='$d_gethostbyname_r'
22461 d_gethostent_r='$d_gethostent_r'
22462 d_gethostprotos='$d_gethostprotos'
22463 d_getitimer='$d_getitimer'
22464 d_getlogin='$d_getlogin'
22465 d_getlogin_r='$d_getlogin_r'
22466 d_getmnt='$d_getmnt'
22467 d_getmntent='$d_getmntent'
22468 d_getnameinfo='$d_getnameinfo'
22469 d_getnbyaddr='$d_getnbyaddr'
22470 d_getnbyname='$d_getnbyname'
22471 d_getnent='$d_getnent'
22472 d_getnetbyaddr_r='$d_getnetbyaddr_r'
22473 d_getnetbyname_r='$d_getnetbyname_r'
22474 d_getnetent_r='$d_getnetent_r'
22475 d_getnetprotos='$d_getnetprotos'
22476 d_getpagsz='$d_getpagsz'
22477 d_getpbyname='$d_getpbyname'
22478 d_getpbynumber='$d_getpbynumber'
22479 d_getpent='$d_getpent'
22480 d_getpgid='$d_getpgid'
22481 d_getpgrp2='$d_getpgrp2'
22482 d_getpgrp='$d_getpgrp'
22483 d_getppid='$d_getppid'
22484 d_getprior='$d_getprior'
22485 d_getprotobyname_r='$d_getprotobyname_r'
22486 d_getprotobynumber_r='$d_getprotobynumber_r'
22487 d_getprotoent_r='$d_getprotoent_r'
22488 d_getprotoprotos='$d_getprotoprotos'
22489 d_getprpwnam='$d_getprpwnam'
22490 d_getpwent='$d_getpwent'
22491 d_getpwent_r='$d_getpwent_r'
22492 d_getpwnam_r='$d_getpwnam_r'
22493 d_getpwuid_r='$d_getpwuid_r'
22494 d_getsbyname='$d_getsbyname'
22495 d_getsbyport='$d_getsbyport'
22496 d_getsent='$d_getsent'
22497 d_getservbyname_r='$d_getservbyname_r'
22498 d_getservbyport_r='$d_getservbyport_r'
22499 d_getservent_r='$d_getservent_r'
22500 d_getservprotos='$d_getservprotos'
22501 d_getspnam='$d_getspnam'
22502 d_getspnam_r='$d_getspnam_r'
22503 d_gettimeod='$d_gettimeod'
22504 d_gmtime64='$d_gmtime64'
22505 d_gmtime_r='$d_gmtime_r'
22506 d_gnulibc='$d_gnulibc'
22507 d_grpasswd='$d_grpasswd'
22508 d_hasmntopt='$d_hasmntopt'
22510 d_ilogbl='$d_ilogbl'
22511 d_inc_version_list='$d_inc_version_list'
22513 d_inetaton='$d_inetaton'
22514 d_inetntop='$d_inetntop'
22515 d_inetpton='$d_inetpton'
22516 d_int64_t='$d_int64_t'
22517 d_isascii='$d_isascii'
22518 d_isfinite='$d_isfinite'
22521 d_isnanl='$d_isnanl'
22522 d_killpg='$d_killpg'
22523 d_lchown='$d_lchown'
22524 d_ldbl_dig='$d_ldbl_dig'
22525 d_libm_lib_version='$d_libm_lib_version'
22527 d_localtime64='$d_localtime64'
22528 d_localtime_r='$d_localtime_r'
22529 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
22530 d_locconv='$d_locconv'
22532 d_longdbl='$d_longdbl'
22533 d_longlong='$d_longlong'
22534 d_lseekproto='$d_lseekproto'
22536 d_madvise='$d_madvise'
22537 d_malloc_good_size='$d_malloc_good_size'
22538 d_malloc_size='$d_malloc_size'
22540 d_mbstowcs='$d_mbstowcs'
22541 d_mbtowc='$d_mbtowc'
22542 d_memchr='$d_memchr'
22543 d_memcmp='$d_memcmp'
22544 d_memcpy='$d_memcpy'
22545 d_memmove='$d_memmove'
22546 d_memset='$d_memset'
22548 d_mkdtemp='$d_mkdtemp'
22549 d_mkfifo='$d_mkfifo'
22550 d_mkstemp='$d_mkstemp'
22551 d_mkstemps='$d_mkstemps'
22552 d_mktime64='$d_mktime64'
22553 d_mktime='$d_mktime'
22556 d_modfl_pow32_bug='$d_modfl_pow32_bug'
22557 d_modflproto='$d_modflproto'
22558 d_mprotect='$d_mprotect'
22560 d_msg_ctrunc='$d_msg_ctrunc'
22561 d_msg_dontroute='$d_msg_dontroute'
22562 d_msg_oob='$d_msg_oob'
22563 d_msg_peek='$d_msg_peek'
22564 d_msg_proxy='$d_msg_proxy'
22565 d_msgctl='$d_msgctl'
22566 d_msgget='$d_msgget'
22567 d_msghdr_s='$d_msghdr_s'
22568 d_msgrcv='$d_msgrcv'
22569 d_msgsnd='$d_msgsnd'
22571 d_munmap='$d_munmap'
22572 d_mymalloc='$d_mymalloc'
22574 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
22576 d_nl_langinfo='$d_nl_langinfo'
22577 d_nv_preserves_uv='$d_nv_preserves_uv'
22578 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
22579 d_off64_t='$d_off64_t'
22580 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
22581 d_oldpthreads='$d_oldpthreads'
22582 d_oldsock='$d_oldsock'
22584 d_pathconf='$d_pathconf'
22586 d_perl_otherlibdirs='$d_perl_otherlibdirs'
22587 d_phostname='$d_phostname'
22590 d_portable='$d_portable'
22591 d_printf_format_null='$d_printf_format_null'
22592 d_procselfexe='$d_procselfexe'
22593 d_pseudofork='$d_pseudofork'
22594 d_pthread_atfork='$d_pthread_atfork'
22595 d_pthread_attr_setscope='$d_pthread_attr_setscope'
22596 d_pthread_yield='$d_pthread_yield'
22598 d_pwchange='$d_pwchange'
22599 d_pwclass='$d_pwclass'
22600 d_pwcomment='$d_pwcomment'
22601 d_pwexpire='$d_pwexpire'
22602 d_pwgecos='$d_pwgecos'
22603 d_pwpasswd='$d_pwpasswd'
22604 d_pwquota='$d_pwquota'
22607 d_random_r='$d_random_r'
22608 d_readdir64_r='$d_readdir64_r'
22609 d_readdir='$d_readdir'
22610 d_readdir_r='$d_readdir_r'
22611 d_readlink='$d_readlink'
22613 d_recvmsg='$d_recvmsg'
22614 d_rename='$d_rename'
22615 d_rewinddir='$d_rewinddir'
22617 d_safebcpy='$d_safebcpy'
22618 d_safemcpy='$d_safemcpy'
22619 d_sanemcmp='$d_sanemcmp'
22620 d_sbrkproto='$d_sbrkproto'
22621 d_scalbnl='$d_scalbnl'
22622 d_sched_yield='$d_sched_yield'
22623 d_scm_rights='$d_scm_rights'
22624 d_seekdir='$d_seekdir'
22625 d_select='$d_select'
22627 d_semctl='$d_semctl'
22628 d_semctl_semid_ds='$d_semctl_semid_ds'
22629 d_semctl_semun='$d_semctl_semun'
22630 d_semget='$d_semget'
22632 d_sendmsg='$d_sendmsg'
22633 d_setegid='$d_setegid'
22634 d_seteuid='$d_seteuid'
22635 d_setgrent='$d_setgrent'
22636 d_setgrent_r='$d_setgrent_r'
22637 d_setgrps='$d_setgrps'
22638 d_sethent='$d_sethent'
22639 d_sethostent_r='$d_sethostent_r'
22640 d_setitimer='$d_setitimer'
22641 d_setlinebuf='$d_setlinebuf'
22642 d_setlocale='$d_setlocale'
22643 d_setlocale_r='$d_setlocale_r'
22644 d_setnent='$d_setnent'
22645 d_setnetent_r='$d_setnetent_r'
22646 d_setpent='$d_setpent'
22647 d_setpgid='$d_setpgid'
22648 d_setpgrp2='$d_setpgrp2'
22649 d_setpgrp='$d_setpgrp'
22650 d_setprior='$d_setprior'
22651 d_setproctitle='$d_setproctitle'
22652 d_setprotoent_r='$d_setprotoent_r'
22653 d_setpwent='$d_setpwent'
22654 d_setpwent_r='$d_setpwent_r'
22655 d_setregid='$d_setregid'
22656 d_setresgid='$d_setresgid'
22657 d_setresuid='$d_setresuid'
22658 d_setreuid='$d_setreuid'
22659 d_setrgid='$d_setrgid'
22660 d_setruid='$d_setruid'
22661 d_setsent='$d_setsent'
22662 d_setservent_r='$d_setservent_r'
22663 d_setsid='$d_setsid'
22664 d_setvbuf='$d_setvbuf'
22668 d_shmatprototype='$d_shmatprototype'
22669 d_shmctl='$d_shmctl'
22671 d_shmget='$d_shmget'
22672 d_sigaction='$d_sigaction'
22673 d_signbit='$d_signbit'
22674 d_sigprocmask='$d_sigprocmask'
22675 d_sigsetjmp='$d_sigsetjmp'
22676 d_sitearch='$d_sitearch'
22677 d_snprintf='$d_snprintf'
22678 d_sockatmark='$d_sockatmark'
22679 d_sockatmarkproto='$d_sockatmarkproto'
22680 d_socket='$d_socket'
22681 d_socklen_t='$d_socklen_t'
22682 d_sockpair='$d_sockpair'
22683 d_socks5_init='$d_socks5_init'
22684 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
22686 d_srand48_r='$d_srand48_r'
22687 d_srandom_r='$d_srandom_r'
22688 d_sresgproto='$d_sresgproto'
22689 d_sresuproto='$d_sresuproto'
22690 d_statblks='$d_statblks'
22691 d_statfs_f_flags='$d_statfs_f_flags'
22692 d_statfs_s='$d_statfs_s'
22693 d_statvfs='$d_statvfs'
22694 d_stdio_cnt_lval='$d_stdio_cnt_lval'
22695 d_stdio_ptr_lval='$d_stdio_ptr_lval'
22696 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
22697 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
22698 d_stdio_stream_array='$d_stdio_stream_array'
22699 d_stdiobase='$d_stdiobase'
22700 d_stdstdio='$d_stdstdio'
22701 d_strchr='$d_strchr'
22702 d_strcoll='$d_strcoll'
22703 d_strctcpy='$d_strctcpy'
22704 d_strerrm='$d_strerrm'
22705 d_strerror='$d_strerror'
22706 d_strerror_r='$d_strerror_r'
22707 d_strftime='$d_strftime'
22708 d_strlcat='$d_strlcat'
22709 d_strlcpy='$d_strlcpy'
22710 d_strtod='$d_strtod'
22711 d_strtol='$d_strtol'
22712 d_strtold='$d_strtold'
22713 d_strtoll='$d_strtoll'
22714 d_strtoq='$d_strtoq'
22715 d_strtoul='$d_strtoul'
22716 d_strtoull='$d_strtoull'
22717 d_strtouq='$d_strtouq'
22718 d_strxfrm='$d_strxfrm'
22719 d_suidsafe='$d_suidsafe'
22720 d_symlink='$d_symlink'
22721 d_syscall='$d_syscall'
22722 d_syscallproto='$d_syscallproto'
22723 d_sysconf='$d_sysconf'
22724 d_sysernlst='$d_sysernlst'
22725 d_syserrlst='$d_syserrlst'
22726 d_system='$d_system'
22727 d_tcgetpgrp='$d_tcgetpgrp'
22728 d_tcsetpgrp='$d_tcsetpgrp'
22729 d_telldir='$d_telldir'
22730 d_telldirproto='$d_telldirproto'
22732 d_timegm='$d_timegm'
22734 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
22735 d_tm_tm_zone='$d_tm_tm_zone'
22736 d_tmpnam_r='$d_tmpnam_r'
22737 d_truncate='$d_truncate'
22738 d_ttyname_r='$d_ttyname_r'
22739 d_tzname='$d_tzname'
22740 d_u32align='$d_u32align'
22741 d_ualarm='$d_ualarm'
22744 d_union_semun='$d_union_semun'
22745 d_unordered='$d_unordered'
22746 d_unsetenv='$d_unsetenv'
22747 d_usleep='$d_usleep'
22748 d_usleepproto='$d_usleepproto'
22750 d_vendorarch='$d_vendorarch'
22751 d_vendorbin='$d_vendorbin'
22752 d_vendorlib='$d_vendorlib'
22753 d_vendorscript='$d_vendorscript'
22755 d_void_closedir='$d_void_closedir'
22756 d_voidsig='$d_voidsig'
22757 d_voidtty='$d_voidtty'
22758 d_volatile='$d_volatile'
22759 d_vprintf='$d_vprintf'
22760 d_vsnprintf='$d_vsnprintf'
22762 d_waitpid='$d_waitpid'
22763 d_wcstombs='$d_wcstombs'
22764 d_wctomb='$d_wctomb'
22765 d_writev='$d_writev'
22768 db_hashtype='$db_hashtype'
22769 db_prefixtype='$db_prefixtype'
22770 db_version_major='$db_version_major'
22771 db_version_minor='$db_version_minor'
22772 db_version_patch='$db_version_patch'
22773 defvoidused='$defvoidused'
22774 direntrytype='$direntrytype'
22777 doublesize='$doublesize'
22779 drand48_r_proto='$drand48_r_proto'
22781 dynamic_ext='$dynamic_ext'
22787 endgrent_r_proto='$endgrent_r_proto'
22788 endhostent_r_proto='$endhostent_r_proto'
22789 endnetent_r_proto='$endnetent_r_proto'
22790 endprotoent_r_proto='$endprotoent_r_proto'
22791 endpwent_r_proto='$endpwent_r_proto'
22792 endservent_r_proto='$endservent_r_proto'
22793 eunicefix='$eunicefix'
22796 extensions='$extensions'
22797 extern_C='$extern_C'
22799 fflushNULL='$fflushNULL'
22800 fflushall='$fflushall'
22802 firstmakefile='$firstmakefile'
22804 fpossize='$fpossize'
22805 fpostype='$fpostype'
22806 freetype='$freetype'
22809 full_csh='$full_csh'
22810 full_sed='$full_sed'
22811 gccansipedantic='$gccansipedantic'
22812 gccosandvers='$gccosandvers'
22813 gccversion='$gccversion'
22814 getgrent_r_proto='$getgrent_r_proto'
22815 getgrgid_r_proto='$getgrgid_r_proto'
22816 getgrnam_r_proto='$getgrnam_r_proto'
22817 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22818 gethostbyname_r_proto='$gethostbyname_r_proto'
22819 gethostent_r_proto='$gethostent_r_proto'
22820 getlogin_r_proto='$getlogin_r_proto'
22821 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22822 getnetbyname_r_proto='$getnetbyname_r_proto'
22823 getnetent_r_proto='$getnetent_r_proto'
22824 getprotobyname_r_proto='$getprotobyname_r_proto'
22825 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22826 getprotoent_r_proto='$getprotoent_r_proto'
22827 getpwent_r_proto='$getpwent_r_proto'
22828 getpwnam_r_proto='$getpwnam_r_proto'
22829 getpwuid_r_proto='$getpwuid_r_proto'
22830 getservbyname_r_proto='$getservbyname_r_proto'
22831 getservbyport_r_proto='$getservbyport_r_proto'
22832 getservent_r_proto='$getservent_r_proto'
22833 getspnam_r_proto='$getspnam_r_proto'
22834 gidformat='$gidformat'
22840 gmtime_r_proto='$gmtime_r_proto'
22841 gnulibc_version='$gnulibc_version'
22843 groupcat='$groupcat'
22844 groupstype='$groupstype'
22847 h_sysfile='$h_sysfile'
22850 html1dir='$html1dir'
22851 html1direxp='$html1direxp'
22852 html3dir='$html3dir'
22853 html3direxp='$html3direxp'
22862 i_arpainet='$i_arpainet'
22863 i_assert='$i_assert'
22864 i_bsdioctl='$i_bsdioctl'
22868 i_dirent='$i_dirent'
22874 i_fp_class='$i_fp_class'
22876 i_gdbm_ndbm='$i_gdbm_ndbm'
22877 i_gdbmndbm='$i_gdbmndbm'
22879 i_ieeefp='$i_ieeefp'
22880 i_inttypes='$i_inttypes'
22881 i_langinfo='$i_langinfo'
22882 i_libutil='$i_libutil'
22883 i_limits='$i_limits'
22884 i_locale='$i_locale'
22885 i_machcthr='$i_machcthr'
22886 i_malloc='$i_malloc'
22887 i_mallocmalloc='$i_mallocmalloc'
22889 i_memory='$i_memory'
22890 i_mntent='$i_mntent'
22893 i_neterrno='$i_neterrno'
22894 i_netinettcp='$i_netinettcp'
22898 i_pthread='$i_pthread'
22900 i_rpcsvcdbm='$i_rpcsvcdbm'
22903 i_shadow='$i_shadow'
22905 i_stdarg='$i_stdarg'
22906 i_stddef='$i_stddef'
22907 i_stdlib='$i_stdlib'
22908 i_string='$i_string'
22909 i_sunmath='$i_sunmath'
22910 i_sysaccess='$i_sysaccess'
22911 i_sysdir='$i_sysdir'
22912 i_sysfile='$i_sysfile'
22913 i_sysfilio='$i_sysfilio'
22915 i_sysioctl='$i_sysioctl'
22916 i_syslog='$i_syslog'
22917 i_sysmman='$i_sysmman'
22918 i_sysmode='$i_sysmode'
22919 i_sysmount='$i_sysmount'
22920 i_sysndir='$i_sysndir'
22921 i_sysparam='$i_sysparam'
22922 i_syspoll='$i_syspoll'
22923 i_sysresrc='$i_sysresrc'
22924 i_syssecrt='$i_syssecrt'
22925 i_sysselct='$i_sysselct'
22926 i_syssockio='$i_syssockio'
22927 i_sysstat='$i_sysstat'
22928 i_sysstatfs='$i_sysstatfs'
22929 i_sysstatvfs='$i_sysstatvfs'
22930 i_systime='$i_systime'
22931 i_systimek='$i_systimek'
22932 i_systimes='$i_systimes'
22933 i_systypes='$i_systypes'
22934 i_sysuio='$i_sysuio'
22936 i_sysutsname='$i_sysutsname'
22937 i_sysvfs='$i_sysvfs'
22938 i_syswait='$i_syswait'
22939 i_termio='$i_termio'
22940 i_termios='$i_termios'
22942 i_unistd='$i_unistd'
22945 i_values='$i_values'
22946 i_varargs='$i_varargs'
22947 i_varhdr='$i_varhdr'
22949 ignore_versioned_solibs='$ignore_versioned_solibs'
22950 inc_version_list='$inc_version_list'
22951 inc_version_list_init='$inc_version_list_init'
22954 initialinstalllocation='$initialinstalllocation'
22955 installarchlib='$installarchlib'
22956 installbin='$installbin'
22957 installhtml1dir='$installhtml1dir'
22958 installhtml3dir='$installhtml3dir'
22959 installman1dir='$installman1dir'
22960 installman3dir='$installman3dir'
22961 installprefix='$installprefix'
22962 installprefixexp='$installprefixexp'
22963 installprivlib='$installprivlib'
22964 installscript='$installscript'
22965 installsitearch='$installsitearch'
22966 installsitebin='$installsitebin'
22967 installsitehtml1dir='$installsitehtml1dir'
22968 installsitehtml3dir='$installsitehtml3dir'
22969 installsitelib='$installsitelib'
22970 installsiteman1dir='$installsiteman1dir'
22971 installsiteman3dir='$installsiteman3dir'
22972 installsitescript='$installsitescript'
22973 installstyle='$installstyle'
22974 installusrbinperl='$installusrbinperl'
22975 installvendorarch='$installvendorarch'
22976 installvendorbin='$installvendorbin'
22977 installvendorhtml1dir='$installvendorhtml1dir'
22978 installvendorhtml3dir='$installvendorhtml3dir'
22979 installvendorlib='$installvendorlib'
22980 installvendorman1dir='$installvendorman1dir'
22981 installvendorman3dir='$installvendorman3dir'
22982 installvendorscript='$installvendorscript'
22984 issymlink='$issymlink'
22985 ivdformat='$ivdformat'
22988 known_extensions='$known_extensions'
22991 lddlflags='$lddlflags'
22993 ldflags_uselargefiles='$ldflags_uselargefiles'
22994 ldlibpthname='$ldlibpthname'
23001 libsdirs='$libsdirs'
23002 libsfiles='$libsfiles'
23003 libsfound='$libsfound'
23004 libspath='$libspath'
23005 libswanted='$libswanted'
23006 libswanted_uselargefiles='$libswanted_uselargefiles'
23012 localtime_r_proto='$localtime_r_proto'
23013 locincpth='$locincpth'
23014 loclibpth='$loclibpth'
23015 longdblsize='$longdblsize'
23016 longlongsize='$longlongsize'
23017 longsize='$longsize'
23021 lseeksize='$lseeksize'
23022 lseektype='$lseektype'
23025 madlyobj='$madlyobj'
23026 madlysrc='$madlysrc'
23030 make_set_make='$make_set_make'
23031 mallocobj='$mallocobj'
23032 mallocsrc='$mallocsrc'
23033 malloctype='$malloctype'
23035 man1direxp='$man1direxp'
23038 man3direxp='$man3direxp'
23040 mips_type='$mips_type'
23041 mistrustnm='$mistrustnm'
23043 mmaptype='$mmaptype'
23044 modetype='$modetype'
23046 multiarch='$multiarch'
23048 myarchname='$myarchname'
23049 mydomain='$mydomain'
23050 myhostname='$myhostname'
23053 need_va_copy='$need_va_copy'
23054 netdb_hlen_type='$netdb_hlen_type'
23055 netdb_host_type='$netdb_host_type'
23056 netdb_name_type='$netdb_name_type'
23057 netdb_net_type='$netdb_net_type'
23060 nm_so_opt='$nm_so_opt'
23061 nonxs_ext='$nonxs_ext'
23063 nvEUformat='$nvEUformat'
23064 nvFUformat='$nvFUformat'
23065 nvGUformat='$nvGUformat'
23066 nv_overflows_integers_at='$nv_overflows_integers_at'
23067 nv_preserves_uv_bits='$nv_preserves_uv_bits'
23068 nveformat='$nveformat'
23069 nvfformat='$nvfformat'
23070 nvgformat='$nvgformat'
23073 o_nonblock='$o_nonblock'
23075 old_pthread_create_joinable='$old_pthread_create_joinable'
23076 optimize='$optimize'
23077 orderlib='$orderlib'
23080 otherlibdirs='$otherlibdirs'
23084 patchlevel='$patchlevel'
23085 path_sep='$path_sep'
23088 perl_patchlevel='$perl_patchlevel'
23089 perladmin='$perladmin'
23090 perllibs='$perllibs'
23091 perlpath='$perlpath'
23093 phostname='$phostname'
23099 prefixexp='$prefixexp'
23101 privlibexp='$privlibexp'
23102 procselfexe='$procselfexe'
23103 prototype='$prototype'
23105 quadkind='$quadkind'
23106 quadtype='$quadtype'
23107 randbits='$randbits'
23108 randfunc='$randfunc'
23109 random_r_proto='$random_r_proto'
23110 randseedtype='$randseedtype'
23112 rd_nodata='$rd_nodata'
23113 readdir64_r_proto='$readdir64_r_proto'
23114 readdir_r_proto='$readdir_r_proto'
23115 revision='$revision'
23121 sGMTIME_max='$sGMTIME_max'
23122 sGMTIME_min='$sGMTIME_min'
23123 sLOCALTIME_max='$sLOCALTIME_max'
23124 sLOCALTIME_min='$sLOCALTIME_min'
23125 sPRIEUldbl='$sPRIEUldbl'
23126 sPRIFUldbl='$sPRIFUldbl'
23127 sPRIGUldbl='$sPRIGUldbl'
23128 sPRIXU64='$sPRIXU64'
23130 sPRIeldbl='$sPRIeldbl'
23131 sPRIfldbl='$sPRIfldbl'
23132 sPRIgldbl='$sPRIgldbl'
23137 sSCNfldbl='$sSCNfldbl'
23138 sched_yield='$sched_yield'
23139 scriptdir='$scriptdir'
23140 scriptdirexp='$scriptdirexp'
23142 seedfunc='$seedfunc'
23143 selectminbits='$selectminbits'
23144 selecttype='$selecttype'
23145 sendmail='$sendmail'
23146 setgrent_r_proto='$setgrent_r_proto'
23147 sethostent_r_proto='$sethostent_r_proto'
23148 setlocale_r_proto='$setlocale_r_proto'
23149 setnetent_r_proto='$setnetent_r_proto'
23150 setprotoent_r_proto='$setprotoent_r_proto'
23151 setpwent_r_proto='$setpwent_r_proto'
23152 setservent_r_proto='$setservent_r_proto'
23155 sharpbang='$sharpbang'
23156 shmattype='$shmattype'
23157 shortsize='$shortsize'
23160 sig_count='$sig_count'
23161 sig_name='$sig_name'
23162 sig_name_init='$sig_name_init'
23164 sig_num_init='$sig_num_init'
23165 sig_size='$sig_size'
23166 signal_t='$signal_t'
23167 sitearch='$sitearch'
23168 sitearchexp='$sitearchexp'
23170 sitebinexp='$sitebinexp'
23171 sitehtml1dir='$sitehtml1dir'
23172 sitehtml1direxp='$sitehtml1direxp'
23173 sitehtml3dir='$sitehtml3dir'
23174 sitehtml3direxp='$sitehtml3direxp'
23176 sitelib_stem='$sitelib_stem'
23177 sitelibexp='$sitelibexp'
23178 siteman1dir='$siteman1dir'
23179 siteman1direxp='$siteman1direxp'
23180 siteman3dir='$siteman3dir'
23181 siteman3direxp='$siteman3direxp'
23182 siteprefix='$siteprefix'
23183 siteprefixexp='$siteprefixexp'
23184 sitescript='$sitescript'
23185 sitescriptexp='$sitescriptexp'
23186 sizesize='$sizesize'
23187 sizetype='$sizetype'
23191 sockethdr='$sockethdr'
23192 socketlib='$socketlib'
23193 socksizetype='$socksizetype'
23195 spackage='$spackage'
23196 spitshell='$spitshell'
23197 srand48_r_proto='$srand48_r_proto'
23198 srandom_r_proto='$srandom_r_proto'
23200 ssizetype='$ssizetype'
23201 startperl='$startperl'
23203 static_ext='$static_ext'
23205 stdio_base='$stdio_base'
23206 stdio_bufsiz='$stdio_bufsiz'
23207 stdio_cnt='$stdio_cnt'
23208 stdio_filbuf='$stdio_filbuf'
23209 stdio_ptr='$stdio_ptr'
23210 stdio_stream_array='$stdio_stream_array'
23211 strerror_r_proto='$strerror_r_proto'
23214 subversion='$subversion'
23218 targetarch='$targetarch'
23222 timeincl='$timeincl'
23223 timetype='$timetype'
23224 tmpnam_r_proto='$tmpnam_r_proto'
23230 ttyname_r_proto='$ttyname_r_proto'
23239 uidformat='$uidformat'
23245 uquadtype='$uquadtype'
23246 use5005threads='$use5005threads'
23247 use64bitall='$use64bitall'
23248 use64bitint='$use64bitint'
23249 usecrosscompile='$usecrosscompile'
23250 usedevel='$usedevel'
23252 usedtrace='$usedtrace'
23253 usefaststdio='$usefaststdio'
23254 useithreads='$useithreads'
23255 uselargefiles='$uselargefiles'
23256 uselongdouble='$uselongdouble'
23257 usemallocwrap='$usemallocwrap'
23258 usemorebits='$usemorebits'
23259 usemultiplicity='$usemultiplicity'
23260 usemymalloc='$usemymalloc'
23262 useopcode='$useopcode'
23263 useperlio='$useperlio'
23264 useposix='$useposix'
23265 usereentrant='$usereentrant'
23266 userelocatableinc='$userelocatableinc'
23268 useshrplib='$useshrplib'
23269 usesitecustomize='$usesitecustomize'
23270 usesocks='$usesocks'
23271 usethreads='$usethreads'
23272 usevendorprefix='$usevendorprefix'
23273 usevfork='$usevfork'
23276 uvXUformat='$uvXUformat'
23277 uvoformat='$uvoformat'
23280 uvuformat='$uvuformat'
23281 uvxformat='$uvxformat'
23282 vendorarch='$vendorarch'
23283 vendorarchexp='$vendorarchexp'
23284 vendorbin='$vendorbin'
23285 vendorbinexp='$vendorbinexp'
23286 vendorhtml1dir='$vendorhtml1dir'
23287 vendorhtml1direxp='$vendorhtml1direxp'
23288 vendorhtml3dir='$vendorhtml3dir'
23289 vendorhtml3direxp='$vendorhtml3direxp'
23290 vendorlib='$vendorlib'
23291 vendorlib_stem='$vendorlib_stem'
23292 vendorlibexp='$vendorlibexp'
23293 vendorman1dir='$vendorman1dir'
23294 vendorman1direxp='$vendorman1direxp'
23295 vendorman3dir='$vendorman3dir'
23296 vendorman3direxp='$vendorman3direxp'
23297 vendorprefix='$vendorprefix'
23298 vendorprefixexp='$vendorprefixexp'
23299 vendorscript='$vendorscript'
23300 vendorscriptexp='$vendorscriptexp'
23302 version_patchlevel_string='$version_patchlevel_string'
23303 versiononly='$versiononly'
23305 voidflags='$voidflags'
23308 yaccflags='$yaccflags'
23313 : add special variables
23314 $test -f $src/patchlevel.h && \
23315 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23316 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
23317 echo "PERL_CONFIG_SH=true" >>config.sh
23319 : propagate old symbols
23320 if $test -f UU/config.sh; then
23321 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23322 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23323 config.sh config.sh UU/oldconfig.sh |\
23324 $sort | $uniq -u >UU/oldsyms
23325 set X `cat UU/oldsyms`
23331 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23333 echo ": Variables propagated from previous config.sh file." >>config.sh
23334 for sym in `cat UU/oldsyms`; do
23335 echo " Propagating $hint variable "'$'"$sym..."
23336 eval 'tmp="$'"${sym}"'"'
23338 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23344 : Finish up by extracting the .SH files
23348 echo "Extraction done."
23358 If you'd like to make any changes to the config.sh file before I begin
23359 to configure things, do it as a shell escape now (e.g. !vi config.sh).
23362 rp="Press return or use a shell escape to edit config.sh:"
23367 *) : in case they cannot read
23368 sh 1>&4 -c "$ans";;
23373 : if this fails, just run all the .SH files by hand
23382 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
23389 Now you need to generate make dependencies by running "$make depend".
23390 You might prefer to run it in background: "$make depend > makedepend.out &"
23391 It can take a while, so you might not want to run it right now.
23396 rp="Run $make depend now?"
23400 $make depend && echo "Now you must run '$make'."
23403 echo "You must run '$make depend' then '$make'."
23406 elif test -f [Mm]akefile; then
23408 echo "Now you must run a $make."
23410 echo "Configure done."
23413 if $test -f Policy.sh; then
23416 If you compile $package on a different machine or from a different object
23417 directory, copy the Policy.sh file from this object directory to the
23418 new one before you run Configure -- this will help you with most of
23419 the policy defaults.
23423 if $test -f config.msg; then
23424 echo "Hmm. I also noted the following information while running:"
23426 $cat config.msg >&4
23429 $rm -f kit*isdone ark*isdone