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
20 # Though this script was generated by metaconfig, it is OK to send
21 # patches against it. It's up to the Configure pumpkin to backport
22 # the patch to the metaunits if it is accepted.
23 # See Porting/pumpkin.pod for more information on metaconfig.
26 # $Id: Head.U 6 2006-08-25 22:21:46Z rmanfredi $
28 # Generated on Thu Dec 25 12:54:36 CET 2008 [metaconfig 3.5 PL0]
29 # (with additional metaconfig patches by perlbug@perl.org)
34 SCO csh still thinks true is false. Write to SCO today and tell them that next
35 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
37 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
38 we'd have to do is go in and swap the && and || tokens, wherever they are.)
40 [End of diatribe. We now return you to your regularly scheduled programming...]
44 OOPS! You naughty creature! You didn't run Configure with sh!
45 I will attempt to remedy the situation by running sh for you...
49 true || exec sh $0 $argv:q
51 (exit $?0) || cat c2$$
52 (exit $?0) || exec sh $0 $argv:q
55 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
58 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
59 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
60 *** Please read the README.plan9 for further instructions.
61 *** Cannot continue, aborting.
67 if test ! -c /dev/null ; then
70 *** I'm sorry, but /dev/null appears to be a file rather than a device.
71 *** Please consult your operating sytem's notes for making a device
73 *** Cannot continue, aborting.
79 : compute my invocation name
83 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
88 : Proper separator for the PATH environment variable
90 : On OS/2 this directory should exist if this is not floppy only system ":-]"
91 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
92 if test -n "$OS2_SHELL"; then
94 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
95 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
97 elif test -n "$DJGPP"; then
98 case "X${MACHTYPE:-nonesuchmach}" in
105 : Proper PATH setting
106 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
107 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
108 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
109 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
110 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
111 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
112 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
113 paths="$paths /sbin /usr/sbin /usr/libexec"
114 paths="$paths /system/gnu_library/bin"
118 case "$p_$PATH$p_" in
120 *) test -d $p && PATH=$PATH$p_$p ;;
127 : shall we be using ksh?
133 if (PATH=.; alias -x) >/dev/null 2>&1; then
136 if test -f /hp-ux -a -f /bin/ksh; then
137 needksh='to avoid sh bug in "here document" expansion'
139 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
140 if test X`/usr/bin/uname -v` = X4; then
141 avoidksh="to avoid AIX 4's /bin/sh"
145 if test -f /osf_boot -a -f /usr/sbin/setld; then
146 if test X`/usr/bin/uname -s` = XOSF1; then
147 avoidksh="to avoid Digital UNIX' ksh"
152 case "$inksh/$needksh" in
159 case "$inksh/$avoidksh" in
165 case "$inksh/$needksh-$avoidksh-" in
168 (I see you are using the Korn shell. Some ksh's blow up on $me,
169 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
176 echo "(Feeding myself to $newsh $reason.)"
178 Configure|*/Configure) exec $newsh $0 "$@";;
179 *) exec $newsh Configure "$@";;
183 test -x "${newsh}" || unset newsh
185 : if needed, set CDPATH to a harmless value that is not chatty
186 : avoid bash 2.02 problems with empty CDPATH.
190 *bash*) CDPATH='.' ;;
196 : Configure runs within the UU subdirectory
197 test -d UU || mkdir UU
337 initialinstalllocation=''
364 d_attribute_deprecated=''
365 d_attribute_format=''
366 d_attribute_malloc=''
367 d_attribute_nonnull=''
368 d_attribute_noreturn=''
370 d_attribute_unused=''
371 d_attribute_warn_unused_result=''
372 d_printf_format_null=''
375 d_builtin_choose_expr=''
378 d_c99_variadic_macros=''
425 endhostent_r_proto=''
431 endprotoent_r_proto=''
437 endservent_r_proto=''
489 gethostbyaddr_r_proto=''
491 gethostbyname_r_proto=''
493 gethostent_r_proto=''
505 getnetbyaddr_r_proto=''
507 getnetbyname_r_proto=''
521 d_getprotobyname_r=''
522 getprotobyname_r_proto=''
523 d_getprotobynumber_r=''
524 getprotobynumber_r_proto=''
526 getprotoent_r_proto=''
538 getservbyname_r_proto=''
540 getservbyport_r_proto=''
542 getservent_r_proto=''
566 d_libm_lib_version=''
569 d_localtime_r_needs_tzset=''
580 d_malloc_good_size=''
622 d_old_pthread_create_joinable=''
623 old_pthread_create_joinable=''
625 d_pthread_attr_setscope=''
664 sethostent_r_proto=''
681 setprotoent_r_proto=''
693 setservent_r_proto=''
727 d_sprintf_returns_strlen=''
742 d_stdio_ptr_lval_nochange_cnt=''
743 d_stdio_ptr_lval_sets_cnt=''
886 d_gdbm_ndbm_h_uses_prototypes=''
887 d_gdbmndbm_h_uses_prototypes=''
889 d_ndbm_h_uses_prototypes=''
963 d_inc_version_list=''
965 inc_version_list_init=''
984 ignore_versioned_solibs=''
1048 d_perl_otherlibdirs=''
1056 api_versionstring=''
1062 version_patchlevel_string=''
1066 d_nv_preserves_uv=''
1067 d_nv_zero_is_allbits_zero=''
1078 nv_overflows_integers_at=''
1079 nv_preserves_uv_bits=''
1151 installsitehtml1dir=''
1154 installsitehtml3dir=''
1161 installsiteman1dir=''
1164 installsiteman3dir=''
1169 installsitescript=''
1184 d_stdio_stream_array=''
1185 stdio_stream_array=''
1202 ccflags_uselargefiles=''
1203 ldflags_uselargefiles=''
1204 libswanted_uselargefiles=''
1224 installvendorarch=''
1231 installvendorhtml1dir=''
1233 vendorhtml1direxp=''
1234 installvendorhtml3dir=''
1236 vendorhtml3direxp=''
1242 installvendorman1dir=''
1245 installvendorman3dir=''
1252 installvendorscript=''
1265 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1268 : We must find out about Eunice early
1270 if test -f /etc/unixtovms; then
1271 eunicefix=/etc/unixtovms
1273 if test -f /etc/unixtovms.exe; then
1274 eunicefix=/etc/unixtovms.exe
1277 : Set executable suffix now -- needed before hints available
1278 if test -f "/libs/version.library"; then
1281 elif test -f "/system/gnu_library/bin/ar.pm"; then
1284 elif test -n "$DJGPP"; then
1287 elif test -d c:/. -o -n "$is_os2" ; then
1294 : Trailing extension. Override this in a hint file, if needed.
1295 : Extra object files, if any, needed on this platform.
1299 : change the next line if compiling for Xenix/286 on Xenix/386
1300 xlibpth='/usr/lib/386 /lib/386'
1301 : Possible local library directories to search.
1302 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1303 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1305 : general looking path for locating libraries
1306 glibpth="/lib /usr/lib $xlibpth"
1307 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1308 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1309 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1310 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1312 : Private path used by Configure to find libraries. Its value
1313 : is prepended to libpth. This variable takes care of special
1314 : machines, like the mips. Usually, it should be empty.
1317 : default library list
1319 : some systems want to use only the non-versioned libso:s
1320 ignore_versioned_solibs=''
1321 : set usethreads on the Configure command line to enable threads.
1322 usereentrant='undef'
1323 : full support for void wanted by default
1326 : Possible local include directories to search.
1327 : Set locincpth to "" in a hint file to defeat local include searches.
1328 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1329 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1331 : no include file wanted by default
1334 : Enable -DEBUGGING and -DDEBUGGING from the command line
1341 : set useposix=false in your hint file to disable the POSIX extension.
1343 : set useopcode=false in your hint file to disable the Opcode extension.
1346 ccflags_uselargefiles=''
1347 ldflags_uselargefiles=''
1348 libswanted_uselargefiles=''
1349 : set usemultiplicity on the Configure command line to enable multiplicity.
1350 : set usesocks on the Configure command line to enable socks.
1351 : List of libraries we want.
1352 : If anyone needs extra -lxxx, put those in a hint file.
1353 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1354 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1355 : We probably want to search /usr/shlib before most other libraries.
1356 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1357 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1358 glibpth="/usr/shlib $glibpth"
1359 : Do not use vfork unless overridden by a hint file.
1362 : Find the basic shell for Bourne shell scripts
1366 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1369 if test -f "$xxx"; then
1372 : Build up a list and do a single loop so we can 'break' out.
1373 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1374 for xxx in sh bash ksh pdksh ash; do
1376 try="$try ${p}/${xxx}"
1380 if test -f "$xxx"; then
1383 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1386 elif test -f "$xxx.exe"; then
1397 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1399 Usually it's in /bin/sh. How did you even get this far?
1400 Please contact me (Perl Maintainers) at perlbug@perl.org and
1401 we'll try to straighten this all out.
1407 : see if sh knows # comments
1408 if `$sh -c '#' >/dev/null 2>&1`; then
1412 test -f $xcat$_exe || xcat=/usr/bin/cat
1413 if test ! -f $xcat$_exe; then
1414 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1415 if test -f $p/cat$_exe; then
1420 if test ! -f $xcat$_exe; then
1421 echo "Can't find cat anywhere!"
1425 echo "#!$xcat" >sharp
1428 ./sharp > today 2>/dev/null
1429 if test -s today; then
1432 echo "#! $xcat" > sharp
1435 ./sharp > today 2>/dev/null
1436 if test -s today; then
1444 echo "Your $sh doesn't grok # comments--I will strip them later on."
1447 echo "exec grep -v '^[ ]*#'" >spitshell
1449 $eunicefix spitshell
1450 spitshell=`pwd`/spitshell
1452 echo "I presume that if # doesn't work, #! won't work either!"
1457 : figure out how to guarantee sh startup
1459 '') startsh=${sharpbang}${sh} ;;
1471 : echo "Yup, it does."
1473 echo "Hmm... '$startsh' does not guarantee sh startup..."
1474 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1478 : Save command line options in file UU/cmdline.opt for later use in
1479 : generating config.sh.
1480 cat > cmdline.opt <<EOSH
1481 : Configure command line arguments.
1490 cat >>cmdline.opt <<EOSH
1491 config_arg$argn='$arg'
1493 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1496 arg_exp=`cat cmdl.opt`
1497 args_exp="$args_exp$args_sep'$arg_exp'"
1498 argn=`expr $argn + 1`
1503 : produce awk script to parse command line options
1504 cat >options.awk <<'EOF'
1506 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1508 len = length(optstr);
1509 for (i = 1; i <= len; i++) {
1510 c = substr(optstr, i, 1);
1511 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1522 if (substr(str, 1, 1) != "-") {
1523 printf("'%s'\n", str);
1527 for (i = 2; i <= len; i++) {
1528 c = substr(str, i, 1);
1530 printf("-%s\n", substr(str, i));
1536 printf("'%s'\n", substr(str, i + 1));
1549 : process the command line options
1550 set X `for arg in "$@"; do echo "X$arg"; done |
1551 sed -e s/X// | awk -f options.awk`
1556 : set up default values
1566 rm -f optdef.sh posthint.sh
1567 cat >optdef.sh <<EOS
1573 while test $# -gt 0; do
1575 -d) shift; fastread=yes;;
1576 -e) shift; alldone=cont;;
1580 if test -r "$1"; then
1583 echo "$me: cannot read config file $1." >&2
1589 -h) shift; error=true;;
1590 -r) shift; reuseval=true;;
1591 -s) shift; silent=true; realsilent=true;;
1592 -E) shift; alldone=exit;;
1593 -K) shift; knowitall=true;;
1594 -O) shift; override=true;;
1595 -S) shift; silent=true; extractsh=true;;
1600 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1601 echo "$me: ignoring -D $1" >&2
1604 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1605 *) echo "$1='define'" >> optdef.sh;;
1612 *=) echo "$1" >> optdef.sh;;
1614 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1615 echo "$me: ignoring -U $1" >&2
1617 *) echo "$1='undef'" >> optdef.sh;;
1628 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1632 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1633 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1639 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1640 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1641 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1642 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1643 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1644 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1650 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1652 echo "$yyy=''" >> posthint.sh ;;
1657 echo "$yyy='$zzz'" >> posthint.sh ;;
1659 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1661 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1666 echo "$yyy=$zzz" >> posthint.sh ;;
1667 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1671 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1674 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1682 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1683 [-U symbol] [-U symbol=] [-A command:symbol...]
1684 -d : use defaults for all answers.
1685 -e : go on without questioning past the production of config.sh.
1686 -f : specify an alternate default configuration file.
1687 -h : print this help message and exit (with an error status).
1688 -r : reuse C symbols value if possible (skips costly nm extraction).
1689 -s : silent mode, only echoes questions and essential information.
1690 -D : define symbol to have some value:
1691 -D symbol symbol gets the value 'define'
1692 -D symbol=value symbol gets the value 'value'
1693 common used examples (see INSTALL for more info):
1694 -Duse64bitint use 64bit integers
1695 -Duse64bitall use 64bit integers and pointers
1696 -Dusethreads use thread support
1697 -Dinc_version_list=none do not include older perl trees in @INC
1698 -DEBUGGING=none DEBUGGING options
1699 -Dcc=gcc choose your compiler
1700 -Dprefix=/opt/perl5 choose your destination
1701 -E : stop at the end of questions, after having produced config.sh.
1702 -K : do not use unless you know what you are doing.
1703 -O : let -D and -U override definitions from loaded configuration file.
1704 -S : perform variable substitutions on all .SH files (can mix with -f)
1705 -U : undefine symbol:
1706 -U symbol symbol gets the value 'undef'
1707 -U symbol= symbol gets completely empty
1709 -A : manipulate symbol after the platform specific hints have been applied:
1710 -A append:symbol=value append value to symbol
1711 -A symbol=value like append:, but with a separating space
1712 -A define:symbol=value define symbol to have value
1713 -A clear:symbol define symbol to be ''
1714 -A define:symbol define symbol to be 'define'
1715 -A eval:symbol=value define symbol to be eval of value
1716 -A prepend:symbol=value prepend value to symbol
1717 -A undef:symbol define symbol to be 'undef'
1718 -A undef:symbol= define symbol to be ''
1719 e.g.: -A prepend:libswanted='cl pthread '
1720 -A ccflags=-DSOME_MACRO
1721 -V : print version number and exit (with a zero status).
1728 case "$fastread$alldone" in
1731 case "$extractsh" in
1734 if test ! -t 0; then
1735 echo "Say 'sh Configure', not 'sh <Configure'"
1745 true) exec 1>/dev/null;;
1748 : run the defines and the undefines, if any, but leave the file out there...
1751 : create the posthint manipulation script and leave the file out there...
1756 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1757 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1758 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1759 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1760 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1763 : Some greps do not return status, grrr.
1764 echo "grimblepritz" >grimble
1765 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1767 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1773 : the following should work in any shell
1777 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1778 cat >contains <<'EOSS'
1779 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1784 : Find the path to the source tree
1787 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1791 *) src=`cd ../$src && pwd` ;;
1804 if test -f $rsrc/Configure && \
1805 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1807 : found it, so we are ok.
1810 for src in . .. ../.. ../../.. ../../../..; do
1811 if test -f ../$src/Configure && \
1812 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1823 Sorry, I can't seem to locate the source dir for $package. Please start
1824 Configure with an explicit path -- i.e. /some/path/Configure.
1832 echo "Sources for $package found in \"$src\"." >&4
1836 : script used to extract .SH files with variable substitutions
1837 cat >extract <<'EOS'
1839 echo "Doing variable substitutions on .SH files..."
1840 if test -f MANIFEST; then
1841 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1843 echo "(Looking for .SH files under the source directory.)"
1844 set x `(cd "$src"; find . -name "*.SH" -print)`
1848 0) set x `(cd "$src"; echo *.SH)`; shift;;
1850 if test ! -f "$src/$1"; then
1856 while test $name; do
1857 if test ! -d "$name"; then
1858 create="$name $create";
1859 name=`echo $name | sed -e "s|^[^/]*$||"`;
1860 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1865 for file in $create; do
1874 dir=`expr X$file : 'X\(.*\)/'`
1875 file=`expr X$file : 'X.*/\(.*\)'`
1876 (cd "$dir" && . ./$file)
1886 dir=`expr X$file : 'X\(.*\)/'`
1887 file=`expr X$file : 'X.*/\(.*\)'`
1888 (set x $dir; shift; eval $mkdir_p)
1889 sh <"$src/$dir/$file"
1898 if test -f "$src/config_h.SH"; then
1899 if test ! -f config.h; then
1900 : oops, they left it out of MANIFEST, probably, so do it anyway.
1901 . "$src/config_h.SH"
1906 : extract files and exit if asked to do so
1907 case "$extractsh" in
1909 case "$realsilent" in
1913 case "$config_sh" in
1914 '') config_sh='config.sh';;
1917 echo "Fetching answers from $config_sh..."
1920 test "$override" && . ./optdef.sh
1924 echo "Extraction done."
1929 : Eunice requires " " instead of "", can you believe it
1932 echo "Beginning of configuration questions for $package."
1934 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1936 : first determine how to suppress newline on echo command
1938 echo "Checking echo to see how to suppress newlines..."
1939 (echo "hi there\c" ; echo " ") >.echotmp
1940 if $contains c .echotmp >/dev/null 2>&1 ; then
1951 echo $n "The star should be here-->$c"
1955 : Now test for existence of everything in MANIFEST
1957 if test -f "$rsrc/MANIFEST"; then
1958 echo "First let's make sure your kit is complete. Checking..." >&4
1959 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1960 (split -l 50 2>/dev/null || split -50)
1963 for filelist in x??; do
1964 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1965 >/dev/null 2>>"$tmppwd/missing")
1967 if test -s missing; then
1971 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1973 You have the option of continuing the configuration process, despite the
1974 distinct possibility that your kit is damaged, by typing 'y'es. If you
1975 do, don't blame me if something goes wrong. I advise you to type 'n'o
1976 and contact the author (perlbug@perl.org).
1979 echo $n "Continue? [n] $c" >&4
1983 echo "Continuing..." >&4
1987 echo "ABORTING..." >&4
1992 echo "Looks good..."
1995 echo "There is no MANIFEST file. I hope your kit is complete !"
1999 : Find the appropriate value for a newline for tr
2001 if test -n "$DJGPP"; then
2004 if test X"$trnl" = X; then
2005 case "`echo foo|tr '\n' x 2>/dev/null`" in
2009 if test X"$trnl" = X; then
2010 case "`echo foo|tr '\012' x 2>/dev/null`" in
2011 foox) trnl='\012' ;;
2014 if test X"$trnl" = X; then
2015 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2016 fooxy) trnl='\n\r' ;;
2019 if test X"$trnl" = X; then
2022 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2028 : compute the number of columns on the terminal for proper question formatting
2033 : set up the echo used in my read
2034 myecho="case \"\$xxxm\" in
2035 '') echo $n \"\$rp $c\" >&4;;
2037 '') echo $n \"[\$xxxm] $c\";;
2039 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2041 echo $n \"[\$xxxm] $c\" >&4
2043 echo $n \"\$rp [\$xxxm] $c\" >&4
2049 : now set up to do reads with possible shell escape and default assignment
2055 case "\$fastread" in
2056 yes) case "\$dflt" in
2059 case "\$silent-\$rp" in
2064 *) case "\$silent" in
2065 true) case "\$rp" in
2070 while expr "X\$ans" : "X!" >/dev/null; do
2074 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2082 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2091 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2096 echo "(OK, I'll run with -d after this question.)" >&4
2099 echo "*** Sorry, \$1 not supported yet." >&4
2109 echo "*** Substitution done -- please confirm."
2111 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2116 echo "*** Error -- try again."
2123 case "\$ans\$xxxm\$nostick" in
2135 : create .config dir to save info across Configure sessions
2136 test -d ../.config || mkdir ../.config
2137 cat >../.config/README <<EOF
2138 This directory created by Configure to save information that should
2139 persist across sessions for $package.
2141 You may safely delete it if you wish.
2144 : See if we are using a devel version and want that
2145 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2148 usedevel="$define" ;;
2149 *) case "$xversion" in
2152 *** WHOA THERE!!! ***
2154 This is an UNSTABLE DEVELOPMENT release.
2155 The version of this $package distribution is $xversion, that is, odd,
2156 (as opposed to even) and that signifies a development release.
2157 If you want a maintenance release, you want an even-numbered version.
2159 Do ***NOT*** install this into production use.
2160 Data corruption and crashes are possible.
2162 It is most seriously suggested that you do not continue any further
2163 unless you want to help in developing and debugging Perl.
2165 If you *still* want to build perl, you can answer 'y' now,
2166 or pass -Dusedevel to Configure.
2169 rp='Do you really want to continue?'
2173 [yY]) echo >&4 "Okay, continuing."
2174 usedevel="$define" ;;
2175 *) echo >&4 "Okay, bye."
2186 case "$versiononly" in
2187 '') versiononly="$define" ;;
2189 case "$installusrbinperl" in
2190 '') installusrbinperl="$undef" ;;
2195 : general instructions
2198 user=`(logname) 2>/dev/null`
2200 '') user=`whoami 2>&1`;;
2202 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2205 rp='Would you like to see the instructions?'
2216 This installation shell script will examine your system and ask you questions
2217 to determine how the perl5 package should be installed. If you get
2218 stuck on a question, you may use a ! shell escape to start a subshell or
2219 execute a command. Many of the questions will have default answers in square
2220 brackets; typing carriage return will give you the default.
2222 On some of the questions which ask for file or directory names you are allowed
2223 to use the ~name construct to specify the login directory belonging to "name",
2224 even if you don't have a shell which knows about that. Questions where this is
2225 allowed will be marked "(~name ok)".
2229 dflt='Type carriage return to continue'
2233 The prompter used in this script allows you to use shell variables and
2234 backticks in your answers. You may use $1, $2, etc... to refer to the words
2235 in the default answer, as if the default line was a set of arguments given to a
2236 script shell. This means you may also use $* to repeat the whole default line,
2237 so you do not have to re-type everything to add something to the default.
2239 Everytime there is a substitution, you will have to confirm. If there is an
2240 error (e.g. an unmatched backtick), the default answer will remain unchanged
2241 and you will be prompted again.
2243 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2244 the questions and use the computed defaults (or the previous answers if there
2245 was already a config.sh file). Type 'Configure -h' for a list of options.
2246 You may also start interactively and then answer '& -d' at any prompt to turn
2247 on the non-interactive behaviour for the remainder of the execution.
2253 Much effort has been expended to ensure that this shell script will run on any
2254 Unix system. If despite that it blows up on yours, your best bet is to edit
2255 Configure and run it again. If you can't run Configure for some reason,
2256 you'll have to generate a config.sh file by hand. Whatever problems you
2257 have, let me (perlbug@perl.org) know how I blew it.
2259 This installation script affects things in two ways:
2261 1) it may do direct variable substitutions on some of the files included
2263 2) it builds a config.h file for inclusion in C programs. You may edit
2264 any of these files as the need arises after running this script.
2266 If you make a mistake on a question, there is no easy way to back up to it
2267 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2268 files. Configure will offer to let you do this before it runs the SH files.
2271 dflt='Type carriage return to continue'
2273 case "$firsttime" in
2274 true) echo $user >>../.config/instruct;;
2278 : find out where common programs are
2280 echo "Locating common programs..." >&4
2293 if test -d \$dir/\$thing; then
2299 for thisthing in \$dir/\$thing; do
2300 : just loop through to pick last item
2302 if test -f \$thisthing; then
2305 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2308 elif test -f \$dir/\$thing.exe; then
2309 if test -n "$DJGPP"; then
2310 echo \$dir/\$thing.exe
2311 elif test "$eunicefix" != ":"; then
2312 : on Eunice apparently
2364 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2365 pth="$pth /lib /usr/lib"
2366 for file in $loclist; do
2370 if test -f "$xxx"; then
2373 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2374 xxx=`./loc $file $file $pth`
2377 '') xxx=`./loc $file $file $pth`;;
2378 *) xxx=`./loc $xxx $xxx $pth`;;
2380 eval $file=$xxx$_exe
2384 echo $file is in $xxx.
2387 echo $file is in $xxx.
2390 echo "I don't know where '$file' is, and my life depends on it." >&4
2391 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2397 echo "Don't worry if any of the following aren't found..."
2399 for file in $trylist; do
2403 if test -f "$xxx"; then
2406 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2407 xxx=`./loc $file $file $pth`
2410 '') xxx=`./loc $file $file $pth`;;
2411 *) xxx=`./loc $xxx $xxx $pth`;;
2413 eval $file=$xxx$_exe
2417 echo $file is in $xxx.
2420 echo $file is in $xxx.
2423 echo "I don't see $file out there, $say."
2430 echo "Substituting grep for egrep."
2437 echo "Substituting cp for ln."
2446 echo "I can't find make or gmake, and my life depends on it." >&4
2447 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2455 *) # We can't have osname yet.
2456 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2457 # Assume that gmake, if found, is definitely GNU make
2458 # and prefer it over the system make.
2459 echo "Substituting gmake for make."
2467 echo "Hopefully test is built into your sh."
2470 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2471 echo "Using the test built into your sh."
2479 echo "Hopefully echo is built into your sh."
2484 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2485 $echo $n "hi there$c" >foo1
2486 echo $n "hi there$c" >foo2
2487 if cmp foo1 foo2 >/dev/null 2>&1; then
2488 echo "They are compatible. In fact, they may be identical."
2495 They are not compatible! You are probably running ksh on a non-USG system.
2496 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2497 have echo built in and we may have to run some Bourne shell scripts. That
2498 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2501 $echo $n "The star should be here-->$c"
2508 # This question was auctioned at YAPC::Europe-2007 in Vienna
2509 # I never promised you could answer it. I only auctioned the question.
2511 The following message is sponsored by
2513 Dresden.pm<--The stars should be here.
2515 Dear Perl user, system administrator or package
2516 maintainer, the Perl community sends greetings to
2517 you. Do you (emblematical) greet back [Y/n]? n
2521 : Check what type of C compiler we use
2525 cat <<'EOSC' >>trygcc
2530 int main(int argc, char *argv[]) {
2534 if $cc -o try $ccflags $ldflags try.c; then
2537 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2543 # Skip this test because it gives a false match on output like:
2544 # ./trygcc: line 23: cc: command not found
2545 # case "`$cc -v -c try.c 2>&1`" in
2546 # *gcc*) trygcc=no ;;
2548 if $test X"$trygcc" = Xyes; then
2549 if gcc -o try -c try.c; then
2551 echo "You seem to have a working gcc, though." >&4
2552 # Switching compilers may undo the work of hints files.
2553 # The most common problem is -D_REENTRANT for threads.
2554 # This heuristic catches that case, but gets false positives
2555 # if -Dusethreads was not actually specified. Better to
2556 # bail out here with a useful message than fail
2557 # mysteriously later. Should we perhaps just try to
2558 # re-invoke Configure -Dcc=gcc config_args ?
2559 if $test -f usethreads.cbu; then
2562 *** However, any setting of the C compiler flags (e.g. for thread support)
2563 *** will be lost. It may be necessary for you to restart Configure and
2564 *** add -Dcc=gcc to your Configure command line.
2567 rp="Would you like to go ahead and try gcc anyway?"
2570 rp="Would you like to use it?"
2573 if $test -f myread; then
2576 if $test -f UU/myread; then
2579 echo "Cannot find myread, sorry. Aborting." >&2
2584 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2597 cat <<'EOSC' >>checkcc
2602 int main(int argc, char *argv[]) {
2606 if $cc -o try $ccflags $ldflags try.c; then
2609 if $test X"$despair" = Xyes; then
2610 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2613 You need to find a working C compiler.
2614 Either (purchase and) install the C compiler supplied by your OS vendor,
2615 or for a free C compiler try http://gcc.gnu.org/
2616 I cannot continue any further, aborting.
2625 : determine whether symbolic links are supported
2628 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2629 echo "Symbolic links are supported." >&4
2632 echo "Symbolic links are NOT supported." >&4
2637 : determine whether symbolic links are supported
2641 echo "Checking how to test for symbolic links..." >&4
2643 if $test "X$issymlink" = X; then
2645 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2646 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2648 if test $? = 0; then
2651 echo "Your builtin 'test -h' may be broken." >&4
2654 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2657 if test -f "$p/$test"; then
2666 echo "Trying external '$test -h'." >&4
2667 issymlink="$test -h"
2668 if $test ! -h sym >/dev/null 2>&1; then
2669 echo "External '$test -h' is broken, too." >&4
2677 if $test "X$issymlink" = X; then
2678 if $test -L sym 2>/dev/null; then
2679 issymlink="$test -L"
2680 echo "The builtin '$test -L' worked." >&4
2683 if $test "X$issymlink" != X; then
2684 echo "You can test for symbolic links with '$issymlink'." >&4
2686 echo "I do not know how you can test for symbolic links." >&4
2690 *) echo "No symbolic links, so not testing for their testing..." >&4
2695 : Make symlinks util
2696 case "$mksymlinks" in
2699 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2702 *) case "$lns:$issymlink" in
2703 *"ln"*" -s:"*"test -"?)
2704 echo "Creating the symbolic links..." >&4
2705 echo "(First creating the subdirectories...)" >&4
2707 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2709 test -z "$directory" && break
2713 if test ! -d t/base; then
2714 echo "Failed to create the subdirectories. Aborting." >&4
2717 echo "(Then creating the symlinks...)" >&4
2718 awk '{print $1}' $src/MANIFEST | while true; do
2720 test -z "$filename" && break
2721 if test -f $filename; then
2722 if $issymlink $filename; then
2726 if test -f $filename; then
2727 echo "$filename already exists, not symlinking."
2729 ln -s $src/$filename $filename
2733 if test ! -f t/base/lex.t; then
2734 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2739 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2747 : Check for Cross-Compilation
2748 case "$usecrosscompile" in
2750 $echo "Cross-compiling..."
2753 *-*-gcc) # A cross-compiling gcc, probably.
2754 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2756 # leave out ld, choosing it is more complex
2758 ranlib=$targetarch-ranlib
2759 $echo 'extern int foo;' > try.c
2760 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2762 if $test $# -gt 0; then
2764 incpth="`$echo $incpth|$sed 's/^ //'`"
2765 echo "Guessing incpth '$incpth'." >&4
2767 j="`$echo $i|$sed 's,/include$,/lib,'`"
2768 if $test -d $j; then
2772 libpth="`$echo $libpth|$sed 's/^ //'`"
2773 echo "Guessing libpth '$libpth'." >&4
2778 case "$targetarch" in
2779 '') echo "Targetarch not defined." >&4; croak=y ;;
2780 *) echo "Using targetarch $targetarch." >&4 ;;
2783 '') echo "Incpth not defined." >&4; croak=y ;;
2784 *) echo "Using incpth '$incpth'." >&4 ;;
2787 '') echo "Libpth not defined." >&4; croak=y ;;
2788 *) echo "Using libpth '$libpth'." >&4 ;;
2791 '') for i in $incpth; do
2792 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2794 echo "Guessing usrinc $usrinc." >&4
2799 '') echo "Usrinc not defined." >&4; croak=y ;;
2802 *) echo "Using usrinc $usrinc." >&4 ;;
2804 case "$targethost" in
2805 '') echo "Targethost not defined." >&4; croak=y ;;
2806 *) echo "Using targethost $targethost." >&4
2811 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2814 /*) run=$src/Cross/run
2815 targetmkdir=$src/Cross/mkdir
2817 from=$src/Cross/from
2819 *) pwd=`$test -f ../Configure & cd ..; pwd`
2821 targetmkdir=$pwd/Cross/mkdir
2823 from=$pwd/Cross/from
2826 case "$targetrun" in
2827 '') targetrun=ssh ;;
2832 case "$targetfrom" in
2833 '') targetfrom=scp ;;
2837 from=$from-$targetfrom
2838 case "$targetdir" in
2840 echo "Guessing targetdir $targetdir." >&4
2843 case "$targetuser" in
2845 echo "Guessing targetuser $targetuser." >&4
2848 case "$targetfrom" in
2852 case "$targetrun" in
2864 '') cwd=$targetdir ;;
2868 if $test ! -f \$exe.xok; then
2872 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2875 *) echo "Unknown targetrun '$targetrun'" >&4
2879 case "$targetmkdir" in
2881 cat >$targetmkdir <<EOF
2883 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2885 $chmod a+rx $targetmkdir
2887 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2899 $targetmkdir \`dirname \$f\`
2900 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2903 $targetmkdir $targetdir/\`dirname \$f\`
2904 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2917 $mkdir -p $targetdir/\`dirname \$f\`
2918 $cp \$f $targetdir/\$f || exit 1
2921 $targetmkdir $targetdir/\`dirname \$f\`
2922 $cp \$f $targetdir/\$f || exit 1
2929 *) echo "Unknown targetto '$targetto'" >&4
2933 case "$targetfrom" in
2940 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2945 cp) cat >$from <<EOF
2950 cp $targetdir/\$f . || exit 1
2955 *) echo "Unknown targetfrom '$targetfrom'" >&4
2959 if $test ! -f $run; then
2960 echo "Target 'run' script '$run' not found." >&4
2964 if $test ! -f $to; then
2965 echo "Target 'to' script '$to' not found." >&4
2969 if $test ! -f $from; then
2970 echo "Target 'from' script '$from' not found." >&4
2974 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2978 Using '$run' for remote execution,
2979 and '$from' and '$to'
2980 for remote file transfer.
2986 usecrosscompile='undef'
2991 : see whether [:lower:] and [:upper:] are supported character classes
2993 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2995 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2999 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3000 # (0xd9 and 0xe2), therefore that is a nice testing point.
3001 if test "X$up" = X -o "X$low" = X; then
3002 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3008 if test "X$up" = X -o "X$low" = X; then
3009 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3015 if test "X$up" = X -o "X$low" = X; then
3016 case "`echo RS | od -x 2>/dev/null`" in
3018 echo "Hey, this might be EBCDIC." >&4
3019 if test "X$up" = X -o "X$low" = X; then
3020 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3021 rs) up='[A-IJ-RS-Z]'
3026 if test "X$up" = X -o "X$low" = X; then
3027 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3037 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3039 echo "Using $up and $low to convert case." >&4
3042 echo "I don't know how to translate letters from upper to lower case." >&4
3043 echo "Your tr is not acting any way I know of." >&4
3047 : set up the translation script tr, must be called with ./tr of course
3051 '[A-Z][a-z]') exec $tr '$up' '$low';;
3052 '[a-z][A-Z]') exec $tr '$low' '$up';;
3059 : Try to determine whether config.sh was made on this system
3060 case "$config_sh" in
3062 myuname=`$uname -a 2>/dev/null`
3063 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3064 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3065 # because the A-Z/a-z are not consecutive.
3066 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3067 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3068 newmyuname="$myuname"
3070 case "$knowitall" in
3072 if test -f ../config.sh; then
3073 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3074 eval "`grep myuname= ../config.sh`"
3076 if test "X$myuname" = "X$newmyuname"; then
3084 : Get old answers from old config file if Configure was run on the
3085 : same system, otherwise use the hints.
3088 if test -f config.sh; then
3090 rp="I see a config.sh file. Shall I use it to set the defaults?"
3093 n*|N*) echo "OK, I'll ignore it."
3094 mv config.sh config.sh.old
3095 myuname="$newmyuname"
3097 *) echo "Fetching default answers from your old config.sh file..." >&4
3105 : Older versions did not always set $sh. Catch re-use of such
3115 if test ! -f config.sh; then
3118 First time through, eh? I have some defaults handy for some systems
3119 that need some extra help getting the Configure answers right:
3122 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3124 : Half the following guesses are probably wrong... If you have better
3125 : tests or hints, please send them to perlbug@perl.org
3126 : The metaconfig authors would also appreciate a copy...
3127 $test -f /irix && osname=irix
3128 $test -f /xenix && osname=sco_xenix
3129 $test -f /dynix && osname=dynix
3130 $test -f /dnix && osname=dnix
3131 $test -f /lynx.os && osname=lynxos
3132 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3133 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3134 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3135 $test -f /bin/mips && /bin/mips && osname=mips
3136 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3137 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3138 $test -d /usr/apollo/bin && osname=apollo
3139 $test -f /etc/saf/_sactab && osname=svr4
3140 $test -d /usr/include/minix && osname=minix
3141 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3142 if $test -d /MachTen -o -d /MachTen_Folder; then
3144 if $test -x /sbin/version; then
3145 osvers=`/sbin/version | $awk '{print $2}' |
3146 $sed -e 's/[A-Za-z]$//'`
3147 elif $test -x /usr/etc/version; then
3148 osvers=`/usr/etc/version | $awk '{print $2}' |
3149 $sed -e 's/[A-Za-z]$//'`
3155 $test -f /sys/posix.dll &&
3156 $test -f /usr/bin/what &&
3157 set X `/usr/bin/what /sys/posix.dll` &&
3158 $test "$3" = UWIN &&
3162 if $test -f $uname; then
3170 umips) osname=umips ;;
3173 [23]100) osname=mips ;;
3174 next*) osname=next ;;
3176 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3177 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3180 elif $test -f /etc/kconfig; then
3182 if test "$lns" = "$ln -s"; then
3184 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3186 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3193 if test -n "$DJGPP"; then
3202 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3204 # oslevel can fail with:
3205 # oslevel: Unable to acquire lock.
3206 *not\ found) osvers="$4"."$3" ;;
3207 '<3240'|'<>3240') osvers=3.2.0 ;;
3208 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3209 '=3250'|'>3250') osvers=3.2.5 ;;
3213 bsd386) osname=bsd386
3216 cygwin*) osname=cygwin
3219 *dc.osx) osname=dcosx
3225 domainos) osname=apollo
3231 dragonfly) osname=dragonfly
3234 dynixptx*) osname=dynixptx
3235 osvers=`echo "$4"|sed 's/^v//'`
3237 freebsd) osname=freebsd
3239 genix) osname=genix ;;
3243 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3259 netbsd*) osname=netbsd
3262 news-os) osvers="$3"
3264 4*) osname=newsos4 ;;
3268 next*) osname=next ;;
3269 nonstop-ux) osname=nonstopux ;;
3270 openbsd) osname=openbsd
3276 POSIX-BC | posix-bc ) osname=posix-bc
3279 powerux | power_ux | powermax_os | powermaxos | \
3280 powerunix | power_unix) osname=powerux
3286 solaris) osname=solaris
3288 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3295 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3299 titanos) osname=titanos
3308 ultrix) osname=ultrix
3311 osf1|mls+) case "$5" in
3314 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3317 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3320 hp*) osname=hp_osf1 ;;
3321 mips) osname=mips_osf1 ;;
3324 # UnixWare 7.1.2 is known as Open UNIX 8
3325 openunix|unixware) osname=svr5
3333 $2) case "$osname" in
3337 : svr4.x or possibly later
3347 if test -f /stand/boot ; then
3348 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3349 if test -n "$INITPROG" -a -f "$INITPROG"; then
3350 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3351 if test -n "$isesix"; then
3359 *) if test -f /etc/systemid; then
3361 set `echo $3 | $sed 's/\./ /g'` $4
3362 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3364 elif $test -f $src/hints/sco_$1_$2.sh; then
3366 elif $test -f $src/hints/sco_$1.sh; then
3371 '') : Still unknown. Probably a generic Sys V.
3380 *) case "$osname" in
3381 '') : Still unknown. Probably a generic BSD.
3389 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3390 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3391 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3394 $rm -f UU/kernel.what
3395 elif test -d c:/. -o -n "$is_os2" ; then
3402 case "$targetarch" in
3405 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3410 : Now look for a hint file osname_osvers, unless one has been
3411 : specified already.
3414 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3415 : Also try without trailing minor version numbers.
3416 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3417 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3418 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3419 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3422 *) case "$osvers" in
3425 *) if $test -f $src/hints/$file.sh ; then
3427 elif $test -f $src/hints/$xfile.sh ; then
3429 elif $test -f $src/hints/$xxfile.sh ; then
3431 elif $test -f $src/hints/$xxxfile.sh ; then
3433 elif $test -f $src/hints/$xxxxfile.sh ; then
3435 elif $test -f "$src/hints/${osname}.sh" ; then
3444 if $test -f Policy.sh ; then
3447 none) dflt="Policy" ;;
3448 *) dflt="Policy $dflt" ;;
3453 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3457 if $test -f Policy.sh ; then
3460 There's also a Policy hint file available, which should make the
3461 site-specific (policy) questions easier to answer.
3468 You may give one or more space-separated answers, or "none" if appropriate.
3469 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3470 previous run of Configure, you may specify it as well as or instead of
3471 OS-specific hints. If hints are provided for your OS, you should use them:
3472 although Perl can probably be built without hints on many platforms, using
3473 hints often improve performance and may enable features that Configure can't
3474 set up on its own. If there are no hints that match your OS, specify "none";
3475 DO NOT give a wrong version or a wrong OS.
3479 rp="Which of these apply, if any?"
3482 for file in $tans; do
3483 if $test X$file = XPolicy -a -f Policy.sh; then
3485 $cat Policy.sh >> UU/config.sh
3486 elif $test -f $src/hints/$file.sh; then
3487 . $src/hints/$file.sh
3488 $cat $src/hints/$file.sh >> UU/config.sh
3489 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3492 : Give one chance to correct a possible typo.
3493 echo "$file.sh does not exist"
3495 rp="hint to use instead?"
3497 for file in $ans; do
3498 if $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$ans = X -o X$ans = Xnone ; then
3504 echo "$file.sh does not exist -- ignored."
3511 : Remember our hint file for later.
3512 if $test -f "$src/hints/$file.sh" ; then
3522 echo "Fetching default answers from $config_sh..." >&4
3526 cp $config_sh config.sh 2>/dev/null
3536 test "$override" && . ./optdef.sh
3538 : Restore computed paths
3539 for file in $loclist $trylist; do
3540 eval $file="\$_$file"
3545 Configure uses the operating system name and version to set some defaults.
3546 The default value is probably right if the name rings a bell. Otherwise,
3547 since spelling matters for me, either accept the default or answer "none"
3554 ''|' '|none) dflt=none ;;
3555 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3558 *) dflt="$osname" ;;
3560 rp="Operating system name?"
3564 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3570 ''|' '|none) dflt=none ;;
3571 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3572 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3574 ''|' ') dflt=none ;;
3579 *) dflt="$osvers" ;;
3581 rp="Operating system version?"
3591 : who configured the system
3592 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3595 cf_by=`(logname) 2>/dev/null`
3598 cf_by=`(whoami) 2>/dev/null`
3600 "") cf_by=unknown ;;
3605 : decide how portable to be. Allow command line overrides.
3606 case "$d_portable" in
3608 *) d_portable="$define" ;;
3611 : set up shell script to do ~ expansion
3617 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3620 if $test -f /bin/csh; then
3621 /bin/csh -f -c "glob \$1"
3626 name=\`$expr x\$1 : '..\([^/]*\)'\`
3627 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3628 if $test ! -d "\$dir"; then
3630 echo "\$me: can't locate home directory for: \$name" >&2
3635 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3651 : now set up to get a file name
3655 cat <<'EOSC' >>getfile
3671 : getfile will accept an answer from the comma-separated list
3672 : enclosed in parentheses even if it does not meet other criteria.
3673 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3674 fn=`echo $fn | sed 's/(.*)//'`
3680 loc_file=`expr $fn : '.*:\(.*\)'`
3681 fn=`expr $fn : '\(.*\):.*'`
3689 */*) fullpath=true;;
3698 *e*) exp_file=true;;
3701 *p*) nopath_ok=true;;
3706 *d*) type='Directory';;
3707 *l*) type='Locate';;
3712 Locate) what='File';;
3717 case "$d_portable" in
3725 while test "$type"; do
3730 true) rp="$rp (~name ok)";;
3733 if test -f UU/getfile.ok && \
3734 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3753 value=`UU/filexp $ans`
3756 if test "$ans" != "$value"; then
3757 echo "(That expands to $value on this system.)"
3771 /*) value="$ansexp" ;;
3772 [a-zA-Z]:/*) value="$ansexp" ;;
3777 echo "I shall only accept a full path name, as in /bin/ls." >&4
3778 echo "Use a ! shell escape if you wish to check pathnames." >&4
3781 echo "Please give a full path name, starting with slash." >&4
3784 echo "Note that using ~name is ok provided it expands well." >&4
3797 for fp in $gfpth; do
3798 if test "X$fp" = X.; then
3803 if test -f "$pf"; then
3805 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3807 echo "($value is not a plain file, but that's ok.)"
3810 if test X"$type" = X; then
3817 for fp in $gfpth; do
3818 if test "X$fp" = X.; then
3823 direxp="$fp/$ansexp"
3825 if test -d "$direxp"; then
3833 if test -d "$ansexp"; then
3834 echo "(Looking for $loc_file in directory $value.)"
3835 value="$value/$loc_file"
3836 ansexp="$ansexp/$loc_file"
3838 if test -f "$ansexp"; then
3841 case "$nopath_ok" in
3842 true) case "$value" in
3844 *) echo "Assuming $value will be in people's path."
3860 if test "$fastread" = yes; then
3865 rp="$what $value doesn't exist. Use that name anyway?"
3884 test "X$gfpthkeep" != Xy && gfpth=""
3887 : determine root of directory hierarchy where package will be installed.
3890 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3893 dflt=`echo "$prefix" | sed 's/.$//'`
3901 By default, $package will be installed in $dflt/bin, manual pages
3902 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3903 installation directories. Typically this is something like /usr/local.
3904 If you wish to have binaries under /usr/bin but other parts of the
3905 installation under /usr/local, that's ok: you will be prompted
3906 separately for each of the installation directories, the prefix being
3907 only used to set the defaults.
3911 rp='Installation prefix to use?'
3919 *) oldprefix="$prefix";;
3926 : allow them to override the AFS root
3929 *) afsroot=$afsroot ;;
3935 $define|true) afs=true ;;
3936 $undef|false) afs=false ;;
3937 *) if $test -d $afsroot; then
3945 echo "AFS may be running... I'll be extra cautious then..." >&4
3947 echo "AFS does not seem to be running..." >&4
3950 : determine installation prefix for where package is to be installed.
3954 Since you are running AFS, I need to distinguish the directory in which
3955 files will reside from the directory in which they are installed (and from
3956 which they are presumably copied to the former directory by occult means).
3959 case "$installprefix" in
3960 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3961 *) dflt="$installprefix";;
3966 In some special cases, particularly when building $package for distribution,
3967 it is convenient to distinguish the directory in which files should be
3968 installed from the directory ($prefix) in which they will
3969 eventually reside. For most users, these two directories are the same.
3972 case "$installprefix" in
3974 *) dflt=$installprefix;;
3978 rp='What installation prefix should I use for installing files?'
3980 installprefix="$ans"
3981 installprefixexp="$ansexp"
3983 : Perform the prefixexp/installprefixexp correction if necessary
3984 cat <<EOS >installprefix
3987 cat <<'EOSC' >>installprefix
3988 : Change installation prefix, if necessary.
3989 if $test X"$prefix" != X"$installprefix"; then
3990 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3992 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3995 chmod +x installprefix
3996 $eunicefix installprefix
3998 : Set variables such as privlib and privlibexp from the output of ./getfile
3999 : performing the prefixexp/installprefixexp correction if necessary.
4000 cat <<EOS >setprefixvar
4003 cat <<'EOSC' >>setprefixvar
4004 eval "${prefixvar}=\"\$ans\""
4005 eval "${prefixvar}exp=\"\$ansexp\""
4008 chmod +x setprefixvar
4009 $eunicefix setprefixvar
4011 : set up the script used to warn in case of inconsistency
4020 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4022 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4023 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4028 echo "*** WHOA THERE!!! ***" >&4
4029 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4032 rp=" Keep the $hint value?"
4035 y) td=$was; tu=$was;;
4039 : function used to set '$1' to '$val'
4040 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4042 $define$undef) . ./whoa; eval "$var=\$td";;
4043 $undef$define) . ./whoa; eval "$var=\$tu";;
4044 *) eval "$var=$val";;
4047 : Check is we will use socks
4049 $define|true|[yY]*) dflt='y';;
4054 Perl can be built to use the SOCKS proxy protocol library. To do so,
4055 Configure must be run with -Dusesocks. If you use SOCKS you also need
4056 to use the PerlIO abstraction layer, this will be implicitly selected.
4058 If this doesn't make any sense to you, just accept the default '$dflt'.
4060 rp='Build Perl for SOCKS?'
4063 y|Y) val="$define" ;;
4070 $define|true|[yY]*) useperlio="$define";;
4073 : Check if we want perlio
4074 case "$useperlio" in
4075 $define|true|[yY]*|'') dflt='y';;
4080 Previous version of $package used the standard IO mechanisms as
4081 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4082 alternate IO mechanisms via the PerlIO abstraction layer, but the
4083 stdio mechanism is still available if needed. The abstraction layer
4084 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4085 Using PerlIO with sfio may cause problems with some extension modules.
4087 If this doesn't make any sense to you, just accept the default '$dflt'.
4089 rp='Use the PerlIO abstraction layer?'
4096 echo "Ok, doing things the stdio way."
4105 case "$useperlio" in
4106 $define|true|[yY]*) ;;
4109 You are using the SOCKS proxy protocol library which means that you
4110 should also use the PerlIO layer. You may be headed for trouble.
4118 : get the patchlevel
4120 echo "Getting the current patchlevel..." >&4
4121 if $test -r $rsrc/patchlevel.h;then
4122 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4123 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4124 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4125 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4126 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4127 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4128 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4137 $echo "(You do not have patchlevel.h. Eek.)"
4139 if $test -r $rsrc/.patch ; then
4140 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
4141 perl_patchlevel=`cat $rsrc/.patch`
4144 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4145 version_patchlevel_string="version $patchlevel subversion $subversion"
4146 case "$perl_patchlevel" in
4148 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4149 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4153 $echo "(You have $package $version_patchlevel_string.)"
4157 : XXX Should be a Configure test for double-dots in filenames.
4158 version=`echo $revision $patchlevel $subversion | \
4159 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4160 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4161 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4164 version=`echo $revision $patchlevel $subversion | \
4165 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4166 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4167 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4170 : Special case the 5.005_xx maintenance series, which used 5.005
4171 : without any subversion label as a subdirectory in $sitelib
4172 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4173 api_versionstring='5.005'
4176 : Do we want threads support and if so, what type
4177 case "$usethreads" in
4178 $define|true|[yY]*) dflt='y';;
4179 *) # Catch case where user specified ithreads or 5005threads but
4180 # forgot -Dusethreads (A.D. 4/2002)
4181 case "$useithreads$use5005threads" in
4183 case "$useperlio" in
4184 "$define") dflt='y' ;;
4194 Perl can be built to take advantage of threads on some systems.
4195 To do so, Configure can be run with -Dusethreads.
4197 Note that Perl built with threading support runs slightly slower
4198 and uses more memory than plain Perl. The current implementation
4199 is believed to be stable, but it is fairly new, and so should be
4200 treated with caution.
4202 If this doesn't make any sense to you, just accept the default '$dflt'.
4204 rp='Build a threading Perl?'
4207 y|Y) val="$define" ;;
4213 if $test $patchlevel -lt 9; then
4214 case "$usethreads" in
4218 Since release 5.6, Perl has had two different threading implementations,
4219 the newer interpreter-based version (ithreads) with one interpreter per
4220 thread, and the older 5.005 version (5005threads).
4221 The 5005threads version is effectively unmaintained and will probably be
4222 removed in Perl 5.10, so there should be no need to build a Perl using it
4223 unless needed for backwards compatibility with some existing 5.005threads
4227 : Default to ithreads unless overridden on command line or with
4230 case "$use5005threads" in
4231 $define|true|[yY]*) dflt='n';;
4233 case "$useithreads" in
4234 $undef|false|[nN]*) dflt='n';;
4236 rp='Use the newer interpreter-based ithreads?'
4239 y|Y) val="$define" ;;
4244 : Now set use5005threads to the opposite value.
4245 case "$useithreads" in
4246 $define) val="$undef" ;;
4253 useithreads="$undef"
4254 use5005threads="$undef"
4258 case "$useithreads$use5005threads" in
4262 You cannot have both the ithreads and the 5.005 threads enabled
4263 at the same time. Disabling the 5.005 threads since they are
4264 much less stable than the ithreads.
4267 use5005threads="$undef"
4272 : perl-5.9.x and later
4274 if test X"$usethreads" = "X$define"; then
4275 case "$use5005threads" in
4279 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4286 use5005threads="$undef"
4287 useithreads="$usethreads"
4290 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4293 *** To build with ithreads you must also use the PerlIO layer.
4294 *** Cannot continue, aborting.
4300 case "$d_oldpthreads" in
4301 '') : Configure tests would be welcome here. For now, assume undef.
4303 *) val="$d_oldpthreads" ;;
4309 : Look for a hint-file generated 'call-back-unit'. If the
4310 : user has specified that a threading perl is to be built,
4311 : we may need to set or change some other defaults.
4312 if $test -f usethreads.cbu; then
4313 echo "Your platform has some specific hints regarding threaded builds, using them..."
4316 case "$usethreads" in
4317 "$define"|true|[yY]*)
4319 (Your platform does not have any specific hints for threaded builds.
4320 Assuming POSIX threads, then.)
4326 : Check if multiplicity is required
4329 Perl can be built so that multiple Perl interpreters can coexist
4330 within the same Perl executable.
4333 case "$useithreads" in
4336 This multiple interpreter support is required for interpreter-based threads.
4340 *) case "$usemultiplicity" in
4341 $define|true|[yY]*) dflt='y';;
4345 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4346 rp='Build Perl for multiplicity?'
4349 y|Y) val="$define" ;;
4357 : Check if morebits is requested
4358 case "$usemorebits" in
4359 "$define"|true|[yY]*)
4360 use64bitint="$define"
4361 uselongdouble="$define"
4362 usemorebits="$define"
4364 *) usemorebits="$undef"
4368 : Determine the C compiler to be used
4374 rp="Use which C compiler?"
4378 : See whether they have no cc but they do have gcc
4380 if $test -f cc.cbu; then
4385 : make some quick guesses about what we are up against
4387 $echo $n "Hmm... $c"
4397 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4398 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4400 echo "Looks kind of like an OSF/1 system, but we'll see..."
4402 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4403 xxx=`./loc addbib blurfl $pth`
4404 if $test -f $xxx; then
4405 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4409 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4410 echo "Looks kind of like an extended USG system, but we'll see..."
4412 echo "Looks kind of like a USG system, but we'll see..."
4416 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4417 echo "Looks kind of like a BSD system, but we'll see..."
4421 echo "Looks kind of like a Version 7 system, but we'll see..."
4424 case "$eunicefix" in
4427 There is, however, a strange, musty smell in the air that reminds me of
4428 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4432 : it so happens the Eunice I know will not run shell scripts in Unix format
4436 echo "Congratulations. You aren't running Eunice."
4440 : Detect OS2. The p_ variable is set above in the Head.U unit.
4441 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4442 : semicolon as a patch separator
4447 I have the feeling something is not exactly right, however...don't tell me...
4448 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4449 (Or you may be running DOS with DJGPP.)
4454 if test -f /xenix; then
4455 echo "Actually, this looks more like a XENIX system..."
4460 echo "It's not Xenix..."
4465 if test -f /venix; then
4466 echo "Actually, this looks more like a VENIX system..."
4473 echo "Nor is it Venix..."
4476 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4477 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4480 : Check if we are using GNU gcc and what its version is
4482 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4486 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4488 printf("%s\n", __VERSION__);
4490 printf("%s\n", "1");
4496 if $cc -o try $ccflags $ldflags try.c; then
4497 gccversion=`$run ./try`
4498 case "$gccversion" in
4499 '') echo "You are not using GNU cc." ;;
4500 *) echo "You are using GNU cc $gccversion."
4506 echo "*** WHOA THERE!!! ***" >&4
4507 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4508 case "$knowitall" in
4510 echo " You'd better start hunting for one and let me know about it." >&4
4516 case "$gccversion" in
4517 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4519 case "$gccversion" in
4520 '') gccosandvers='' ;;
4521 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4522 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4524 case "$gccosandvers" in
4525 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4526 $osname$osvers) ;; # looking good
4527 $osname*) cat <<EOM >&4
4529 *** WHOA THERE!!! ***
4531 Your gcc has not been compiled for the exact release of
4532 your operating system ($gccosandvers versus $osname$osvers).
4534 In general it is a good idea to keep gcc synchronized with
4535 the operating system because otherwise serious problems
4536 may ensue when trying to compile software, like Perl.
4538 I'm trying to be optimistic here, though, and will continue.
4539 If later during the configuration and build icky compilation
4540 problems appear (headerfile conflicts being the most common
4541 manifestation), I suggest reinstalling the gcc to match
4542 your operating system release.
4546 *) gccosandvers='' ;; # failed to parse, better be silent
4554 # gcc 3.* complain about adding -Idirectories that they already know about,
4555 # so we will take those off from locincpth.
4556 case "$gccversion" in
4558 echo "main(){}">try.c
4559 for incdir in $locincpth; do
4560 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4561 grep '^c[cp]p*[01]: warning: changing search order '`
4562 if test "X$warn" != X; then
4563 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4569 : What should the include directory be ?
4571 $echo $n "Hmm... $c"
4575 if $test -f /bin/mips && /bin/mips; then
4576 echo "Looks like a MIPS system..."
4577 $cat >usr.c <<'EOCP'
4578 #ifdef SYSTYPE_BSD43
4582 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4583 dflt='/bsd43/usr/include'
4587 mips_type='System V'
4589 $rm -f usr.c usr.out
4590 echo "and you're compiling with the $mips_type compiler and libraries."
4594 echo "Doesn't look like a MIPS system."
4604 case "$xxx_prompt" in
4607 rp='Where are the include files you want to use?'
4615 : see how we invoke the C preprocessor
4617 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4618 cat <<'EOT' >testcpp.c
4624 if test ! -f cppstdin; then
4625 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4626 # AIX cc -E doesn't show the absolute headerfile
4627 # locations but we'll cheat by using the -M flag.
4628 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
4630 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4633 echo "Keeping your $hint cppstdin wrapper."
4636 wrapper=`pwd`/cppstdin
4640 if $test "X$cppstdin" != "X" && \
4641 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4642 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4644 echo "You used to use $cppstdin $cppminus so we'll use that again."
4646 '') echo "But let's see if we can live without a wrapper..." ;;
4648 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4649 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4651 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4654 echo "(However, $cpprun $cpplast does not work, let's see...)"
4662 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4669 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4670 $cc -E <testcpp.c >testcpp.out 2>&1; \
4671 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4672 echo "Yup, it does."
4675 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4676 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4677 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4678 echo "Yup, it does."
4681 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4682 $cc -P <testcpp.c >testcpp.out 2>&1; \
4683 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4684 echo "Yipee, that works!"
4687 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4688 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4689 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4690 echo "At long last!"
4693 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4694 $cpp <testcpp.c >testcpp.out 2>&1; \
4695 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4699 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4700 $cpp - <testcpp.c >testcpp.out 2>&1; \
4701 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4702 echo "Hooray, it works! I was beginning to wonder."
4705 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4706 $wrapper <testcpp.c >testcpp.out 2>&1; \
4707 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4713 rp="No dice. I can't find a C preprocessor. Name one:"
4717 $x_cpp <testcpp.c >testcpp.out 2>&1
4718 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4719 echo "OK, that will do." >&4
4721 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4736 echo "Perhaps can we force $cc -E using a wrapper..."
4737 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4738 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4744 echo "Nope, we'll have to live without it..."
4758 "$wrapper"|'cppstdin') ;;
4759 *) $rm -f $wrapper;;
4761 $rm -f testcpp.c testcpp.out
4763 : Set private lib path
4766 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4771 '') dlist="$loclibpth $plibpth $glibpth";;
4772 *) dlist="$libpth";;
4775 : Now check and see which directories actually exist, avoiding duplicates
4779 if $test -d $xxx; then
4782 *) libpth="$libpth $xxx";;
4788 Some systems have incompatible or broken versions of libraries. Among
4789 the directories listed in the question below, please remove any you
4790 know not to be holding relevant libraries, and add any that are needed.
4791 Say "none" for none.
4802 rp="Directories to use for library searches?"
4809 : compute shared library extension
4812 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4822 On some systems, shared libraries may be available. Answer 'none' if
4823 you want to suppress searching of shared libraries for the remainder
4824 of this configuration.
4827 rp='What is the file extension used for shared libraries?'
4831 : Define several unixisms.
4832 : Hints files or command line option can be used to override them.
4833 : The convoluted testing is in case hints files set either the old
4836 '') case "$exe_ext" in
4838 *) _exe="$exe_ext" ;;
4843 '') case "$lib_ext" in
4850 '') case "$obj_ext" in
4857 '') case "$path_sep" in
4868 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4870 : Which makefile gets called first. This is used by make depend.
4871 case "$firstmakefile" in
4872 '') firstmakefile='makefile';;
4875 : Check for uselongdouble support
4877 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4880 case "$uselongdouble" in
4881 $define|true|[yY]*) dflt='y';;
4886 Perl can be built to take advantage of long doubles which
4887 (if available) may give more accuracy and range for floating point numbers.
4889 If this doesn't make any sense to you, just accept the default '$dflt'.
4891 rp='Try to use long doubles if available?'
4894 y|Y) val="$define" ;;
4900 case "$uselongdouble" in
4901 true|[yY]*) uselongdouble="$define" ;;
4904 : Look for a hint-file generated 'call-back-unit'. If the
4905 : user has specified that long doubles should be used,
4906 : we may need to set or change some other defaults.
4907 if $test -f uselongdouble.cbu; then
4908 echo "Your platform has some specific hints regarding long doubles, using them..."
4909 . ./uselongdouble.cbu
4911 case "$uselongdouble" in
4914 (Your platform does not have any specific hints for long doubles.)
4920 : Looking for optional libraries
4922 echo "Checking for optional libraries..." >&4
4927 case "$libswanted" in
4928 '') libswanted='c_s';;
4931 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4937 for thisdir in $libpth $xlibpth; do
4938 test -d $thisdir && libspath="$libspath $thisdir"
4940 for thislib in $libswanted; do
4941 for thisdir in $libspath; do
4943 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4944 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4945 $test -f "$xxx" && eval $libscheck
4946 $test -f "$xxx" && libstyle=shared
4948 if test ! -f "$xxx"; then
4949 xxx=$thisdir/lib$thislib.$so
4950 $test -f "$xxx" && eval $libscheck
4951 $test -f "$xxx" && libstyle=shared
4953 if test ! -f "$xxx"; then
4954 xxx=$thisdir/lib$thislib$_a
4955 $test -f "$xxx" && eval $libscheck
4956 $test -f "$xxx" && libstyle=static
4958 if test ! -f "$xxx"; then
4959 xxx=$thisdir/$thislib$_a
4960 $test -f "$xxx" && eval $libscheck
4961 $test -f "$xxx" && libstyle=static
4963 if test ! -f "$xxx"; then
4964 xxx=$thisdir/lib${thislib}_s$_a
4965 $test -f "$xxx" && eval $libscheck
4966 $test -f "$xxx" && libstyle=static
4967 $test -f "$xxx" && thislib=${thislib}_s
4969 if test ! -f "$xxx"; then
4970 xxx=$thisdir/Slib$thislib$_a
4971 $test -f "$xxx" && eval $libscheck
4972 $test -f "$xxx" && libstyle=static
4974 if $test -f "$xxx"; then
4976 shared) echo "Found -l$thislib (shared)." ;;
4977 static) echo "Found -l$thislib." ;;
4978 *) echo "Found -l$thislib ($libstyle)." ;;
4982 *) dflt="$dflt -l$thislib"
4983 libsfound="$libsfound $xxx"
4985 libsfiles="$libsfiles $yyy"
4986 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4987 case " $libsdirs " in
4989 *) libsdirs="$libsdirs $yyy" ;;
4996 if $test ! -f "$xxx"; then
4997 echo "No -l$thislib."
5008 ' '|'') dflt='none';;
5013 In order to compile $package on your machine, a number of libraries
5014 are usually needed. Include any other special libraries here as well.
5015 Say "none" for none. The default list is almost always right.
5019 rp="What libraries to use?"
5026 : determine optimization, if desired, or use for debug flag also
5028 ' '|$undef) dflt='none';;
5030 *) dflt="$optimize";;
5034 By default, $package compiles with the -O flag to use the optimizer.
5035 Alternately, you might want to use the symbolic debugger, which uses
5036 the -g flag (on traditional Unix systems). Either flag can be
5037 specified here. To use neither flag, specify the word "none".
5040 rp="What optimizer/debugger flag should be used?"
5044 'none') optimize=" ";;
5047 : Check what DEBUGGING is required from the command line
5048 : -DEBUGGING or -DDEBUGGING or
5049 : -DEBUGGING=both = -g + -DDEBUGGING
5050 : -DEBUGGING=-g or -Doptimize=-g = -g
5051 : -DEBUGGING=none or -UDEBUGGING =
5052 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5055 *) DEBUGGING=$EBUGGING ;;
5058 case "$DEBUGGING" in
5062 *) optimize="$optimize -g" ;;
5066 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5074 case "$DEBUGGING" in
5075 both|$define) dflt='-DDEBUGGING'
5078 : argument order is deliberate, as the flag will start with - which set could
5079 : think is an option
5080 checkccflag='check=$1; flag=$2; callback=$3;
5082 echo "Checking if your compiler accepts $flag" 2>&1;
5083 echo "int main(void) { return 0; }" > gcctest.c;
5084 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5085 echo "Yes, it does." 2>&1;
5086 if $test -s gcctest.out ; then
5087 echo "But your platform does not like it:";
5092 echo "Leaving current flags $ccflags alone." 2>&1
5094 *) dflt="$dflt $flag";
5100 echo "Nope, it does not, but that is ok." 2>&1;
5104 : We will not override a previous value, but we might want to
5105 : augment a hint file
5107 default|recommended)
5108 case "$gccversion" in
5109 1*) dflt="$dflt -fpcc-struct-return" ;;
5111 case "$optimize:$DEBUGGING" in
5112 *-g*:old) dflt="$dflt -DDEBUGGING";;
5114 case "$gccversion" in
5115 2*) if $test -d /etc/conf/kconfig.d &&
5116 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5118 # Interactive Systems (ISC) POSIX mode.
5123 case "$gccversion" in
5126 ?*) set strict-aliasing -fno-strict-aliasing
5130 # For gcc, adding -pipe speeds up compilations for some, but apparently
5131 # some assemblers can't read from stdin. (It also slows down compilations
5132 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5133 case "$gccversion" in
5139 # on x86_64 (at least) we require an extra library (libssp) in the
5140 # link command line. This library is not named, so I infer that it is
5141 # an implementation detail that may change. Hence the safest approach
5142 # is to add the flag to the flags passed to the compiler at link time,
5143 # as that way the compiler can do the right implementation dependant
5145 case "$gccversion" in
5146 ?*) set stack-protector -fstack-protector
5153 case "$mips_type" in
5154 *BSD*|'') inclwanted="$locincpth $usrinc";;
5155 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5157 for thisincl in $inclwanted; do
5158 if $test -d $thisincl; then
5159 if $test x$thisincl != x$usrinc; then
5161 *" -I$thisincl "*);;
5162 *) dflt="$dflt -I$thisincl ";;
5168 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5170 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5178 *) dflt="$dflt -D$2";;
5182 set signal.h LANGUAGE_C; eval $inctest
5186 ccflags="$ccflags -DSOCKS"
5191 default|recommended) dflt="$ccflags $dflt" ;;
5192 *) dflt="$ccflags";;
5201 Your C compiler may want other flags. For this question you should include
5202 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5203 but you should NOT include libraries or ld flags like -lwhatever. If you
5204 want $package to honor its debug switch, you should include -DDEBUGGING here.
5205 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5207 To use no flags, specify the word "none".
5213 rp="Any additional cc flags?"
5220 : the following weeds options from ccflags that are of no interest to cpp
5222 '') cppflags="$ccflags" ;;
5223 *) cppflags="$cppflags $ccflags" ;;
5225 case "$gccversion" in
5226 1*) cppflags="$cppflags -D__GNUC__"
5228 case "$mips_type" in
5230 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5236 echo "Let me guess what the preprocessor flags are..." >&4
5250 *) ftry="$previous $flag";;
5252 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5253 >cpp1.out 2>/dev/null && \
5254 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5255 >cpp2.out 2>/dev/null && \
5256 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5257 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5259 cppflags="$cppflags $ftry"
5269 *-*) echo "They appear to be: $cppflags";;
5271 $rm -f cpp.c cpp?.out
5275 : flags used in final linking phase
5277 '') if ./venix; then
5283 *-posix*) dflt="$dflt -posix" ;;
5286 *) dflt="$ldflags";;
5288 # See note above about -fstack-protector
5290 *-fstack-protector*)
5292 *-fstack-protector*) ;; # Don't add it again
5293 *) dflt="$dflt -fstack-protector" ;;
5298 : Try to guess additional flags to pick up local libraries.
5299 for thislibdir in $libpth; do
5300 case " $loclibpth " in
5303 *"-L$thislibdir "*) ;;
5304 *) dflt="$dflt -L$thislibdir" ;;
5316 Your C linker may need flags. For this question you should
5317 include -L/whatever and any other flags used by the C linker, but you
5318 should NOT include libraries like -lwhatever.
5320 Make sure you include the appropriate -L/path flags if your C linker
5321 does not normally search all of the directories you specified above,
5324 To use no flags, specify the word "none".
5328 rp="Any additional ld flags (NOT including libraries)?"
5334 rmlist="$rmlist pdp11"
5338 echo "Checking your choice of C compiler and flags for coherency..." >&4
5339 $cat > try.c <<'EOF'
5341 int main() { printf("Ok\n"); return(0); }
5343 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5345 $cat >try.msg <<'EOM'
5346 I've tried to compile and run the following simple program:
5349 $cat try.c >> try.msg
5351 $cat >> try.msg <<EOM
5358 and I got the following output:
5362 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5363 if $sh -c "$run ./try " >>try.msg 2>&1; then
5367 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5370 cat >> try.msg <<'EOQS'
5371 If $libs contains -lsfio, and sfio is mis-configured, then it
5372 sometimes (apparently) runs and exits with a 0 status, but with no
5373 output! It may have to do with sfio's use of _exit vs. exit.
5376 rp="You have a big problem. Shall I abort Configure"
5383 echo "The program compiled OK, but exited with status $?." >>try.msg
5384 rp="You have a problem. Shall I abort Configure"
5388 echo "I can't compile the test program." >>try.msg
5389 rp="You have a BIG problem. Shall I abort Configure"
5395 case "$knowitall" in
5397 echo "(The supplied flags or libraries might be incorrect.)"
5405 *) echo "Ok. Stopping Configure." >&4
5410 n) echo "OK, that should do.";;
5412 $rm_try gcctest gcctest.out
5414 : define a shorthand compile call
5418 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5419 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5423 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5424 : define a shorthand compile call for compilations that should be ok.
5428 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5430 : determine filename position in cpp output
5432 echo "Computing filename position in cpp output for #include directives..." >&4
5434 vos) testaccess=-e ;;
5437 echo '#include <stdio.h>' > foo.c
5440 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5441 $grep '^[ ]*#.*stdio\.h' | \
5442 while read cline; do
5445 while $test \$# -gt 0; do
5446 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5451 pos=\`expr \$pos + 1\`
5463 *) pos="${fieldn}th";;
5465 echo "Your cpp writes the filename in the $pos field of the line."
5468 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5469 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5472 : locate header file
5477 for usrincdir in $usrinc
5479 if test -f \$usrincdir/\$wanted; then
5480 echo "\$usrincdir/\$wanted"
5484 awkprg='{ print \$$fieldn }'
5485 echo "#include <\$wanted>" > foo\$\$.c
5486 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5487 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5488 while read cline; do
5489 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5491 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5492 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5497 # status = 0: grep returned 0 lines, case statement not executed
5498 # status = 1: headerfile found
5499 # status = 2: while loop executed, no headerfile found
5503 if test \$status -eq 1; then
5510 : define an alternate in-header-list? function
5511 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5512 cont=true; xxf="echo \"<\$1> found.\" >&4";
5513 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5514 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5516 case $# in 4) instead=instead;; *) instead="at last";; esac;
5517 while $test "$cont"; do
5519 var=$2; eval "was=\$$2";
5520 if $test "$xxx" && $test -r "$xxx";
5522 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5525 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5526 set $yyy; shift; shift; yyy=$@;
5527 case $# in 0) cont="";;
5528 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5529 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5530 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5531 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5535 do set $yyy; var=$2; eval "was=\$$2";
5536 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5537 set $yyy; shift; shift; yyy=$@;
5540 : see if stdlib is available
5541 set stdlib.h i_stdlib
5544 : check for lengths of integral types
5548 echo "Checking to see how big your integers are..." >&4
5557 printf("intsize=%d;\n", (int)sizeof(int));
5558 printf("longsize=%d;\n", (int)sizeof(long));
5559 printf("shortsize=%d;\n", (int)sizeof(short));
5564 if eval $compile_ok && $run ./try > /dev/null; then
5566 echo "Your integers are $intsize bytes long."
5567 echo "Your long integers are $longsize bytes long."
5568 echo "Your short integers are $shortsize bytes long."
5572 Help! I can't compile and run the intsize test program: please enlighten me!
5573 (This is probably a misconfiguration in your system or libraries, and
5574 you really ought to fix it. Still, I'll try anyway.)
5578 rp="What is the size of an integer (in bytes)?"
5582 rp="What is the size of a long integer (in bytes)?"
5586 rp="What is the size of a short integer (in bytes)?"
5594 : check for long long
5596 echo "Checking to see if you have long long..." >&4
5597 echo 'int main() { long long x = 7; return 0; }' > try.c
5599 if eval $compile; then
5601 echo "You have long long."
5604 echo "You do not have long long."
5610 : check for length of long long
5611 case "${d_longlong}${longlongsize}" in
5614 echo "Checking to see how big your long longs are..." >&4
5615 $cat >try.c <<'EOCP'
5619 printf("%d\n", (int)sizeof(long long));
5624 if eval $compile_ok; then
5625 longlongsize=`$run ./try`
5626 echo "Your long longs are $longlongsize bytes long."
5630 echo "(I can't seem to compile the test program. Guessing...)"
5631 rp="What is the size of a long long (in bytes)?"
5635 if $test "X$longsize" = "X$longlongsize"; then
5636 echo "(That isn't any different from an ordinary long.)"
5642 : see if inttypes.h is available
5643 : we want a real compile instead of Inhdr because some systems
5644 : have an inttypes.h which includes non-existent headers
5647 #include <inttypes.h>
5649 static int32_t foo32 = 0x12345678;
5653 if eval $compile; then
5654 echo "<inttypes.h> found." >&4
5657 echo "<inttypes.h> NOT found." >&4
5666 echo "Checking to see if you have int64_t..." >&4
5668 #include <sys/types.h>
5669 #$i_inttypes I_INTTYPES
5671 #include <inttypes.h>
5673 int main() { int64_t x = 7; }
5676 if eval $compile; then
5678 echo "You have int64_t."
5681 echo "You do not have int64_t."
5687 : Check if 64bit ints have a quad type
5689 echo "Checking which 64-bit integer type we could use..." >&4
5695 val='"unsigned int"'
5700 *) case "$longsize" in
5704 val='"unsigned long"'
5709 *) case "$d_longlong:$longlongsize" in
5714 val='"unsigned long long"'
5719 *) case "$d_int64_t" in
5738 '') echo "Alas, no 64-bit integer types in sight." >&4
5741 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5746 : Do we want 64bit support
5747 case "$uselonglong" in
5748 "$define"|true|[yY]*)
5751 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5753 use64bitint="$define"
5756 case "$use64bits" in
5757 "$define"|true|[yY]*)
5760 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5762 use64bitint="$define"
5765 case "$use64bitints" in
5766 "$define"|true|[yY]*)
5769 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5771 use64bitint="$define"
5774 case "$use64bitsint" in
5775 "$define"|true|[yY]*)
5778 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5780 use64bitint="$define"
5783 case "$uselonglongs" in
5784 "$define"|true|[yY]*)
5787 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5789 use64bitint="$define"
5792 case "$use64bitsall" in
5793 "$define"|true|[yY]*)
5796 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5798 use64bitall="$define"
5803 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5805 case "$use64bitall" in
5806 "$define"|true|[yY]*) use64bitint="$define" ;;
5812 You have natively 64-bit long integers.
5816 *) case "$use64bitint" in
5817 "$define"|true|[yY]*) dflt='y';;
5826 Perl can be built to take advantage of 64-bit integer types
5827 on some systems. To do so, Configure can be run with -Duse64bitint.
5828 Choosing this option will most probably introduce binary incompatibilities.
5830 If this doesn't make any sense to you, just accept the default '$dflt'.
5831 (The default has been chosen based on your configuration.)
5833 rp='Try to use 64-bit integers, if available?'
5836 [yY]*) val="$define" ;;
5844 case "$use64bitall" in
5845 "$define"|true|[yY]*) dflt='y' ;;
5846 *) case "$longsize" in
5854 You may also choose to try maximal 64-bitness. It means using as much
5855 64-bitness as possible on the platform. This in turn means even more
5856 binary incompatibilities. On the other hand, your platform may not
5857 have any more 64-bitness available than what you already have chosen.
5859 If this doesn't make any sense to you, just accept the default '$dflt'.
5860 (The default has been chosen based on your configuration.)
5862 rp='Try to use maximal 64-bit support, if available?'
5865 [yY]*) val="$define" ;;
5870 case "$use64bitall" in
5872 case "$use64bitint" in
5876 Since you have chosen a maximally 64-bit build, I'm also turning on
5877 the use of 64-bit integers.
5879 use64bitint="$define" ;;
5884 : Look for a hint-file generated 'call-back-unit'. If the
5885 : user has specified that a 64-bit perl is to be built,
5886 : we may need to set or change some other defaults.
5887 if $test -f use64bitint.cbu; then
5888 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5891 case "$use64bitint" in
5892 "$define"|true|[yY]*)
5894 4) case "$archname64" in
5895 '') archname64=64int ;;
5902 : Look for a hint-file generated 'call-back-unit'. If the
5903 : user has specified that a maximally 64-bit perl is to be built,
5904 : we may need to set or change some other defaults.
5905 if $test -f use64bitall.cbu; then
5906 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5909 case "$use64bitall" in
5910 "$define"|true|[yY]*)
5912 4) case "$archname64" in
5913 ''|64int) archname64=64all ;;
5920 case "$d_quad:$use64bitint" in
5924 *** You have chosen to use 64-bit integers,
5925 *** but none can be found.
5926 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5927 *** Cannot continue, aborting.
5934 : check for length of double
5936 case "$doublesize" in
5938 echo "Checking to see how big your double precision numbers are..." >&4
5947 printf("%d\n", (int)sizeof(double));
5952 if eval $compile_ok; then
5953 doublesize=`$run ./try`
5954 echo "Your double is $doublesize bytes long."
5957 echo "(I can't seem to compile the test program. Guessing...)"
5958 rp="What is the size of a double precision number (in bytes)?"
5966 : check for long doubles
5968 echo "Checking to see if you have long double..." >&4
5969 echo 'int main() { long double x = 7.0; }' > try.c
5971 if eval $compile; then
5973 echo "You have long double."
5976 echo "You do not have long double."
5982 : check for length of long double
5983 case "${d_longdbl}${longdblsize}" in
5986 echo "Checking to see how big your long doubles are..." >&4
5987 $cat >try.c <<'EOCP'
5991 printf("%d\n", sizeof(long double));
5996 if eval $compile; then
5997 longdblsize=`$run ./try`
5998 echo "Your long doubles are $longdblsize bytes long."
6002 echo "(I can't seem to compile the test program. Guessing...)" >&4
6003 rp="What is the size of a long double (in bytes)?"
6007 if $test "X$doublesize" = "X$longdblsize"; then
6008 echo "That isn't any different from an ordinary double."
6009 echo "I'll keep your setting anyway, but you may see some"
6010 echo "harmless compilation warnings."
6016 : determine the architecture name
6018 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6019 tarch=`arch`"-$osname"
6020 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6021 if uname -m > tmparch 2>&1 ; then
6022 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6023 -e 's/$/'"-$osname/" tmparch`
6031 case "$myarchname" in
6034 echo "(Your architecture name used to be $myarchname.)"
6038 case "$targetarch" in
6040 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6045 *) dflt="$archname";;
6047 rp='What is your architecture name'
6050 case "$usethreads" in
6052 echo "Threads selected." >&4
6054 *-thread*) echo "...and architecture name already has -thread." >&4
6056 *) archname="$archname-thread"
6057 echo "...setting architecture name to $archname." >&4
6062 case "$usemultiplicity" in
6064 echo "Multiplicity selected." >&4
6066 *-multi*) echo "...and architecture name already has -multi." >&4
6068 *) archname="$archname-multi"
6069 echo "...setting architecture name to $archname." >&4
6074 case "$use64bitint$use64bitall" in
6076 case "$archname64" in
6078 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6081 case "$use64bitint" in
6082 "$define") echo "64 bit integers selected." >&4 ;;
6084 case "$use64bitall" in
6085 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6088 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6090 *) archname="$archname-$archname64"
6091 echo "...setting architecture name to $archname." >&4
6097 case "$uselongdouble" in
6099 echo "Long doubles selected." >&4
6100 case "$longdblsize" in
6102 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6106 *-ld*) echo "...and architecture name already has -ld." >&4
6108 *) archname="$archname-ld"
6109 echo "...setting architecture name to $archname." >&4
6116 case "$useperlio" in
6118 echo "Perlio selected." >&4
6121 echo "Perlio not selected, using stdio." >&4
6123 *-stdio*) echo "...and architecture name already has -stdio." >&4
6125 *) archname="$archname-stdio"
6126 echo "...setting architecture name to $archname." >&4
6131 if $test -f archname.cbu; then
6132 echo "Your platform has some specific hints for architecture name, using them..."
6136 : set the prefixit variable, to compute a suitable default value
6137 prefixit='case "$3" in
6139 case "$oldprefix" in
6140 "") eval "$1=\"\$$2\"";;
6147 ""|" ") eval "$1=\"\$$2\"";;
6153 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6155 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6156 /*-$oldprefix/*|\~*-$oldprefix/*)
6157 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6158 *) eval "$1=\"\$$2\"";;
6162 : determine installation style
6163 : For now, try to deduce it from prefix unless it is already set.
6164 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6165 case "$installstyle" in
6166 '') case "$prefix" in
6167 *perl*) dflt='lib';;
6168 *) dflt='lib/perl5' ;;
6171 *) dflt="$installstyle" ;;
6173 : Probably not worth prompting for this since we prompt for all
6174 : the directories individually, and the prompt would be too long and
6178 : determine where public executables go
6183 rp='Pathname where the public executables will reside?'
6185 if $test "X$ansexp" != "X$binexp"; then
6189 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6190 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6191 : this via initialinstalllocation
6194 case "$userelocatableinc" in
6195 $define|true|[yY]*) dflt='y' ;;
6200 Would you like to build Perl so that the installation is relocatable, so that
6201 library paths in @INC are determined relative to the path of the perl binary?
6202 This is not advised for system Perl installs, or if you need to run setid
6203 scripts or scripts under taint mode.
6205 If this doesn't make any sense to you, just accept the default '$dflt'.
6207 rp='Use relocatable @INC?'
6210 y|Y) val="$define" ;;
6213 set userelocatableinc
6216 initialinstalllocation="$binexp"
6217 : Default prefix is now "up one level from where the binaries are"
6218 case "$userelocatableinc" in
6224 installprefixexp=".../.."
6228 : determine where private library files go
6229 : Usual default is /usr/local/lib/perl5/$version.
6230 : Also allow things like /opt/perl/lib/$version, since
6231 : /opt/perl/lib/perl5... would be redundant.
6232 : The default "style" setting is made in installstyle.U
6233 case "$installstyle" in
6234 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6235 *) set dflt privlib lib/$version ;;
6240 There are some auxiliary files for $package that need to be put into a
6241 private library directory that is accessible by everyone.
6246 rp='Pathname where the private library files will reside?'
6251 : set the prefixup variable, to restore leading tilda escape
6252 prefixup='case "$prefixexp" in
6254 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6257 : determine where public architecture dependent libraries go
6260 : privlib default is /usr/local/lib/$package/$version
6261 : archlib default is /usr/local/lib/$package/$version/$archname
6262 : privlib may have an optional trailing /share.
6263 tdflt=`echo $privlib | $sed 's,/share$,,'`
6264 tdflt=$tdflt/$archname
6273 $spackage contains architecture-dependent library files. If you are
6274 sharing libraries in a heterogeneous environment, you might store
6275 these files in a separate location. Otherwise, you can just include
6276 them with the rest of the public library files.
6281 rp='Where do you want to put the public architecture-dependent libraries?'
6285 if $test X"$archlib" = X"$privlib"; then
6291 : see if setuid scripts can be secure
6294 Some kernels have a bug that prevents setuid #! scripts from being
6295 secure. Some sites have disabled setuid #! scripts because of this.
6297 First let's decide if your kernel supports secure setuid #! scripts.
6298 (If setuid #! scripts would be secure but have been disabled anyway,
6299 don't say that they are secure if asked.)
6304 if $test -d /dev/fd; then
6305 echo "#!$ls" >reflect
6306 chmod +x,u+s reflect
6307 ./reflect >flect 2>&1
6308 if $contains "/dev/fd" flect >/dev/null; then
6309 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6313 If you are not sure if they are secure, I can check but I'll need a
6314 username and password different from the one you are using right now.
6315 If you don't have such a username or don't want me to test, simply
6319 rp='Other username to test security of setuid scripts with?'
6324 case "$d_suidsafe" in
6325 '') echo "I'll assume setuid scripts are *not* secure." >&4
6328 echo "Well, the $hint value is *not* secure." >&4
6330 *) echo "Well, the $hint value *is* secure." >&4
6335 $rm -f reflect flect
6336 echo "#!$ls" >reflect
6337 chmod +x,u+s reflect
6340 echo '"su" will (probably) prompt you for '"$ans's password."
6341 su $ans -c './reflect >flect'
6342 if $contains "/dev/fd" flect >/dev/null; then
6343 echo "Okay, it looks like setuid scripts are secure." >&4
6346 echo "I don't think setuid scripts are secure." >&4
6351 rp='Does your kernel have *secure* setuid scripts?'
6354 [yY]*) val="$define";;
6359 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6360 echo "(That's for file descriptors, not floppy disks.)"
6366 $rm -f reflect flect
6368 : now see if they want to do setuid emulation
6371 case "$d_suidsafe" in
6374 echo "No need to emulate SUID scripts since they are secure here." >&4
6378 Some systems have disabled setuid scripts, especially systems where
6379 setuid scripts cannot be secure. On systems where setuid scripts have
6380 been disabled, the setuid/setgid bits on scripts are currently
6381 useless. It is possible for $package to detect those bits and emulate
6382 setuid/setgid in a secure fashion. This emulation will only work if
6383 setuid scripts have been disabled in your kernel.
6387 "$define") dflt=y ;;
6390 rp="Do you want to do setuid/setgid emulation?"
6393 [yY]*) val="$define";;
6401 : Find perl5.005 or later.
6402 echo "Looking for a previously installed perl5.005 or later... "
6404 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6405 : Check if this perl is recent and can load a simple module
6406 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6409 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6419 '') echo "None found. That's ok.";;
6420 *) echo "Using $perl5." ;;
6423 : Set the siteprefix variables
6426 After $package is installed, you may wish to install various
6427 add-on modules and utilities. Typically, these add-ons will
6428 be installed under $prefix with the rest
6429 of this package. However, you may wish to install such add-ons
6430 elsewhere under a different prefix.
6432 If you do not wish to put everything under a single prefix, that's
6433 ok. You will be prompted for the individual locations; this siteprefix
6434 is only used to suggest the defaults.
6436 The default should be fine for most people.
6440 rp='Installation prefix to use for add-on modules and utilities?'
6441 : XXX Here might be another good place for an installstyle setting.
6442 case "$siteprefix" in
6444 *) dflt=$siteprefix ;;
6447 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6449 case "$siteprefix" in
6453 *) oldsiteprefix="$prefix";;
6458 siteprefixexp="$ansexp"
6460 : determine where site specific libraries go.
6461 : Usual default is /usr/local/lib/perl5/site_perl/$version
6462 : The default "style" setting is made in installstyle.U
6463 : XXX No longer works with Prefixit stuff.
6464 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6466 '') case "$installstyle" in
6467 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6468 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6476 The installation process will create a directory for
6477 site-specific extensions and modules. Most users find it convenient
6478 to place all site-specific files in this directory rather than in the
6479 main distribution directory.
6483 rp='Pathname for the site-specific library files?'
6487 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6489 : Determine list of previous versions to include in @INC
6490 $cat > getverlist <<EOPL
6493 \$api_versionstring = "$api_versionstring";
6494 \$version = "$version";
6495 \$stem = "$sitelib_stem";
6496 \$archname = "$archname";
6498 $cat >> getverlist <<'EOPL'
6499 # The list found is store twice for each entry: the original name, and
6500 # the binary broken down version as pack "sss", so sorting is easy and
6501 # unambiguous. This will work for all versions that have a maximum of
6502 # three digit groups, separate by '.'s or '_'s. Names are extended with
6503 # ".0.0" to ensure at least three elements for the pack.
6504 # -- H.Merijn Brand (m)'06 23-10-2006
6506 # Can't have leading @ because metaconfig interprets it as a command!
6507 ;@inc_version_list=();
6508 # XXX Redo to do opendir/readdir?
6511 ;@candidates = map {
6512 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6518 ($pversion, $aversion, $vsn5005) = map {
6519 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6520 foreach $d (@candidates) {
6521 if ($d->[1] lt $pversion) {
6522 if ($d->[1] ge $aversion) {
6523 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6525 elsif ($d->[1] ge $vsn5005) {
6526 unshift(@inc_version_list, grep { -d } $d->[0]);
6530 # Skip newer version. I.e. don't look in
6531 # 5.7.0 if we're installing 5.6.1.
6535 if (@inc_version_list) {
6536 print join(' ', @inc_version_list);
6539 # Blank space to preserve value for next Configure run.
6544 case "$inc_version_list" in
6545 '') if test -x "$perl5$exe_ext"; then
6546 dflt=`$perl5 getverlist`
6551 $undef) dflt='none' ;;
6552 *) eval dflt=\"$inc_version_list\" ;;
6555 ''|' ') dflt=none ;;
6562 In order to ease the process of upgrading, this version of perl
6563 can be configured to use modules built and installed with earlier
6564 versions of perl that were installed under $prefix. Specify here
6565 the list of earlier versions that this version of perl should check.
6566 If Configure detected no earlier versions of perl installed under
6567 $prefix, then the list will be empty. Answer 'none' to tell perl
6568 to not search earlier versions.
6570 The default should almost always be sensible, so if you're not sure,
6571 just accept the default.
6574 rp='List of earlier versions to include in @INC?'
6577 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6578 *) inc_version_list="$ans" ;;
6580 case "$inc_version_list" in
6582 inc_version_list_init='0'
6583 d_inc_version_list="$undef"
6585 *) inc_version_list_init=`echo $inc_version_list |
6586 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6587 d_inc_version_list="$define"
6592 : see if malloc/malloc.h has to be included
6593 set malloc/malloc.h i_mallocmalloc
6596 : see if this is a malloc.h system
6597 : we want a real compile instead of Inhdr because some systems have a
6598 : malloc.h that just gives a compile error saying to use stdlib.h instead
6603 #$i_mallocmalloc I_MALLOCMALLOC
6604 #ifdef I_MALLOCMALLOC
6605 # include <malloc/malloc.h>
6608 int main () { return 0; }
6611 if eval $compile; then
6612 echo "<malloc.h> found." >&4
6615 echo "<malloc.h> NOT found." >&4
6622 : check for void type
6624 echo "Checking to see how well your C compiler groks the void type..." >&4
6625 case "$voidflags" in
6637 extern void moo(); /* function returning void */
6638 void (*goo)(); /* ptr to func returning void */
6640 void *hue; /* generic ptr */
6653 int main() { sub(); }
6655 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6656 voidflags=$defvoidused
6657 echo "Good. It appears to support void to the level $package wants.">&4
6658 if $contains warning .out >/dev/null 2>&1; then
6659 echo "However, you might get some warnings that look like this:"
6663 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6664 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6665 echo "It supports 1..."
6666 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6667 echo "It also supports 2..."
6668 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6670 echo "And it supports 4 but not 8 definitely."
6672 echo "It doesn't support 4..."
6673 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6675 echo "But it supports 8."
6678 echo "Neither does it support 8."
6682 echo "It does not support 2..."
6683 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6685 echo "But it supports 4 and 8."
6687 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6689 echo "And it supports 4 but has not heard about 8."
6691 echo "However it supports 8 but not 4."
6696 echo "There is no support at all for void."
6701 case "$voidflags" in
6704 Support flag bits are:
6705 1: basic void declarations.
6706 2: arrays of pointers to functions returning void.
6707 4: operations between pointers to and addresses of void functions.
6708 8: generic void pointers.
6711 rp="Your void support flags add up to what?"
6718 : check for length of pointer
6722 echo "Checking to see how big your pointers are..." >&4
6723 if test "$voidflags" -gt 7; then
6724 echo '#define VOID_PTR char *' > try.c
6726 echo '#define VOID_PTR void *' > try.c
6736 printf("%d\n", (int)sizeof(VOID_PTR));
6741 if eval $compile_ok; then
6742 ptrsize=`$run ./try`
6743 echo "Your pointers are $ptrsize bytes long."
6746 echo "(I can't seem to compile the test program. Guessing...)" >&4
6747 rp="What is the size of a pointer (in bytes)?"
6754 case "$use64bitall" in
6755 "$define"|true|[yY]*)
6759 *** You have chosen a maximally 64-bit build,
6760 *** but your pointers are only 4 bytes wide.
6761 *** Please rerun Configure without -Duse64bitall.
6766 *** Since you have quads, you could possibly try with -Duse64bitint.
6771 *** Cannot continue, aborting.
6782 : determine whether to use malloc wrapping
6784 case "$usemallocwrap" in
6785 [yY]*|true|$define) dflt='y' ;;
6786 [nN]*|false|$undef) dflt='n' ;;
6787 *) case "$usedevel" in
6788 [yY]*|true|$define) dflt='y' ;;
6793 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6795 usemallocwrap="$ans"
6798 usemallocwrap="$define" ;;
6800 usemallocwrap="$undef" ;;
6803 : determine which malloc to compile in
6805 case "$usemymalloc" in
6806 [yY]*|true|$define) dflt='y' ;;
6807 [nN]*|false|$undef) dflt='n' ;;
6808 *) case "$ptrsize" in
6814 rp="Do you wish to attempt to use the malloc that comes with $package?"
6820 mallocsrc='malloc.c'
6821 mallocobj="malloc$_o"
6822 d_mymalloc="$define"
6825 : Remove malloc from list of libraries to use
6826 echo "Removing unneeded -lmalloc from library list" >&4
6827 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6830 echo "libs = $libs" >&4
6842 : compute the return types of malloc and free
6844 $cat >malloc.c <<END
6848 #include <sys/types.h>
6862 case "$malloctype" in
6864 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6871 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6875 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6882 echo "Your system uses $freetype free(), it would seem." >&4
6884 : determine where site specific architecture-dependent libraries go.
6885 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6886 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6887 : sitelib may have an optional trailing /share.
6889 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6890 dflt="$dflt/$archname"
6895 set sitearch sitearch none
6899 The installation process will also create a directory for
6900 architecture-dependent site-specific extensions and modules.
6904 rp='Pathname for the site-specific architecture-dependent library files?'
6908 if $test X"$sitearch" = X"$sitelib"; then
6911 d_sitearch="$define"
6914 : Set the vendorprefix variables
6917 The installation process will also create a directory for
6918 vendor-supplied add-ons. Vendors who supply perl with their system
6919 may find it convenient to place all vendor-supplied files in this
6920 directory rather than in the main distribution directory. This will
6921 ease upgrades between binary-compatible maintenance versions of perl.
6923 Of course you may also use these directories in whatever way you see
6924 fit. For example, you might use them to access modules shared over a
6925 company-wide network.
6927 The default answer should be fine for most people.
6928 This causes further questions about vendor add-ons to be skipped
6929 and no vendor-specific directories will be configured for perl.
6932 rp='Do you want to configure vendor-specific add-on directories?'
6933 case "$usevendorprefix" in
6934 define|true|[yY]*) dflt=y ;;
6935 *) : User may have set vendorprefix directly on Configure command line.
6936 case "$vendorprefix" in
6945 rp='Installation prefix to use for vendor-supplied add-ons?'
6946 case "$vendorprefix" in
6948 *) dflt=$vendorprefix ;;
6951 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6953 case "$vendorprefix" in
6957 *) oldvendorprefix="$prefix";;
6961 usevendorprefix="$define"
6963 vendorprefixexp="$ansexp"
6965 *) usevendorprefix="$undef"
6971 : Set the vendorlib variables
6972 case "$vendorprefix" in
6973 '') d_vendorlib="$undef"
6977 *) d_vendorlib="$define"
6978 : determine where vendor-supplied modules go.
6979 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6980 case "$vendorlib" in
6982 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6983 case "$installstyle" in
6984 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6985 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6988 *) dflt="$vendorlib"
6992 rp='Pathname for the vendor-supplied library files?'
6995 vendorlibexp="$ansexp"
6998 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7002 : Set the vendorarch variables
7003 case "$vendorprefix" in
7004 '') d_vendorarch="$undef"
7008 *) d_vendorarch="$define"
7009 : determine where vendor-supplied architecture-dependent libraries go.
7010 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7011 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7012 : vendorlib may have an optional trailing /share.
7013 case "$vendorarch" in
7014 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7015 dflt="$dflt/$archname"
7017 *) dflt="$vendorarch" ;;
7020 rp='Pathname for vendor-supplied architecture-dependent files?'
7023 vendorarchexp="$ansexp"
7026 prefixvar=vendorarch
7028 if $test X"$vendorarch" = X"$vendorlib"; then
7029 d_vendorarch="$undef"
7031 d_vendorarch="$define"
7034 : Final catch-all directories to search
7037 Lastly, you can have perl look in other directories for extensions and
7038 modules in addition to those already specified.
7039 These directories will be searched after
7043 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7044 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7046 case "$otherlibdirs" in
7047 ''|' ') dflt='none' ;;
7048 *) dflt="$otherlibdirs" ;;
7051 Enter a colon-separated set of extra paths to include in perl's @INC
7052 search path, or enter 'none' for no extra paths.
7056 rp='Colon-separated list of additional directories for perl to search?'
7059 ' '|''|none) otherlibdirs=' ' ;;
7060 *) otherlibdirs="$ans" ;;
7062 case "$otherlibdirs" in
7066 set d_perl_otherlibdirs
7069 : Cruising for prototypes
7071 echo "Checking out function prototypes..." >&4
7072 $cat >prototype.c <<EOCP
7077 int main(int argc, char *argv[]) {
7080 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7081 echo "Your C compiler appears to support function prototypes."
7084 echo "Your C compiler doesn't seem to understand function prototypes."
7091 : Check if ansi2knr is required
7092 case "$prototype" in
7094 *) ansi2knr='ansi2knr'
7099 This version of $package can only be compiled by a compiler that
7100 understands function prototypes. Unfortunately, your C compiler
7102 doesn't seem to understand them. Sorry about that.
7104 If GNU cc is available for your system, perhaps you could try that instead.
7106 Eventually, we hope to support building Perl with pre-ANSI compilers.
7107 If you would like to help in that effort, please contact <perlbug@perl.org>.
7109 Aborting Configure now.
7116 dflt_dtrace='/usr/sbin/dtrace'
7119 Perl can be built to support DTrace on platforms that support it.
7120 DTrace is a diagnosis and performance analysis tool from Sun.
7122 If this doesn't make any sense to you, just accept the default '$dflt'.
7126 case "$usedtrace" in
7132 dflt_dtrace=$usedtrace
7139 rp='Support DTrace if available?'
7142 y|Y) val="$define" ;;
7148 test "X$usedtrace" != "X$define" && break
7151 rp='Where is the dtrace executable?'
7160 if $dtrace -h -s ../perldtrace.d \
7161 -o perldtrace.tmp >/dev/null 2>&1 \
7162 && rm -f perldtrace.tmp
7165 echo "Good: your $dtrace knows about the -h flag."
7169 *** $me: Fatal Error: $dtrace doesn't support -h flag
7171 *** Your installed dtrace doesn't support the -h switch to compile a D
7172 *** program into a C header. Can't continue.
7184 *** $me: Fatal Error: $dtrace not found.
7191 echo "*** $dtrace was not found."
7197 : See if we want extra modules installed
7204 Perl can be built with extra modules or bundles of modules which
7205 will be fetched from the CPAN and installed alongside Perl.
7207 Notice that you will need access to the CPAN; either via the Internet,
7208 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7209 be asked later to configure the CPAN.pm module which will in turn do
7210 the installation of the rest of the extra modules or bundles.)
7212 Notice also that if the modules require any external software such as
7213 libraries and headers (the libz library and the zlib.h header for the
7214 Compress::Zlib module, for example) you MUST have any such software
7215 already installed, this configuration process will NOT install such
7218 If this doesn't make any sense to you, just accept the default '$dflt'.
7220 rp='Install any extra modules (y or n)?'
7226 Please list any extra modules or bundles to be installed from CPAN,
7227 with spaces between the names. The names can be in any format the
7228 'install' command of CPAN.pm will understand. (Answer 'none',
7229 without the quotes, to install no extra modules or bundles.)
7239 $rm -f ../extras.lst
7241 *) echo "(Saving the list of extras for later...)"
7242 echo "$extras" > ../extras.lst
7250 : determine where html pages for programs go
7251 set html1dir html1dir none
7255 If you wish to install html files for programs in $spackage, indicate
7256 the appropriate directory here. To skip installing html files,
7260 ''|none|$undef|' ') dflt=none ;;
7261 *) dflt=$html1dir ;;
7264 rp="Directory for the main $spackage html pages?"
7268 : Use ' ' for none so value is preserved next time through Configure
7269 $test X"$html1dir" = "X" && html1dir=' '
7271 : determine where html pages for libraries and modules go
7272 set html3dir html3dir none
7276 If you wish to install html files for modules associated with $spackage,
7277 indicate the appropriate directory here. To skip installing html files,
7280 : There is no obvious default. If they have specified html1dir, then
7281 : try to key off that, possibly changing .../html1 into .../html3.
7283 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7284 *) dflt=$html3dir ;;
7287 rp="Directory for the $spackage module html pages?"
7291 : Use ' ' for none so value is preserved next time through Configure
7292 $test X"$html3dir" = "X" && html3dir=' '
7294 : determine whether to install perl also as /usr/bin/perl
7297 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7299 Many scripts expect perl to be installed as /usr/bin/perl.
7301 If you want to, I can install the perl you are about to compile
7302 as /usr/bin/perl (in addition to $bin/perl).
7304 if test -f /usr/bin/perl; then
7307 However, please note that because you already have a /usr/bin/perl,
7308 overwriting that with a new Perl would very probably cause problems.
7309 Therefore I'm assuming you don't want to do that (unless you insist).
7312 case "$installusrbinperl" in
7313 "$define"|[yY]*) dflt='y';;
7319 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7322 case "$installusrbinperl" in
7323 "$undef"|[nN]*) dflt='n';;
7327 rp="Do you want to install perl as /usr/bin/perl?"
7330 [yY]*) val="$define";;
7336 set installusrbinperl
7339 : Check if we are using the GNU C library
7341 echo "Checking for GNU C Library..." >&4
7343 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7344 alone are insufficient to distinguish different versions, such as
7345 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7346 libc version 2.1.0. A. Dougherty, June 3, 2002.
7352 # ifdef __GLIBC_MINOR__
7353 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7354 # include <gnu/libc-version.h>
7355 printf("%s\n", gnu_get_libc_version());
7357 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7360 printf("%d\n", __GLIBC__);
7369 if eval $compile_ok && $run ./try > glibc.ver; then
7371 gnulibc_version=`$cat glibc.ver`
7372 echo "You are using the GNU C Library version $gnulibc_version"
7376 echo "You are not using the GNU C Library"
7382 : see if nm is to be used to determine whether a symbol is defined or not
7386 case "$d_gnulibc" in
7389 echo "nm probably won't work on the GNU C Library." >&4
7395 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7397 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7398 echo "'nm' won't be sufficient on this sytem." >&4
7404 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7405 if $test $dflt -gt 20; then
7415 true|$define) dflt=y;;
7422 I can use $nm to extract the symbols from your C libraries. This
7423 is a time consuming task which may generate huge output on the disk (up
7424 to 3 megabytes) but that should make the symbols extraction faster. The
7425 alternative is to skip the 'nm' extraction part and to compile a small
7426 test program instead to determine whether each symbol is present. If
7427 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7428 this may be the best solution.
7430 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7433 rp="Shall I use $nm to extract C symbols from the libraries?"
7436 [Nn]*) usenm=false;;
7445 : nm options which may be necessary
7447 '') if $test -f /mach_boot; then
7449 elif $test -d /usr/ccs/lib; then
7450 nm_opt='-p' # Solaris (and SunOS?)
7451 elif $test -f /dgux; then
7453 elif $test -f /lib64/rld; then
7454 nm_opt='-p' # 64-bit Irix
7460 : nm options which may be necessary for shared libraries but illegal
7461 : for archive libraries. Thank you, Linux.
7462 case "$nm_so_opt" in
7463 '') case "$myuname" in
7465 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7466 nm_so_opt='--dynamic'
7473 : Figure out where the libc is located
7476 : get list of predefined functions in a handy place
7481 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7487 *) for thislib in $libs; do
7490 : Handle C library specially below.
7493 thislib=`echo $thislib | $sed -e 's/^-l//'`
7494 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7496 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7498 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7500 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7502 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7504 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7506 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7511 libnames="$libnames $try"
7513 *) libnames="$libnames $thislib" ;;
7522 for xxx in $libpth; do
7523 $test -r $1 || set $xxx/libc.$so
7524 : The messy sed command sorts on library version numbers.
7526 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7527 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7529 s/[0-9][0-9]*/0000&/g
7530 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7533 $sort | $sed -e 's/^.* //'`
7536 $test -r $1 || set /usr/ccs/lib/libc.$so
7537 $test -r $1 || set /lib/libsys_s$_a
7543 if $test -r "$1"; then
7544 echo "Your (shared) C library seems to be in $1."
7546 elif $test -r /lib/libc && $test -r /lib/clib; then
7547 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7549 libc='/lib/clib /lib/libc'
7550 if $test -r /lib/syslib; then
7551 echo "(Your math library is in /lib/syslib.)"
7552 libc="$libc /lib/syslib"
7554 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7555 echo "Your C library seems to be in $libc, as you said before."
7556 elif $test -r $incpath/usr/lib/libc$_a; then
7557 libc=$incpath/usr/lib/libc$_a;
7558 echo "Your C library seems to be in $libc. That's fine."
7559 elif $test -r /lib/libc$_a; then
7561 echo "Your C library seems to be in $libc. You're normal."
7563 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7565 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7566 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7567 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7569 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7571 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7574 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7576 if $test -r "$tans"; then
7577 echo "Your C library seems to be in $tans, of all places."
7583 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7587 If the guess above is wrong (which it might be if you're using a strange
7588 compiler, or your machine supports multiple models), you can override it here.
7593 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7595 I can't seem to find your C library. I've looked in the following places:
7598 $sed 's/^/ /' libpath
7601 None of these seems to contain your C library. I need to get its name...
7606 rp='Where is your C library?'
7611 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7612 set X `cat libnames`
7615 case $# in 1) xxx=file; esac
7616 echo "Extracting names from the following $xxx for later perusal:" >&4
7618 $sed 's/^/ /' libnames >&4
7620 $echo $n "This may take a while...$c" >&4
7624 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7625 *) $nm $nm_opt $file 2>/dev/null;;
7630 $grep fprintf libc.tmp > libc.ptf
7631 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7632 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7634 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7636 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7638 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7640 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7642 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7644 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7646 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7648 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7650 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7652 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7654 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7656 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7658 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7659 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7661 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7663 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7665 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7667 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7669 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7671 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7673 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7675 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7677 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7679 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7681 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7683 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7685 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7687 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7689 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7692 $nm -p $* 2>/dev/null >libc.tmp
7693 $grep fprintf libc.tmp > libc.ptf
7694 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7695 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7701 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7703 if $ar t $libc > libc.tmp && \
7704 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7706 for thisname in $libnames $libc; do
7707 $ar t $thisname >>libc.tmp
7709 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7711 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7712 for thisname in $libnames $libc; do
7713 $ar tv $thisname >>libc.tmp
7714 emximp -o tmp.imp $thisname \
7716 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7717 < tmp.imp >>libc.tmp
7720 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7723 echo "$ar didn't seem to work right." >&4
7724 echo "Maybe this is a Cray...trying bld instead..." >&4
7726 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7729 for thisname in $libnames; do
7731 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7732 $ar t $thisname >>libc.tmp
7736 echo "That didn't work either. Giving up." >&4
7746 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7747 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7749 *) if $test -f /lib/syscalls.exp; then
7751 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7752 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7753 /lib/syscalls.exp >>libc.list
7759 $rm -f libnames libpath
7761 : see if dld is available
7765 : Check if we are using C++
7767 echo "Checking for C++..." >&4
7768 $cat >try.c <<'EOCP'
7780 if eval $compile_ok && $run ./try; then
7782 echo "You are using a C++ compiler."
7785 echo "You are not using a C++ compiler."
7791 : is a C symbol defined?
7794 -v) tf=libc.tmp; tdc="";;
7795 -a) tf=libc.tmp; tdc="[]";;
7796 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7798 case "$d_cplusplus" in
7799 $define) extern_C="extern \"C\"" ;;
7800 *) extern_C="extern" ;;
7803 case "$reuseval-$4" in
7805 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7810 if $test "$runnm" = true; then
7811 if $contains $tlook $tf >/dev/null 2>&1; then
7813 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7814 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7815 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7816 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7820 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7821 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7827 $define) tval=true;;
7834 : define an is-in-libc? function
7835 inlibc='echo " "; td=$define; tu=$undef;
7836 sym=$1; var=$2; eval "was=\$$2";
7838 case "$reuseval$was" in
7848 echo "$sym() found." >&4;
7849 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7851 echo "$sym() NOT found." >&4;
7852 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7856 $define) echo "$sym() found." >&4;;
7857 *) echo "$sym() NOT found." >&4;;
7861 : see if dlopen exists
7863 xxx_ccflags="$ccflags"
7865 : with g++ one needs -shared to get is-in-libc to work for dlopen
7866 case "$gccversion" in
7868 *) case "$d_cplusplus" in
7869 "$define") ccflags="$ccflags -shared" ;;
7876 ccflags="$xxx_ccflags"
7878 : see if this is a unistd.h system
7879 set unistd.h i_unistd
7882 : determine which dynamic loading, if any, to compile in
7884 dldir="ext/DynaLoader"
7897 $define) dflt='y' ;;
7900 $define) dflt='y' ;;
7902 : Does a dl_xxx.xs file exist for this operating system
7903 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7906 rp="Do you wish to use dynamic loading?"
7913 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7914 dflt="$dldir/dl_${osname}.xs"
7915 elif $test "$d_dlopen" = "$define" ; then
7916 dflt="$dldir/dl_dlopen.xs"
7917 elif $test "$i_dld" = "$define" ; then
7918 dflt="$dldir/dl_dld.xs"
7923 *) dflt="$dldir/$dlsrc"
7926 echo "The following dynamic loading files are available:"
7927 : Can not go over to $dldir because getfile has path hard-coded in.
7928 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7929 rp="Source file to use for dynamic loading"
7935 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7939 Some systems may require passing special flags to $cc -c to
7940 compile modules that will be used to create a shared library.
7941 To use no flags, say "none".
7944 case "$cccdlflags" in
7945 '') case "$gccversion" in
7946 '') case "$osname" in
7948 next) dflt='none' ;;
7949 irix*) dflt='-KPIC' ;;
7950 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7951 sunos) dflt='-pic' ;;
7955 *) case "$osname" in
7956 darwin) dflt='none' ;;
7957 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7962 *) dflt="$cccdlflags" ;;
7964 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7967 none) cccdlflags=' ' ;;
7968 *) cccdlflags="$ans" ;;
7973 Some systems use ld to create libraries that can be dynamically loaded,
7974 while other systems (such as those using ELF) use $cc.
7978 '') $cat >try.c <<EOM
7979 /* Test for whether ELF binaries are produced */
7991 int i = open("a.out",O_RDONLY);
7994 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7995 exit(0); /* succeed (yes, it's ELF) */
8000 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8002 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8006 echo "I'll use ld to build dynamic libraries."
8015 rp="What command should be used to create dynamic libraries?"
8021 Some systems may require passing special flags to $ld to create a
8022 library that can be dynamically loaded. If your ld flags include
8023 -L/other/path options to locate libraries outside your loader's normal
8024 search path, you may need to specify those -L options here as well. To
8025 use no flags, say "none".
8028 case "$lddlflags" in
8029 '') case "$osname" in
8030 beos) dflt='-nostart' ;;
8031 haiku) dflt='-shared' ;;
8033 case "$gccversion" in
8034 '') dflt="$dflt +vnocompatwarnings" ;;
8037 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8038 next) dflt='none' ;;
8039 solaris) dflt='-G' ;;
8040 sunos) dflt='-assert nodefinitions' ;;
8041 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8045 *) dflt="$lddlflags" ;;
8048 : Try to guess additional flags to pick up local libraries.
8049 : Be careful not to append to a plain 'none'
8053 for thisflag in $ldflags; do
8058 *) dflt="$dflt $thisflag" ;;
8065 ''|' ') dflt='none' ;;
8069 *-fstack-protector*)
8071 *-fstack-protector*) ;; # Don't add it again
8072 *) dflt="$dflt -fstack-protector" ;;
8078 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8081 none) lddlflags=' ' ;;
8082 *) lddlflags="$ans" ;;
8087 Some systems may require passing special flags to $cc to indicate that
8088 the resulting executable will use dynamic linking. To use no flags,
8092 case "$ccdlflags" in
8093 '') case "$osname" in
8094 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8095 next|sunos) dflt='none' ;;
8099 *) dflt="$ccdlflags" ;;
8101 rp="Any special flags to pass to $cc to use dynamic linking?"
8104 none) ccdlflags=' ' ;;
8105 *) ccdlflags="$ans" ;;
8116 : Do we want a shared libperl?
8120 # No dynamic loading being used, so don't bother even to prompt.
8123 *) case "$useshrplib" in
8124 '') case "$osname" in
8125 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|haiku|cygwin*)
8127 also='Building a shared libperl is required for dynamic loading to work on your system.'
8132 also='Building a shared libperl is needed for MAB support.'
8150 The perl executable is normally obtained by linking perlmain.c with
8151 libperl${_a}, any static extensions (usually just DynaLoader), and
8152 any other libraries needed on this system (such as -lm, etc.). Since
8153 your system supports dynamic loading, it is probably possible to build
8154 a shared libperl.$so. If you will have more than one executable linked
8155 to libperl.$so, this will significantly reduce the size of each
8156 executable, but it may have a noticeable effect on performance. The
8157 default is probably sensible for your system.
8161 rp="Build a shared libperl.$so (y/n)"
8165 useshrplib='true' ;;
8166 *) useshrplib='false' ;;
8171 case "$useshrplib" in
8175 # Figure out a good name for libperl.so. Since it gets stored in
8176 # a version-specific architecture-dependent library, the version
8177 # number isn't really that important, except for making cc/ld happy.
8179 # A name such as libperl.so.10.1
8180 majmin="libperl.$so.$patchlevel.$subversion"
8181 # A name such as libperl.so.100
8182 majonly=`echo $patchlevel $subversion |
8183 $awk '{printf "%d%02d", $1, $2}'`
8184 majonly=libperl.$so.$majonly
8185 # I'd prefer to keep the os-specific stuff here to a minimum, and
8186 # rely on figuring it out from the naming of libc.
8187 case "${osname}${osvers}" in
8190 # XXX How handle the --version stuff for MAB?
8192 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8195 cygwin*) # ld links now against the dll directly
8196 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8197 majonly=`echo $patchlevel $subversion |
8198 $awk '{printf "%03d%03d", $1, $2}'`
8199 majonly=cygperl5.$majonly.$so
8202 *) # Try to guess based on whether libc has major.minor.
8204 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8205 *libc.$so.[0-9]*) dflt=$majonly ;;
8206 *) dflt=libperl.$so ;;
8216 I need to select a good name for the shared libperl. If your system uses
8217 library names with major and minor numbers, then you might want something
8218 like $majmin. Alternatively, if your system uses a single version
8219 number for shared libraries, then you might want to use $majonly.
8220 Or, your system might be quite happy with a simple libperl.$so.
8222 Since the shared libperl will get installed into a version-specific
8223 architecture-dependent directory, the version number of the shared perl
8224 library probably isn't important, so the default should be o.k.
8227 rp='What name do you want to give to the shared libperl?'
8230 echo "Ok, I'll use $libperl"
8233 libperl="libperl${_a}"
8237 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8241 WARNING: Use of the shrpdir variable for the installation location of
8242 the shared $libperl is not supported. It was never documented and
8243 will not work in this version. Let me (perlbug@perl.org)
8244 know of any problems this may cause.
8250 But your current setting of $shrpdir is
8251 the default anyway, so it's harmless.
8256 Further, your current attempted setting of $shrpdir
8257 conflicts with the value of $archlibexp/CORE
8258 that installperl will use.
8265 # How will the perl executable find the installed shared $libperl?
8266 # Add $xxx to ccdlflags.
8267 # If we can't figure out a command-line option, use $shrpenv to
8268 # set env LD_RUN_PATH. The main perl makefile uses this.
8269 shrpdir=$archlibexp/CORE
8272 if "$useshrplib"; then
8275 # We'll set it in Makefile.SH...
8280 freebsd|netbsd|openbsd|interix|dragonfly)
8281 xxx="-Wl,-R$shrpdir"
8283 bsdos|linux|irix*|dec_osf|gnu*)
8284 xxx="-Wl,-rpath,$shrpdir"
8287 # next doesn't like the default...
8290 # beos doesn't like the default, either.
8293 # Haiku doesn't like the default, either.
8296 # hpux doesn't like the default, either.
8297 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8300 # cygwin needs only ldlibpth
8303 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8309 # Only add $xxx if it isn't already in ccdlflags.
8310 case " $ccdlflags " in
8312 *) ccdlflags="$ccdlflags $xxx"
8315 Adding $xxx to the flags
8316 passed to $ld so that the perl executable will find the
8317 installed shared $libperl.
8325 # Fix ccdlflags in AIX for building external extensions.
8326 # (For building Perl itself bare -bE:perl.exp is needed,
8327 # Makefile.SH takes care of this.)
8329 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8331 # Respect a hint or command-line value.
8333 '') shrpenv="$tmp_shrpenv" ;;
8335 case "$ldlibpthname" in
8336 '') ldlibpthname=LD_LIBRARY_PATH ;;
8337 none) ldlibpthname='' ;;
8340 : determine where manual pages are on this system
8344 syspath='/usr/share/man/man1 /usr/man/man1'
8345 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8346 syspath="$syspath /usr/man/u_man/man1"
8347 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8348 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8349 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8350 sysman=`./loc . /usr/man/man1 $syspath`
8353 if $test -d "$sysman"; then
8354 echo "System manual is in $sysman." >&4
8356 echo "Could not find manual pages in source form." >&4
8359 : determine where manual pages go
8360 set man1dir man1dir none
8364 $spackage has manual pages available in source form.
8368 echo "However, you don't have nroff, so they're probably useless to you."
8370 '') man1dir="none";;
8373 echo "If you don't want the manual sources installed, answer 'none'."
8378 lookpath="$prefixexp/share/man/man1"
8379 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8380 lookpath="$lookpath $prefixexp/man/p_man/man1"
8381 lookpath="$lookpath $prefixexp/man/u_man/man1"
8382 lookpath="$lookpath $prefixexp/man/man.1"
8384 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8385 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8395 rp="Where do the main $spackage manual pages (source) go?"
8397 if $test "X$man1direxp" != "X$ansexp"; then
8408 : What suffix to use on installed man pages
8415 rp="What suffix should be used for the main $spackage man pages?"
8417 '') case "$man1dir" in
8431 *) dflt="$man1ext";;
8438 : see if we can have long filenames
8440 first=123456789abcdef
8442 if (echo hi >$first) 2>/dev/null; then
8443 if $test -f 123456789abcde; then
8444 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8447 echo 'You can have filenames longer than 14 characters.'>&4
8452 You can't have filenames longer than 14 chars.
8453 You can't even think about them!
8459 $rm -rf 123456789abcde*
8461 : determine where library module manual pages go
8462 set man3dir man3dir none
8466 $spackage has manual pages for many of the library modules.
8472 However, you don't have nroff, so they're probably useless to you.
8475 '') man3dir="none";;
8479 case "$d_flexfnam" in
8482 However, your system can't handle the long file names like File::Basename.3.
8485 '') man3dir="none";;
8489 echo "If you don't want the manual sources installed, answer 'none'."
8490 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8492 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8493 if $test -d "$privlib/man/man3"; then
8496 WARNING: Previous versions of perl installed man3 pages into
8497 $privlib/man/man3. This version will suggest a
8498 new default of $dflt.
8502 rp='Do you wish to preserve the old behavior?(y/n)'
8505 y*) dflt="$privlib/man/man3" ;;
8510 *) dflt="$man3dir" ;;
8517 rp="Where do the $package library man pages (source) go?"
8527 : What suffix to use on installed man pages
8533 rp="What suffix should be used for the $package library man pages?"
8535 '') case "$man3dir" in
8549 *) dflt="$man3ext";;
8556 : see if we have to deal with yellow pages, now NIS.
8557 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8558 if $test -f /usr/etc/nibindd; then
8560 echo "I'm fairly confident you're on a NeXT."
8562 rp='Do you get the hosts file via NetInfo?'
8571 y*) hostcat='nidump hosts .';;
8572 *) case "$hostcat" in
8573 nidump*) hostcat='';;
8583 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8591 rp='Are you getting the hosts file via yellow pages?'
8594 y*) hostcat='ypcat hosts';;
8595 *) hostcat='cat /etc/hosts';;
8601 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8604 '') test -f /etc/group && groupcat='cat /etc/group';;
8607 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8610 : now get the host name
8612 echo "Figuring out host name..." >&4
8613 case "$myhostname" in
8615 echo 'Maybe "hostname" will work...'
8616 if tans=`sh -c hostname 2>&1` ; then
8624 if $test "$cont"; then
8626 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8627 if tans=`cat /etc/systemid 2>&1` ; then
8629 phostname='cat /etc/systemid'
8630 echo "Whadyaknow. Xenix always was a bit strange..."
8633 elif $test -r /etc/systemid; then
8634 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8637 if $test "$cont"; then
8638 echo 'No, maybe "uuname -l" will work...'
8639 if tans=`sh -c 'uuname -l' 2>&1` ; then
8641 phostname='uuname -l'
8643 echo 'Strange. Maybe "uname -n" will work...'
8644 if tans=`sh -c 'uname -n' 2>&1` ; then
8646 phostname='uname -n'
8648 echo 'Oh well, maybe I can mine it out of whoami.h...'
8649 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8650 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8651 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8653 case "$myhostname" in
8654 '') echo "Does this machine have an identity crisis or something?"
8657 echo "Well, you said $myhostname before..."
8658 phostname='echo $myhostname';;
8664 case "$myhostname" in
8665 '') myhostname=noname ;;
8667 : you do not want to know about this
8672 if $test "$myhostname" ; then
8674 rp='Your host name appears to be "'$myhostname'".'" Right?"
8682 : bad guess or no guess
8683 while $test "X$myhostname" = X ; do
8685 rp="Please type the (one word) name of your host:"
8690 : translate upper to lower if necessary
8691 case "$myhostname" in
8693 echo "(Normalizing case in your host name)"
8694 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8698 case "$myhostname" in
8700 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8701 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8702 echo "(Trimming domain name from host name--host name is now $myhostname)"
8704 *) case "$mydomain" in
8707 test "X$hostcat" = "Xypcat hosts" &&
8708 ypmatch "$myhostname" hosts 2>/dev/null |\
8709 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8712 test "X$hostcat" != "X" &&
8713 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8714 /[ ]$myhostname[ . ]/p" > hosts
8717 if $test -f hosts; then
8718 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8719 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8720 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8721 hosts | $sort | $uniq | \
8722 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8723 case `$echo X$dflt` in
8724 X*\ *) echo "(Several hosts in the database matched hostname)"
8727 X.) echo "(You do not have fully-qualified names in the hosts database)"
8731 echo "(I cannot locate a hosts database anywhere)"
8736 tans=`./loc resolv.conf X /etc /usr/etc`
8737 if $test -f "$tans"; then
8738 echo "(Attempting domain name extraction from $tans)"
8739 dflt=.`$sed -n -e 's/ / /g' \
8740 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8743 .) dflt=.`$sed -n -e 's/ / /g' \
8744 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8752 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8753 dflt=.`sh -c domainname 2>/dev/null`
8756 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8760 case "$dflt$osname" in
8761 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8762 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8766 .) echo "(Lost all hope -- silly guess then)"
8772 *) dflt="$mydomain";;
8776 rp="What is your domain name?"
8786 : translate upper to lower if necessary
8789 echo "(Normalizing case in your domain name)"
8790 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8794 : a little sanity check here
8795 case "$phostname" in
8798 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8799 $myhostname$mydomain|$myhostname) ;;
8801 case "$phostname" in
8803 echo "(That doesn't agree with your whoami.h file, by the way.)"
8806 echo "(That doesn't agree with your $phostname command, by the way.)"
8814 : determine the e-mail address of the user who is running us
8817 I need to get your e-mail address in Internet format if possible, i.e.
8818 something like user@host.domain. Please answer accurately since I have
8819 no easy means to double check it. The default value provided below
8820 is most probably close to reality but may not be valid from outside
8821 your organization...
8825 while test "$cont"; do
8827 '') dflt="$cf_by@$myhostname$mydomain";;
8828 *) dflt="$cf_email";;
8830 rp='What is your e-mail address?'
8836 rp='Address does not look like an Internet one. Use it anyway?'
8850 : Ask e-mail of administrator
8853 If you or somebody else will be maintaining perl at your site, please
8854 fill in the correct e-mail address here so that they may be contacted
8855 if necessary. Currently, the "perlbug" program included with perl
8856 will send mail to this address in addition to perlbug@perl.org. You may
8857 enter "none" for no administrator.
8860 case "$perladmin" in
8861 '') dflt="$cf_email";;
8862 *) dflt="$perladmin";;
8864 rp='Perl administrator e-mail address'
8868 : determine whether to only install version-specific parts.
8871 Do you want to install only the version-specific parts of the perl
8872 distribution? Usually you do *not* want to do this.
8874 case "$versiononly" in
8875 "$define"|[Yy]*|true) dflt='y' ;;
8878 rp="Do you want to install only the version-specific parts of perl?"
8881 [yY]*) val="$define";;
8887 case "$versiononly" in
8888 "$define") inc_version_list=''
8889 inc_version_list_init=0
8893 : figure out how to guarantee perl startup
8894 : XXX Note that this currently takes advantage of the bug that binexp ignores
8895 : the Configure -Dinstallprefix setting, which in turn means that under
8896 : relocatable @INC, initialinstalllocation is what binexp started as.
8897 case "$startperl" in
8899 case "$sharpbang" in
8903 I can use the #! construct to start perl on your system. This will
8904 make startup of perl scripts faster, but may cause problems if you
8905 want to share those scripts and perl is not in a standard place
8906 ($initialinstalllocation/perl) on all your platforms. The alternative
8907 is to force a shell by starting the script with a single ':' character.
8910 case "$versiononly" in
8911 "$define") dflt="$initialinstalllocation/perl$version";;
8912 *) dflt="$initialinstalllocation/perl";;
8914 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8917 none) startperl=": # use perl";;
8918 *) startperl="#!$ans"
8919 if $test 30 -lt `echo "$ans" | wc -c`; then
8922 WARNING: Some systems limit the #! command to 32 characters.
8923 If you experience difficulty running Perl scripts with #!, try
8924 installing Perl in a directory with a shorter pathname.
8930 *) startperl=": # use perl"
8935 echo "I'll use $startperl to start perl scripts."
8937 : figure best path for perl in scripts
8940 case "$versiononly" in
8941 "$define") perlpath="$initialinstalllocation/perl$version";;
8942 *) perlpath="$initialinstalllocation/perl";;
8944 case "$startperl" in
8949 I will use the "eval 'exec'" idiom to start Perl on your system.
8950 I can use the full path of your Perl binary for this purpose, but
8951 doing so may cause problems if you want to share those scripts and
8952 Perl is not always in a standard place ($initialinstalllocation/perl).
8955 dflt="$initialinstalllocation/perl"
8956 rp="What path shall I use in \"eval 'exec'\"?"
8963 case "$startperl" in
8965 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8968 : determine where public executable scripts go
8969 set scriptdir scriptdir
8971 case "$scriptdir" in
8974 : guess some guesses
8975 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8976 $test -d /usr/share/bin && dflt=/usr/share/bin
8977 $test -d /usr/local/script && dflt=/usr/local/script
8978 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8979 $test -d $prefixexp/script && dflt=$prefixexp/script
8983 *) dflt="$scriptdir"
8988 Some installations have a separate directory just for executable scripts so
8989 that they can mount it across multiple architectures but keep the scripts in
8990 one spot. You might, for example, have a subdirectory of /usr/share for this.
8991 Or you might just lump your scripts in with all your other executables.
8995 rp='Where do you keep publicly executable scripts?'
8997 if $test "X$ansexp" != "X$scriptdirexp"; then
9003 : A little fix up for an irregularly named variable.
9004 installscript="$installscriptdir"
9006 : determine where add-on public executables go
9008 '') dflt=$siteprefix/bin ;;
9012 rp='Pathname where the add-on public executables should be installed?'
9017 : determine where add-on html pages go
9018 : There is no standard location, so try to copy the previously-selected
9019 : directory structure for the core html pages.
9020 case "$sitehtml1dir" in
9021 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9022 *) dflt=$sitehtml1dir ;;
9025 ''|' ') dflt=none ;;
9028 rp='Pathname where the site-specific html pages should be installed?'
9030 prefixvar=sitehtml1dir
9033 : determine where add-on library html pages go
9034 : There is no standard location, so try to copy the previously-selected
9035 : directory structure for the core html pages.
9036 case "$sitehtml3dir" in
9037 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9038 *) dflt=$sitehtml3dir ;;
9041 ''|' ') dflt=none ;;
9044 rp='Pathname where the site-specific library html pages should be installed?'
9046 prefixvar=sitehtml3dir
9049 : determine where add-on manual pages go
9050 case "$siteman1dir" in
9051 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9052 *) dflt=$siteman1dir ;;
9055 ''|' ') dflt=none ;;
9058 rp='Pathname where the site-specific manual pages should be installed?'
9060 prefixvar=siteman1dir
9063 : determine where add-on library man pages go
9064 case "$siteman3dir" in
9065 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9066 *) dflt=$siteman3dir ;;
9069 ''|' ') dflt=none ;;
9072 rp='Pathname where the site-specific library manual pages should be installed?'
9074 prefixvar=siteman3dir
9077 : determine where add-on public executable scripts go
9078 case "$sitescript" in
9079 '') dflt=$siteprefix/script
9080 $test -d $dflt || dflt=$sitebin ;;
9081 *) dflt="$sitescript" ;;
9084 rp='Pathname where add-on public executable scripts should be installed?'
9086 prefixvar=sitescript
9089 : Check if faststdio is requested and available
9090 case "$usefaststdio" in
9091 $define|true|[yY]*|'')
9092 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9102 Perl can be built to use 'fast stdio', which means using the stdio
9103 library but also directly manipulating the stdio buffers to enable
9104 faster I/O. Using stdio is better for backward compatibility (especially
9105 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9106 interface has been preferred instead of stdio.
9108 If this doesn't make any sense to you, just accept the default '$dflt'.
9110 rp='Use the "fast stdio" if available?'
9113 y|Y) val="$define" ;;
9120 : define an is-a-typedef? function
9121 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9123 "") inclist="sys/types.h";;
9125 eval "varval=\$$var";
9129 for inc in $inclist; do
9130 echo "#include <$inc>" >>temp.c;
9132 echo "#ifdef $type" >> temp.c;
9133 echo "printf(\"We have $type\");" >> temp.c;
9134 echo "#endif" >> temp.c;
9135 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9136 if $contains $type temp.E >/dev/null 2>&1; then
9142 *) eval "$var=\$varval";;
9145 : define an is-a-typedef? function that prompts if the type is not available.
9146 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9148 "") inclist="sys/types.h";;
9150 eval "varval=\$$var";
9154 for inc in $inclist; do
9155 echo "#include <$inc>" >>temp.c;
9157 echo "#ifdef $type" >> temp.c;
9158 echo "printf(\"We have $type\");" >> temp.c;
9159 echo "#endif" >> temp.c;
9160 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9162 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9163 if $contains $type temp.E >/dev/null 2>&1; then
9164 echo "$type found." >&4;
9167 echo "$type NOT found." >&4;
9173 *) eval "$var=\$varval";;
9176 : see what type lseek is declared as in the kernel
9177 rp="What is the type used for lseek's offset on this system?"
9178 set off_t lseektype long stdio.h sys/types.h
9182 echo "Checking to see how big your file offsets are..." >&4
9184 #include <sys/types.h>
9188 printf("%d\n", (int)sizeof($lseektype));
9193 if eval $compile_ok; then
9194 lseeksize=`$run ./try`
9195 echo "Your file offsets are $lseeksize bytes long."
9199 echo "(I can't seem to compile the test program. Guessing...)"
9200 rp="What is the size of your file offsets (in bytes)?"
9206 : see what type file positions are declared as in the library
9207 rp="What is the type for file position used by fsetpos()?"
9208 set fpos_t fpostype long stdio.h sys/types.h
9211 : Check size for Fpos_t
9214 *_t) zzz="$fpostype" ;;
9217 echo "Checking the size of $zzz..." >&4
9219 #include <sys/types.h>
9226 printf("%d\n", (int)sizeof($fpostype));
9231 if eval $compile_ok; then
9235 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9238 echo "Your $zzz is $fpossize bytes long."
9244 echo "(I can't compile the test program. Guessing...)" >&4
9245 rp="What is the size of your file positions (in bytes)?"
9250 : Check for large file support
9251 # Backward compatibility (uselfs is deprecated).
9253 "$define"|true|[yY]*)
9256 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9258 uselargefiles="$define"
9262 case "$lseeksize:$fpossize" in
9265 You can have files larger than 2 gigabytes.
9268 *) case "$uselargefiles" in
9269 "$undef"|false|[nN]*) dflt='n' ;;
9274 Perl can be built to understand large files (files larger than 2 gigabytes)
9275 on some systems. To do so, Configure can be run with -Duselargefiles.
9277 If this doesn't make any sense to you, just accept the default '$dflt'.
9279 rp='Try to understand large files, if available?'
9282 y|Y) val="$define" ;;
9289 : Look for a hint-file generated 'call-back-unit'. If the
9290 : user has specified that a large files perl is to be built,
9291 : we may need to set or change some other defaults.
9292 if $test -f uselargefiles.cbu; then
9293 echo "Your platform has some specific hints regarding large file builds, using them..."
9294 . ./uselargefiles.cbu
9296 case "$uselargefiles" in
9298 if $test -f uselargefiles.cbu; then
9300 echo "Rechecking to see how big your file offsets are..." >&4
9302 #include <sys/types.h>
9306 printf("%d\n", (int)sizeof($lseektype));
9311 if eval $compile_ok; then
9312 lseeksize=`$run ./try`
9313 $echo "Your file offsets are now $lseeksize bytes long."
9317 echo "(I can't seem to compile the test program. Guessing...)"
9318 rp="What is the size of your file offsets (in bytes)?"
9323 *_t) zzz="$fpostype" ;;
9326 $echo $n "Rechecking the size of $zzz...$c" >&4
9328 #include <sys/types.h>
9335 printf("%d\n", (int)sizeof($fpostype));
9340 if eval $compile_ok; then
9345 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9348 echo " $fpossize bytes." >&4
9354 echo "(I can't compile the test program. Guessing...)" >&4
9355 rp="What is the size of your file positions (in bytes)?"
9364 : Set the vendorbin variables
9365 case "$vendorprefix" in
9366 '') d_vendorbin="$undef"
9370 *) d_vendorbin="$define"
9371 : determine where vendor-supplied executables go.
9372 case "$vendorbin" in
9373 '') dflt=$vendorprefix/bin ;;
9374 *) dflt="$vendorbin" ;;
9377 rp='Pathname for the vendor-supplied executables directory?'
9380 vendorbinexp="$ansexp"
9386 : Set the vendorhtml1dir variables
9387 case "$vendorprefix" in
9388 '') vendorhtml1dir=''
9389 vendorhtml1direxp=''
9391 *) : determine where vendor-supplied html pages go.
9392 : There is no standard location, so try to copy the previously-selected
9393 : directory structure for the core html pages.
9394 : XXX Better default suggestions would be welcome.
9395 case "$vendorhtml1dir" in
9396 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9397 *) dflt=$vendorhtml1dir ;;
9400 ''|' ') dflt=none ;;
9403 rp='Pathname for the vendor-supplied html pages?'
9405 vendorhtml1dir="$ans"
9406 vendorhtml1direxp="$ansexp"
9409 : Use ' ' for none so value is preserved next time through Configure
9410 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9411 prefixvar=vendorhtml1dir
9414 : Set the vendorhtml3dir variables
9415 case "$vendorprefix" in
9416 '') vendorhtml3dir=''
9417 vendorhtml3direxp=''
9419 *) : determine where vendor-supplied module html pages go.
9420 : There is no standard location, so try to copy the previously-selected
9421 : directory structure for the core html pages.
9422 : XXX Better default suggestions would be welcome.
9423 case "$vendorhtml3dir" in
9424 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9425 *) dflt=$vendorhtml3dir ;;
9428 ''|' ') dflt=none ;;
9431 rp='Pathname for the vendor-supplied html pages?'
9433 vendorhtml3dir="$ans"
9434 vendorhtml3direxp="$ansexp"
9437 : Use ' ' for none so value is preserved next time through Configure
9438 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9439 prefixvar=vendorhtml3dir
9442 : Set the vendorman1dir variables
9443 case "$vendorprefix" in
9444 '') vendorman1dir=''
9447 *) : determine where vendor-supplied manual pages go.
9448 case "$vendorman1dir" in
9449 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9450 *) dflt=$vendorman1dir ;;
9453 ''|' ') dflt=none ;;
9456 rp='Pathname for the vendor-supplied manual section 1 pages?'
9458 vendorman1dir="$ans"
9459 vendorman1direxp="$ansexp"
9462 : Use ' ' for none so value is preserved next time through Configure
9463 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9464 prefixvar=vendorman1dir
9467 : Set the vendorman3dir variables
9468 case "$vendorprefix" in
9469 '') vendorman3dir=''
9472 *) : determine where vendor-supplied module manual pages go.
9473 case "$vendorman3dir" in
9474 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9475 *) dflt=$vendorman3dir ;;
9478 ''|' ') dflt=none ;;
9481 rp='Pathname for the vendor-supplied manual section 3 pages?'
9483 vendorman3dir="$ans"
9484 vendorman3direxp="$ansexp"
9487 : Use ' ' for none so value is preserved next time through Configure
9488 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9489 prefixvar=vendorman3dir
9492 : Set the vendorscript variables
9493 case "$vendorprefix" in
9494 '') d_vendorscript="$undef"
9498 *) d_vendorscript="$define"
9499 : determine where vendor-supplied scripts go.
9500 case "$vendorscript" in
9501 '') dflt=$vendorprefix/script
9502 $test -d $dflt || dflt=$vendorbin ;;
9503 *) dflt="$vendorscript" ;;
9507 The installation process will create a directory for
9508 vendor-supplied scripts.
9512 rp='Pathname for the vendor-supplied scripts directory?'
9515 vendorscriptexp="$ansexp"
9518 prefixvar=vendorscript
9521 : script used to emit important warnings
9524 if test \$# -gt 0; then
9529 echo "*** WARNING:" >&4
9530 sed -e 's/^/*** /' <msg >&4
9532 cat msg >>config.msg
9533 echo " " >>config.msg
9539 : see which of string.h or strings.h is needed
9541 strings=`./findhdr string.h`
9542 if $test "$strings" && $test -r "$strings"; then
9543 echo "Using <string.h> instead of <strings.h>." >&4
9547 strings=`./findhdr strings.h`
9548 if $test "$strings" && $test -r "$strings"; then
9549 echo "Using <strings.h> instead of <string.h>." >&4
9551 ./warn "No string header found -- You'll surely have problems."
9557 "$undef") strings=`./findhdr strings.h`;;
9558 *) strings=`./findhdr string.h`;;
9561 : see if qgcvt exists
9565 : Check print/scan long double stuff
9568 if $test X"$d_longdbl" = X"$define"; then
9570 echo "Checking how to print long doubles..." >&4
9572 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9573 $cat >try.c <<'EOCP'
9574 #include <sys/types.h>
9578 printf("%.3f\n", d);
9582 if eval $compile; then
9586 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9587 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9588 echo "We will use %f."
9594 if $test X"$sPRIfldbl" = X; then
9595 $cat >try.c <<'EOCP'
9596 #include <sys/types.h>
9599 long double d = 123.456;
9600 printf("%.3Lf\n", d);
9604 if eval $compile; then
9608 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9609 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9610 echo "We will use %Lf."
9616 if $test X"$sPRIfldbl" = X; then
9617 $cat >try.c <<'EOCP'
9618 #include <sys/types.h>
9621 long double d = 123.456;
9622 printf("%.3llf\n", d);
9626 if eval $compile; then
9630 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9631 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9632 echo "We will use %llf."
9638 if $test X"$sPRIfldbl" = X; then
9639 $cat >try.c <<'EOCP'
9640 #include <sys/types.h>
9643 long double d = 123.456;
9644 printf("%.3lf\n", d);
9648 if eval $compile; then
9652 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9653 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9654 echo "We will use %lf."
9660 if $test X"$sPRIfldbl" = X; then
9661 echo "Cannot figure out how to print long doubles." >&4
9663 sSCNfldbl=$sPRIfldbl # expect consistency
9670 case "$sPRIfldbl" in
9671 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9672 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9673 d_SCNfldbl="$undef";
9675 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9676 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9677 d_SCNfldbl="$define";
9681 : Check how to convert floats to strings.
9683 if test "X$d_Gconvert" = X; then
9686 echo "Checking for an efficient way to convert floats to strings."
9688 case "$uselongdouble" in
9689 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9691 case "$d_longdbl" in
9692 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9694 case "$d_PRIgldbl" in
9695 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9699 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9700 char *myname = "gconvert";
9703 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9704 char *myname = "gcvt";
9707 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9708 char *myname = "qgcvt";
9709 #define DOUBLETYPE long double
9712 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9714 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9716 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9719 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9721 char *myname = "sprintf";
9725 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9726 #define DOUBLETYPE long double
9728 #define DOUBLETYPE double
9740 # include <string.h>
9742 # include <strings.h>
9745 int checkit(char *expect, char *got)
9747 if (strcmp(expect, got)) {
9748 printf("%s oddity: Expected %s, got %s\n",
9749 myname, expect, got);
9759 /* This must be 1st test on (which?) platform */
9760 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9761 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9762 checkit("0.1", buf);
9764 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9765 checkit("0.01", buf);
9767 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9768 checkit("0.001", buf);
9770 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9771 checkit("0.0001", buf);
9773 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9774 if (strlen(buf) > 5)
9775 checkit("9e-005", buf); /* for Microsoft ?? */
9777 checkit("9e-05", buf);
9779 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9782 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9783 checkit("1.1", buf);
9785 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9786 checkit("1.01", buf);
9788 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9789 checkit("1.001", buf);
9791 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9792 checkit("1.0001", buf);
9794 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9795 checkit("1.00001", buf);
9797 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9798 checkit("1.000001", buf);
9800 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9803 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9806 /* Some Linux gcvt's give 1.e+5 here. */
9807 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9808 checkit("100000", buf);
9810 /* Some Linux gcvt's give -1.e+5 here. */
9811 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9812 checkit("-100000", buf);
9814 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9815 checkit("123.456", buf);
9817 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9818 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9819 /* 34 should be enough to scare even long double
9820 * places into using the e notation. */
9821 if (strlen(buf) > 5)
9822 checkit("1e+034", buf); /* for Microsoft */
9824 checkit("1e+34", buf);
9826 /* For Perl, if you add additional tests here, also add them to
9827 * t/base/num.t for benefit of platforms not using Configure or
9828 * overriding d_Gconvert */
9833 : first add preferred functions to our list
9835 for xxx_convert in $gconvert_preference; do
9836 case $xxx_convert in
9837 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9838 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9841 : then add any others
9842 for xxx_convert in gconvert gcvt sprintf; do
9845 *) xxx_list="$xxx_list $xxx_convert" ;;
9849 case "$d_longdbl$uselongdouble" in
9851 : again, add prefered functions to our list first
9853 for xxx_convert in $gconvert_ld_preference; do
9854 case $xxx_convert in
9855 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9856 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9859 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9860 for xxx_convert in qgcvt sprintf $xxx_list; do
9861 case "$xxx_ld_list" in
9862 $xxx_convert*|*" $xxx_convert"*) ;;
9863 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9866 : if sprintf cannot do long doubles, move it to the end
9867 if test "$d_PRIgldbl" != "$define"; then
9868 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9870 : if no qgcvt, remove it
9871 if test "$d_qgcvt" != "$define"; then
9872 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9875 xxx_list="$xxx_ld_list"
9879 for xxx_convert in $xxx_list; do
9880 echo "Trying $xxx_convert..."
9881 $rm -f try try$_o core
9882 set try -DTRY_$xxx_convert
9883 if eval $compile; then
9884 echo "$xxx_convert() found." >&4
9886 echo "I'll use $xxx_convert to convert floats into a string." >&4
9889 echo "...But $xxx_convert didn't work as I expected."
9893 echo "$xxx_convert NOT found." >&4
9897 if test X$xxx_convert = X; then
9898 echo "*** WHOA THERE!!! ***" >&4
9899 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9903 case "$xxx_convert" in
9904 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9905 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9906 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9907 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9908 "$define$define$define")
9909 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9910 "$define$define$undef")
9911 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9912 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9920 : see if _fwalk exists
9924 : Initialize h_fcntl
9927 : Initialize h_sysfile
9930 : access call always available on UNIX
9934 : locate the flags for 'access()'
9938 $cat >access.c <<EOCP
9939 #include <sys/types.h>
9944 #include <sys/file.h>
9957 : check sys/file.h first, no particular reason here
9958 if $test `./findhdr sys/file.h` && \
9959 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9961 echo "<sys/file.h> defines the *_OK access constants." >&4
9962 elif $test `./findhdr fcntl.h` && \
9963 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9965 echo "<fcntl.h> defines the *_OK access constants." >&4
9966 elif $test `./findhdr unistd.h` && \
9967 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9968 echo "<unistd.h> defines the *_OK access constants." >&4
9970 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9976 : see if accessx exists
9977 set accessx d_accessx
9980 : see if aintl exists
9984 : see if alarm exists
9988 : see if 64bit time functions exists
9990 set ctime64 d_ctime64
9993 set localtime64 d_localtime64
9996 set gmtime64 d_gmtime64
9999 set mktime64 d_mktime64
10002 set difftime64 d_difftime64
10005 set asctime64 d_asctime64
10008 : see if POSIX threads are available
10009 set pthread.h i_pthread
10012 : define a fucntion to check prototypes
10013 $cat > protochk <<EOSH
10016 optimize="$optimize"
10018 prototype="$prototype"
10021 usethreads=$usethreads
10022 i_pthread=$i_pthread
10023 pthread_h_first=$pthread_h_first
10026 $cat >> protochk <<'EOSH'
10031 while test $# -ge 2; do
10033 $define) echo "#include <$2>" >> try.c ;;
10034 literal) echo "$2" >> try.c ;;
10036 # Extra magic for the benefit of systems that need pthread.h
10037 # to be included early to correctly detect threadsafe functions.
10038 # Such functions must guarantee themselves, though, that the usethreads
10039 # and i_pthread have been defined, before calling protochk.
10040 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10041 echo "#include <pthread.h>" >> try.c
10046 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10047 cat >> try.c <<'EOCP'
10048 #ifdef CAN_PROTOTYPE
10049 #define _(args) args
10054 echo "$foo" >> try.c
10055 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10056 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10062 $eunicefix protochk
10064 : Define hasproto macro for Configure internal use
10065 hasproto='varname=$1; func=$2; shift; shift;
10066 while $test $# -ge 2; do
10068 $define) echo "#include <$2>";;
10072 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10073 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10074 echo "$func() prototype found.";
10077 echo "$func() prototype NOT found.";
10084 : see if sys/types.h has to be included
10085 set sys/types.h i_systypes
10088 : see if sys/select.h has to be included
10089 set sys/select.h i_sysselct
10092 : Define hasfield macro for Configure internal use
10093 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10094 while $test $# -ge 2; do
10096 $define) echo "#include <$2>";;
10100 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10102 if eval $compile; then
10111 : see if we should include time.h, sys/time.h, or both
10113 if test "X$timeincl" = X; then
10114 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10115 $echo $n "I'm now running the test program...$c"
10117 #include <sys/types.h>
10122 #ifdef SYSTIMEKERNEL
10125 #include <sys/time.h>
10128 #include <sys/select.h>
10130 #$i_stdlib I_STDLIB
10132 #include <stdlib.h>
10138 struct timeval bar;
10141 struct timezone tzp;
10143 if (foo.tm_sec == foo.tm_sec)
10146 if (bar.tv_sec == bar.tv_sec)
10153 for s_timezone in '-DS_TIMEZONE' ''; do
10155 for s_timeval in '-DS_TIMEVAL' ''; do
10156 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10157 for i_time in '' '-DI_TIME'; do
10158 for i_systime in '-DI_SYSTIME' ''; do
10161 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10162 if eval $compile; then
10163 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10167 $echo $n "Succeeded with $flags$c"
10179 *SYSTIMEKERNEL*) i_systimek="$define"
10180 timeincl=`./findhdr sys/time.h`
10181 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10182 *) i_systimek="$undef";;
10185 *I_TIME*) i_time="$define"
10186 timeincl=`./findhdr time.h`" $timeincl"
10187 echo "We'll include <time.h>." >&4;;
10188 *) i_time="$undef";;
10191 *I_SYSTIME*) i_systime="$define"
10192 timeincl=`./findhdr sys/time.h`" $timeincl"
10193 echo "We'll include <sys/time.h>." >&4;;
10194 *) i_systime="$undef";;
10198 : see if struct tm knows about tm_zone
10199 case "$i_systime$i_time" in
10202 echo "Checking to see if your struct tm has tm_zone field..." >&4
10203 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10211 case "$d_tm_tm_zone" in
10212 "$define") echo "Yes, it does." ;;
10213 *) echo "No, it doesn't." ;;
10215 : see if struct tm knows about tm_gmtoff
10216 case "$i_systime$i_time" in
10219 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10220 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10228 case "$d_tm_tm_gmtoff" in
10229 "$define") echo "Yes, it does." ;;
10230 *) echo "No, it doesn't." ;;
10233 : see if asctime_r exists
10234 set asctime_r d_asctime_r
10236 case "$d_asctime_r" in
10238 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10239 case "$d_asctime_r_proto:$usethreads" in
10240 ":define") d_asctime_r_proto=define
10241 set d_asctime_r_proto asctime_r $hdrs
10245 case "$d_asctime_r_proto" in
10247 case "$asctime_r_proto" in
10248 ''|0) try='char* asctime_r(const struct tm*, char*);'
10249 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10251 case "$asctime_r_proto" in
10252 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10253 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10255 case "$asctime_r_proto" in
10256 ''|0) try='int asctime_r(const struct tm*, char*);'
10257 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10259 case "$asctime_r_proto" in
10260 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10261 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10263 case "$asctime_r_proto" in
10264 ''|0) d_asctime_r=undef
10266 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10267 * ) case "$asctime_r_proto" in
10268 REENTRANT_PROTO*) ;;
10269 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10271 echo "Prototype: $try" ;;
10274 *) case "$usethreads" in
10275 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10282 *) asctime_r_proto=0
10286 : see if atolf exists
10290 : see if atoll exists
10294 : Look for GCC-style attribute format
10295 case "$d_attribute_format" in
10298 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10299 $cat >attrib.c <<'EOCP'
10301 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10303 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10304 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10305 echo "Your C compiler doesn't support __attribute__((format))."
10308 echo "Your C compiler supports __attribute__((format))."
10312 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10316 *) val="$d_attribute_format" ;;
10318 set d_attribute_format
10322 : Look for GCC-style attribute format with null format allowed
10323 case "$d_printf_format_null" in
10324 '') case "$d_attribute_format" in
10327 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10328 $cat >attrib.c <<EOCP
10330 #$i_stdlib I_STDLIB
10332 #include <stdlib.h>
10334 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10335 int null_printf (char* pat,...) { return (int)pat; }
10336 int main () { exit(null_printf(NULL)); }
10338 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10339 : run the executable in case it produces a run-time warning
10340 if $run ./attrib >>attrib.out 2>&1; then
10341 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10342 echo "Your C compiler doesn't allow __printf__ format to be null."
10345 echo "Your C compiler allows __printf__ format to be null."
10349 echo "Your C compiler executable failed with __printf__ format null."
10353 echo "Your C compiler fails with __printf__ format null."
10360 *) val="$d_printf_format_null" ;;
10362 set d_printf_format_null
10366 : Look for GCC-style attribute malloc
10367 case "$d_attribute_malloc" in
10370 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10371 $cat >attrib.c <<'EOCP'
10373 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10375 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10376 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10377 echo "Your C compiler doesn't support __attribute__((malloc))."
10380 echo "Your C compiler supports __attribute__((malloc))."
10384 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10388 *) val="$d_attribute_malloc" ;;
10390 set d_attribute_malloc
10394 : Look for GCC-style attribute nonnull
10395 case "$d_attribute_nonnull" in
10398 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10399 $cat >attrib.c <<'EOCP'
10401 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10403 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10404 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10405 echo "Your C compiler doesn't support __attribute__((nonnull))."
10408 echo "Your C compiler supports __attribute__((nonnull))."
10412 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10416 *) val="$d_attribute_nonnull" ;;
10418 set d_attribute_nonnull
10422 : Look for GCC-style attribute noreturn
10423 case "$d_attribute_noreturn" in
10426 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10427 $cat >attrib.c <<'EOCP'
10429 void fall_over_dead( void ) __attribute__((noreturn));
10431 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10432 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10433 echo "Your C compiler doesn't support __attribute__((noreturn))."
10436 echo "Your C compiler supports __attribute__((noreturn))."
10440 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10444 *) val="$d_attribute_noreturn" ;;
10446 set d_attribute_noreturn
10450 : Look for GCC-style attribute pure
10451 case "$d_attribute_pure" in
10454 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10455 $cat >attrib.c <<'EOCP'
10457 int square( int n ) __attribute__((pure));
10459 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10460 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10461 echo "Your C compiler doesn't support __attribute__((pure))."
10464 echo "Your C compiler supports __attribute__((pure))."
10468 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10472 *) val="$d_attribute_pure" ;;
10474 set d_attribute_pure
10478 : Look for GCC-style attribute unused
10479 case "$d_attribute_unused" in
10482 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10483 $cat >attrib.c <<'EOCP'
10485 int do_something( int dummy __attribute__((unused)), int n );
10487 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10488 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10489 echo "Your C compiler doesn't support __attribute__((unused))."
10492 echo "Your C compiler supports __attribute__((unused))."
10496 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10500 *) val="$d_attribute_unused" ;;
10502 set d_attribute_unused
10506 : Look for GCC-style attribute deprecated
10507 case "$d_attribute_deprecated" in
10510 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10511 $cat >attrib.c <<'EOCP'
10513 int I_am_deprecated(void) __attribute__((deprecated));
10515 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10516 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10517 echo "Your C compiler doesn't support __attribute__((deprecated))."
10520 echo "Your C compiler supports __attribute__((deprecated))."
10524 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10528 *) val="$d_attribute_deprecated" ;;
10530 set d_attribute_deprecated
10534 : Look for GCC-style attribute warn_unused_result
10535 case "$d_attribute_warn_unused_result" in
10538 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10539 $cat >attrib.c <<'EOCP'
10541 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10543 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10544 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10545 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10548 echo "Your C compiler supports __attribute__((warn_unused_result))."
10552 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10556 *) val="$d_attribute_warn_unused_result" ;;
10558 set d_attribute_warn_unused_result
10562 : see if bcmp exists
10566 : see if bcopy exists
10570 : see if getpgrp exists
10571 set getpgrp d_getpgrp
10574 case "$d_getpgrp" in
10577 echo "Checking to see which flavor of getpgrp is in use..."
10579 #$i_unistd I_UNISTD
10580 #include <sys/types.h>
10582 # include <unistd.h>
10584 #$i_stdlib I_STDLIB
10586 #include <stdlib.h>
10590 if (getuid() == 0) {
10591 printf("(I see you are running Configure as super-user...)\n");
10594 #ifdef TRY_BSD_PGRP
10595 if (getpgrp(1) == 0)
10604 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10605 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10607 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10608 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10611 echo "I can't seem to compile and run the test program."
10613 xxx="a USG one, i.e. you use getpgrp()."
10615 # SVR4 systems can appear rather BSD-ish.
10616 case "$i_unistd" in
10618 xxx="a BSD one, i.e. you use getpgrp(pid)."
10622 xxx="probably a USG one, i.e. you use getpgrp()."
10627 echo "Assuming your getpgrp is $xxx" >&4
10636 : see if setpgrp exists
10637 set setpgrp d_setpgrp
10640 case "$d_setpgrp" in
10643 echo "Checking to see which flavor of setpgrp is in use..."
10645 #$i_unistd I_UNISTD
10646 #include <sys/types.h>
10648 # include <unistd.h>
10650 #$i_stdlib I_STDLIB
10652 #include <stdlib.h>
10656 if (getuid() == 0) {
10657 printf("(I see you are running Configure as super-user...)\n");
10660 #ifdef TRY_BSD_PGRP
10661 if (-1 == setpgrp(1, 1))
10664 if (setpgrp() != -1)
10670 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10671 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10673 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10674 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10677 echo "(I can't seem to compile and run the test program.)"
10679 xxx="a USG one, i.e. you use setpgrp()."
10681 # SVR4 systems can appear rather BSD-ish.
10682 case "$i_unistd" in
10684 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10688 xxx="probably a USG one, i.e. you use setpgrp()."
10693 echo "Assuming your setpgrp is $xxx" >&4
10702 : Look for GCC-style __builtin_choose_expr
10703 case "$d_builtin_choose_expr" in
10706 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10707 $cat >try.c <<'EOCP'
10708 #include <assert.h>
10709 #include <stdlib.h>
10712 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10715 assert( SYRINX(1) == 2112 );
10716 assert( SYRINX(1) != 5150 );
10717 assert( SYRINX(0) == 5150 );
10718 assert( SYRINX(0) != 2112 );
10719 puts( "All good!" );
10725 if eval $compile && $run ./try; then
10726 echo "Your C compiler supports __builtin_choose_expr."
10729 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10733 *) val="$d_builtin_choose_expr" ;;
10736 set d_builtin_choose_expr
10740 : Look for GCC-style __builtin_expect
10741 case "$d_builtin_expect" in
10744 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10745 $cat >try.c <<'EOCP'
10748 if ( __builtin_expect(n, 0) ) n = 1;
10749 /* Remember shell exit code truth is 0, C truth is non-zero */
10754 if eval $compile && $run ./try; then
10755 echo "Your C compiler supports __builtin_expect."
10758 echo "Your C compiler doesn't seem to understand __builtin_expect."
10762 *) val="$d_builtin_expect" ;;
10765 set d_builtin_expect
10769 : see if bzero exists
10773 : see if stdarg is available
10775 if $test `./findhdr stdarg.h`; then
10776 echo "<stdarg.h> found." >&4
10779 echo "<stdarg.h> NOT found." >&4
10783 : see if varags is available
10785 if $test `./findhdr varargs.h`; then
10786 echo "<varargs.h> found." >&4
10788 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10791 : set up the varargs testing programs
10792 $cat > varargs.c <<EOP
10794 #include <stdarg.h>
10797 #include <varargs.h>
10801 int f(char *p, ...)
10815 p = va_arg(ap, char *);
10821 $cat > varargs <<EOP
10823 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10832 : now check which varargs header should be included
10837 if `./varargs I_STDARG`; then
10839 elif `./varargs I_VARARGS`; then
10844 if `./varargs I_VARARGS`; then
10851 echo "I could not find the definition for va_dcl... You have problems..." >&4
10852 val="$undef"; set i_stdarg; eval $setvar
10853 val="$undef"; set i_varargs; eval $setvar
10858 case "$i_varhdr" in
10860 val="$define"; set i_stdarg; eval $setvar
10861 val="$undef"; set i_varargs; eval $setvar
10864 val="$undef"; set i_stdarg; eval $setvar
10865 val="$define"; set i_varargs; eval $setvar
10868 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10872 : see if the Compiler supports C99 variadic macros
10873 case "$i_stdarg$i_stdlib" in
10875 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10878 #include <stdarg.h>
10880 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10884 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10890 if eval $compile && $run ./try 2>&1 >/dev/null; then
10891 case "`$run ./try`" in
10893 echo "You have C99 variadic macros." >&4
10894 d_c99_variadic_macros="$define"
10897 echo "You don't have functional C99 variadic macros." >&4
10898 d_c99_variadic_macros="$undef"
10902 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10903 d_c99_variadic_macros="$undef"
10908 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10909 d_c99_variadic_macros="$undef"
10913 : see if signal is declared as pointer to function returning int or void
10915 xxx=`./findhdr signal.h`
10916 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10917 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10918 echo "You have int (*signal())() instead of void." >&4
10920 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10921 echo "You have void (*signal())()." >&4
10923 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10924 echo "You have int (*signal())() instead of void." >&4
10926 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10927 echo "You have void (*signal())()." >&4
10930 case "$d_voidsig" in
10932 echo "I can't determine whether signal handler returns void or int..." >&4
10934 rp="What type does your signal handler return?"
10937 v*) val="$define";;
10941 echo "As you already told me, signal handler returns void." >&4
10944 *) echo "As you already told me, signal handler returns int." >&4
10951 case "$d_voidsig" in
10952 "$define") signal_t="void";;
10953 *) signal_t="int";;
10957 : check for ability to cast large floats to 32-bit ints.
10959 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10960 if $test "$intsize" -ge 4; then
10967 #$i_stdlib I_STDLIB
10969 #include <stdlib.h>
10971 #include <sys/types.h>
10972 #include <signal.h>
10973 $signal_t blech(int s) { exit(3); }
10980 signal(SIGFPE, blech);
10982 /* Don't let compiler optimize the test away. Store the number
10983 in a writable string for gcc to pass to sscanf under HP/UX.
10985 sprintf(str, "2147483647");
10986 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10990 /* x86 processors will probably give 0x8000 0000, which is a
10991 sign change. We don't want that. We want to mimic SPARC
10992 behavior here, which is to preserve the sign and give
10995 if (i32 != ($xxx) f)
11001 if eval $compile_ok; then
11005 echo "(I can't seem to compile the test program--assuming it can't)"
11010 echo "Yup, it can."
11013 echo "Nope, it can't."
11020 : check for ability to cast negative floats to unsigned
11022 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11025 #$i_stdlib I_STDLIB
11027 #include <stdlib.h>
11029 #include <sys/types.h>
11030 #include <signal.h>
11031 $signal_t blech(int s) { exit(7); }
11032 $signal_t blech_in_list(int s) { exit(4); }
11033 unsigned long dummy_long(unsigned long p) { return p; }
11034 unsigned int dummy_int(unsigned int p) { return p; }
11035 unsigned short dummy_short(unsigned short p) { return p; }
11039 unsigned long along;
11041 unsigned short ashort;
11045 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11046 a direct f = -123. assignment. gcc-2.8.0 reportedly
11047 optimized the whole file away
11049 /* Store the number in a writable string for gcc to pass to
11050 sscanf under HP/UX.
11052 sprintf(str, "-123");
11053 sscanf(str, "%lf", &f); /* f = -123.; */
11055 signal(SIGFPE, blech);
11056 along = (unsigned long)f;
11057 aint = (unsigned int)f;
11058 ashort = (unsigned short)f;
11059 if (along != (unsigned long)-123)
11061 if (aint != (unsigned int)-123)
11063 if (ashort != (unsigned short)-123)
11065 sprintf(str, "1073741824.");
11066 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11069 along = (unsigned long)f;
11070 if (along != 0x80000000)
11074 along = (unsigned long)f;
11075 if (along != 0x7fffffff)
11079 along = (unsigned long)f;
11080 if (along != 0x80000001)
11084 signal(SIGFPE, blech_in_list);
11085 sprintf(str, "123.");
11086 sscanf(str, "%lf", &f); /* f = 123.; */
11087 along = dummy_long((unsigned long)f);
11088 aint = dummy_int((unsigned int)f);
11089 ashort = dummy_short((unsigned short)f);
11090 if (along != (unsigned long)123)
11092 if (aint != (unsigned int)123)
11094 if (ashort != (unsigned short)123)
11101 if eval $compile_ok; then
11105 echo "(I can't seem to compile the test program--assuming it can't)"
11108 case "$castflags" in
11110 echo "Yup, it can."
11113 echo "Nope, it can't."
11120 : see if vprintf exists
11122 if set vprintf val -f d_vprintf; eval $csym; $val; then
11123 echo 'vprintf() found.' >&4
11126 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11127 #$i_varargs I_VARARGS
11129 #$i_stdlib I_STDLIB
11130 #$i_unistd I_UNISTD
11133 # include <stdarg.h>
11134 #else /* I_VARARGS */
11135 # include <varargs.h>
11139 # include <unistd.h>
11143 # include <stdlib.h>
11146 #include <stdio.h> /* vsprintf prototype */
11149 void xxx(int n, ...)
11154 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11156 int main() { xxx(1, "foo"); }
11158 #else /* I_VARARGS */
11166 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11168 int main() { xxx("foo"); }
11174 if eval $compile_ok; then
11175 if $run ./try; then
11176 echo "Your vsprintf() returns (int)." >&4
11179 echo "Your vsprintf() returns (char*)." >&4
11183 echo 'I am unable to compile the vsprintf() test program.' >&4
11184 # We shouldn't get here. If we do, assume the standard signature,
11185 # not the old BSD one.
11186 echo 'Guessing that vsprintf() returns (int).' >&4
11190 echo 'vprintf() NOT found.' >&4
11201 : see if chown exists
11205 : see if chroot exists
11206 set chroot d_chroot
11209 : see if chsize exists
11210 set chsize d_chsize
11213 : see if class exists
11217 : see if clearenv exists
11218 set clearenv d_clearenv
11221 : Define hasstruct macro for Configure internal use
11222 hasstruct='varname=$1; struct=$2; shift; shift;
11223 while $test $# -ge 2; do
11225 $define) echo "#include <$2>";;
11229 echo "int main () { struct $struct foo; }" >> try.c;
11231 if eval $compile; then
11240 : see whether socket exists
11244 $echo $n "Hmm... $c" >&4
11245 if set socket val -f d_socket; eval $csym; $val; then
11246 echo "Looks like you have Berkeley networking support." >&4
11248 if set setsockopt val -f; eval $csym; $val; then
11251 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11252 d_oldsock="$define"
11255 if $contains socklib libc.list >/dev/null 2>&1; then
11256 echo "Looks like you have Berkeley networking support." >&4
11258 : we will have to assume that it supports the 4.2 BSD interface
11261 echo "You don't have Berkeley networking in libc$_a..." >&4
11262 if test "X$d_socket" = "X$define"; then
11263 echo "...but you seem to believe that you have sockets." >&4
11265 for net in net socket
11267 if test -f /usr/lib/lib$net$_a; then
11268 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11269 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11270 if $contains socket libc.list >/dev/null 2>&1; then
11275 echo "...but the Wollongong group seems to have hacked it in." >&4
11276 sockethdr="-I/usr/netinclude"
11279 echo "Found Berkeley sockets interface in lib$net." >&4
11280 if $contains setsockopt libc.list >/dev/null 2>&1; then
11283 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11284 d_oldsock="$define"
11290 if test "X$d_socket" != "X$define"; then
11291 echo "or anywhere else I see." >&4
11299 : see if socketpair exists
11300 set socketpair d_sockpair
11305 echo "Checking the availability of certain socket constants..." >&4
11306 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11307 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11309 #include <sys/types.h>
11310 #include <sys/socket.h>
11316 set try; if eval $compile; then
11319 set d_${enum}; eval $setvar
11323 : see if this is a sys/uio.h system
11324 set sys/uio.h i_sysuio
11327 : Check for cmsghdr support
11329 echo "Checking to see if your system supports struct cmsghdr..." >&4
11330 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11332 case "$d_cmsghdr_s" in
11333 "$define") echo "Yes, it does." ;;
11334 *) echo "No, it doesn't." ;;
11338 : check for const keyword
11340 echo 'Checking to see if your C compiler knows about "const"...' >&4
11341 $cat >const.c <<'EOCP'
11342 typedef struct spug { int drokk; } spug;
11346 const spug y = { 0 };
11349 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11351 echo "Yup, it does."
11354 echo "Nope, it doesn't."
11359 : see if copysignl exists
11360 set copysignl d_copysignl
11363 : see if crypt exists
11368 $define) cryptlib='' ;;
11369 *) if set crypt val -f d_crypt; eval $csym; $val; then
11370 echo 'crypt() found.' >&4
11374 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11375 if $test -z "$cryptlib"; then
11376 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11380 if $test -z "$cryptlib"; then
11381 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11385 if $test -z "$cryptlib"; then
11386 cryptlib=`./loc libcrypt$_a "" $libpth`
11390 if $test -z "$cryptlib"; then
11391 echo 'crypt() NOT found.' >&4
11402 : see if this is a crypt.h system
11403 set crypt.h i_crypt
11406 : see if crypt_r exists
11407 set crypt_r d_crypt_r
11409 case "$d_crypt_r" in
11411 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11412 case "$d_crypt_r_proto:$usethreads" in
11413 ":define") d_crypt_r_proto=define
11414 set d_crypt_r_proto crypt_r $hdrs
11418 case "$d_crypt_r_proto" in
11420 case "$crypt_r_proto" in
11421 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11422 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11424 case "$crypt_r_proto" in
11425 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11426 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11428 case "$crypt_r_proto" in
11429 ''|0) d_crypt_r=undef
11431 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11432 * ) case "$crypt_r_proto" in
11433 REENTRANT_PROTO*) ;;
11434 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11436 echo "Prototype: $try" ;;
11439 *) case "$usethreads" in
11440 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11451 : get csh whereabouts
11453 'csh') val="$undef" ;;
11454 *) val="$define" ;;
11458 : Respect a hint or command line value for full_csh.
11459 case "$full_csh" in
11460 '') full_csh=$csh ;;
11463 : see if ctermid exists
11464 set ctermid d_ctermid
11467 : see if ctermid_r exists
11468 set ctermid_r d_ctermid_r
11470 case "$d_ctermid_r" in
11472 hdrs="$i_systypes sys/types.h define stdio.h "
11473 case "$d_ctermid_r_proto:$usethreads" in
11474 ":define") d_ctermid_r_proto=define
11475 set d_ctermid_r_proto ctermid_r $hdrs
11479 case "$d_ctermid_r_proto" in
11481 case "$ctermid_r_proto" in
11482 ''|0) try='char* ctermid_r(char*);'
11483 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11485 case "$ctermid_r_proto" in
11486 ''|0) d_ctermid_r=undef
11488 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11489 * ) case "$ctermid_r_proto" in
11490 REENTRANT_PROTO*) ;;
11491 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11493 echo "Prototype: $try" ;;
11496 *) case "$usethreads" in
11497 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11504 *) ctermid_r_proto=0
11508 : see if ctime_r exists
11509 set ctime_r d_ctime_r
11511 case "$d_ctime_r" in
11513 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11514 case "$d_ctime_r_proto:$usethreads" in
11515 ":define") d_ctime_r_proto=define
11516 set d_ctime_r_proto ctime_r $hdrs
11520 case "$d_ctime_r_proto" in
11522 case "$ctime_r_proto" in
11523 ''|0) try='char* ctime_r(const time_t*, char*);'
11524 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11526 case "$ctime_r_proto" in
11527 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11528 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11530 case "$ctime_r_proto" in
11531 ''|0) try='int ctime_r(const time_t*, char*);'
11532 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11534 case "$ctime_r_proto" in
11535 ''|0) try='int ctime_r(const time_t*, char*, int);'
11536 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11538 case "$ctime_r_proto" in
11539 ''|0) d_ctime_r=undef
11541 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11542 * ) case "$ctime_r_proto" in
11543 REENTRANT_PROTO*) ;;
11544 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11546 echo "Prototype: $try" ;;
11549 *) case "$usethreads" in
11550 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11561 : see if cuserid exists
11562 set cuserid d_cuserid
11565 : see if this is a limits.h system
11566 set limits.h i_limits
11569 : see if this is a float.h system
11570 set float.h i_float
11573 : See if number of significant digits in a double precision number is known
11575 $cat >dbl_dig.c <<EOM
11576 #$i_limits I_LIMITS
11579 #include <limits.h>
11585 printf("Contains DBL_DIG");
11588 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11589 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11590 echo "DBL_DIG found." >&4
11593 echo "DBL_DIG NOT found." >&4
11600 : see if dbm.h is available
11601 : see if dbmclose exists
11602 set dbmclose d_dbmclose
11605 case "$d_dbmclose" in
11615 *) set rpcsvc/dbm.h i_rpcsvcdbm
11620 *) echo "We won't be including <dbm.h>"
11630 : see if prototype for dbminit is available
11632 set d_dbminitproto dbminit $i_dbm dbm.h
11635 : see if difftime exists
11636 set difftime d_difftime
11639 : see if this is a dirent system
11641 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11643 echo "<dirent.h> found." >&4
11646 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11647 echo "<sys/dir.h> found." >&4
11650 xinc=`./findhdr sys/ndir.h`
11652 echo "<dirent.h> NOT found." >&4
11657 : Look for type of directory structure.
11659 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11661 case "$direntrytype" in
11663 case "$i_dirent" in
11664 $define) guess1='struct dirent' ;;
11665 *) guess1='struct direct' ;;
11668 *) guess1="$direntrytype"
11673 'struct dirent') guess2='struct direct' ;;
11674 *) guess2='struct dirent' ;;
11677 if $contains "$guess1" try.c >/dev/null 2>&1; then
11678 direntrytype="$guess1"
11679 echo "Your directory entries are $direntrytype." >&4
11680 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11681 direntrytype="$guess2"
11682 echo "Your directory entries seem to be $direntrytype." >&4
11684 echo "I don't recognize your system's directory entries." >&4
11685 rp="What type is used for directory entries on this system?"
11688 direntrytype="$ans"
11692 : see if the directory entry stores field length
11694 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11695 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11696 echo "Good, your directory entry keeps length information in d_namlen." >&4
11699 echo "Your directory entry does not know about the d_namlen field." >&4
11706 : Look for DIR.dd_fd
11707 case "$i_dirent" in
11709 echo "Checking to see if DIR has a dd_fd member variable" >&4
11711 #$i_stdlib I_STDLIB
11713 #include <stdlib.h>
11715 #include <dirent.h>
11725 if eval $compile; then
11726 echo "Yes, it does."
11729 echo "No, it does not."
11734 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11742 : see if this is an sysdir system
11743 set sys/dir.h i_sysdir
11746 : see if this is an sysndir system
11747 set sys/ndir.h i_sysndir
11752 $cat >dirfd.c <<EOM
11754 #$i_stdlib I_STDLIB
11756 #include <stdlib.h>
11758 #$i_dirent I_DIRENT /**/
11759 #$i_sysdir I_SYS_DIR /**/
11760 #$i_sysndir I_SYS_NDIR /**/
11761 #$i_systypes I_SYS_TYPES /**/
11762 #if defined(I_SYS_TYPES)
11763 #include <sys/types.h>
11765 #if defined(I_DIRENT)
11766 #include <dirent.h>
11767 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11768 #include <sys/dir.h>
11772 #include <sys/ndir.h>
11776 #include <ndir.h> /* may be wrong in the future */
11778 #include <sys/dir.h>
11784 DIR *dirp = opendir(".");
11785 if (dirfd(dirp) >= 0)
11793 if eval $compile; then
11797 $define) echo "dirfd() found." >&4 ;;
11798 *) echo "dirfd() NOT found." >&4 ;;
11804 : see if dlerror exists
11807 set dlerror d_dlerror
11811 : see if dlfcn is available
11812 set dlfcn.h i_dlfcn
11815 : Check what extension to use for shared libs
11820 On a few systems, the dynamically loaded modules that perl generates and uses
11821 will need a different extension than shared libs. The default will probably
11827 *) dflt="$dlext" ;;
11829 rp='What is the extension of dynamically loaded modules'
11838 : Check if dlsym need a leading underscore
11844 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11845 $cat >dyna.c <<'EOM'
11852 #$i_stdlib I_STDLIB
11854 #include <stdlib.h>
11858 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11860 #include <sys/types.h>
11865 extern int fred() ;
11874 int mode = RTLD_LAZY ;
11876 handle = dlopen("./dyna.$dlext", mode) ;
11877 if (handle == NULL) {
11882 symbol = dlsym(handle, "fred") ;
11883 if (symbol == NULL) {
11884 /* try putting a leading underscore */
11885 symbol = dlsym(handle, "_fred") ;
11886 if (symbol == NULL) {
11899 : Call the object file tmp-dyna.o in case dlext=o.
11900 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11901 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11902 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11903 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11906 1) echo "Test program failed using dlopen." >&4
11907 echo "Perhaps you should not use dynamic loading." >&4;;
11908 2) echo "Test program failed using dlsym." >&4
11909 echo "Perhaps you should not use dynamic loading." >&4;;
11910 3) echo "dlsym needs a leading underscore" >&4
11912 4) echo "dlsym doesn't need a leading underscore." >&4;;
11915 echo "I can't compile and run the test program." >&4
11916 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11921 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11926 : see if drand48_r exists
11927 set drand48_r d_drand48_r
11929 case "$d_drand48_r" in
11931 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11932 case "$d_drand48_r_proto:$usethreads" in
11933 ":define") d_drand48_r_proto=define
11934 set d_drand48_r_proto drand48_r $hdrs
11938 case "$d_drand48_r_proto" in
11940 case "$drand48_r_proto" in
11941 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11942 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
11944 case "$drand48_r_proto" in
11945 ''|0) d_drand48_r=undef
11947 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11948 * ) case "$drand48_r_proto" in
11949 REENTRANT_PROTO*) ;;
11950 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11952 echo "Prototype: $try" ;;
11955 *) case "$usethreads" in
11956 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11963 *) drand48_r_proto=0
11967 : see if prototype for drand48 is available
11969 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11972 : see if dup2 exists
11976 : see if eaccess exists
11977 set eaccess d_eaccess
11980 : see if endgrent exists
11981 set endgrent d_endgrent
11984 : see if this is an grp system
11990 xxx=`./findhdr grp.h`
11991 $cppstdin $cppflags $cppminus < $xxx >$$.h
11993 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12005 set d_grpasswd; eval $setvar
12009 : see if endgrent_r exists
12010 set endgrent_r d_endgrent_r
12012 case "$d_endgrent_r" in
12014 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12015 case "$d_endgrent_r_proto:$usethreads" in
12016 ":define") d_endgrent_r_proto=define
12017 set d_endgrent_r_proto endgrent_r $hdrs
12021 case "$d_endgrent_r_proto" in
12023 case "$endgrent_r_proto" in
12024 ''|0) try='int endgrent_r(FILE**);'
12025 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12027 case "$endgrent_r_proto" in
12028 ''|0) try='void endgrent_r(FILE**);'
12029 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12031 case "$endgrent_r_proto" in
12032 ''|0) d_endgrent_r=undef
12034 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12035 * ) case "$endgrent_r_proto" in
12036 REENTRANT_PROTO*) ;;
12037 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12039 echo "Prototype: $try" ;;
12042 *) case "$usethreads" in
12043 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12050 *) endgrent_r_proto=0
12054 : see if endhostent exists
12055 set endhostent d_endhent
12058 : see if this is a netdb.h system
12059 set netdb.h i_netdb
12062 : see if endhostent_r exists
12063 set endhostent_r d_endhostent_r
12065 case "$d_endhostent_r" in
12067 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12068 case "$d_endhostent_r_proto:$usethreads" in
12069 ":define") d_endhostent_r_proto=define
12070 set d_endhostent_r_proto endhostent_r $hdrs
12074 case "$d_endhostent_r_proto" in
12076 case "$endhostent_r_proto" in
12077 ''|0) try='int endhostent_r(struct hostent_data*);'
12078 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12080 case "$endhostent_r_proto" in
12081 ''|0) try='void endhostent_r(struct hostent_data*);'
12082 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12084 case "$endhostent_r_proto" in
12085 ''|0) d_endhostent_r=undef
12086 endhostent_r_proto=0
12087 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12088 * ) case "$endhostent_r_proto" in
12089 REENTRANT_PROTO*) ;;
12090 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12092 echo "Prototype: $try" ;;
12095 *) case "$usethreads" in
12096 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12098 d_endhostent_r=undef
12099 endhostent_r_proto=0
12103 *) endhostent_r_proto=0
12107 : see if endnetent exists
12108 set endnetent d_endnent
12111 : see if endnetent_r exists
12112 set endnetent_r d_endnetent_r
12114 case "$d_endnetent_r" in
12116 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12117 case "$d_endnetent_r_proto:$usethreads" in
12118 ":define") d_endnetent_r_proto=define
12119 set d_endnetent_r_proto endnetent_r $hdrs
12123 case "$d_endnetent_r_proto" in
12125 case "$endnetent_r_proto" in
12126 ''|0) try='int endnetent_r(struct netent_data*);'
12127 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12129 case "$endnetent_r_proto" in
12130 ''|0) try='void endnetent_r(struct netent_data*);'
12131 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12133 case "$endnetent_r_proto" in
12134 ''|0) d_endnetent_r=undef
12135 endnetent_r_proto=0
12136 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12137 * ) case "$endnetent_r_proto" in
12138 REENTRANT_PROTO*) ;;
12139 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12141 echo "Prototype: $try" ;;
12144 *) case "$usethreads" in
12145 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12147 d_endnetent_r=undef
12148 endnetent_r_proto=0
12152 *) endnetent_r_proto=0
12156 : see if endprotoent exists
12157 set endprotoent d_endpent
12160 : see if endprotoent_r exists
12161 set endprotoent_r d_endprotoent_r
12163 case "$d_endprotoent_r" in
12165 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12166 case "$d_endprotoent_r_proto:$usethreads" in
12167 ":define") d_endprotoent_r_proto=define
12168 set d_endprotoent_r_proto endprotoent_r $hdrs
12172 case "$d_endprotoent_r_proto" in
12174 case "$endprotoent_r_proto" in
12175 ''|0) try='int endprotoent_r(struct protoent_data*);'
12176 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12178 case "$endprotoent_r_proto" in
12179 ''|0) try='void endprotoent_r(struct protoent_data*);'
12180 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12182 case "$endprotoent_r_proto" in
12183 ''|0) d_endprotoent_r=undef
12184 endprotoent_r_proto=0
12185 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12186 * ) case "$endprotoent_r_proto" in
12187 REENTRANT_PROTO*) ;;
12188 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12190 echo "Prototype: $try" ;;
12193 *) case "$usethreads" in
12194 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12196 d_endprotoent_r=undef
12197 endprotoent_r_proto=0
12201 *) endprotoent_r_proto=0
12205 : see if endpwent exists
12206 set endpwent d_endpwent
12209 : see if this is a pwd.h system
12215 xxx=`./findhdr pwd.h`
12216 $cppstdin $cppflags $cppminus < $xxx >$$.h
12218 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12226 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12234 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12242 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12250 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12258 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12266 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12274 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12286 set d_pwquota; eval $setvar
12287 set d_pwage; eval $setvar
12288 set d_pwchange; eval $setvar
12289 set d_pwclass; eval $setvar
12290 set d_pwexpire; eval $setvar
12291 set d_pwcomment; eval $setvar
12292 set d_pwgecos; eval $setvar
12293 set d_pwpasswd; eval $setvar
12297 : see if endpwent_r exists
12298 set endpwent_r d_endpwent_r
12300 case "$d_endpwent_r" in
12302 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12303 case "$d_endpwent_r_proto:$usethreads" in
12304 ":define") d_endpwent_r_proto=define
12305 set d_endpwent_r_proto endpwent_r $hdrs
12309 case "$d_endpwent_r_proto" in
12311 case "$endpwent_r_proto" in
12312 ''|0) try='int endpwent_r(FILE**);'
12313 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12315 case "$endpwent_r_proto" in
12316 ''|0) try='void endpwent_r(FILE**);'
12317 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12319 case "$endpwent_r_proto" in
12320 ''|0) d_endpwent_r=undef
12322 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12323 * ) case "$endpwent_r_proto" in
12324 REENTRANT_PROTO*) ;;
12325 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12327 echo "Prototype: $try" ;;
12330 *) case "$usethreads" in
12331 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12338 *) endpwent_r_proto=0
12342 : see if endservent exists
12343 set endservent d_endsent
12346 : see if endservent_r exists
12347 set endservent_r d_endservent_r
12349 case "$d_endservent_r" in
12351 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12352 case "$d_endservent_r_proto:$usethreads" in
12353 ":define") d_endservent_r_proto=define
12354 set d_endservent_r_proto endservent_r $hdrs
12358 case "$d_endservent_r_proto" in
12360 case "$endservent_r_proto" in
12361 ''|0) try='int endservent_r(struct servent_data*);'
12362 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12364 case "$endservent_r_proto" in
12365 ''|0) try='void endservent_r(struct servent_data*);'
12366 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12368 case "$endservent_r_proto" in
12369 ''|0) d_endservent_r=undef
12370 endservent_r_proto=0
12371 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12372 * ) case "$endservent_r_proto" in
12373 REENTRANT_PROTO*) ;;
12374 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12376 echo "Prototype: $try" ;;
12379 *) case "$usethreads" in
12380 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12382 d_endservent_r=undef
12383 endservent_r_proto=0
12387 *) endservent_r_proto=0
12391 : Locate the flags for 'open()'
12394 #include <sys/types.h>
12399 #include <sys/file.h>
12401 #$i_stdlib I_STDLIB
12403 #include <stdlib.h>
12414 : check sys/file.h first to get FREAD on Sun
12415 if $test `./findhdr sys/file.h` && \
12416 set try -DI_SYS_FILE && eval $compile; then
12418 echo "<sys/file.h> defines the O_* constants..." >&4
12419 if $run ./try; then
12420 echo "and you have the 3 argument form of open()." >&4
12423 echo "but not the 3 argument form of open(). Oh, well." >&4
12426 elif $test `./findhdr fcntl.h` && \
12427 set try -DI_FCNTL && eval $compile; then
12429 echo "<fcntl.h> defines the O_* constants..." >&4
12430 if $run ./try; then
12431 echo "and you have the 3 argument form of open()." >&4
12434 echo "but not the 3 argument form of open(). Oh, well." >&4
12439 echo "I can't find the O_* constant definitions! You got problems." >&4
12445 : see if this is a sys/file.h system
12450 : do we need to include sys/file.h ?
12454 if $h_sysfile; then
12456 echo "We'll be including <sys/file.h>." >&4
12459 echo "We won't be including <sys/file.h>." >&4
12469 : see if fcntl.h is there
12474 : see if we can include fcntl.h
12480 echo "We'll be including <fcntl.h>." >&4
12483 if $h_sysfile; then
12484 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12486 echo "We won't be including <fcntl.h>." >&4
12498 : see if fork exists
12502 : see if pipe exists
12506 : check for non-blocking I/O stuff
12507 case "$h_sysfile" in
12508 true) echo "#include <sys/file.h>" > head.c;;
12511 true) echo "#include <fcntl.h>" > head.c;;
12512 *) echo "#include <sys/fcntl.h>" > head.c;;
12517 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12518 case "$o_nonblock" in
12520 $cat head.c > try.c
12521 $cat >>try.c <<EOCP
12523 #$i_stdlib I_STDLIB
12525 #include <stdlib.h>
12533 printf("O_NONBLOCK\n");
12537 printf("O_NDELAY\n");
12541 printf("FNDELAY\n");
12548 if eval $compile_ok; then
12549 o_nonblock=`$run ./try`
12550 case "$o_nonblock" in
12551 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12552 *) echo "Seems like we can use $o_nonblock.";;
12555 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12558 *) echo "Using $hint value $o_nonblock.";;
12563 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12566 case "$d_fork:$d_pipe" in
12568 $cat head.c > try.c
12569 $cat >>try.c <<EOCP
12571 #include <sys/types.h>
12572 #include <signal.h>
12574 #$i_stdlib I_STDLIB
12576 #include <stdlib.h>
12582 #define MY_O_NONBLOCK $o_nonblock
12583 #ifndef errno /* XXX need better Configure test */
12586 #$i_unistd I_UNISTD
12588 #include <unistd.h>
12590 #$i_string I_STRING
12592 #include <string.h>
12594 #include <strings.h>
12596 $signal_t blech(int x) { exit(3); }
12598 $cat >> try.c <<'EOCP'
12606 pipe(pd); /* Down: child -> parent */
12607 pipe(pu); /* Up: parent -> child */
12610 close(pd[1]); /* Parent reads from pd[0] */
12611 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12613 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12618 signal(SIGALRM, blech);
12620 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12622 sprintf(string, "%d\n", ret);
12623 write(2, string, strlen(string));
12626 if (errno == EAGAIN) {
12627 printf("EAGAIN\n");
12632 if (errno == EWOULDBLOCK)
12633 printf("EWOULDBLOCK\n");
12636 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12637 sleep(2); /* Give it time to close our pipe */
12639 ret = read(pd[0], buf, 1); /* Should read EOF */
12641 sprintf(string, "%d\n", ret);
12642 write(4, string, strlen(string));
12646 close(pd[0]); /* We write to pd[1] */
12647 close(pu[1]); /* We read from pu[0] */
12648 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12649 close(pd[1]); /* Pipe pd is now fully closed! */
12650 exit(0); /* Bye bye, thank you for playing! */
12654 if eval $compile_ok; then
12655 echo "$startsh" >mtry
12656 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12658 ./mtry >/dev/null 2>&1
12660 0) eagain=`$cat try.out`;;
12661 1) echo "Could not perform non-blocking setting!";;
12662 2) echo "I did a successful read() for something that was not there!";;
12663 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12664 4) echo "Could not find F_SETFL!";;
12665 *) echo "Something terribly wrong happened during testing.";;
12667 rd_nodata=`$cat try.ret`
12668 echo "A read() system call with no data present returns $rd_nodata."
12669 case "$rd_nodata" in
12672 echo "(That's peculiar, fixing that to be -1.)"
12678 echo "Forcing errno EAGAIN on read() with no data available."
12682 echo "Your read() sets errno to $eagain when no data is available."
12685 status=`$cat try.err`
12687 0) echo "And it correctly returns 0 to signal EOF.";;
12688 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12689 *) echo "However, your read() returns '$status' on EOF??";;
12692 if test "$status" = "$rd_nodata"; then
12693 echo "WARNING: you can't distinguish between EOF and no data!"
12697 echo "I can't compile the test program--assuming errno EAGAIN will do."
12701 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12710 echo "Using $hint value $eagain."
12711 echo "Your read() returns $rd_nodata when no data is present."
12712 case "$d_eofnblk" in
12713 "$define") echo "And you can see EOF because read() returns 0.";;
12714 "$undef") echo "But you can't see EOF status from read() returned value.";;
12716 echo "(Assuming you can't see EOF status from read anyway.)"
12722 $rm_try head.c mtry
12724 : see if _ptr and _cnt from stdio act std
12727 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12728 echo "(Looks like you have stdio.h from BSD.)"
12729 case "$stdio_ptr" in
12730 '') stdio_ptr='((fp)->_p)'
12733 *) ptr_lval=$d_stdio_ptr_lval;;
12735 case "$stdio_cnt" in
12736 '') stdio_cnt='((fp)->_r)'
12739 *) cnt_lval=$d_stdio_cnt_lval;;
12741 case "$stdio_base" in
12742 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12744 case "$stdio_bufsiz" in
12745 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12747 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12748 echo "(Looks like you have stdio.h from Linux.)"
12749 case "$stdio_ptr" in
12750 '') stdio_ptr='((fp)->_IO_read_ptr)'
12753 *) ptr_lval=$d_stdio_ptr_lval;;
12755 case "$stdio_cnt" in
12756 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12759 *) cnt_lval=$d_stdio_cnt_lval;;
12761 case "$stdio_base" in
12762 '') stdio_base='((fp)->_IO_read_base)';;
12764 case "$stdio_bufsiz" in
12765 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12768 case "$stdio_ptr" in
12769 '') stdio_ptr='((fp)->_ptr)'
12772 *) ptr_lval=$d_stdio_ptr_lval;;
12774 case "$stdio_cnt" in
12775 '') stdio_cnt='((fp)->_cnt)'
12778 *) cnt_lval=$d_stdio_cnt_lval;;
12780 case "$stdio_base" in
12781 '') stdio_base='((fp)->_base)';;
12783 case "$stdio_bufsiz" in
12784 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12788 : test whether _ptr and _cnt really work
12789 echo "Checking how std your stdio is..." >&4
12792 #$i_stdlib I_STDLIB
12794 #include <stdlib.h>
12796 #define FILE_ptr(fp) $stdio_ptr
12797 #define FILE_cnt(fp) $stdio_cnt
12799 FILE *fp = fopen("try.c", "r");
12802 18 <= FILE_cnt(fp) &&
12803 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12811 if eval $compile && $to try.c; then
12812 if $run ./try; then
12813 echo "Your stdio acts pretty std."
12816 echo "Your stdio isn't very std."
12819 echo "Your stdio doesn't appear very std."
12823 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12824 # direct buffer manipulation no longer works. The Configure tests
12825 # should be changed to correctly detect this, but until then,
12826 # the following check should at least let perl compile and run.
12827 # (This quick fix should be updated before 5.8.1.)
12828 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12829 # A. Dougherty, June 3, 2002.
12830 case "$d_gnulibc" in
12832 case "$gnulibc_version" in
12836 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12845 : Can _ptr be used as an lvalue?
12846 case "$d_stdstdio$ptr_lval" in
12847 $define$define) val=$define ;;
12850 set d_stdio_ptr_lval
12853 : Can _cnt be used as an lvalue?
12854 case "$d_stdstdio$cnt_lval" in
12855 $define$define) val=$define ;;
12858 set d_stdio_cnt_lval
12862 : test whether setting _ptr sets _cnt as a side effect
12863 d_stdio_ptr_lval_sets_cnt="$undef"
12864 d_stdio_ptr_lval_nochange_cnt="$undef"
12865 case "$d_stdio_ptr_lval$d_stdstdio" in
12867 echo "Checking to see what happens if we set the stdio ptr..." >&4
12870 /* Can we scream? */
12871 /* Eat dust sed :-) */
12872 /* In the buffer space, no one can hear you scream. */
12873 #$i_stdlib I_STDLIB
12875 #include <stdlib.h>
12877 #define FILE_ptr(fp) $stdio_ptr
12878 #define FILE_cnt(fp) $stdio_cnt
12879 #include <sys/types.h>
12881 FILE *fp = fopen("try.c", "r");
12886 puts("Fail even to read");
12889 c = getc(fp); /* Read away the first # */
12891 puts("Fail even to read");
12895 18 <= FILE_cnt(fp) &&
12896 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12898 puts("Fail even to read");
12901 ptr = (char*) FILE_ptr(fp);
12902 cnt = (size_t)FILE_cnt(fp);
12904 FILE_ptr(fp) += 42;
12906 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12907 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12910 if (FILE_cnt(fp) <= 20) {
12911 printf ("Fail (<20 chars to test)");
12914 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12915 puts("Fail compare");
12918 if (cnt == FILE_cnt(fp)) {
12919 puts("Pass_unchanged");
12922 if (FILE_cnt(fp) == (cnt - 42)) {
12923 puts("Pass_changed");
12926 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12932 if eval $compile && $to try.c; then
12933 case `$run ./try` in
12935 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12936 d_stdio_ptr_lval_sets_cnt="$define" ;;
12938 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12939 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12941 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12943 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12946 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12952 : see if _base is also standard
12954 case "$d_stdstdio" in
12958 #$i_stdlib I_STDLIB
12960 #include <stdlib.h>
12962 #define FILE_base(fp) $stdio_base
12963 #define FILE_bufsiz(fp) $stdio_bufsiz
12965 FILE *fp = fopen("try.c", "r");
12968 19 <= FILE_bufsiz(fp) &&
12969 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12976 if eval $compile && $to try.c; then
12977 if $run ./try; then
12978 echo "And its _base field acts std."
12981 echo "But its _base field isn't std."
12984 echo "However, it seems to be lacking the _base field."
12992 : see if fast_stdio exists
12994 case "$d_stdstdio:$d_stdio_ptr_lval" in
12996 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12998 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13009 : see if fchdir exists
13010 set fchdir d_fchdir
13013 : see if fchmod exists
13014 set fchmod d_fchmod
13017 : see if fchown exists
13018 set fchown d_fchown
13021 : see if this is an fcntl system
13025 : See if fcntl-based locking works.
13028 #$i_stdlib I_STDLIB
13030 #include <stdlib.h>
13032 #include <unistd.h>
13034 #include <signal.h>
13035 $signal_t blech(int x) { exit(3); }
13037 #if defined(F_SETLK) && defined(F_SETLKW)
13038 struct flock flock;
13040 fd = open("try.c", O_RDONLY);
13041 flock.l_type = F_RDLCK;
13042 flock.l_whence = SEEK_SET;
13043 flock.l_start = flock.l_len = 0;
13044 signal(SIGALRM, blech);
13046 retval = fcntl(fd, F_SETLK, &flock);
13048 (retval < 0 ? exit(2) : exit(0));
13054 echo "Checking if fcntl-based file locking works... "
13058 if eval $compile_ok; then
13059 if $run ./try; then
13060 echo "Yes, it seems to work."
13063 echo "Nope, it didn't work."
13068 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13069 *** This is (almost) impossible.
13070 *** If your NFS lock daemons are not feeling well, something like
13071 *** this may happen, please investigate. Cannot continue, aborting.
13079 echo "I'm unable to compile the test program, so I'll assume not."
13084 echo "Nope, since you don't even have fcntl()."
13087 set d_fcntl_can_lock
13091 : check for fd_set items
13094 Checking to see how well your C compiler handles fd_set and friends ...
13097 #$i_stdlib I_STDLIB
13099 #include <stdlib.h>
13101 #$i_systime I_SYS_TIME
13102 #$i_sysselct I_SYS_SELECT
13103 #$d_socket HAS_SOCKET
13104 #include <sys/types.h>
13106 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13109 #include <sys/time.h>
13111 #ifdef I_SYS_SELECT
13112 #include <sys/select.h>
13121 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13129 if eval $compile; then
13130 d_fds_bits="$define"
13132 echo "Well, your system knows about the normal fd_set typedef..." >&4
13133 if $run ./try; then
13134 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13135 d_fd_macros="$define"
13138 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13140 d_fd_macros="$undef"
13144 Hmm, your compiler has some difficulty with fd_set. Checking further...
13147 if eval $compile; then
13148 d_fds_bits="$undef"
13150 echo "Well, your system has some sort of fd_set available..." >&4
13151 if $run ./try; then
13152 echo "and you have the normal fd_set macros." >&4
13153 d_fd_macros="$define"
13156 but not the normal fd_set macros! Gross! More work for me...
13158 d_fd_macros="$undef"
13161 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13163 d_fds_bits="$undef"
13164 d_fd_macros="$undef"
13169 : see if fgetpos exists
13170 set fgetpos d_fgetpos
13173 : see if finite exists
13174 set finite d_finite
13177 : see if finitel exists
13178 set finitel d_finitel
13181 : see if flock exists
13185 : see if prototype for flock is available
13187 set d_flockproto flock $i_sysfile sys/file.h
13190 : see if fp_class exists
13191 set fp_class d_fp_class
13194 : see if pathconf exists
13195 set pathconf d_pathconf
13198 : see if fpathconf exists
13199 set fpathconf d_fpathconf
13202 : see if fpclass exists
13203 set fpclass d_fpclass
13206 : see if fpclassify exists
13207 set fpclassify d_fpclassify
13210 : see if fpclassl exists
13211 set fpclassl d_fpclassl
13214 : check for fpos64_t
13216 echo "Checking to see if you have fpos64_t..." >&4
13219 int main() { fpos64_t x = 7; }
13222 if eval $compile; then
13224 echo "You have fpos64_t."
13227 echo "You do not have fpos64_t."
13228 case "$fpossize" in
13229 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13236 : see if frexpl exists
13237 set frexpl d_frexpl
13240 : see if this is a sys/param system
13241 set sys/param.h i_sysparam
13244 : see if this is a sys/mount.h system
13245 set sys/mount.h i_sysmount
13248 : Check for fs_data_s
13250 echo "Checking to see if your system supports struct fs_data..." >&4
13251 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13253 case "$d_fs_data_s" in
13254 "$define") echo "Yes, it does." ;;
13255 *) echo "No, it doesn't." ;;
13258 : see if fseeko exists
13259 set fseeko d_fseeko
13261 case "$longsize" in
13262 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13265 : see if fsetpos exists
13266 set fsetpos d_fsetpos
13269 : see if fstatfs exists
13270 set fstatfs d_fstatfs
13273 : see if statvfs exists
13274 set statvfs d_statvfs
13277 : see if fstatvfs exists
13278 set fstatvfs d_fstatvfs
13282 : see if fsync exists
13286 : see if ftello exists
13287 set ftello d_ftello
13289 case "$longsize" in
13290 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13293 : check for a working futimes
13296 echo "Checking if you have a working futimes()" >&4
13299 #include <sys/time.h>
13306 fd = open ("try.c", O_RDWR);
13307 if (-1 == fd) exit (1);
13308 rv = futimes (fd, NULL);
13309 exit (rv == -1 ? errno : 0);
13313 if eval $compile; then
13317 0) echo "Yes, you have" >&4
13318 d_futimes="$define"
13320 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13324 echo "No, it does not (probably harmless)" >&4
13328 : see if ndbm.h is available
13331 : Compatibility location for RedHat 7.1
13332 set gdbm/ndbm.h i_gdbmndbm
13334 : Compatibility location for Debian 4.0
13335 set gdbm-ndbm.h i_gdbm_ndbm
13339 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13340 : see if dbm_open exists
13341 set dbm_open d_dbm_open
13343 case "$d_dbm_open" in
13346 i_gdbmndbm="$undef"
13347 i_gdbm_ndbm="$undef"
13348 echo "We won't be including <ndbm.h>"
13358 ndbm_hdr_protochk='name=$1; hdr=$2;
13359 eval "ihdr=\$""i_$name";
13361 if $test "$ihdr" = "$define"; then
13362 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13363 case "$d_cplusplus" in
13364 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13365 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13368 $define) $echo "Your <$hdr> seems to have prototypes";;
13369 *) $echo "Your <$hdr> does not seem to have prototypes";;
13372 set "d_${name}_h_uses_prototypes";
13376 eval $ndbm_hdr_protochk
13377 set gdbmndbm gdbm/ndbm.h
13378 eval $ndbm_hdr_protochk
13379 set gdbm_ndbm gdbm-ndbm.h
13380 eval $ndbm_hdr_protochk
13382 : see if getcwd exists
13383 set getcwd d_getcwd
13386 : see if getespwnam exists
13387 set getespwnam d_getespwnam
13390 : see if getfsstat exists
13391 set getfsstat d_getfsstat
13394 : see if getgrent exists
13395 set getgrent d_getgrent
13398 : see if getgrent_r exists
13399 set getgrent_r d_getgrent_r
13401 case "$d_getgrent_r" in
13403 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13404 case "$d_getgrent_r_proto:$usethreads" in
13405 ":define") d_getgrent_r_proto=define
13406 set d_getgrent_r_proto getgrent_r $hdrs
13410 case "$d_getgrent_r_proto" in
13412 case "$getgrent_r_proto" in
13413 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13414 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13416 case "$getgrent_r_proto" in
13417 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13418 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13420 case "$getgrent_r_proto" in
13421 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13422 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13424 case "$getgrent_r_proto" in
13425 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13426 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13428 case "$getgrent_r_proto" in
13429 ''|0) try='int getgrent_r(struct group*, char*, int);'
13430 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13432 case "$getgrent_r_proto" in
13433 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13434 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13436 case "$getgrent_r_proto" in
13437 ''|0) d_getgrent_r=undef
13439 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13440 * ) case "$getgrent_r_proto" in
13441 REENTRANT_PROTO*) ;;
13442 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13444 echo "Prototype: $try" ;;
13447 *) case "$usethreads" in
13448 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13455 *) getgrent_r_proto=0
13459 : see if getgrgid_r exists
13460 set getgrgid_r d_getgrgid_r
13462 case "$d_getgrgid_r" in
13464 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13465 case "$d_getgrgid_r_proto:$usethreads" in
13466 ":define") d_getgrgid_r_proto=define
13467 set d_getgrgid_r_proto getgrgid_r $hdrs
13471 case "$d_getgrgid_r_proto" in
13473 case "$getgrgid_r_proto" in
13474 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13475 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13477 case "$getgrgid_r_proto" in
13478 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13479 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13481 case "$getgrgid_r_proto" in
13482 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13483 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13485 case "$getgrgid_r_proto" in
13486 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13487 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13489 case "$getgrgid_r_proto" in
13490 ''|0) d_getgrgid_r=undef
13492 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13493 * ) case "$getgrgid_r_proto" in
13494 REENTRANT_PROTO*) ;;
13495 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13497 echo "Prototype: $try" ;;
13500 *) case "$usethreads" in
13501 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13508 *) getgrgid_r_proto=0
13512 : see if getgrnam_r exists
13513 set getgrnam_r d_getgrnam_r
13515 case "$d_getgrnam_r" in
13517 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13518 case "$d_getgrnam_r_proto:$usethreads" in
13519 ":define") d_getgrnam_r_proto=define
13520 set d_getgrnam_r_proto getgrnam_r $hdrs
13524 case "$d_getgrnam_r_proto" in
13526 case "$getgrnam_r_proto" in
13527 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13528 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13530 case "$getgrnam_r_proto" in
13531 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13532 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13534 case "$getgrnam_r_proto" in
13535 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13536 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13538 case "$getgrnam_r_proto" in
13539 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13540 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13542 case "$getgrnam_r_proto" in
13543 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13544 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13546 case "$getgrnam_r_proto" in
13547 ''|0) d_getgrnam_r=undef
13549 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13550 * ) case "$getgrnam_r_proto" in
13551 REENTRANT_PROTO*) ;;
13552 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13554 echo "Prototype: $try" ;;
13557 *) case "$usethreads" in
13558 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13565 *) getgrnam_r_proto=0
13569 : see if gethostbyaddr exists
13570 set gethostbyaddr d_gethbyaddr
13573 : see if gethostbyname exists
13574 set gethostbyname d_gethbyname
13577 : see if gethostent exists
13578 set gethostent d_gethent
13581 : see how we will look up host name
13584 if set gethostname val -f d_gethname; eval $csym; $val; then
13585 echo 'gethostname() found.' >&4
13586 d_gethname="$define"
13589 if set uname val -f d_uname; eval $csym; $val; then
13592 uname() was found, but you're running xenix, and older versions of xenix
13593 have a broken uname(). If you don't really know whether your xenix is old
13594 enough to have a broken system call, use the default answer.
13599 "$define") dflt=n;;
13601 rp='Is your uname() broken?'
13604 n*) d_uname="$define"; call=uname;;
13607 echo 'uname() found.' >&4
13614 case "$d_gethname" in
13615 '') d_gethname="$undef";;
13618 '') d_uname="$undef";;
13620 case "$d_uname$d_gethname" in
13625 Every now and then someone has a $call() that lies about the hostname
13626 but can't be fixed for political or economic reasons. If you wish, I can
13627 pretend $call() isn't there and maybe compute hostname at run-time
13628 thanks to the '$phostname' command.
13631 rp="Shall I ignore $call() from now on?"
13634 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13637 case "$phostname" in
13638 '') aphostname='';;
13639 *) case "$aphostname" in
13641 *) set X $phostname
13645 file=`./loc $file $file $pth`
13646 aphostname=`echo $file $*`
13651 case "$d_uname$d_gethname" in
13654 case "$phostname" in
13656 echo "There will be no way for $package to get your hostname." >&4;;
13658 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13662 case "$d_phostname" in
13663 '') d_phostname="$undef";;
13666 : see if gethostbyaddr_r exists
13667 set gethostbyaddr_r d_gethostbyaddr_r
13669 case "$d_gethostbyaddr_r" in
13671 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13672 case "$d_gethostbyaddr_r_proto:$usethreads" in
13673 ":define") d_gethostbyaddr_r_proto=define
13674 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13678 case "$d_gethostbyaddr_r_proto" in
13680 case "$gethostbyaddr_r_proto" in
13681 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13682 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13684 case "$gethostbyaddr_r_proto" in
13685 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13686 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13688 case "$gethostbyaddr_r_proto" in
13689 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13690 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13692 case "$gethostbyaddr_r_proto" in
13693 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13694 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13696 case "$gethostbyaddr_r_proto" in
13697 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13698 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13700 case "$gethostbyaddr_r_proto" in
13701 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13702 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13704 case "$gethostbyaddr_r_proto" in
13705 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13706 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13708 case "$gethostbyaddr_r_proto" in
13709 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13710 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13712 case "$gethostbyaddr_r_proto" in
13713 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13714 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13716 case "$gethostbyaddr_r_proto" in
13717 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13718 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13720 case "$gethostbyaddr_r_proto" in
13721 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13722 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13724 case "$gethostbyaddr_r_proto" in
13725 ''|0) d_gethostbyaddr_r=undef
13726 gethostbyaddr_r_proto=0
13727 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13728 * ) case "$gethostbyaddr_r_proto" in
13729 REENTRANT_PROTO*) ;;
13730 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13732 echo "Prototype: $try" ;;
13735 *) case "$usethreads" in
13736 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13738 d_gethostbyaddr_r=undef
13739 gethostbyaddr_r_proto=0
13743 *) gethostbyaddr_r_proto=0
13747 : see if gethostbyname_r exists
13748 set gethostbyname_r d_gethostbyname_r
13750 case "$d_gethostbyname_r" in
13752 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13753 case "$d_gethostbyname_r_proto:$usethreads" in
13754 ":define") d_gethostbyname_r_proto=define
13755 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13759 case "$d_gethostbyname_r_proto" in
13761 case "$gethostbyname_r_proto" in
13762 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13763 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13765 case "$gethostbyname_r_proto" in
13766 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13767 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13769 case "$gethostbyname_r_proto" in
13770 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13771 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13773 case "$gethostbyname_r_proto" in
13774 ''|0) d_gethostbyname_r=undef
13775 gethostbyname_r_proto=0
13776 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13777 * ) case "$gethostbyname_r_proto" in
13778 REENTRANT_PROTO*) ;;
13779 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13781 echo "Prototype: $try" ;;
13784 *) case "$usethreads" in
13785 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13787 d_gethostbyname_r=undef
13788 gethostbyname_r_proto=0
13792 *) gethostbyname_r_proto=0
13796 : see if gethostent_r exists
13797 set gethostent_r d_gethostent_r
13799 case "$d_gethostent_r" in
13801 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13802 case "$d_gethostent_r_proto:$usethreads" in
13803 ":define") d_gethostent_r_proto=define
13804 set d_gethostent_r_proto gethostent_r $hdrs
13808 case "$d_gethostent_r_proto" in
13810 case "$gethostent_r_proto" in
13811 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13812 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13814 case "$gethostent_r_proto" in
13815 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13816 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13818 case "$gethostent_r_proto" in
13819 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13820 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13822 case "$gethostent_r_proto" in
13823 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13824 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
13826 case "$gethostent_r_proto" in
13827 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13828 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
13830 case "$gethostent_r_proto" in
13831 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13832 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
13834 case "$gethostent_r_proto" in
13835 ''|0) d_gethostent_r=undef
13836 gethostent_r_proto=0
13837 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13838 * ) case "$gethostent_r_proto" in
13839 REENTRANT_PROTO*) ;;
13840 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13842 echo "Prototype: $try" ;;
13845 *) case "$usethreads" in
13846 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13848 d_gethostent_r=undef
13849 gethostent_r_proto=0
13853 *) gethostent_r_proto=0
13857 : see if prototypes for various gethostxxx netdb.h functions are available
13859 set d_gethostprotos gethostent $i_netdb netdb.h
13862 : see if getitimer exists
13863 set getitimer d_getitimer
13866 : see if getlogin exists
13867 set getlogin d_getlogin
13870 : see if getlogin_r exists
13871 set getlogin_r d_getlogin_r
13873 case "$d_getlogin_r" in
13875 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13876 case "$d_getlogin_r_proto:$usethreads" in
13877 ":define") d_getlogin_r_proto=define
13878 set d_getlogin_r_proto getlogin_r $hdrs
13882 case "$d_getlogin_r_proto" in
13884 case "$getlogin_r_proto" in
13885 ''|0) try='int getlogin_r(char*, size_t);'
13886 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
13888 case "$getlogin_r_proto" in
13889 ''|0) try='int getlogin_r(char*, int);'
13890 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
13892 case "$getlogin_r_proto" in
13893 ''|0) try='char* getlogin_r(char*, size_t);'
13894 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
13896 case "$getlogin_r_proto" in
13897 ''|0) try='char* getlogin_r(char*, int);'
13898 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
13900 case "$getlogin_r_proto" in
13901 ''|0) d_getlogin_r=undef
13903 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13904 * ) case "$getlogin_r_proto" in
13905 REENTRANT_PROTO*) ;;
13906 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13908 echo "Prototype: $try" ;;
13911 *) case "$usethreads" in
13912 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13919 *) getlogin_r_proto=0
13923 : see if getmnt exists
13924 set getmnt d_getmnt
13927 : see if getmntent exists
13928 set getmntent d_getmntent
13931 : see if getnetbyaddr exists
13932 set getnetbyaddr d_getnbyaddr
13935 : see if getnetbyname exists
13936 set getnetbyname d_getnbyname
13939 : see if getnetent exists
13940 set getnetent d_getnent
13943 : see if getnetbyaddr_r exists
13944 set getnetbyaddr_r d_getnetbyaddr_r
13946 case "$d_getnetbyaddr_r" in
13948 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13949 case "$d_getnetbyaddr_r_proto:$usethreads" in
13950 ":define") d_getnetbyaddr_r_proto=define
13951 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13955 case "$d_getnetbyaddr_r_proto" in
13957 case "$getnetbyaddr_r_proto" in
13958 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13959 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13961 case "$getnetbyaddr_r_proto" in
13962 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13963 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13965 case "$getnetbyaddr_r_proto" in
13966 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13967 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13969 case "$getnetbyaddr_r_proto" in
13970 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13971 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13973 case "$getnetbyaddr_r_proto" in
13974 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13975 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13977 case "$getnetbyaddr_r_proto" in
13978 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13979 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13981 case "$getnetbyaddr_r_proto" in
13982 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13983 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13985 case "$getnetbyaddr_r_proto" in
13986 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13987 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13989 case "$getnetbyaddr_r_proto" in
13990 ''|0) d_getnetbyaddr_r=undef
13991 getnetbyaddr_r_proto=0
13992 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13993 * ) case "$getnetbyaddr_r_proto" in
13994 REENTRANT_PROTO*) ;;
13995 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13997 echo "Prototype: $try" ;;
14000 *) case "$usethreads" in
14001 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14003 d_getnetbyaddr_r=undef
14004 getnetbyaddr_r_proto=0
14008 *) getnetbyaddr_r_proto=0
14012 : see if getnetbyname_r exists
14013 set getnetbyname_r d_getnetbyname_r
14015 case "$d_getnetbyname_r" in
14017 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14018 case "$d_getnetbyname_r_proto:$usethreads" in
14019 ":define") d_getnetbyname_r_proto=define
14020 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14024 case "$d_getnetbyname_r_proto" in
14026 case "$getnetbyname_r_proto" in
14027 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14028 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14030 case "$getnetbyname_r_proto" in
14031 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14032 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14034 case "$getnetbyname_r_proto" in
14035 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14036 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14038 case "$getnetbyname_r_proto" in
14039 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14040 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14042 case "$getnetbyname_r_proto" in
14043 ''|0) d_getnetbyname_r=undef
14044 getnetbyname_r_proto=0
14045 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14046 * ) case "$getnetbyname_r_proto" in
14047 REENTRANT_PROTO*) ;;
14048 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14050 echo "Prototype: $try" ;;
14053 *) case "$usethreads" in
14054 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14056 d_getnetbyname_r=undef
14057 getnetbyname_r_proto=0
14061 *) getnetbyname_r_proto=0
14065 : see if getnetent_r exists
14066 set getnetent_r d_getnetent_r
14068 case "$d_getnetent_r" in
14070 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14071 case "$d_getnetent_r_proto:$usethreads" in
14072 ":define") d_getnetent_r_proto=define
14073 set d_getnetent_r_proto getnetent_r $hdrs
14077 case "$d_getnetent_r_proto" in
14079 case "$getnetent_r_proto" in
14080 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14081 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14083 case "$getnetent_r_proto" in
14084 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14085 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14087 case "$getnetent_r_proto" in
14088 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14089 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14091 case "$getnetent_r_proto" in
14092 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14093 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14095 case "$getnetent_r_proto" in
14096 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14097 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14099 case "$getnetent_r_proto" in
14100 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14101 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14103 case "$getnetent_r_proto" in
14104 ''|0) d_getnetent_r=undef
14105 getnetent_r_proto=0
14106 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14107 * ) case "$getnetent_r_proto" in
14108 REENTRANT_PROTO*) ;;
14109 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14111 echo "Prototype: $try" ;;
14114 *) case "$usethreads" in
14115 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14117 d_getnetent_r=undef
14118 getnetent_r_proto=0
14122 *) getnetent_r_proto=0
14126 : see if prototypes for various getnetxxx netdb.h functions are available
14128 set d_getnetprotos getnetent $i_netdb netdb.h
14131 : see if getpagesize exists
14132 set getpagesize d_getpagsz
14135 : Optional checks for getprotobyname and getprotobynumber
14137 : see if getprotobyname exists
14138 set getprotobyname d_getpbyname
14141 : see if getprotobynumber exists
14142 set getprotobynumber d_getpbynumber
14145 : see if getprotoent exists
14146 set getprotoent d_getpent
14149 : see if getpgid exists
14150 set getpgid d_getpgid
14153 : see if getpgrp2 exists
14154 set getpgrp2 d_getpgrp2
14157 : see if getppid exists
14158 set getppid d_getppid
14161 : see if getpriority exists
14162 set getpriority d_getprior
14165 : see if getprotobyname_r exists
14166 set getprotobyname_r d_getprotobyname_r
14168 case "$d_getprotobyname_r" in
14170 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14171 case "$d_getprotobyname_r_proto:$usethreads" in
14172 ":define") d_getprotobyname_r_proto=define
14173 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14177 case "$d_getprotobyname_r_proto" in
14179 case "$getprotobyname_r_proto" in
14180 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14181 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14183 case "$getprotobyname_r_proto" in
14184 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14185 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14187 case "$getprotobyname_r_proto" in
14188 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14189 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14191 case "$getprotobyname_r_proto" in
14192 ''|0) d_getprotobyname_r=undef
14193 getprotobyname_r_proto=0
14194 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14195 * ) case "$getprotobyname_r_proto" in
14196 REENTRANT_PROTO*) ;;
14197 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14199 echo "Prototype: $try" ;;
14202 *) case "$usethreads" in
14203 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14205 d_getprotobyname_r=undef
14206 getprotobyname_r_proto=0
14210 *) getprotobyname_r_proto=0
14214 : see if getprotobynumber_r exists
14215 set getprotobynumber_r d_getprotobynumber_r
14217 case "$d_getprotobynumber_r" in
14219 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14220 case "$d_getprotobynumber_r_proto:$usethreads" in
14221 ":define") d_getprotobynumber_r_proto=define
14222 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14226 case "$d_getprotobynumber_r_proto" in
14228 case "$getprotobynumber_r_proto" in
14229 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14230 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14232 case "$getprotobynumber_r_proto" in
14233 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14234 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14236 case "$getprotobynumber_r_proto" in
14237 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14238 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14240 case "$getprotobynumber_r_proto" in
14241 ''|0) d_getprotobynumber_r=undef
14242 getprotobynumber_r_proto=0
14243 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14244 * ) case "$getprotobynumber_r_proto" in
14245 REENTRANT_PROTO*) ;;
14246 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14248 echo "Prototype: $try" ;;
14251 *) case "$usethreads" in
14252 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14254 d_getprotobynumber_r=undef
14255 getprotobynumber_r_proto=0
14259 *) getprotobynumber_r_proto=0
14263 : see if getprotoent_r exists
14264 set getprotoent_r d_getprotoent_r
14266 case "$d_getprotoent_r" in
14268 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14269 case "$d_getprotoent_r_proto:$usethreads" in
14270 ":define") d_getprotoent_r_proto=define
14271 set d_getprotoent_r_proto getprotoent_r $hdrs
14275 case "$d_getprotoent_r_proto" in
14277 case "$getprotoent_r_proto" in
14278 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14279 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14281 case "$getprotoent_r_proto" in
14282 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14283 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14285 case "$getprotoent_r_proto" in
14286 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14287 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14289 case "$getprotoent_r_proto" in
14290 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14291 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14293 case "$getprotoent_r_proto" in
14294 ''|0) d_getprotoent_r=undef
14295 getprotoent_r_proto=0
14296 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14297 * ) case "$getprotoent_r_proto" in
14298 REENTRANT_PROTO*) ;;
14299 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14301 echo "Prototype: $try" ;;
14304 *) case "$usethreads" in
14305 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14307 d_getprotoent_r=undef
14308 getprotoent_r_proto=0
14312 *) getprotoent_r_proto=0
14316 : see if prototypes for various getprotoxxx netdb.h functions are available
14318 set d_getprotoprotos getprotoent $i_netdb netdb.h
14321 : see if getprpwnam exists
14322 set getprpwnam d_getprpwnam
14325 : see if getpwent exists
14326 set getpwent d_getpwent
14329 : see if getpwent_r exists
14330 set getpwent_r d_getpwent_r
14332 case "$d_getpwent_r" in
14334 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14335 case "$d_getpwent_r_proto:$usethreads" in
14336 ":define") d_getpwent_r_proto=define
14337 set d_getpwent_r_proto getpwent_r $hdrs
14341 case "$d_getpwent_r_proto" in
14343 case "$getpwent_r_proto" in
14344 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14345 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14347 case "$getpwent_r_proto" in
14348 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14349 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14351 case "$getpwent_r_proto" in
14352 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14353 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14355 case "$getpwent_r_proto" in
14356 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14357 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14359 case "$getpwent_r_proto" in
14360 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14361 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14363 case "$getpwent_r_proto" in
14364 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14365 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14367 case "$getpwent_r_proto" in
14368 ''|0) d_getpwent_r=undef
14370 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14371 * ) case "$getpwent_r_proto" in
14372 REENTRANT_PROTO*) ;;
14373 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14375 echo "Prototype: $try" ;;
14378 *) case "$usethreads" in
14379 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14386 *) getpwent_r_proto=0
14390 : see if getpwnam_r exists
14391 set getpwnam_r d_getpwnam_r
14393 case "$d_getpwnam_r" in
14395 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14396 case "$d_getpwnam_r_proto:$usethreads" in
14397 ":define") d_getpwnam_r_proto=define
14398 set d_getpwnam_r_proto getpwnam_r $hdrs
14402 case "$d_getpwnam_r_proto" in
14404 case "$getpwnam_r_proto" in
14405 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14406 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14408 case "$getpwnam_r_proto" in
14409 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14410 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14412 case "$getpwnam_r_proto" in
14413 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14414 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14416 case "$getpwnam_r_proto" in
14417 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14418 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14420 case "$getpwnam_r_proto" in
14421 ''|0) d_getpwnam_r=undef
14423 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14424 * ) case "$getpwnam_r_proto" in
14425 REENTRANT_PROTO*) ;;
14426 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14428 echo "Prototype: $try" ;;
14431 *) case "$usethreads" in
14432 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14439 *) getpwnam_r_proto=0
14443 : see if getpwuid_r exists
14444 set getpwuid_r d_getpwuid_r
14446 case "$d_getpwuid_r" in
14448 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14449 case "$d_getpwuid_r_proto:$usethreads" in
14450 ":define") d_getpwuid_r_proto=define
14451 set d_getpwuid_r_proto getpwuid_r $hdrs
14455 case "$d_getpwuid_r_proto" in
14457 case "$getpwuid_r_proto" in
14458 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14459 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14461 case "$getpwuid_r_proto" in
14462 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14463 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14465 case "$getpwuid_r_proto" in
14466 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14467 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14469 case "$getpwuid_r_proto" in
14470 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14471 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14473 case "$getpwuid_r_proto" in
14474 ''|0) d_getpwuid_r=undef
14476 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14477 * ) case "$getpwuid_r_proto" in
14478 REENTRANT_PROTO*) ;;
14479 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14481 echo "Prototype: $try" ;;
14484 *) case "$usethreads" in
14485 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14492 *) getpwuid_r_proto=0
14496 : Optional checks for getsbyname and getsbyport
14498 : see if getservbyname exists
14499 set getservbyname d_getsbyname
14502 : see if getservbyport exists
14503 set getservbyport d_getsbyport
14506 : see if getservent exists
14507 set getservent d_getsent
14510 : see if getservbyname_r exists
14511 set getservbyname_r d_getservbyname_r
14513 case "$d_getservbyname_r" in
14515 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14516 case "$d_getservbyname_r_proto:$usethreads" in
14517 ":define") d_getservbyname_r_proto=define
14518 set d_getservbyname_r_proto getservbyname_r $hdrs
14522 case "$d_getservbyname_r_proto" in
14524 case "$getservbyname_r_proto" in
14525 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14526 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14528 case "$getservbyname_r_proto" in
14529 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14530 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14532 case "$getservbyname_r_proto" in
14533 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14534 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14536 case "$getservbyname_r_proto" in
14537 ''|0) d_getservbyname_r=undef
14538 getservbyname_r_proto=0
14539 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14540 * ) case "$getservbyname_r_proto" in
14541 REENTRANT_PROTO*) ;;
14542 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14544 echo "Prototype: $try" ;;
14547 *) case "$usethreads" in
14548 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14550 d_getservbyname_r=undef
14551 getservbyname_r_proto=0
14555 *) getservbyname_r_proto=0
14559 : see if getservbyport_r exists
14560 set getservbyport_r d_getservbyport_r
14562 case "$d_getservbyport_r" in
14564 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14565 case "$d_getservbyport_r_proto:$usethreads" in
14566 ":define") d_getservbyport_r_proto=define
14567 set d_getservbyport_r_proto getservbyport_r $hdrs
14571 case "$d_getservbyport_r_proto" in
14573 case "$getservbyport_r_proto" in
14574 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14575 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14577 case "$getservbyport_r_proto" in
14578 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14579 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14581 case "$getservbyport_r_proto" in
14582 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14583 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14585 case "$getservbyport_r_proto" in
14586 ''|0) d_getservbyport_r=undef
14587 getservbyport_r_proto=0
14588 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14589 * ) case "$getservbyport_r_proto" in
14590 REENTRANT_PROTO*) ;;
14591 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14593 echo "Prototype: $try" ;;
14596 *) case "$usethreads" in
14597 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14599 d_getservbyport_r=undef
14600 getservbyport_r_proto=0
14604 *) getservbyport_r_proto=0
14608 : see if getservent_r exists
14609 set getservent_r d_getservent_r
14611 case "$d_getservent_r" in
14613 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14614 case "$d_getservent_r_proto:$usethreads" in
14615 ":define") d_getservent_r_proto=define
14616 set d_getservent_r_proto getservent_r $hdrs
14620 case "$d_getservent_r_proto" in
14622 case "$getservent_r_proto" in
14623 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14624 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14626 case "$getservent_r_proto" in
14627 ''|0) try='int getservent_r(struct servent*, char*, int);'
14628 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14630 case "$getservent_r_proto" in
14631 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14632 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14634 case "$getservent_r_proto" in
14635 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14636 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14638 case "$getservent_r_proto" in
14639 ''|0) d_getservent_r=undef
14640 getservent_r_proto=0
14641 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14642 * ) case "$getservent_r_proto" in
14643 REENTRANT_PROTO*) ;;
14644 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14646 echo "Prototype: $try" ;;
14649 *) case "$usethreads" in
14650 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14652 d_getservent_r=undef
14653 getservent_r_proto=0
14657 *) getservent_r_proto=0
14661 : see if prototypes for various getservxxx netdb.h functions are available
14663 set d_getservprotos getservent $i_netdb netdb.h
14666 : see if getspnam exists
14667 set getspnam d_getspnam
14670 : see if this is a shadow.h system
14671 set shadow.h i_shadow
14674 : see if getspnam_r exists
14675 set getspnam_r d_getspnam_r
14677 case "$d_getspnam_r" in
14679 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14680 case "$d_getspnam_r_proto:$usethreads" in
14681 ":define") d_getspnam_r_proto=define
14682 set d_getspnam_r_proto getspnam_r $hdrs
14686 case "$d_getspnam_r_proto" in
14688 case "$getspnam_r_proto" in
14689 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14690 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14692 case "$getspnam_r_proto" in
14693 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14694 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14696 case "$getspnam_r_proto" in
14697 ''|0) d_getspnam_r=undef
14699 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14700 * ) case "$getspnam_r_proto" in
14701 REENTRANT_PROTO*) ;;
14702 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14704 echo "Prototype: $try" ;;
14707 *) case "$usethreads" in
14708 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14715 *) getspnam_r_proto=0
14719 : see if gettimeofday or ftime exists
14720 set gettimeofday d_gettimeod
14722 case "$d_gettimeod" in
14728 val="$undef"; set d_ftime; eval $setvar
14731 case "$d_gettimeod$d_ftime" in
14734 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14738 : see if gmtime_r exists
14739 set gmtime_r d_gmtime_r
14741 case "$d_gmtime_r" in
14743 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14744 case "$d_gmtime_r_proto:$usethreads" in
14745 ":define") d_gmtime_r_proto=define
14746 set d_gmtime_r_proto gmtime_r $hdrs
14750 case "$d_gmtime_r_proto" in
14752 case "$gmtime_r_proto" in
14753 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14754 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
14756 case "$gmtime_r_proto" in
14757 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14758 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
14760 case "$gmtime_r_proto" in
14761 ''|0) d_gmtime_r=undef
14763 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14764 * ) case "$gmtime_r_proto" in
14765 REENTRANT_PROTO*) ;;
14766 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14768 echo "Prototype: $try" ;;
14771 *) case "$usethreads" in
14772 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14779 *) gmtime_r_proto=0
14783 : see if hasmntopt exists
14784 set hasmntopt d_hasmntopt
14787 : see if this is a netinet/in.h or sys/in.h system
14788 set netinet/in.h i_niin sys/in.h i_sysin
14791 : see if arpa/inet.h has to be included
14792 set arpa/inet.h i_arpainet
14795 : see if htonl --and friends-- exists
14800 : Maybe they are macros.
14803 $cat >htonl.c <<EOM
14805 #include <sys/types.h>
14806 #$i_niin I_NETINET_IN
14808 #$i_arpainet I_ARPA_INET
14809 #ifdef I_NETINET_IN
14810 #include <netinet/in.h>
14813 #include <sys/in.h>
14816 #include <arpa/inet.h>
14819 printf("Defined as a macro.");
14822 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14823 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14825 echo "But it seems to be defined as a macro." >&4
14833 : see if ilogbl exists
14834 set ilogbl d_ilogbl
14839 if set index val -f; eval $csym; $val; then
14840 if set strchr val -f d_strchr; eval $csym; $val; then
14841 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14844 echo "strchr() found." >&4
14848 echo "index() found." >&4
14853 echo "index() found." >&4
14856 if set strchr val -f d_strchr; eval $csym; $val; then
14859 echo "strchr() found." >&4
14861 echo "No index() or strchr() found!" >&4
14866 set d_strchr; eval $setvar
14868 set d_index; eval $setvar
14870 : check whether inet_aton exists
14871 set inet_aton d_inetaton
14876 $cat >isascii.c <<EOCP
14879 #$i_stdlib I_STDLIB
14881 #include <stdlib.h>
14892 if eval $compile; then
14893 echo "isascii() found." >&4
14896 echo "isascii() NOT found." >&4
14903 : see if isfinite exists
14904 set isfinite d_isfinite
14907 : see if isinf exists
14911 : see if isnan exists
14915 : see if isnanl exists
14916 set isnanl d_isnanl
14919 : see if killpg exists
14920 set killpg d_killpg
14923 : see if lchown exists
14925 $cat > try.c <<'EOCP'
14926 /* System header to define __stub macros and hopefully few prototypes,
14927 which can conflict with char lchown(); below. */
14928 #include <assert.h>
14929 /* Override any gcc2 internal prototype to avoid an error. */
14930 /* We use char because int might match the return type of a gcc2
14931 builtin and then its argument prototype would still apply. */
14934 /* The GNU C library defines this for functions which it implements
14935 to always fail with ENOSYS. Some functions are actually named
14936 something starting with __ and the normal name is an alias. */
14937 #if defined (__stub_lchown) || defined (__stub___lchown)
14945 if eval $compile; then
14946 $echo "lchown() found." >&4
14949 $echo "lchown() NOT found." >&4
14955 : See if number of significant digits in a double precision number is known
14957 $cat >ldbl_dig.c <<EOM
14958 #$i_limits I_LIMITS
14961 #include <limits.h>
14967 printf("Contains LDBL_DIG");
14970 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14971 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14972 echo "LDBL_DIG found." >&4
14975 echo "LDBL_DIG NOT found." >&4
14982 : see if this is a math.h system
14986 : check to see if math.h defines _LIB_VERSION
14987 d_libm_lib_version="$undef"
14991 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14993 #include <unistd.h>
14995 int main (int argc, char *argv[])
14997 printf ("%d\n", _LIB_VERSION);
15002 if eval $compile; then
15004 echo "Yes, it does ($foo)" >&4
15005 d_libm_lib_version="$define"
15007 echo "No, it does not (probably harmless)" >&4
15014 : see if link exists
15018 : see if localtime_r exists
15019 set localtime_r d_localtime_r
15021 case "$d_localtime_r" in
15023 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15024 case "$d_localtime_r_proto:$usethreads" in
15025 ":define") d_localtime_r_proto=define
15026 set d_localtime_r_proto localtime_r $hdrs
15030 case "$d_localtime_r_proto" in
15032 case "$localtime_r_proto" in
15033 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15034 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15036 case "$localtime_r_proto" in
15037 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15038 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15040 case "$localtime_r_proto" in
15041 ''|0) d_localtime_r=undef
15042 localtime_r_proto=0
15043 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15044 * ) case "$localtime_r_proto" in
15045 REENTRANT_PROTO*) ;;
15046 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15048 echo "Prototype: $try" ;;
15051 *) case "$usethreads" in
15052 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15054 d_localtime_r=undef
15055 localtime_r_proto=0
15059 *) localtime_r_proto=0
15063 : see if localtime_r calls tzset
15064 case "$localtime_r_proto" in
15067 /* Does our libc's localtime_r call tzset ?
15068 * return 0 if so, 1 otherwise.
15070 #$i_systypes I_SYS_TYPES
15071 #$i_unistd I_UNISTD
15073 #$i_stdlib I_STDLIB
15074 #$i_string I_STRING
15075 #$i_malloc I_MALLOC
15077 # include <sys/types.h>
15080 # include <unistd.h>
15086 #include <stdlib.h>
15089 # include <string.h>
15091 # include <strings.h>
15094 # include <malloc.h>
15098 time_t t = time(0L);
15099 char w_tz[]="TZ" "=GMT+5",
15100 e_tz[]="TZ" "=GMT-5",
15101 *tz_e = (char*)malloc(16),
15102 *tz_w = (char*)malloc(16);
15103 struct tm tm_e, tm_w;
15104 memset(&tm_e,'\0',sizeof(struct tm));
15105 memset(&tm_w,'\0',sizeof(struct tm));
15110 localtime_r(&t, &tm_e);
15113 localtime_r(&t, &tm_w);
15115 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15121 if eval $compile; then
15122 if $run ./try; then
15123 d_localtime_r_needs_tzset=undef;
15125 d_localtime_r_needs_tzset=define;
15128 d_localtime_r_needs_tzset=undef;
15132 d_localtime_r_needs_tzset=undef;
15137 : see if localeconv exists
15138 set localeconv d_locconv
15141 : see if lockf exists
15145 : see if prototype for lseek is available
15147 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15150 : see if lstat exists
15154 : see if madvise exists
15155 set madvise d_madvise
15158 : see if malloc_size exists
15159 set malloc_size d_malloc_size
15162 : see if malloc_size_good exists
15163 set malloc_good_size d_malloc_good_size
15166 : see if mblen exists
15170 : see if mbstowcs exists
15171 set mbstowcs d_mbstowcs
15174 : see if mbtowc exists
15175 set mbtowc d_mbtowc
15178 : see if memchr exists
15179 set memchr d_memchr
15182 : see if memcmp exists
15183 set memcmp d_memcmp
15186 : see if memcpy exists
15187 set memcpy d_memcpy
15190 : see if memmove exists
15191 set memmove d_memmove
15194 : see if memset exists
15195 set memset d_memset
15198 : see if mkdir exists
15202 : see if mkdtemp exists
15203 set mkdtemp d_mkdtemp
15206 : see if mkfifo exists
15207 set mkfifo d_mkfifo
15210 : see if mkstemp exists
15211 set mkstemp d_mkstemp
15214 : see if mkstemps exists
15215 set mkstemps d_mkstemps
15218 : see if mktime exists
15219 set mktime d_mktime
15222 : see if this is a sys/mman.h system
15223 set sys/mman.h i_sysmman
15226 : see if mmap exists
15229 : see what shmat returns
15230 : default to something harmless
15232 case "$i_sysmman$d_mmap" in
15234 $cat >mmap.c <<'END'
15235 #include <sys/mman.h>
15238 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15243 echo "and it returns ($mmaptype)." >&4
15249 : see if sqrtl exists
15253 : see if scalbnl exists
15254 set scalbnl d_scalbnl
15257 : see if modfl exists
15261 : see if prototype for modfl is available
15263 set d_modflproto modfl $i_math math.h
15266 d_modfl_pow32_bug="$undef"
15268 case "$d_longdbl$d_modfl" in
15271 Checking to see whether your modfl() is okay for large values...
15277 if $test "X$d_modflproto" != "X$define"; then
15278 $cat >>try.c <<EOCP
15279 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15280 long double modfl (long double, long double *);
15283 $cat >>try.c <<EOCP
15285 long double nv = 4294967303.15;
15291 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15295 case "$osname:$gccversion" in
15296 aix:) saveccflags="$ccflags"
15297 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15300 if eval $compile; then
15303 *" 4294967303.150000 1.150000 4294967302.000000")
15304 echo >&4 "Your modfl() is broken for large values."
15305 d_modfl_pow32_bug="$define"
15307 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15311 *" 4294967303.150000 0.150000 4294967303.000000")
15312 echo >&4 "Your modfl() seems okay for large values."
15314 *) echo >&4 "I don't understand your modfl() at all."
15320 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15323 case "$osname:$gccversion" in
15324 aix:) ccflags="$saveccflags" ;; # restore
15329 if $test "$uselongdouble" = "$define"; then
15331 if $test "$d_sqrtl" != "$define"; then
15332 message="$message sqrtl"
15334 if $test "$d_modfl" != "$define"; then
15335 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15336 echo "You have both aintl and copysignl, so I can emulate modfl."
15338 message="$message modfl"
15341 if $test "$d_frexpl" != "$define"; then
15342 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15343 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15345 message="$message frexpl"
15349 if $test "$message" != ""; then
15352 *** You requested the use of long doubles but you do not seem to have
15353 *** the following mathematical functions needed for long double support:
15355 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15356 *** Cannot continue, aborting.
15364 : see if mprotect exists
15365 set mprotect d_mprotect
15368 : see if msgctl exists
15369 set msgctl d_msgctl
15372 : see if msgget exists
15373 set msgget d_msgget
15376 : see if msgsnd exists
15377 set msgsnd d_msgsnd
15380 : see if msgrcv exists
15381 set msgrcv d_msgrcv
15384 : see how much of the 'msg*(2)' library is present.
15387 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15388 *"$undef"*) h_msg=false;;
15392 case "`ipcs 2>&1`" in
15393 "SVID messages"*"not configured"*)
15394 echo "Your $osname does not have the msg*(2) configured." >&4
15397 set msgctl d_msgctl
15399 set msgget d_msgget
15401 set msgsnd d_msgsnd
15403 set msgrcv d_msgrcv
15409 : we could also check for sys/ipc.h ...
15410 if $h_msg && $test `./findhdr sys/msg.h`; then
15411 echo "You have the full msg*(2) library." >&4
15414 echo "You don't have the full msg*(2) library." >&4
15420 : Check for msghdr_s
15422 echo "Checking to see if your system supports struct msghdr..." >&4
15423 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15425 case "$d_msghdr_s" in
15426 "$define") echo "Yes, it does." ;;
15427 *) echo "No, it doesn't." ;;
15431 : see if msync exists
15435 : see if munmap exists
15436 set munmap d_munmap
15439 : see if nice exists
15443 : see if this is a langinfo.h system
15444 set langinfo.h i_langinfo
15447 : see if nl_langinfo exists
15448 set nl_langinfo d_nl_langinfo
15451 : check for volatile keyword
15453 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15454 $cat >try.c <<'EOCP'
15457 typedef struct _goo_struct goo_struct;
15458 goo_struct * volatile goo = ((goo_struct *)0);
15459 struct _goo_struct {
15464 typedef unsigned short foo_t;
15465 char *volatile foo;
15467 volatile foo_t blech;
15471 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15473 echo "Yup, it does."
15476 echo "Nope, it doesn't."
15482 : Check basic sizes
15484 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15486 case "$use64bitint:$d_quad:$quadtype" in
15489 uvtype="$uquadtype"
15494 uvtype="unsigned long"
15500 case "$uselongdouble:$d_longdbl" in
15502 nvtype="long double"
15503 nvsize=$longdblsize
15510 $echo "(IV will be "$ivtype", $ivsize bytes)"
15511 $echo "(UV will be "$uvtype", $uvsize bytes)"
15512 $echo "(NV will be "$nvtype", $nvsize bytes)"
15515 #$i_inttypes I_INTTYPES
15517 #include <inttypes.h>
15522 int8_t i = INT8_MAX;
15523 uint8_t u = UINT8_MAX;
15524 printf("int8_t\n");
15527 int16_t i = INT16_MAX;
15528 uint16_t i = UINT16_MAX;
15529 printf("int16_t\n");
15532 int32_t i = INT32_MAX;
15533 uint32_t u = UINT32_MAX;
15534 printf("int32_t\n");
15539 i8type="signed char"
15540 u8type="unsigned char"
15545 '') case "$shortsize" in
15547 u16type="unsigned short"
15555 '') set try -DINT16
15556 if eval $compile; then
15557 case "`$run ./try`" in
15569 '') if $test $shortsize -ge 2; then
15571 u16type="unsigned short"
15579 '') case "$longsize" in
15581 u32type="unsigned long"
15585 *) case "$intsize" in
15587 u32type="unsigned int"
15597 '') set try -DINT32
15598 if eval $compile; then
15599 case "`$run ./try`" in
15611 '') if $test $intsize -ge 4; then
15613 u32type="unsigned int"
15621 '') case "$d_quad:$quadtype" in
15623 i64type="$quadtype"
15624 u64type="$uquadtype"
15632 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15633 : volatile so that the compiler has to store it out to memory.
15634 if test X"$d_volatile" = X"$define"; then
15639 #$i_stdlib I_STDLIB
15641 #include <stdlib.h>
15643 #include <sys/types.h>
15644 #include <signal.h>
15646 $volatile int bletched = 0;
15647 $signal_t blech(int s) { bletched = 1; }
15652 int n = 8 * $uvsize;
15655 signal(SIGFPE, blech);
15658 for (i = 0; i < n; i++) {
15659 u = u << 1 | ($uvtype)1;
15661 if (($uvtype)d != u)
15665 d = ($nvtype)(u - 1);
15666 if (($uvtype)d != (u - 1))
15673 printf("%d\n", ((i == n) ? -n : i));
15679 d_nv_preserves_uv="$undef"
15680 if eval $compile; then
15681 nv_preserves_uv_bits="`$run ./try`"
15683 case "$nv_preserves_uv_bits" in
15685 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15686 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15687 d_nv_preserves_uv="$define"
15689 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15690 d_nv_preserves_uv="$undef" ;;
15691 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15692 nv_preserves_uv_bits="0" ;;
15696 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15697 : volatile so that the compiler has to store it out to memory.
15698 if test X"$d_volatile" = X"$define"; then
15704 typedef $nvtype NV;
15711 while(count < 256) {
15712 $volatile NV up = value + 1.0;
15713 $volatile NV negated = -value;
15714 $volatile NV down = negated - 1.0;
15715 $volatile NV got_up = up - value;
15716 int up_good = got_up == 1.0;
15717 int got_down = down - negated;
15718 int down_good = got_down == -1.0;
15720 if (down_good != up_good) {
15722 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15723 up_good, (double) got_up, down_good, (double) got_down,
15724 count, (double) value);
15731 fputs("256.0", stdout);
15734 fputs("2.0", stdout);
15740 fputs("*", stdout);
15746 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15747 count, (double) value);
15753 nv_overflows_integers_at='0'
15754 if eval $compile; then
15760 The largest integer your NVs can preserve is equal to $xxx
15762 nv_overflows_integers_at="$xxx"
15765 Cannot determine the largest integer value your NVs can hold, unexpected output
15772 Cannot determine the largest integer value your NVs can hold
15779 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15780 : volatile so that the compiler has to store it out to memory.
15781 if test X"$d_volatile" = X"$define"; then
15786 #$i_stdlib I_STDLIB
15788 #include <stdlib.h>
15790 #$i_string I_STRING
15792 # include <string.h>
15794 # include <strings.h>
15796 #include <sys/types.h>
15797 #include <signal.h>
15799 $volatile int bletched = 0;
15800 $signal_t blech(int s) { bletched = 1; }
15803 int checkit($nvtype d, char *where) {
15804 unsigned char *p = (char *)&d;
15805 unsigned char *end = p + sizeof(d);
15815 printf("No - %s: 0x", where);
15817 printf ("%02X", *p++);
15822 int main(int argc, char **argv) {
15825 fail += checkit(d, "0.0");
15827 /* The compiler shouldn't be assuming that bletched is 0 */
15830 fail += checkit(d, "bleched");
15833 signal(SIGFPE, blech);
15836 /* Paranoia - the compiler should have no way of knowing that ANSI says
15837 that argv[argc] will always be NULL. Actually, if it did assume this it
15838 would be buggy, as this is C and main() can be called from elsewhere in
15840 d = argv[argc] ? 1 : 0;
15843 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15846 fail += checkit(d, "ternary");
15848 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15851 printf("No - memset doesn't give 0.0\n");
15852 /* This might just blow up: */
15853 printf("(gives %g)\n", d);
15859 printf("No - something bleched\n");
15864 printf("No - %d fail(s)\n", fail);
15873 d_nv_zero_is_allbits_zero="$undef"
15874 if eval $compile; then
15880 0.0 is represented as all bits zero in memory
15882 d_nv_zero_is_allbits_zero="$define"
15885 0.0 is not represented as all bits zero in memory
15887 d_nv_zero_is_allbits_zero="$undef"
15892 0.0 is not represented as all bits zero in memory
15894 d_nv_zero_is_allbits_zero="$undef"
15900 : check for off64_t
15902 echo "Checking to see if you have off64_t..." >&4
15904 #include <sys/types.h>
15905 #include <unistd.h>
15906 int main() { off64_t x = 7; }
15909 if eval $compile; then
15911 echo "You have off64_t."
15914 echo "You do not have off64_t."
15915 case "$lseeksize" in
15916 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15923 : how to create joinable pthreads
15924 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15926 echo "Checking what constant to use for creating joinable pthreads..." >&4
15927 $cat >try.c <<'EOCP'
15928 #include <pthread.h>
15930 int detachstate = JOINABLE;
15933 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15934 if eval $compile; then
15935 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15936 val="$undef" # Yes, undef.
15937 set d_old_pthread_create_joinable
15940 set old_pthread_create_joinable
15943 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15944 if eval $compile; then
15945 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15947 set d_old_pthread_create_joinable
15949 val=PTHREAD_CREATE_UNDETACHED
15950 set old_pthread_create_joinable
15953 set try -DJOINABLE=__UNDETACHED
15954 if eval $compile; then
15955 echo "You seem to use __UNDETACHED." >&4
15957 set d_old_pthread_create_joinable
15960 set old_pthread_create_joinable
15963 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15965 set d_old_pthread_create_joinable
15968 set old_pthread_create_joinable
15975 d_old_pthread_create_joinable="$undef"
15976 old_pthread_create_joinable=""
15979 : see if pause exists
15983 : see if poll exists
15987 : see if readlink exists
15988 set readlink d_readlink
15991 : Check if exe is symlink to abs path of executing program
15995 case "$d_readlink" in
15997 if $issymlink /proc/self/exe ; then
15998 $ls -l /proc/self/exe > reflect
15999 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16000 echo "You have Linux-like /proc/self/exe."
16001 procselfexe='"/proc/self/exe"'
16005 if $issymlink /proc/curproc/file ; then
16006 $ls -l /proc/curproc/file > reflect
16007 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16008 echo "You have BSD-like /proc/curproc/file."
16009 procselfexe='"/proc/curproc/file"'
16019 : backward compatibility for d_hvfork
16020 if test X$d_hvfork != X; then
16021 d_vfork="$d_hvfork"
16024 : see if there is a vfork
16029 d_pseudofork=$undef
16031 : Ok, but do we want to use it. vfork is reportedly unreliable in
16032 : perl on Solaris 2.x, and probably elsewhere.
16036 case "$usevfork" in
16042 Perl can only use a vfork() that doesn't suffer from strict
16043 restrictions on calling functions or modifying global data in
16044 the child. For example, glibc-2.1 contains such a vfork()
16045 that is unsuitable. If your system provides a proper fork()
16046 call, chances are that you do NOT want perl to use vfork().
16049 rp="Do you still want to use vfork()?"
16054 echo "Ok, we won't use vfork()."
16063 $define) usevfork='true';;
16064 *) usevfork='false';;
16067 : see whether the pthread_atfork exists
16069 #include <pthread.h>
16072 #ifdef PTHREAD_ATFORK
16073 pthread_atfork(NULL,NULL,NULL);
16078 : see if pthread_atfork exists
16079 set try -DPTHREAD_ATFORK
16080 if eval $compile; then
16085 case "$usethreads" in
16088 $define) echo 'pthread_atfork found.' >&4 ;;
16089 *) echo 'pthread_atfork NOT found.' >&4 ;;
16092 set d_pthread_atfork
16095 : see if pthread_attr_setscope exists
16096 set pthread_attr_setscope d_pthread_attr_setscope
16099 : see whether the various POSIXish _yields exist
16101 #include <pthread.h>
16107 #ifdef PTHREAD_YIELD
16110 #ifdef PTHREAD_YIELD_NULL
16111 pthread_yield(NULL);
16117 : see if sched_yield exists
16118 set try -DSCHED_YIELD
16119 if eval $compile; then
16121 sched_yield='sched_yield()'
16125 case "$usethreads" in
16128 $define) echo 'sched_yield() found.' >&4 ;;
16129 *) echo 'sched_yield() NOT found.' >&4 ;;
16135 : see if pthread_yield exists
16136 set try -DPTHREAD_YIELD
16137 if eval $compile; then
16139 case "$sched_yield" in
16140 '') sched_yield='pthread_yield()' ;;
16143 set try -DPTHREAD_YIELD_NULL
16144 if eval $compile; then
16146 case "$sched_yield" in
16147 '') sched_yield='pthread_yield(NULL)' ;;
16153 case "$usethreads" in
16156 $define) echo 'pthread_yield() found.' >&4 ;;
16157 *) echo 'pthread_yield() NOT found.' >&4 ;;
16161 set d_pthread_yield
16163 case "$sched_yield" in
16164 '') sched_yield=undef ;;
16168 : see if random_r exists
16169 set random_r d_random_r
16171 case "$d_random_r" in
16173 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16174 case "$d_random_r_proto:$usethreads" in
16175 ":define") d_random_r_proto=define
16176 set d_random_r_proto random_r $hdrs
16180 case "$d_random_r_proto" in
16182 case "$random_r_proto" in
16183 ''|0) try='int random_r(int*, struct random_data*);'
16184 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16186 case "$random_r_proto" in
16187 ''|0) try='int random_r(long*, struct random_data*);'
16188 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16190 case "$random_r_proto" in
16191 ''|0) try='int random_r(struct random_data*, int32_t*);'
16192 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16194 case "$random_r_proto" in
16195 ''|0) d_random_r=undef
16197 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16198 * ) case "$random_r_proto" in
16199 REENTRANT_PROTO*) ;;
16200 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16202 echo "Prototype: $try" ;;
16205 *) case "$usethreads" in
16206 define) echo "random_r has no prototype, not using it." >&4 ;;
16213 *) random_r_proto=0
16217 : see if readdir and friends exist
16218 set readdir d_readdir
16220 set seekdir d_seekdir
16222 set telldir d_telldir
16224 set rewinddir d_rewinddir
16227 : see if readdir64_r exists
16228 set readdir64_r d_readdir64_r
16230 case "$d_readdir64_r" in
16232 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16233 case "$d_readdir64_r_proto:$usethreads" in
16234 ":define") d_readdir64_r_proto=define
16235 set d_readdir64_r_proto readdir64_r $hdrs
16239 case "$d_readdir64_r_proto" in
16241 case "$readdir64_r_proto" in
16242 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16243 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16245 case "$readdir64_r_proto" in
16246 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16247 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16249 case "$readdir64_r_proto" in
16250 ''|0) d_readdir64_r=undef
16251 readdir64_r_proto=0
16252 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16253 * ) case "$readdir64_r_proto" in
16254 REENTRANT_PROTO*) ;;
16255 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16257 echo "Prototype: $try" ;;
16260 *) case "$usethreads" in
16261 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16263 d_readdir64_r=undef
16264 readdir64_r_proto=0
16268 *) readdir64_r_proto=0
16272 : see if readdir_r exists
16273 set readdir_r d_readdir_r
16275 case "$d_readdir_r" in
16277 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16278 case "$d_readdir_r_proto:$usethreads" in
16279 ":define") d_readdir_r_proto=define
16280 set d_readdir_r_proto readdir_r $hdrs
16284 case "$d_readdir_r_proto" in
16286 case "$readdir_r_proto" in
16287 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16288 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16290 case "$readdir_r_proto" in
16291 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16292 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16294 case "$readdir_r_proto" in
16295 ''|0) d_readdir_r=undef
16297 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16298 * ) case "$readdir_r_proto" in
16299 REENTRANT_PROTO*) ;;
16300 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16302 echo "Prototype: $try" ;;
16305 *) case "$usethreads" in
16306 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16313 *) readdir_r_proto=0
16317 : see if readv exists
16321 : see if recvmsg exists
16322 set recvmsg d_recvmsg
16325 : see if rename exists
16326 set rename d_rename
16329 : see if rmdir exists
16333 : see if memory.h is available.
16338 : See if it conflicts with string.h
16344 $cppstdin $cppflags $cppminus < $strings > mem.h
16345 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16347 echo "We won't be including <memory.h>."
16357 : can bcopy handle overlapping blocks?
16360 case "$d_memmove" in
16361 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16362 *) case "$d_bcopy" in
16364 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16366 #$i_memory I_MEMORY
16367 #$i_stdlib I_STDLIB
16368 #$i_string I_STRING
16369 #$i_unistd I_UNISTD
16371 $cat >>try.c <<'EOCP'
16374 # include <memory.h>
16377 # include <stdlib.h>
16380 # include <string.h>
16382 # include <strings.h>
16385 # include <unistd.h> /* Needed for NetBSD */
16389 char buf[128], abc[128];
16395 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16396 try to store the string in read-only memory. */
16397 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16399 for (align = 7; align >= 0; align--) {
16400 for (len = 36; len; len--) {
16402 bcopy(abc, b, len);
16403 for (off = 1; off <= len; off++) {
16404 bcopy(b, b+off, len);
16405 bcopy(b+off, b, len);
16406 if (bcmp(b, abc, len))
16415 if eval $compile_ok; then
16416 if $run ./try 2>/dev/null; then
16417 echo "Yes, it can."
16420 echo "It can't, sorry."
16423 echo "(I can't compile the test program, so we'll assume not...)"
16433 : can memcpy handle overlapping blocks?
16436 case "$d_memmove" in
16437 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16438 *) case "$d_memcpy" in
16440 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16442 #$i_memory I_MEMORY
16443 #$i_stdlib I_STDLIB
16444 #$i_string I_STRING
16445 #$i_unistd I_UNISTD
16447 $cat >>try.c <<'EOCP'
16450 # include <memory.h>
16453 # include <stdlib.h>
16456 # include <string.h>
16458 # include <strings.h>
16461 # include <unistd.h> /* Needed for NetBSD */
16465 char buf[128], abc[128];
16471 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16472 try to store the string in read-only memory. */
16473 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16475 for (align = 7; align >= 0; align--) {
16476 for (len = 36; len; len--) {
16478 memcpy(b, abc, len);
16479 for (off = 1; off <= len; off++) {
16480 memcpy(b+off, b, len);
16481 memcpy(b, b+off, len);
16482 if (memcmp(b, abc, len))
16491 if eval $compile_ok; then
16492 if $run ./try 2>/dev/null; then
16493 echo "Yes, it can."
16496 echo "It can't, sorry."
16499 echo "(I can't compile the test program, so we'll assume not...)"
16509 : can memcmp be trusted to compare relative magnitude?
16511 case "$d_memcmp" in
16514 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16516 #$i_memory I_MEMORY
16517 #$i_stdlib I_STDLIB
16518 #$i_string I_STRING
16519 #$i_unistd I_UNISTD
16521 $cat >>try.c <<'EOCP'
16524 # include <memory.h>
16527 # include <stdlib.h>
16530 # include <string.h>
16532 # include <strings.h>
16535 # include <unistd.h> /* Needed for NetBSD */
16541 if ((a < b) && memcmp(&a, &b, 1) < 0)
16547 if eval $compile_ok; then
16548 if $run ./try 2>/dev/null; then
16549 echo "Yes, it can."
16552 echo "No, it can't (it uses signed chars)."
16555 echo "(I can't compile the test program, so we'll assume not...)"
16563 : see if prototype for sbrk is available
16565 set d_sbrkproto sbrk $i_unistd unistd.h
16568 : see if select exists
16569 set select d_select
16572 : see if semctl exists
16573 set semctl d_semctl
16576 : see if semget exists
16577 set semget d_semget
16580 : see if semop exists
16584 : see how much of the 'sem*(2)' library is present.
16587 case "$d_semctl$d_semget$d_semop" in
16588 *"$undef"*) h_sem=false;;
16592 case "`ipcs 2>&1`" in
16593 "SVID messages"*"not configured"*)
16594 echo "Your $osname does not have the sem*(2) configured." >&4
16597 set semctl d_semctl
16599 set semget d_semget
16607 : we could also check for sys/ipc.h ...
16608 if $h_sem && $test `./findhdr sys/sem.h`; then
16609 echo "You have the full sem*(2) library." >&4
16612 echo "You don't have the full sem*(2) library." >&4
16618 : see whether sys/sem.h defines union semun
16620 $cat > try.c <<'END'
16621 #include <sys/types.h>
16622 #include <sys/ipc.h>
16623 #include <sys/sem.h>
16624 int main () { union semun semun; semun.buf = 0; }
16627 if eval $compile; then
16628 echo "You have union semun in <sys/sem.h>." >&4
16631 echo "You do not have union semun in <sys/sem.h>." >&4
16638 : see how to do semctl IPC_STAT
16642 $cat > tryh.h <<END
16645 # define S_IRUSR S_IREAD
16646 # define S_IWUSR S_IWRITE
16647 # define S_IXUSR S_IEXEC
16649 # define S_IRUSR 0400
16650 # define S_IWUSR 0200
16651 # define S_IXUSR 0100
16653 # define S_IRGRP (S_IRUSR>>3)
16654 # define S_IWGRP (S_IWUSR>>3)
16655 # define S_IXGRP (S_IXUSR>>3)
16656 # define S_IROTH (S_IRUSR>>6)
16657 # define S_IWOTH (S_IWUSR>>6)
16658 # define S_IXOTH (S_IXUSR>>6)
16661 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16662 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16663 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16666 : see whether semctl IPC_STAT can use union semun
16667 case "$d_semctl_semun" in
16671 #include <sys/types.h>
16672 #include <sys/ipc.h>
16673 #include <sys/sem.h>
16674 #include <sys/stat.h>
16681 #$d_union_semun HAS_UNION_SEMUN
16684 #ifndef HAS_UNION_SEMUN
16687 struct semid_ds *buf;
16688 unsigned short *array;
16694 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16695 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16697 struct semid_ds argbuf;
16700 st = semctl(sem, 0, IPC_STAT, arg);
16704 # endif /* IPC_STAT */
16705 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16707 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16708 # endif /* IPC_RMID */
16709 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16711 #endif /* IPC_PRIVATE && ... */
16712 printf("semget failed: errno = %d\n", errno);
16717 if eval $compile; then
16720 semun) val="$define" ;;
16728 case "$d_semctl_semun" in
16730 echo "You can use union semun for semctl IPC_STAT." >&4
16733 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16738 : see whether semctl IPC_STAT can use struct semid_ds pointer
16739 case "$d_semctl_semid_ds" in
16742 $cat > try.c <<'END'
16743 #include <sys/types.h>
16744 #include <sys/ipc.h>
16745 #include <sys/sem.h>
16746 #include <sys/stat.h>
16754 struct semid_ds arg;
16757 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16758 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16761 st = semctl(sem, 0, IPC_STAT, &arg);
16763 printf("semid_ds\n");
16765 # endif /* IPC_STAT */
16766 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16768 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16769 # endif /* IPC_RMID */
16770 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16772 #endif /* IPC_PRIVATE && ... */
16773 printf("semget failed: errno = %d\n", errno);
16779 if eval $compile; then
16782 semid_ds) val="$define" ;;
16786 set d_semctl_semid_ds
16790 case "$d_semctl_semid_ds" in
16792 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16794 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16800 # We do not have the full sem*(2) library, so assume we can not
16806 set d_semctl_semid_ds
16812 : see if sendmsg exists
16813 set sendmsg d_sendmsg
16816 : see if setegid exists
16817 set setegid d_setegid
16820 : see if seteuid exists
16821 set seteuid d_seteuid
16824 : see if setgrent exists
16825 set setgrent d_setgrent
16828 : see if setgrent_r exists
16829 set setgrent_r d_setgrent_r
16831 case "$d_setgrent_r" in
16833 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16834 case "$d_setgrent_r_proto:$usethreads" in
16835 ":define") d_setgrent_r_proto=define
16836 set d_setgrent_r_proto setgrent_r $hdrs
16840 case "$d_setgrent_r_proto" in
16842 case "$setgrent_r_proto" in
16843 ''|0) try='int setgrent_r(FILE**);'
16844 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
16846 case "$setgrent_r_proto" in
16847 ''|0) try='void setgrent_r(FILE**);'
16848 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
16850 case "$setgrent_r_proto" in
16851 ''|0) d_setgrent_r=undef
16853 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16854 * ) case "$setgrent_r_proto" in
16855 REENTRANT_PROTO*) ;;
16856 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16858 echo "Prototype: $try" ;;
16861 *) case "$usethreads" in
16862 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16869 *) setgrent_r_proto=0
16873 : see if sethostent exists
16874 set sethostent d_sethent
16877 : see if sethostent_r exists
16878 set sethostent_r d_sethostent_r
16880 case "$d_sethostent_r" in
16882 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16883 case "$d_sethostent_r_proto:$usethreads" in
16884 ":define") d_sethostent_r_proto=define
16885 set d_sethostent_r_proto sethostent_r $hdrs
16889 case "$d_sethostent_r_proto" in
16891 case "$sethostent_r_proto" in
16892 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16893 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
16895 case "$sethostent_r_proto" in
16896 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16897 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
16899 case "$sethostent_r_proto" in
16900 ''|0) d_sethostent_r=undef
16901 sethostent_r_proto=0
16902 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16903 * ) case "$sethostent_r_proto" in
16904 REENTRANT_PROTO*) ;;
16905 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16907 echo "Prototype: $try" ;;
16910 *) case "$usethreads" in
16911 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16913 d_sethostent_r=undef
16914 sethostent_r_proto=0
16918 *) sethostent_r_proto=0
16922 : see if setitimer exists
16923 set setitimer d_setitimer
16926 : see if setlinebuf exists
16927 set setlinebuf d_setlinebuf
16930 : see if setlocale exists
16931 set setlocale d_setlocale
16934 : see if locale.h is available
16935 set locale.h i_locale
16938 : see if setlocale_r exists
16939 set setlocale_r d_setlocale_r
16941 case "$d_setlocale_r" in
16943 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16944 case "$d_setlocale_r_proto:$usethreads" in
16945 ":define") d_setlocale_r_proto=define
16946 set d_setlocale_r_proto setlocale_r $hdrs
16950 case "$d_setlocale_r_proto" in
16952 case "$setlocale_r_proto" in
16953 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16954 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16956 case "$setlocale_r_proto" in
16957 ''|0) d_setlocale_r=undef
16958 setlocale_r_proto=0
16959 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16960 * ) case "$setlocale_r_proto" in
16961 REENTRANT_PROTO*) ;;
16962 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16964 echo "Prototype: $try" ;;
16967 *) case "$usethreads" in
16968 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16970 d_setlocale_r=undef
16971 setlocale_r_proto=0
16975 *) setlocale_r_proto=0
16979 : see if setnetent exists
16980 set setnetent d_setnent
16983 : see if setnetent_r exists
16984 set setnetent_r d_setnetent_r
16986 case "$d_setnetent_r" in
16988 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16989 case "$d_setnetent_r_proto:$usethreads" in
16990 ":define") d_setnetent_r_proto=define
16991 set d_setnetent_r_proto setnetent_r $hdrs
16995 case "$d_setnetent_r_proto" in
16997 case "$setnetent_r_proto" in
16998 ''|0) try='int setnetent_r(int, struct netent_data*);'
16999 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17001 case "$setnetent_r_proto" in
17002 ''|0) try='void setnetent_r(int, struct netent_data*);'
17003 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17005 case "$setnetent_r_proto" in
17006 ''|0) d_setnetent_r=undef
17007 setnetent_r_proto=0
17008 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17009 * ) case "$setnetent_r_proto" in
17010 REENTRANT_PROTO*) ;;
17011 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17013 echo "Prototype: $try" ;;
17016 *) case "$usethreads" in
17017 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17019 d_setnetent_r=undef
17020 setnetent_r_proto=0
17024 *) setnetent_r_proto=0
17028 : see if setprotoent exists
17029 set setprotoent d_setpent
17032 : see if setpgid exists
17033 set setpgid d_setpgid
17036 : see if setpgrp2 exists
17037 set setpgrp2 d_setpgrp2
17040 : see if setpriority exists
17041 set setpriority d_setprior
17044 : see if setproctitle exists
17045 set setproctitle d_setproctitle
17048 : see if setprotoent_r exists
17049 set setprotoent_r d_setprotoent_r
17051 case "$d_setprotoent_r" in
17053 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17054 case "$d_setprotoent_r_proto:$usethreads" in
17055 ":define") d_setprotoent_r_proto=define
17056 set d_setprotoent_r_proto setprotoent_r $hdrs
17060 case "$d_setprotoent_r_proto" in
17062 case "$setprotoent_r_proto" in
17063 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17064 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17066 case "$setprotoent_r_proto" in
17067 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17068 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17070 case "$setprotoent_r_proto" in
17071 ''|0) d_setprotoent_r=undef
17072 setprotoent_r_proto=0
17073 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17074 * ) case "$setprotoent_r_proto" in
17075 REENTRANT_PROTO*) ;;
17076 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17078 echo "Prototype: $try" ;;
17081 *) case "$usethreads" in
17082 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17084 d_setprotoent_r=undef
17085 setprotoent_r_proto=0
17089 *) setprotoent_r_proto=0
17093 : see if setpwent exists
17094 set setpwent d_setpwent
17097 : see if setpwent_r exists
17098 set setpwent_r d_setpwent_r
17100 case "$d_setpwent_r" in
17102 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17103 case "$d_setpwent_r_proto:$usethreads" in
17104 ":define") d_setpwent_r_proto=define
17105 set d_setpwent_r_proto setpwent_r $hdrs
17109 case "$d_setpwent_r_proto" in
17111 case "$setpwent_r_proto" in
17112 ''|0) try='int setpwent_r(FILE**);'
17113 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17115 case "$setpwent_r_proto" in
17116 ''|0) try='void setpwent_r(FILE**);'
17117 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17119 case "$setpwent_r_proto" in
17120 ''|0) d_setpwent_r=undef
17122 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17123 * ) case "$setpwent_r_proto" in
17124 REENTRANT_PROTO*) ;;
17125 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17127 echo "Prototype: $try" ;;
17130 *) case "$usethreads" in
17131 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17138 *) setpwent_r_proto=0
17142 : see if setregid exists
17143 set setregid d_setregid
17145 set setresgid d_setresgid
17148 : see if setreuid exists
17149 set setreuid d_setreuid
17151 set setresuid d_setresuid
17154 : see if setrgid exists
17155 set setrgid d_setrgid
17158 : see if setruid exists
17159 set setruid d_setruid
17162 : see if setservent exists
17163 set setservent d_setsent
17166 : see if setservent_r exists
17167 set setservent_r d_setservent_r
17169 case "$d_setservent_r" in
17171 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17172 case "$d_setservent_r_proto:$usethreads" in
17173 ":define") d_setservent_r_proto=define
17174 set d_setservent_r_proto setservent_r $hdrs
17178 case "$d_setservent_r_proto" in
17180 case "$setservent_r_proto" in
17181 ''|0) try='int setservent_r(int, struct servent_data*);'
17182 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17184 case "$setservent_r_proto" in
17185 ''|0) try='void setservent_r(int, struct servent_data*);'
17186 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17188 case "$setservent_r_proto" in
17189 ''|0) d_setservent_r=undef
17190 setservent_r_proto=0
17191 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17192 * ) case "$setservent_r_proto" in
17193 REENTRANT_PROTO*) ;;
17194 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17196 echo "Prototype: $try" ;;
17199 *) case "$usethreads" in
17200 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17202 d_setservent_r=undef
17203 setservent_r_proto=0
17207 *) setservent_r_proto=0
17211 : see if setsid exists
17212 set setsid d_setsid
17215 : see if setvbuf exists
17216 set setvbuf d_setvbuf
17219 : see if sfio.h is available
17223 : see if sfio library is available
17234 : Ok, but do we want to use it.
17238 true|$define|[yY]*) dflt='y';;
17241 echo "$package can use the sfio library, but it is experimental."
17242 case "$useperlio" in
17244 echo "For sfio also the PerlIO abstraction layer is needed."
17245 echo "Earlier you said you wouldn't want that."
17248 rp="You seem to have sfio available, do you want to try using it?"
17251 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
17252 useperlio="$define"
17255 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17260 *) case "$usesfio" in
17261 true|$define|[yY]*)
17262 echo "Sorry, cannot find sfio on this machine." >&4
17263 echo "Ignoring your setting of usesfio=$usesfio." >&4
17272 $define) usesfio='true';;
17273 *) usesfio='false';;
17277 *) : Remove sfio from list of libraries to use
17280 echo "Removing unneeded -lsfio from library list" >&4
17281 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17284 echo "libs = $libs" >&4
17291 : see if shmctl exists
17292 set shmctl d_shmctl
17295 : see if shmget exists
17296 set shmget d_shmget
17299 : see if shmat exists
17302 : see what shmat returns
17305 $cat >shmat.c <<'END'
17306 #include <sys/shm.h>
17309 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17314 echo "and it returns ($shmattype)." >&4
17315 : see if a prototype for shmat is available
17316 xxx=`./findhdr sys/shm.h`
17317 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17318 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17329 set d_shmatprototype
17332 : see if shmdt exists
17336 : see how much of the 'shm*(2)' library is present.
17339 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17340 *"$undef"*) h_shm=false;;
17344 case "`ipcs 2>&1`" in
17345 "SVID shared memory"*"not configured"*)
17346 echo "Your $osname does not have the shm*(2) configured." >&4
17349 set shmctl d_shmctl
17351 set shmget d_shmget
17361 : we could also check for sys/ipc.h ...
17362 if $h_shm && $test `./findhdr sys/shm.h`; then
17363 echo "You have the full shm*(2) library." >&4
17366 echo "You don't have the full shm*(2) library." >&4
17372 : see if we have sigaction
17374 if set sigaction val -f d_sigaction; eval $csym; $val; then
17375 echo 'sigaction() found.' >&4
17378 #include <sys/types.h>
17379 #include <signal.h>
17380 #$i_stdlib I_STDLIB
17382 #include <stdlib.h>
17386 struct sigaction act, oact;
17388 oact.sa_handler = 0;
17389 /* so that act and oact are used */
17390 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17394 if eval $compile_ok; then
17397 echo "But you don't seem to have a useable struct sigaction." >&4
17401 echo 'sigaction NOT found.' >&4
17404 set d_sigaction; eval $setvar
17407 : see if this is a sunmath.h system
17408 set sunmath.h i_sunmath
17411 : see if signbit exists
17412 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17415 #$i_sunmath I_SUNMATH
17419 #ifdef I_SUNMATH /* Solaris special math library */
17420 # include <sunmath.h>
17423 int main(int argc, char **argv)
17427 if ((signbit(x) == 0) && (signbit(y) != 0))
17435 if eval $compile; then
17436 if $run ./try; then
17440 $echo "Signbit seems to be available, but doesn't work as I expected."
17441 $echo "I won't use it." >&4
17452 : see if sigprocmask exists
17453 set sigprocmask d_sigprocmask
17456 : see if sigsetjmp exists
17458 case "$d_sigsetjmp" in
17461 #include <setjmp.h>
17462 #$i_stdlib I_STDLIB
17464 #include <stdlib.h>
17470 if (sigsetjmp(env,1))
17473 siglongjmp(env, 1);
17478 if eval $compile; then
17479 if $run ./try >/dev/null 2>&1; then
17480 echo "POSIX sigsetjmp found." >&4
17484 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17490 echo "sigsetjmp not found." >&4
17494 *) val="$d_sigsetjmp"
17495 case "$d_sigsetjmp" in
17496 $define) echo "POSIX sigsetjmp found." >&4;;
17497 $undef) echo "sigsetjmp not found." >&4;;
17505 : see if snprintf exists
17506 set snprintf d_snprintf
17509 : see if vsnprintf exists
17510 set vsnprintf d_vsnprintf
17513 case "$d_snprintf-$d_vsnprintf" in
17516 Checking whether your snprintf() and vsnprintf() work okay...
17518 $cat >try.c <<'EOCP'
17519 /* v?snprintf testing logic courtesy of Russ Allbery.
17520 * According to C99:
17521 * - if the buffer is too short it still must be \0-terminated
17522 * - if the buffer is too short the potentially required length
17523 * must be returned and not -1
17524 * - if the buffer is NULL the potentially required length
17525 * must be returned and not -1 or core dump
17528 #include <stdarg.h>
17532 int test (char *format, ...)
17537 va_start (args, format);
17538 count = vsnprintf (buf, sizeof buf, format, args);
17545 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17546 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17550 if eval $compile; then
17553 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17555 Your snprintf() and snprintf() don't seem to be working okay.
17557 d_snprintf="$undef"
17558 d_vsnprintf="$undef"
17562 echo "(I can't seem to compile the test program--assuming they don't)"
17563 d_snprintf="$undef"
17564 d_vsnprintf="$undef"
17570 : see if sockatmark exists
17571 set sockatmark d_sockatmark
17574 : see if prototype for sockatmark is available
17576 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17579 : see if socks5_init exists
17580 set socks5_init d_socks5_init
17583 : see if sprintf returns the length of the string in the buffer as per ANSI
17584 $echo "Checking whether sprintf returns the length of the string..." >&4
17587 #$i_stdlib I_STDLIB
17589 #include <stdlib.h>
17591 #$i_string I_STRING
17593 # include <string.h>
17595 # include <strings.h>
17604 int check (size_t expect, int test) {
17605 size_t got = strlen(buffer);
17609 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17614 int main(int argc, char **argv) {
17617 check(sprintf(buffer, ""), ++test);
17618 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17619 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17626 if eval $compile; then
17630 sprintf returns the length of the string (as ANSI says it should)
17632 d_sprintf_returns_strlen="$define"
17635 sprintf does not return the length of the string (how old is this system?)
17637 d_sprintf_returns_strlen="$undef"
17641 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17642 d_sprintf_returns_strlen="$undef"
17646 : see if srand48_r exists
17647 set srand48_r d_srand48_r
17649 case "$d_srand48_r" in
17651 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17652 case "$d_srand48_r_proto:$usethreads" in
17653 ":define") d_srand48_r_proto=define
17654 set d_srand48_r_proto srand48_r $hdrs
17658 case "$d_srand48_r_proto" in
17660 case "$srand48_r_proto" in
17661 ''|0) try='int srand48_r(long, struct drand48_data*);'
17662 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17664 case "$srand48_r_proto" in
17665 ''|0) d_srand48_r=undef
17667 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17668 * ) case "$srand48_r_proto" in
17669 REENTRANT_PROTO*) ;;
17670 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17672 echo "Prototype: $try" ;;
17675 *) case "$usethreads" in
17676 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17683 *) srand48_r_proto=0
17687 : see if srandom_r exists
17688 set srandom_r d_srandom_r
17690 case "$d_srandom_r" in
17692 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17693 case "$d_srandom_r_proto:$usethreads" in
17694 ":define") d_srandom_r_proto=define
17695 set d_srandom_r_proto srandom_r $hdrs
17699 case "$d_srandom_r_proto" in
17701 case "$srandom_r_proto" in
17702 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17703 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
17705 case "$srandom_r_proto" in
17706 ''|0) d_srandom_r=undef
17708 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17709 * ) case "$srandom_r_proto" in
17710 REENTRANT_PROTO*) ;;
17711 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17713 echo "Prototype: $try" ;;
17716 *) case "$usethreads" in
17717 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17724 *) srandom_r_proto=0
17728 : see if prototype for setresgid is available
17730 set d_sresgproto setresgid $i_unistd unistd.h
17733 : see if prototype for setresuid is available
17735 set d_sresuproto setresuid $i_unistd unistd.h
17738 : see if sys/stat.h is available
17739 set sys/stat.h i_sysstat
17742 : see if stat knows about block sizes
17744 echo "Checking to see if your struct stat has st_blocks field..." >&4
17745 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17748 : see if this is a sys/vfs.h system
17749 set sys/vfs.h i_sysvfs
17752 : see if this is a sys/statfs.h system
17753 set sys/statfs.h i_sysstatfs
17756 : Check for statfs_s
17758 echo "Checking to see if your system supports struct statfs..." >&4
17759 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
17761 case "$d_statfs_s" in
17762 "$define") echo "Yes, it does." ;;
17763 *) echo "No, it doesn't." ;;
17767 : see if struct statfs knows about f_flags
17768 case "$d_statfs_s" in
17771 echo "Checking to see if your struct statfs has f_flags field..." >&4
17772 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
17776 set d_statfs_f_flags
17780 case "$d_statfs_f_flags" in
17781 "$define") echo "Yes, it does." ;;
17782 *) echo "No, it doesn't." ;;
17785 : Check stream access
17787 Checking how to access stdio streams by file descriptor number...
17789 case "$stdio_stream_array" in
17790 '') $cat >try.c <<EOCP
17793 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17797 for s in _iob __iob __sF
17799 set try -DSTDIO_STREAM_ARRAY=$s
17800 if eval $compile; then
17801 case "`$run ./try`" in
17802 yes) stdio_stream_array=$s; break ;;
17808 case "$stdio_stream_array" in
17810 I can't figure out how to access stdio streams by file descriptor number.
17812 d_stdio_stream_array="$undef"
17815 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17817 d_stdio_stream_array="$define"
17821 : see if strcoll exists
17822 set strcoll d_strcoll
17825 : check for structure copying
17827 echo "Checking to see if your C compiler can copy structs..." >&4
17828 $cat >try.c <<'EOCP'
17838 if $cc -c try.c >/dev/null 2>&1 ; then
17840 echo "Yup, it can."
17843 echo "Nope, it can't."
17849 : see if strerror and/or sys_errlist[] exist
17851 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17852 if set strerror val -f d_strerror; eval $csym; $val; then
17853 echo 'strerror() found.' >&4
17854 d_strerror="$define"
17855 d_strerrm='strerror(e)'
17856 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17857 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17858 d_syserrlst="$define"
17860 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17861 d_syserrlst="$undef"
17863 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17864 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17865 echo 'strerror() found in string header.' >&4
17866 d_strerror="$define"
17867 d_strerrm='strerror(e)'
17868 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17869 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17870 d_syserrlst="$define"
17872 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17873 d_syserrlst="$undef"
17875 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17876 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17877 d_strerror="$undef"
17878 d_syserrlst="$define"
17879 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17881 echo 'strerror() and sys_errlist[] NOT found.' >&4
17882 d_strerror="$undef"
17883 d_syserrlst="$undef"
17884 d_strerrm='"unknown"'
17888 : see if strerror_r exists
17889 set strerror_r d_strerror_r
17891 case "$d_strerror_r" in
17893 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17894 case "$d_strerror_r_proto:$usethreads" in
17895 ":define") d_strerror_r_proto=define
17896 set d_strerror_r_proto strerror_r $hdrs
17900 case "$d_strerror_r_proto" in
17902 case "$strerror_r_proto" in
17903 ''|0) try='int strerror_r(int, char*, size_t);'
17904 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
17906 case "$strerror_r_proto" in
17907 ''|0) try='int strerror_r(int, char*, int);'
17908 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
17910 case "$strerror_r_proto" in
17911 ''|0) try='char* strerror_r(int, char*, size_t);'
17912 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
17914 case "$strerror_r_proto" in
17915 ''|0) d_strerror_r=undef
17917 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17918 * ) case "$strerror_r_proto" in
17919 REENTRANT_PROTO*) ;;
17920 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17922 echo "Prototype: $try" ;;
17925 *) case "$usethreads" in
17926 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17933 *) strerror_r_proto=0
17937 : see if strftime exists
17938 set strftime d_strftime
17941 : see if strlcat exists
17942 set strlcat d_strlcat
17945 : see if strlcpy exists
17946 set strlcpy d_strlcpy
17949 : see if strtod exists
17950 set strtod d_strtod
17953 : see if strtol exists
17954 set strtol d_strtol
17957 : see if strtold exists
17958 set strtold d_strtold
17961 : see if strtoll exists
17962 set strtoll d_strtoll
17965 case "$d_longlong-$d_strtoll" in
17968 Checking whether your strtoll() works okay...
17970 $cat >try.c <<'EOCP'
17973 #define strtoll __strtoll
17976 #define strtoll _strtoll
17979 extern long long int strtoll(char *s, char **, int);
17980 static int bad = 0;
17981 int check(char *s, long long ell, int een) {
17984 gll = strtoll(s, 0, 10);
17985 if (!((gll == ell) && (errno == een)))
17989 check(" 1", 1LL, 0);
17990 check(" 0", 0LL, 0);
17991 check("-1", -1LL, 0);
17992 check("-9223372036854775808", -9223372036854775808LL, 0);
17993 check("-9223372036854775808", -9223372036854775808LL, 0);
17994 check(" 9223372036854775807", 9223372036854775807LL, 0);
17995 check("-9223372036854775808", -9223372036854775808LL, 0);
17996 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17997 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18003 if eval $compile; then
18006 ok) echo "Your strtoll() seems to be working okay." ;;
18008 Your strtoll() doesn't seem to be working okay.
18014 echo "(I can't seem to compile the test program--assuming it doesn't)"
18020 : see if strtoq exists
18021 set strtoq d_strtoq
18024 : see if strtoul exists
18025 set strtoul d_strtoul
18028 case "$d_strtoul" in
18031 Checking whether your strtoul() works okay...
18033 $cat >try.c <<'EOCP'
18036 extern unsigned long int strtoul(char *s, char **, int);
18037 static int bad = 0;
18038 void check(char *s, unsigned long eul, int een) {
18041 gul = strtoul(s, 0, 10);
18042 if (!((gul == eul) && (errno == een)))
18046 check(" 1", 1L, 0);
18047 check(" 0", 0L, 0);
18049 case "$longsize" in
18051 $cat >>try.c <<'EOCP'
18052 check("18446744073709551615", 18446744073709551615UL, 0);
18053 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18054 #if 0 /* strtoul() for /^-/ strings is undefined. */
18055 check("-1", 18446744073709551615UL, 0);
18056 check("-18446744073709551614", 2, 0);
18057 check("-18446744073709551615", 1, 0);
18058 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18059 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18064 $cat >>try.c <<'EOCP'
18065 check("4294967295", 4294967295UL, 0);
18066 check("4294967296", 4294967295UL, ERANGE);
18067 #if 0 /* strtoul() for /^-/ strings is undefined. */
18068 check("-1", 4294967295UL, 0);
18069 check("-4294967294", 2, 0);
18070 check("-4294967295", 1, 0);
18071 check("-4294967296", 4294967295UL, ERANGE);
18072 check("-4294967297", 4294967295UL, ERANGE);
18077 : Should we write these tests to be more portable by sprintf-ing
18078 : ~0 and then manipulating that char string as input for strtol?
18081 $cat >>try.c <<'EOCP'
18088 if eval $compile; then
18089 case "`$run ./try`" in
18090 ok) echo "Your strtoul() seems to be working okay." ;;
18092 Your strtoul() doesn't seem to be working okay.
18098 echo "(I can't seem to compile the test program--assuming it doesn't)"
18104 : see if strtoull exists
18105 set strtoull d_strtoull
18108 case "$d_longlong-$d_strtoull" in
18111 Checking whether your strtoull() works okay...
18113 $cat >try.c <<'EOCP'
18116 #define strtoull __strtoull
18119 extern unsigned long long int strtoull(char *s, char **, int);
18120 static int bad = 0;
18121 int check(char *s, long long eull, int een) {
18124 gull = strtoull(s, 0, 10);
18125 if (!((gull == eull) && (errno == een)))
18129 check(" 1", 1LL, 0);
18130 check(" 0", 0LL, 0);
18131 check("18446744073709551615", 18446744073709551615ULL, 0);
18132 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18133 #if 0 /* strtoull() for /^-/ strings is undefined. */
18134 check("-1", 18446744073709551615ULL, 0);
18135 check("-18446744073709551614", 2LL, 0);
18136 check("-18446744073709551615", 1LL, 0);
18137 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18138 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18145 if eval $compile; then
18146 case "`$run ./try`" in
18147 ok) echo "Your strtoull() seems to be working okay." ;;
18149 Your strtoull() doesn't seem to be working okay.
18151 d_strtoull="$undef"
18155 echo "(I can't seem to compile the test program--assuming it doesn't)"
18156 d_strtoull="$undef"
18161 : see if strtouq exists
18162 set strtouq d_strtouq
18165 case "$d_strtouq" in
18168 Checking whether your strtouq() works okay...
18170 $cat >try.c <<'EOCP'
18173 extern unsigned long long int strtouq(char *s, char **, int);
18174 static int bad = 0;
18175 void check(char *s, unsigned long long eull, int een) {
18176 unsigned long long gull;
18178 gull = strtouq(s, 0, 10);
18179 if (!((gull == eull) && (errno == een)))
18183 check(" 1", 1LL, 0);
18184 check(" 0", 0LL, 0);
18185 check("18446744073709551615", 18446744073709551615ULL, 0);
18186 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18187 #if 0 /* strtouq() for /^-/ strings is undefined. */
18188 check("-1", 18446744073709551615ULL, 0);
18189 check("-18446744073709551614", 2LL, 0);
18190 check("-18446744073709551615", 1LL, 0);
18191 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18192 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18200 if eval $compile; then
18201 case "`$run ./try`" in
18202 ok) echo "Your strtouq() seems to be working okay." ;;
18204 Your strtouq() doesn't seem to be working okay.
18210 echo "(I can't seem to compile the test program--assuming it doesn't)"
18216 : see if strxfrm exists
18217 set strxfrm d_strxfrm
18220 : see if symlink exists
18221 set symlink d_symlink
18224 : see if syscall exists
18225 set syscall d_syscall
18228 : see if prototype for syscall is available
18230 set d_syscallproto syscall $i_unistd unistd.h
18233 : see if sysconf exists
18234 set sysconf d_sysconf
18237 : see if system exists
18238 set system d_system
18241 : see if tcgetpgrp exists
18242 set tcgetpgrp d_tcgetpgrp
18245 : see if tcsetpgrp exists
18246 set tcsetpgrp d_tcsetpgrp
18249 : see if prototype for telldir is available
18251 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18254 : see if time exists
18256 if test "X$d_time" = X -o X"$timetype" = X; then
18257 if set time val -f d_time; eval $csym; $val; then
18258 echo 'time() found.' >&4
18260 rp="What is the type returned by time() on this system?"
18261 set time_t timetype long stdio.h sys/types.h
18264 echo 'time() not found, hope that will do.' >&4
18272 : see if timegm exists
18273 set timegm d_timegm
18276 : see if this is a sys/times.h system
18277 set sys/times.h i_systimes
18280 : see if times exists
18282 if set times val -f d_times; eval $csym; $val; then
18283 echo 'times() found.' >&4
18286 case "$i_systimes" in
18287 "$define") inc='sys/times.h';;
18289 rp="What is the type returned by times() on this system?"
18290 set clock_t clocktype long stdio.h sys/types.h $inc
18293 echo 'times() NOT found, hope that will do.' >&4
18298 : see if tmpnam_r exists
18299 set tmpnam_r d_tmpnam_r
18301 case "$d_tmpnam_r" in
18303 hdrs="$i_systypes sys/types.h define stdio.h "
18304 case "$d_tmpnam_r_proto:$usethreads" in
18305 ":define") d_tmpnam_r_proto=define
18306 set d_tmpnam_r_proto tmpnam_r $hdrs
18310 case "$d_tmpnam_r_proto" in
18312 case "$tmpnam_r_proto" in
18313 ''|0) try='char* tmpnam_r(char*);'
18314 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18316 case "$tmpnam_r_proto" in
18317 ''|0) d_tmpnam_r=undef
18319 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18320 * ) case "$tmpnam_r_proto" in
18321 REENTRANT_PROTO*) ;;
18322 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18324 echo "Prototype: $try" ;;
18327 *) case "$usethreads" in
18328 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18335 *) tmpnam_r_proto=0
18339 : see if truncate exists
18340 set truncate d_truncate
18343 : see if ttyname_r exists
18344 set ttyname_r d_ttyname_r
18346 case "$d_ttyname_r" in
18348 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18349 case "$d_ttyname_r_proto:$usethreads" in
18350 ":define") d_ttyname_r_proto=define
18351 set d_ttyname_r_proto ttyname_r $hdrs
18355 case "$d_ttyname_r_proto" in
18357 case "$ttyname_r_proto" in
18358 ''|0) try='int ttyname_r(int, char*, size_t);'
18359 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18361 case "$ttyname_r_proto" in
18362 ''|0) try='int ttyname_r(int, char*, int);'
18363 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18365 case "$ttyname_r_proto" in
18366 ''|0) try='char* ttyname_r(int, char*, int);'
18367 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18369 case "$ttyname_r_proto" in
18370 ''|0) d_ttyname_r=undef
18372 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18373 * ) case "$ttyname_r_proto" in
18374 REENTRANT_PROTO*) ;;
18375 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18377 echo "Prototype: $try" ;;
18380 *) case "$usethreads" in
18381 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18388 *) ttyname_r_proto=0
18392 : see if tzname[] exists
18394 if set tzname val -a d_tzname; eval $csym; $val; then
18396 echo 'tzname[] found.' >&4
18399 echo 'tzname[] NOT found.' >&4
18404 : Check if is a multiplatform env
18406 next|rhapsody|darwin) multiarch="$define" ;;
18408 case "$multiarch" in
18409 ''|[nN]*) multiarch="$undef" ;;
18412 : check for ordering of bytes in a UV
18414 case "$usecrosscompile$multiarch" in
18417 You seem to be either cross-compiling or doing a multiarchitecture build,
18418 skipping the byteorder check.
18424 case "$byteorder" in
18427 In the following, larger digits indicate more significance. A big-endian
18428 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18429 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18430 machines may have weird orders like 3412. A Cray will report 87654321,
18431 an Alpha will report 12345678. If the test program works the default is
18433 I'm now running the test program...
18437 #$i_stdlib I_STDLIB
18439 #include <stdlib.h>
18441 #include <sys/types.h>
18442 typedef $uvtype UV;
18452 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18454 u.l = (UV)0x04030201;
18455 for (i = 0; i < $uvsize; i++)
18456 printf("%c", u.c[i]+'0');
18463 if eval $compile && $run ./try > /dev/null; then
18466 [1-4][1-4][1-4][1-4]|12345678|87654321)
18467 echo "(The test program ran ok.)"
18468 echo "byteorder=$dflt"
18471 ????|????????) echo "(The test program ran ok.)" ;;
18472 *) echo "(The test program didn't run right for some reason.)" ;;
18477 (I can't seem to compile the test program. Guessing big-endian...)
18480 case "$xxx_prompt" in
18482 rp="What is the order of bytes in $uvtype?"
18495 : Checking 32bit aligndness
18498 Checking to see whether you can access character data unalignedly...
18500 case "$d_u32align" in
18501 '') $cat >try.c <<EOCP
18503 #$i_stdlib I_STDLIB
18505 #include <stdlib.h>
18507 #define U32 $u32type
18508 #define BYTEORDER 0x$byteorder
18510 #include <signal.h>
18512 $signal_t bletch(int s) { exit(4); }
18515 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18520 if (sizeof(U32) != 4) {
18521 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18528 signal(SIGBUS, bletch);
18540 for (i = 0; i < 4; i++) {
18541 up = (U32*)(buf + i);
18542 if (! ((*up == 1 << (8*i)) || /* big-endian */
18543 (*up == 1 << (8*(3-i))) /* little-endian */
18547 printf("read failed (%x)\n", *up);
18553 for (i = 0; i < 4; i++) {
18554 up = (U32*)(buf + i);
18556 if (*up != 0xBeef) {
18557 printf("write failed (%x)\n", *up);
18571 if eval $compile_ok; then
18572 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18573 $run ./try 2>&1 >/dev/null
18576 You can access character data pretty unalignedly.
18578 d_u32align="$undef"
18581 It seems that you must access character data in an aligned manner.
18583 d_u32align="$define"
18587 rp='Can you access character data at unaligned addresses?'
18591 [yY]*) d_u32align="$undef" ;;
18592 *) d_u32align="$define" ;;
18599 : see if ualarm exists
18600 set ualarm d_ualarm
18603 : see if umask exists
18607 : see if unordered exists
18608 set unordered d_unordered
18611 : see if unsetenv exists
18612 set unsetenv d_unsetenv
18615 : see if usleep exists
18616 set usleep d_usleep
18619 : see if prototype for usleep is available
18621 set d_usleepproto usleep $i_unistd unistd.h
18624 : see if ustat exists
18628 : see if closedir exists
18629 set closedir d_closedir
18632 case "$d_closedir" in
18635 echo "Checking whether closedir() returns a status..." >&4
18637 #$i_dirent I_DIRENT /**/
18638 #$i_sysdir I_SYS_DIR /**/
18639 #$i_sysndir I_SYS_NDIR /**/
18640 #$i_systypes I_SYS_TYPES /**/
18642 #if defined(I_SYS_TYPES)
18643 #include <sys/types.h>
18645 #if defined(I_DIRENT)
18646 #include <dirent.h>
18647 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18648 #include <sys/dir.h>
18652 #include <sys/ndir.h>
18656 #include <ndir.h> /* may be wrong in the future */
18658 #include <sys/dir.h>
18663 int main() { return closedir(opendir(".")); }
18666 if eval $compile_ok; then
18667 if $run ./try > /dev/null 2>&1 ; then
18668 echo "Yes, it does."
18671 echo "No, it doesn't."
18675 echo "(I can't seem to compile the test program--assuming it doesn't)"
18683 set d_void_closedir
18687 : see if there is a wait4
18691 : see if waitpid exists
18692 set waitpid d_waitpid
18695 : see if wcstombs exists
18696 set wcstombs d_wcstombs
18699 : see if wctomb exists
18700 set wctomb d_wctomb
18703 : see if writev exists
18704 set writev d_writev
18707 : preserve RCS keywords in files with variable substitution, grrr
18712 Revision='$Revision'
18714 : check for alignment requirements
18716 case "$usecrosscompile$multiarch" in
18719 You seem to be either cross-compiling or doing a multiarchitecture build,
18720 skipping the memory alignment check.
18723 case "$alignbytes" in
18724 '') alignbytes=8 ;;
18728 case "$alignbytes" in
18729 '') echo "Checking alignment constraints..." >&4
18730 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18731 $cat >try.c <<'EOCP'
18732 typedef long double NV;
18735 $cat >try.c <<'EOCP'
18739 $cat >>try.c <<'EOCP'
18747 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18752 if eval $compile_ok; then
18756 echo "(I can't seem to compile the test program...)"
18759 *) dflt="$alignbytes"
18762 rp="Doubles must be aligned on a how-many-byte boundary?"
18770 : set the base revision
18773 : how do we concatenate cpp tokens here?
18775 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18776 $cat >cpp_stuff.c <<'EOCP'
18777 #define RCAT(a,b)a/**/b
18778 #define ACAT(a,b)a ## b
18782 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18783 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18784 echo "Oh! Smells like ANSI's been here." >&4
18785 echo "We can catify or stringify, separately or together!"
18787 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18788 echo "Ah, yes! The good old days!" >&4
18789 echo "However, in the good old days we don't know how to stringify and"
18790 echo "catify at the same time."
18794 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18795 You're going to have to edit the values of CAT[2-5] in config.h...
18797 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18801 : see if this is a db.h system
18807 : Check db version.
18809 echo "Checking Berkeley DB version ..." >&4
18815 #include <sys/types.h>
18817 #$i_stdlib I_STDLIB
18819 #include <stdlib.h>
18822 int main(int argc, char *argv[])
18824 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18825 int Major, Minor, Patch ;
18826 unsigned long Version ;
18827 (void)db_version(&Major, &Minor, &Patch) ;
18829 printf("%d %d %d %d %d %d\n",
18830 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18831 Major, Minor, Patch);
18834 printf("You have Berkeley DB Version 2 or greater.\n");
18836 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18837 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18838 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18839 Major, Minor, Patch) ;
18841 /* check that db.h & libdb are compatible */
18842 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18843 printf("db.h and libdb are incompatible.\n") ;
18847 printf("db.h and libdb are compatible.\n") ;
18849 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18850 + DB_VERSION_PATCH ;
18852 /* needs to be >= 2.3.4 */
18853 if (Version < 2003004) {
18854 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18855 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18861 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18866 printf("You have Berkeley DB Version 1.\n");
18867 exit(0); /* DB version < 2: the coast is clear. */
18869 exit(1); /* <db.h> not Berkeley DB? */
18875 if eval $compile_ok && $run ./try; then
18876 echo 'Looks OK.' >&4
18878 db_version_major=$1
18879 db_version_minor=$2
18880 db_version_patch=$3
18882 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18886 : Remove db from list of libraries to use
18887 echo "Removing unusable -ldb from library list" >&4
18888 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18891 echo "libs = $libs" >&4
18901 : Check the return type needed for hash
18903 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18909 #include <sys/types.h>
18912 #ifndef DB_VERSION_MAJOR
18913 u_int32_t hash_cb (ptr, size)
18921 info.hash = hash_cb;
18925 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18926 if $contains warning try.out >>/dev/null 2>&1 ; then
18929 db_hashtype='u_int32_t'
18932 : XXX Maybe we should just give up here.
18933 db_hashtype=u_int32_t
18935 echo "Help: I can't seem to compile the db test program." >&4
18936 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18939 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18941 *) db_hashtype=u_int32_t
18946 : Check the return type needed for prefix
18948 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18954 #include <sys/types.h>
18957 #ifndef DB_VERSION_MAJOR
18958 size_t prefix_cb (key1, key2)
18966 info.prefix = prefix_cb;
18970 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18971 if $contains warning try.out >>/dev/null 2>&1 ; then
18972 db_prefixtype='int'
18974 db_prefixtype='size_t'
18977 db_prefixtype='size_t'
18978 : XXX Maybe we should just give up here.
18980 echo "Help: I can't seem to compile the db test program." >&4
18981 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18984 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18986 *) db_prefixtype='size_t'
18990 : How can we generate normalized random numbers ?
18992 echo "Looking for a random number function..." >&4
18993 case "$randfunc" in
18995 if set drand48 val -f; eval $csym; $val; then
18997 echo "Good, found drand48()." >&4
18998 elif set random val -f; eval $csym; $val; then
19000 echo "OK, found random()." >&4
19003 echo "Yick, looks like I have to use rand()." >&4
19014 *-Dmy_rand=*|*-Dmy_srand=*)
19015 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19016 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19017 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19018 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19022 while $test "$cont"; do
19023 rp="Use which function to generate random numbers?"
19025 if $test "$ans" = "$dflt"; then
19031 if set $ans val -f; eval $csym; $val; then
19035 rp="I cannot find function $ans. Use that name anyway?"
19044 case "$randfunc" in
19046 drand01="drand48()"
19052 case "$randbits" in
19054 echo "Checking to see how many bits your $randfunc() function produces..." >&4
19056 #$i_unistd I_UNISTD
19057 #$i_stdlib I_STDLIB
19060 # include <unistd.h>
19063 # include <stdlib.h>
19068 register unsigned long tmp;
19069 register unsigned long max = 0L;
19071 for (i = 1000; i; i--) {
19072 tmp = (unsigned long) $randfunc();
19073 if (tmp > max) max = tmp;
19075 for (i = 0; max; i++)
19081 if eval $compile_ok; then
19085 echo "(I can't seem to compile the test program...)"
19092 rp="How many bits does your $randfunc() function produce?"
19096 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19097 seedfunc="s$randfunc"
19098 randseedtype=unsigned
19102 rp="How many bits does your $randfunc() function produce?"
19105 seedfunc="s$randfunc"
19106 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19107 if set $seedfunc val -f; eval $csym; $val; then
19108 echo "(Using $seedfunc() to seed random generator)"
19110 echo "(Warning: no $seedfunc() to seed random generator)"
19113 randseedtype=unsigned
19120 : Determine if this is an EBCDIC system
19122 echo "Determining whether or not we are on an EBCDIC system..." >&4
19123 $cat >try.c <<'EOM'
19126 if ('M'==0xd4) return 0;
19133 if eval $compile_ok; then
19134 if $run ./try; then
19135 echo "You seem to speak EBCDIC." >&4
19138 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19141 echo "I'm unable to compile the test program." >&4
19142 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19148 : Check how to flush
19151 Checking how to flush all pending stdio output...
19153 # I only know how to find the first 32 possibly open files on SunOS.
19154 # See also hints/sunos_4_1.sh and util.c --AD
19156 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19158 $cat >>try.c <<EOCP
19160 #$i_stdlib I_STDLIB
19162 #include <stdlib.h>
19164 #$i_unistd I_UNISTD
19166 # include <unistd.h>
19168 #$d_sysconf HAS_SYSCONF
19169 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19170 #ifdef HAS_STDIO_STREAM_ARRAY
19171 # define STDIO_STREAM_ARRAY $stdio_stream_array
19176 p = fopen("try.out", "w");
19180 # ifdef TRY_FPRINTF
19184 #ifdef TRY_FFLUSH_NULL
19187 #ifdef TRY_FFLUSH_ALL
19189 long open_max = -1;
19190 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19191 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19193 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19194 open_max = sysconf(_SC_OPEN_MAX);
19197 open_max = FOPEN_MAX;
19200 open_max = OPEN_MAX;
19209 # ifdef HAS_STDIO_STREAM_ARRAY
19210 if (open_max > 0) {
19212 for (i = 0; i < open_max; i++)
19213 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19214 STDIO_STREAM_ARRAY[i]._file < open_max &&
19215 STDIO_STREAM_ARRAY[i]._flag)
19216 fflush(&STDIO_STREAM_ARRAY[i]);
19224 : first we have to find out how _not_ to flush
19226 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19228 set try -DTRY_FPUTC
19229 if eval $compile; then
19230 $run ./try 2>/dev/null
19233 if $test ! -s try.out -a "X$code" = X42; then
19239 set try -DTRY_FPRINTF
19240 if eval $compile; then
19241 $run ./try 2>/dev/null
19244 if $test ! -s try.out -a "X$code" = X42; then
19245 output=-DTRY_FPRINTF
19251 : check for fflush NULL behaviour
19252 case "$fflushNULL" in
19253 '') set try -DTRY_FFLUSH_NULL $output
19254 if eval $compile; then
19255 $run ./try 2>/dev/null
19258 if $test -s try.out -a "X$code" = X42; then
19259 fflushNULL="`$cat try.out`"
19261 if $test "X$code" != X42; then
19263 (If this test failed, don't worry, we'll try another method shortly.)
19268 $rm -f core try.core core.try.*
19269 case "$fflushNULL" in
19271 Your fflush(NULL) works okay for output streams.
19272 Let's see if it clobbers input pipes...
19274 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19275 # bug that improperly flushes the input end of pipes. So we avoid the
19276 # autoflush on fork/system/exec support for now. :-(
19277 $cat >tryp.c <<EOCP
19280 main(int argc, char **argv)
19286 while ((i = getc(stdin)) != -1
19287 && (*bp++ = i) != '\n'
19288 && bp < &buf[1024])
19291 fprintf(stdout, "%s", buf);
19299 fflushNULL="$define"
19301 if eval $compile; then
19303 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19304 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19306 fflush(NULL) seems to behave okay with input streams.
19308 fflushNULL="$define"
19311 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19313 fflushNULL="$undef"
19316 $rm -f core tryp.c tryp.core core.tryp.*
19319 Your fflush(NULL) isn't working (contrary to ANSI C).
19321 fflushNULL="$undef"
19324 Cannot figure out whether your fflush(NULL) works or not.
19325 I'm assuming it doesn't (contrary to ANSI C).
19327 fflushNULL="$undef"
19331 $define|true|[yY]*)
19332 fflushNULL="$define"
19335 fflushNULL="$undef"
19338 : check explicit looping only if NULL did not work, and if the pipe
19339 : bug does not show up on an explicit flush too
19340 case "$fflushNULL" in
19342 $cat >tryp.c <<EOCP
19345 main(int argc, char **argv)
19351 while ((i = getc(stdin)) != -1
19352 && (*bp++ = i) != '\n'
19353 && bp < &buf[1024])
19356 fprintf(stdout, "%s", buf);
19365 if eval $compile; then
19367 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19368 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19370 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19372 : now check for fflushall behaviour
19373 case "$fflushall" in
19374 '') set try -DTRY_FFLUSH_ALL $output
19375 if eval $compile; then
19377 (Now testing the other method--but note that this also may fail.)
19379 $run ./try 2>/dev/null
19382 if $test -s try.out -a "X$code" = X42; then
19383 fflushall="`$cat try.out`"
19387 case "$fflushall" in
19389 Whew. Flushing explicitly all the stdio streams works.
19391 fflushall="$define"
19394 Sigh. Flushing explicitly all the stdio streams doesn't work.
19399 Cannot figure out whether flushing stdio streams explicitly works or not.
19400 I'm assuming it doesn't.
19406 "$define"|true|[yY]*)
19407 fflushall="$define"
19415 All is futile. Even fflush(stdin) clobbers input pipes!
19422 $rm -f core tryp.c tryp.core core.tryp.*
19424 *) fflushall="$undef"
19428 case "$fflushNULL$fflushall" in
19431 OK, I give up. I cannot figure out how to flush pending stdio output.
19432 We won't be flushing handles at all before fork/exec/popen.
19438 : Store the full pathname to the ar program for use in the C program
19439 : Respect a hint or command line value for full_ar.
19444 : Store the full pathname to the sed program for use in the C program
19447 : see what type gids are declared as in the kernel
19449 echo "Looking for the type for group ids returned by getgid()."
19450 set gid_t gidtype xxx stdio.h sys/types.h
19454 xxx=`./findhdr sys/user.h`
19455 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19457 unsigned) dflt="$1 $2" ;;
19461 *) dflt="$gidtype";;
19464 gid_t) echo "gid_t found." ;;
19465 *) rp="What is the type for group ids returned by getgid()?"
19471 : Check the size of GID
19474 *_t) zzz="$gidtype" ;;
19477 echo "Checking the size of $zzz..." >&4
19479 #include <sys/types.h>
19481 #$i_stdlib I_STDLIB
19483 #include <stdlib.h>
19486 printf("%d\n", (int)sizeof($gidtype));
19491 if eval $compile_ok; then
19495 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19498 echo "Your $zzz is $gidsize bytes long."
19503 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19507 : Check if GID is signed
19510 *_t) zzz="$gidtype" ;;
19513 echo "Checking the sign of $zzz..." >&4
19515 #include <sys/types.h>
19526 if eval $compile; then
19530 echo "(I can't execute the test program--guessing unsigned.)" >&4
19534 1) echo "Your $zzz is unsigned." ;;
19535 -1) echo "Your $zzz is signed." ;;
19541 echo "(I can't compile the test program--guessing unsigned.)" >&4
19545 : Check 64bit sizes
19548 if $test X"$quadtype" != X; then
19550 echo "Checking how to print 64-bit integers..." >&4
19552 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19553 $cat >try.c <<'EOCP'
19554 #include <sys/types.h>
19557 int q = 12345678901;
19558 printf("%ld\n", q);
19562 if eval $compile; then
19566 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19567 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19568 echo "We will use %d."
19574 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19575 $cat >try.c <<'EOCP'
19576 #include <sys/types.h>
19579 long q = 12345678901;
19580 printf("%ld\n", q);
19584 if eval $compile; then
19588 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19589 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19590 echo "We will use %ld."
19596 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19597 $cat >try.c <<'EOCP'
19598 #include <sys/types.h>
19599 #include <inttypes.h>
19602 int64_t q = 12345678901;
19603 printf("%" PRId64 "\n", q);
19607 if eval $compile; then
19611 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19612 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19613 echo "We will use the C9X style."
19619 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19621 #include <sys/types.h>
19624 $quadtype q = 12345678901;
19625 printf("%Ld\n", q);
19629 if eval $compile; then
19633 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19634 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19635 echo "We will use %Ld."
19641 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19642 $cat >try.c <<'EOCP'
19643 #include <sys/types.h>
19646 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19647 printf("%lld\n", q);
19651 if eval $compile; then
19655 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19656 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19657 echo "We will use the %lld style."
19663 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19665 #include <sys/types.h>
19668 $quadtype q = 12345678901;
19669 printf("%qd\n", q);
19673 if eval $compile; then
19677 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19678 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19679 echo "We will use %qd."
19685 if $test X"$sPRId64" = X; then
19686 echo "Cannot figure out how to print 64-bit integers." >&4
19693 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19694 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19696 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19697 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19701 : Check format strings for internal types
19703 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19705 if $test X"$ivsize" = X8; then
19706 ivdformat="$sPRId64"
19707 uvuformat="$sPRIu64"
19708 uvoformat="$sPRIo64"
19709 uvxformat="$sPRIx64"
19710 uvXUformat="$sPRIXU64"
19712 if $test X"$ivsize" = X"$longsize"; then
19719 if $test X"$ivsize" = X"$intsize"; then
19727 if $test X"$ivsize" = X"$shortsize"; then
19738 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19739 nveformat="$sPRIeldbl"
19740 nvfformat="$sPRIfldbl"
19741 nvgformat="$sPRIgldbl"
19742 nvEUformat="$sPRIEUldbl"
19743 nvFUformat="$sPRIFUldbl"
19744 nvGUformat="$sPRIGUldbl"
19754 case "$ivdformat" in
19755 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19760 : Check format string for GID
19763 $echo "Checking the format string to be used for gids..." >&4
19766 -1) if $test X"$gidsize" = X"$ivsize"; then
19767 gidformat="$ivdformat"
19769 if $test X"$gidsize" = X"$longsize"; then
19772 if $test X"$gidsize" = X"$intsize"; then
19775 if $test X"$gidsize" = X"$shortsize"; then
19782 *) if $test X"$gidsize" = X"$uvsize"; then
19783 gidformat="$uvuformat"
19785 if $test X"$gidsize" = X"$longsize"; then
19788 if $test X"$gidsize" = X"$intsize"; then
19791 if $test X"$gidsize" = X"$shortsize"; then
19800 : see if getgroups exists
19801 set getgroups d_getgrps
19804 : see if setgroups exists
19805 set setgroups d_setgrps
19808 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19810 case "$d_getgrps$d_setgrps" in
19812 case "$groupstype" in
19813 '') dflt="$gidtype" ;;
19814 *) dflt="$groupstype" ;;
19817 What type of pointer is the second argument to getgroups() and setgroups()?
19818 Usually this is the same as group ids, $gidtype, but not always.
19821 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19825 *) groupstype="$gidtype";;
19828 : MAD = Misc Attribute Definition
19830 if $test $patchlevel -lt 9; then
19831 : MAD is not available in 5.8.x or earlier.
19835 $define|true|[yY]*) dflt='y' ;;
19840 Would you like to build with Misc Attribute Decoration? This is development
19841 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19842 overhead on the interpreter.
19844 If this doesn't make any sense to you, just accept the default '$dflt'.
19846 rp='Build Perl with MAD?'
19851 madlyh='madly.h madly.act madly.tab'
19853 madlyobj="madly$_o" ;;
19862 : check whether make sets MAKE
19864 echo "Checking if your $make program sets \$(MAKE)..." >&4
19865 case "$make_set_make" in
19867 $sed 's/^X //' > testmake.mak << 'EOF'
19869 X @echo 'maketemp="$(MAKE)"'
19871 case "`$make -f testmake.mak 2>/dev/null`" in
19872 *maketemp=*) make_set_make='#' ;;
19873 *) make_set_make="MAKE=$make" ;;
19875 $rm -f testmake.mak
19878 case "$make_set_make" in
19879 '#') echo "Yup, it does.";;
19880 *) echo "Nope, it doesn't.";;
19883 : see what type is used for mode_t
19884 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19885 set mode_t modetype int stdio.h sys/types.h
19888 : see if we need va_copy
19890 case "$i_stdarg" in
19893 #include <stdarg.h>
19895 #$i_stdlib I_STDLIB
19897 #include <stdlib.h>
19899 #include <signal.h>
19902 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19904 return vfprintf(f, fmt, *valp);
19908 myvfprintf(FILE *f, const char *fmt, va_list val)
19910 return ivfprintf(f, fmt, &val);
19914 myprintf(char *fmt, ...)
19917 va_start(val, fmt);
19918 return myvfprintf(stdout, fmt, val);
19922 main(int ac, char **av)
19924 signal(SIGSEGV, exit);
19926 myprintf("%s%cs all right, then\n", "that", '\'');
19931 if eval $compile && $run ./try 2>&1 >/dev/null; then
19932 case "`$run ./try`" in
19933 "that's all right, then")
19939 yes) echo "It seems that you don't need va_copy()." >&4
19940 need_va_copy="$undef"
19942 *) echo "It seems that va_copy() or similar will be needed." >&4
19943 need_va_copy="$define"
19948 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19952 : see what type is used for size_t
19953 rp="What is the type used for the length parameter for string functions?"
19954 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19957 : check for type of arguments to gethostbyaddr.
19958 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19959 case "$d_gethbyaddr" in
19963 Checking to see what type of arguments are accepted by gethostbyaddr().
19965 hdrs="$define sys/types.h
19966 $d_socket sys/socket.h
19967 $i_niin netinet/in.h
19969 $i_unistd unistd.h"
19970 : The first arg can 'char *' or 'void *'
19971 : The second arg is some of integral type
19972 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19973 for yyy in size_t long int; do
19974 case "$netdb_host_type" in
19975 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
19976 if ./protochk "$try" $hdrs; then
19977 echo "Your system accepts $xxx for the first arg."
19978 echo "...and $yyy for the second arg."
19979 netdb_host_type="$xxx"
19980 netdb_hlen_type="$yyy"
19986 : In case none of those worked, prompt the user.
19987 case "$netdb_host_type" in
19988 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19991 netdb_host_type=$ans
19992 rp='What is the type for the 2nd argument to gethostbyaddr?'
19995 netdb_hlen_type=$ans
19999 *) : no gethostbyaddr, so pick harmless defaults
20000 netdb_host_type='char *'
20001 netdb_hlen_type="$sizetype"
20004 # Remove the "const" if needed. -- but then we'll have a
20006 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20009 : check for type of argument to gethostbyname.
20010 if test "X$netdb_name_type" = X ; then
20011 case "$d_gethbyname" in
20015 Checking to see what type of argument is accepted by gethostbyname().
20017 hdrs="$define sys/types.h
20018 $d_socket sys/socket.h
20019 $i_niin netinet/in.h
20021 $i_unistd unistd.h"
20022 for xxx in "const char *" "char *"; do
20023 case "$netdb_name_type" in
20024 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20025 if ./protochk "$try" $hdrs; then
20026 echo "Your system accepts $xxx."
20027 netdb_name_type="$xxx"
20032 : In case none of those worked, prompt the user.
20033 case "$netdb_name_type" in
20034 '') rp='What is the type for the 1st argument to gethostbyname?'
20037 netdb_name_type=$ans
20041 *) : no gethostbyname, so pick harmless default
20042 netdb_name_type='char *'
20047 : check for type of 1st argument to getnetbyaddr.
20048 if test "X$netdb_net_type" = X ; then
20049 case "$d_getnbyaddr" in
20053 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20055 hdrs="$define sys/types.h
20056 $d_socket sys/socket.h
20057 $i_niin netinet/in.h
20059 $i_unistd unistd.h"
20060 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20061 case "$netdb_net_type" in
20062 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20063 if ./protochk "$try" $hdrs; then
20064 echo "Your system accepts $xxx."
20065 netdb_net_type="$xxx"
20070 : In case none of those worked, prompt the user.
20071 case "$netdb_net_type" in
20072 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20075 netdb_net_type=$ans
20079 *) : no getnetbyaddr, so pick harmless default
20080 netdb_net_type='long'
20084 : locate the preferred pager for this system
20091 [a-zA-Z]:/*) dflt=$pg;;
20095 [a-zA-Z]:/*) dflt=$more;;
20099 [a-zA-Z]:/*) dflt=$less;;
20102 '') dflt=/usr/ucb/more;;
20110 rp='What pager is used on your system?'
20114 : see what type pids are declared as in the kernel
20115 rp="What is the type of process ids on this system?"
20116 set pid_t pidtype int stdio.h sys/types.h
20119 : see if ar generates random libraries by itself
20121 echo "Checking how to generate random libraries on your machine..." >&4
20122 echo 'int bar1() { return bar2(); }' > bar1.c
20123 echo 'int bar2() { return 2; }' > bar2.c
20125 #$i_stdlib I_STDLIB
20127 #include <stdlib.h>
20129 int main() { printf("%d\n", bar1()); exit(0); }
20131 $cc $ccflags -c bar1.c >/dev/null 2>&1
20132 $cc $ccflags -c bar2.c >/dev/null 2>&1
20133 $cc $ccflags -c foo.c >/dev/null 2>&1
20134 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20135 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20136 $run ./foobar >/dev/null 2>&1; then
20137 echo "$ar appears to generate random libraries itself."
20139 if [ "X$ranlib" = "X" ]; then
20142 elif $ar s bar$_a >/dev/null 2>&1 &&
20143 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20144 $run ./foobar >/dev/null 2>&1; then
20145 echo "a table of contents needs to be added with '$ar s'."
20148 elif $ar ts bar$_a >/dev/null 2>&1 &&
20149 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20150 $run ./foobar >/dev/null 2>&1; then
20151 echo "a table of contents needs to be added with '$ar ts'."
20158 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20159 $test -f $ranlib || ranlib=''
20162 if $test -n "$ranlib"; then
20163 echo "your system has '$ranlib'; we'll use that."
20166 echo "your system doesn't seem to support random libraries"
20167 echo "so we'll use lorder and tsort to order the libraries."
20174 : see if this is a values.h system
20175 set values.h i_values
20178 : Check the max offset that gmtime and localtime accept
20179 echo "Checking max offsets that gmtime () accepts"
20182 define) yyy="#include <values.h>" ;;
20186 case "$sGMTIME_min/$sGMTIME_max" in
20189 #include <sys/types.h>
20198 void gm_check (time_t t, int min_year, int max_year)
20201 if ( tmp == NULL ||
20202 /* Check tm_year overflow */
20203 tmp->tm_year < min_year || tmp->tm_year > max_year)
20214 gm_check (MAXLONG, 69, 0x7fffffff);
20216 if (tmp == NULL || tmp->tm_year < 0) {
20217 for (i = 63; i >= 0; i--) {
20218 time_t x = pt | ((time_t)1 << i);
20219 if (x < 0 || x < pt) continue;
20220 gm_check (x, 69, 0x7fffffff);
20223 printf ("sGMTIME_max=%ld\n", pt);
20232 gm_check (MINLONG, -1900, 70);
20235 for (i = 36; i >= 0; i--) {
20236 time_t x = pt - ((time_t)1 << i);
20237 if (x > 0) continue;
20238 gm_check (x, -1900, 70);
20241 printf ("sGMTIME_min=%ld\n", pt);
20245 int main (int argc, char *argv[])
20247 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20254 if eval $compile; then
20257 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20263 echo "Checking max offsets that localtime () accepts"
20265 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20268 #include <sys/types.h>
20277 void local_check (time_t t, int min_year, int max_year)
20279 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20282 tmp = localtime (&t);
20283 if ( tmp == NULL ||
20284 /* Check tm_year overflow */
20285 tmp->tm_year < min_year || tmp->tm_year > max_year)
20289 } /* local_check */
20296 local_check (MAXLONG, 69, 0x7fffffff);
20298 if (tmp == NULL || tmp->tm_year < 0) {
20299 for (i = 63; i >= 0; i--) {
20300 time_t x = pt | ((time_t)1 << i);
20301 if (x < 0 || x < pt) continue;
20302 local_check (x, 69, 0x7fffffff);
20305 printf ("sLOCALTIME_max=%ld\n", pt);
20314 local_check (MINLONG, -1900, 70);
20317 for (i = 36; i >= 0; i--) {
20318 time_t x = pt - ((time_t)1 << i);
20319 if (x > 0) continue;
20320 local_check (x, -1900, 70);
20323 printf ("sLOCALTIME_min=%ld\n", pt);
20327 int main (int argc, char *argv[])
20335 if eval $compile; then
20338 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20344 : check for type of arguments to select.
20345 case "$selecttype" in
20346 '') case "$d_select" in
20350 Checking to see what type of arguments are accepted by select().
20352 hdrs="$define sys/types.h
20353 $i_systime sys/time.h
20354 $i_sysselct sys/select.h
20355 $d_socket sys/socket.h"
20356 : The first arg can be int, unsigned, or size_t
20357 : The last arg may or may not be 'const'
20359 : void pointer has been seen but using that
20360 : breaks the selectminbits test
20361 for xxx in 'fd_set *' 'int *'; do
20362 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20363 for tmo in 'struct timeval *' 'const struct timeval *'; do
20365 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20366 if ./protochk "$try" $hdrs; then
20367 echo "Your system accepts $xxx."
20376 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20377 case "$d_fd_set" in
20378 $define) dflt="fd_set *" ;;
20387 *) : no select, so pick a harmless default
20394 : check for the select 'width'
20395 case "$selectminbits" in
20396 '') safebits=`expr $ptrsize \* 8`
20397 case "$d_select" in
20401 Checking to see on how many bits at a time your select() operates...
20404 #include <sys/types.h>
20406 #$i_systime I_SYS_TIME
20407 #$i_systimek I_SYS_TIME_KERNEL
20412 # ifdef I_SYS_TIME_KERNEL
20415 # include <sys/time.h>
20416 # ifdef I_SYS_TIME_KERNEL
20420 #$i_sysselct I_SYS_SELECT
20421 #ifdef I_SYS_SELECT
20422 #include <sys/select.h>
20424 #$d_socket HAS_SOCKET
20426 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20429 #$i_stdlib I_STDLIB
20431 #include <stdlib.h>
20434 #define S sizeof(*(b))
20436 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20437 #define NBITS (NBYTES * 8)
20439 char *s = (char *)malloc(NBYTES);
20448 fp = fopen("try.c", "r");
20454 b = ($selecttype)s;
20455 for (i = 0; i < NBITS; i++)
20459 select(fd + 1, b, 0, 0, &t);
20460 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20462 printf("%d\n", i + 1);
20467 if eval $compile_ok; then
20468 selectminbits=`$run ./try`
20469 case "$selectminbits" in
20471 Cannot figure out on how many bits at a time your select() operates.
20472 I'll play safe and guess it is $safebits bits.
20474 selectminbits=$safebits
20475 bits="$safebits bits"
20478 *) bits="$selectminbits bits" ;;
20480 echo "Your select() operates on $bits at a time." >&4
20482 rp='What is the minimum number of bits your select() operates on?'
20483 case "$byteorder" in
20484 12345678) dflt=64 ;;
20490 selectminbits="$val"
20494 *) : no select, so pick a harmless default
20495 selectminbits=$safebits
20501 : Trace out the files included by signal.h, then look for SIGxxx names.
20502 if [ "X$fieldn" = X ]; then
20503 : Just make some guesses. We check them later.
20504 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20506 xxx=`echo '#include <signal.h>' |
20507 $cppstdin $cppminus $cppflags 2>/dev/null |
20508 $grep '^[ ]*#.*include' |
20509 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20510 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20513 for xx in $xxx /dev/null ; do
20514 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20516 case "$xxxfiles" in
20517 '') xxxfiles=`./findhdr signal.h` ;;
20520 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20521 print substr($2, 4, 20)
20523 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20524 print substr($3, 4, 20)
20526 : Append some common names just in case the awk scan failed.
20527 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20528 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20529 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20530 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20531 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20533 : generate a few handy files for later
20534 $cat > signal.c <<EOCP
20535 #include <sys/types.h>
20536 #include <signal.h>
20537 #$i_stdlib I_STDLIB
20539 #include <stdlib.h>
20544 /* Strange style to avoid deeply-nested #if/#else/#endif */
20547 # define NSIG (_NSIG)
20553 # define NSIG (SIGMAX+1)
20559 # define NSIG (SIG_MAX+1)
20565 # define NSIG (_SIG_MAX+1)
20571 # define NSIG (MAXSIG+1)
20577 # define NSIG (MAX_SIG+1)
20582 # ifdef SIGARRAYSIZE
20583 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20589 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20593 /* Default to some arbitrary number that's big enough to get most
20594 of the common signals.
20600 printf("NSIG %d\n", NSIG);
20606 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20608 printf "#ifdef SIG"; printf $1; printf "\n"
20609 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20610 printf $1; printf ");\n"
20614 printf "#endif /* JUST_NSIG */\n";
20615 printf "exit(0);\n}\n";
20618 $cat >signal.awk <<'EOP'
20619 BEGIN { ndups = 0 }
20620 $1 ~ /^NSIG$/ { nsig = $2 }
20621 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20622 if ($2 > maxsig) { maxsig = $2 }
20623 if (sig_name[$2]) {
20624 dup_name[ndups] = $1
20625 dup_num[ndups] = $2
20637 printf("NSIG %d\n", nsig);
20638 for (n = 1; n < nsig; n++) {
20640 printf("%s %d\n", sig_name[n], sig_num[n])
20643 printf("NUM%d %d\n", n, n)
20646 for (n = 0; n < ndups; n++) {
20647 printf("%s %d\n", dup_name[n], dup_num[n])
20651 $cat >signal_cmd <<EOS
20653 if $test -s signal.lst; then
20654 echo "Using your existing signal.lst file"
20659 $cat >>signal_cmd <<'EOS'
20662 if eval $compile_ok; then
20663 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20664 $uniq | $awk -f signal.awk >signal.lst
20666 echo "(I can't seem be able to compile the whole test program)" >&4
20667 echo "(I'll try it in little pieces.)" >&4
20668 set signal -DJUST_NSIG
20669 if eval $compile_ok; then
20670 $run ./signal$_exe > signal.nsg
20673 echo "I can't seem to figure out how many signals you have." >&4
20674 echo "Guessing 50." >&4
20675 echo 'NSIG 50' > signal.nsg
20677 : Now look at all the signal names, one at a time.
20678 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20679 $cat > signal.c <<EOCP
20680 #include <sys/types.h>
20681 #include <signal.h>
20684 printf("$xx %d\n", SIG${xx});
20689 if eval $compile; then
20690 echo "SIG${xx} found."
20691 $run ./signal$_exe >> signal.ls1
20693 echo "SIG${xx} NOT found."
20696 if $test -s signal.ls1; then
20697 $cat signal.nsg signal.ls1 |
20698 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20702 if $test -s signal.lst; then
20705 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20706 echo 'kill -l' >signal
20707 set X `csh -f <signal`
20711 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20713 echo $@ | $tr ' ' $trnl | \
20714 $awk '{ printf "%s %d\n", $1, ++s; }
20715 END { printf "NSIG %d\n", ++s }' >signal.lst
20717 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20719 chmod a+x signal_cmd
20720 $eunicefix signal_cmd
20722 : generate list of signal names
20724 case "$sig_name_init" in
20726 *) case "$sig_num_init" in
20727 ''|*,*) doinit=yes ;;
20732 echo "Generating a list of signal names and numbers..." >&4
20734 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20735 sig_name=`$awk 'BEGIN { printf "ZERO " }
20736 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20737 sig_num=`$awk 'BEGIN { printf "0 " }
20738 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20739 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20740 !/^NSIG/ { printf "\"%s\", ", $1 }
20741 END { printf "0\n" }' signal.lst`
20742 sig_num_init=`$awk 'BEGIN { printf "0, " }
20743 !/^NSIG/ { printf "%d, ", $2}
20744 END { printf "0\n"}' signal.lst`
20747 echo "The following $sig_count signals are available:"
20749 echo $sig_name | $awk \
20750 'BEGIN { linelen = 0 }
20752 for (i = 1; i <= NF; i++) {
20753 name = "SIG" $i " "
20754 linelen = linelen + length(name)
20755 if (linelen > 70) {
20757 linelen = length(name)
20763 sig_size=`echo $sig_name | awk '{print NF}'`
20764 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20766 : Check size of size
20768 case "$sizetype" in
20769 *_t) zzz="$sizetype" ;;
20770 *) zzz="filesize" ;;
20772 echo "Checking the size of $zzz..." >&4
20774 #include <sys/types.h>
20776 #$i_stdlib I_STDLIB
20778 #include <stdlib.h>
20781 printf("%d\n", (int)sizeof($sizetype));
20786 if eval $compile_ok; then
20790 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20793 echo "Your $zzz size is $sizesize bytes."
20798 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20802 : check for socklen_t
20804 echo "Checking to see if you have socklen_t..." >&4
20806 #include <sys/types.h>
20807 #$d_socket HAS_SOCKET
20809 #include <sys/socket.h>
20811 int main() { socklen_t x = 16; }
20814 if eval $compile; then
20816 echo "You have socklen_t."
20819 echo "You do not have socklen_t."
20820 case "$sizetype" in
20821 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20828 : see if this is a socks.h system
20829 set socks.h i_socks
20832 : check for type of the size argument to socket calls
20833 case "$d_socket" in
20837 Checking to see what type is the last argument of accept().
20840 case "$d_socklen_t" in
20841 "$define") yyy="$yyy socklen_t"
20843 yyy="$yyy $sizetype int long unsigned"
20844 for xxx in $yyy; do
20845 case "$socksizetype" in
20846 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
20847 case "$usesocks" in
20849 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20850 echo "Your system accepts '$xxx *' for the last argument of accept()."
20851 socksizetype="$xxx"
20854 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20855 echo "Your system accepts '$xxx *' for the last argument of accept()."
20856 socksizetype="$xxx"
20863 : In case none of those worked, prompt the user.
20864 case "$socksizetype" in
20865 '') rp='What is the type for socket address structure sizes?'
20872 *) : no sockets, so pick relatively harmless default
20877 : see what type is used for signed size_t
20878 set ssize_t ssizetype int stdio.h sys/types.h
20883 #$i_stdlib I_STDLIB
20885 #include <stdlib.h>
20887 #include <sys/types.h>
20888 #define Size_t $sizetype
20889 #define SSize_t $dflt
20892 if (sizeof(Size_t) == sizeof(SSize_t))
20894 else if (sizeof(Size_t) == sizeof(int))
20903 if eval $compile_ok && $run ./try > /dev/null; then
20904 ssizetype=`$run ./try`
20905 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20908 Help! I can't compile and run the ssize_t test program: please enlighten me!
20909 (This is probably a misconfiguration in your system or libraries, and
20910 you really ought to fix it. Still, I'll try anyway.)
20912 I need a type that is the same size as $sizetype, but is guaranteed to
20913 be signed. Common values are ssize_t, int and long.
20916 rp="What signed type is the same size as $sizetype?"
20922 : see what type of char stdio uses.
20924 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
20925 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20926 echo "Your stdio uses unsigned chars." >&4
20927 stdchar="unsigned char"
20929 echo "Your stdio uses signed chars." >&4
20934 : see what type uids are declared as in the kernel
20936 echo "Looking for the type for user ids returned by getuid()."
20937 set uid_t uidtype xxx stdio.h sys/types.h
20941 xxx=`./findhdr sys/user.h`
20942 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20944 unsigned) dflt="$1 $2" ;;
20948 *) dflt="$uidtype";;
20951 uid_t) echo "uid_t found." ;;
20952 *) rp="What is the type for user ids returned by getuid()?"
20958 : Check size of UID
20961 *_t) zzz="$uidtype" ;;
20964 echo "Checking the size of $zzz..." >&4
20966 #include <sys/types.h>
20968 #$i_stdlib I_STDLIB
20970 #include <stdlib.h>
20973 printf("%d\n", (int)sizeof($uidtype));
20978 if eval $compile_ok; then
20982 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20985 echo "Your $zzz is $uidsize bytes long."
20990 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20993 : Check if UID is signed
20996 *_t) zzz="$uidtype" ;;
20999 echo "Checking the sign of $zzz..." >&4
21001 #include <sys/types.h>
21012 if eval $compile; then
21016 echo "(I can't execute the test program--guessing unsigned.)" >&4
21020 1) echo "Your $zzz is unsigned." ;;
21021 -1) echo "Your $zzz is signed." ;;
21027 echo "(I can't compile the test program--guessing unsigned.)" >&4
21031 : Check format string for UID
21033 $echo "Checking the format string to be used for uids..." >&4
21036 -1) if $test X"$uidsize" = X"$ivsize"; then
21037 uidformat="$ivdformat"
21039 if $test X"$uidsize" = X"$longsize"; then
21042 if $test X"$uidsize" = X"$intsize"; then
21045 if $test X"$uidsize" = X"$shortsize"; then
21052 *) if $test X"$uidsize" = X"$uvsize"; then
21053 uidformat="$uvuformat"
21055 if $test X"$uidsize" = X"$longsize"; then
21058 if $test X"$uidsize" = X"$intsize"; then
21061 if $test X"$uidsize" = X"$shortsize"; then
21070 : Check if site customization support was requested
21071 case "$usesitecustomize" in
21072 $define|true|[Yy]*)
21073 usesitecustomize="$define"
21076 usesitecustomize="$undef"
21080 : determine compiler compiler
21089 if $test -f "$byacc$_exe"; then
21091 comp="byacc or $comp"
21093 if $test -f "$bison$_exe"; then
21094 comp="$comp or bison -y"
21096 rp="Which compiler compiler ($comp) shall I use?"
21105 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
21111 : see if this is a assert.h system
21112 set assert.h i_assert
21115 : see if this is a fp.h system
21119 : see if this is a fp_class.h system
21120 set fp_class.h i_fp_class
21123 : see if gdbm.h is available
21128 : see if gdbm_open exists
21129 set gdbm_open d_gdbm_open
21131 case "$d_gdbm_open" in
21134 echo "We won't be including <gdbm.h>"
21143 : see if this is a ieeefp.h system
21144 case "$i_ieeefp" in
21145 '' ) set ieeefp.h i_ieeefp
21150 : see if this is a libutil.h system
21151 set libutil.h i_libutil
21154 : see if mach cthreads are available
21155 if test "X$usethreads" = "X$define"; then
21156 set mach/cthreads.h i_machcthr
21159 i_machcthr="$undef"
21162 : see if this is a mntent.h system
21163 set mntent.h i_mntent
21166 : see if net/errno.h is available
21168 set net/errno.h val
21171 : Unfortunately, it causes problems on some systems. Arrgh.
21174 cat > try.c <<'EOM'
21177 #include <net/errno.h>
21183 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21184 echo "We'll be including <net/errno.h>." >&4
21186 echo "We won't be including <net/errno.h>." >&4
21195 : see if netinet/tcp.h is available
21196 set netinet/tcp.h i_netinettcp
21199 : see if this is a poll.h system
21203 : see if this is a prot.h system
21207 : Preprocessor symbols
21209 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21210 $cat <<'EOSH' > Cppsym.know
21211 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21212 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21213 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21214 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21215 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21216 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21217 bull c cadmus clipper CMU COFF COMPILER_VERSION
21218 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21219 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21220 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21221 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21223 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21224 H3050R H3050RX hbullx20 hcx host_mips
21225 hp200 hp300 hp700 HP700 hp800 hp9000
21226 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21227 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21228 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21229 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21230 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21231 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21232 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21233 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21234 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21235 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21236 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21237 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21238 MATH_HAS_NO_SIDE_EFFECTS
21239 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21240 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21241 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21242 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21243 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21244 NetBSD news1500 news1700 news1800 news1900 news3700
21245 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21246 ns32016 ns32332 ns32k nsc32000
21247 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21248 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21249 pc532 pdp11 PGC PIC plexus PORTAR posix
21250 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21251 POSIX_C_SOURCE POSIX_SOURCE POWER
21252 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21253 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21254 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21255 sony sony_news sonyrisc sparc sparclite spectrum
21256 stardent stdc STDC_EXT stratos sun sun3 sun386
21257 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21258 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21259 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21260 sysV68 sysV88 Tek4132 Tek4300 titan
21261 TM3200 TM5400 TM5600
21262 tower tower32 tower32_200 tower32_600 tower32_700
21263 tower32_800 tower32_850 tss
21264 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21265 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21266 unix UNIX95 UNIX99 unixpc unos
21267 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21268 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21269 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21271 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21272 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21273 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21276 # Maybe put other stuff here too.
21277 cat <<EOSH >>Cppsym.know
21280 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21281 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21282 $cat Cppsym.know > Cppsym.c
21283 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21284 $rm -f Cppsym.a Cppsym.b Cppsym.c
21285 cat <<EOSH > Cppsym
21287 if $test \$# -gt 0; then
21288 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21289 if $test -s Cppsym.got; then
21296 $tr " " "$trnl" | ./Cppsym.try
21302 cat <<EOSH > Cppsym.try
21304 cat <<'EOCP' > try.c
21307 #define STRINGIFY(a) "a"
21309 #if cpp_stuff == 42
21310 #define StGiFy(a) #a
21311 #define STRINGIFY(a) StGiFy(a)
21313 #if $cpp_stuff != 1 && $cpp_stuff != 42
21314 # include "Bletch: How does this C preprocessor stringify macros?"
21320 cat <<'EOSH' >> Cppsym.try
21322 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21323 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21324 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21325 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21327 echo 'return 0;}' >> try.c
21329 cat <<EOSH >> Cppsym.try
21331 case "$osname-$gccversion" in
21332 irix-) ccflags="\$ccflags -woff 1178" ;;
21333 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21335 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21337 chmod +x Cppsym.try
21338 $eunicefix Cppsym.try
21339 ./Cppsym < Cppsym.know > Cppsym.true
21340 : Add in any linux cpp "predefined macros":
21341 case "$osname::$gccversion" in
21344 rm -f $tHdrH'.h' $tHdrH
21346 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21347 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21348 if [ -s $tHdrH'_cppsym.real' ]; then
21349 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21352 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21355 : now check the C compiler for additional symbols
21356 postprocess_cc_v=''
21358 aix) postprocess_cc_v="|$tr , ' '" ;;
21365 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21368 -D*) echo "\$i" | $sed 's/^-D//';;
21369 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21374 postprocess_cc_v=''
21377 ./ccsym > ccsym1.raw
21378 if $test -s ccsym1.raw; then
21379 $sort ccsym1.raw | $uniq >ccsym.raw
21381 mv ccsym1.raw ccsym.raw
21384 $awk '/\=/ { print $0; next }
21385 { print $0"=1" }' ccsym.raw >ccsym.list
21386 $comm -13 Cppsym.true ccsym.list >ccsym.own
21387 $comm -12 Cppsym.true ccsym.list >ccsym.com
21388 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21390 if $test -z ccsym.raw; then
21391 echo "Your C compiler doesn't seem to define any symbols!" >&4
21393 echo "However, your C preprocessor defines the following symbols:"
21396 cppsymbols=`$cat Cppsym.true`
21397 cppsymbols=`echo $cppsymbols`
21398 cppccsymbols="$cppsymbols"
21400 if $test -s ccsym.com; then
21401 echo "Your C compiler and pre-processor define these symbols:"
21402 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
21405 cppccsymbols=`$cat ccsym.com`
21406 cppccsymbols=`echo $cppccsymbols`
21407 $test "$silent" || sleep 1
21409 if $test -s ccsym.cpp; then
21410 $test "$also" && echo " "
21411 echo "Your C pre-processor ${also}defines the following symbols:"
21412 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
21414 cppsymbols=`$cat ccsym.cpp`
21415 cppsymbols=`echo $cppsymbols`
21416 $test "$silent" || sleep 1
21418 if $test -s ccsym.own; then
21419 $test "$also" && echo " "
21420 echo "Your C compiler ${also}defines the following cpp symbols:"
21421 $sed -e 's/\(..*\)=1/\1/' ccsym.own
21422 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
21423 ccsymbols=`$cat ccsym.own`
21424 ccsymbols=`echo $ccsymbols`
21425 $test "$silent" || sleep 1
21429 : see if this is a termio system
21433 if $test `./findhdr termios.h`; then
21434 set tcsetattr i_termios
21440 "$define") echo "You have POSIX termios.h... good!" >&4;;
21441 *) if ./Cppsym pyr; then
21442 case "`/bin/universe`" in
21443 ucb) if $test `./findhdr sgtty.h`; then
21445 echo "<sgtty.h> found." >&4
21447 echo "System is pyramid with BSD universe."
21448 ./warn "<sgtty.h> not found--you could have problems."
21450 *) if $test `./findhdr termio.h`; then
21452 echo "<termio.h> found." >&4
21454 echo "System is pyramid with USG universe."
21455 ./warn "<termio.h> not found--you could have problems."
21459 if $test `./findhdr termio.h`; then
21460 echo "<termio.h> found." >&4
21462 elif $test `./findhdr sgtty.h`; then
21463 echo "<sgtty.h> found." >&4
21466 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
21469 if $test `./findhdr sgtty.h`; then
21470 echo "<sgtty.h> found." >&4
21472 elif $test `./findhdr termio.h`; then
21473 echo "<termio.h> found." >&4
21476 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
21480 set i_termio; eval $setvar
21481 val=$val2; set i_sgtty; eval $setvar
21482 val=$val3; set i_termios; eval $setvar
21484 : see if stddef is available
21485 set stddef.h i_stddef
21488 : see if sys/access.h is available
21489 set sys/access.h i_sysaccess
21492 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
21493 set sys/filio.h i_sysfilio
21496 if $test `./findhdr sys/ioctl.h`; then
21498 echo '<sys/ioctl.h> found.' >&4
21501 if $test $i_sysfilio = "$define"; then
21502 echo '<sys/ioctl.h> NOT found.' >&4
21504 $test $i_sgtty = "$define" && xxx="sgtty.h"
21505 $test $i_termio = "$define" && xxx="termio.h"
21506 $test $i_termios = "$define" && xxx="termios.h"
21507 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
21513 : see if socket ioctl defs are in sys/sockio.h
21515 xxx=`./findhdr sys/sockio.h`
21516 if $test "$xxx"; then
21517 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
21519 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
21522 echo "No socket ioctls found in <sys/sockio.h>." >&4
21527 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
21533 : see if this is a syslog.h system
21534 set syslog.h i_syslog
21537 : see if this is a sys/mode.h system
21538 set sys/mode.h i_sysmode
21541 : see if there is a sys/poll.h file
21542 set sys/poll.h i_syspoll
21545 : see if sys/resource.h has to be included
21546 set sys/resource.h i_sysresrc
21549 : see if sys/security.h is available
21550 set sys/security.h i_syssecrt
21553 : see if this is a sys/statvfs.h system
21554 set sys/statvfs.h i_sysstatvfs
21557 : see if this is a sys/un.h system
21558 set sys/un.h i_sysun
21561 : see if this is a sys/utsname.h system
21562 set sys/utsname.h i_sysutsname
21565 : see if this is a syswait system
21566 set sys/wait.h i_syswait
21569 : see if this is a ustat.h system
21570 set ustat.h i_ustat
21573 : see if this is an utime system
21574 set utime.h i_utime
21577 : see if this is a vfork system
21580 set vfork.h i_vfork
21590 echo "Looking for extensions..." >&4
21591 : If we are using the old config.sh, known_extensions may contain
21592 : old or inaccurate or duplicate values.
21593 known_extensions=''
21594 nonxs_extensions=''
21595 : We do not use find because it might not be available.
21596 : We do not just use MANIFEST because the user may have dropped
21597 : some additional extensions into the source tree and expect them
21600 : Function to recursively find available extensions, ignoring DynaLoader
21601 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21605 DynaLoader|dynaload) ;;
21607 if $test -f $xxx/$xxx.xs -o -f $xxx/$xxx.c; then
21608 known_extensions="$known_extensions $1$xxx";
21609 elif $test -f $xxx/Makefile.PL; then
21610 nonxs_extensions="$nonxs_extensions $1$xxx";
21612 if $test -d $xxx -a $# -lt 10; then
21615 eval $find_extensions;
21627 eval $find_extensions
21628 # Special case: Add in modules that nest beyond the first level.
21629 # Currently threads/shared and Hash/Util/FieldHash, since they are
21630 # not picked up by the recursive find above (and adding in general
21631 # recursive finding breaks SDBM_File/sdbm).
21632 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
21633 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
21634 set X $known_extensions
21636 known_extensions="$*"
21637 set X $nonxs_extensions
21639 nonxs_extensions="$*"
21642 : Now see which are supported on this system.
21644 for xxx in $known_extensions ; do
21648 $define) avail_ext="$avail_ext $xxx" ;;
21651 GDBM_File|gdbm_fil)
21653 $define) avail_ext="$avail_ext $xxx" ;;
21656 I18N/Langinfo|i18n_lan)
21657 case "$i_langinfo$d_nl_langinfo" in
21658 $define$define) avail_ext="$avail_ext $xxx" ;;
21662 : XXX Do we need a useipcsysv variable here
21663 case "${d_msg}${d_sem}${d_shm}" in
21664 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21667 NDBM_File|ndbm_fil)
21670 case "$osname-$use64bitint" in
21673 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21676 *) avail_ext="$avail_ext $xxx" ;;
21681 ODBM_File|odbm_fil)
21682 case "${i_dbm}${i_rpcsvcdbm}" in
21684 case "$d_cplusplus" in
21685 define) ;; # delete as a function name will not work
21686 *) case "$osname-$use64bitint" in
21689 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21692 *) avail_ext="$avail_ext $xxx" ;;
21700 case "$useopcode" in
21701 true|define|y) avail_ext="$avail_ext $xxx" ;;
21705 case "$useposix" in
21706 true|define|y) avail_ext="$avail_ext $xxx" ;;
21710 case "$d_socket" in
21713 beos) ;; # not unless BONE
21714 *) avail_ext="$avail_ext $xxx" ;;
21719 Sys/Syslog|sys/syslog)
21720 : XXX syslog requires socket
21721 case "$d_socket" in
21722 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21726 case "$usethreads" in
21728 case "$use5005threads" in
21729 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
21733 threads|threads/shared)
21734 # threads and threads::shared are special cases.
21735 # To stop people from asking "Perl 5.8.0 was supposed
21736 # to have this new fancy threads implementation but my
21737 # perl doesn't have it" and from people trying to
21738 # (re)install the threads module using CPAN.pm and
21739 # CPAN.pm then offering to reinstall Perl 5.8.0,
21740 # the threads.pm and threads/shared.pm will always be
21741 # there, croaking informatively ("you need to rebuild
21742 # all of Perl with threads, sorry") when threads haven't
21743 # been compiled in.
21745 avail_ext="$avail_ext $xxx"
21749 cygwin) avail_ext="$avail_ext $xxx" ;;
21752 XS/APItest|xs/apitest)
21753 # This is just for testing. Skip it unless we have dynamic loading.
21756 $define) avail_ext="$avail_ext $xxx" ;;
21759 XS/Typemap|xs/typemap)
21760 # This is just for testing. Skip it unless we have dynamic loading.
21762 $define) avail_ext="$avail_ext $xxx" ;;
21765 *) avail_ext="$avail_ext $xxx"
21774 case "$onlyextensions" in
21776 *) keepextensions=''
21777 echo "You have requested that only certains extensions be included..." >&4
21778 for i in $onlyextensions; do
21779 case " $avail_ext " in
21781 echo "Keeping extension $i."
21782 keepextensions="$keepextensions $i"
21784 *) echo "Ignoring extension $i." ;;
21787 avail_ext="$keepextensions"
21791 case "$noextensions" in
21793 *) keepextensions=''
21794 echo "You have requested that certain extensions be ignored..." >&4
21795 for i in $avail_ext; do
21796 case " $noextensions " in
21797 *" $i "*) echo "Ignoring extension $i." ;;
21798 *) echo "Keeping extension $i.";
21799 keepextensions="$keepextensions $i"
21803 avail_ext="$keepextensions"
21807 : Now see which nonxs extensions are supported on this system.
21808 : For now assume all are.
21810 for xxx in $nonxs_extensions ; do
21812 *) nonxs_ext="$nonxs_ext $xxx"
21824 A number of extensions are supplied with $package. You may choose to
21825 compile these extensions for dynamic loading (the default), compile
21826 them into the $package executable (static loading), or not include
21827 them at all. Answer "none" to include no extensions.
21828 Note that DynaLoader is always built and need not be mentioned here.
21831 case "$dynamic_ext" in
21833 : Exclude those listed in static_ext
21835 for xxx in $avail_ext; do
21836 case " $static_ext " in
21838 *) dflt="$dflt $xxx" ;;
21845 *) dflt="$dynamic_ext"
21846 # Perhaps we are reusing an old out-of-date config.sh.
21849 if test X"$dynamic_ext" != X"$avail_ext"; then
21851 NOTICE: Your previous config.sh list may be incorrect.
21852 The extensions now available to you are
21854 but the default list from your previous config.sh is
21866 rp="What extensions do you wish to load dynamically?"
21869 none) dynamic_ext=' ' ;;
21870 *) dynamic_ext="$ans" ;;
21873 case "$static_ext" in
21875 : Exclude those already listed in dynamic linking
21877 for xxx in $avail_ext; do
21878 case " $dynamic_ext " in
21880 *) dflt="$dflt $xxx" ;;
21887 *) dflt="$static_ext"
21894 rp="What extensions do you wish to load statically?"
21897 none) static_ext=' ' ;;
21898 *) static_ext="$ans" ;;
21903 A number of extensions are supplied with $package. Answer "none"
21904 to include no extensions.
21905 Note that DynaLoader is always built and need not be mentioned here.
21908 case "$static_ext" in
21909 '') dflt="$avail_ext" ;;
21910 *) dflt="$static_ext"
21911 # Perhaps we are reusing an old out-of-date config.sh.
21914 if test X"$static_ext" != X"$avail_ext"; then
21916 NOTICE: Your previous config.sh list may be incorrect.
21917 The extensions now available to you are
21919 but the default list from your previous config.sh is
21928 : Exclude those that are not xs extensions
21932 rp="What extensions do you wish to include?"
21935 none) static_ext=' ' ;;
21936 *) static_ext="$ans" ;;
21941 # Encode is a special case. If we are building Encode as a static
21942 # extension, we need to explicitly list its subextensions as well.
21943 # For other nested extensions, this is handled automatically by
21944 # the appropriate Makefile.PL.
21945 case " $static_ext " in
21946 *" Encode "*) # Add the subextensions of Encode
21948 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21949 static_ext="$static_ext Encode/$xxx"
21955 set X $dynamic_ext $static_ext $nonxs_ext
21959 # Sanity check: We require an extension suitable for use with
21960 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21961 # should show up as failures in the test suite, but it's helpful to
21962 # catch them now.) The 'extensions' list is normally sorted
21963 # alphabetically, so we need to accept either
21964 # DB_File ... Fcntl ... IO ....
21965 # or something like
21966 # Fcntl ... NDBM_File ... IO ....
21967 case " $extensions" in
21968 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21969 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21970 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21971 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21972 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21976 : Remove libraries needed only for extensions
21977 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21978 : The exception is SunOS 4.x, which needs them.
21979 case "${osname}X${osvers}" in
21983 *) case "$usedl" in
21984 $define|true|[yY]*)
21985 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21989 *) perllibs="$libs"
21995 : Remove build directory name from cppstdin so it can be used from
21996 : either the present location or the final installed location.
21998 : Get out of the UU directory to get correct path name.
22000 case "$cppstdin" in
22002 echo "Stripping down cppstdin path name"
22008 : end of configuration questions
22010 echo "End of configuration questions."
22013 : back to where it started
22014 if test -d ../UU; then
22018 : configuration may be unconditionally patched via a 'config.arch' file
22019 if $test -f config.arch; then
22020 echo "I see a config.arch file, loading it." >&4
22024 : configuration may be patched via a 'config.over' file
22025 if $test -f config.over; then
22028 rp='I see a config.over file. Do you wish to load it?'
22031 n*) echo "OK, I'll ignore it.";;
22033 echo "Configuration override changes have been loaded."
22038 : in case they want portability, strip down executable paths
22039 case "$d_portable" in
22042 echo "Stripping down executable paths..." >&4
22043 for file in $loclist $trylist; do
22045 eval $file=`basename $temp`
22050 : create config.sh file
22052 echo "Creating config.sh..." >&4
22053 $spitshell <<EOT >config.sh
22056 # This file was produced by running the Configure script. It holds all the
22057 # definitions figured out by Configure. Should you modify one of these values,
22058 # do not forget to propagate your changes by running "Configure -der". You may
22059 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22062 # Package name : $package
22063 # Source directory : $src
22064 # Configuration time: $cf_time
22065 # Configured by : $cf_by
22066 # Target system : $myuname
22069 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22070 $spitshell <<EOT >>config.sh
22079 Revision='$Revision'
22087 alignbytes='$alignbytes'
22088 ansi2knr='$ansi2knr'
22089 aphostname='$aphostname'
22090 api_revision='$api_revision'
22091 api_subversion='$api_subversion'
22092 api_version='$api_version'
22093 api_versionstring='$api_versionstring'
22096 archlibexp='$archlibexp'
22097 archname64='$archname64'
22098 archname='$archname'
22099 archobjs='$archobjs'
22100 asctime_r_proto='$asctime_r_proto'
22108 byteorder='$byteorder'
22110 castflags='$castflags'
22113 cccdlflags='$cccdlflags'
22114 ccdlflags='$ccdlflags'
22116 ccflags_uselargefiles='$ccflags_uselargefiles'
22118 ccsymbols='$ccsymbols'
22119 ccversion='$ccversion'
22121 cf_email='$cf_email'
22126 clocktype='$clocktype'
22128 compress='$compress'
22129 contains='$contains'
22133 cpp_stuff='$cpp_stuff'
22134 cppccsymbols='$cppccsymbols'
22135 cppflags='$cppflags'
22137 cppminus='$cppminus'
22139 cppstdin='$cppstdin'
22140 cppsymbols='$cppsymbols'
22141 crypt_r_proto='$crypt_r_proto'
22142 cryptlib='$cryptlib'
22144 ctermid_r_proto='$ctermid_r_proto'
22145 ctime_r_proto='$ctime_r_proto'
22146 d_Gconvert='$d_Gconvert'
22147 d_PRIEUldbl='$d_PRIEUldbl'
22148 d_PRIFUldbl='$d_PRIFUldbl'
22149 d_PRIGUldbl='$d_PRIGUldbl'
22150 d_PRIXU64='$d_PRIXU64'
22151 d_PRId64='$d_PRId64'
22152 d_PRIeldbl='$d_PRIeldbl'
22153 d_PRIfldbl='$d_PRIfldbl'
22154 d_PRIgldbl='$d_PRIgldbl'
22155 d_PRIi64='$d_PRIi64'
22156 d_PRIo64='$d_PRIo64'
22157 d_PRIu64='$d_PRIu64'
22158 d_PRIx64='$d_PRIx64'
22159 d_SCNfldbl='$d_SCNfldbl'
22160 d__fwalk='$d__fwalk'
22161 d_access='$d_access'
22162 d_accessx='$d_accessx'
22165 d_archlib='$d_archlib'
22166 d_asctime64='$d_asctime64'
22167 d_asctime_r='$d_asctime_r'
22170 d_attribute_deprecated='$d_attribute_deprecated'
22171 d_attribute_format='$d_attribute_format'
22172 d_attribute_malloc='$d_attribute_malloc'
22173 d_attribute_nonnull='$d_attribute_nonnull'
22174 d_attribute_noreturn='$d_attribute_noreturn'
22175 d_attribute_pure='$d_attribute_pure'
22176 d_attribute_unused='$d_attribute_unused'
22177 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22181 d_bsdgetpgrp='$d_bsdgetpgrp'
22182 d_bsdsetpgrp='$d_bsdsetpgrp'
22183 d_builtin_choose_expr='$d_builtin_choose_expr'
22184 d_builtin_expect='$d_builtin_expect'
22186 d_c99_variadic_macros='$d_c99_variadic_macros'
22187 d_casti32='$d_casti32'
22188 d_castneg='$d_castneg'
22189 d_charvspr='$d_charvspr'
22191 d_chroot='$d_chroot'
22192 d_chsize='$d_chsize'
22194 d_clearenv='$d_clearenv'
22195 d_closedir='$d_closedir'
22196 d_cmsghdr_s='$d_cmsghdr_s'
22198 d_copysignl='$d_copysignl'
22199 d_cplusplus='$d_cplusplus'
22201 d_crypt_r='$d_crypt_r'
22203 d_ctermid='$d_ctermid'
22204 d_ctermid_r='$d_ctermid_r'
22205 d_ctime64='$d_ctime64'
22206 d_ctime_r='$d_ctime_r'
22207 d_cuserid='$d_cuserid'
22208 d_dbl_dig='$d_dbl_dig'
22209 d_dbminitproto='$d_dbminitproto'
22210 d_difftime64='$d_difftime64'
22211 d_difftime='$d_difftime'
22212 d_dir_dd_fd='$d_dir_dd_fd'
22214 d_dirnamlen='$d_dirnamlen'
22215 d_dlerror='$d_dlerror'
22216 d_dlopen='$d_dlopen'
22217 d_dlsymun='$d_dlsymun'
22218 d_dosuid='$d_dosuid'
22219 d_drand48_r='$d_drand48_r'
22220 d_drand48proto='$d_drand48proto'
22222 d_eaccess='$d_eaccess'
22223 d_endgrent='$d_endgrent'
22224 d_endgrent_r='$d_endgrent_r'
22225 d_endhent='$d_endhent'
22226 d_endhostent_r='$d_endhostent_r'
22227 d_endnent='$d_endnent'
22228 d_endnetent_r='$d_endnetent_r'
22229 d_endpent='$d_endpent'
22230 d_endprotoent_r='$d_endprotoent_r'
22231 d_endpwent='$d_endpwent'
22232 d_endpwent_r='$d_endpwent_r'
22233 d_endsent='$d_endsent'
22234 d_endservent_r='$d_endservent_r'
22235 d_eofnblk='$d_eofnblk'
22236 d_eunice='$d_eunice'
22237 d_faststdio='$d_faststdio'
22238 d_fchdir='$d_fchdir'
22239 d_fchmod='$d_fchmod'
22240 d_fchown='$d_fchown'
22242 d_fcntl_can_lock='$d_fcntl_can_lock'
22243 d_fd_macros='$d_fd_macros'
22244 d_fd_set='$d_fd_set'
22245 d_fds_bits='$d_fds_bits'
22246 d_fgetpos='$d_fgetpos'
22247 d_finite='$d_finite'
22248 d_finitel='$d_finitel'
22249 d_flexfnam='$d_flexfnam'
22251 d_flockproto='$d_flockproto'
22253 d_fp_class='$d_fp_class'
22254 d_fpathconf='$d_fpathconf'
22255 d_fpclass='$d_fpclass'
22256 d_fpclassify='$d_fpclassify'
22257 d_fpclassl='$d_fpclassl'
22258 d_fpos64_t='$d_fpos64_t'
22259 d_frexpl='$d_frexpl'
22260 d_fs_data_s='$d_fs_data_s'
22261 d_fseeko='$d_fseeko'
22262 d_fsetpos='$d_fsetpos'
22263 d_fstatfs='$d_fstatfs'
22264 d_fstatvfs='$d_fstatvfs'
22266 d_ftello='$d_ftello'
22268 d_futimes='$d_futimes'
22269 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
22270 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
22271 d_getcwd='$d_getcwd'
22272 d_getespwnam='$d_getespwnam'
22273 d_getfsstat='$d_getfsstat'
22274 d_getgrent='$d_getgrent'
22275 d_getgrent_r='$d_getgrent_r'
22276 d_getgrgid_r='$d_getgrgid_r'
22277 d_getgrnam_r='$d_getgrnam_r'
22278 d_getgrps='$d_getgrps'
22279 d_gethbyaddr='$d_gethbyaddr'
22280 d_gethbyname='$d_gethbyname'
22281 d_gethent='$d_gethent'
22282 d_gethname='$d_gethname'
22283 d_gethostbyaddr_r='$d_gethostbyaddr_r'
22284 d_gethostbyname_r='$d_gethostbyname_r'
22285 d_gethostent_r='$d_gethostent_r'
22286 d_gethostprotos='$d_gethostprotos'
22287 d_getitimer='$d_getitimer'
22288 d_getlogin='$d_getlogin'
22289 d_getlogin_r='$d_getlogin_r'
22290 d_getmnt='$d_getmnt'
22291 d_getmntent='$d_getmntent'
22292 d_getnbyaddr='$d_getnbyaddr'
22293 d_getnbyname='$d_getnbyname'
22294 d_getnent='$d_getnent'
22295 d_getnetbyaddr_r='$d_getnetbyaddr_r'
22296 d_getnetbyname_r='$d_getnetbyname_r'
22297 d_getnetent_r='$d_getnetent_r'
22298 d_getnetprotos='$d_getnetprotos'
22299 d_getpagsz='$d_getpagsz'
22300 d_getpbyname='$d_getpbyname'
22301 d_getpbynumber='$d_getpbynumber'
22302 d_getpent='$d_getpent'
22303 d_getpgid='$d_getpgid'
22304 d_getpgrp2='$d_getpgrp2'
22305 d_getpgrp='$d_getpgrp'
22306 d_getppid='$d_getppid'
22307 d_getprior='$d_getprior'
22308 d_getprotobyname_r='$d_getprotobyname_r'
22309 d_getprotobynumber_r='$d_getprotobynumber_r'
22310 d_getprotoent_r='$d_getprotoent_r'
22311 d_getprotoprotos='$d_getprotoprotos'
22312 d_getprpwnam='$d_getprpwnam'
22313 d_getpwent='$d_getpwent'
22314 d_getpwent_r='$d_getpwent_r'
22315 d_getpwnam_r='$d_getpwnam_r'
22316 d_getpwuid_r='$d_getpwuid_r'
22317 d_getsbyname='$d_getsbyname'
22318 d_getsbyport='$d_getsbyport'
22319 d_getsent='$d_getsent'
22320 d_getservbyname_r='$d_getservbyname_r'
22321 d_getservbyport_r='$d_getservbyport_r'
22322 d_getservent_r='$d_getservent_r'
22323 d_getservprotos='$d_getservprotos'
22324 d_getspnam='$d_getspnam'
22325 d_getspnam_r='$d_getspnam_r'
22326 d_gettimeod='$d_gettimeod'
22327 d_gmtime64='$d_gmtime64'
22328 d_gmtime_r='$d_gmtime_r'
22329 d_gnulibc='$d_gnulibc'
22330 d_grpasswd='$d_grpasswd'
22331 d_hasmntopt='$d_hasmntopt'
22333 d_ilogbl='$d_ilogbl'
22334 d_inc_version_list='$d_inc_version_list'
22336 d_inetaton='$d_inetaton'
22337 d_int64_t='$d_int64_t'
22338 d_isascii='$d_isascii'
22339 d_isfinite='$d_isfinite'
22342 d_isnanl='$d_isnanl'
22343 d_killpg='$d_killpg'
22344 d_lchown='$d_lchown'
22345 d_ldbl_dig='$d_ldbl_dig'
22346 d_libm_lib_version='$d_libm_lib_version'
22348 d_localtime64='$d_localtime64'
22349 d_localtime_r='$d_localtime_r'
22350 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
22351 d_locconv='$d_locconv'
22353 d_longdbl='$d_longdbl'
22354 d_longlong='$d_longlong'
22355 d_lseekproto='$d_lseekproto'
22357 d_madvise='$d_madvise'
22358 d_malloc_good_size='$d_malloc_good_size'
22359 d_malloc_size='$d_malloc_size'
22361 d_mbstowcs='$d_mbstowcs'
22362 d_mbtowc='$d_mbtowc'
22363 d_memchr='$d_memchr'
22364 d_memcmp='$d_memcmp'
22365 d_memcpy='$d_memcpy'
22366 d_memmove='$d_memmove'
22367 d_memset='$d_memset'
22369 d_mkdtemp='$d_mkdtemp'
22370 d_mkfifo='$d_mkfifo'
22371 d_mkstemp='$d_mkstemp'
22372 d_mkstemps='$d_mkstemps'
22373 d_mktime64='$d_mktime64'
22374 d_mktime='$d_mktime'
22377 d_modfl_pow32_bug='$d_modfl_pow32_bug'
22378 d_modflproto='$d_modflproto'
22379 d_mprotect='$d_mprotect'
22381 d_msg_ctrunc='$d_msg_ctrunc'
22382 d_msg_dontroute='$d_msg_dontroute'
22383 d_msg_oob='$d_msg_oob'
22384 d_msg_peek='$d_msg_peek'
22385 d_msg_proxy='$d_msg_proxy'
22386 d_msgctl='$d_msgctl'
22387 d_msgget='$d_msgget'
22388 d_msghdr_s='$d_msghdr_s'
22389 d_msgrcv='$d_msgrcv'
22390 d_msgsnd='$d_msgsnd'
22392 d_munmap='$d_munmap'
22393 d_mymalloc='$d_mymalloc'
22395 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
22397 d_nl_langinfo='$d_nl_langinfo'
22398 d_nv_preserves_uv='$d_nv_preserves_uv'
22399 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
22400 d_off64_t='$d_off64_t'
22401 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
22402 d_oldpthreads='$d_oldpthreads'
22403 d_oldsock='$d_oldsock'
22405 d_pathconf='$d_pathconf'
22407 d_perl_otherlibdirs='$d_perl_otherlibdirs'
22408 d_phostname='$d_phostname'
22411 d_portable='$d_portable'
22412 d_printf_format_null='$d_printf_format_null'
22413 d_procselfexe='$d_procselfexe'
22414 d_pseudofork='$d_pseudofork'
22415 d_pthread_atfork='$d_pthread_atfork'
22416 d_pthread_attr_setscope='$d_pthread_attr_setscope'
22417 d_pthread_yield='$d_pthread_yield'
22419 d_pwchange='$d_pwchange'
22420 d_pwclass='$d_pwclass'
22421 d_pwcomment='$d_pwcomment'
22422 d_pwexpire='$d_pwexpire'
22423 d_pwgecos='$d_pwgecos'
22424 d_pwpasswd='$d_pwpasswd'
22425 d_pwquota='$d_pwquota'
22428 d_random_r='$d_random_r'
22429 d_readdir64_r='$d_readdir64_r'
22430 d_readdir='$d_readdir'
22431 d_readdir_r='$d_readdir_r'
22432 d_readlink='$d_readlink'
22434 d_recvmsg='$d_recvmsg'
22435 d_rename='$d_rename'
22436 d_rewinddir='$d_rewinddir'
22438 d_safebcpy='$d_safebcpy'
22439 d_safemcpy='$d_safemcpy'
22440 d_sanemcmp='$d_sanemcmp'
22441 d_sbrkproto='$d_sbrkproto'
22442 d_scalbnl='$d_scalbnl'
22443 d_sched_yield='$d_sched_yield'
22444 d_scm_rights='$d_scm_rights'
22445 d_seekdir='$d_seekdir'
22446 d_select='$d_select'
22448 d_semctl='$d_semctl'
22449 d_semctl_semid_ds='$d_semctl_semid_ds'
22450 d_semctl_semun='$d_semctl_semun'
22451 d_semget='$d_semget'
22453 d_sendmsg='$d_sendmsg'
22454 d_setegid='$d_setegid'
22455 d_seteuid='$d_seteuid'
22456 d_setgrent='$d_setgrent'
22457 d_setgrent_r='$d_setgrent_r'
22458 d_setgrps='$d_setgrps'
22459 d_sethent='$d_sethent'
22460 d_sethostent_r='$d_sethostent_r'
22461 d_setitimer='$d_setitimer'
22462 d_setlinebuf='$d_setlinebuf'
22463 d_setlocale='$d_setlocale'
22464 d_setlocale_r='$d_setlocale_r'
22465 d_setnent='$d_setnent'
22466 d_setnetent_r='$d_setnetent_r'
22467 d_setpent='$d_setpent'
22468 d_setpgid='$d_setpgid'
22469 d_setpgrp2='$d_setpgrp2'
22470 d_setpgrp='$d_setpgrp'
22471 d_setprior='$d_setprior'
22472 d_setproctitle='$d_setproctitle'
22473 d_setprotoent_r='$d_setprotoent_r'
22474 d_setpwent='$d_setpwent'
22475 d_setpwent_r='$d_setpwent_r'
22476 d_setregid='$d_setregid'
22477 d_setresgid='$d_setresgid'
22478 d_setresuid='$d_setresuid'
22479 d_setreuid='$d_setreuid'
22480 d_setrgid='$d_setrgid'
22481 d_setruid='$d_setruid'
22482 d_setsent='$d_setsent'
22483 d_setservent_r='$d_setservent_r'
22484 d_setsid='$d_setsid'
22485 d_setvbuf='$d_setvbuf'
22489 d_shmatprototype='$d_shmatprototype'
22490 d_shmctl='$d_shmctl'
22492 d_shmget='$d_shmget'
22493 d_sigaction='$d_sigaction'
22494 d_signbit='$d_signbit'
22495 d_sigprocmask='$d_sigprocmask'
22496 d_sigsetjmp='$d_sigsetjmp'
22497 d_sitearch='$d_sitearch'
22498 d_snprintf='$d_snprintf'
22499 d_sockatmark='$d_sockatmark'
22500 d_sockatmarkproto='$d_sockatmarkproto'
22501 d_socket='$d_socket'
22502 d_socklen_t='$d_socklen_t'
22503 d_sockpair='$d_sockpair'
22504 d_socks5_init='$d_socks5_init'
22505 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
22507 d_srand48_r='$d_srand48_r'
22508 d_srandom_r='$d_srandom_r'
22509 d_sresgproto='$d_sresgproto'
22510 d_sresuproto='$d_sresuproto'
22511 d_statblks='$d_statblks'
22512 d_statfs_f_flags='$d_statfs_f_flags'
22513 d_statfs_s='$d_statfs_s'
22514 d_statvfs='$d_statvfs'
22515 d_stdio_cnt_lval='$d_stdio_cnt_lval'
22516 d_stdio_ptr_lval='$d_stdio_ptr_lval'
22517 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
22518 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
22519 d_stdio_stream_array='$d_stdio_stream_array'
22520 d_stdiobase='$d_stdiobase'
22521 d_stdstdio='$d_stdstdio'
22522 d_strchr='$d_strchr'
22523 d_strcoll='$d_strcoll'
22524 d_strctcpy='$d_strctcpy'
22525 d_strerrm='$d_strerrm'
22526 d_strerror='$d_strerror'
22527 d_strerror_r='$d_strerror_r'
22528 d_strftime='$d_strftime'
22529 d_strlcat='$d_strlcat'
22530 d_strlcpy='$d_strlcpy'
22531 d_strtod='$d_strtod'
22532 d_strtol='$d_strtol'
22533 d_strtold='$d_strtold'
22534 d_strtoll='$d_strtoll'
22535 d_strtoq='$d_strtoq'
22536 d_strtoul='$d_strtoul'
22537 d_strtoull='$d_strtoull'
22538 d_strtouq='$d_strtouq'
22539 d_strxfrm='$d_strxfrm'
22540 d_suidsafe='$d_suidsafe'
22541 d_symlink='$d_symlink'
22542 d_syscall='$d_syscall'
22543 d_syscallproto='$d_syscallproto'
22544 d_sysconf='$d_sysconf'
22545 d_sysernlst='$d_sysernlst'
22546 d_syserrlst='$d_syserrlst'
22547 d_system='$d_system'
22548 d_tcgetpgrp='$d_tcgetpgrp'
22549 d_tcsetpgrp='$d_tcsetpgrp'
22550 d_telldir='$d_telldir'
22551 d_telldirproto='$d_telldirproto'
22553 d_timegm='$d_timegm'
22555 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
22556 d_tm_tm_zone='$d_tm_tm_zone'
22557 d_tmpnam_r='$d_tmpnam_r'
22558 d_truncate='$d_truncate'
22559 d_ttyname_r='$d_ttyname_r'
22560 d_tzname='$d_tzname'
22561 d_u32align='$d_u32align'
22562 d_ualarm='$d_ualarm'
22565 d_union_semun='$d_union_semun'
22566 d_unordered='$d_unordered'
22567 d_unsetenv='$d_unsetenv'
22568 d_usleep='$d_usleep'
22569 d_usleepproto='$d_usleepproto'
22571 d_vendorarch='$d_vendorarch'
22572 d_vendorbin='$d_vendorbin'
22573 d_vendorlib='$d_vendorlib'
22574 d_vendorscript='$d_vendorscript'
22576 d_void_closedir='$d_void_closedir'
22577 d_voidsig='$d_voidsig'
22578 d_voidtty='$d_voidtty'
22579 d_volatile='$d_volatile'
22580 d_vprintf='$d_vprintf'
22581 d_vsnprintf='$d_vsnprintf'
22583 d_waitpid='$d_waitpid'
22584 d_wcstombs='$d_wcstombs'
22585 d_wctomb='$d_wctomb'
22586 d_writev='$d_writev'
22589 db_hashtype='$db_hashtype'
22590 db_prefixtype='$db_prefixtype'
22591 db_version_major='$db_version_major'
22592 db_version_minor='$db_version_minor'
22593 db_version_patch='$db_version_patch'
22594 defvoidused='$defvoidused'
22595 direntrytype='$direntrytype'
22598 doublesize='$doublesize'
22600 drand48_r_proto='$drand48_r_proto'
22602 dynamic_ext='$dynamic_ext'
22608 endgrent_r_proto='$endgrent_r_proto'
22609 endhostent_r_proto='$endhostent_r_proto'
22610 endnetent_r_proto='$endnetent_r_proto'
22611 endprotoent_r_proto='$endprotoent_r_proto'
22612 endpwent_r_proto='$endpwent_r_proto'
22613 endservent_r_proto='$endservent_r_proto'
22614 eunicefix='$eunicefix'
22617 extensions='$extensions'
22618 extern_C='$extern_C'
22620 fflushNULL='$fflushNULL'
22621 fflushall='$fflushall'
22623 firstmakefile='$firstmakefile'
22625 fpossize='$fpossize'
22626 fpostype='$fpostype'
22627 freetype='$freetype'
22630 full_csh='$full_csh'
22631 full_sed='$full_sed'
22632 gccansipedantic='$gccansipedantic'
22633 gccosandvers='$gccosandvers'
22634 gccversion='$gccversion'
22635 getgrent_r_proto='$getgrent_r_proto'
22636 getgrgid_r_proto='$getgrgid_r_proto'
22637 getgrnam_r_proto='$getgrnam_r_proto'
22638 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22639 gethostbyname_r_proto='$gethostbyname_r_proto'
22640 gethostent_r_proto='$gethostent_r_proto'
22641 getlogin_r_proto='$getlogin_r_proto'
22642 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22643 getnetbyname_r_proto='$getnetbyname_r_proto'
22644 getnetent_r_proto='$getnetent_r_proto'
22645 getprotobyname_r_proto='$getprotobyname_r_proto'
22646 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22647 getprotoent_r_proto='$getprotoent_r_proto'
22648 getpwent_r_proto='$getpwent_r_proto'
22649 getpwnam_r_proto='$getpwnam_r_proto'
22650 getpwuid_r_proto='$getpwuid_r_proto'
22651 getservbyname_r_proto='$getservbyname_r_proto'
22652 getservbyport_r_proto='$getservbyport_r_proto'
22653 getservent_r_proto='$getservent_r_proto'
22654 getspnam_r_proto='$getspnam_r_proto'
22655 gidformat='$gidformat'
22661 gmtime_r_proto='$gmtime_r_proto'
22662 gnulibc_version='$gnulibc_version'
22664 groupcat='$groupcat'
22665 groupstype='$groupstype'
22668 h_sysfile='$h_sysfile'
22671 html1dir='$html1dir'
22672 html1direxp='$html1direxp'
22673 html3dir='$html3dir'
22674 html3direxp='$html3direxp'
22683 i_arpainet='$i_arpainet'
22684 i_assert='$i_assert'
22685 i_bsdioctl='$i_bsdioctl'
22689 i_dirent='$i_dirent'
22695 i_fp_class='$i_fp_class'
22697 i_gdbm_ndbm='$i_gdbm_ndbm'
22698 i_gdbmndbm='$i_gdbmndbm'
22700 i_ieeefp='$i_ieeefp'
22701 i_inttypes='$i_inttypes'
22702 i_langinfo='$i_langinfo'
22703 i_libutil='$i_libutil'
22704 i_limits='$i_limits'
22705 i_locale='$i_locale'
22706 i_machcthr='$i_machcthr'
22707 i_malloc='$i_malloc'
22708 i_mallocmalloc='$i_mallocmalloc'
22710 i_memory='$i_memory'
22711 i_mntent='$i_mntent'
22714 i_neterrno='$i_neterrno'
22715 i_netinettcp='$i_netinettcp'
22719 i_pthread='$i_pthread'
22721 i_rpcsvcdbm='$i_rpcsvcdbm'
22724 i_shadow='$i_shadow'
22726 i_stdarg='$i_stdarg'
22727 i_stddef='$i_stddef'
22728 i_stdlib='$i_stdlib'
22729 i_string='$i_string'
22730 i_sunmath='$i_sunmath'
22731 i_sysaccess='$i_sysaccess'
22732 i_sysdir='$i_sysdir'
22733 i_sysfile='$i_sysfile'
22734 i_sysfilio='$i_sysfilio'
22736 i_sysioctl='$i_sysioctl'
22737 i_syslog='$i_syslog'
22738 i_sysmman='$i_sysmman'
22739 i_sysmode='$i_sysmode'
22740 i_sysmount='$i_sysmount'
22741 i_sysndir='$i_sysndir'
22742 i_sysparam='$i_sysparam'
22743 i_syspoll='$i_syspoll'
22744 i_sysresrc='$i_sysresrc'
22745 i_syssecrt='$i_syssecrt'
22746 i_sysselct='$i_sysselct'
22747 i_syssockio='$i_syssockio'
22748 i_sysstat='$i_sysstat'
22749 i_sysstatfs='$i_sysstatfs'
22750 i_sysstatvfs='$i_sysstatvfs'
22751 i_systime='$i_systime'
22752 i_systimek='$i_systimek'
22753 i_systimes='$i_systimes'
22754 i_systypes='$i_systypes'
22755 i_sysuio='$i_sysuio'
22757 i_sysutsname='$i_sysutsname'
22758 i_sysvfs='$i_sysvfs'
22759 i_syswait='$i_syswait'
22760 i_termio='$i_termio'
22761 i_termios='$i_termios'
22763 i_unistd='$i_unistd'
22766 i_values='$i_values'
22767 i_varargs='$i_varargs'
22768 i_varhdr='$i_varhdr'
22770 ignore_versioned_solibs='$ignore_versioned_solibs'
22771 inc_version_list='$inc_version_list'
22772 inc_version_list_init='$inc_version_list_init'
22775 initialinstalllocation='$initialinstalllocation'
22776 installarchlib='$installarchlib'
22777 installbin='$installbin'
22778 installhtml1dir='$installhtml1dir'
22779 installhtml3dir='$installhtml3dir'
22780 installman1dir='$installman1dir'
22781 installman3dir='$installman3dir'
22782 installprefix='$installprefix'
22783 installprefixexp='$installprefixexp'
22784 installprivlib='$installprivlib'
22785 installscript='$installscript'
22786 installsitearch='$installsitearch'
22787 installsitebin='$installsitebin'
22788 installsitehtml1dir='$installsitehtml1dir'
22789 installsitehtml3dir='$installsitehtml3dir'
22790 installsitelib='$installsitelib'
22791 installsiteman1dir='$installsiteman1dir'
22792 installsiteman3dir='$installsiteman3dir'
22793 installsitescript='$installsitescript'
22794 installstyle='$installstyle'
22795 installusrbinperl='$installusrbinperl'
22796 installvendorarch='$installvendorarch'
22797 installvendorbin='$installvendorbin'
22798 installvendorhtml1dir='$installvendorhtml1dir'
22799 installvendorhtml3dir='$installvendorhtml3dir'
22800 installvendorlib='$installvendorlib'
22801 installvendorman1dir='$installvendorman1dir'
22802 installvendorman3dir='$installvendorman3dir'
22803 installvendorscript='$installvendorscript'
22805 issymlink='$issymlink'
22806 ivdformat='$ivdformat'
22809 known_extensions='$known_extensions'
22812 lddlflags='$lddlflags'
22814 ldflags_uselargefiles='$ldflags_uselargefiles'
22815 ldlibpthname='$ldlibpthname'
22822 libsdirs='$libsdirs'
22823 libsfiles='$libsfiles'
22824 libsfound='$libsfound'
22825 libspath='$libspath'
22826 libswanted='$libswanted'
22827 libswanted_uselargefiles='$libswanted_uselargefiles'
22833 localtime_r_proto='$localtime_r_proto'
22834 locincpth='$locincpth'
22835 loclibpth='$loclibpth'
22836 longdblsize='$longdblsize'
22837 longlongsize='$longlongsize'
22838 longsize='$longsize'
22842 lseeksize='$lseeksize'
22843 lseektype='$lseektype'
22846 madlyobj='$madlyobj'
22847 madlysrc='$madlysrc'
22851 make_set_make='$make_set_make'
22852 mallocobj='$mallocobj'
22853 mallocsrc='$mallocsrc'
22854 malloctype='$malloctype'
22856 man1direxp='$man1direxp'
22859 man3direxp='$man3direxp'
22861 mips_type='$mips_type'
22862 mistrustnm='$mistrustnm'
22864 mmaptype='$mmaptype'
22865 modetype='$modetype'
22867 multiarch='$multiarch'
22869 myarchname='$myarchname'
22870 mydomain='$mydomain'
22871 myhostname='$myhostname'
22874 need_va_copy='$need_va_copy'
22875 netdb_hlen_type='$netdb_hlen_type'
22876 netdb_host_type='$netdb_host_type'
22877 netdb_name_type='$netdb_name_type'
22878 netdb_net_type='$netdb_net_type'
22881 nm_so_opt='$nm_so_opt'
22882 nonxs_ext='$nonxs_ext'
22884 nvEUformat='$nvEUformat'
22885 nvFUformat='$nvFUformat'
22886 nvGUformat='$nvGUformat'
22887 nv_overflows_integers_at='$nv_overflows_integers_at'
22888 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22889 nveformat='$nveformat'
22890 nvfformat='$nvfformat'
22891 nvgformat='$nvgformat'
22894 o_nonblock='$o_nonblock'
22896 old_pthread_create_joinable='$old_pthread_create_joinable'
22897 optimize='$optimize'
22898 orderlib='$orderlib'
22901 otherlibdirs='$otherlibdirs'
22905 patchlevel='$patchlevel'
22906 path_sep='$path_sep'
22909 perl_patchlevel='$perl_patchlevel'
22910 perladmin='$perladmin'
22911 perllibs='$perllibs'
22912 perlpath='$perlpath'
22914 phostname='$phostname'
22920 prefixexp='$prefixexp'
22922 privlibexp='$privlibexp'
22923 procselfexe='$procselfexe'
22924 prototype='$prototype'
22926 quadkind='$quadkind'
22927 quadtype='$quadtype'
22928 randbits='$randbits'
22929 randfunc='$randfunc'
22930 random_r_proto='$random_r_proto'
22931 randseedtype='$randseedtype'
22933 rd_nodata='$rd_nodata'
22934 readdir64_r_proto='$readdir64_r_proto'
22935 readdir_r_proto='$readdir_r_proto'
22936 revision='$revision'
22942 sGMTIME_max='$sGMTIME_max'
22943 sGMTIME_min='$sGMTIME_min'
22944 sLOCALTIME_max='$sLOCALTIME_max'
22945 sLOCALTIME_min='$sLOCALTIME_min'
22946 sPRIEUldbl='$sPRIEUldbl'
22947 sPRIFUldbl='$sPRIFUldbl'
22948 sPRIGUldbl='$sPRIGUldbl'
22949 sPRIXU64='$sPRIXU64'
22951 sPRIeldbl='$sPRIeldbl'
22952 sPRIfldbl='$sPRIfldbl'
22953 sPRIgldbl='$sPRIgldbl'
22958 sSCNfldbl='$sSCNfldbl'
22959 sched_yield='$sched_yield'
22960 scriptdir='$scriptdir'
22961 scriptdirexp='$scriptdirexp'
22963 seedfunc='$seedfunc'
22964 selectminbits='$selectminbits'
22965 selecttype='$selecttype'
22966 sendmail='$sendmail'
22967 setgrent_r_proto='$setgrent_r_proto'
22968 sethostent_r_proto='$sethostent_r_proto'
22969 setlocale_r_proto='$setlocale_r_proto'
22970 setnetent_r_proto='$setnetent_r_proto'
22971 setprotoent_r_proto='$setprotoent_r_proto'
22972 setpwent_r_proto='$setpwent_r_proto'
22973 setservent_r_proto='$setservent_r_proto'
22976 sharpbang='$sharpbang'
22977 shmattype='$shmattype'
22978 shortsize='$shortsize'
22981 sig_count='$sig_count'
22982 sig_name='$sig_name'
22983 sig_name_init='$sig_name_init'
22985 sig_num_init='$sig_num_init'
22986 sig_size='$sig_size'
22987 signal_t='$signal_t'
22988 sitearch='$sitearch'
22989 sitearchexp='$sitearchexp'
22991 sitebinexp='$sitebinexp'
22992 sitehtml1dir='$sitehtml1dir'
22993 sitehtml1direxp='$sitehtml1direxp'
22994 sitehtml3dir='$sitehtml3dir'
22995 sitehtml3direxp='$sitehtml3direxp'
22997 sitelib_stem='$sitelib_stem'
22998 sitelibexp='$sitelibexp'
22999 siteman1dir='$siteman1dir'
23000 siteman1direxp='$siteman1direxp'
23001 siteman3dir='$siteman3dir'
23002 siteman3direxp='$siteman3direxp'
23003 siteprefix='$siteprefix'
23004 siteprefixexp='$siteprefixexp'
23005 sitescript='$sitescript'
23006 sitescriptexp='$sitescriptexp'
23007 sizesize='$sizesize'
23008 sizetype='$sizetype'
23012 sockethdr='$sockethdr'
23013 socketlib='$socketlib'
23014 socksizetype='$socksizetype'
23016 spackage='$spackage'
23017 spitshell='$spitshell'
23018 srand48_r_proto='$srand48_r_proto'
23019 srandom_r_proto='$srandom_r_proto'
23021 ssizetype='$ssizetype'
23022 startperl='$startperl'
23024 static_ext='$static_ext'
23026 stdio_base='$stdio_base'
23027 stdio_bufsiz='$stdio_bufsiz'
23028 stdio_cnt='$stdio_cnt'
23029 stdio_filbuf='$stdio_filbuf'
23030 stdio_ptr='$stdio_ptr'
23031 stdio_stream_array='$stdio_stream_array'
23032 strerror_r_proto='$strerror_r_proto'
23035 subversion='$subversion'
23039 targetarch='$targetarch'
23043 timeincl='$timeincl'
23044 timetype='$timetype'
23045 tmpnam_r_proto='$tmpnam_r_proto'
23051 ttyname_r_proto='$ttyname_r_proto'
23060 uidformat='$uidformat'
23066 uquadtype='$uquadtype'
23067 use5005threads='$use5005threads'
23068 use64bitall='$use64bitall'
23069 use64bitint='$use64bitint'
23070 usecrosscompile='$usecrosscompile'
23071 usedevel='$usedevel'
23073 usedtrace='$usedtrace'
23074 usefaststdio='$usefaststdio'
23075 useithreads='$useithreads'
23076 uselargefiles='$uselargefiles'
23077 uselongdouble='$uselongdouble'
23078 usemallocwrap='$usemallocwrap'
23079 usemorebits='$usemorebits'
23080 usemultiplicity='$usemultiplicity'
23081 usemymalloc='$usemymalloc'
23083 useopcode='$useopcode'
23084 useperlio='$useperlio'
23085 useposix='$useposix'
23086 usereentrant='$usereentrant'
23087 userelocatableinc='$userelocatableinc'
23089 useshrplib='$useshrplib'
23090 usesitecustomize='$usesitecustomize'
23091 usesocks='$usesocks'
23092 usethreads='$usethreads'
23093 usevendorprefix='$usevendorprefix'
23094 usevfork='$usevfork'
23097 uvXUformat='$uvXUformat'
23098 uvoformat='$uvoformat'
23101 uvuformat='$uvuformat'
23102 uvxformat='$uvxformat'
23103 vendorarch='$vendorarch'
23104 vendorarchexp='$vendorarchexp'
23105 vendorbin='$vendorbin'
23106 vendorbinexp='$vendorbinexp'
23107 vendorhtml1dir='$vendorhtml1dir'
23108 vendorhtml1direxp='$vendorhtml1direxp'
23109 vendorhtml3dir='$vendorhtml3dir'
23110 vendorhtml3direxp='$vendorhtml3direxp'
23111 vendorlib='$vendorlib'
23112 vendorlib_stem='$vendorlib_stem'
23113 vendorlibexp='$vendorlibexp'
23114 vendorman1dir='$vendorman1dir'
23115 vendorman1direxp='$vendorman1direxp'
23116 vendorman3dir='$vendorman3dir'
23117 vendorman3direxp='$vendorman3direxp'
23118 vendorprefix='$vendorprefix'
23119 vendorprefixexp='$vendorprefixexp'
23120 vendorscript='$vendorscript'
23121 vendorscriptexp='$vendorscriptexp'
23123 version_patchlevel_string='$version_patchlevel_string'
23124 versiononly='$versiononly'
23126 voidflags='$voidflags'
23129 yaccflags='$yaccflags'
23134 : Add in command line options if available
23135 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23137 : add special variables
23138 $test -f $src/patchlevel.h && \
23139 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23140 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
23141 echo "PERL_CONFIG_SH=true" >>config.sh
23143 : propagate old symbols
23144 if $test -f UU/config.sh; then
23145 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23146 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23147 config.sh config.sh UU/oldconfig.sh |\
23148 $sort | $uniq -u >UU/oldsyms
23149 set X `cat UU/oldsyms`
23155 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23157 echo ": Variables propagated from previous config.sh file." >>config.sh
23158 for sym in `cat UU/oldsyms`; do
23159 echo " Propagating $hint variable "'$'"$sym..."
23160 eval 'tmp="$'"${sym}"'"'
23162 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23168 : Finish up by extracting the .SH files
23172 echo "Extraction done."
23182 If you'd like to make any changes to the config.sh file before I begin
23183 to configure things, do it as a shell escape now (e.g. !vi config.sh).
23186 rp="Press return or use a shell escape to edit config.sh:"
23191 *) : in case they cannot read
23192 sh 1>&4 -c "$ans";;
23197 : if this fails, just run all the .SH files by hand
23206 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
23213 Now you need to generate make dependencies by running "$make depend".
23214 You might prefer to run it in background: "$make depend > makedepend.out &"
23215 It can take a while, so you might not want to run it right now.
23220 rp="Run $make depend now?"
23224 $make depend && echo "Now you must run '$make'."
23227 echo "You must run '$make depend' then '$make'."
23230 elif test -f [Mm]akefile; then
23232 echo "Now you must run a $make."
23234 echo "Configure done."
23237 if $test -f Policy.sh; then
23240 If you compile $package on a different machine or from a different object
23241 directory, copy the Policy.sh file from this object directory to the
23242 new one before you run Configure -- this will help you with most of
23243 the policy defaults.
23247 if $test -f config.msg; then
23248 echo "Hmm. I also noted the following information while running:"
23250 $cat config.msg >&4
23253 $rm -f kit*isdone ark*isdone