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 Mon Jan 19 16:46:57 CET 2009 [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
6369 if $test $patchlevel -lt 11; then
6372 case "$d_suidsafe" in
6375 echo "No need to emulate SUID scripts since they are secure here." >&4
6379 Some systems have disabled setuid scripts, especially systems where
6380 setuid scripts cannot be secure. On systems where setuid scripts have
6381 been disabled, the setuid/setgid bits on scripts are currently
6382 useless. It is possible for $package to detect those bits and emulate
6383 setuid/setgid in a secure fashion. This emulation will only work if
6384 setuid scripts have been disabled in your kernel.
6388 "$define") dflt=y ;;
6391 rp="Do you want to do setuid/setgid emulation?"
6394 [yY]*) val="$define";;
6406 SUID emulation has been removed for 5.12
6407 Please re-run Configure without -Dd_dosuid
6416 : Find perl5.005 or later.
6417 echo "Looking for a previously installed perl5.005 or later... "
6419 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6420 : Check if this perl is recent and can load a simple module
6421 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6424 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6434 '') echo "None found. That's ok.";;
6435 *) echo "Using $perl5." ;;
6438 : Set the siteprefix variables
6441 After $package is installed, you may wish to install various
6442 add-on modules and utilities. Typically, these add-ons will
6443 be installed under $prefix with the rest
6444 of this package. However, you may wish to install such add-ons
6445 elsewhere under a different prefix.
6447 If you do not wish to put everything under a single prefix, that's
6448 ok. You will be prompted for the individual locations; this siteprefix
6449 is only used to suggest the defaults.
6451 The default should be fine for most people.
6455 rp='Installation prefix to use for add-on modules and utilities?'
6456 : XXX Here might be another good place for an installstyle setting.
6457 case "$siteprefix" in
6459 *) dflt=$siteprefix ;;
6462 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6464 case "$siteprefix" in
6468 *) oldsiteprefix="$prefix";;
6473 siteprefixexp="$ansexp"
6475 : determine where site specific libraries go.
6476 : Usual default is /usr/local/lib/perl5/site_perl/$version
6477 : The default "style" setting is made in installstyle.U
6478 : XXX No longer works with Prefixit stuff.
6479 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6481 '') case "$installstyle" in
6482 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6483 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6491 The installation process will create a directory for
6492 site-specific extensions and modules. Most users find it convenient
6493 to place all site-specific files in this directory rather than in the
6494 main distribution directory.
6498 rp='Pathname for the site-specific library files?'
6502 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6504 : Determine list of previous versions to include in @INC
6505 $cat > getverlist <<EOPL
6508 \$api_versionstring = "$api_versionstring";
6509 \$version = "$version";
6510 \$stem = "$sitelib_stem";
6511 \$archname = "$archname";
6513 $cat >> getverlist <<'EOPL'
6514 # The list found is store twice for each entry: the original name, and
6515 # the binary broken down version as pack "sss", so sorting is easy and
6516 # unambiguous. This will work for all versions that have a maximum of
6517 # three digit groups, separate by '.'s or '_'s. Names are extended with
6518 # ".0.0" to ensure at least three elements for the pack.
6519 # -- H.Merijn Brand (m)'06 23-10-2006
6521 # Can't have leading @ because metaconfig interprets it as a command!
6522 ;@inc_version_list=();
6523 # XXX Redo to do opendir/readdir?
6526 ;@candidates = map {
6527 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6533 ($pversion, $aversion, $vsn5005) = map {
6534 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6535 foreach $d (@candidates) {
6536 if ($d->[1] lt $pversion) {
6537 if ($d->[1] ge $aversion) {
6538 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6540 elsif ($d->[1] ge $vsn5005) {
6541 unshift(@inc_version_list, grep { -d } $d->[0]);
6545 # Skip newer version. I.e. don't look in
6546 # 5.7.0 if we're installing 5.6.1.
6550 if (@inc_version_list) {
6551 print join(' ', @inc_version_list);
6554 # Blank space to preserve value for next Configure run.
6559 case "$inc_version_list" in
6560 '') if test -x "$perl5$exe_ext"; then
6561 dflt=`$perl5 getverlist`
6566 $undef) dflt='none' ;;
6567 *) eval dflt=\"$inc_version_list\" ;;
6570 ''|' ') dflt=none ;;
6577 In order to ease the process of upgrading, this version of perl
6578 can be configured to use modules built and installed with earlier
6579 versions of perl that were installed under $prefix. Specify here
6580 the list of earlier versions that this version of perl should check.
6581 If Configure detected no earlier versions of perl installed under
6582 $prefix, then the list will be empty. Answer 'none' to tell perl
6583 to not search earlier versions.
6585 The default should almost always be sensible, so if you're not sure,
6586 just accept the default.
6589 rp='List of earlier versions to include in @INC?'
6592 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6593 *) inc_version_list="$ans" ;;
6595 case "$inc_version_list" in
6597 inc_version_list_init='0'
6598 d_inc_version_list="$undef"
6600 *) inc_version_list_init=`echo $inc_version_list |
6601 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6602 d_inc_version_list="$define"
6607 : see if malloc/malloc.h has to be included
6608 set malloc/malloc.h i_mallocmalloc
6611 : see if this is a malloc.h system
6612 : we want a real compile instead of Inhdr because some systems have a
6613 : malloc.h that just gives a compile error saying to use stdlib.h instead
6618 #$i_mallocmalloc I_MALLOCMALLOC
6619 #ifdef I_MALLOCMALLOC
6620 # include <malloc/malloc.h>
6623 int main () { return 0; }
6626 if eval $compile; then
6627 echo "<malloc.h> found." >&4
6630 echo "<malloc.h> NOT found." >&4
6637 : check for void type
6639 echo "Checking to see how well your C compiler groks the void type..." >&4
6640 case "$voidflags" in
6652 extern void moo(); /* function returning void */
6653 void (*goo)(); /* ptr to func returning void */
6655 void *hue; /* generic ptr */
6668 int main() { sub(); }
6670 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6671 voidflags=$defvoidused
6672 echo "Good. It appears to support void to the level $package wants.">&4
6673 if $contains warning .out >/dev/null 2>&1; then
6674 echo "However, you might get some warnings that look like this:"
6678 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6679 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6680 echo "It supports 1..."
6681 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6682 echo "It also supports 2..."
6683 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6685 echo "And it supports 4 but not 8 definitely."
6687 echo "It doesn't support 4..."
6688 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6690 echo "But it supports 8."
6693 echo "Neither does it support 8."
6697 echo "It does not support 2..."
6698 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6700 echo "But it supports 4 and 8."
6702 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6704 echo "And it supports 4 but has not heard about 8."
6706 echo "However it supports 8 but not 4."
6711 echo "There is no support at all for void."
6716 case "$voidflags" in
6719 Support flag bits are:
6720 1: basic void declarations.
6721 2: arrays of pointers to functions returning void.
6722 4: operations between pointers to and addresses of void functions.
6723 8: generic void pointers.
6726 rp="Your void support flags add up to what?"
6733 : check for length of pointer
6737 echo "Checking to see how big your pointers are..." >&4
6738 if test "$voidflags" -gt 7; then
6739 echo '#define VOID_PTR char *' > try.c
6741 echo '#define VOID_PTR void *' > try.c
6751 printf("%d\n", (int)sizeof(VOID_PTR));
6756 if eval $compile_ok; then
6757 ptrsize=`$run ./try`
6758 echo "Your pointers are $ptrsize bytes long."
6761 echo "(I can't seem to compile the test program. Guessing...)" >&4
6762 rp="What is the size of a pointer (in bytes)?"
6769 case "$use64bitall" in
6770 "$define"|true|[yY]*)
6774 *** You have chosen a maximally 64-bit build,
6775 *** but your pointers are only 4 bytes wide.
6776 *** Please rerun Configure without -Duse64bitall.
6781 *** Since you have quads, you could possibly try with -Duse64bitint.
6786 *** Cannot continue, aborting.
6797 : determine whether to use malloc wrapping
6799 case "$usemallocwrap" in
6800 [yY]*|true|$define) dflt='y' ;;
6801 [nN]*|false|$undef) dflt='n' ;;
6802 *) case "$usedevel" in
6803 [yY]*|true|$define) dflt='y' ;;
6808 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6810 usemallocwrap="$ans"
6813 usemallocwrap="$define" ;;
6815 usemallocwrap="$undef" ;;
6818 : determine which malloc to compile in
6820 case "$usemymalloc" in
6821 [yY]*|true|$define) dflt='y' ;;
6822 [nN]*|false|$undef) dflt='n' ;;
6823 *) case "$ptrsize" in
6829 rp="Do you wish to attempt to use the malloc that comes with $package?"
6835 mallocsrc='malloc.c'
6836 mallocobj="malloc$_o"
6837 d_mymalloc="$define"
6840 : Remove malloc from list of libraries to use
6841 echo "Removing unneeded -lmalloc from library list" >&4
6842 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6845 echo "libs = $libs" >&4
6857 : compute the return types of malloc and free
6859 $cat >malloc.c <<END
6863 #include <sys/types.h>
6877 case "$malloctype" in
6879 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6886 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6890 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6897 echo "Your system uses $freetype free(), it would seem." >&4
6899 : determine where site specific architecture-dependent libraries go.
6900 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6901 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6902 : sitelib may have an optional trailing /share.
6904 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6905 dflt="$dflt/$archname"
6910 set sitearch sitearch none
6914 The installation process will also create a directory for
6915 architecture-dependent site-specific extensions and modules.
6919 rp='Pathname for the site-specific architecture-dependent library files?'
6923 if $test X"$sitearch" = X"$sitelib"; then
6926 d_sitearch="$define"
6929 : Set the vendorprefix variables
6932 The installation process will also create a directory for
6933 vendor-supplied add-ons. Vendors who supply perl with their system
6934 may find it convenient to place all vendor-supplied files in this
6935 directory rather than in the main distribution directory. This will
6936 ease upgrades between binary-compatible maintenance versions of perl.
6938 Of course you may also use these directories in whatever way you see
6939 fit. For example, you might use them to access modules shared over a
6940 company-wide network.
6942 The default answer should be fine for most people.
6943 This causes further questions about vendor add-ons to be skipped
6944 and no vendor-specific directories will be configured for perl.
6947 rp='Do you want to configure vendor-specific add-on directories?'
6948 case "$usevendorprefix" in
6949 define|true|[yY]*) dflt=y ;;
6950 *) : User may have set vendorprefix directly on Configure command line.
6951 case "$vendorprefix" in
6960 rp='Installation prefix to use for vendor-supplied add-ons?'
6961 case "$vendorprefix" in
6963 *) dflt=$vendorprefix ;;
6966 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6968 case "$vendorprefix" in
6972 *) oldvendorprefix="$prefix";;
6976 usevendorprefix="$define"
6978 vendorprefixexp="$ansexp"
6980 *) usevendorprefix="$undef"
6986 : Set the vendorlib variables
6987 case "$vendorprefix" in
6988 '') d_vendorlib="$undef"
6992 *) d_vendorlib="$define"
6993 : determine where vendor-supplied modules go.
6994 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6995 case "$vendorlib" in
6997 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6998 case "$installstyle" in
6999 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7000 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7003 *) dflt="$vendorlib"
7007 rp='Pathname for the vendor-supplied library files?'
7010 vendorlibexp="$ansexp"
7013 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7017 : Set the vendorarch variables
7018 case "$vendorprefix" in
7019 '') d_vendorarch="$undef"
7023 *) d_vendorarch="$define"
7024 : determine where vendor-supplied architecture-dependent libraries go.
7025 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7026 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7027 : vendorlib may have an optional trailing /share.
7028 case "$vendorarch" in
7029 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7030 dflt="$dflt/$archname"
7032 *) dflt="$vendorarch" ;;
7035 rp='Pathname for vendor-supplied architecture-dependent files?'
7038 vendorarchexp="$ansexp"
7041 prefixvar=vendorarch
7043 if $test X"$vendorarch" = X"$vendorlib"; then
7044 d_vendorarch="$undef"
7046 d_vendorarch="$define"
7049 : Final catch-all directories to search
7052 Lastly, you can have perl look in other directories for extensions and
7053 modules in addition to those already specified.
7054 These directories will be searched after
7058 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7059 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7061 case "$otherlibdirs" in
7062 ''|' ') dflt='none' ;;
7063 *) dflt="$otherlibdirs" ;;
7066 Enter a colon-separated set of extra paths to include in perl's @INC
7067 search path, or enter 'none' for no extra paths.
7071 rp='Colon-separated list of additional directories for perl to search?'
7074 ' '|''|none) otherlibdirs=' ' ;;
7075 *) otherlibdirs="$ans" ;;
7077 case "$otherlibdirs" in
7081 set d_perl_otherlibdirs
7084 : Cruising for prototypes
7086 echo "Checking out function prototypes..." >&4
7087 $cat >prototype.c <<EOCP
7092 int main(int argc, char *argv[]) {
7095 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7096 echo "Your C compiler appears to support function prototypes."
7099 echo "Your C compiler doesn't seem to understand function prototypes."
7106 : Check if ansi2knr is required
7107 case "$prototype" in
7109 *) ansi2knr='ansi2knr'
7114 This version of $package can only be compiled by a compiler that
7115 understands function prototypes. Unfortunately, your C compiler
7117 doesn't seem to understand them. Sorry about that.
7119 If GNU cc is available for your system, perhaps you could try that instead.
7121 Eventually, we hope to support building Perl with pre-ANSI compilers.
7122 If you would like to help in that effort, please contact <perlbug@perl.org>.
7124 Aborting Configure now.
7131 dflt_dtrace='/usr/sbin/dtrace'
7134 Perl can be built to support DTrace on platforms that support it.
7135 DTrace is a diagnosis and performance analysis tool from Sun.
7137 If this doesn't make any sense to you, just accept the default '$dflt'.
7141 case "$usedtrace" in
7147 dflt_dtrace=$usedtrace
7154 rp='Support DTrace if available?'
7157 y|Y) val="$define" ;;
7163 test "X$usedtrace" != "X$define" && break
7166 rp='Where is the dtrace executable?'
7175 if $dtrace -h -s ../perldtrace.d \
7176 -o perldtrace.tmp >/dev/null 2>&1 \
7177 && rm -f perldtrace.tmp
7180 echo "Good: your $dtrace knows about the -h flag."
7184 *** $me: Fatal Error: $dtrace doesn't support -h flag
7186 *** Your installed dtrace doesn't support the -h switch to compile a D
7187 *** program into a C header. Can't continue.
7199 *** $me: Fatal Error: $dtrace not found.
7206 echo "*** $dtrace was not found."
7212 : See if we want extra modules installed
7219 Perl can be built with extra modules or bundles of modules which
7220 will be fetched from the CPAN and installed alongside Perl.
7222 Notice that you will need access to the CPAN; either via the Internet,
7223 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7224 be asked later to configure the CPAN.pm module which will in turn do
7225 the installation of the rest of the extra modules or bundles.)
7227 Notice also that if the modules require any external software such as
7228 libraries and headers (the libz library and the zlib.h header for the
7229 Compress::Zlib module, for example) you MUST have any such software
7230 already installed, this configuration process will NOT install such
7233 If this doesn't make any sense to you, just accept the default '$dflt'.
7235 rp='Install any extra modules (y or n)?'
7241 Please list any extra modules or bundles to be installed from CPAN,
7242 with spaces between the names. The names can be in any format the
7243 'install' command of CPAN.pm will understand. (Answer 'none',
7244 without the quotes, to install no extra modules or bundles.)
7254 $rm -f ../extras.lst
7256 *) echo "(Saving the list of extras for later...)"
7257 echo "$extras" > ../extras.lst
7265 : determine where html pages for programs go
7266 set html1dir html1dir none
7270 If you wish to install html files for programs in $spackage, indicate
7271 the appropriate directory here. To skip installing html files,
7275 ''|none|$undef|' ') dflt=none ;;
7276 *) dflt=$html1dir ;;
7279 rp="Directory for the main $spackage html pages?"
7283 : Use ' ' for none so value is preserved next time through Configure
7284 $test X"$html1dir" = "X" && html1dir=' '
7286 : determine where html pages for libraries and modules go
7287 set html3dir html3dir none
7291 If you wish to install html files for modules associated with $spackage,
7292 indicate the appropriate directory here. To skip installing html files,
7295 : There is no obvious default. If they have specified html1dir, then
7296 : try to key off that, possibly changing .../html1 into .../html3.
7298 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7299 *) dflt=$html3dir ;;
7302 rp="Directory for the $spackage module html pages?"
7306 : Use ' ' for none so value is preserved next time through Configure
7307 $test X"$html3dir" = "X" && html3dir=' '
7309 : determine whether to install perl also as /usr/bin/perl
7312 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7314 Many scripts expect perl to be installed as /usr/bin/perl.
7316 If you want to, I can install the perl you are about to compile
7317 as /usr/bin/perl (in addition to $bin/perl).
7319 if test -f /usr/bin/perl; then
7322 However, please note that because you already have a /usr/bin/perl,
7323 overwriting that with a new Perl would very probably cause problems.
7324 Therefore I'm assuming you don't want to do that (unless you insist).
7327 case "$installusrbinperl" in
7328 "$define"|[yY]*) dflt='y';;
7334 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7337 case "$installusrbinperl" in
7338 "$undef"|[nN]*) dflt='n';;
7342 rp="Do you want to install perl as /usr/bin/perl?"
7345 [yY]*) val="$define";;
7351 set installusrbinperl
7354 : Check if we are using the GNU C library
7356 echo "Checking for GNU C Library..." >&4
7358 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7359 alone are insufficient to distinguish different versions, such as
7360 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7361 libc version 2.1.0. A. Dougherty, June 3, 2002.
7367 # ifdef __GLIBC_MINOR__
7368 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7369 # include <gnu/libc-version.h>
7370 printf("%s\n", gnu_get_libc_version());
7372 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7375 printf("%d\n", __GLIBC__);
7384 if eval $compile_ok && $run ./try > glibc.ver; then
7386 gnulibc_version=`$cat glibc.ver`
7387 echo "You are using the GNU C Library version $gnulibc_version"
7391 echo "You are not using the GNU C Library"
7397 : see if nm is to be used to determine whether a symbol is defined or not
7401 case "$d_gnulibc" in
7404 echo "nm probably won't work on the GNU C Library." >&4
7410 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7412 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7413 echo "'nm' won't be sufficient on this sytem." >&4
7419 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7420 if $test $dflt -gt 20; then
7430 true|$define) dflt=y;;
7437 I can use $nm to extract the symbols from your C libraries. This
7438 is a time consuming task which may generate huge output on the disk (up
7439 to 3 megabytes) but that should make the symbols extraction faster. The
7440 alternative is to skip the 'nm' extraction part and to compile a small
7441 test program instead to determine whether each symbol is present. If
7442 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7443 this may be the best solution.
7445 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7448 rp="Shall I use $nm to extract C symbols from the libraries?"
7451 [Nn]*) usenm=false;;
7460 : nm options which may be necessary
7462 '') if $test -f /mach_boot; then
7464 elif $test -d /usr/ccs/lib; then
7465 nm_opt='-p' # Solaris (and SunOS?)
7466 elif $test -f /dgux; then
7468 elif $test -f /lib64/rld; then
7469 nm_opt='-p' # 64-bit Irix
7475 : nm options which may be necessary for shared libraries but illegal
7476 : for archive libraries. Thank you, Linux.
7477 case "$nm_so_opt" in
7478 '') case "$myuname" in
7480 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7481 nm_so_opt='--dynamic'
7488 : Figure out where the libc is located
7491 : get list of predefined functions in a handy place
7496 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7502 *) for thislib in $libs; do
7505 : Handle C library specially below.
7508 thislib=`echo $thislib | $sed -e 's/^-l//'`
7509 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7511 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7513 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7515 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7517 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7519 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7521 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7526 libnames="$libnames $try"
7528 *) libnames="$libnames $thislib" ;;
7537 for xxx in $libpth; do
7538 $test -r $1 || set $xxx/libc.$so
7539 : The messy sed command sorts on library version numbers.
7541 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7542 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7544 s/[0-9][0-9]*/0000&/g
7545 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7548 $sort | $sed -e 's/^.* //'`
7551 $test -r $1 || set /usr/ccs/lib/libc.$so
7552 $test -r $1 || set /lib/libsys_s$_a
7558 if $test -r "$1"; then
7559 echo "Your (shared) C library seems to be in $1."
7561 elif $test -r /lib/libc && $test -r /lib/clib; then
7562 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7564 libc='/lib/clib /lib/libc'
7565 if $test -r /lib/syslib; then
7566 echo "(Your math library is in /lib/syslib.)"
7567 libc="$libc /lib/syslib"
7569 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7570 echo "Your C library seems to be in $libc, as you said before."
7571 elif $test -r $incpath/usr/lib/libc$_a; then
7572 libc=$incpath/usr/lib/libc$_a;
7573 echo "Your C library seems to be in $libc. That's fine."
7574 elif $test -r /lib/libc$_a; then
7576 echo "Your C library seems to be in $libc. You're normal."
7578 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7580 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7581 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7582 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7584 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7586 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7589 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7591 if $test -r "$tans"; then
7592 echo "Your C library seems to be in $tans, of all places."
7598 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7602 If the guess above is wrong (which it might be if you're using a strange
7603 compiler, or your machine supports multiple models), you can override it here.
7608 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7610 I can't seem to find your C library. I've looked in the following places:
7613 $sed 's/^/ /' libpath
7616 None of these seems to contain your C library. I need to get its name...
7621 rp='Where is your C library?'
7626 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7627 set X `cat libnames`
7630 case $# in 1) xxx=file; esac
7631 echo "Extracting names from the following $xxx for later perusal:" >&4
7633 $sed 's/^/ /' libnames >&4
7635 $echo $n "This may take a while...$c" >&4
7639 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7640 *) $nm $nm_opt $file 2>/dev/null;;
7645 $grep fprintf libc.tmp > libc.ptf
7646 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7647 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7649 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7651 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7653 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7655 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7657 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7659 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7661 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7663 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7665 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7667 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7669 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7671 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7673 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7674 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7676 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7678 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7680 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7682 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7684 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7686 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7688 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7690 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7692 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7694 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7696 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7698 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7700 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7702 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7704 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7707 $nm -p $* 2>/dev/null >libc.tmp
7708 $grep fprintf libc.tmp > libc.ptf
7709 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7710 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7716 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7718 if $ar t $libc > libc.tmp && \
7719 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7721 for thisname in $libnames $libc; do
7722 $ar t $thisname >>libc.tmp
7724 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7726 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7727 for thisname in $libnames $libc; do
7728 $ar tv $thisname >>libc.tmp
7729 emximp -o tmp.imp $thisname \
7731 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7732 < tmp.imp >>libc.tmp
7735 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7738 echo "$ar didn't seem to work right." >&4
7739 echo "Maybe this is a Cray...trying bld instead..." >&4
7741 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7744 for thisname in $libnames; do
7746 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7747 $ar t $thisname >>libc.tmp
7751 echo "That didn't work either. Giving up." >&4
7761 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7762 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7764 *) if $test -f /lib/syscalls.exp; then
7766 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7767 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7768 /lib/syscalls.exp >>libc.list
7774 $rm -f libnames libpath
7776 : see if dld is available
7780 : Check if we are using C++
7782 echo "Checking for C++..." >&4
7783 $cat >try.c <<'EOCP'
7795 if eval $compile_ok && $run ./try; then
7797 echo "You are using a C++ compiler."
7800 echo "You are not using a C++ compiler."
7806 : is a C symbol defined?
7809 -v) tf=libc.tmp; tdc="";;
7810 -a) tf=libc.tmp; tdc="[]";;
7811 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7813 case "$d_cplusplus" in
7814 $define) extern_C="extern \"C\"" ;;
7815 *) extern_C="extern" ;;
7818 case "$reuseval-$4" in
7820 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7825 if $test "$runnm" = true; then
7826 if $contains $tlook $tf >/dev/null 2>&1; then
7828 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7829 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7830 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7831 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7835 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7836 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7842 $define) tval=true;;
7849 : define an is-in-libc? function
7850 inlibc='echo " "; td=$define; tu=$undef;
7851 sym=$1; var=$2; eval "was=\$$2";
7853 case "$reuseval$was" in
7863 echo "$sym() found." >&4;
7864 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7866 echo "$sym() NOT found." >&4;
7867 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7871 $define) echo "$sym() found." >&4;;
7872 *) echo "$sym() NOT found." >&4;;
7876 : see if dlopen exists
7878 xxx_ccflags="$ccflags"
7880 : with g++ one needs -shared to get is-in-libc to work for dlopen
7881 case "$gccversion" in
7883 *) case "$d_cplusplus" in
7884 "$define") ccflags="$ccflags -shared" ;;
7891 ccflags="$xxx_ccflags"
7893 : see if this is a unistd.h system
7894 set unistd.h i_unistd
7897 : determine which dynamic loading, if any, to compile in
7899 dldir="ext/DynaLoader"
7912 $define) dflt='y' ;;
7915 $define) dflt='y' ;;
7917 : Does a dl_xxx.xs file exist for this operating system
7918 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7921 rp="Do you wish to use dynamic loading?"
7928 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7929 dflt="$dldir/dl_${osname}.xs"
7930 elif $test "$d_dlopen" = "$define" ; then
7931 dflt="$dldir/dl_dlopen.xs"
7932 elif $test "$i_dld" = "$define" ; then
7933 dflt="$dldir/dl_dld.xs"
7938 *) dflt="$dldir/$dlsrc"
7941 echo "The following dynamic loading files are available:"
7942 : Can not go over to $dldir because getfile has path hard-coded in.
7943 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7944 rp="Source file to use for dynamic loading"
7950 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7954 Some systems may require passing special flags to $cc -c to
7955 compile modules that will be used to create a shared library.
7956 To use no flags, say "none".
7959 case "$cccdlflags" in
7960 '') case "$gccversion" in
7961 '') case "$osname" in
7963 next) dflt='none' ;;
7964 irix*) dflt='-KPIC' ;;
7965 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7966 sunos) dflt='-pic' ;;
7970 *) case "$osname" in
7971 darwin) dflt='none' ;;
7972 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7977 *) dflt="$cccdlflags" ;;
7979 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7982 none) cccdlflags=' ' ;;
7983 *) cccdlflags="$ans" ;;
7988 Some systems use ld to create libraries that can be dynamically loaded,
7989 while other systems (such as those using ELF) use $cc.
7993 '') $cat >try.c <<EOM
7994 /* Test for whether ELF binaries are produced */
8006 int i = open("a.out",O_RDONLY);
8009 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8010 exit(0); /* succeed (yes, it's ELF) */
8015 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8017 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8021 echo "I'll use ld to build dynamic libraries."
8030 rp="What command should be used to create dynamic libraries?"
8036 Some systems may require passing special flags to $ld to create a
8037 library that can be dynamically loaded. If your ld flags include
8038 -L/other/path options to locate libraries outside your loader's normal
8039 search path, you may need to specify those -L options here as well. To
8040 use no flags, say "none".
8043 case "$lddlflags" in
8044 '') case "$osname" in
8045 beos) dflt='-nostart' ;;
8046 haiku) dflt='-shared' ;;
8048 case "$gccversion" in
8049 '') dflt="$dflt +vnocompatwarnings" ;;
8052 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8053 next) dflt='none' ;;
8054 solaris) dflt='-G' ;;
8055 sunos) dflt='-assert nodefinitions' ;;
8056 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8060 *) dflt="$lddlflags" ;;
8063 : Try to guess additional flags to pick up local libraries.
8064 : Be careful not to append to a plain 'none'
8068 for thisflag in $ldflags; do
8073 *) dflt="$dflt $thisflag" ;;
8080 ''|' ') dflt='none' ;;
8084 *-fstack-protector*)
8086 *-fstack-protector*) ;; # Don't add it again
8087 *) dflt="$dflt -fstack-protector" ;;
8093 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8096 none) lddlflags=' ' ;;
8097 *) lddlflags="$ans" ;;
8102 Some systems may require passing special flags to $cc to indicate that
8103 the resulting executable will use dynamic linking. To use no flags,
8107 case "$ccdlflags" in
8108 '') case "$osname" in
8109 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8110 next|sunos) dflt='none' ;;
8114 *) dflt="$ccdlflags" ;;
8116 rp="Any special flags to pass to $cc to use dynamic linking?"
8119 none) ccdlflags=' ' ;;
8120 *) ccdlflags="$ans" ;;
8131 : Do we want a shared libperl?
8135 # No dynamic loading being used, so don't bother even to prompt.
8138 *) case "$useshrplib" in
8139 '') case "$osname" in
8140 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|haiku|cygwin*)
8142 also='Building a shared libperl is required for dynamic loading to work on your system.'
8147 also='Building a shared libperl is needed for MAB support.'
8165 The perl executable is normally obtained by linking perlmain.c with
8166 libperl${_a}, any static extensions (usually just DynaLoader), and
8167 any other libraries needed on this system (such as -lm, etc.). Since
8168 your system supports dynamic loading, it is probably possible to build
8169 a shared libperl.$so. If you will have more than one executable linked
8170 to libperl.$so, this will significantly reduce the size of each
8171 executable, but it may have a noticeable effect on performance. The
8172 default is probably sensible for your system.
8176 rp="Build a shared libperl.$so (y/n)"
8180 useshrplib='true' ;;
8181 *) useshrplib='false' ;;
8186 case "$useshrplib" in
8190 # Figure out a good name for libperl.so. Since it gets stored in
8191 # a version-specific architecture-dependent library, the version
8192 # number isn't really that important, except for making cc/ld happy.
8194 # A name such as libperl.so.10.1
8195 majmin="libperl.$so.$patchlevel.$subversion"
8196 # A name such as libperl.so.100
8197 majonly=`echo $patchlevel $subversion |
8198 $awk '{printf "%d%02d", $1, $2}'`
8199 majonly=libperl.$so.$majonly
8200 # I'd prefer to keep the os-specific stuff here to a minimum, and
8201 # rely on figuring it out from the naming of libc.
8202 case "${osname}${osvers}" in
8205 # XXX How handle the --version stuff for MAB?
8207 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8210 cygwin*) # ld links now against the dll directly
8211 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8212 majonly=`echo $patchlevel $subversion |
8213 $awk '{printf "%03d%03d", $1, $2}'`
8214 majonly=cygperl5.$majonly.$so
8217 *) # Try to guess based on whether libc has major.minor.
8219 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8220 *libc.$so.[0-9]*) dflt=$majonly ;;
8221 *) dflt=libperl.$so ;;
8231 I need to select a good name for the shared libperl. If your system uses
8232 library names with major and minor numbers, then you might want something
8233 like $majmin. Alternatively, if your system uses a single version
8234 number for shared libraries, then you might want to use $majonly.
8235 Or, your system might be quite happy with a simple libperl.$so.
8237 Since the shared libperl will get installed into a version-specific
8238 architecture-dependent directory, the version number of the shared perl
8239 library probably isn't important, so the default should be o.k.
8242 rp='What name do you want to give to the shared libperl?'
8245 echo "Ok, I'll use $libperl"
8248 libperl="libperl${_a}"
8252 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8256 WARNING: Use of the shrpdir variable for the installation location of
8257 the shared $libperl is not supported. It was never documented and
8258 will not work in this version. Let me (perlbug@perl.org)
8259 know of any problems this may cause.
8265 But your current setting of $shrpdir is
8266 the default anyway, so it's harmless.
8271 Further, your current attempted setting of $shrpdir
8272 conflicts with the value of $archlibexp/CORE
8273 that installperl will use.
8280 # How will the perl executable find the installed shared $libperl?
8281 # Add $xxx to ccdlflags.
8282 # If we can't figure out a command-line option, use $shrpenv to
8283 # set env LD_RUN_PATH. The main perl makefile uses this.
8284 shrpdir=$archlibexp/CORE
8287 if "$useshrplib"; then
8290 # We'll set it in Makefile.SH...
8295 freebsd|netbsd|openbsd|interix|dragonfly)
8296 xxx="-Wl,-R$shrpdir"
8298 bsdos|linux|irix*|dec_osf|gnu*)
8299 xxx="-Wl,-rpath,$shrpdir"
8302 # next doesn't like the default...
8305 # beos doesn't like the default, either.
8308 # Haiku doesn't like the default, either.
8311 # hpux doesn't like the default, either.
8312 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8315 # cygwin needs only ldlibpth
8318 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8324 # Only add $xxx if it isn't already in ccdlflags.
8325 case " $ccdlflags " in
8327 *) ccdlflags="$ccdlflags $xxx"
8330 Adding $xxx to the flags
8331 passed to $ld so that the perl executable will find the
8332 installed shared $libperl.
8340 # Fix ccdlflags in AIX for building external extensions.
8341 # (For building Perl itself bare -bE:perl.exp is needed,
8342 # Makefile.SH takes care of this.)
8344 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8346 # Respect a hint or command-line value.
8348 '') shrpenv="$tmp_shrpenv" ;;
8350 case "$ldlibpthname" in
8351 '') ldlibpthname=LD_LIBRARY_PATH ;;
8352 none) ldlibpthname='' ;;
8355 : determine where manual pages are on this system
8359 syspath='/usr/share/man/man1 /usr/man/man1'
8360 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8361 syspath="$syspath /usr/man/u_man/man1"
8362 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8363 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8364 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8365 sysman=`./loc . /usr/man/man1 $syspath`
8368 if $test -d "$sysman"; then
8369 echo "System manual is in $sysman." >&4
8371 echo "Could not find manual pages in source form." >&4
8374 : determine where manual pages go
8375 set man1dir man1dir none
8379 $spackage has manual pages available in source form.
8383 echo "However, you don't have nroff, so they're probably useless to you."
8385 '') man1dir="none";;
8388 echo "If you don't want the manual sources installed, answer 'none'."
8393 lookpath="$prefixexp/share/man/man1"
8394 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8395 lookpath="$lookpath $prefixexp/man/p_man/man1"
8396 lookpath="$lookpath $prefixexp/man/u_man/man1"
8397 lookpath="$lookpath $prefixexp/man/man.1"
8399 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8400 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8410 rp="Where do the main $spackage manual pages (source) go?"
8412 if $test "X$man1direxp" != "X$ansexp"; then
8423 : What suffix to use on installed man pages
8430 rp="What suffix should be used for the main $spackage man pages?"
8432 '') case "$man1dir" in
8446 *) dflt="$man1ext";;
8453 : see if we can have long filenames
8455 first=123456789abcdef
8457 if (echo hi >$first) 2>/dev/null; then
8458 if $test -f 123456789abcde; then
8459 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8462 echo 'You can have filenames longer than 14 characters.'>&4
8467 You can't have filenames longer than 14 chars.
8468 You can't even think about them!
8474 $rm -rf 123456789abcde*
8476 : determine where library module manual pages go
8477 set man3dir man3dir none
8481 $spackage has manual pages for many of the library modules.
8487 However, you don't have nroff, so they're probably useless to you.
8490 '') man3dir="none";;
8494 case "$d_flexfnam" in
8497 However, your system can't handle the long file names like File::Basename.3.
8500 '') man3dir="none";;
8504 echo "If you don't want the manual sources installed, answer 'none'."
8505 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8507 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8508 if $test -d "$privlib/man/man3"; then
8511 WARNING: Previous versions of perl installed man3 pages into
8512 $privlib/man/man3. This version will suggest a
8513 new default of $dflt.
8517 rp='Do you wish to preserve the old behavior?(y/n)'
8520 y*) dflt="$privlib/man/man3" ;;
8525 *) dflt="$man3dir" ;;
8532 rp="Where do the $package library man pages (source) go?"
8542 : What suffix to use on installed man pages
8548 rp="What suffix should be used for the $package library man pages?"
8550 '') case "$man3dir" in
8564 *) dflt="$man3ext";;
8571 : see if we have to deal with yellow pages, now NIS.
8572 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8573 if $test -f /usr/etc/nibindd; then
8575 echo "I'm fairly confident you're on a NeXT."
8577 rp='Do you get the hosts file via NetInfo?'
8586 y*) hostcat='nidump hosts .';;
8587 *) case "$hostcat" in
8588 nidump*) hostcat='';;
8598 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8606 rp='Are you getting the hosts file via yellow pages?'
8609 y*) hostcat='ypcat hosts';;
8610 *) hostcat='cat /etc/hosts';;
8616 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8619 '') test -f /etc/group && groupcat='cat /etc/group';;
8622 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8625 : now get the host name
8627 echo "Figuring out host name..." >&4
8628 case "$myhostname" in
8630 echo 'Maybe "hostname" will work...'
8631 if tans=`sh -c hostname 2>&1` ; then
8639 if $test "$cont"; then
8641 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8642 if tans=`cat /etc/systemid 2>&1` ; then
8644 phostname='cat /etc/systemid'
8645 echo "Whadyaknow. Xenix always was a bit strange..."
8648 elif $test -r /etc/systemid; then
8649 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8652 if $test "$cont"; then
8653 echo 'No, maybe "uuname -l" will work...'
8654 if tans=`sh -c 'uuname -l' 2>&1` ; then
8656 phostname='uuname -l'
8658 echo 'Strange. Maybe "uname -n" will work...'
8659 if tans=`sh -c 'uname -n' 2>&1` ; then
8661 phostname='uname -n'
8663 echo 'Oh well, maybe I can mine it out of whoami.h...'
8664 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8665 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8666 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8668 case "$myhostname" in
8669 '') echo "Does this machine have an identity crisis or something?"
8672 echo "Well, you said $myhostname before..."
8673 phostname='echo $myhostname';;
8679 case "$myhostname" in
8680 '') myhostname=noname ;;
8682 : you do not want to know about this
8687 if $test "$myhostname" ; then
8689 rp='Your host name appears to be "'$myhostname'".'" Right?"
8697 : bad guess or no guess
8698 while $test "X$myhostname" = X ; do
8700 rp="Please type the (one word) name of your host:"
8705 : translate upper to lower if necessary
8706 case "$myhostname" in
8708 echo "(Normalizing case in your host name)"
8709 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8713 case "$myhostname" in
8715 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8716 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8717 echo "(Trimming domain name from host name--host name is now $myhostname)"
8719 *) case "$mydomain" in
8722 test "X$hostcat" = "Xypcat hosts" &&
8723 ypmatch "$myhostname" hosts 2>/dev/null |\
8724 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8727 test "X$hostcat" != "X" &&
8728 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8729 /[ ]$myhostname[ . ]/p" > hosts
8732 if $test -f hosts; then
8733 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8734 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8735 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8736 hosts | $sort | $uniq | \
8737 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8738 case `$echo X$dflt` in
8739 X*\ *) echo "(Several hosts in the database matched hostname)"
8742 X.) echo "(You do not have fully-qualified names in the hosts database)"
8746 echo "(I cannot locate a hosts database anywhere)"
8751 tans=`./loc resolv.conf X /etc /usr/etc`
8752 if $test -f "$tans"; then
8753 echo "(Attempting domain name extraction from $tans)"
8754 dflt=.`$sed -n -e 's/ / /g' \
8755 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8758 .) dflt=.`$sed -n -e 's/ / /g' \
8759 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8767 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8768 dflt=.`sh -c domainname 2>/dev/null`
8771 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8775 case "$dflt$osname" in
8776 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8777 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8781 .) echo "(Lost all hope -- silly guess then)"
8787 *) dflt="$mydomain";;
8791 rp="What is your domain name?"
8801 : translate upper to lower if necessary
8804 echo "(Normalizing case in your domain name)"
8805 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8809 : a little sanity check here
8810 case "$phostname" in
8813 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8814 $myhostname$mydomain|$myhostname) ;;
8816 case "$phostname" in
8818 echo "(That doesn't agree with your whoami.h file, by the way.)"
8821 echo "(That doesn't agree with your $phostname command, by the way.)"
8829 : determine the e-mail address of the user who is running us
8832 I need to get your e-mail address in Internet format if possible, i.e.
8833 something like user@host.domain. Please answer accurately since I have
8834 no easy means to double check it. The default value provided below
8835 is most probably close to reality but may not be valid from outside
8836 your organization...
8840 while test "$cont"; do
8842 '') dflt="$cf_by@$myhostname$mydomain";;
8843 *) dflt="$cf_email";;
8845 rp='What is your e-mail address?'
8851 rp='Address does not look like an Internet one. Use it anyway?'
8865 : Ask e-mail of administrator
8868 If you or somebody else will be maintaining perl at your site, please
8869 fill in the correct e-mail address here so that they may be contacted
8870 if necessary. Currently, the "perlbug" program included with perl
8871 will send mail to this address in addition to perlbug@perl.org. You may
8872 enter "none" for no administrator.
8875 case "$perladmin" in
8876 '') dflt="$cf_email";;
8877 *) dflt="$perladmin";;
8879 rp='Perl administrator e-mail address'
8883 : determine whether to only install version-specific parts.
8886 Do you want to install only the version-specific parts of the perl
8887 distribution? Usually you do *not* want to do this.
8889 case "$versiononly" in
8890 "$define"|[Yy]*|true) dflt='y' ;;
8893 rp="Do you want to install only the version-specific parts of perl?"
8896 [yY]*) val="$define";;
8902 case "$versiononly" in
8903 "$define") inc_version_list=''
8904 inc_version_list_init=0
8908 : figure out how to guarantee perl startup
8909 : XXX Note that this currently takes advantage of the bug that binexp ignores
8910 : the Configure -Dinstallprefix setting, which in turn means that under
8911 : relocatable @INC, initialinstalllocation is what binexp started as.
8912 case "$startperl" in
8914 case "$sharpbang" in
8918 I can use the #! construct to start perl on your system. This will
8919 make startup of perl scripts faster, but may cause problems if you
8920 want to share those scripts and perl is not in a standard place
8921 ($initialinstalllocation/perl) on all your platforms. The alternative
8922 is to force a shell by starting the script with a single ':' character.
8925 case "$versiononly" in
8926 "$define") dflt="$initialinstalllocation/perl$version";;
8927 *) dflt="$initialinstalllocation/perl";;
8929 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8932 none) startperl=": # use perl";;
8933 *) startperl="#!$ans"
8934 if $test 30 -lt `echo "$ans" | wc -c`; then
8937 WARNING: Some systems limit the #! command to 32 characters.
8938 If you experience difficulty running Perl scripts with #!, try
8939 installing Perl in a directory with a shorter pathname.
8945 *) startperl=": # use perl"
8950 echo "I'll use $startperl to start perl scripts."
8952 : figure best path for perl in scripts
8955 case "$versiononly" in
8956 "$define") perlpath="$initialinstalllocation/perl$version";;
8957 *) perlpath="$initialinstalllocation/perl";;
8959 case "$startperl" in
8964 I will use the "eval 'exec'" idiom to start Perl on your system.
8965 I can use the full path of your Perl binary for this purpose, but
8966 doing so may cause problems if you want to share those scripts and
8967 Perl is not always in a standard place ($initialinstalllocation/perl).
8970 dflt="$initialinstalllocation/perl"
8971 rp="What path shall I use in \"eval 'exec'\"?"
8978 case "$startperl" in
8980 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8983 : determine where public executable scripts go
8984 set scriptdir scriptdir
8986 case "$scriptdir" in
8989 : guess some guesses
8990 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8991 $test -d /usr/share/bin && dflt=/usr/share/bin
8992 $test -d /usr/local/script && dflt=/usr/local/script
8993 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8994 $test -d $prefixexp/script && dflt=$prefixexp/script
8998 *) dflt="$scriptdir"
9003 Some installations have a separate directory just for executable scripts so
9004 that they can mount it across multiple architectures but keep the scripts in
9005 one spot. You might, for example, have a subdirectory of /usr/share for this.
9006 Or you might just lump your scripts in with all your other executables.
9010 rp='Where do you keep publicly executable scripts?'
9012 if $test "X$ansexp" != "X$scriptdirexp"; then
9018 : A little fix up for an irregularly named variable.
9019 installscript="$installscriptdir"
9021 : determine where add-on public executables go
9023 '') dflt=$siteprefix/bin ;;
9027 rp='Pathname where the add-on public executables should be installed?'
9032 : determine where add-on html pages go
9033 : There is no standard location, so try to copy the previously-selected
9034 : directory structure for the core html pages.
9035 case "$sitehtml1dir" in
9036 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9037 *) dflt=$sitehtml1dir ;;
9040 ''|' ') dflt=none ;;
9043 rp='Pathname where the site-specific html pages should be installed?'
9045 prefixvar=sitehtml1dir
9048 : determine where add-on library html pages go
9049 : There is no standard location, so try to copy the previously-selected
9050 : directory structure for the core html pages.
9051 case "$sitehtml3dir" in
9052 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9053 *) dflt=$sitehtml3dir ;;
9056 ''|' ') dflt=none ;;
9059 rp='Pathname where the site-specific library html pages should be installed?'
9061 prefixvar=sitehtml3dir
9064 : determine where add-on manual pages go
9065 case "$siteman1dir" in
9066 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9067 *) dflt=$siteman1dir ;;
9070 ''|' ') dflt=none ;;
9073 rp='Pathname where the site-specific manual pages should be installed?'
9075 prefixvar=siteman1dir
9078 : determine where add-on library man pages go
9079 case "$siteman3dir" in
9080 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9081 *) dflt=$siteman3dir ;;
9084 ''|' ') dflt=none ;;
9087 rp='Pathname where the site-specific library manual pages should be installed?'
9089 prefixvar=siteman3dir
9092 : determine where add-on public executable scripts go
9093 case "$sitescript" in
9094 '') dflt=$siteprefix/script
9095 $test -d $dflt || dflt=$sitebin ;;
9096 *) dflt="$sitescript" ;;
9099 rp='Pathname where add-on public executable scripts should be installed?'
9101 prefixvar=sitescript
9104 : Check if faststdio is requested and available
9105 case "$usefaststdio" in
9106 $define|true|[yY]*|'')
9107 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9117 Perl can be built to use 'fast stdio', which means using the stdio
9118 library but also directly manipulating the stdio buffers to enable
9119 faster I/O. Using stdio is better for backward compatibility (especially
9120 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9121 interface has been preferred instead of stdio.
9123 If this doesn't make any sense to you, just accept the default '$dflt'.
9125 rp='Use the "fast stdio" if available?'
9128 y|Y) val="$define" ;;
9135 : define an is-a-typedef? function
9136 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9138 "") inclist="sys/types.h";;
9140 eval "varval=\$$var";
9144 for inc in $inclist; do
9145 echo "#include <$inc>" >>temp.c;
9147 echo "#ifdef $type" >> temp.c;
9148 echo "printf(\"We have $type\");" >> temp.c;
9149 echo "#endif" >> temp.c;
9150 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9151 if $contains $type temp.E >/dev/null 2>&1; then
9157 *) eval "$var=\$varval";;
9160 : define an is-a-typedef? function that prompts if the type is not available.
9161 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9163 "") inclist="sys/types.h";;
9165 eval "varval=\$$var";
9169 for inc in $inclist; do
9170 echo "#include <$inc>" >>temp.c;
9172 echo "#ifdef $type" >> temp.c;
9173 echo "printf(\"We have $type\");" >> temp.c;
9174 echo "#endif" >> temp.c;
9175 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9177 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9178 if $contains $type temp.E >/dev/null 2>&1; then
9179 echo "$type found." >&4;
9182 echo "$type NOT found." >&4;
9188 *) eval "$var=\$varval";;
9191 : see what type lseek is declared as in the kernel
9192 rp="What is the type used for lseek's offset on this system?"
9193 set off_t lseektype long stdio.h sys/types.h
9197 echo "Checking to see how big your file offsets are..." >&4
9199 #include <sys/types.h>
9203 printf("%d\n", (int)sizeof($lseektype));
9208 if eval $compile_ok; then
9209 lseeksize=`$run ./try`
9210 echo "Your file offsets are $lseeksize bytes long."
9214 echo "(I can't seem to compile the test program. Guessing...)"
9215 rp="What is the size of your file offsets (in bytes)?"
9221 : see what type file positions are declared as in the library
9222 rp="What is the type for file position used by fsetpos()?"
9223 set fpos_t fpostype long stdio.h sys/types.h
9226 : Check size for Fpos_t
9229 *_t) zzz="$fpostype" ;;
9232 echo "Checking the size of $zzz..." >&4
9234 #include <sys/types.h>
9241 printf("%d\n", (int)sizeof($fpostype));
9246 if eval $compile_ok; then
9250 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9253 echo "Your $zzz is $fpossize bytes long."
9259 echo "(I can't compile the test program. Guessing...)" >&4
9260 rp="What is the size of your file positions (in bytes)?"
9265 : Check for large file support
9266 # Backward compatibility (uselfs is deprecated).
9268 "$define"|true|[yY]*)
9271 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9273 uselargefiles="$define"
9277 case "$lseeksize:$fpossize" in
9280 You can have files larger than 2 gigabytes.
9283 *) case "$uselargefiles" in
9284 "$undef"|false|[nN]*) dflt='n' ;;
9289 Perl can be built to understand large files (files larger than 2 gigabytes)
9290 on some systems. To do so, Configure can be run with -Duselargefiles.
9292 If this doesn't make any sense to you, just accept the default '$dflt'.
9294 rp='Try to understand large files, if available?'
9297 y|Y) val="$define" ;;
9304 : Look for a hint-file generated 'call-back-unit'. If the
9305 : user has specified that a large files perl is to be built,
9306 : we may need to set or change some other defaults.
9307 if $test -f uselargefiles.cbu; then
9308 echo "Your platform has some specific hints regarding large file builds, using them..."
9309 . ./uselargefiles.cbu
9311 case "$uselargefiles" in
9313 if $test -f uselargefiles.cbu; then
9315 echo "Rechecking to see how big your file offsets are..." >&4
9317 #include <sys/types.h>
9321 printf("%d\n", (int)sizeof($lseektype));
9326 if eval $compile_ok; then
9327 lseeksize=`$run ./try`
9328 $echo "Your file offsets are now $lseeksize bytes long."
9332 echo "(I can't seem to compile the test program. Guessing...)"
9333 rp="What is the size of your file offsets (in bytes)?"
9338 *_t) zzz="$fpostype" ;;
9341 $echo $n "Rechecking the size of $zzz...$c" >&4
9343 #include <sys/types.h>
9350 printf("%d\n", (int)sizeof($fpostype));
9355 if eval $compile_ok; then
9360 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9363 echo " $fpossize bytes." >&4
9369 echo "(I can't compile the test program. Guessing...)" >&4
9370 rp="What is the size of your file positions (in bytes)?"
9379 : Set the vendorbin variables
9380 case "$vendorprefix" in
9381 '') d_vendorbin="$undef"
9385 *) d_vendorbin="$define"
9386 : determine where vendor-supplied executables go.
9387 case "$vendorbin" in
9388 '') dflt=$vendorprefix/bin ;;
9389 *) dflt="$vendorbin" ;;
9392 rp='Pathname for the vendor-supplied executables directory?'
9395 vendorbinexp="$ansexp"
9401 : Set the vendorhtml1dir variables
9402 case "$vendorprefix" in
9403 '') vendorhtml1dir=''
9404 vendorhtml1direxp=''
9406 *) : determine where vendor-supplied html pages go.
9407 : There is no standard location, so try to copy the previously-selected
9408 : directory structure for the core html pages.
9409 : XXX Better default suggestions would be welcome.
9410 case "$vendorhtml1dir" in
9411 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9412 *) dflt=$vendorhtml1dir ;;
9415 ''|' ') dflt=none ;;
9418 rp='Pathname for the vendor-supplied html pages?'
9420 vendorhtml1dir="$ans"
9421 vendorhtml1direxp="$ansexp"
9424 : Use ' ' for none so value is preserved next time through Configure
9425 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9426 prefixvar=vendorhtml1dir
9429 : Set the vendorhtml3dir variables
9430 case "$vendorprefix" in
9431 '') vendorhtml3dir=''
9432 vendorhtml3direxp=''
9434 *) : determine where vendor-supplied module html pages go.
9435 : There is no standard location, so try to copy the previously-selected
9436 : directory structure for the core html pages.
9437 : XXX Better default suggestions would be welcome.
9438 case "$vendorhtml3dir" in
9439 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9440 *) dflt=$vendorhtml3dir ;;
9443 ''|' ') dflt=none ;;
9446 rp='Pathname for the vendor-supplied html pages?'
9448 vendorhtml3dir="$ans"
9449 vendorhtml3direxp="$ansexp"
9452 : Use ' ' for none so value is preserved next time through Configure
9453 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9454 prefixvar=vendorhtml3dir
9457 : Set the vendorman1dir variables
9458 case "$vendorprefix" in
9459 '') vendorman1dir=''
9462 *) : determine where vendor-supplied manual pages go.
9463 case "$vendorman1dir" in
9464 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9465 *) dflt=$vendorman1dir ;;
9468 ''|' ') dflt=none ;;
9471 rp='Pathname for the vendor-supplied manual section 1 pages?'
9473 vendorman1dir="$ans"
9474 vendorman1direxp="$ansexp"
9477 : Use ' ' for none so value is preserved next time through Configure
9478 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9479 prefixvar=vendorman1dir
9482 : Set the vendorman3dir variables
9483 case "$vendorprefix" in
9484 '') vendorman3dir=''
9487 *) : determine where vendor-supplied module manual pages go.
9488 case "$vendorman3dir" in
9489 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9490 *) dflt=$vendorman3dir ;;
9493 ''|' ') dflt=none ;;
9496 rp='Pathname for the vendor-supplied manual section 3 pages?'
9498 vendorman3dir="$ans"
9499 vendorman3direxp="$ansexp"
9502 : Use ' ' for none so value is preserved next time through Configure
9503 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9504 prefixvar=vendorman3dir
9507 : Set the vendorscript variables
9508 case "$vendorprefix" in
9509 '') d_vendorscript="$undef"
9513 *) d_vendorscript="$define"
9514 : determine where vendor-supplied scripts go.
9515 case "$vendorscript" in
9516 '') dflt=$vendorprefix/script
9517 $test -d $dflt || dflt=$vendorbin ;;
9518 *) dflt="$vendorscript" ;;
9522 The installation process will create a directory for
9523 vendor-supplied scripts.
9527 rp='Pathname for the vendor-supplied scripts directory?'
9530 vendorscriptexp="$ansexp"
9533 prefixvar=vendorscript
9536 : script used to emit important warnings
9539 if test \$# -gt 0; then
9544 echo "*** WARNING:" >&4
9545 sed -e 's/^/*** /' <msg >&4
9547 cat msg >>config.msg
9548 echo " " >>config.msg
9554 : see which of string.h or strings.h is needed
9556 strings=`./findhdr string.h`
9557 if $test "$strings" && $test -r "$strings"; then
9558 echo "Using <string.h> instead of <strings.h>." >&4
9562 strings=`./findhdr strings.h`
9563 if $test "$strings" && $test -r "$strings"; then
9564 echo "Using <strings.h> instead of <string.h>." >&4
9566 ./warn "No string header found -- You'll surely have problems."
9572 "$undef") strings=`./findhdr strings.h`;;
9573 *) strings=`./findhdr string.h`;;
9576 : see if qgcvt exists
9580 : Check print/scan long double stuff
9583 if $test X"$d_longdbl" = X"$define"; then
9585 echo "Checking how to print long doubles..." >&4
9587 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9588 $cat >try.c <<'EOCP'
9589 #include <sys/types.h>
9593 printf("%.3f\n", d);
9597 if eval $compile; then
9601 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9602 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9603 echo "We will use %f."
9609 if $test X"$sPRIfldbl" = X; then
9610 $cat >try.c <<'EOCP'
9611 #include <sys/types.h>
9614 long double d = 123.456;
9615 printf("%.3Lf\n", d);
9619 if eval $compile; then
9623 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9624 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9625 echo "We will use %Lf."
9631 if $test X"$sPRIfldbl" = X; then
9632 $cat >try.c <<'EOCP'
9633 #include <sys/types.h>
9636 long double d = 123.456;
9637 printf("%.3llf\n", d);
9641 if eval $compile; then
9645 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9646 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9647 echo "We will use %llf."
9653 if $test X"$sPRIfldbl" = X; then
9654 $cat >try.c <<'EOCP'
9655 #include <sys/types.h>
9658 long double d = 123.456;
9659 printf("%.3lf\n", d);
9663 if eval $compile; then
9667 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9668 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9669 echo "We will use %lf."
9675 if $test X"$sPRIfldbl" = X; then
9676 echo "Cannot figure out how to print long doubles." >&4
9678 sSCNfldbl=$sPRIfldbl # expect consistency
9685 case "$sPRIfldbl" in
9686 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9687 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9688 d_SCNfldbl="$undef";
9690 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9691 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9692 d_SCNfldbl="$define";
9696 : Check how to convert floats to strings.
9698 if test "X$d_Gconvert" = X; then
9701 echo "Checking for an efficient way to convert floats to strings."
9703 case "$uselongdouble" in
9704 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9706 case "$d_longdbl" in
9707 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9709 case "$d_PRIgldbl" in
9710 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9714 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9715 char *myname = "gconvert";
9718 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9719 char *myname = "gcvt";
9722 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9723 char *myname = "qgcvt";
9724 #define DOUBLETYPE long double
9727 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9729 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9731 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9734 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9736 char *myname = "sprintf";
9740 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9741 #define DOUBLETYPE long double
9743 #define DOUBLETYPE double
9755 # include <string.h>
9757 # include <strings.h>
9760 int checkit(char *expect, char *got)
9762 if (strcmp(expect, got)) {
9763 printf("%s oddity: Expected %s, got %s\n",
9764 myname, expect, got);
9774 /* This must be 1st test on (which?) platform */
9775 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9776 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9777 checkit("0.1", buf);
9779 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9780 checkit("0.01", buf);
9782 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9783 checkit("0.001", buf);
9785 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9786 checkit("0.0001", buf);
9788 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9789 if (strlen(buf) > 5)
9790 checkit("9e-005", buf); /* for Microsoft ?? */
9792 checkit("9e-05", buf);
9794 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9797 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9798 checkit("1.1", buf);
9800 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9801 checkit("1.01", buf);
9803 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9804 checkit("1.001", buf);
9806 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9807 checkit("1.0001", buf);
9809 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9810 checkit("1.00001", buf);
9812 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9813 checkit("1.000001", buf);
9815 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9818 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9821 /* Some Linux gcvt's give 1.e+5 here. */
9822 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9823 checkit("100000", buf);
9825 /* Some Linux gcvt's give -1.e+5 here. */
9826 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9827 checkit("-100000", buf);
9829 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9830 checkit("123.456", buf);
9832 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9833 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9834 /* 34 should be enough to scare even long double
9835 * places into using the e notation. */
9836 if (strlen(buf) > 5)
9837 checkit("1e+034", buf); /* for Microsoft */
9839 checkit("1e+34", buf);
9841 /* For Perl, if you add additional tests here, also add them to
9842 * t/base/num.t for benefit of platforms not using Configure or
9843 * overriding d_Gconvert */
9848 : first add preferred functions to our list
9850 for xxx_convert in $gconvert_preference; do
9851 case $xxx_convert in
9852 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9853 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9856 : then add any others
9857 for xxx_convert in gconvert gcvt sprintf; do
9860 *) xxx_list="$xxx_list $xxx_convert" ;;
9864 case "$d_longdbl$uselongdouble" in
9866 : again, add prefered functions to our list first
9868 for xxx_convert in $gconvert_ld_preference; do
9869 case $xxx_convert in
9870 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9871 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9874 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9875 for xxx_convert in qgcvt sprintf $xxx_list; do
9876 case "$xxx_ld_list" in
9877 $xxx_convert*|*" $xxx_convert"*) ;;
9878 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9881 : if sprintf cannot do long doubles, move it to the end
9882 if test "$d_PRIgldbl" != "$define"; then
9883 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9885 : if no qgcvt, remove it
9886 if test "$d_qgcvt" != "$define"; then
9887 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9890 xxx_list="$xxx_ld_list"
9894 for xxx_convert in $xxx_list; do
9895 echo "Trying $xxx_convert..."
9896 $rm -f try try$_o core
9897 set try -DTRY_$xxx_convert
9898 if eval $compile; then
9899 echo "$xxx_convert() found." >&4
9901 echo "I'll use $xxx_convert to convert floats into a string." >&4
9904 echo "...But $xxx_convert didn't work as I expected."
9908 echo "$xxx_convert NOT found." >&4
9912 if test X$xxx_convert = X; then
9913 echo "*** WHOA THERE!!! ***" >&4
9914 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9918 case "$xxx_convert" in
9919 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9920 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9921 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9922 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9923 "$define$define$define")
9924 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9925 "$define$define$undef")
9926 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9927 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9935 : see if _fwalk exists
9939 : Initialize h_fcntl
9942 : Initialize h_sysfile
9945 : access call always available on UNIX
9949 : locate the flags for 'access()'
9953 $cat >access.c <<EOCP
9954 #include <sys/types.h>
9959 #include <sys/file.h>
9972 : check sys/file.h first, no particular reason here
9973 if $test `./findhdr sys/file.h` && \
9974 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9976 echo "<sys/file.h> defines the *_OK access constants." >&4
9977 elif $test `./findhdr fcntl.h` && \
9978 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9980 echo "<fcntl.h> defines the *_OK access constants." >&4
9981 elif $test `./findhdr unistd.h` && \
9982 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9983 echo "<unistd.h> defines the *_OK access constants." >&4
9985 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9991 : see if accessx exists
9992 set accessx d_accessx
9995 : see if aintl exists
9999 : see if alarm exists
10003 : see if 64bit time functions exists
10005 set ctime64 d_ctime64
10008 set localtime64 d_localtime64
10011 set gmtime64 d_gmtime64
10014 set mktime64 d_mktime64
10017 set difftime64 d_difftime64
10020 set asctime64 d_asctime64
10023 : see if POSIX threads are available
10024 set pthread.h i_pthread
10027 : define a fucntion to check prototypes
10028 $cat > protochk <<EOSH
10031 optimize="$optimize"
10033 prototype="$prototype"
10036 usethreads=$usethreads
10037 i_pthread=$i_pthread
10038 pthread_h_first=$pthread_h_first
10041 $cat >> protochk <<'EOSH'
10046 while test $# -ge 2; do
10048 $define) echo "#include <$2>" >> try.c ;;
10049 literal) echo "$2" >> try.c ;;
10051 # Extra magic for the benefit of systems that need pthread.h
10052 # to be included early to correctly detect threadsafe functions.
10053 # Such functions must guarantee themselves, though, that the usethreads
10054 # and i_pthread have been defined, before calling protochk.
10055 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10056 echo "#include <pthread.h>" >> try.c
10061 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10062 cat >> try.c <<'EOCP'
10063 #ifdef CAN_PROTOTYPE
10064 #define _(args) args
10069 echo "$foo" >> try.c
10070 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10071 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10077 $eunicefix protochk
10079 : Define hasproto macro for Configure internal use
10080 hasproto='varname=$1; func=$2; shift; shift;
10081 while $test $# -ge 2; do
10083 $define) echo "#include <$2>";;
10087 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10088 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10089 echo "$func() prototype found.";
10092 echo "$func() prototype NOT found.";
10099 : see if sys/types.h has to be included
10100 set sys/types.h i_systypes
10103 : see if sys/select.h has to be included
10104 set sys/select.h i_sysselct
10107 : Define hasfield macro for Configure internal use
10108 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10109 while $test $# -ge 2; do
10111 $define) echo "#include <$2>";;
10115 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10117 if eval $compile; then
10126 : see if we should include time.h, sys/time.h, or both
10128 if test "X$timeincl" = X; then
10129 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10130 $echo $n "I'm now running the test program...$c"
10132 #include <sys/types.h>
10137 #ifdef SYSTIMEKERNEL
10140 #include <sys/time.h>
10143 #include <sys/select.h>
10145 #$i_stdlib I_STDLIB
10147 #include <stdlib.h>
10153 struct timeval bar;
10156 struct timezone tzp;
10158 if (foo.tm_sec == foo.tm_sec)
10161 if (bar.tv_sec == bar.tv_sec)
10168 for s_timezone in '-DS_TIMEZONE' ''; do
10170 for s_timeval in '-DS_TIMEVAL' ''; do
10171 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10172 for i_time in '' '-DI_TIME'; do
10173 for i_systime in '-DI_SYSTIME' ''; do
10176 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10177 if eval $compile; then
10178 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10182 $echo $n "Succeeded with $flags$c"
10194 *SYSTIMEKERNEL*) i_systimek="$define"
10195 timeincl=`./findhdr sys/time.h`
10196 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10197 *) i_systimek="$undef";;
10200 *I_TIME*) i_time="$define"
10201 timeincl=`./findhdr time.h`" $timeincl"
10202 echo "We'll include <time.h>." >&4;;
10203 *) i_time="$undef";;
10206 *I_SYSTIME*) i_systime="$define"
10207 timeincl=`./findhdr sys/time.h`" $timeincl"
10208 echo "We'll include <sys/time.h>." >&4;;
10209 *) i_systime="$undef";;
10213 : see if struct tm knows about tm_zone
10214 case "$i_systime$i_time" in
10217 echo "Checking to see if your struct tm has tm_zone field..." >&4
10218 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10226 case "$d_tm_tm_zone" in
10227 "$define") echo "Yes, it does." ;;
10228 *) echo "No, it doesn't." ;;
10230 : see if struct tm knows about tm_gmtoff
10231 case "$i_systime$i_time" in
10234 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10235 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10243 case "$d_tm_tm_gmtoff" in
10244 "$define") echo "Yes, it does." ;;
10245 *) echo "No, it doesn't." ;;
10248 : see if asctime_r exists
10249 set asctime_r d_asctime_r
10251 case "$d_asctime_r" in
10253 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10254 case "$d_asctime_r_proto:$usethreads" in
10255 ":define") d_asctime_r_proto=define
10256 set d_asctime_r_proto asctime_r $hdrs
10260 case "$d_asctime_r_proto" in
10262 case "$asctime_r_proto" in
10263 ''|0) try='char* asctime_r(const struct tm*, char*);'
10264 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10266 case "$asctime_r_proto" in
10267 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10268 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10270 case "$asctime_r_proto" in
10271 ''|0) try='int asctime_r(const struct tm*, char*);'
10272 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10274 case "$asctime_r_proto" in
10275 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10276 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10278 case "$asctime_r_proto" in
10279 ''|0) d_asctime_r=undef
10281 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10282 * ) case "$asctime_r_proto" in
10283 REENTRANT_PROTO*) ;;
10284 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10286 echo "Prototype: $try" ;;
10289 *) case "$usethreads" in
10290 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10297 *) asctime_r_proto=0
10301 : see if atolf exists
10305 : see if atoll exists
10309 : Look for GCC-style attribute format
10310 case "$d_attribute_format" in
10313 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10314 $cat >attrib.c <<'EOCP'
10316 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10318 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10319 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10320 echo "Your C compiler doesn't support __attribute__((format))."
10323 echo "Your C compiler supports __attribute__((format))."
10327 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10331 *) val="$d_attribute_format" ;;
10333 set d_attribute_format
10337 : Look for GCC-style attribute format with null format allowed
10338 case "$d_printf_format_null" in
10339 '') case "$d_attribute_format" in
10342 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10343 $cat >attrib.c <<EOCP
10345 #$i_stdlib I_STDLIB
10347 #include <stdlib.h>
10349 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10350 int null_printf (char* pat,...) { return (int)pat; }
10351 int main () { exit(null_printf(NULL)); }
10353 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10354 : run the executable in case it produces a run-time warning
10355 if $run ./attrib >>attrib.out 2>&1; then
10356 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10357 echo "Your C compiler doesn't allow __printf__ format to be null."
10360 echo "Your C compiler allows __printf__ format to be null."
10364 echo "Your C compiler executable failed with __printf__ format null."
10368 echo "Your C compiler fails with __printf__ format null."
10375 *) val="$d_printf_format_null" ;;
10377 set d_printf_format_null
10381 : Look for GCC-style attribute malloc
10382 case "$d_attribute_malloc" in
10385 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10386 $cat >attrib.c <<'EOCP'
10388 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10390 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10391 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10392 echo "Your C compiler doesn't support __attribute__((malloc))."
10395 echo "Your C compiler supports __attribute__((malloc))."
10399 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10403 *) val="$d_attribute_malloc" ;;
10405 set d_attribute_malloc
10409 : Look for GCC-style attribute nonnull
10410 case "$d_attribute_nonnull" in
10413 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10414 $cat >attrib.c <<'EOCP'
10416 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10418 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10419 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10420 echo "Your C compiler doesn't support __attribute__((nonnull))."
10423 echo "Your C compiler supports __attribute__((nonnull))."
10427 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10431 *) val="$d_attribute_nonnull" ;;
10433 set d_attribute_nonnull
10437 : Look for GCC-style attribute noreturn
10438 case "$d_attribute_noreturn" in
10441 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10442 $cat >attrib.c <<'EOCP'
10444 void fall_over_dead( void ) __attribute__((noreturn));
10446 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10447 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10448 echo "Your C compiler doesn't support __attribute__((noreturn))."
10451 echo "Your C compiler supports __attribute__((noreturn))."
10455 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10459 *) val="$d_attribute_noreturn" ;;
10461 set d_attribute_noreturn
10465 : Look for GCC-style attribute pure
10466 case "$d_attribute_pure" in
10469 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10470 $cat >attrib.c <<'EOCP'
10472 int square( int n ) __attribute__((pure));
10474 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10475 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10476 echo "Your C compiler doesn't support __attribute__((pure))."
10479 echo "Your C compiler supports __attribute__((pure))."
10483 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10487 *) val="$d_attribute_pure" ;;
10489 set d_attribute_pure
10493 : Look for GCC-style attribute unused
10494 case "$d_attribute_unused" in
10497 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10498 $cat >attrib.c <<'EOCP'
10500 int do_something( int dummy __attribute__((unused)), int n );
10502 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10503 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10504 echo "Your C compiler doesn't support __attribute__((unused))."
10507 echo "Your C compiler supports __attribute__((unused))."
10511 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10515 *) val="$d_attribute_unused" ;;
10517 set d_attribute_unused
10521 : Look for GCC-style attribute deprecated
10522 case "$d_attribute_deprecated" in
10525 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10526 $cat >attrib.c <<'EOCP'
10528 int I_am_deprecated(void) __attribute__((deprecated));
10530 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10531 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10532 echo "Your C compiler doesn't support __attribute__((deprecated))."
10535 echo "Your C compiler supports __attribute__((deprecated))."
10539 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10543 *) val="$d_attribute_deprecated" ;;
10545 set d_attribute_deprecated
10549 : Look for GCC-style attribute warn_unused_result
10550 case "$d_attribute_warn_unused_result" in
10553 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10554 $cat >attrib.c <<'EOCP'
10556 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10558 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10559 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10560 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10563 echo "Your C compiler supports __attribute__((warn_unused_result))."
10567 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10571 *) val="$d_attribute_warn_unused_result" ;;
10573 set d_attribute_warn_unused_result
10577 : see if bcmp exists
10581 : see if bcopy exists
10585 : see if getpgrp exists
10586 set getpgrp d_getpgrp
10589 case "$d_getpgrp" in
10592 echo "Checking to see which flavor of getpgrp is in use..."
10594 #$i_unistd I_UNISTD
10595 #include <sys/types.h>
10597 # include <unistd.h>
10599 #$i_stdlib I_STDLIB
10601 #include <stdlib.h>
10605 if (getuid() == 0) {
10606 printf("(I see you are running Configure as super-user...)\n");
10609 #ifdef TRY_BSD_PGRP
10610 if (getpgrp(1) == 0)
10619 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10620 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10622 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10623 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10626 echo "I can't seem to compile and run the test program."
10628 xxx="a USG one, i.e. you use getpgrp()."
10630 # SVR4 systems can appear rather BSD-ish.
10631 case "$i_unistd" in
10633 xxx="a BSD one, i.e. you use getpgrp(pid)."
10637 xxx="probably a USG one, i.e. you use getpgrp()."
10642 echo "Assuming your getpgrp is $xxx" >&4
10651 : see if setpgrp exists
10652 set setpgrp d_setpgrp
10655 case "$d_setpgrp" in
10658 echo "Checking to see which flavor of setpgrp is in use..."
10660 #$i_unistd I_UNISTD
10661 #include <sys/types.h>
10663 # include <unistd.h>
10665 #$i_stdlib I_STDLIB
10667 #include <stdlib.h>
10671 if (getuid() == 0) {
10672 printf("(I see you are running Configure as super-user...)\n");
10675 #ifdef TRY_BSD_PGRP
10676 if (-1 == setpgrp(1, 1))
10679 if (setpgrp() != -1)
10685 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10686 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10688 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10689 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10692 echo "(I can't seem to compile and run the test program.)"
10694 xxx="a USG one, i.e. you use setpgrp()."
10696 # SVR4 systems can appear rather BSD-ish.
10697 case "$i_unistd" in
10699 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10703 xxx="probably a USG one, i.e. you use setpgrp()."
10708 echo "Assuming your setpgrp is $xxx" >&4
10717 : Look for GCC-style __builtin_choose_expr
10718 case "$d_builtin_choose_expr" in
10721 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10722 $cat >try.c <<'EOCP'
10723 #include <assert.h>
10724 #include <stdlib.h>
10727 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10730 assert( SYRINX(1) == 2112 );
10731 assert( SYRINX(1) != 5150 );
10732 assert( SYRINX(0) == 5150 );
10733 assert( SYRINX(0) != 2112 );
10734 puts( "All good!" );
10740 if eval $compile && $run ./try; then
10741 echo "Your C compiler supports __builtin_choose_expr."
10744 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10748 *) val="$d_builtin_choose_expr" ;;
10751 set d_builtin_choose_expr
10755 : Look for GCC-style __builtin_expect
10756 case "$d_builtin_expect" in
10759 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10760 $cat >try.c <<'EOCP'
10763 if ( __builtin_expect(n, 0) ) n = 1;
10764 /* Remember shell exit code truth is 0, C truth is non-zero */
10769 if eval $compile && $run ./try; then
10770 echo "Your C compiler supports __builtin_expect."
10773 echo "Your C compiler doesn't seem to understand __builtin_expect."
10777 *) val="$d_builtin_expect" ;;
10780 set d_builtin_expect
10784 : see if bzero exists
10788 : see if stdarg is available
10790 if $test `./findhdr stdarg.h`; then
10791 echo "<stdarg.h> found." >&4
10794 echo "<stdarg.h> NOT found." >&4
10798 : see if varags is available
10800 if $test `./findhdr varargs.h`; then
10801 echo "<varargs.h> found." >&4
10803 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10806 : set up the varargs testing programs
10807 $cat > varargs.c <<EOP
10809 #include <stdarg.h>
10812 #include <varargs.h>
10816 int f(char *p, ...)
10830 p = va_arg(ap, char *);
10836 $cat > varargs <<EOP
10838 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10847 : now check which varargs header should be included
10852 if `./varargs I_STDARG`; then
10854 elif `./varargs I_VARARGS`; then
10859 if `./varargs I_VARARGS`; then
10866 echo "I could not find the definition for va_dcl... You have problems..." >&4
10867 val="$undef"; set i_stdarg; eval $setvar
10868 val="$undef"; set i_varargs; eval $setvar
10873 case "$i_varhdr" in
10875 val="$define"; set i_stdarg; eval $setvar
10876 val="$undef"; set i_varargs; eval $setvar
10879 val="$undef"; set i_stdarg; eval $setvar
10880 val="$define"; set i_varargs; eval $setvar
10883 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10887 : see if the Compiler supports C99 variadic macros
10888 case "$i_stdarg$i_stdlib" in
10890 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10893 #include <stdarg.h>
10895 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10899 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10905 if eval $compile && $run ./try 2>&1 >/dev/null; then
10906 case "`$run ./try`" in
10908 echo "You have C99 variadic macros." >&4
10909 d_c99_variadic_macros="$define"
10912 echo "You don't have functional C99 variadic macros." >&4
10913 d_c99_variadic_macros="$undef"
10917 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10918 d_c99_variadic_macros="$undef"
10923 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10924 d_c99_variadic_macros="$undef"
10928 : see if signal is declared as pointer to function returning int or void
10930 xxx=`./findhdr signal.h`
10931 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10932 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10933 echo "You have int (*signal())() instead of void." >&4
10935 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10936 echo "You have void (*signal())()." >&4
10938 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10939 echo "You have int (*signal())() instead of void." >&4
10941 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10942 echo "You have void (*signal())()." >&4
10945 case "$d_voidsig" in
10947 echo "I can't determine whether signal handler returns void or int..." >&4
10949 rp="What type does your signal handler return?"
10952 v*) val="$define";;
10956 echo "As you already told me, signal handler returns void." >&4
10959 *) echo "As you already told me, signal handler returns int." >&4
10966 case "$d_voidsig" in
10967 "$define") signal_t="void";;
10968 *) signal_t="int";;
10972 : check for ability to cast large floats to 32-bit ints.
10974 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10975 if $test "$intsize" -ge 4; then
10982 #$i_stdlib I_STDLIB
10984 #include <stdlib.h>
10986 #include <sys/types.h>
10987 #include <signal.h>
10988 $signal_t blech(int s) { exit(3); }
10995 signal(SIGFPE, blech);
10997 /* Don't let compiler optimize the test away. Store the number
10998 in a writable string for gcc to pass to sscanf under HP/UX.
11000 sprintf(str, "2147483647");
11001 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11005 /* x86 processors will probably give 0x8000 0000, which is a
11006 sign change. We don't want that. We want to mimic SPARC
11007 behavior here, which is to preserve the sign and give
11010 if (i32 != ($xxx) f)
11016 if eval $compile_ok; then
11020 echo "(I can't seem to compile the test program--assuming it can't)"
11025 echo "Yup, it can."
11028 echo "Nope, it can't."
11035 : check for ability to cast negative floats to unsigned
11037 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11040 #$i_stdlib I_STDLIB
11042 #include <stdlib.h>
11044 #include <sys/types.h>
11045 #include <signal.h>
11046 $signal_t blech(int s) { exit(7); }
11047 $signal_t blech_in_list(int s) { exit(4); }
11048 unsigned long dummy_long(unsigned long p) { return p; }
11049 unsigned int dummy_int(unsigned int p) { return p; }
11050 unsigned short dummy_short(unsigned short p) { return p; }
11054 unsigned long along;
11056 unsigned short ashort;
11060 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11061 a direct f = -123. assignment. gcc-2.8.0 reportedly
11062 optimized the whole file away
11064 /* Store the number in a writable string for gcc to pass to
11065 sscanf under HP/UX.
11067 sprintf(str, "-123");
11068 sscanf(str, "%lf", &f); /* f = -123.; */
11070 signal(SIGFPE, blech);
11071 along = (unsigned long)f;
11072 aint = (unsigned int)f;
11073 ashort = (unsigned short)f;
11074 if (along != (unsigned long)-123)
11076 if (aint != (unsigned int)-123)
11078 if (ashort != (unsigned short)-123)
11080 sprintf(str, "1073741824.");
11081 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11084 along = (unsigned long)f;
11085 if (along != 0x80000000)
11089 along = (unsigned long)f;
11090 if (along != 0x7fffffff)
11094 along = (unsigned long)f;
11095 if (along != 0x80000001)
11099 signal(SIGFPE, blech_in_list);
11100 sprintf(str, "123.");
11101 sscanf(str, "%lf", &f); /* f = 123.; */
11102 along = dummy_long((unsigned long)f);
11103 aint = dummy_int((unsigned int)f);
11104 ashort = dummy_short((unsigned short)f);
11105 if (along != (unsigned long)123)
11107 if (aint != (unsigned int)123)
11109 if (ashort != (unsigned short)123)
11116 if eval $compile_ok; then
11120 echo "(I can't seem to compile the test program--assuming it can't)"
11123 case "$castflags" in
11125 echo "Yup, it can."
11128 echo "Nope, it can't."
11135 : see if vprintf exists
11137 if set vprintf val -f d_vprintf; eval $csym; $val; then
11138 echo 'vprintf() found.' >&4
11141 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11142 #$i_varargs I_VARARGS
11144 #$i_stdlib I_STDLIB
11145 #$i_unistd I_UNISTD
11148 # include <stdarg.h>
11149 #else /* I_VARARGS */
11150 # include <varargs.h>
11154 # include <unistd.h>
11158 # include <stdlib.h>
11161 #include <stdio.h> /* vsprintf prototype */
11164 void xxx(int n, ...)
11169 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11171 int main() { xxx(1, "foo"); }
11173 #else /* I_VARARGS */
11181 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11183 int main() { xxx("foo"); }
11189 if eval $compile_ok; then
11190 if $run ./try; then
11191 echo "Your vsprintf() returns (int)." >&4
11194 echo "Your vsprintf() returns (char*)." >&4
11198 echo 'I am unable to compile the vsprintf() test program.' >&4
11199 # We shouldn't get here. If we do, assume the standard signature,
11200 # not the old BSD one.
11201 echo 'Guessing that vsprintf() returns (int).' >&4
11205 echo 'vprintf() NOT found.' >&4
11216 : see if chown exists
11220 : see if chroot exists
11221 set chroot d_chroot
11224 : see if chsize exists
11225 set chsize d_chsize
11228 : see if class exists
11232 : see if clearenv exists
11233 set clearenv d_clearenv
11236 : Define hasstruct macro for Configure internal use
11237 hasstruct='varname=$1; struct=$2; shift; shift;
11238 while $test $# -ge 2; do
11240 $define) echo "#include <$2>";;
11244 echo "int main () { struct $struct foo; }" >> try.c;
11246 if eval $compile; then
11255 : see whether socket exists
11259 $echo $n "Hmm... $c" >&4
11260 if set socket val -f d_socket; eval $csym; $val; then
11261 echo "Looks like you have Berkeley networking support." >&4
11263 if set setsockopt val -f; eval $csym; $val; then
11266 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11267 d_oldsock="$define"
11270 if $contains socklib libc.list >/dev/null 2>&1; then
11271 echo "Looks like you have Berkeley networking support." >&4
11273 : we will have to assume that it supports the 4.2 BSD interface
11276 echo "You don't have Berkeley networking in libc$_a..." >&4
11277 if test "X$d_socket" = "X$define"; then
11278 echo "...but you seem to believe that you have sockets." >&4
11280 for net in net socket
11282 if test -f /usr/lib/lib$net$_a; then
11283 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11284 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11285 if $contains socket libc.list >/dev/null 2>&1; then
11290 echo "...but the Wollongong group seems to have hacked it in." >&4
11291 sockethdr="-I/usr/netinclude"
11294 echo "Found Berkeley sockets interface in lib$net." >&4
11295 if $contains setsockopt libc.list >/dev/null 2>&1; then
11298 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11299 d_oldsock="$define"
11305 if test "X$d_socket" != "X$define"; then
11306 echo "or anywhere else I see." >&4
11314 : see if socketpair exists
11315 set socketpair d_sockpair
11320 echo "Checking the availability of certain socket constants..." >&4
11321 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11322 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11324 #include <sys/types.h>
11325 #include <sys/socket.h>
11331 set try; if eval $compile; then
11334 set d_${enum}; eval $setvar
11338 : see if this is a sys/uio.h system
11339 set sys/uio.h i_sysuio
11342 : Check for cmsghdr support
11344 echo "Checking to see if your system supports struct cmsghdr..." >&4
11345 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11347 case "$d_cmsghdr_s" in
11348 "$define") echo "Yes, it does." ;;
11349 *) echo "No, it doesn't." ;;
11353 : check for const keyword
11355 echo 'Checking to see if your C compiler knows about "const"...' >&4
11356 $cat >const.c <<'EOCP'
11357 typedef struct spug { int drokk; } spug;
11361 const spug y = { 0 };
11364 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11366 echo "Yup, it does."
11369 echo "Nope, it doesn't."
11374 : see if copysignl exists
11375 set copysignl d_copysignl
11378 : see if crypt exists
11383 $define) cryptlib='' ;;
11384 *) if set crypt val -f d_crypt; eval $csym; $val; then
11385 echo 'crypt() found.' >&4
11389 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11390 if $test -z "$cryptlib"; then
11391 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11395 if $test -z "$cryptlib"; then
11396 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11400 if $test -z "$cryptlib"; then
11401 cryptlib=`./loc libcrypt$_a "" $libpth`
11405 if $test -z "$cryptlib"; then
11406 echo 'crypt() NOT found.' >&4
11417 : see if this is a crypt.h system
11418 set crypt.h i_crypt
11421 : see if crypt_r exists
11422 set crypt_r d_crypt_r
11424 case "$d_crypt_r" in
11426 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11427 case "$d_crypt_r_proto:$usethreads" in
11428 ":define") d_crypt_r_proto=define
11429 set d_crypt_r_proto crypt_r $hdrs
11433 case "$d_crypt_r_proto" in
11435 case "$crypt_r_proto" in
11436 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11437 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11439 case "$crypt_r_proto" in
11440 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11441 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11443 case "$crypt_r_proto" in
11444 ''|0) d_crypt_r=undef
11446 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11447 * ) case "$crypt_r_proto" in
11448 REENTRANT_PROTO*) ;;
11449 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11451 echo "Prototype: $try" ;;
11454 *) case "$usethreads" in
11455 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11466 : get csh whereabouts
11468 'csh') val="$undef" ;;
11469 *) val="$define" ;;
11473 : Respect a hint or command line value for full_csh.
11474 case "$full_csh" in
11475 '') full_csh=$csh ;;
11478 : see if ctermid exists
11479 set ctermid d_ctermid
11482 : see if ctermid_r exists
11483 set ctermid_r d_ctermid_r
11485 case "$d_ctermid_r" in
11487 hdrs="$i_systypes sys/types.h define stdio.h "
11488 case "$d_ctermid_r_proto:$usethreads" in
11489 ":define") d_ctermid_r_proto=define
11490 set d_ctermid_r_proto ctermid_r $hdrs
11494 case "$d_ctermid_r_proto" in
11496 case "$ctermid_r_proto" in
11497 ''|0) try='char* ctermid_r(char*);'
11498 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11500 case "$ctermid_r_proto" in
11501 ''|0) d_ctermid_r=undef
11503 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11504 * ) case "$ctermid_r_proto" in
11505 REENTRANT_PROTO*) ;;
11506 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11508 echo "Prototype: $try" ;;
11511 *) case "$usethreads" in
11512 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11519 *) ctermid_r_proto=0
11523 : see if ctime_r exists
11524 set ctime_r d_ctime_r
11526 case "$d_ctime_r" in
11528 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11529 case "$d_ctime_r_proto:$usethreads" in
11530 ":define") d_ctime_r_proto=define
11531 set d_ctime_r_proto ctime_r $hdrs
11535 case "$d_ctime_r_proto" in
11537 case "$ctime_r_proto" in
11538 ''|0) try='char* ctime_r(const time_t*, char*);'
11539 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11541 case "$ctime_r_proto" in
11542 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11543 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11545 case "$ctime_r_proto" in
11546 ''|0) try='int ctime_r(const time_t*, char*);'
11547 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11549 case "$ctime_r_proto" in
11550 ''|0) try='int ctime_r(const time_t*, char*, int);'
11551 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11553 case "$ctime_r_proto" in
11554 ''|0) d_ctime_r=undef
11556 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11557 * ) case "$ctime_r_proto" in
11558 REENTRANT_PROTO*) ;;
11559 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11561 echo "Prototype: $try" ;;
11564 *) case "$usethreads" in
11565 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11576 : see if cuserid exists
11577 set cuserid d_cuserid
11580 : see if this is a limits.h system
11581 set limits.h i_limits
11584 : see if this is a float.h system
11585 set float.h i_float
11588 : See if number of significant digits in a double precision number is known
11590 $cat >dbl_dig.c <<EOM
11591 #$i_limits I_LIMITS
11594 #include <limits.h>
11600 printf("Contains DBL_DIG");
11603 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11604 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11605 echo "DBL_DIG found." >&4
11608 echo "DBL_DIG NOT found." >&4
11615 : see if dbm.h is available
11616 : see if dbmclose exists
11617 set dbmclose d_dbmclose
11620 case "$d_dbmclose" in
11630 *) set rpcsvc/dbm.h i_rpcsvcdbm
11635 *) echo "We won't be including <dbm.h>"
11645 : see if prototype for dbminit is available
11647 set d_dbminitproto dbminit $i_dbm dbm.h
11650 : see if difftime exists
11651 set difftime d_difftime
11654 : see if this is a dirent system
11656 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11658 echo "<dirent.h> found." >&4
11661 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11662 echo "<sys/dir.h> found." >&4
11665 xinc=`./findhdr sys/ndir.h`
11667 echo "<dirent.h> NOT found." >&4
11672 : Look for type of directory structure.
11674 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11676 case "$direntrytype" in
11678 case "$i_dirent" in
11679 $define) guess1='struct dirent' ;;
11680 *) guess1='struct direct' ;;
11683 *) guess1="$direntrytype"
11688 'struct dirent') guess2='struct direct' ;;
11689 *) guess2='struct dirent' ;;
11692 if $contains "$guess1" try.c >/dev/null 2>&1; then
11693 direntrytype="$guess1"
11694 echo "Your directory entries are $direntrytype." >&4
11695 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11696 direntrytype="$guess2"
11697 echo "Your directory entries seem to be $direntrytype." >&4
11699 echo "I don't recognize your system's directory entries." >&4
11700 rp="What type is used for directory entries on this system?"
11703 direntrytype="$ans"
11707 : see if the directory entry stores field length
11709 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11710 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11711 echo "Good, your directory entry keeps length information in d_namlen." >&4
11714 echo "Your directory entry does not know about the d_namlen field." >&4
11721 : Look for DIR.dd_fd
11722 case "$i_dirent" in
11724 echo "Checking to see if DIR has a dd_fd member variable" >&4
11726 #$i_stdlib I_STDLIB
11728 #include <stdlib.h>
11730 #include <dirent.h>
11740 if eval $compile; then
11741 echo "Yes, it does."
11744 echo "No, it does not."
11749 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11757 : see if this is an sysdir system
11758 set sys/dir.h i_sysdir
11761 : see if this is an sysndir system
11762 set sys/ndir.h i_sysndir
11767 $cat >dirfd.c <<EOM
11769 #$i_stdlib I_STDLIB
11771 #include <stdlib.h>
11773 #$i_dirent I_DIRENT /**/
11774 #$i_sysdir I_SYS_DIR /**/
11775 #$i_sysndir I_SYS_NDIR /**/
11776 #$i_systypes I_SYS_TYPES /**/
11777 #if defined(I_SYS_TYPES)
11778 #include <sys/types.h>
11780 #if defined(I_DIRENT)
11781 #include <dirent.h>
11782 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11783 #include <sys/dir.h>
11787 #include <sys/ndir.h>
11791 #include <ndir.h> /* may be wrong in the future */
11793 #include <sys/dir.h>
11799 DIR *dirp = opendir(".");
11800 if (dirfd(dirp) >= 0)
11808 if eval $compile; then
11812 $define) echo "dirfd() found." >&4 ;;
11813 *) echo "dirfd() NOT found." >&4 ;;
11819 : see if dlerror exists
11822 set dlerror d_dlerror
11826 : see if dlfcn is available
11827 set dlfcn.h i_dlfcn
11830 : Check what extension to use for shared libs
11835 On a few systems, the dynamically loaded modules that perl generates and uses
11836 will need a different extension than shared libs. The default will probably
11842 *) dflt="$dlext" ;;
11844 rp='What is the extension of dynamically loaded modules'
11853 : Check if dlsym need a leading underscore
11859 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11860 $cat >dyna.c <<'EOM'
11867 #$i_stdlib I_STDLIB
11869 #include <stdlib.h>
11873 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11875 #include <sys/types.h>
11880 extern int fred() ;
11889 int mode = RTLD_LAZY ;
11891 handle = dlopen("./dyna.$dlext", mode) ;
11892 if (handle == NULL) {
11897 symbol = dlsym(handle, "fred") ;
11898 if (symbol == NULL) {
11899 /* try putting a leading underscore */
11900 symbol = dlsym(handle, "_fred") ;
11901 if (symbol == NULL) {
11914 : Call the object file tmp-dyna.o in case dlext=o.
11915 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11916 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11917 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11918 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11921 1) echo "Test program failed using dlopen." >&4
11922 echo "Perhaps you should not use dynamic loading." >&4;;
11923 2) echo "Test program failed using dlsym." >&4
11924 echo "Perhaps you should not use dynamic loading." >&4;;
11925 3) echo "dlsym needs a leading underscore" >&4
11927 4) echo "dlsym doesn't need a leading underscore." >&4;;
11930 echo "I can't compile and run the test program." >&4
11931 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11936 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11941 : see if drand48_r exists
11942 set drand48_r d_drand48_r
11944 case "$d_drand48_r" in
11946 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11947 case "$d_drand48_r_proto:$usethreads" in
11948 ":define") d_drand48_r_proto=define
11949 set d_drand48_r_proto drand48_r $hdrs
11953 case "$d_drand48_r_proto" in
11955 case "$drand48_r_proto" in
11956 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11957 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
11959 case "$drand48_r_proto" in
11960 ''|0) d_drand48_r=undef
11962 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11963 * ) case "$drand48_r_proto" in
11964 REENTRANT_PROTO*) ;;
11965 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11967 echo "Prototype: $try" ;;
11970 *) case "$usethreads" in
11971 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11978 *) drand48_r_proto=0
11982 : see if prototype for drand48 is available
11984 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11987 : see if dup2 exists
11991 : see if eaccess exists
11992 set eaccess d_eaccess
11995 : see if endgrent exists
11996 set endgrent d_endgrent
11999 : see if this is an grp system
12005 xxx=`./findhdr grp.h`
12006 $cppstdin $cppflags $cppminus < $xxx >$$.h
12008 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12020 set d_grpasswd; eval $setvar
12024 : see if endgrent_r exists
12025 set endgrent_r d_endgrent_r
12027 case "$d_endgrent_r" in
12029 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12030 case "$d_endgrent_r_proto:$usethreads" in
12031 ":define") d_endgrent_r_proto=define
12032 set d_endgrent_r_proto endgrent_r $hdrs
12036 case "$d_endgrent_r_proto" in
12038 case "$endgrent_r_proto" in
12039 ''|0) try='int endgrent_r(FILE**);'
12040 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12042 case "$endgrent_r_proto" in
12043 ''|0) try='void endgrent_r(FILE**);'
12044 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12046 case "$endgrent_r_proto" in
12047 ''|0) d_endgrent_r=undef
12049 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12050 * ) case "$endgrent_r_proto" in
12051 REENTRANT_PROTO*) ;;
12052 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12054 echo "Prototype: $try" ;;
12057 *) case "$usethreads" in
12058 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12065 *) endgrent_r_proto=0
12069 : see if endhostent exists
12070 set endhostent d_endhent
12073 : see if this is a netdb.h system
12074 set netdb.h i_netdb
12077 : see if endhostent_r exists
12078 set endhostent_r d_endhostent_r
12080 case "$d_endhostent_r" in
12082 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12083 case "$d_endhostent_r_proto:$usethreads" in
12084 ":define") d_endhostent_r_proto=define
12085 set d_endhostent_r_proto endhostent_r $hdrs
12089 case "$d_endhostent_r_proto" in
12091 case "$endhostent_r_proto" in
12092 ''|0) try='int endhostent_r(struct hostent_data*);'
12093 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12095 case "$endhostent_r_proto" in
12096 ''|0) try='void endhostent_r(struct hostent_data*);'
12097 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12099 case "$endhostent_r_proto" in
12100 ''|0) d_endhostent_r=undef
12101 endhostent_r_proto=0
12102 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12103 * ) case "$endhostent_r_proto" in
12104 REENTRANT_PROTO*) ;;
12105 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12107 echo "Prototype: $try" ;;
12110 *) case "$usethreads" in
12111 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12113 d_endhostent_r=undef
12114 endhostent_r_proto=0
12118 *) endhostent_r_proto=0
12122 : see if endnetent exists
12123 set endnetent d_endnent
12126 : see if endnetent_r exists
12127 set endnetent_r d_endnetent_r
12129 case "$d_endnetent_r" in
12131 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12132 case "$d_endnetent_r_proto:$usethreads" in
12133 ":define") d_endnetent_r_proto=define
12134 set d_endnetent_r_proto endnetent_r $hdrs
12138 case "$d_endnetent_r_proto" in
12140 case "$endnetent_r_proto" in
12141 ''|0) try='int endnetent_r(struct netent_data*);'
12142 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12144 case "$endnetent_r_proto" in
12145 ''|0) try='void endnetent_r(struct netent_data*);'
12146 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12148 case "$endnetent_r_proto" in
12149 ''|0) d_endnetent_r=undef
12150 endnetent_r_proto=0
12151 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12152 * ) case "$endnetent_r_proto" in
12153 REENTRANT_PROTO*) ;;
12154 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12156 echo "Prototype: $try" ;;
12159 *) case "$usethreads" in
12160 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12162 d_endnetent_r=undef
12163 endnetent_r_proto=0
12167 *) endnetent_r_proto=0
12171 : see if endprotoent exists
12172 set endprotoent d_endpent
12175 : see if endprotoent_r exists
12176 set endprotoent_r d_endprotoent_r
12178 case "$d_endprotoent_r" in
12180 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12181 case "$d_endprotoent_r_proto:$usethreads" in
12182 ":define") d_endprotoent_r_proto=define
12183 set d_endprotoent_r_proto endprotoent_r $hdrs
12187 case "$d_endprotoent_r_proto" in
12189 case "$endprotoent_r_proto" in
12190 ''|0) try='int endprotoent_r(struct protoent_data*);'
12191 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12193 case "$endprotoent_r_proto" in
12194 ''|0) try='void endprotoent_r(struct protoent_data*);'
12195 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12197 case "$endprotoent_r_proto" in
12198 ''|0) d_endprotoent_r=undef
12199 endprotoent_r_proto=0
12200 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12201 * ) case "$endprotoent_r_proto" in
12202 REENTRANT_PROTO*) ;;
12203 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12205 echo "Prototype: $try" ;;
12208 *) case "$usethreads" in
12209 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12211 d_endprotoent_r=undef
12212 endprotoent_r_proto=0
12216 *) endprotoent_r_proto=0
12220 : see if endpwent exists
12221 set endpwent d_endpwent
12224 : see if this is a pwd.h system
12230 xxx=`./findhdr pwd.h`
12231 $cppstdin $cppflags $cppminus < $xxx >$$.h
12233 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12241 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12249 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12257 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12265 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12273 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12281 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12289 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12301 set d_pwquota; eval $setvar
12302 set d_pwage; eval $setvar
12303 set d_pwchange; eval $setvar
12304 set d_pwclass; eval $setvar
12305 set d_pwexpire; eval $setvar
12306 set d_pwcomment; eval $setvar
12307 set d_pwgecos; eval $setvar
12308 set d_pwpasswd; eval $setvar
12312 : see if endpwent_r exists
12313 set endpwent_r d_endpwent_r
12315 case "$d_endpwent_r" in
12317 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12318 case "$d_endpwent_r_proto:$usethreads" in
12319 ":define") d_endpwent_r_proto=define
12320 set d_endpwent_r_proto endpwent_r $hdrs
12324 case "$d_endpwent_r_proto" in
12326 case "$endpwent_r_proto" in
12327 ''|0) try='int endpwent_r(FILE**);'
12328 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12330 case "$endpwent_r_proto" in
12331 ''|0) try='void endpwent_r(FILE**);'
12332 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12334 case "$endpwent_r_proto" in
12335 ''|0) d_endpwent_r=undef
12337 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12338 * ) case "$endpwent_r_proto" in
12339 REENTRANT_PROTO*) ;;
12340 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12342 echo "Prototype: $try" ;;
12345 *) case "$usethreads" in
12346 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12353 *) endpwent_r_proto=0
12357 : see if endservent exists
12358 set endservent d_endsent
12361 : see if endservent_r exists
12362 set endservent_r d_endservent_r
12364 case "$d_endservent_r" in
12366 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12367 case "$d_endservent_r_proto:$usethreads" in
12368 ":define") d_endservent_r_proto=define
12369 set d_endservent_r_proto endservent_r $hdrs
12373 case "$d_endservent_r_proto" in
12375 case "$endservent_r_proto" in
12376 ''|0) try='int endservent_r(struct servent_data*);'
12377 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12379 case "$endservent_r_proto" in
12380 ''|0) try='void endservent_r(struct servent_data*);'
12381 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12383 case "$endservent_r_proto" in
12384 ''|0) d_endservent_r=undef
12385 endservent_r_proto=0
12386 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12387 * ) case "$endservent_r_proto" in
12388 REENTRANT_PROTO*) ;;
12389 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12391 echo "Prototype: $try" ;;
12394 *) case "$usethreads" in
12395 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12397 d_endservent_r=undef
12398 endservent_r_proto=0
12402 *) endservent_r_proto=0
12406 : Locate the flags for 'open()'
12409 #include <sys/types.h>
12414 #include <sys/file.h>
12416 #$i_stdlib I_STDLIB
12418 #include <stdlib.h>
12429 : check sys/file.h first to get FREAD on Sun
12430 if $test `./findhdr sys/file.h` && \
12431 set try -DI_SYS_FILE && eval $compile; then
12433 echo "<sys/file.h> defines the O_* constants..." >&4
12434 if $run ./try; then
12435 echo "and you have the 3 argument form of open()." >&4
12438 echo "but not the 3 argument form of open(). Oh, well." >&4
12441 elif $test `./findhdr fcntl.h` && \
12442 set try -DI_FCNTL && eval $compile; then
12444 echo "<fcntl.h> defines the O_* constants..." >&4
12445 if $run ./try; then
12446 echo "and you have the 3 argument form of open()." >&4
12449 echo "but not the 3 argument form of open(). Oh, well." >&4
12454 echo "I can't find the O_* constant definitions! You got problems." >&4
12460 : see if this is a sys/file.h system
12465 : do we need to include sys/file.h ?
12469 if $h_sysfile; then
12471 echo "We'll be including <sys/file.h>." >&4
12474 echo "We won't be including <sys/file.h>." >&4
12484 : see if fcntl.h is there
12489 : see if we can include fcntl.h
12495 echo "We'll be including <fcntl.h>." >&4
12498 if $h_sysfile; then
12499 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12501 echo "We won't be including <fcntl.h>." >&4
12513 : see if fork exists
12517 : see if pipe exists
12521 : check for non-blocking I/O stuff
12522 case "$h_sysfile" in
12523 true) echo "#include <sys/file.h>" > head.c;;
12526 true) echo "#include <fcntl.h>" > head.c;;
12527 *) echo "#include <sys/fcntl.h>" > head.c;;
12532 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12533 case "$o_nonblock" in
12535 $cat head.c > try.c
12536 $cat >>try.c <<EOCP
12538 #$i_stdlib I_STDLIB
12540 #include <stdlib.h>
12548 printf("O_NONBLOCK\n");
12552 printf("O_NDELAY\n");
12556 printf("FNDELAY\n");
12563 if eval $compile_ok; then
12564 o_nonblock=`$run ./try`
12565 case "$o_nonblock" in
12566 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12567 *) echo "Seems like we can use $o_nonblock.";;
12570 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12573 *) echo "Using $hint value $o_nonblock.";;
12578 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12581 case "$d_fork:$d_pipe" in
12583 $cat head.c > try.c
12584 $cat >>try.c <<EOCP
12586 #include <sys/types.h>
12587 #include <signal.h>
12589 #$i_stdlib I_STDLIB
12591 #include <stdlib.h>
12597 #define MY_O_NONBLOCK $o_nonblock
12598 #ifndef errno /* XXX need better Configure test */
12601 #$i_unistd I_UNISTD
12603 #include <unistd.h>
12605 #$i_string I_STRING
12607 #include <string.h>
12609 #include <strings.h>
12611 $signal_t blech(int x) { exit(3); }
12613 $cat >> try.c <<'EOCP'
12621 pipe(pd); /* Down: child -> parent */
12622 pipe(pu); /* Up: parent -> child */
12625 close(pd[1]); /* Parent reads from pd[0] */
12626 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12628 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12633 signal(SIGALRM, blech);
12635 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12637 sprintf(string, "%d\n", ret);
12638 write(2, string, strlen(string));
12641 if (errno == EAGAIN) {
12642 printf("EAGAIN\n");
12647 if (errno == EWOULDBLOCK)
12648 printf("EWOULDBLOCK\n");
12651 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12652 sleep(2); /* Give it time to close our pipe */
12654 ret = read(pd[0], buf, 1); /* Should read EOF */
12656 sprintf(string, "%d\n", ret);
12657 write(4, string, strlen(string));
12661 close(pd[0]); /* We write to pd[1] */
12662 close(pu[1]); /* We read from pu[0] */
12663 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12664 close(pd[1]); /* Pipe pd is now fully closed! */
12665 exit(0); /* Bye bye, thank you for playing! */
12669 if eval $compile_ok; then
12670 echo "$startsh" >mtry
12671 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12673 ./mtry >/dev/null 2>&1
12675 0) eagain=`$cat try.out`;;
12676 1) echo "Could not perform non-blocking setting!";;
12677 2) echo "I did a successful read() for something that was not there!";;
12678 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12679 4) echo "Could not find F_SETFL!";;
12680 *) echo "Something terribly wrong happened during testing.";;
12682 rd_nodata=`$cat try.ret`
12683 echo "A read() system call with no data present returns $rd_nodata."
12684 case "$rd_nodata" in
12687 echo "(That's peculiar, fixing that to be -1.)"
12693 echo "Forcing errno EAGAIN on read() with no data available."
12697 echo "Your read() sets errno to $eagain when no data is available."
12700 status=`$cat try.err`
12702 0) echo "And it correctly returns 0 to signal EOF.";;
12703 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12704 *) echo "However, your read() returns '$status' on EOF??";;
12707 if test "$status" = "$rd_nodata"; then
12708 echo "WARNING: you can't distinguish between EOF and no data!"
12712 echo "I can't compile the test program--assuming errno EAGAIN will do."
12716 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12725 echo "Using $hint value $eagain."
12726 echo "Your read() returns $rd_nodata when no data is present."
12727 case "$d_eofnblk" in
12728 "$define") echo "And you can see EOF because read() returns 0.";;
12729 "$undef") echo "But you can't see EOF status from read() returned value.";;
12731 echo "(Assuming you can't see EOF status from read anyway.)"
12737 $rm_try head.c mtry
12739 : see if _ptr and _cnt from stdio act std
12742 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12743 echo "(Looks like you have stdio.h from BSD.)"
12744 case "$stdio_ptr" in
12745 '') stdio_ptr='((fp)->_p)'
12748 *) ptr_lval=$d_stdio_ptr_lval;;
12750 case "$stdio_cnt" in
12751 '') stdio_cnt='((fp)->_r)'
12754 *) cnt_lval=$d_stdio_cnt_lval;;
12756 case "$stdio_base" in
12757 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12759 case "$stdio_bufsiz" in
12760 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12762 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12763 echo "(Looks like you have stdio.h from Linux.)"
12764 case "$stdio_ptr" in
12765 '') stdio_ptr='((fp)->_IO_read_ptr)'
12768 *) ptr_lval=$d_stdio_ptr_lval;;
12770 case "$stdio_cnt" in
12771 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12774 *) cnt_lval=$d_stdio_cnt_lval;;
12776 case "$stdio_base" in
12777 '') stdio_base='((fp)->_IO_read_base)';;
12779 case "$stdio_bufsiz" in
12780 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12783 case "$stdio_ptr" in
12784 '') stdio_ptr='((fp)->_ptr)'
12787 *) ptr_lval=$d_stdio_ptr_lval;;
12789 case "$stdio_cnt" in
12790 '') stdio_cnt='((fp)->_cnt)'
12793 *) cnt_lval=$d_stdio_cnt_lval;;
12795 case "$stdio_base" in
12796 '') stdio_base='((fp)->_base)';;
12798 case "$stdio_bufsiz" in
12799 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12803 : test whether _ptr and _cnt really work
12804 echo "Checking how std your stdio is..." >&4
12807 #$i_stdlib I_STDLIB
12809 #include <stdlib.h>
12811 #define FILE_ptr(fp) $stdio_ptr
12812 #define FILE_cnt(fp) $stdio_cnt
12814 FILE *fp = fopen("try.c", "r");
12817 18 <= FILE_cnt(fp) &&
12818 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12826 if eval $compile && $to try.c; then
12827 if $run ./try; then
12828 echo "Your stdio acts pretty std."
12831 echo "Your stdio isn't very std."
12834 echo "Your stdio doesn't appear very std."
12838 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12839 # direct buffer manipulation no longer works. The Configure tests
12840 # should be changed to correctly detect this, but until then,
12841 # the following check should at least let perl compile and run.
12842 # (This quick fix should be updated before 5.8.1.)
12843 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12844 # A. Dougherty, June 3, 2002.
12845 case "$d_gnulibc" in
12847 case "$gnulibc_version" in
12851 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12860 : Can _ptr be used as an lvalue?
12861 case "$d_stdstdio$ptr_lval" in
12862 $define$define) val=$define ;;
12865 set d_stdio_ptr_lval
12868 : Can _cnt be used as an lvalue?
12869 case "$d_stdstdio$cnt_lval" in
12870 $define$define) val=$define ;;
12873 set d_stdio_cnt_lval
12877 : test whether setting _ptr sets _cnt as a side effect
12878 d_stdio_ptr_lval_sets_cnt="$undef"
12879 d_stdio_ptr_lval_nochange_cnt="$undef"
12880 case "$d_stdio_ptr_lval$d_stdstdio" in
12882 echo "Checking to see what happens if we set the stdio ptr..." >&4
12885 /* Can we scream? */
12886 /* Eat dust sed :-) */
12887 /* In the buffer space, no one can hear you scream. */
12888 #$i_stdlib I_STDLIB
12890 #include <stdlib.h>
12892 #define FILE_ptr(fp) $stdio_ptr
12893 #define FILE_cnt(fp) $stdio_cnt
12894 #include <sys/types.h>
12896 FILE *fp = fopen("try.c", "r");
12901 puts("Fail even to read");
12904 c = getc(fp); /* Read away the first # */
12906 puts("Fail even to read");
12910 18 <= FILE_cnt(fp) &&
12911 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12913 puts("Fail even to read");
12916 ptr = (char*) FILE_ptr(fp);
12917 cnt = (size_t)FILE_cnt(fp);
12919 FILE_ptr(fp) += 42;
12921 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12922 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12925 if (FILE_cnt(fp) <= 20) {
12926 printf ("Fail (<20 chars to test)");
12929 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12930 puts("Fail compare");
12933 if (cnt == FILE_cnt(fp)) {
12934 puts("Pass_unchanged");
12937 if (FILE_cnt(fp) == (cnt - 42)) {
12938 puts("Pass_changed");
12941 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12947 if eval $compile && $to try.c; then
12948 case `$run ./try` in
12950 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12951 d_stdio_ptr_lval_sets_cnt="$define" ;;
12953 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12954 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12956 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12958 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12961 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12967 : see if _base is also standard
12969 case "$d_stdstdio" in
12973 #$i_stdlib I_STDLIB
12975 #include <stdlib.h>
12977 #define FILE_base(fp) $stdio_base
12978 #define FILE_bufsiz(fp) $stdio_bufsiz
12980 FILE *fp = fopen("try.c", "r");
12983 19 <= FILE_bufsiz(fp) &&
12984 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12991 if eval $compile && $to try.c; then
12992 if $run ./try; then
12993 echo "And its _base field acts std."
12996 echo "But its _base field isn't std."
12999 echo "However, it seems to be lacking the _base field."
13007 : see if fast_stdio exists
13009 case "$d_stdstdio:$d_stdio_ptr_lval" in
13011 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13013 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13024 : see if fchdir exists
13025 set fchdir d_fchdir
13028 : see if fchmod exists
13029 set fchmod d_fchmod
13032 : see if fchown exists
13033 set fchown d_fchown
13036 : see if this is an fcntl system
13040 : See if fcntl-based locking works.
13043 #$i_stdlib I_STDLIB
13045 #include <stdlib.h>
13047 #include <unistd.h>
13049 #include <signal.h>
13050 $signal_t blech(int x) { exit(3); }
13052 #if defined(F_SETLK) && defined(F_SETLKW)
13053 struct flock flock;
13055 fd = open("try.c", O_RDONLY);
13056 flock.l_type = F_RDLCK;
13057 flock.l_whence = SEEK_SET;
13058 flock.l_start = flock.l_len = 0;
13059 signal(SIGALRM, blech);
13061 retval = fcntl(fd, F_SETLK, &flock);
13063 (retval < 0 ? exit(2) : exit(0));
13069 echo "Checking if fcntl-based file locking works... "
13073 if eval $compile_ok; then
13074 if $run ./try; then
13075 echo "Yes, it seems to work."
13078 echo "Nope, it didn't work."
13083 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13084 *** This is (almost) impossible.
13085 *** If your NFS lock daemons are not feeling well, something like
13086 *** this may happen, please investigate. Cannot continue, aborting.
13094 echo "I'm unable to compile the test program, so I'll assume not."
13099 echo "Nope, since you don't even have fcntl()."
13102 set d_fcntl_can_lock
13106 : check for fd_set items
13109 Checking to see how well your C compiler handles fd_set and friends ...
13112 #$i_stdlib I_STDLIB
13114 #include <stdlib.h>
13116 #$i_systime I_SYS_TIME
13117 #$i_sysselct I_SYS_SELECT
13118 #$d_socket HAS_SOCKET
13119 #include <sys/types.h>
13121 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13124 #include <sys/time.h>
13126 #ifdef I_SYS_SELECT
13127 #include <sys/select.h>
13136 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13144 if eval $compile; then
13145 d_fds_bits="$define"
13147 echo "Well, your system knows about the normal fd_set typedef..." >&4
13148 if $run ./try; then
13149 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13150 d_fd_macros="$define"
13153 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13155 d_fd_macros="$undef"
13159 Hmm, your compiler has some difficulty with fd_set. Checking further...
13162 if eval $compile; then
13163 d_fds_bits="$undef"
13165 echo "Well, your system has some sort of fd_set available..." >&4
13166 if $run ./try; then
13167 echo "and you have the normal fd_set macros." >&4
13168 d_fd_macros="$define"
13171 but not the normal fd_set macros! Gross! More work for me...
13173 d_fd_macros="$undef"
13176 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13178 d_fds_bits="$undef"
13179 d_fd_macros="$undef"
13184 : see if fgetpos exists
13185 set fgetpos d_fgetpos
13188 : see if finite exists
13189 set finite d_finite
13192 : see if finitel exists
13193 set finitel d_finitel
13196 : see if flock exists
13200 : see if prototype for flock is available
13202 set d_flockproto flock $i_sysfile sys/file.h
13205 : see if fp_class exists
13206 set fp_class d_fp_class
13209 : see if pathconf exists
13210 set pathconf d_pathconf
13213 : see if fpathconf exists
13214 set fpathconf d_fpathconf
13217 : see if fpclass exists
13218 set fpclass d_fpclass
13221 : see if fpclassify exists
13222 set fpclassify d_fpclassify
13225 : see if fpclassl exists
13226 set fpclassl d_fpclassl
13229 : check for fpos64_t
13231 echo "Checking to see if you have fpos64_t..." >&4
13234 int main() { fpos64_t x = 7; }
13237 if eval $compile; then
13239 echo "You have fpos64_t."
13242 echo "You do not have fpos64_t."
13243 case "$fpossize" in
13244 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13251 : see if frexpl exists
13252 set frexpl d_frexpl
13255 : see if this is a sys/param system
13256 set sys/param.h i_sysparam
13259 : see if this is a sys/mount.h system
13260 set sys/mount.h i_sysmount
13263 : Check for fs_data_s
13265 echo "Checking to see if your system supports struct fs_data..." >&4
13266 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13268 case "$d_fs_data_s" in
13269 "$define") echo "Yes, it does." ;;
13270 *) echo "No, it doesn't." ;;
13273 : see if fseeko exists
13274 set fseeko d_fseeko
13276 case "$longsize" in
13277 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13280 : see if fsetpos exists
13281 set fsetpos d_fsetpos
13284 : see if fstatfs exists
13285 set fstatfs d_fstatfs
13288 : see if statvfs exists
13289 set statvfs d_statvfs
13292 : see if fstatvfs exists
13293 set fstatvfs d_fstatvfs
13297 : see if fsync exists
13301 : see if ftello exists
13302 set ftello d_ftello
13304 case "$longsize" in
13305 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13308 : check for a working futimes
13311 echo "Checking if you have a working futimes()" >&4
13314 #include <sys/time.h>
13321 fd = open ("try.c", O_RDWR);
13322 if (-1 == fd) exit (1);
13323 rv = futimes (fd, NULL);
13324 exit (rv == -1 ? errno : 0);
13328 if eval $compile; then
13332 0) echo "Yes, you have" >&4
13333 d_futimes="$define"
13335 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13339 echo "No, it does not (probably harmless)" >&4
13343 : see if ndbm.h is available
13346 : Compatibility location for RedHat 7.1
13347 set gdbm/ndbm.h i_gdbmndbm
13349 : Compatibility location for Debian 4.0
13350 set gdbm-ndbm.h i_gdbm_ndbm
13354 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13355 : see if dbm_open exists
13356 set dbm_open d_dbm_open
13358 case "$d_dbm_open" in
13361 i_gdbmndbm="$undef"
13362 i_gdbm_ndbm="$undef"
13363 echo "We won't be including <ndbm.h>"
13373 ndbm_hdr_protochk='name=$1; hdr=$2;
13374 eval "ihdr=\$""i_$name";
13376 if $test "$ihdr" = "$define"; then
13377 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13378 case "$d_cplusplus" in
13379 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13380 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13383 $define) $echo "Your <$hdr> seems to have prototypes";;
13384 *) $echo "Your <$hdr> does not seem to have prototypes";;
13387 set "d_${name}_h_uses_prototypes";
13391 eval $ndbm_hdr_protochk
13392 set gdbmndbm gdbm/ndbm.h
13393 eval $ndbm_hdr_protochk
13394 set gdbm_ndbm gdbm-ndbm.h
13395 eval $ndbm_hdr_protochk
13397 : see if getcwd exists
13398 set getcwd d_getcwd
13401 : see if getespwnam exists
13402 set getespwnam d_getespwnam
13405 : see if getfsstat exists
13406 set getfsstat d_getfsstat
13409 : see if getgrent exists
13410 set getgrent d_getgrent
13413 : see if getgrent_r exists
13414 set getgrent_r d_getgrent_r
13416 case "$d_getgrent_r" in
13418 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13419 case "$d_getgrent_r_proto:$usethreads" in
13420 ":define") d_getgrent_r_proto=define
13421 set d_getgrent_r_proto getgrent_r $hdrs
13425 case "$d_getgrent_r_proto" in
13427 case "$getgrent_r_proto" in
13428 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13429 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13431 case "$getgrent_r_proto" in
13432 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13433 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13435 case "$getgrent_r_proto" in
13436 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13437 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13439 case "$getgrent_r_proto" in
13440 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13441 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13443 case "$getgrent_r_proto" in
13444 ''|0) try='int getgrent_r(struct group*, char*, int);'
13445 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13447 case "$getgrent_r_proto" in
13448 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13449 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13451 case "$getgrent_r_proto" in
13452 ''|0) d_getgrent_r=undef
13454 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13455 * ) case "$getgrent_r_proto" in
13456 REENTRANT_PROTO*) ;;
13457 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13459 echo "Prototype: $try" ;;
13462 *) case "$usethreads" in
13463 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13470 *) getgrent_r_proto=0
13474 : see if getgrgid_r exists
13475 set getgrgid_r d_getgrgid_r
13477 case "$d_getgrgid_r" in
13479 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13480 case "$d_getgrgid_r_proto:$usethreads" in
13481 ":define") d_getgrgid_r_proto=define
13482 set d_getgrgid_r_proto getgrgid_r $hdrs
13486 case "$d_getgrgid_r_proto" in
13488 case "$getgrgid_r_proto" in
13489 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13490 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13492 case "$getgrgid_r_proto" in
13493 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13494 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13496 case "$getgrgid_r_proto" in
13497 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13498 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13500 case "$getgrgid_r_proto" in
13501 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13502 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13504 case "$getgrgid_r_proto" in
13505 ''|0) d_getgrgid_r=undef
13507 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13508 * ) case "$getgrgid_r_proto" in
13509 REENTRANT_PROTO*) ;;
13510 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13512 echo "Prototype: $try" ;;
13515 *) case "$usethreads" in
13516 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13523 *) getgrgid_r_proto=0
13527 : see if getgrnam_r exists
13528 set getgrnam_r d_getgrnam_r
13530 case "$d_getgrnam_r" in
13532 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13533 case "$d_getgrnam_r_proto:$usethreads" in
13534 ":define") d_getgrnam_r_proto=define
13535 set d_getgrnam_r_proto getgrnam_r $hdrs
13539 case "$d_getgrnam_r_proto" in
13541 case "$getgrnam_r_proto" in
13542 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13543 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13545 case "$getgrnam_r_proto" in
13546 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13547 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13549 case "$getgrnam_r_proto" in
13550 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13551 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13553 case "$getgrnam_r_proto" in
13554 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13555 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13557 case "$getgrnam_r_proto" in
13558 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13559 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13561 case "$getgrnam_r_proto" in
13562 ''|0) d_getgrnam_r=undef
13564 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13565 * ) case "$getgrnam_r_proto" in
13566 REENTRANT_PROTO*) ;;
13567 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13569 echo "Prototype: $try" ;;
13572 *) case "$usethreads" in
13573 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13580 *) getgrnam_r_proto=0
13584 : see if gethostbyaddr exists
13585 set gethostbyaddr d_gethbyaddr
13588 : see if gethostbyname exists
13589 set gethostbyname d_gethbyname
13592 : see if gethostent exists
13593 set gethostent d_gethent
13596 : see how we will look up host name
13599 if set gethostname val -f d_gethname; eval $csym; $val; then
13600 echo 'gethostname() found.' >&4
13601 d_gethname="$define"
13604 if set uname val -f d_uname; eval $csym; $val; then
13607 uname() was found, but you're running xenix, and older versions of xenix
13608 have a broken uname(). If you don't really know whether your xenix is old
13609 enough to have a broken system call, use the default answer.
13614 "$define") dflt=n;;
13616 rp='Is your uname() broken?'
13619 n*) d_uname="$define"; call=uname;;
13622 echo 'uname() found.' >&4
13629 case "$d_gethname" in
13630 '') d_gethname="$undef";;
13633 '') d_uname="$undef";;
13635 case "$d_uname$d_gethname" in
13640 Every now and then someone has a $call() that lies about the hostname
13641 but can't be fixed for political or economic reasons. If you wish, I can
13642 pretend $call() isn't there and maybe compute hostname at run-time
13643 thanks to the '$phostname' command.
13646 rp="Shall I ignore $call() from now on?"
13649 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13652 case "$phostname" in
13653 '') aphostname='';;
13654 *) case "$aphostname" in
13656 *) set X $phostname
13660 file=`./loc $file $file $pth`
13661 aphostname=`echo $file $*`
13666 case "$d_uname$d_gethname" in
13669 case "$phostname" in
13671 echo "There will be no way for $package to get your hostname." >&4;;
13673 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13677 case "$d_phostname" in
13678 '') d_phostname="$undef";;
13681 : see if gethostbyaddr_r exists
13682 set gethostbyaddr_r d_gethostbyaddr_r
13684 case "$d_gethostbyaddr_r" in
13686 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13687 case "$d_gethostbyaddr_r_proto:$usethreads" in
13688 ":define") d_gethostbyaddr_r_proto=define
13689 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13693 case "$d_gethostbyaddr_r_proto" in
13695 case "$gethostbyaddr_r_proto" in
13696 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13697 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13699 case "$gethostbyaddr_r_proto" in
13700 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13701 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13703 case "$gethostbyaddr_r_proto" in
13704 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13705 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13707 case "$gethostbyaddr_r_proto" in
13708 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13709 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13711 case "$gethostbyaddr_r_proto" in
13712 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13713 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13715 case "$gethostbyaddr_r_proto" in
13716 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13717 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13719 case "$gethostbyaddr_r_proto" in
13720 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13721 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13723 case "$gethostbyaddr_r_proto" in
13724 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13725 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13727 case "$gethostbyaddr_r_proto" in
13728 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13729 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13731 case "$gethostbyaddr_r_proto" in
13732 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13733 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13735 case "$gethostbyaddr_r_proto" in
13736 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13737 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13739 case "$gethostbyaddr_r_proto" in
13740 ''|0) d_gethostbyaddr_r=undef
13741 gethostbyaddr_r_proto=0
13742 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13743 * ) case "$gethostbyaddr_r_proto" in
13744 REENTRANT_PROTO*) ;;
13745 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13747 echo "Prototype: $try" ;;
13750 *) case "$usethreads" in
13751 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13753 d_gethostbyaddr_r=undef
13754 gethostbyaddr_r_proto=0
13758 *) gethostbyaddr_r_proto=0
13762 : see if gethostbyname_r exists
13763 set gethostbyname_r d_gethostbyname_r
13765 case "$d_gethostbyname_r" in
13767 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13768 case "$d_gethostbyname_r_proto:$usethreads" in
13769 ":define") d_gethostbyname_r_proto=define
13770 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13774 case "$d_gethostbyname_r_proto" in
13776 case "$gethostbyname_r_proto" in
13777 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13778 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13780 case "$gethostbyname_r_proto" in
13781 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13782 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13784 case "$gethostbyname_r_proto" in
13785 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13786 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13788 case "$gethostbyname_r_proto" in
13789 ''|0) d_gethostbyname_r=undef
13790 gethostbyname_r_proto=0
13791 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13792 * ) case "$gethostbyname_r_proto" in
13793 REENTRANT_PROTO*) ;;
13794 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13796 echo "Prototype: $try" ;;
13799 *) case "$usethreads" in
13800 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13802 d_gethostbyname_r=undef
13803 gethostbyname_r_proto=0
13807 *) gethostbyname_r_proto=0
13811 : see if gethostent_r exists
13812 set gethostent_r d_gethostent_r
13814 case "$d_gethostent_r" in
13816 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13817 case "$d_gethostent_r_proto:$usethreads" in
13818 ":define") d_gethostent_r_proto=define
13819 set d_gethostent_r_proto gethostent_r $hdrs
13823 case "$d_gethostent_r_proto" in
13825 case "$gethostent_r_proto" in
13826 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13827 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13829 case "$gethostent_r_proto" in
13830 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13831 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13833 case "$gethostent_r_proto" in
13834 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13835 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13837 case "$gethostent_r_proto" in
13838 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13839 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
13841 case "$gethostent_r_proto" in
13842 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13843 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
13845 case "$gethostent_r_proto" in
13846 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13847 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
13849 case "$gethostent_r_proto" in
13850 ''|0) d_gethostent_r=undef
13851 gethostent_r_proto=0
13852 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13853 * ) case "$gethostent_r_proto" in
13854 REENTRANT_PROTO*) ;;
13855 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13857 echo "Prototype: $try" ;;
13860 *) case "$usethreads" in
13861 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13863 d_gethostent_r=undef
13864 gethostent_r_proto=0
13868 *) gethostent_r_proto=0
13872 : see if prototypes for various gethostxxx netdb.h functions are available
13874 set d_gethostprotos gethostent $i_netdb netdb.h
13877 : see if getitimer exists
13878 set getitimer d_getitimer
13881 : see if getlogin exists
13882 set getlogin d_getlogin
13885 : see if getlogin_r exists
13886 set getlogin_r d_getlogin_r
13888 case "$d_getlogin_r" in
13890 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13891 case "$d_getlogin_r_proto:$usethreads" in
13892 ":define") d_getlogin_r_proto=define
13893 set d_getlogin_r_proto getlogin_r $hdrs
13897 case "$d_getlogin_r_proto" in
13899 case "$getlogin_r_proto" in
13900 ''|0) try='int getlogin_r(char*, size_t);'
13901 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
13903 case "$getlogin_r_proto" in
13904 ''|0) try='int getlogin_r(char*, int);'
13905 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
13907 case "$getlogin_r_proto" in
13908 ''|0) try='char* getlogin_r(char*, size_t);'
13909 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
13911 case "$getlogin_r_proto" in
13912 ''|0) try='char* getlogin_r(char*, int);'
13913 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
13915 case "$getlogin_r_proto" in
13916 ''|0) d_getlogin_r=undef
13918 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13919 * ) case "$getlogin_r_proto" in
13920 REENTRANT_PROTO*) ;;
13921 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13923 echo "Prototype: $try" ;;
13926 *) case "$usethreads" in
13927 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13934 *) getlogin_r_proto=0
13938 : see if getmnt exists
13939 set getmnt d_getmnt
13942 : see if getmntent exists
13943 set getmntent d_getmntent
13946 : see if getnetbyaddr exists
13947 set getnetbyaddr d_getnbyaddr
13950 : see if getnetbyname exists
13951 set getnetbyname d_getnbyname
13954 : see if getnetent exists
13955 set getnetent d_getnent
13958 : see if getnetbyaddr_r exists
13959 set getnetbyaddr_r d_getnetbyaddr_r
13961 case "$d_getnetbyaddr_r" in
13963 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13964 case "$d_getnetbyaddr_r_proto:$usethreads" in
13965 ":define") d_getnetbyaddr_r_proto=define
13966 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13970 case "$d_getnetbyaddr_r_proto" in
13972 case "$getnetbyaddr_r_proto" in
13973 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13974 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13976 case "$getnetbyaddr_r_proto" in
13977 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13978 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13980 case "$getnetbyaddr_r_proto" in
13981 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13982 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13984 case "$getnetbyaddr_r_proto" in
13985 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13986 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13988 case "$getnetbyaddr_r_proto" in
13989 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13990 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13992 case "$getnetbyaddr_r_proto" in
13993 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13994 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13996 case "$getnetbyaddr_r_proto" in
13997 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13998 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14000 case "$getnetbyaddr_r_proto" in
14001 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14002 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14004 case "$getnetbyaddr_r_proto" in
14005 ''|0) d_getnetbyaddr_r=undef
14006 getnetbyaddr_r_proto=0
14007 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14008 * ) case "$getnetbyaddr_r_proto" in
14009 REENTRANT_PROTO*) ;;
14010 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14012 echo "Prototype: $try" ;;
14015 *) case "$usethreads" in
14016 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14018 d_getnetbyaddr_r=undef
14019 getnetbyaddr_r_proto=0
14023 *) getnetbyaddr_r_proto=0
14027 : see if getnetbyname_r exists
14028 set getnetbyname_r d_getnetbyname_r
14030 case "$d_getnetbyname_r" in
14032 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14033 case "$d_getnetbyname_r_proto:$usethreads" in
14034 ":define") d_getnetbyname_r_proto=define
14035 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14039 case "$d_getnetbyname_r_proto" in
14041 case "$getnetbyname_r_proto" in
14042 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14043 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14045 case "$getnetbyname_r_proto" in
14046 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14047 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14049 case "$getnetbyname_r_proto" in
14050 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14051 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14053 case "$getnetbyname_r_proto" in
14054 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14055 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14057 case "$getnetbyname_r_proto" in
14058 ''|0) d_getnetbyname_r=undef
14059 getnetbyname_r_proto=0
14060 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14061 * ) case "$getnetbyname_r_proto" in
14062 REENTRANT_PROTO*) ;;
14063 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14065 echo "Prototype: $try" ;;
14068 *) case "$usethreads" in
14069 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14071 d_getnetbyname_r=undef
14072 getnetbyname_r_proto=0
14076 *) getnetbyname_r_proto=0
14080 : see if getnetent_r exists
14081 set getnetent_r d_getnetent_r
14083 case "$d_getnetent_r" in
14085 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14086 case "$d_getnetent_r_proto:$usethreads" in
14087 ":define") d_getnetent_r_proto=define
14088 set d_getnetent_r_proto getnetent_r $hdrs
14092 case "$d_getnetent_r_proto" in
14094 case "$getnetent_r_proto" in
14095 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14096 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14098 case "$getnetent_r_proto" in
14099 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14100 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14102 case "$getnetent_r_proto" in
14103 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14104 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14106 case "$getnetent_r_proto" in
14107 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14108 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14110 case "$getnetent_r_proto" in
14111 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14112 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14114 case "$getnetent_r_proto" in
14115 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14116 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14118 case "$getnetent_r_proto" in
14119 ''|0) d_getnetent_r=undef
14120 getnetent_r_proto=0
14121 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14122 * ) case "$getnetent_r_proto" in
14123 REENTRANT_PROTO*) ;;
14124 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14126 echo "Prototype: $try" ;;
14129 *) case "$usethreads" in
14130 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14132 d_getnetent_r=undef
14133 getnetent_r_proto=0
14137 *) getnetent_r_proto=0
14141 : see if prototypes for various getnetxxx netdb.h functions are available
14143 set d_getnetprotos getnetent $i_netdb netdb.h
14146 : see if getpagesize exists
14147 set getpagesize d_getpagsz
14150 : Optional checks for getprotobyname and getprotobynumber
14152 : see if getprotobyname exists
14153 set getprotobyname d_getpbyname
14156 : see if getprotobynumber exists
14157 set getprotobynumber d_getpbynumber
14160 : see if getprotoent exists
14161 set getprotoent d_getpent
14164 : see if getpgid exists
14165 set getpgid d_getpgid
14168 : see if getpgrp2 exists
14169 set getpgrp2 d_getpgrp2
14172 : see if getppid exists
14173 set getppid d_getppid
14176 : see if getpriority exists
14177 set getpriority d_getprior
14180 : see if getprotobyname_r exists
14181 set getprotobyname_r d_getprotobyname_r
14183 case "$d_getprotobyname_r" in
14185 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14186 case "$d_getprotobyname_r_proto:$usethreads" in
14187 ":define") d_getprotobyname_r_proto=define
14188 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14192 case "$d_getprotobyname_r_proto" in
14194 case "$getprotobyname_r_proto" in
14195 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14196 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14198 case "$getprotobyname_r_proto" in
14199 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14200 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14202 case "$getprotobyname_r_proto" in
14203 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14204 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14206 case "$getprotobyname_r_proto" in
14207 ''|0) d_getprotobyname_r=undef
14208 getprotobyname_r_proto=0
14209 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14210 * ) case "$getprotobyname_r_proto" in
14211 REENTRANT_PROTO*) ;;
14212 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14214 echo "Prototype: $try" ;;
14217 *) case "$usethreads" in
14218 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14220 d_getprotobyname_r=undef
14221 getprotobyname_r_proto=0
14225 *) getprotobyname_r_proto=0
14229 : see if getprotobynumber_r exists
14230 set getprotobynumber_r d_getprotobynumber_r
14232 case "$d_getprotobynumber_r" in
14234 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14235 case "$d_getprotobynumber_r_proto:$usethreads" in
14236 ":define") d_getprotobynumber_r_proto=define
14237 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14241 case "$d_getprotobynumber_r_proto" in
14243 case "$getprotobynumber_r_proto" in
14244 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14245 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14247 case "$getprotobynumber_r_proto" in
14248 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14249 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14251 case "$getprotobynumber_r_proto" in
14252 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14253 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14255 case "$getprotobynumber_r_proto" in
14256 ''|0) d_getprotobynumber_r=undef
14257 getprotobynumber_r_proto=0
14258 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14259 * ) case "$getprotobynumber_r_proto" in
14260 REENTRANT_PROTO*) ;;
14261 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14263 echo "Prototype: $try" ;;
14266 *) case "$usethreads" in
14267 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14269 d_getprotobynumber_r=undef
14270 getprotobynumber_r_proto=0
14274 *) getprotobynumber_r_proto=0
14278 : see if getprotoent_r exists
14279 set getprotoent_r d_getprotoent_r
14281 case "$d_getprotoent_r" in
14283 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14284 case "$d_getprotoent_r_proto:$usethreads" in
14285 ":define") d_getprotoent_r_proto=define
14286 set d_getprotoent_r_proto getprotoent_r $hdrs
14290 case "$d_getprotoent_r_proto" in
14292 case "$getprotoent_r_proto" in
14293 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14294 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14296 case "$getprotoent_r_proto" in
14297 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14298 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14300 case "$getprotoent_r_proto" in
14301 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14302 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14304 case "$getprotoent_r_proto" in
14305 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14306 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14308 case "$getprotoent_r_proto" in
14309 ''|0) d_getprotoent_r=undef
14310 getprotoent_r_proto=0
14311 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14312 * ) case "$getprotoent_r_proto" in
14313 REENTRANT_PROTO*) ;;
14314 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14316 echo "Prototype: $try" ;;
14319 *) case "$usethreads" in
14320 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14322 d_getprotoent_r=undef
14323 getprotoent_r_proto=0
14327 *) getprotoent_r_proto=0
14331 : see if prototypes for various getprotoxxx netdb.h functions are available
14333 set d_getprotoprotos getprotoent $i_netdb netdb.h
14336 : see if getprpwnam exists
14337 set getprpwnam d_getprpwnam
14340 : see if getpwent exists
14341 set getpwent d_getpwent
14344 : see if getpwent_r exists
14345 set getpwent_r d_getpwent_r
14347 case "$d_getpwent_r" in
14349 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14350 case "$d_getpwent_r_proto:$usethreads" in
14351 ":define") d_getpwent_r_proto=define
14352 set d_getpwent_r_proto getpwent_r $hdrs
14356 case "$d_getpwent_r_proto" in
14358 case "$getpwent_r_proto" in
14359 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14360 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14362 case "$getpwent_r_proto" in
14363 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14364 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14366 case "$getpwent_r_proto" in
14367 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14368 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14370 case "$getpwent_r_proto" in
14371 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14372 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14374 case "$getpwent_r_proto" in
14375 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14376 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14378 case "$getpwent_r_proto" in
14379 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14380 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14382 case "$getpwent_r_proto" in
14383 ''|0) d_getpwent_r=undef
14385 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14386 * ) case "$getpwent_r_proto" in
14387 REENTRANT_PROTO*) ;;
14388 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14390 echo "Prototype: $try" ;;
14393 *) case "$usethreads" in
14394 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14401 *) getpwent_r_proto=0
14405 : see if getpwnam_r exists
14406 set getpwnam_r d_getpwnam_r
14408 case "$d_getpwnam_r" in
14410 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14411 case "$d_getpwnam_r_proto:$usethreads" in
14412 ":define") d_getpwnam_r_proto=define
14413 set d_getpwnam_r_proto getpwnam_r $hdrs
14417 case "$d_getpwnam_r_proto" in
14419 case "$getpwnam_r_proto" in
14420 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14421 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14423 case "$getpwnam_r_proto" in
14424 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14425 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14427 case "$getpwnam_r_proto" in
14428 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14429 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14431 case "$getpwnam_r_proto" in
14432 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14433 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14435 case "$getpwnam_r_proto" in
14436 ''|0) d_getpwnam_r=undef
14438 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14439 * ) case "$getpwnam_r_proto" in
14440 REENTRANT_PROTO*) ;;
14441 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14443 echo "Prototype: $try" ;;
14446 *) case "$usethreads" in
14447 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14454 *) getpwnam_r_proto=0
14458 : see if getpwuid_r exists
14459 set getpwuid_r d_getpwuid_r
14461 case "$d_getpwuid_r" in
14463 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14464 case "$d_getpwuid_r_proto:$usethreads" in
14465 ":define") d_getpwuid_r_proto=define
14466 set d_getpwuid_r_proto getpwuid_r $hdrs
14470 case "$d_getpwuid_r_proto" in
14472 case "$getpwuid_r_proto" in
14473 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14474 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14476 case "$getpwuid_r_proto" in
14477 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14478 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14480 case "$getpwuid_r_proto" in
14481 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14482 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14484 case "$getpwuid_r_proto" in
14485 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14486 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14488 case "$getpwuid_r_proto" in
14489 ''|0) d_getpwuid_r=undef
14491 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14492 * ) case "$getpwuid_r_proto" in
14493 REENTRANT_PROTO*) ;;
14494 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14496 echo "Prototype: $try" ;;
14499 *) case "$usethreads" in
14500 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14507 *) getpwuid_r_proto=0
14511 : Optional checks for getsbyname and getsbyport
14513 : see if getservbyname exists
14514 set getservbyname d_getsbyname
14517 : see if getservbyport exists
14518 set getservbyport d_getsbyport
14521 : see if getservent exists
14522 set getservent d_getsent
14525 : see if getservbyname_r exists
14526 set getservbyname_r d_getservbyname_r
14528 case "$d_getservbyname_r" in
14530 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14531 case "$d_getservbyname_r_proto:$usethreads" in
14532 ":define") d_getservbyname_r_proto=define
14533 set d_getservbyname_r_proto getservbyname_r $hdrs
14537 case "$d_getservbyname_r_proto" in
14539 case "$getservbyname_r_proto" in
14540 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14541 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14543 case "$getservbyname_r_proto" in
14544 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14545 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14547 case "$getservbyname_r_proto" in
14548 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14549 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14551 case "$getservbyname_r_proto" in
14552 ''|0) d_getservbyname_r=undef
14553 getservbyname_r_proto=0
14554 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14555 * ) case "$getservbyname_r_proto" in
14556 REENTRANT_PROTO*) ;;
14557 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14559 echo "Prototype: $try" ;;
14562 *) case "$usethreads" in
14563 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14565 d_getservbyname_r=undef
14566 getservbyname_r_proto=0
14570 *) getservbyname_r_proto=0
14574 : see if getservbyport_r exists
14575 set getservbyport_r d_getservbyport_r
14577 case "$d_getservbyport_r" in
14579 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14580 case "$d_getservbyport_r_proto:$usethreads" in
14581 ":define") d_getservbyport_r_proto=define
14582 set d_getservbyport_r_proto getservbyport_r $hdrs
14586 case "$d_getservbyport_r_proto" in
14588 case "$getservbyport_r_proto" in
14589 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14590 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14592 case "$getservbyport_r_proto" in
14593 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14594 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14596 case "$getservbyport_r_proto" in
14597 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14598 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14600 case "$getservbyport_r_proto" in
14601 ''|0) d_getservbyport_r=undef
14602 getservbyport_r_proto=0
14603 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14604 * ) case "$getservbyport_r_proto" in
14605 REENTRANT_PROTO*) ;;
14606 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14608 echo "Prototype: $try" ;;
14611 *) case "$usethreads" in
14612 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14614 d_getservbyport_r=undef
14615 getservbyport_r_proto=0
14619 *) getservbyport_r_proto=0
14623 : see if getservent_r exists
14624 set getservent_r d_getservent_r
14626 case "$d_getservent_r" in
14628 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14629 case "$d_getservent_r_proto:$usethreads" in
14630 ":define") d_getservent_r_proto=define
14631 set d_getservent_r_proto getservent_r $hdrs
14635 case "$d_getservent_r_proto" in
14637 case "$getservent_r_proto" in
14638 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14639 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14641 case "$getservent_r_proto" in
14642 ''|0) try='int getservent_r(struct servent*, char*, int);'
14643 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14645 case "$getservent_r_proto" in
14646 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14647 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14649 case "$getservent_r_proto" in
14650 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14651 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14653 case "$getservent_r_proto" in
14654 ''|0) d_getservent_r=undef
14655 getservent_r_proto=0
14656 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14657 * ) case "$getservent_r_proto" in
14658 REENTRANT_PROTO*) ;;
14659 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14661 echo "Prototype: $try" ;;
14664 *) case "$usethreads" in
14665 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14667 d_getservent_r=undef
14668 getservent_r_proto=0
14672 *) getservent_r_proto=0
14676 : see if prototypes for various getservxxx netdb.h functions are available
14678 set d_getservprotos getservent $i_netdb netdb.h
14681 : see if getspnam exists
14682 set getspnam d_getspnam
14685 : see if this is a shadow.h system
14686 set shadow.h i_shadow
14689 : see if getspnam_r exists
14690 set getspnam_r d_getspnam_r
14692 case "$d_getspnam_r" in
14694 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14695 case "$d_getspnam_r_proto:$usethreads" in
14696 ":define") d_getspnam_r_proto=define
14697 set d_getspnam_r_proto getspnam_r $hdrs
14701 case "$d_getspnam_r_proto" in
14703 case "$getspnam_r_proto" in
14704 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14705 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14707 case "$getspnam_r_proto" in
14708 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14709 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14711 case "$getspnam_r_proto" in
14712 ''|0) d_getspnam_r=undef
14714 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14715 * ) case "$getspnam_r_proto" in
14716 REENTRANT_PROTO*) ;;
14717 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14719 echo "Prototype: $try" ;;
14722 *) case "$usethreads" in
14723 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14730 *) getspnam_r_proto=0
14734 : see if gettimeofday or ftime exists
14735 set gettimeofday d_gettimeod
14737 case "$d_gettimeod" in
14743 val="$undef"; set d_ftime; eval $setvar
14746 case "$d_gettimeod$d_ftime" in
14749 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14753 : see if gmtime_r exists
14754 set gmtime_r d_gmtime_r
14756 case "$d_gmtime_r" in
14758 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14759 case "$d_gmtime_r_proto:$usethreads" in
14760 ":define") d_gmtime_r_proto=define
14761 set d_gmtime_r_proto gmtime_r $hdrs
14765 case "$d_gmtime_r_proto" in
14767 case "$gmtime_r_proto" in
14768 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14769 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
14771 case "$gmtime_r_proto" in
14772 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14773 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
14775 case "$gmtime_r_proto" in
14776 ''|0) d_gmtime_r=undef
14778 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14779 * ) case "$gmtime_r_proto" in
14780 REENTRANT_PROTO*) ;;
14781 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14783 echo "Prototype: $try" ;;
14786 *) case "$usethreads" in
14787 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14794 *) gmtime_r_proto=0
14798 : see if hasmntopt exists
14799 set hasmntopt d_hasmntopt
14802 : see if this is a netinet/in.h or sys/in.h system
14803 set netinet/in.h i_niin sys/in.h i_sysin
14806 : see if arpa/inet.h has to be included
14807 set arpa/inet.h i_arpainet
14810 : see if htonl --and friends-- exists
14815 : Maybe they are macros.
14818 $cat >htonl.c <<EOM
14820 #include <sys/types.h>
14821 #$i_niin I_NETINET_IN
14823 #$i_arpainet I_ARPA_INET
14824 #ifdef I_NETINET_IN
14825 #include <netinet/in.h>
14828 #include <sys/in.h>
14831 #include <arpa/inet.h>
14834 printf("Defined as a macro.");
14837 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14838 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14840 echo "But it seems to be defined as a macro." >&4
14848 : see if ilogbl exists
14849 set ilogbl d_ilogbl
14854 if set index val -f; eval $csym; $val; then
14855 if set strchr val -f d_strchr; eval $csym; $val; then
14856 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14859 echo "strchr() found." >&4
14863 echo "index() found." >&4
14868 echo "index() found." >&4
14871 if set strchr val -f d_strchr; eval $csym; $val; then
14874 echo "strchr() found." >&4
14876 echo "No index() or strchr() found!" >&4
14881 set d_strchr; eval $setvar
14883 set d_index; eval $setvar
14885 : check whether inet_aton exists
14886 set inet_aton d_inetaton
14891 $cat >isascii.c <<EOCP
14894 #$i_stdlib I_STDLIB
14896 #include <stdlib.h>
14907 if eval $compile; then
14908 echo "isascii() found." >&4
14911 echo "isascii() NOT found." >&4
14918 : see if isfinite exists
14919 set isfinite d_isfinite
14922 : see if isinf exists
14926 : see if isnan exists
14930 : see if isnanl exists
14931 set isnanl d_isnanl
14934 : see if killpg exists
14935 set killpg d_killpg
14938 : see if lchown exists
14940 $cat > try.c <<'EOCP'
14941 /* System header to define __stub macros and hopefully few prototypes,
14942 which can conflict with char lchown(); below. */
14943 #include <assert.h>
14944 /* Override any gcc2 internal prototype to avoid an error. */
14945 /* We use char because int might match the return type of a gcc2
14946 builtin and then its argument prototype would still apply. */
14949 /* The GNU C library defines this for functions which it implements
14950 to always fail with ENOSYS. Some functions are actually named
14951 something starting with __ and the normal name is an alias. */
14952 #if defined (__stub_lchown) || defined (__stub___lchown)
14960 if eval $compile; then
14961 $echo "lchown() found." >&4
14964 $echo "lchown() NOT found." >&4
14970 : See if number of significant digits in a double precision number is known
14972 $cat >ldbl_dig.c <<EOM
14973 #$i_limits I_LIMITS
14976 #include <limits.h>
14982 printf("Contains LDBL_DIG");
14985 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14986 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14987 echo "LDBL_DIG found." >&4
14990 echo "LDBL_DIG NOT found." >&4
14997 : see if this is a math.h system
15001 : check to see if math.h defines _LIB_VERSION
15002 d_libm_lib_version="$undef"
15006 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15008 #include <unistd.h>
15010 int main (int argc, char *argv[])
15012 printf ("%d\n", _LIB_VERSION);
15017 if eval $compile; then
15019 echo "Yes, it does ($foo)" >&4
15020 d_libm_lib_version="$define"
15022 echo "No, it does not (probably harmless)" >&4
15029 : see if link exists
15033 : see if localtime_r exists
15034 set localtime_r d_localtime_r
15036 case "$d_localtime_r" in
15038 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15039 case "$d_localtime_r_proto:$usethreads" in
15040 ":define") d_localtime_r_proto=define
15041 set d_localtime_r_proto localtime_r $hdrs
15045 case "$d_localtime_r_proto" in
15047 case "$localtime_r_proto" in
15048 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15049 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15051 case "$localtime_r_proto" in
15052 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15053 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15055 case "$localtime_r_proto" in
15056 ''|0) d_localtime_r=undef
15057 localtime_r_proto=0
15058 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15059 * ) case "$localtime_r_proto" in
15060 REENTRANT_PROTO*) ;;
15061 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15063 echo "Prototype: $try" ;;
15066 *) case "$usethreads" in
15067 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15069 d_localtime_r=undef
15070 localtime_r_proto=0
15074 *) localtime_r_proto=0
15078 : see if localtime_r calls tzset
15079 case "$localtime_r_proto" in
15082 /* Does our libc's localtime_r call tzset ?
15083 * return 0 if so, 1 otherwise.
15085 #$i_systypes I_SYS_TYPES
15086 #$i_unistd I_UNISTD
15088 #$i_stdlib I_STDLIB
15089 #$i_string I_STRING
15090 #$i_malloc I_MALLOC
15092 # include <sys/types.h>
15095 # include <unistd.h>
15101 #include <stdlib.h>
15104 # include <string.h>
15106 # include <strings.h>
15109 # include <malloc.h>
15113 time_t t = time(0L);
15114 char w_tz[]="TZ" "=GMT+5",
15115 e_tz[]="TZ" "=GMT-5",
15116 *tz_e = (char*)malloc(16),
15117 *tz_w = (char*)malloc(16);
15118 struct tm tm_e, tm_w;
15119 memset(&tm_e,'\0',sizeof(struct tm));
15120 memset(&tm_w,'\0',sizeof(struct tm));
15125 localtime_r(&t, &tm_e);
15128 localtime_r(&t, &tm_w);
15130 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15136 if eval $compile; then
15137 if $run ./try; then
15138 d_localtime_r_needs_tzset=undef;
15140 d_localtime_r_needs_tzset=define;
15143 d_localtime_r_needs_tzset=undef;
15147 d_localtime_r_needs_tzset=undef;
15152 : see if localeconv exists
15153 set localeconv d_locconv
15156 : see if lockf exists
15160 : see if prototype for lseek is available
15162 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15165 : see if lstat exists
15169 : see if madvise exists
15170 set madvise d_madvise
15173 : see if malloc_size exists
15174 set malloc_size d_malloc_size
15177 : see if malloc_size_good exists
15178 set malloc_good_size d_malloc_good_size
15181 : see if mblen exists
15185 : see if mbstowcs exists
15186 set mbstowcs d_mbstowcs
15189 : see if mbtowc exists
15190 set mbtowc d_mbtowc
15193 : see if memchr exists
15194 set memchr d_memchr
15197 : see if memcmp exists
15198 set memcmp d_memcmp
15201 : see if memcpy exists
15202 set memcpy d_memcpy
15205 : see if memmove exists
15206 set memmove d_memmove
15209 : see if memset exists
15210 set memset d_memset
15213 : see if mkdir exists
15217 : see if mkdtemp exists
15218 set mkdtemp d_mkdtemp
15221 : see if mkfifo exists
15222 set mkfifo d_mkfifo
15225 : see if mkstemp exists
15226 set mkstemp d_mkstemp
15229 : see if mkstemps exists
15230 set mkstemps d_mkstemps
15233 : see if mktime exists
15234 set mktime d_mktime
15237 : see if this is a sys/mman.h system
15238 set sys/mman.h i_sysmman
15241 : see if mmap exists
15244 : see what shmat returns
15245 : default to something harmless
15247 case "$i_sysmman$d_mmap" in
15249 $cat >mmap.c <<'END'
15250 #include <sys/mman.h>
15253 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15258 echo "and it returns ($mmaptype)." >&4
15264 : see if sqrtl exists
15268 : see if scalbnl exists
15269 set scalbnl d_scalbnl
15272 : see if modfl exists
15276 : see if prototype for modfl is available
15278 set d_modflproto modfl $i_math math.h
15281 d_modfl_pow32_bug="$undef"
15283 case "$d_longdbl$d_modfl" in
15286 Checking to see whether your modfl() is okay for large values...
15292 if $test "X$d_modflproto" != "X$define"; then
15293 $cat >>try.c <<EOCP
15294 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15295 long double modfl (long double, long double *);
15298 $cat >>try.c <<EOCP
15300 long double nv = 4294967303.15;
15306 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15310 case "$osname:$gccversion" in
15311 aix:) saveccflags="$ccflags"
15312 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15315 if eval $compile; then
15318 *" 4294967303.150000 1.150000 4294967302.000000")
15319 echo >&4 "Your modfl() is broken for large values."
15320 d_modfl_pow32_bug="$define"
15322 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15326 *" 4294967303.150000 0.150000 4294967303.000000")
15327 echo >&4 "Your modfl() seems okay for large values."
15329 *) echo >&4 "I don't understand your modfl() at all."
15335 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15338 case "$osname:$gccversion" in
15339 aix:) ccflags="$saveccflags" ;; # restore
15344 if $test "$uselongdouble" = "$define"; then
15346 if $test "$d_sqrtl" != "$define"; then
15347 message="$message sqrtl"
15349 if $test "$d_modfl" != "$define"; then
15350 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15351 echo "You have both aintl and copysignl, so I can emulate modfl."
15353 message="$message modfl"
15356 if $test "$d_frexpl" != "$define"; then
15357 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15358 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15360 message="$message frexpl"
15364 if $test "$message" != ""; then
15367 *** You requested the use of long doubles but you do not seem to have
15368 *** the following mathematical functions needed for long double support:
15370 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15371 *** Cannot continue, aborting.
15379 : see if mprotect exists
15380 set mprotect d_mprotect
15383 : see if msgctl exists
15384 set msgctl d_msgctl
15387 : see if msgget exists
15388 set msgget d_msgget
15391 : see if msgsnd exists
15392 set msgsnd d_msgsnd
15395 : see if msgrcv exists
15396 set msgrcv d_msgrcv
15399 : see how much of the 'msg*(2)' library is present.
15402 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15403 *"$undef"*) h_msg=false;;
15407 case "`ipcs 2>&1`" in
15408 "SVID messages"*"not configured"*)
15409 echo "Your $osname does not have the msg*(2) configured." >&4
15412 set msgctl d_msgctl
15414 set msgget d_msgget
15416 set msgsnd d_msgsnd
15418 set msgrcv d_msgrcv
15424 : we could also check for sys/ipc.h ...
15425 if $h_msg && $test `./findhdr sys/msg.h`; then
15426 echo "You have the full msg*(2) library." >&4
15429 echo "You don't have the full msg*(2) library." >&4
15435 : Check for msghdr_s
15437 echo "Checking to see if your system supports struct msghdr..." >&4
15438 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15440 case "$d_msghdr_s" in
15441 "$define") echo "Yes, it does." ;;
15442 *) echo "No, it doesn't." ;;
15446 : see if msync exists
15450 : see if munmap exists
15451 set munmap d_munmap
15454 : see if nice exists
15458 : see if this is a langinfo.h system
15459 set langinfo.h i_langinfo
15462 : see if nl_langinfo exists
15463 set nl_langinfo d_nl_langinfo
15466 : check for volatile keyword
15468 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15469 $cat >try.c <<'EOCP'
15472 typedef struct _goo_struct goo_struct;
15473 goo_struct * volatile goo = ((goo_struct *)0);
15474 struct _goo_struct {
15479 typedef unsigned short foo_t;
15480 char *volatile foo;
15482 volatile foo_t blech;
15486 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15488 echo "Yup, it does."
15491 echo "Nope, it doesn't."
15497 : Check basic sizes
15499 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15501 case "$use64bitint:$d_quad:$quadtype" in
15504 uvtype="$uquadtype"
15509 uvtype="unsigned long"
15515 case "$uselongdouble:$d_longdbl" in
15517 nvtype="long double"
15518 nvsize=$longdblsize
15525 $echo "(IV will be "$ivtype", $ivsize bytes)"
15526 $echo "(UV will be "$uvtype", $uvsize bytes)"
15527 $echo "(NV will be "$nvtype", $nvsize bytes)"
15530 #$i_inttypes I_INTTYPES
15532 #include <inttypes.h>
15537 int8_t i = INT8_MAX;
15538 uint8_t u = UINT8_MAX;
15539 printf("int8_t\n");
15542 int16_t i = INT16_MAX;
15543 uint16_t i = UINT16_MAX;
15544 printf("int16_t\n");
15547 int32_t i = INT32_MAX;
15548 uint32_t u = UINT32_MAX;
15549 printf("int32_t\n");
15554 i8type="signed char"
15555 u8type="unsigned char"
15560 '') case "$shortsize" in
15562 u16type="unsigned short"
15570 '') set try -DINT16
15571 if eval $compile; then
15572 case "`$run ./try`" in
15584 '') if $test $shortsize -ge 2; then
15586 u16type="unsigned short"
15594 '') case "$longsize" in
15596 u32type="unsigned long"
15600 *) case "$intsize" in
15602 u32type="unsigned int"
15612 '') set try -DINT32
15613 if eval $compile; then
15614 case "`$run ./try`" in
15626 '') if $test $intsize -ge 4; then
15628 u32type="unsigned int"
15636 '') case "$d_quad:$quadtype" in
15638 i64type="$quadtype"
15639 u64type="$uquadtype"
15647 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15648 : volatile so that the compiler has to store it out to memory.
15649 if test X"$d_volatile" = X"$define"; then
15654 #$i_stdlib I_STDLIB
15656 #include <stdlib.h>
15658 #include <sys/types.h>
15659 #include <signal.h>
15661 $volatile int bletched = 0;
15662 $signal_t blech(int s) { bletched = 1; }
15667 int n = 8 * $uvsize;
15670 signal(SIGFPE, blech);
15673 for (i = 0; i < n; i++) {
15674 u = u << 1 | ($uvtype)1;
15676 if (($uvtype)d != u)
15680 d = ($nvtype)(u - 1);
15681 if (($uvtype)d != (u - 1))
15688 printf("%d\n", ((i == n) ? -n : i));
15694 d_nv_preserves_uv="$undef"
15695 if eval $compile; then
15696 nv_preserves_uv_bits="`$run ./try`"
15698 case "$nv_preserves_uv_bits" in
15700 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15701 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15702 d_nv_preserves_uv="$define"
15704 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15705 d_nv_preserves_uv="$undef" ;;
15706 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15707 nv_preserves_uv_bits="0" ;;
15711 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15712 : volatile so that the compiler has to store it out to memory.
15713 if test X"$d_volatile" = X"$define"; then
15719 typedef $nvtype NV;
15726 while(count < 256) {
15727 $volatile NV up = value + 1.0;
15728 $volatile NV negated = -value;
15729 $volatile NV down = negated - 1.0;
15730 $volatile NV got_up = up - value;
15731 int up_good = got_up == 1.0;
15732 int got_down = down - negated;
15733 int down_good = got_down == -1.0;
15735 if (down_good != up_good) {
15737 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15738 up_good, (double) got_up, down_good, (double) got_down,
15739 count, (double) value);
15746 fputs("256.0", stdout);
15749 fputs("2.0", stdout);
15755 fputs("*", stdout);
15761 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15762 count, (double) value);
15768 nv_overflows_integers_at='0'
15769 if eval $compile; then
15775 The largest integer your NVs can preserve is equal to $xxx
15777 nv_overflows_integers_at="$xxx"
15780 Cannot determine the largest integer value your NVs can hold, unexpected output
15787 Cannot determine the largest integer value your NVs can hold
15794 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15795 : volatile so that the compiler has to store it out to memory.
15796 if test X"$d_volatile" = X"$define"; then
15801 #$i_stdlib I_STDLIB
15803 #include <stdlib.h>
15805 #$i_string I_STRING
15807 # include <string.h>
15809 # include <strings.h>
15811 #include <sys/types.h>
15812 #include <signal.h>
15814 $volatile int bletched = 0;
15815 $signal_t blech(int s) { bletched = 1; }
15818 int checkit($nvtype d, char *where) {
15819 unsigned char *p = (char *)&d;
15820 unsigned char *end = p + sizeof(d);
15830 printf("No - %s: 0x", where);
15832 printf ("%02X", *p++);
15837 int main(int argc, char **argv) {
15840 fail += checkit(d, "0.0");
15842 /* The compiler shouldn't be assuming that bletched is 0 */
15845 fail += checkit(d, "bleched");
15848 signal(SIGFPE, blech);
15851 /* Paranoia - the compiler should have no way of knowing that ANSI says
15852 that argv[argc] will always be NULL. Actually, if it did assume this it
15853 would be buggy, as this is C and main() can be called from elsewhere in
15855 d = argv[argc] ? 1 : 0;
15858 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15861 fail += checkit(d, "ternary");
15863 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15866 printf("No - memset doesn't give 0.0\n");
15867 /* This might just blow up: */
15868 printf("(gives %g)\n", d);
15874 printf("No - something bleched\n");
15879 printf("No - %d fail(s)\n", fail);
15888 d_nv_zero_is_allbits_zero="$undef"
15889 if eval $compile; then
15895 0.0 is represented as all bits zero in memory
15897 d_nv_zero_is_allbits_zero="$define"
15900 0.0 is not represented as all bits zero in memory
15902 d_nv_zero_is_allbits_zero="$undef"
15907 0.0 is not represented as all bits zero in memory
15909 d_nv_zero_is_allbits_zero="$undef"
15915 : check for off64_t
15917 echo "Checking to see if you have off64_t..." >&4
15919 #include <sys/types.h>
15920 #include <unistd.h>
15921 int main() { off64_t x = 7; }
15924 if eval $compile; then
15926 echo "You have off64_t."
15929 echo "You do not have off64_t."
15930 case "$lseeksize" in
15931 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15938 : how to create joinable pthreads
15939 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15941 echo "Checking what constant to use for creating joinable pthreads..." >&4
15942 $cat >try.c <<'EOCP'
15943 #include <pthread.h>
15945 int detachstate = JOINABLE;
15948 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15949 if eval $compile; then
15950 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15951 val="$undef" # Yes, undef.
15952 set d_old_pthread_create_joinable
15955 set old_pthread_create_joinable
15958 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15959 if eval $compile; then
15960 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15962 set d_old_pthread_create_joinable
15964 val=PTHREAD_CREATE_UNDETACHED
15965 set old_pthread_create_joinable
15968 set try -DJOINABLE=__UNDETACHED
15969 if eval $compile; then
15970 echo "You seem to use __UNDETACHED." >&4
15972 set d_old_pthread_create_joinable
15975 set old_pthread_create_joinable
15978 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15980 set d_old_pthread_create_joinable
15983 set old_pthread_create_joinable
15990 d_old_pthread_create_joinable="$undef"
15991 old_pthread_create_joinable=""
15994 : see if pause exists
15998 : see if poll exists
16002 : see if readlink exists
16003 set readlink d_readlink
16006 : Check if exe is symlink to abs path of executing program
16010 case "$d_readlink" in
16012 if $issymlink /proc/self/exe ; then
16013 $ls -l /proc/self/exe > reflect
16014 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16015 echo "You have Linux-like /proc/self/exe."
16016 procselfexe='"/proc/self/exe"'
16020 if $issymlink /proc/curproc/file ; then
16021 $ls -l /proc/curproc/file > reflect
16022 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16023 echo "You have BSD-like /proc/curproc/file."
16024 procselfexe='"/proc/curproc/file"'
16034 : backward compatibility for d_hvfork
16035 if test X$d_hvfork != X; then
16036 d_vfork="$d_hvfork"
16039 : see if there is a vfork
16044 d_pseudofork=$undef
16046 : Ok, but do we want to use it. vfork is reportedly unreliable in
16047 : perl on Solaris 2.x, and probably elsewhere.
16051 case "$usevfork" in
16057 Perl can only use a vfork() that doesn't suffer from strict
16058 restrictions on calling functions or modifying global data in
16059 the child. For example, glibc-2.1 contains such a vfork()
16060 that is unsuitable. If your system provides a proper fork()
16061 call, chances are that you do NOT want perl to use vfork().
16064 rp="Do you still want to use vfork()?"
16069 echo "Ok, we won't use vfork()."
16078 $define) usevfork='true';;
16079 *) usevfork='false';;
16082 : see whether the pthread_atfork exists
16084 #include <pthread.h>
16087 #ifdef PTHREAD_ATFORK
16088 pthread_atfork(NULL,NULL,NULL);
16093 : see if pthread_atfork exists
16094 set try -DPTHREAD_ATFORK
16095 if eval $compile; then
16100 case "$usethreads" in
16103 $define) echo 'pthread_atfork found.' >&4 ;;
16104 *) echo 'pthread_atfork NOT found.' >&4 ;;
16107 set d_pthread_atfork
16110 : see if pthread_attr_setscope exists
16111 set pthread_attr_setscope d_pthread_attr_setscope
16114 : see whether the various POSIXish _yields exist
16116 #include <pthread.h>
16122 #ifdef PTHREAD_YIELD
16125 #ifdef PTHREAD_YIELD_NULL
16126 pthread_yield(NULL);
16132 : see if sched_yield exists
16133 set try -DSCHED_YIELD
16134 if eval $compile; then
16136 sched_yield='sched_yield()'
16140 case "$usethreads" in
16143 $define) echo 'sched_yield() found.' >&4 ;;
16144 *) echo 'sched_yield() NOT found.' >&4 ;;
16150 : see if pthread_yield exists
16151 set try -DPTHREAD_YIELD
16152 if eval $compile; then
16154 case "$sched_yield" in
16155 '') sched_yield='pthread_yield()' ;;
16158 set try -DPTHREAD_YIELD_NULL
16159 if eval $compile; then
16161 case "$sched_yield" in
16162 '') sched_yield='pthread_yield(NULL)' ;;
16168 case "$usethreads" in
16171 $define) echo 'pthread_yield() found.' >&4 ;;
16172 *) echo 'pthread_yield() NOT found.' >&4 ;;
16176 set d_pthread_yield
16178 case "$sched_yield" in
16179 '') sched_yield=undef ;;
16183 : see if random_r exists
16184 set random_r d_random_r
16186 case "$d_random_r" in
16188 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16189 case "$d_random_r_proto:$usethreads" in
16190 ":define") d_random_r_proto=define
16191 set d_random_r_proto random_r $hdrs
16195 case "$d_random_r_proto" in
16197 case "$random_r_proto" in
16198 ''|0) try='int random_r(int*, struct random_data*);'
16199 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16201 case "$random_r_proto" in
16202 ''|0) try='int random_r(long*, struct random_data*);'
16203 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16205 case "$random_r_proto" in
16206 ''|0) try='int random_r(struct random_data*, int32_t*);'
16207 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16209 case "$random_r_proto" in
16210 ''|0) d_random_r=undef
16212 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16213 * ) case "$random_r_proto" in
16214 REENTRANT_PROTO*) ;;
16215 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16217 echo "Prototype: $try" ;;
16220 *) case "$usethreads" in
16221 define) echo "random_r has no prototype, not using it." >&4 ;;
16228 *) random_r_proto=0
16232 : see if readdir and friends exist
16233 set readdir d_readdir
16235 set seekdir d_seekdir
16237 set telldir d_telldir
16239 set rewinddir d_rewinddir
16242 : see if readdir64_r exists
16243 set readdir64_r d_readdir64_r
16245 case "$d_readdir64_r" in
16247 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16248 case "$d_readdir64_r_proto:$usethreads" in
16249 ":define") d_readdir64_r_proto=define
16250 set d_readdir64_r_proto readdir64_r $hdrs
16254 case "$d_readdir64_r_proto" in
16256 case "$readdir64_r_proto" in
16257 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16258 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16260 case "$readdir64_r_proto" in
16261 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16262 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16264 case "$readdir64_r_proto" in
16265 ''|0) d_readdir64_r=undef
16266 readdir64_r_proto=0
16267 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16268 * ) case "$readdir64_r_proto" in
16269 REENTRANT_PROTO*) ;;
16270 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16272 echo "Prototype: $try" ;;
16275 *) case "$usethreads" in
16276 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16278 d_readdir64_r=undef
16279 readdir64_r_proto=0
16283 *) readdir64_r_proto=0
16287 : see if readdir_r exists
16288 set readdir_r d_readdir_r
16290 case "$d_readdir_r" in
16292 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16293 case "$d_readdir_r_proto:$usethreads" in
16294 ":define") d_readdir_r_proto=define
16295 set d_readdir_r_proto readdir_r $hdrs
16299 case "$d_readdir_r_proto" in
16301 case "$readdir_r_proto" in
16302 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16303 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16305 case "$readdir_r_proto" in
16306 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16307 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16309 case "$readdir_r_proto" in
16310 ''|0) d_readdir_r=undef
16312 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16313 * ) case "$readdir_r_proto" in
16314 REENTRANT_PROTO*) ;;
16315 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16317 echo "Prototype: $try" ;;
16320 *) case "$usethreads" in
16321 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16328 *) readdir_r_proto=0
16332 : see if readv exists
16336 : see if recvmsg exists
16337 set recvmsg d_recvmsg
16340 : see if rename exists
16341 set rename d_rename
16344 : see if rmdir exists
16348 : see if memory.h is available.
16353 : See if it conflicts with string.h
16359 $cppstdin $cppflags $cppminus < $strings > mem.h
16360 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16362 echo "We won't be including <memory.h>."
16372 : can bcopy handle overlapping blocks?
16375 case "$d_memmove" in
16376 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16377 *) case "$d_bcopy" in
16379 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16381 #$i_memory I_MEMORY
16382 #$i_stdlib I_STDLIB
16383 #$i_string I_STRING
16384 #$i_unistd I_UNISTD
16386 $cat >>try.c <<'EOCP'
16389 # include <memory.h>
16392 # include <stdlib.h>
16395 # include <string.h>
16397 # include <strings.h>
16400 # include <unistd.h> /* Needed for NetBSD */
16404 char buf[128], abc[128];
16410 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16411 try to store the string in read-only memory. */
16412 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16414 for (align = 7; align >= 0; align--) {
16415 for (len = 36; len; len--) {
16417 bcopy(abc, b, len);
16418 for (off = 1; off <= len; off++) {
16419 bcopy(b, b+off, len);
16420 bcopy(b+off, b, len);
16421 if (bcmp(b, abc, len))
16430 if eval $compile_ok; then
16431 if $run ./try 2>/dev/null; then
16432 echo "Yes, it can."
16435 echo "It can't, sorry."
16438 echo "(I can't compile the test program, so we'll assume not...)"
16448 : can memcpy handle overlapping blocks?
16451 case "$d_memmove" in
16452 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16453 *) case "$d_memcpy" in
16455 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16457 #$i_memory I_MEMORY
16458 #$i_stdlib I_STDLIB
16459 #$i_string I_STRING
16460 #$i_unistd I_UNISTD
16462 $cat >>try.c <<'EOCP'
16465 # include <memory.h>
16468 # include <stdlib.h>
16471 # include <string.h>
16473 # include <strings.h>
16476 # include <unistd.h> /* Needed for NetBSD */
16480 char buf[128], abc[128];
16486 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16487 try to store the string in read-only memory. */
16488 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16490 for (align = 7; align >= 0; align--) {
16491 for (len = 36; len; len--) {
16493 memcpy(b, abc, len);
16494 for (off = 1; off <= len; off++) {
16495 memcpy(b+off, b, len);
16496 memcpy(b, b+off, len);
16497 if (memcmp(b, abc, len))
16506 if eval $compile_ok; then
16507 if $run ./try 2>/dev/null; then
16508 echo "Yes, it can."
16511 echo "It can't, sorry."
16514 echo "(I can't compile the test program, so we'll assume not...)"
16524 : can memcmp be trusted to compare relative magnitude?
16526 case "$d_memcmp" in
16529 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16531 #$i_memory I_MEMORY
16532 #$i_stdlib I_STDLIB
16533 #$i_string I_STRING
16534 #$i_unistd I_UNISTD
16536 $cat >>try.c <<'EOCP'
16539 # include <memory.h>
16542 # include <stdlib.h>
16545 # include <string.h>
16547 # include <strings.h>
16550 # include <unistd.h> /* Needed for NetBSD */
16556 if ((a < b) && memcmp(&a, &b, 1) < 0)
16562 if eval $compile_ok; then
16563 if $run ./try 2>/dev/null; then
16564 echo "Yes, it can."
16567 echo "No, it can't (it uses signed chars)."
16570 echo "(I can't compile the test program, so we'll assume not...)"
16578 : see if prototype for sbrk is available
16580 set d_sbrkproto sbrk $i_unistd unistd.h
16583 : see if select exists
16584 set select d_select
16587 : see if semctl exists
16588 set semctl d_semctl
16591 : see if semget exists
16592 set semget d_semget
16595 : see if semop exists
16599 : see how much of the 'sem*(2)' library is present.
16602 case "$d_semctl$d_semget$d_semop" in
16603 *"$undef"*) h_sem=false;;
16607 case "`ipcs 2>&1`" in
16608 "SVID messages"*"not configured"*)
16609 echo "Your $osname does not have the sem*(2) configured." >&4
16612 set semctl d_semctl
16614 set semget d_semget
16622 : we could also check for sys/ipc.h ...
16623 if $h_sem && $test `./findhdr sys/sem.h`; then
16624 echo "You have the full sem*(2) library." >&4
16627 echo "You don't have the full sem*(2) library." >&4
16633 : see whether sys/sem.h defines union semun
16635 $cat > try.c <<'END'
16636 #include <sys/types.h>
16637 #include <sys/ipc.h>
16638 #include <sys/sem.h>
16639 int main () { union semun semun; semun.buf = 0; }
16642 if eval $compile; then
16643 echo "You have union semun in <sys/sem.h>." >&4
16646 echo "You do not have union semun in <sys/sem.h>." >&4
16653 : see how to do semctl IPC_STAT
16657 $cat > tryh.h <<END
16660 # define S_IRUSR S_IREAD
16661 # define S_IWUSR S_IWRITE
16662 # define S_IXUSR S_IEXEC
16664 # define S_IRUSR 0400
16665 # define S_IWUSR 0200
16666 # define S_IXUSR 0100
16668 # define S_IRGRP (S_IRUSR>>3)
16669 # define S_IWGRP (S_IWUSR>>3)
16670 # define S_IXGRP (S_IXUSR>>3)
16671 # define S_IROTH (S_IRUSR>>6)
16672 # define S_IWOTH (S_IWUSR>>6)
16673 # define S_IXOTH (S_IXUSR>>6)
16676 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16677 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16678 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16681 : see whether semctl IPC_STAT can use union semun
16682 case "$d_semctl_semun" in
16686 #include <sys/types.h>
16687 #include <sys/ipc.h>
16688 #include <sys/sem.h>
16689 #include <sys/stat.h>
16696 #$d_union_semun HAS_UNION_SEMUN
16699 #ifndef HAS_UNION_SEMUN
16702 struct semid_ds *buf;
16703 unsigned short *array;
16709 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16710 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16712 struct semid_ds argbuf;
16715 st = semctl(sem, 0, IPC_STAT, arg);
16719 # endif /* IPC_STAT */
16720 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16722 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16723 # endif /* IPC_RMID */
16724 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16726 #endif /* IPC_PRIVATE && ... */
16727 printf("semget failed: errno = %d\n", errno);
16732 if eval $compile; then
16735 semun) val="$define" ;;
16743 case "$d_semctl_semun" in
16745 echo "You can use union semun for semctl IPC_STAT." >&4
16748 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16753 : see whether semctl IPC_STAT can use struct semid_ds pointer
16754 case "$d_semctl_semid_ds" in
16757 $cat > try.c <<'END'
16758 #include <sys/types.h>
16759 #include <sys/ipc.h>
16760 #include <sys/sem.h>
16761 #include <sys/stat.h>
16769 struct semid_ds arg;
16772 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16773 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16776 st = semctl(sem, 0, IPC_STAT, &arg);
16778 printf("semid_ds\n");
16780 # endif /* IPC_STAT */
16781 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16783 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16784 # endif /* IPC_RMID */
16785 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16787 #endif /* IPC_PRIVATE && ... */
16788 printf("semget failed: errno = %d\n", errno);
16794 if eval $compile; then
16797 semid_ds) val="$define" ;;
16801 set d_semctl_semid_ds
16805 case "$d_semctl_semid_ds" in
16807 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16809 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16815 # We do not have the full sem*(2) library, so assume we can not
16821 set d_semctl_semid_ds
16827 : see if sendmsg exists
16828 set sendmsg d_sendmsg
16831 : see if setegid exists
16832 set setegid d_setegid
16835 : see if seteuid exists
16836 set seteuid d_seteuid
16839 : see if setgrent exists
16840 set setgrent d_setgrent
16843 : see if setgrent_r exists
16844 set setgrent_r d_setgrent_r
16846 case "$d_setgrent_r" in
16848 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16849 case "$d_setgrent_r_proto:$usethreads" in
16850 ":define") d_setgrent_r_proto=define
16851 set d_setgrent_r_proto setgrent_r $hdrs
16855 case "$d_setgrent_r_proto" in
16857 case "$setgrent_r_proto" in
16858 ''|0) try='int setgrent_r(FILE**);'
16859 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
16861 case "$setgrent_r_proto" in
16862 ''|0) try='void setgrent_r(FILE**);'
16863 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
16865 case "$setgrent_r_proto" in
16866 ''|0) d_setgrent_r=undef
16868 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16869 * ) case "$setgrent_r_proto" in
16870 REENTRANT_PROTO*) ;;
16871 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16873 echo "Prototype: $try" ;;
16876 *) case "$usethreads" in
16877 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16884 *) setgrent_r_proto=0
16888 : see if sethostent exists
16889 set sethostent d_sethent
16892 : see if sethostent_r exists
16893 set sethostent_r d_sethostent_r
16895 case "$d_sethostent_r" in
16897 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16898 case "$d_sethostent_r_proto:$usethreads" in
16899 ":define") d_sethostent_r_proto=define
16900 set d_sethostent_r_proto sethostent_r $hdrs
16904 case "$d_sethostent_r_proto" in
16906 case "$sethostent_r_proto" in
16907 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16908 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
16910 case "$sethostent_r_proto" in
16911 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16912 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
16914 case "$sethostent_r_proto" in
16915 ''|0) d_sethostent_r=undef
16916 sethostent_r_proto=0
16917 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16918 * ) case "$sethostent_r_proto" in
16919 REENTRANT_PROTO*) ;;
16920 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16922 echo "Prototype: $try" ;;
16925 *) case "$usethreads" in
16926 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16928 d_sethostent_r=undef
16929 sethostent_r_proto=0
16933 *) sethostent_r_proto=0
16937 : see if setitimer exists
16938 set setitimer d_setitimer
16941 : see if setlinebuf exists
16942 set setlinebuf d_setlinebuf
16945 : see if setlocale exists
16946 set setlocale d_setlocale
16949 : see if locale.h is available
16950 set locale.h i_locale
16953 : see if setlocale_r exists
16954 set setlocale_r d_setlocale_r
16956 case "$d_setlocale_r" in
16958 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16959 case "$d_setlocale_r_proto:$usethreads" in
16960 ":define") d_setlocale_r_proto=define
16961 set d_setlocale_r_proto setlocale_r $hdrs
16965 case "$d_setlocale_r_proto" in
16967 case "$setlocale_r_proto" in
16968 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16969 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16971 case "$setlocale_r_proto" in
16972 ''|0) d_setlocale_r=undef
16973 setlocale_r_proto=0
16974 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16975 * ) case "$setlocale_r_proto" in
16976 REENTRANT_PROTO*) ;;
16977 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16979 echo "Prototype: $try" ;;
16982 *) case "$usethreads" in
16983 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16985 d_setlocale_r=undef
16986 setlocale_r_proto=0
16990 *) setlocale_r_proto=0
16994 : see if setnetent exists
16995 set setnetent d_setnent
16998 : see if setnetent_r exists
16999 set setnetent_r d_setnetent_r
17001 case "$d_setnetent_r" in
17003 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17004 case "$d_setnetent_r_proto:$usethreads" in
17005 ":define") d_setnetent_r_proto=define
17006 set d_setnetent_r_proto setnetent_r $hdrs
17010 case "$d_setnetent_r_proto" in
17012 case "$setnetent_r_proto" in
17013 ''|0) try='int setnetent_r(int, struct netent_data*);'
17014 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17016 case "$setnetent_r_proto" in
17017 ''|0) try='void setnetent_r(int, struct netent_data*);'
17018 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17020 case "$setnetent_r_proto" in
17021 ''|0) d_setnetent_r=undef
17022 setnetent_r_proto=0
17023 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17024 * ) case "$setnetent_r_proto" in
17025 REENTRANT_PROTO*) ;;
17026 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17028 echo "Prototype: $try" ;;
17031 *) case "$usethreads" in
17032 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17034 d_setnetent_r=undef
17035 setnetent_r_proto=0
17039 *) setnetent_r_proto=0
17043 : see if setprotoent exists
17044 set setprotoent d_setpent
17047 : see if setpgid exists
17048 set setpgid d_setpgid
17051 : see if setpgrp2 exists
17052 set setpgrp2 d_setpgrp2
17055 : see if setpriority exists
17056 set setpriority d_setprior
17059 : see if setproctitle exists
17060 set setproctitle d_setproctitle
17063 : see if setprotoent_r exists
17064 set setprotoent_r d_setprotoent_r
17066 case "$d_setprotoent_r" in
17068 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17069 case "$d_setprotoent_r_proto:$usethreads" in
17070 ":define") d_setprotoent_r_proto=define
17071 set d_setprotoent_r_proto setprotoent_r $hdrs
17075 case "$d_setprotoent_r_proto" in
17077 case "$setprotoent_r_proto" in
17078 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17079 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17081 case "$setprotoent_r_proto" in
17082 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17083 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17085 case "$setprotoent_r_proto" in
17086 ''|0) d_setprotoent_r=undef
17087 setprotoent_r_proto=0
17088 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17089 * ) case "$setprotoent_r_proto" in
17090 REENTRANT_PROTO*) ;;
17091 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17093 echo "Prototype: $try" ;;
17096 *) case "$usethreads" in
17097 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17099 d_setprotoent_r=undef
17100 setprotoent_r_proto=0
17104 *) setprotoent_r_proto=0
17108 : see if setpwent exists
17109 set setpwent d_setpwent
17112 : see if setpwent_r exists
17113 set setpwent_r d_setpwent_r
17115 case "$d_setpwent_r" in
17117 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17118 case "$d_setpwent_r_proto:$usethreads" in
17119 ":define") d_setpwent_r_proto=define
17120 set d_setpwent_r_proto setpwent_r $hdrs
17124 case "$d_setpwent_r_proto" in
17126 case "$setpwent_r_proto" in
17127 ''|0) try='int setpwent_r(FILE**);'
17128 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17130 case "$setpwent_r_proto" in
17131 ''|0) try='void setpwent_r(FILE**);'
17132 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17134 case "$setpwent_r_proto" in
17135 ''|0) d_setpwent_r=undef
17137 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17138 * ) case "$setpwent_r_proto" in
17139 REENTRANT_PROTO*) ;;
17140 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17142 echo "Prototype: $try" ;;
17145 *) case "$usethreads" in
17146 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17153 *) setpwent_r_proto=0
17157 : see if setregid exists
17158 set setregid d_setregid
17160 set setresgid d_setresgid
17163 : see if setreuid exists
17164 set setreuid d_setreuid
17166 set setresuid d_setresuid
17169 : see if setrgid exists
17170 set setrgid d_setrgid
17173 : see if setruid exists
17174 set setruid d_setruid
17177 : see if setservent exists
17178 set setservent d_setsent
17181 : see if setservent_r exists
17182 set setservent_r d_setservent_r
17184 case "$d_setservent_r" in
17186 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17187 case "$d_setservent_r_proto:$usethreads" in
17188 ":define") d_setservent_r_proto=define
17189 set d_setservent_r_proto setservent_r $hdrs
17193 case "$d_setservent_r_proto" in
17195 case "$setservent_r_proto" in
17196 ''|0) try='int setservent_r(int, struct servent_data*);'
17197 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17199 case "$setservent_r_proto" in
17200 ''|0) try='void setservent_r(int, struct servent_data*);'
17201 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17203 case "$setservent_r_proto" in
17204 ''|0) d_setservent_r=undef
17205 setservent_r_proto=0
17206 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17207 * ) case "$setservent_r_proto" in
17208 REENTRANT_PROTO*) ;;
17209 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17211 echo "Prototype: $try" ;;
17214 *) case "$usethreads" in
17215 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17217 d_setservent_r=undef
17218 setservent_r_proto=0
17222 *) setservent_r_proto=0
17226 : see if setsid exists
17227 set setsid d_setsid
17230 : see if setvbuf exists
17231 set setvbuf d_setvbuf
17234 : see if sfio.h is available
17238 : see if sfio library is available
17249 : Ok, but do we want to use it.
17253 true|$define|[yY]*) dflt='y';;
17256 echo "$package can use the sfio library, but it is experimental."
17257 case "$useperlio" in
17259 echo "For sfio also the PerlIO abstraction layer is needed."
17260 echo "Earlier you said you wouldn't want that."
17263 rp="You seem to have sfio available, do you want to try using it?"
17266 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
17267 useperlio="$define"
17270 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17275 *) case "$usesfio" in
17276 true|$define|[yY]*)
17277 echo "Sorry, cannot find sfio on this machine." >&4
17278 echo "Ignoring your setting of usesfio=$usesfio." >&4
17287 $define) usesfio='true';;
17288 *) usesfio='false';;
17292 *) : Remove sfio from list of libraries to use
17295 echo "Removing unneeded -lsfio from library list" >&4
17296 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17299 echo "libs = $libs" >&4
17306 : see if shmctl exists
17307 set shmctl d_shmctl
17310 : see if shmget exists
17311 set shmget d_shmget
17314 : see if shmat exists
17317 : see what shmat returns
17320 $cat >shmat.c <<'END'
17321 #include <sys/shm.h>
17324 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17329 echo "and it returns ($shmattype)." >&4
17330 : see if a prototype for shmat is available
17331 xxx=`./findhdr sys/shm.h`
17332 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17333 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17344 set d_shmatprototype
17347 : see if shmdt exists
17351 : see how much of the 'shm*(2)' library is present.
17354 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17355 *"$undef"*) h_shm=false;;
17359 case "`ipcs 2>&1`" in
17360 "SVID shared memory"*"not configured"*)
17361 echo "Your $osname does not have the shm*(2) configured." >&4
17364 set shmctl d_shmctl
17366 set shmget d_shmget
17376 : we could also check for sys/ipc.h ...
17377 if $h_shm && $test `./findhdr sys/shm.h`; then
17378 echo "You have the full shm*(2) library." >&4
17381 echo "You don't have the full shm*(2) library." >&4
17387 : see if we have sigaction
17389 if set sigaction val -f d_sigaction; eval $csym; $val; then
17390 echo 'sigaction() found.' >&4
17393 #include <sys/types.h>
17394 #include <signal.h>
17395 #$i_stdlib I_STDLIB
17397 #include <stdlib.h>
17401 struct sigaction act, oact;
17403 oact.sa_handler = 0;
17404 /* so that act and oact are used */
17405 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17409 if eval $compile_ok; then
17412 echo "But you don't seem to have a useable struct sigaction." >&4
17416 echo 'sigaction NOT found.' >&4
17419 set d_sigaction; eval $setvar
17422 : see if this is a sunmath.h system
17423 set sunmath.h i_sunmath
17426 : see if signbit exists
17427 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17430 #$i_sunmath I_SUNMATH
17434 #ifdef I_SUNMATH /* Solaris special math library */
17435 # include <sunmath.h>
17438 int main(int argc, char **argv)
17442 if ((signbit(x) == 0) && (signbit(y) != 0))
17450 if eval $compile; then
17451 if $run ./try; then
17455 $echo "Signbit seems to be available, but doesn't work as I expected."
17456 $echo "I won't use it." >&4
17467 : see if sigprocmask exists
17468 set sigprocmask d_sigprocmask
17471 : see if sigsetjmp exists
17473 case "$d_sigsetjmp" in
17476 #include <setjmp.h>
17477 #$i_stdlib I_STDLIB
17479 #include <stdlib.h>
17485 if (sigsetjmp(env,1))
17488 siglongjmp(env, 1);
17493 if eval $compile; then
17494 if $run ./try >/dev/null 2>&1; then
17495 echo "POSIX sigsetjmp found." >&4
17499 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17505 echo "sigsetjmp not found." >&4
17509 *) val="$d_sigsetjmp"
17510 case "$d_sigsetjmp" in
17511 $define) echo "POSIX sigsetjmp found." >&4;;
17512 $undef) echo "sigsetjmp not found." >&4;;
17520 : see if snprintf exists
17521 set snprintf d_snprintf
17524 : see if vsnprintf exists
17525 set vsnprintf d_vsnprintf
17528 case "$d_snprintf-$d_vsnprintf" in
17531 Checking whether your snprintf() and vsnprintf() work okay...
17533 $cat >try.c <<'EOCP'
17534 /* v?snprintf testing logic courtesy of Russ Allbery.
17535 * According to C99:
17536 * - if the buffer is too short it still must be \0-terminated
17537 * - if the buffer is too short the potentially required length
17538 * must be returned and not -1
17539 * - if the buffer is NULL the potentially required length
17540 * must be returned and not -1 or core dump
17543 #include <stdarg.h>
17547 int test (char *format, ...)
17552 va_start (args, format);
17553 count = vsnprintf (buf, sizeof buf, format, args);
17560 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17561 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17565 if eval $compile; then
17568 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17570 Your snprintf() and snprintf() don't seem to be working okay.
17572 d_snprintf="$undef"
17573 d_vsnprintf="$undef"
17577 echo "(I can't seem to compile the test program--assuming they don't)"
17578 d_snprintf="$undef"
17579 d_vsnprintf="$undef"
17585 : see if sockatmark exists
17586 set sockatmark d_sockatmark
17589 : see if prototype for sockatmark is available
17591 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17594 : see if socks5_init exists
17595 set socks5_init d_socks5_init
17598 : see if sprintf returns the length of the string in the buffer as per ANSI
17599 $echo "Checking whether sprintf returns the length of the string..." >&4
17602 #$i_stdlib I_STDLIB
17604 #include <stdlib.h>
17606 #$i_string I_STRING
17608 # include <string.h>
17610 # include <strings.h>
17619 int check (size_t expect, int test) {
17620 size_t got = strlen(buffer);
17624 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17629 int main(int argc, char **argv) {
17632 check(sprintf(buffer, ""), ++test);
17633 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17634 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17641 if eval $compile; then
17645 sprintf returns the length of the string (as ANSI says it should)
17647 d_sprintf_returns_strlen="$define"
17650 sprintf does not return the length of the string (how old is this system?)
17652 d_sprintf_returns_strlen="$undef"
17656 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17657 d_sprintf_returns_strlen="$undef"
17661 : see if srand48_r exists
17662 set srand48_r d_srand48_r
17664 case "$d_srand48_r" in
17666 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17667 case "$d_srand48_r_proto:$usethreads" in
17668 ":define") d_srand48_r_proto=define
17669 set d_srand48_r_proto srand48_r $hdrs
17673 case "$d_srand48_r_proto" in
17675 case "$srand48_r_proto" in
17676 ''|0) try='int srand48_r(long, struct drand48_data*);'
17677 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17679 case "$srand48_r_proto" in
17680 ''|0) d_srand48_r=undef
17682 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17683 * ) case "$srand48_r_proto" in
17684 REENTRANT_PROTO*) ;;
17685 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17687 echo "Prototype: $try" ;;
17690 *) case "$usethreads" in
17691 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17698 *) srand48_r_proto=0
17702 : see if srandom_r exists
17703 set srandom_r d_srandom_r
17705 case "$d_srandom_r" in
17707 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17708 case "$d_srandom_r_proto:$usethreads" in
17709 ":define") d_srandom_r_proto=define
17710 set d_srandom_r_proto srandom_r $hdrs
17714 case "$d_srandom_r_proto" in
17716 case "$srandom_r_proto" in
17717 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17718 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
17720 case "$srandom_r_proto" in
17721 ''|0) d_srandom_r=undef
17723 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17724 * ) case "$srandom_r_proto" in
17725 REENTRANT_PROTO*) ;;
17726 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17728 echo "Prototype: $try" ;;
17731 *) case "$usethreads" in
17732 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17739 *) srandom_r_proto=0
17743 : see if prototype for setresgid is available
17745 set d_sresgproto setresgid $i_unistd unistd.h
17748 : see if prototype for setresuid is available
17750 set d_sresuproto setresuid $i_unistd unistd.h
17753 : see if sys/stat.h is available
17754 set sys/stat.h i_sysstat
17757 : see if stat knows about block sizes
17759 echo "Checking to see if your struct stat has st_blocks field..." >&4
17760 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17763 : see if this is a sys/vfs.h system
17764 set sys/vfs.h i_sysvfs
17767 : see if this is a sys/statfs.h system
17768 set sys/statfs.h i_sysstatfs
17771 : Check for statfs_s
17773 echo "Checking to see if your system supports struct statfs..." >&4
17774 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
17776 case "$d_statfs_s" in
17777 "$define") echo "Yes, it does." ;;
17778 *) echo "No, it doesn't." ;;
17782 : see if struct statfs knows about f_flags
17783 case "$d_statfs_s" in
17786 echo "Checking to see if your struct statfs has f_flags field..." >&4
17787 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
17791 set d_statfs_f_flags
17795 case "$d_statfs_f_flags" in
17796 "$define") echo "Yes, it does." ;;
17797 *) echo "No, it doesn't." ;;
17800 : Check stream access
17802 Checking how to access stdio streams by file descriptor number...
17804 case "$stdio_stream_array" in
17805 '') $cat >try.c <<EOCP
17808 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17812 for s in _iob __iob __sF
17814 set try -DSTDIO_STREAM_ARRAY=$s
17815 if eval $compile; then
17816 case "`$run ./try`" in
17817 yes) stdio_stream_array=$s; break ;;
17823 case "$stdio_stream_array" in
17825 I can't figure out how to access stdio streams by file descriptor number.
17827 d_stdio_stream_array="$undef"
17830 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17832 d_stdio_stream_array="$define"
17836 : see if strcoll exists
17837 set strcoll d_strcoll
17840 : check for structure copying
17842 echo "Checking to see if your C compiler can copy structs..." >&4
17843 $cat >try.c <<'EOCP'
17853 if $cc -c try.c >/dev/null 2>&1 ; then
17855 echo "Yup, it can."
17858 echo "Nope, it can't."
17864 : see if strerror and/or sys_errlist[] exist
17866 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17867 if set strerror val -f d_strerror; eval $csym; $val; then
17868 echo 'strerror() found.' >&4
17869 d_strerror="$define"
17870 d_strerrm='strerror(e)'
17871 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17872 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17873 d_syserrlst="$define"
17875 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17876 d_syserrlst="$undef"
17878 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17879 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17880 echo 'strerror() found in string header.' >&4
17881 d_strerror="$define"
17882 d_strerrm='strerror(e)'
17883 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17884 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17885 d_syserrlst="$define"
17887 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17888 d_syserrlst="$undef"
17890 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17891 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17892 d_strerror="$undef"
17893 d_syserrlst="$define"
17894 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17896 echo 'strerror() and sys_errlist[] NOT found.' >&4
17897 d_strerror="$undef"
17898 d_syserrlst="$undef"
17899 d_strerrm='"unknown"'
17903 : see if strerror_r exists
17904 set strerror_r d_strerror_r
17906 case "$d_strerror_r" in
17908 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17909 case "$d_strerror_r_proto:$usethreads" in
17910 ":define") d_strerror_r_proto=define
17911 set d_strerror_r_proto strerror_r $hdrs
17915 case "$d_strerror_r_proto" in
17917 case "$strerror_r_proto" in
17918 ''|0) try='int strerror_r(int, char*, size_t);'
17919 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
17921 case "$strerror_r_proto" in
17922 ''|0) try='int strerror_r(int, char*, int);'
17923 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
17925 case "$strerror_r_proto" in
17926 ''|0) try='char* strerror_r(int, char*, size_t);'
17927 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
17929 case "$strerror_r_proto" in
17930 ''|0) d_strerror_r=undef
17932 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17933 * ) case "$strerror_r_proto" in
17934 REENTRANT_PROTO*) ;;
17935 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17937 echo "Prototype: $try" ;;
17940 *) case "$usethreads" in
17941 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17948 *) strerror_r_proto=0
17952 : see if strftime exists
17953 set strftime d_strftime
17956 : see if strlcat exists
17957 set strlcat d_strlcat
17960 : see if strlcpy exists
17961 set strlcpy d_strlcpy
17964 : see if strtod exists
17965 set strtod d_strtod
17968 : see if strtol exists
17969 set strtol d_strtol
17972 : see if strtold exists
17973 set strtold d_strtold
17976 : see if strtoll exists
17977 set strtoll d_strtoll
17980 case "$d_longlong-$d_strtoll" in
17983 Checking whether your strtoll() works okay...
17985 $cat >try.c <<'EOCP'
17988 #define strtoll __strtoll
17991 #define strtoll _strtoll
17994 extern long long int strtoll(char *s, char **, int);
17995 static int bad = 0;
17996 int check(char *s, long long ell, int een) {
17999 gll = strtoll(s, 0, 10);
18000 if (!((gll == ell) && (errno == een)))
18004 check(" 1", 1LL, 0);
18005 check(" 0", 0LL, 0);
18006 check("-1", -1LL, 0);
18007 check("-9223372036854775808", -9223372036854775808LL, 0);
18008 check("-9223372036854775808", -9223372036854775808LL, 0);
18009 check(" 9223372036854775807", 9223372036854775807LL, 0);
18010 check("-9223372036854775808", -9223372036854775808LL, 0);
18011 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18012 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18018 if eval $compile; then
18021 ok) echo "Your strtoll() seems to be working okay." ;;
18023 Your strtoll() doesn't seem to be working okay.
18029 echo "(I can't seem to compile the test program--assuming it doesn't)"
18035 : see if strtoq exists
18036 set strtoq d_strtoq
18039 : see if strtoul exists
18040 set strtoul d_strtoul
18043 case "$d_strtoul" in
18046 Checking whether your strtoul() works okay...
18048 $cat >try.c <<'EOCP'
18051 extern unsigned long int strtoul(char *s, char **, int);
18052 static int bad = 0;
18053 void check(char *s, unsigned long eul, int een) {
18056 gul = strtoul(s, 0, 10);
18057 if (!((gul == eul) && (errno == een)))
18061 check(" 1", 1L, 0);
18062 check(" 0", 0L, 0);
18064 case "$longsize" in
18066 $cat >>try.c <<'EOCP'
18067 check("18446744073709551615", 18446744073709551615UL, 0);
18068 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18069 #if 0 /* strtoul() for /^-/ strings is undefined. */
18070 check("-1", 18446744073709551615UL, 0);
18071 check("-18446744073709551614", 2, 0);
18072 check("-18446744073709551615", 1, 0);
18073 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18074 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18079 $cat >>try.c <<'EOCP'
18080 check("4294967295", 4294967295UL, 0);
18081 check("4294967296", 4294967295UL, ERANGE);
18082 #if 0 /* strtoul() for /^-/ strings is undefined. */
18083 check("-1", 4294967295UL, 0);
18084 check("-4294967294", 2, 0);
18085 check("-4294967295", 1, 0);
18086 check("-4294967296", 4294967295UL, ERANGE);
18087 check("-4294967297", 4294967295UL, ERANGE);
18092 : Should we write these tests to be more portable by sprintf-ing
18093 : ~0 and then manipulating that char string as input for strtol?
18096 $cat >>try.c <<'EOCP'
18103 if eval $compile; then
18104 case "`$run ./try`" in
18105 ok) echo "Your strtoul() seems to be working okay." ;;
18107 Your strtoul() doesn't seem to be working okay.
18113 echo "(I can't seem to compile the test program--assuming it doesn't)"
18119 : see if strtoull exists
18120 set strtoull d_strtoull
18123 case "$d_longlong-$d_strtoull" in
18126 Checking whether your strtoull() works okay...
18128 $cat >try.c <<'EOCP'
18131 #define strtoull __strtoull
18134 extern unsigned long long int strtoull(char *s, char **, int);
18135 static int bad = 0;
18136 int check(char *s, long long eull, int een) {
18139 gull = strtoull(s, 0, 10);
18140 if (!((gull == eull) && (errno == een)))
18144 check(" 1", 1LL, 0);
18145 check(" 0", 0LL, 0);
18146 check("18446744073709551615", 18446744073709551615ULL, 0);
18147 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18148 #if 0 /* strtoull() for /^-/ strings is undefined. */
18149 check("-1", 18446744073709551615ULL, 0);
18150 check("-18446744073709551614", 2LL, 0);
18151 check("-18446744073709551615", 1LL, 0);
18152 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18153 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18160 if eval $compile; then
18161 case "`$run ./try`" in
18162 ok) echo "Your strtoull() seems to be working okay." ;;
18164 Your strtoull() doesn't seem to be working okay.
18166 d_strtoull="$undef"
18170 echo "(I can't seem to compile the test program--assuming it doesn't)"
18171 d_strtoull="$undef"
18176 : see if strtouq exists
18177 set strtouq d_strtouq
18180 case "$d_strtouq" in
18183 Checking whether your strtouq() works okay...
18185 $cat >try.c <<'EOCP'
18188 extern unsigned long long int strtouq(char *s, char **, int);
18189 static int bad = 0;
18190 void check(char *s, unsigned long long eull, int een) {
18191 unsigned long long gull;
18193 gull = strtouq(s, 0, 10);
18194 if (!((gull == eull) && (errno == een)))
18198 check(" 1", 1LL, 0);
18199 check(" 0", 0LL, 0);
18200 check("18446744073709551615", 18446744073709551615ULL, 0);
18201 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18202 #if 0 /* strtouq() for /^-/ strings is undefined. */
18203 check("-1", 18446744073709551615ULL, 0);
18204 check("-18446744073709551614", 2LL, 0);
18205 check("-18446744073709551615", 1LL, 0);
18206 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18207 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18215 if eval $compile; then
18216 case "`$run ./try`" in
18217 ok) echo "Your strtouq() seems to be working okay." ;;
18219 Your strtouq() doesn't seem to be working okay.
18225 echo "(I can't seem to compile the test program--assuming it doesn't)"
18231 : see if strxfrm exists
18232 set strxfrm d_strxfrm
18235 : see if symlink exists
18236 set symlink d_symlink
18239 : see if syscall exists
18240 set syscall d_syscall
18243 : see if prototype for syscall is available
18245 set d_syscallproto syscall $i_unistd unistd.h
18248 : see if sysconf exists
18249 set sysconf d_sysconf
18252 : see if system exists
18253 set system d_system
18256 : see if tcgetpgrp exists
18257 set tcgetpgrp d_tcgetpgrp
18260 : see if tcsetpgrp exists
18261 set tcsetpgrp d_tcsetpgrp
18264 : see if prototype for telldir is available
18266 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18269 : see if time exists
18271 if test "X$d_time" = X -o X"$timetype" = X; then
18272 if set time val -f d_time; eval $csym; $val; then
18273 echo 'time() found.' >&4
18275 rp="What is the type returned by time() on this system?"
18276 set time_t timetype long stdio.h sys/types.h
18279 echo 'time() not found, hope that will do.' >&4
18287 : see if timegm exists
18288 set timegm d_timegm
18291 : see if this is a sys/times.h system
18292 set sys/times.h i_systimes
18295 : see if times exists
18297 if set times val -f d_times; eval $csym; $val; then
18298 echo 'times() found.' >&4
18301 case "$i_systimes" in
18302 "$define") inc='sys/times.h';;
18304 rp="What is the type returned by times() on this system?"
18305 set clock_t clocktype long stdio.h sys/types.h $inc
18308 echo 'times() NOT found, hope that will do.' >&4
18313 : see if tmpnam_r exists
18314 set tmpnam_r d_tmpnam_r
18316 case "$d_tmpnam_r" in
18318 hdrs="$i_systypes sys/types.h define stdio.h "
18319 case "$d_tmpnam_r_proto:$usethreads" in
18320 ":define") d_tmpnam_r_proto=define
18321 set d_tmpnam_r_proto tmpnam_r $hdrs
18325 case "$d_tmpnam_r_proto" in
18327 case "$tmpnam_r_proto" in
18328 ''|0) try='char* tmpnam_r(char*);'
18329 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18331 case "$tmpnam_r_proto" in
18332 ''|0) d_tmpnam_r=undef
18334 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18335 * ) case "$tmpnam_r_proto" in
18336 REENTRANT_PROTO*) ;;
18337 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18339 echo "Prototype: $try" ;;
18342 *) case "$usethreads" in
18343 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18350 *) tmpnam_r_proto=0
18354 : see if truncate exists
18355 set truncate d_truncate
18358 : see if ttyname_r exists
18359 set ttyname_r d_ttyname_r
18361 case "$d_ttyname_r" in
18363 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18364 case "$d_ttyname_r_proto:$usethreads" in
18365 ":define") d_ttyname_r_proto=define
18366 set d_ttyname_r_proto ttyname_r $hdrs
18370 case "$d_ttyname_r_proto" in
18372 case "$ttyname_r_proto" in
18373 ''|0) try='int ttyname_r(int, char*, size_t);'
18374 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18376 case "$ttyname_r_proto" in
18377 ''|0) try='int ttyname_r(int, char*, int);'
18378 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18380 case "$ttyname_r_proto" in
18381 ''|0) try='char* ttyname_r(int, char*, int);'
18382 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18384 case "$ttyname_r_proto" in
18385 ''|0) d_ttyname_r=undef
18387 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18388 * ) case "$ttyname_r_proto" in
18389 REENTRANT_PROTO*) ;;
18390 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18392 echo "Prototype: $try" ;;
18395 *) case "$usethreads" in
18396 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18403 *) ttyname_r_proto=0
18407 : see if tzname[] exists
18409 if set tzname val -a d_tzname; eval $csym; $val; then
18411 echo 'tzname[] found.' >&4
18414 echo 'tzname[] NOT found.' >&4
18419 : Check if is a multiplatform env
18421 next|rhapsody|darwin) multiarch="$define" ;;
18423 case "$multiarch" in
18424 ''|[nN]*) multiarch="$undef" ;;
18427 : check for ordering of bytes in a UV
18429 case "$usecrosscompile$multiarch" in
18432 You seem to be either cross-compiling or doing a multiarchitecture build,
18433 skipping the byteorder check.
18439 case "$byteorder" in
18442 In the following, larger digits indicate more significance. A big-endian
18443 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18444 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18445 machines may have weird orders like 3412. A Cray will report 87654321,
18446 an Alpha will report 12345678. If the test program works the default is
18448 I'm now running the test program...
18452 #$i_stdlib I_STDLIB
18454 #include <stdlib.h>
18456 #include <sys/types.h>
18457 typedef $uvtype UV;
18467 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18469 u.l = (UV)0x04030201;
18470 for (i = 0; i < $uvsize; i++)
18471 printf("%c", u.c[i]+'0');
18478 if eval $compile && $run ./try > /dev/null; then
18481 [1-4][1-4][1-4][1-4]|12345678|87654321)
18482 echo "(The test program ran ok.)"
18483 echo "byteorder=$dflt"
18486 ????|????????) echo "(The test program ran ok.)" ;;
18487 *) echo "(The test program didn't run right for some reason.)" ;;
18492 (I can't seem to compile the test program. Guessing big-endian...)
18495 case "$xxx_prompt" in
18497 rp="What is the order of bytes in $uvtype?"
18510 : Checking 32bit aligndness
18513 Checking to see whether you can access character data unalignedly...
18515 case "$d_u32align" in
18516 '') $cat >try.c <<EOCP
18518 #$i_stdlib I_STDLIB
18520 #include <stdlib.h>
18522 #define U32 $u32type
18523 #define BYTEORDER 0x$byteorder
18525 #include <signal.h>
18527 $signal_t bletch(int s) { exit(4); }
18530 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18535 if (sizeof(U32) != 4) {
18536 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18543 signal(SIGBUS, bletch);
18555 for (i = 0; i < 4; i++) {
18556 up = (U32*)(buf + i);
18557 if (! ((*up == 1 << (8*i)) || /* big-endian */
18558 (*up == 1 << (8*(3-i))) /* little-endian */
18562 printf("read failed (%x)\n", *up);
18568 for (i = 0; i < 4; i++) {
18569 up = (U32*)(buf + i);
18571 if (*up != 0xBeef) {
18572 printf("write failed (%x)\n", *up);
18586 if eval $compile_ok; then
18587 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18588 $run ./try 2>&1 >/dev/null
18591 You can access character data pretty unalignedly.
18593 d_u32align="$undef"
18596 It seems that you must access character data in an aligned manner.
18598 d_u32align="$define"
18602 rp='Can you access character data at unaligned addresses?'
18606 [yY]*) d_u32align="$undef" ;;
18607 *) d_u32align="$define" ;;
18614 : see if ualarm exists
18615 set ualarm d_ualarm
18618 : see if umask exists
18622 : see if unordered exists
18623 set unordered d_unordered
18626 : see if unsetenv exists
18627 set unsetenv d_unsetenv
18630 : see if usleep exists
18631 set usleep d_usleep
18634 : see if prototype for usleep is available
18636 set d_usleepproto usleep $i_unistd unistd.h
18639 : see if ustat exists
18643 : see if closedir exists
18644 set closedir d_closedir
18647 case "$d_closedir" in
18650 echo "Checking whether closedir() returns a status..." >&4
18652 #$i_dirent I_DIRENT /**/
18653 #$i_sysdir I_SYS_DIR /**/
18654 #$i_sysndir I_SYS_NDIR /**/
18655 #$i_systypes I_SYS_TYPES /**/
18657 #if defined(I_SYS_TYPES)
18658 #include <sys/types.h>
18660 #if defined(I_DIRENT)
18661 #include <dirent.h>
18662 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18663 #include <sys/dir.h>
18667 #include <sys/ndir.h>
18671 #include <ndir.h> /* may be wrong in the future */
18673 #include <sys/dir.h>
18678 int main() { return closedir(opendir(".")); }
18681 if eval $compile_ok; then
18682 if $run ./try > /dev/null 2>&1 ; then
18683 echo "Yes, it does."
18686 echo "No, it doesn't."
18690 echo "(I can't seem to compile the test program--assuming it doesn't)"
18698 set d_void_closedir
18702 : see if there is a wait4
18706 : see if waitpid exists
18707 set waitpid d_waitpid
18710 : see if wcstombs exists
18711 set wcstombs d_wcstombs
18714 : see if wctomb exists
18715 set wctomb d_wctomb
18718 : see if writev exists
18719 set writev d_writev
18722 : preserve RCS keywords in files with variable substitution, grrr
18727 Revision='$Revision'
18729 : check for alignment requirements
18731 case "$usecrosscompile$multiarch" in
18734 You seem to be either cross-compiling or doing a multiarchitecture build,
18735 skipping the memory alignment check.
18738 case "$alignbytes" in
18739 '') alignbytes=8 ;;
18743 case "$alignbytes" in
18744 '') echo "Checking alignment constraints..." >&4
18745 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18746 $cat >try.c <<'EOCP'
18747 typedef long double NV;
18750 $cat >try.c <<'EOCP'
18754 $cat >>try.c <<'EOCP'
18762 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18767 if eval $compile_ok; then
18771 echo "(I can't seem to compile the test program...)"
18774 *) dflt="$alignbytes"
18777 rp="Doubles must be aligned on a how-many-byte boundary?"
18785 : set the base revision
18788 : how do we concatenate cpp tokens here?
18790 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18791 $cat >cpp_stuff.c <<'EOCP'
18792 #define RCAT(a,b)a/**/b
18793 #define ACAT(a,b)a ## b
18797 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18798 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18799 echo "Oh! Smells like ANSI's been here." >&4
18800 echo "We can catify or stringify, separately or together!"
18802 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18803 echo "Ah, yes! The good old days!" >&4
18804 echo "However, in the good old days we don't know how to stringify and"
18805 echo "catify at the same time."
18809 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18810 You're going to have to edit the values of CAT[2-5] in config.h...
18812 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18816 : see if this is a db.h system
18822 : Check db version.
18824 echo "Checking Berkeley DB version ..." >&4
18830 #include <sys/types.h>
18832 #$i_stdlib I_STDLIB
18834 #include <stdlib.h>
18837 int main(int argc, char *argv[])
18839 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18840 int Major, Minor, Patch ;
18841 unsigned long Version ;
18842 (void)db_version(&Major, &Minor, &Patch) ;
18844 printf("%d %d %d %d %d %d\n",
18845 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18846 Major, Minor, Patch);
18849 printf("You have Berkeley DB Version 2 or greater.\n");
18851 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18852 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18853 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18854 Major, Minor, Patch) ;
18856 /* check that db.h & libdb are compatible */
18857 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18858 printf("db.h and libdb are incompatible.\n") ;
18862 printf("db.h and libdb are compatible.\n") ;
18864 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18865 + DB_VERSION_PATCH ;
18867 /* needs to be >= 2.3.4 */
18868 if (Version < 2003004) {
18869 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18870 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18876 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18881 printf("You have Berkeley DB Version 1.\n");
18882 exit(0); /* DB version < 2: the coast is clear. */
18884 exit(1); /* <db.h> not Berkeley DB? */
18890 if eval $compile_ok && $run ./try; then
18891 echo 'Looks OK.' >&4
18893 db_version_major=$1
18894 db_version_minor=$2
18895 db_version_patch=$3
18897 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18901 : Remove db from list of libraries to use
18902 echo "Removing unusable -ldb from library list" >&4
18903 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18906 echo "libs = $libs" >&4
18916 : Check the return type needed for hash
18918 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18924 #include <sys/types.h>
18927 #ifndef DB_VERSION_MAJOR
18928 u_int32_t hash_cb (ptr, size)
18936 info.hash = hash_cb;
18940 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18941 if $contains warning try.out >>/dev/null 2>&1 ; then
18944 db_hashtype='u_int32_t'
18947 : XXX Maybe we should just give up here.
18948 db_hashtype=u_int32_t
18950 echo "Help: I can't seem to compile the db test program." >&4
18951 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18954 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18956 *) db_hashtype=u_int32_t
18961 : Check the return type needed for prefix
18963 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18969 #include <sys/types.h>
18972 #ifndef DB_VERSION_MAJOR
18973 size_t prefix_cb (key1, key2)
18981 info.prefix = prefix_cb;
18985 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18986 if $contains warning try.out >>/dev/null 2>&1 ; then
18987 db_prefixtype='int'
18989 db_prefixtype='size_t'
18992 db_prefixtype='size_t'
18993 : XXX Maybe we should just give up here.
18995 echo "Help: I can't seem to compile the db test program." >&4
18996 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18999 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19001 *) db_prefixtype='size_t'
19005 : How can we generate normalized random numbers ?
19007 echo "Looking for a random number function..." >&4
19008 case "$randfunc" in
19010 if set drand48 val -f; eval $csym; $val; then
19012 echo "Good, found drand48()." >&4
19013 elif set random val -f; eval $csym; $val; then
19015 echo "OK, found random()." >&4
19018 echo "Yick, looks like I have to use rand()." >&4
19029 *-Dmy_rand=*|*-Dmy_srand=*)
19030 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19031 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19032 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19033 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19037 while $test "$cont"; do
19038 rp="Use which function to generate random numbers?"
19040 if $test "$ans" = "$dflt"; then
19046 if set $ans val -f; eval $csym; $val; then
19050 rp="I cannot find function $ans. Use that name anyway?"
19059 case "$randfunc" in
19061 drand01="drand48()"
19067 case "$randbits" in
19069 echo "Checking to see how many bits your $randfunc() function produces..." >&4
19071 #$i_unistd I_UNISTD
19072 #$i_stdlib I_STDLIB
19075 # include <unistd.h>
19078 # include <stdlib.h>
19083 register unsigned long tmp;
19084 register unsigned long max = 0L;
19086 for (i = 1000; i; i--) {
19087 tmp = (unsigned long) $randfunc();
19088 if (tmp > max) max = tmp;
19090 for (i = 0; max; i++)
19096 if eval $compile_ok; then
19100 echo "(I can't seem to compile the test program...)"
19107 rp="How many bits does your $randfunc() function produce?"
19111 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19112 seedfunc="s$randfunc"
19113 randseedtype=unsigned
19117 rp="How many bits does your $randfunc() function produce?"
19120 seedfunc="s$randfunc"
19121 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19122 if set $seedfunc val -f; eval $csym; $val; then
19123 echo "(Using $seedfunc() to seed random generator)"
19125 echo "(Warning: no $seedfunc() to seed random generator)"
19128 randseedtype=unsigned
19135 : Determine if this is an EBCDIC system
19137 echo "Determining whether or not we are on an EBCDIC system..." >&4
19138 $cat >try.c <<'EOM'
19141 if ('M'==0xd4) return 0;
19148 if eval $compile_ok; then
19149 if $run ./try; then
19150 echo "You seem to speak EBCDIC." >&4
19153 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19156 echo "I'm unable to compile the test program." >&4
19157 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19163 : Check how to flush
19166 Checking how to flush all pending stdio output...
19168 # I only know how to find the first 32 possibly open files on SunOS.
19169 # See also hints/sunos_4_1.sh and util.c --AD
19171 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19173 $cat >>try.c <<EOCP
19175 #$i_stdlib I_STDLIB
19177 #include <stdlib.h>
19179 #$i_unistd I_UNISTD
19181 # include <unistd.h>
19183 #$d_sysconf HAS_SYSCONF
19184 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19185 #ifdef HAS_STDIO_STREAM_ARRAY
19186 # define STDIO_STREAM_ARRAY $stdio_stream_array
19191 p = fopen("try.out", "w");
19195 # ifdef TRY_FPRINTF
19199 #ifdef TRY_FFLUSH_NULL
19202 #ifdef TRY_FFLUSH_ALL
19204 long open_max = -1;
19205 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19206 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19208 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19209 open_max = sysconf(_SC_OPEN_MAX);
19212 open_max = FOPEN_MAX;
19215 open_max = OPEN_MAX;
19224 # ifdef HAS_STDIO_STREAM_ARRAY
19225 if (open_max > 0) {
19227 for (i = 0; i < open_max; i++)
19228 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19229 STDIO_STREAM_ARRAY[i]._file < open_max &&
19230 STDIO_STREAM_ARRAY[i]._flag)
19231 fflush(&STDIO_STREAM_ARRAY[i]);
19239 : first we have to find out how _not_ to flush
19241 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19243 set try -DTRY_FPUTC
19244 if eval $compile; then
19245 $run ./try 2>/dev/null
19248 if $test ! -s try.out -a "X$code" = X42; then
19254 set try -DTRY_FPRINTF
19255 if eval $compile; then
19256 $run ./try 2>/dev/null
19259 if $test ! -s try.out -a "X$code" = X42; then
19260 output=-DTRY_FPRINTF
19266 : check for fflush NULL behaviour
19267 case "$fflushNULL" in
19268 '') set try -DTRY_FFLUSH_NULL $output
19269 if eval $compile; then
19270 $run ./try 2>/dev/null
19273 if $test -s try.out -a "X$code" = X42; then
19274 fflushNULL="`$cat try.out`"
19276 if $test "X$code" != X42; then
19278 (If this test failed, don't worry, we'll try another method shortly.)
19283 $rm -f core try.core core.try.*
19284 case "$fflushNULL" in
19286 Your fflush(NULL) works okay for output streams.
19287 Let's see if it clobbers input pipes...
19289 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19290 # bug that improperly flushes the input end of pipes. So we avoid the
19291 # autoflush on fork/system/exec support for now. :-(
19292 $cat >tryp.c <<EOCP
19295 main(int argc, char **argv)
19301 while ((i = getc(stdin)) != -1
19302 && (*bp++ = i) != '\n'
19303 && bp < &buf[1024])
19306 fprintf(stdout, "%s", buf);
19314 fflushNULL="$define"
19316 if eval $compile; then
19318 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19319 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19321 fflush(NULL) seems to behave okay with input streams.
19323 fflushNULL="$define"
19326 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19328 fflushNULL="$undef"
19331 $rm -f core tryp.c tryp.core core.tryp.*
19334 Your fflush(NULL) isn't working (contrary to ANSI C).
19336 fflushNULL="$undef"
19339 Cannot figure out whether your fflush(NULL) works or not.
19340 I'm assuming it doesn't (contrary to ANSI C).
19342 fflushNULL="$undef"
19346 $define|true|[yY]*)
19347 fflushNULL="$define"
19350 fflushNULL="$undef"
19353 : check explicit looping only if NULL did not work, and if the pipe
19354 : bug does not show up on an explicit flush too
19355 case "$fflushNULL" in
19357 $cat >tryp.c <<EOCP
19360 main(int argc, char **argv)
19366 while ((i = getc(stdin)) != -1
19367 && (*bp++ = i) != '\n'
19368 && bp < &buf[1024])
19371 fprintf(stdout, "%s", buf);
19380 if eval $compile; then
19382 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19383 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19385 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19387 : now check for fflushall behaviour
19388 case "$fflushall" in
19389 '') set try -DTRY_FFLUSH_ALL $output
19390 if eval $compile; then
19392 (Now testing the other method--but note that this also may fail.)
19394 $run ./try 2>/dev/null
19397 if $test -s try.out -a "X$code" = X42; then
19398 fflushall="`$cat try.out`"
19402 case "$fflushall" in
19404 Whew. Flushing explicitly all the stdio streams works.
19406 fflushall="$define"
19409 Sigh. Flushing explicitly all the stdio streams doesn't work.
19414 Cannot figure out whether flushing stdio streams explicitly works or not.
19415 I'm assuming it doesn't.
19421 "$define"|true|[yY]*)
19422 fflushall="$define"
19430 All is futile. Even fflush(stdin) clobbers input pipes!
19437 $rm -f core tryp.c tryp.core core.tryp.*
19439 *) fflushall="$undef"
19443 case "$fflushNULL$fflushall" in
19446 OK, I give up. I cannot figure out how to flush pending stdio output.
19447 We won't be flushing handles at all before fork/exec/popen.
19453 : Store the full pathname to the ar program for use in the C program
19454 : Respect a hint or command line value for full_ar.
19459 : Store the full pathname to the sed program for use in the C program
19462 : see what type gids are declared as in the kernel
19464 echo "Looking for the type for group ids returned by getgid()."
19465 set gid_t gidtype xxx stdio.h sys/types.h
19469 xxx=`./findhdr sys/user.h`
19470 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19472 unsigned) dflt="$1 $2" ;;
19476 *) dflt="$gidtype";;
19479 gid_t) echo "gid_t found." ;;
19480 *) rp="What is the type for group ids returned by getgid()?"
19486 : Check the size of GID
19489 *_t) zzz="$gidtype" ;;
19492 echo "Checking the size of $zzz..." >&4
19494 #include <sys/types.h>
19496 #$i_stdlib I_STDLIB
19498 #include <stdlib.h>
19501 printf("%d\n", (int)sizeof($gidtype));
19506 if eval $compile_ok; then
19510 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19513 echo "Your $zzz is $gidsize bytes long."
19518 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19522 : Check if GID is signed
19525 *_t) zzz="$gidtype" ;;
19528 echo "Checking the sign of $zzz..." >&4
19530 #include <sys/types.h>
19541 if eval $compile; then
19545 echo "(I can't execute the test program--guessing unsigned.)" >&4
19549 1) echo "Your $zzz is unsigned." ;;
19550 -1) echo "Your $zzz is signed." ;;
19556 echo "(I can't compile the test program--guessing unsigned.)" >&4
19560 : Check 64bit sizes
19563 if $test X"$quadtype" != X; then
19565 echo "Checking how to print 64-bit integers..." >&4
19567 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19568 $cat >try.c <<'EOCP'
19569 #include <sys/types.h>
19572 int q = 12345678901;
19573 printf("%ld\n", q);
19577 if eval $compile; then
19581 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19582 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19583 echo "We will use %d."
19589 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19590 $cat >try.c <<'EOCP'
19591 #include <sys/types.h>
19594 long q = 12345678901;
19595 printf("%ld\n", q);
19599 if eval $compile; then
19603 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19604 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19605 echo "We will use %ld."
19611 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19612 $cat >try.c <<'EOCP'
19613 #include <sys/types.h>
19614 #include <inttypes.h>
19617 int64_t q = 12345678901;
19618 printf("%" PRId64 "\n", q);
19622 if eval $compile; then
19626 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19627 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19628 echo "We will use the C9X style."
19634 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19636 #include <sys/types.h>
19639 $quadtype q = 12345678901;
19640 printf("%Ld\n", q);
19644 if eval $compile; then
19648 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19649 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19650 echo "We will use %Ld."
19656 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19657 $cat >try.c <<'EOCP'
19658 #include <sys/types.h>
19661 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19662 printf("%lld\n", q);
19666 if eval $compile; then
19670 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19671 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19672 echo "We will use the %lld style."
19678 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19680 #include <sys/types.h>
19683 $quadtype q = 12345678901;
19684 printf("%qd\n", q);
19688 if eval $compile; then
19692 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19693 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19694 echo "We will use %qd."
19700 if $test X"$sPRId64" = X; then
19701 echo "Cannot figure out how to print 64-bit integers." >&4
19708 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19709 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19711 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19712 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19716 : Check format strings for internal types
19718 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19720 if $test X"$ivsize" = X8; then
19721 ivdformat="$sPRId64"
19722 uvuformat="$sPRIu64"
19723 uvoformat="$sPRIo64"
19724 uvxformat="$sPRIx64"
19725 uvXUformat="$sPRIXU64"
19727 if $test X"$ivsize" = X"$longsize"; then
19734 if $test X"$ivsize" = X"$intsize"; then
19742 if $test X"$ivsize" = X"$shortsize"; then
19753 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19754 nveformat="$sPRIeldbl"
19755 nvfformat="$sPRIfldbl"
19756 nvgformat="$sPRIgldbl"
19757 nvEUformat="$sPRIEUldbl"
19758 nvFUformat="$sPRIFUldbl"
19759 nvGUformat="$sPRIGUldbl"
19769 case "$ivdformat" in
19770 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19775 : Check format string for GID
19778 $echo "Checking the format string to be used for gids..." >&4
19781 -1) if $test X"$gidsize" = X"$ivsize"; then
19782 gidformat="$ivdformat"
19784 if $test X"$gidsize" = X"$longsize"; then
19787 if $test X"$gidsize" = X"$intsize"; then
19790 if $test X"$gidsize" = X"$shortsize"; then
19797 *) if $test X"$gidsize" = X"$uvsize"; then
19798 gidformat="$uvuformat"
19800 if $test X"$gidsize" = X"$longsize"; then
19803 if $test X"$gidsize" = X"$intsize"; then
19806 if $test X"$gidsize" = X"$shortsize"; then
19815 : see if getgroups exists
19816 set getgroups d_getgrps
19819 : see if setgroups exists
19820 set setgroups d_setgrps
19823 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19825 case "$d_getgrps$d_setgrps" in
19827 case "$groupstype" in
19828 '') dflt="$gidtype" ;;
19829 *) dflt="$groupstype" ;;
19832 What type of pointer is the second argument to getgroups() and setgroups()?
19833 Usually this is the same as group ids, $gidtype, but not always.
19836 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19840 *) groupstype="$gidtype";;
19843 : MAD = Misc Attribute Definition
19845 if $test $patchlevel -lt 9; then
19846 : MAD is not available in 5.8.x or earlier.
19850 $define|true|[yY]*) dflt='y' ;;
19855 Would you like to build with Misc Attribute Decoration? This is development
19856 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19857 overhead on the interpreter.
19859 If this doesn't make any sense to you, just accept the default '$dflt'.
19861 rp='Build Perl with MAD?'
19866 madlyh='madly.h madly.act madly.tab'
19868 madlyobj="madly$_o" ;;
19877 : check whether make sets MAKE
19879 echo "Checking if your $make program sets \$(MAKE)..." >&4
19880 case "$make_set_make" in
19882 $sed 's/^X //' > testmake.mak << 'EOF'
19884 X @echo 'maketemp="$(MAKE)"'
19886 case "`$make -f testmake.mak 2>/dev/null`" in
19887 *maketemp=*) make_set_make='#' ;;
19888 *) make_set_make="MAKE=$make" ;;
19890 $rm -f testmake.mak
19893 case "$make_set_make" in
19894 '#') echo "Yup, it does.";;
19895 *) echo "Nope, it doesn't.";;
19898 : see what type is used for mode_t
19899 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19900 set mode_t modetype int stdio.h sys/types.h
19903 : see if we need va_copy
19905 case "$i_stdarg" in
19908 #include <stdarg.h>
19910 #$i_stdlib I_STDLIB
19912 #include <stdlib.h>
19914 #include <signal.h>
19917 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19919 return vfprintf(f, fmt, *valp);
19923 myvfprintf(FILE *f, const char *fmt, va_list val)
19925 return ivfprintf(f, fmt, &val);
19929 myprintf(char *fmt, ...)
19932 va_start(val, fmt);
19933 return myvfprintf(stdout, fmt, val);
19937 main(int ac, char **av)
19939 signal(SIGSEGV, exit);
19941 myprintf("%s%cs all right, then\n", "that", '\'');
19946 if eval $compile && $run ./try 2>&1 >/dev/null; then
19947 case "`$run ./try`" in
19948 "that's all right, then")
19954 yes) echo "It seems that you don't need va_copy()." >&4
19955 need_va_copy="$undef"
19957 *) echo "It seems that va_copy() or similar will be needed." >&4
19958 need_va_copy="$define"
19963 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19967 : see what type is used for size_t
19968 rp="What is the type used for the length parameter for string functions?"
19969 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19972 : check for type of arguments to gethostbyaddr.
19973 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19974 case "$d_gethbyaddr" in
19978 Checking to see what type of arguments are accepted by gethostbyaddr().
19980 hdrs="$define sys/types.h
19981 $d_socket sys/socket.h
19982 $i_niin netinet/in.h
19984 $i_unistd unistd.h"
19985 : The first arg can 'char *' or 'void *'
19986 : The second arg is some of integral type
19987 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19988 for yyy in size_t long int; do
19989 case "$netdb_host_type" in
19990 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
19991 if ./protochk "$try" $hdrs; then
19992 echo "Your system accepts $xxx for the first arg."
19993 echo "...and $yyy for the second arg."
19994 netdb_host_type="$xxx"
19995 netdb_hlen_type="$yyy"
20001 : In case none of those worked, prompt the user.
20002 case "$netdb_host_type" in
20003 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20006 netdb_host_type=$ans
20007 rp='What is the type for the 2nd argument to gethostbyaddr?'
20010 netdb_hlen_type=$ans
20014 *) : no gethostbyaddr, so pick harmless defaults
20015 netdb_host_type='char *'
20016 netdb_hlen_type="$sizetype"
20019 # Remove the "const" if needed. -- but then we'll have a
20021 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20024 : check for type of argument to gethostbyname.
20025 if test "X$netdb_name_type" = X ; then
20026 case "$d_gethbyname" in
20030 Checking to see what type of argument is accepted by gethostbyname().
20032 hdrs="$define sys/types.h
20033 $d_socket sys/socket.h
20034 $i_niin netinet/in.h
20036 $i_unistd unistd.h"
20037 for xxx in "const char *" "char *"; do
20038 case "$netdb_name_type" in
20039 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20040 if ./protochk "$try" $hdrs; then
20041 echo "Your system accepts $xxx."
20042 netdb_name_type="$xxx"
20047 : In case none of those worked, prompt the user.
20048 case "$netdb_name_type" in
20049 '') rp='What is the type for the 1st argument to gethostbyname?'
20052 netdb_name_type=$ans
20056 *) : no gethostbyname, so pick harmless default
20057 netdb_name_type='char *'
20062 : check for type of 1st argument to getnetbyaddr.
20063 if test "X$netdb_net_type" = X ; then
20064 case "$d_getnbyaddr" in
20068 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20070 hdrs="$define sys/types.h
20071 $d_socket sys/socket.h
20072 $i_niin netinet/in.h
20074 $i_unistd unistd.h"
20075 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20076 case "$netdb_net_type" in
20077 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20078 if ./protochk "$try" $hdrs; then
20079 echo "Your system accepts $xxx."
20080 netdb_net_type="$xxx"
20085 : In case none of those worked, prompt the user.
20086 case "$netdb_net_type" in
20087 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20090 netdb_net_type=$ans
20094 *) : no getnetbyaddr, so pick harmless default
20095 netdb_net_type='long'
20099 : locate the preferred pager for this system
20106 [a-zA-Z]:/*) dflt=$pg;;
20110 [a-zA-Z]:/*) dflt=$more;;
20114 [a-zA-Z]:/*) dflt=$less;;
20117 '') dflt=/usr/ucb/more;;
20125 rp='What pager is used on your system?'
20129 : see what type pids are declared as in the kernel
20130 rp="What is the type of process ids on this system?"
20131 set pid_t pidtype int stdio.h sys/types.h
20134 : see if ar generates random libraries by itself
20136 echo "Checking how to generate random libraries on your machine..." >&4
20137 echo 'int bar1() { return bar2(); }' > bar1.c
20138 echo 'int bar2() { return 2; }' > bar2.c
20140 #$i_stdlib I_STDLIB
20142 #include <stdlib.h>
20144 int main() { printf("%d\n", bar1()); exit(0); }
20146 $cc $ccflags -c bar1.c >/dev/null 2>&1
20147 $cc $ccflags -c bar2.c >/dev/null 2>&1
20148 $cc $ccflags -c foo.c >/dev/null 2>&1
20149 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20150 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20151 $run ./foobar >/dev/null 2>&1; then
20152 echo "$ar appears to generate random libraries itself."
20154 if [ "X$ranlib" = "X" ]; then
20157 elif $ar s bar$_a >/dev/null 2>&1 &&
20158 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20159 $run ./foobar >/dev/null 2>&1; then
20160 echo "a table of contents needs to be added with '$ar s'."
20163 elif $ar ts bar$_a >/dev/null 2>&1 &&
20164 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20165 $run ./foobar >/dev/null 2>&1; then
20166 echo "a table of contents needs to be added with '$ar ts'."
20173 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20174 $test -f $ranlib || ranlib=''
20177 if $test -n "$ranlib"; then
20178 echo "your system has '$ranlib'; we'll use that."
20181 echo "your system doesn't seem to support random libraries"
20182 echo "so we'll use lorder and tsort to order the libraries."
20189 : see if this is a values.h system
20190 set values.h i_values
20193 : Check the max offset that gmtime and localtime accept
20194 echo "Checking max offsets that gmtime () accepts"
20197 define) yyy="#include <values.h>" ;;
20201 case "$sGMTIME_min/$sGMTIME_max" in
20204 #include <sys/types.h>
20213 void gm_check (time_t t, int min_year, int max_year)
20216 if ( tmp == NULL ||
20217 /* Check tm_year overflow */
20218 tmp->tm_year < min_year || tmp->tm_year > max_year)
20229 gm_check (MAXLONG, 69, 0x7fffffff);
20231 if (tmp == NULL || tmp->tm_year < 0) {
20232 for (i = 63; i >= 0; i--) {
20233 time_t x = pt | ((time_t)1 << i);
20234 if (x < 0 || x < pt) continue;
20235 gm_check (x, 69, 0x7fffffff);
20238 printf ("sGMTIME_max=%ld\n", pt);
20247 gm_check (MINLONG, -1900, 70);
20250 for (i = 36; i >= 0; i--) {
20251 time_t x = pt - ((time_t)1 << i);
20252 if (x > 0) continue;
20253 gm_check (x, -1900, 70);
20256 printf ("sGMTIME_min=%ld\n", pt);
20260 int main (int argc, char *argv[])
20262 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20269 if eval $compile; then
20272 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20278 echo "Checking max offsets that localtime () accepts"
20280 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20283 #include <sys/types.h>
20292 void local_check (time_t t, int min_year, int max_year)
20294 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20297 tmp = localtime (&t);
20298 if ( tmp == NULL ||
20299 /* Check tm_year overflow */
20300 tmp->tm_year < min_year || tmp->tm_year > max_year)
20304 } /* local_check */
20311 local_check (MAXLONG, 69, 0x7fffffff);
20313 if (tmp == NULL || tmp->tm_year < 0) {
20314 for (i = 63; i >= 0; i--) {
20315 time_t x = pt | ((time_t)1 << i);
20316 if (x < 0 || x < pt) continue;
20317 local_check (x, 69, 0x7fffffff);
20320 printf ("sLOCALTIME_max=%ld\n", pt);
20329 local_check (MINLONG, -1900, 70);
20332 for (i = 36; i >= 0; i--) {
20333 time_t x = pt - ((time_t)1 << i);
20334 if (x > 0) continue;
20335 local_check (x, -1900, 70);
20338 printf ("sLOCALTIME_min=%ld\n", pt);
20342 int main (int argc, char *argv[])
20350 if eval $compile; then
20353 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20359 : check for type of arguments to select.
20360 case "$selecttype" in
20361 '') case "$d_select" in
20365 Checking to see what type of arguments are accepted by select().
20367 hdrs="$define sys/types.h
20368 $i_systime sys/time.h
20369 $i_sysselct sys/select.h
20370 $d_socket sys/socket.h"
20371 : The first arg can be int, unsigned, or size_t
20372 : The last arg may or may not be 'const'
20374 : void pointer has been seen but using that
20375 : breaks the selectminbits test
20376 for xxx in 'fd_set *' 'int *'; do
20377 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20378 for tmo in 'struct timeval *' 'const struct timeval *'; do
20380 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20381 if ./protochk "$try" $hdrs; then
20382 echo "Your system accepts $xxx."
20391 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20392 case "$d_fd_set" in
20393 $define) dflt="fd_set *" ;;
20402 *) : no select, so pick a harmless default
20409 : check for the select 'width'
20410 case "$selectminbits" in
20411 '') safebits=`expr $ptrsize \* 8`
20412 case "$d_select" in
20416 Checking to see on how many bits at a time your select() operates...
20419 #include <sys/types.h>
20421 #$i_systime I_SYS_TIME
20422 #$i_systimek I_SYS_TIME_KERNEL
20427 # ifdef I_SYS_TIME_KERNEL
20430 # include <sys/time.h>
20431 # ifdef I_SYS_TIME_KERNEL
20435 #$i_sysselct I_SYS_SELECT
20436 #ifdef I_SYS_SELECT
20437 #include <sys/select.h>
20439 #$d_socket HAS_SOCKET
20441 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20444 #$i_stdlib I_STDLIB
20446 #include <stdlib.h>
20449 #define S sizeof(*(b))
20451 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20452 #define NBITS (NBYTES * 8)
20454 char *s = (char *)malloc(NBYTES);
20463 fp = fopen("try.c", "r");
20469 b = ($selecttype)s;
20470 for (i = 0; i < NBITS; i++)
20474 select(fd + 1, b, 0, 0, &t);
20475 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20477 printf("%d\n", i + 1);
20482 if eval $compile_ok; then
20483 selectminbits=`$run ./try`
20484 case "$selectminbits" in
20486 Cannot figure out on how many bits at a time your select() operates.
20487 I'll play safe and guess it is $safebits bits.
20489 selectminbits=$safebits
20490 bits="$safebits bits"
20493 *) bits="$selectminbits bits" ;;
20495 echo "Your select() operates on $bits at a time." >&4
20497 rp='What is the minimum number of bits your select() operates on?'
20498 case "$byteorder" in
20499 12345678) dflt=64 ;;
20505 selectminbits="$val"
20509 *) : no select, so pick a harmless default
20510 selectminbits=$safebits
20516 : Trace out the files included by signal.h, then look for SIGxxx names.
20517 if [ "X$fieldn" = X ]; then
20518 : Just make some guesses. We check them later.
20519 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20521 xxx=`echo '#include <signal.h>' |
20522 $cppstdin $cppminus $cppflags 2>/dev/null |
20523 $grep '^[ ]*#.*include' |
20524 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20525 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20528 for xx in $xxx /dev/null ; do
20529 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20531 case "$xxxfiles" in
20532 '') xxxfiles=`./findhdr signal.h` ;;
20535 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20536 print substr($2, 4, 20)
20538 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20539 print substr($3, 4, 20)
20541 : Append some common names just in case the awk scan failed.
20542 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20543 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20544 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20545 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20546 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20548 : generate a few handy files for later
20549 $cat > signal.c <<EOCP
20550 #include <sys/types.h>
20551 #include <signal.h>
20552 #$i_stdlib I_STDLIB
20554 #include <stdlib.h>
20559 /* Strange style to avoid deeply-nested #if/#else/#endif */
20562 # define NSIG (_NSIG)
20568 # define NSIG (SIGMAX+1)
20574 # define NSIG (SIG_MAX+1)
20580 # define NSIG (_SIG_MAX+1)
20586 # define NSIG (MAXSIG+1)
20592 # define NSIG (MAX_SIG+1)
20597 # ifdef SIGARRAYSIZE
20598 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20604 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20608 /* Default to some arbitrary number that's big enough to get most
20609 of the common signals.
20615 printf("NSIG %d\n", NSIG);
20621 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20623 printf "#ifdef SIG"; printf $1; printf "\n"
20624 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20625 printf $1; printf ");\n"
20629 printf "#endif /* JUST_NSIG */\n";
20630 printf "exit(0);\n}\n";
20633 $cat >signal.awk <<'EOP'
20634 BEGIN { ndups = 0 }
20635 $1 ~ /^NSIG$/ { nsig = $2 }
20636 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20637 if ($2 > maxsig) { maxsig = $2 }
20638 if (sig_name[$2]) {
20639 dup_name[ndups] = $1
20640 dup_num[ndups] = $2
20652 printf("NSIG %d\n", nsig);
20653 for (n = 1; n < nsig; n++) {
20655 printf("%s %d\n", sig_name[n], sig_num[n])
20658 printf("NUM%d %d\n", n, n)
20661 for (n = 0; n < ndups; n++) {
20662 printf("%s %d\n", dup_name[n], dup_num[n])
20666 $cat >signal_cmd <<EOS
20668 if $test -s signal.lst; then
20669 echo "Using your existing signal.lst file"
20674 $cat >>signal_cmd <<'EOS'
20677 if eval $compile_ok; then
20678 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20679 $uniq | $awk -f signal.awk >signal.lst
20681 echo "(I can't seem be able to compile the whole test program)" >&4
20682 echo "(I'll try it in little pieces.)" >&4
20683 set signal -DJUST_NSIG
20684 if eval $compile_ok; then
20685 $run ./signal$_exe > signal.nsg
20688 echo "I can't seem to figure out how many signals you have." >&4
20689 echo "Guessing 50." >&4
20690 echo 'NSIG 50' > signal.nsg
20692 : Now look at all the signal names, one at a time.
20693 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20694 $cat > signal.c <<EOCP
20695 #include <sys/types.h>
20696 #include <signal.h>
20699 printf("$xx %d\n", SIG${xx});
20704 if eval $compile; then
20705 echo "SIG${xx} found."
20706 $run ./signal$_exe >> signal.ls1
20708 echo "SIG${xx} NOT found."
20711 if $test -s signal.ls1; then
20712 $cat signal.nsg signal.ls1 |
20713 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20717 if $test -s signal.lst; then
20720 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20721 echo 'kill -l' >signal
20722 set X `csh -f <signal`
20726 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20728 echo $@ | $tr ' ' $trnl | \
20729 $awk '{ printf "%s %d\n", $1, ++s; }
20730 END { printf "NSIG %d\n", ++s }' >signal.lst
20732 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20734 chmod a+x signal_cmd
20735 $eunicefix signal_cmd
20737 : generate list of signal names
20739 case "$sig_name_init" in
20741 *) case "$sig_num_init" in
20742 ''|*,*) doinit=yes ;;
20747 echo "Generating a list of signal names and numbers..." >&4
20749 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20750 sig_name=`$awk 'BEGIN { printf "ZERO " }
20751 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20752 sig_num=`$awk 'BEGIN { printf "0 " }
20753 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20754 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20755 !/^NSIG/ { printf "\"%s\", ", $1 }
20756 END { printf "0\n" }' signal.lst`
20757 sig_num_init=`$awk 'BEGIN { printf "0, " }
20758 !/^NSIG/ { printf "%d, ", $2}
20759 END { printf "0\n"}' signal.lst`
20762 echo "The following $sig_count signals are available:"
20764 echo $sig_name | $awk \
20765 'BEGIN { linelen = 0 }
20767 for (i = 1; i <= NF; i++) {
20768 name = "SIG" $i " "
20769 linelen = linelen + length(name)
20770 if (linelen > 70) {
20772 linelen = length(name)
20778 sig_size=`echo $sig_name | awk '{print NF}'`
20779 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20781 : Check size of size
20783 case "$sizetype" in
20784 *_t) zzz="$sizetype" ;;
20785 *) zzz="filesize" ;;
20787 echo "Checking the size of $zzz..." >&4
20789 #include <sys/types.h>
20791 #$i_stdlib I_STDLIB
20793 #include <stdlib.h>
20796 printf("%d\n", (int)sizeof($sizetype));
20801 if eval $compile_ok; then
20805 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20808 echo "Your $zzz size is $sizesize bytes."
20813 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20817 : check for socklen_t
20819 echo "Checking to see if you have socklen_t..." >&4
20821 #include <sys/types.h>
20822 #$d_socket HAS_SOCKET
20824 #include <sys/socket.h>
20826 int main() { socklen_t x = 16; }
20829 if eval $compile; then
20831 echo "You have socklen_t."
20834 echo "You do not have socklen_t."
20835 case "$sizetype" in
20836 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20843 : see if this is a socks.h system
20844 set socks.h i_socks
20847 : check for type of the size argument to socket calls
20848 case "$d_socket" in
20852 Checking to see what type is the last argument of accept().
20855 case "$d_socklen_t" in
20856 "$define") yyy="$yyy socklen_t"
20858 yyy="$yyy $sizetype int long unsigned"
20859 for xxx in $yyy; do
20860 case "$socksizetype" in
20861 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
20862 case "$usesocks" in
20864 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20865 echo "Your system accepts '$xxx *' for the last argument of accept()."
20866 socksizetype="$xxx"
20869 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20870 echo "Your system accepts '$xxx *' for the last argument of accept()."
20871 socksizetype="$xxx"
20878 : In case none of those worked, prompt the user.
20879 case "$socksizetype" in
20880 '') rp='What is the type for socket address structure sizes?'
20887 *) : no sockets, so pick relatively harmless default
20892 : see what type is used for signed size_t
20893 set ssize_t ssizetype int stdio.h sys/types.h
20898 #$i_stdlib I_STDLIB
20900 #include <stdlib.h>
20902 #include <sys/types.h>
20903 #define Size_t $sizetype
20904 #define SSize_t $dflt
20907 if (sizeof(Size_t) == sizeof(SSize_t))
20909 else if (sizeof(Size_t) == sizeof(int))
20918 if eval $compile_ok && $run ./try > /dev/null; then
20919 ssizetype=`$run ./try`
20920 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20923 Help! I can't compile and run the ssize_t test program: please enlighten me!
20924 (This is probably a misconfiguration in your system or libraries, and
20925 you really ought to fix it. Still, I'll try anyway.)
20927 I need a type that is the same size as $sizetype, but is guaranteed to
20928 be signed. Common values are ssize_t, int and long.
20931 rp="What signed type is the same size as $sizetype?"
20937 : see what type of char stdio uses.
20939 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
20940 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20941 echo "Your stdio uses unsigned chars." >&4
20942 stdchar="unsigned char"
20944 echo "Your stdio uses signed chars." >&4
20949 : see what type uids are declared as in the kernel
20951 echo "Looking for the type for user ids returned by getuid()."
20952 set uid_t uidtype xxx stdio.h sys/types.h
20956 xxx=`./findhdr sys/user.h`
20957 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20959 unsigned) dflt="$1 $2" ;;
20963 *) dflt="$uidtype";;
20966 uid_t) echo "uid_t found." ;;
20967 *) rp="What is the type for user ids returned by getuid()?"
20973 : Check size of UID
20976 *_t) zzz="$uidtype" ;;
20979 echo "Checking the size of $zzz..." >&4
20981 #include <sys/types.h>
20983 #$i_stdlib I_STDLIB
20985 #include <stdlib.h>
20988 printf("%d\n", (int)sizeof($uidtype));
20993 if eval $compile_ok; then
20997 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21000 echo "Your $zzz is $uidsize bytes long."
21005 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21008 : Check if UID is signed
21011 *_t) zzz="$uidtype" ;;
21014 echo "Checking the sign of $zzz..." >&4
21016 #include <sys/types.h>
21027 if eval $compile; then
21031 echo "(I can't execute the test program--guessing unsigned.)" >&4
21035 1) echo "Your $zzz is unsigned." ;;
21036 -1) echo "Your $zzz is signed." ;;
21042 echo "(I can't compile the test program--guessing unsigned.)" >&4
21046 : Check format string for UID
21048 $echo "Checking the format string to be used for uids..." >&4
21051 -1) if $test X"$uidsize" = X"$ivsize"; then
21052 uidformat="$ivdformat"
21054 if $test X"$uidsize" = X"$longsize"; then
21057 if $test X"$uidsize" = X"$intsize"; then
21060 if $test X"$uidsize" = X"$shortsize"; then
21067 *) if $test X"$uidsize" = X"$uvsize"; then
21068 uidformat="$uvuformat"
21070 if $test X"$uidsize" = X"$longsize"; then
21073 if $test X"$uidsize" = X"$intsize"; then
21076 if $test X"$uidsize" = X"$shortsize"; then
21085 : Check if site customization support was requested
21086 case "$usesitecustomize" in
21087 $define|true|[Yy]*)
21088 usesitecustomize="$define"
21091 usesitecustomize="$undef"
21095 : determine compiler compiler
21104 if $test -f "$byacc$_exe"; then
21106 comp="byacc or $comp"
21108 if $test -f "$bison$_exe"; then
21109 comp="$comp or bison -y"
21111 rp="Which compiler compiler ($comp) shall I use?"
21120 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
21126 : see if this is a assert.h system
21127 set assert.h i_assert
21130 : see if this is a fp.h system
21134 : see if this is a fp_class.h system
21135 set fp_class.h i_fp_class
21138 : see if gdbm.h is available
21143 : see if gdbm_open exists
21144 set gdbm_open d_gdbm_open
21146 case "$d_gdbm_open" in
21149 echo "We won't be including <gdbm.h>"
21158 : see if this is a ieeefp.h system
21159 case "$i_ieeefp" in
21160 '' ) set ieeefp.h i_ieeefp
21165 : see if this is a libutil.h system
21166 set libutil.h i_libutil
21169 : see if mach cthreads are available
21170 if test "X$usethreads" = "X$define"; then
21171 set mach/cthreads.h i_machcthr
21174 i_machcthr="$undef"
21177 : see if this is a mntent.h system
21178 set mntent.h i_mntent
21181 : see if net/errno.h is available
21183 set net/errno.h val
21186 : Unfortunately, it causes problems on some systems. Arrgh.
21189 cat > try.c <<'EOM'
21192 #include <net/errno.h>
21198 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21199 echo "We'll be including <net/errno.h>." >&4
21201 echo "We won't be including <net/errno.h>." >&4
21210 : see if netinet/tcp.h is available
21211 set netinet/tcp.h i_netinettcp
21214 : see if this is a poll.h system
21218 : see if this is a prot.h system
21222 : Preprocessor symbols
21224 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21225 $cat <<'EOSH' > Cppsym.know
21226 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21227 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21228 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21229 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21230 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21231 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21232 bull c cadmus clipper CMU COFF COMPILER_VERSION
21233 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21234 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21235 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21236 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21238 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21239 H3050R H3050RX hbullx20 hcx host_mips
21240 hp200 hp300 hp700 HP700 hp800 hp9000
21241 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21242 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21243 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21244 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21245 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21246 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21247 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21248 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21249 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21250 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21251 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21252 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21253 MATH_HAS_NO_SIDE_EFFECTS
21254 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21255 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21256 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21257 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21258 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21259 NetBSD news1500 news1700 news1800 news1900 news3700
21260 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21261 ns32016 ns32332 ns32k nsc32000
21262 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21263 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21264 pc532 pdp11 PGC PIC plexus PORTAR posix
21265 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21266 POSIX_C_SOURCE POSIX_SOURCE POWER
21267 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21268 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21269 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21270 sony sony_news sonyrisc sparc sparclite spectrum
21271 stardent stdc STDC_EXT stratos sun sun3 sun386
21272 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21273 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21274 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21275 sysV68 sysV88 Tek4132 Tek4300 titan
21276 TM3200 TM5400 TM5600
21277 tower tower32 tower32_200 tower32_600 tower32_700
21278 tower32_800 tower32_850 tss
21279 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21280 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21281 unix UNIX95 UNIX99 unixpc unos
21282 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21283 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21284 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21286 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21287 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21288 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21291 # Maybe put other stuff here too.
21292 cat <<EOSH >>Cppsym.know
21295 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21296 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21297 $cat Cppsym.know > Cppsym.c
21298 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21299 $rm -f Cppsym.a Cppsym.b Cppsym.c
21300 cat <<EOSH > Cppsym
21302 if $test \$# -gt 0; then
21303 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21304 if $test -s Cppsym.got; then
21311 $tr " " "$trnl" | ./Cppsym.try
21317 cat <<EOSH > Cppsym.try
21319 cat <<'EOCP' > try.c
21322 #define STRINGIFY(a) "a"
21324 #if cpp_stuff == 42
21325 #define StGiFy(a) #a
21326 #define STRINGIFY(a) StGiFy(a)
21328 #if $cpp_stuff != 1 && $cpp_stuff != 42
21329 # include "Bletch: How does this C preprocessor stringify macros?"
21335 cat <<'EOSH' >> Cppsym.try
21337 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21338 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21339 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21340 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21342 echo 'return 0;}' >> try.c
21344 cat <<EOSH >> Cppsym.try
21346 case "$osname-$gccversion" in
21347 irix-) ccflags="\$ccflags -woff 1178" ;;
21348 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21350 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21352 chmod +x Cppsym.try
21353 $eunicefix Cppsym.try
21354 ./Cppsym < Cppsym.know > Cppsym.true
21355 : Add in any linux cpp "predefined macros":
21356 case "$osname::$gccversion" in
21359 rm -f $tHdrH'.h' $tHdrH
21361 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21362 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21363 if [ -s $tHdrH'_cppsym.real' ]; then
21364 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21367 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21370 : now check the C compiler for additional symbols
21371 postprocess_cc_v=''
21373 aix) postprocess_cc_v="|$tr , ' '" ;;
21380 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21383 -D*) echo "\$i" | $sed 's/^-D//';;
21384 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21389 postprocess_cc_v=''
21392 ./ccsym > ccsym1.raw
21393 if $test -s ccsym1.raw; then
21394 $sort ccsym1.raw | $uniq >ccsym.raw
21396 mv ccsym1.raw ccsym.raw
21399 $awk '/\=/ { print $0; next }
21400 { print $0"=1" }' ccsym.raw >ccsym.list
21401 $comm -13 Cppsym.true ccsym.list >ccsym.own
21402 $comm -12 Cppsym.true ccsym.list >ccsym.com
21403 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21405 if $test -z ccsym.raw; then
21406 echo "Your C compiler doesn't seem to define any symbols!" >&4
21408 echo "However, your C preprocessor defines the following symbols:"
21411 cppsymbols=`$cat Cppsym.true`
21412 cppsymbols=`echo $cppsymbols`
21413 cppccsymbols="$cppsymbols"
21415 if $test -s ccsym.com; then
21416 echo "Your C compiler and pre-processor define these symbols:"
21417 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
21420 cppccsymbols=`$cat ccsym.com`
21421 cppccsymbols=`echo $cppccsymbols`
21422 $test "$silent" || sleep 1
21424 if $test -s ccsym.cpp; then
21425 $test "$also" && echo " "
21426 echo "Your C pre-processor ${also}defines the following symbols:"
21427 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
21429 cppsymbols=`$cat ccsym.cpp`
21430 cppsymbols=`echo $cppsymbols`
21431 $test "$silent" || sleep 1
21433 if $test -s ccsym.own; then
21434 $test "$also" && echo " "
21435 echo "Your C compiler ${also}defines the following cpp symbols:"
21436 $sed -e 's/\(..*\)=1/\1/' ccsym.own
21437 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
21438 ccsymbols=`$cat ccsym.own`
21439 ccsymbols=`echo $ccsymbols`
21440 $test "$silent" || sleep 1
21444 : see if this is a termio system
21448 if $test `./findhdr termios.h`; then
21449 set tcsetattr i_termios
21455 "$define") echo "You have POSIX termios.h... good!" >&4;;
21456 *) if ./Cppsym pyr; then
21457 case "`/bin/universe`" in
21458 ucb) if $test `./findhdr sgtty.h`; then
21460 echo "<sgtty.h> found." >&4
21462 echo "System is pyramid with BSD universe."
21463 ./warn "<sgtty.h> not found--you could have problems."
21465 *) if $test `./findhdr termio.h`; then
21467 echo "<termio.h> found." >&4
21469 echo "System is pyramid with USG universe."
21470 ./warn "<termio.h> not found--you could have problems."
21474 if $test `./findhdr termio.h`; then
21475 echo "<termio.h> found." >&4
21477 elif $test `./findhdr sgtty.h`; then
21478 echo "<sgtty.h> found." >&4
21481 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
21484 if $test `./findhdr sgtty.h`; then
21485 echo "<sgtty.h> found." >&4
21487 elif $test `./findhdr termio.h`; then
21488 echo "<termio.h> found." >&4
21491 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
21495 set i_termio; eval $setvar
21496 val=$val2; set i_sgtty; eval $setvar
21497 val=$val3; set i_termios; eval $setvar
21499 : see if stddef is available
21500 set stddef.h i_stddef
21503 : see if sys/access.h is available
21504 set sys/access.h i_sysaccess
21507 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
21508 set sys/filio.h i_sysfilio
21511 if $test `./findhdr sys/ioctl.h`; then
21513 echo '<sys/ioctl.h> found.' >&4
21516 if $test $i_sysfilio = "$define"; then
21517 echo '<sys/ioctl.h> NOT found.' >&4
21519 $test $i_sgtty = "$define" && xxx="sgtty.h"
21520 $test $i_termio = "$define" && xxx="termio.h"
21521 $test $i_termios = "$define" && xxx="termios.h"
21522 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
21528 : see if socket ioctl defs are in sys/sockio.h
21530 xxx=`./findhdr sys/sockio.h`
21531 if $test "$xxx"; then
21532 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
21534 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
21537 echo "No socket ioctls found in <sys/sockio.h>." >&4
21542 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
21548 : see if this is a syslog.h system
21549 set syslog.h i_syslog
21552 : see if this is a sys/mode.h system
21553 set sys/mode.h i_sysmode
21556 : see if there is a sys/poll.h file
21557 set sys/poll.h i_syspoll
21560 : see if sys/resource.h has to be included
21561 set sys/resource.h i_sysresrc
21564 : see if sys/security.h is available
21565 set sys/security.h i_syssecrt
21568 : see if this is a sys/statvfs.h system
21569 set sys/statvfs.h i_sysstatvfs
21572 : see if this is a sys/un.h system
21573 set sys/un.h i_sysun
21576 : see if this is a sys/utsname.h system
21577 set sys/utsname.h i_sysutsname
21580 : see if this is a syswait system
21581 set sys/wait.h i_syswait
21584 : see if this is a ustat.h system
21585 set ustat.h i_ustat
21588 : see if this is an utime system
21589 set utime.h i_utime
21592 : see if this is a vfork system
21595 set vfork.h i_vfork
21605 echo "Looking for extensions..." >&4
21606 : If we are using the old config.sh, known_extensions may contain
21607 : old or inaccurate or duplicate values.
21608 known_extensions=''
21609 nonxs_extensions=''
21610 : We do not use find because it might not be available.
21611 : We do not just use MANIFEST because the user may have dropped
21612 : some additional extensions into the source tree and expect them
21615 : Function to recursively find available extensions, ignoring DynaLoader
21616 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21620 DynaLoader|dynaload) ;;
21622 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
21623 leaf=`echo $xxx | $sed -e s/.*-//`;
21624 if $test -f $xxx/$leaf.xs -o -f $xxx/$leaf.c; then
21625 known_extensions="$known_extensions $1$this_ext";
21626 elif $test -f $xxx/Makefile.PL; then
21627 nonxs_extensions="$nonxs_extensions $1$this_ext";
21629 if $test -d $xxx -a $# -lt 10; then
21632 eval $find_extensions;
21644 eval $find_extensions
21645 # Special case: Add in modules that nest beyond the first level.
21646 # Currently threads/shared and Hash/Util/FieldHash, since they are
21647 # not picked up by the recursive find above (and adding in general
21648 # recursive finding breaks SDBM_File/sdbm).
21649 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
21650 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
21651 set X $known_extensions
21653 known_extensions="$*"
21654 set X $nonxs_extensions
21656 nonxs_extensions="$*"
21659 : Now see which are supported on this system.
21661 for xxx in $known_extensions ; do
21665 $define) avail_ext="$avail_ext $xxx" ;;
21668 GDBM_File|gdbm_fil)
21670 $define) avail_ext="$avail_ext $xxx" ;;
21673 I18N/Langinfo|i18n_lan)
21674 case "$i_langinfo$d_nl_langinfo" in
21675 $define$define) avail_ext="$avail_ext $xxx" ;;
21679 : XXX Do we need a useipcsysv variable here
21680 case "${d_msg}${d_sem}${d_shm}" in
21681 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21684 NDBM_File|ndbm_fil)
21687 case "$osname-$use64bitint" in
21690 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21693 *) avail_ext="$avail_ext $xxx" ;;
21698 ODBM_File|odbm_fil)
21699 case "${i_dbm}${i_rpcsvcdbm}" in
21701 case "$d_cplusplus" in
21702 define) ;; # delete as a function name will not work
21703 *) case "$osname-$use64bitint" in
21706 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21709 *) avail_ext="$avail_ext $xxx" ;;
21717 case "$useopcode" in
21718 true|define|y) avail_ext="$avail_ext $xxx" ;;
21722 case "$useposix" in
21723 true|define|y) avail_ext="$avail_ext $xxx" ;;
21727 case "$d_socket" in
21730 beos) ;; # not unless BONE
21731 *) avail_ext="$avail_ext $xxx" ;;
21736 Sys/Syslog|sys/syslog)
21737 : XXX syslog requires socket
21738 case "$d_socket" in
21739 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21743 case "$usethreads" in
21745 case "$use5005threads" in
21746 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
21750 threads|threads/shared)
21751 # threads and threads::shared are special cases.
21752 # To stop people from asking "Perl 5.8.0 was supposed
21753 # to have this new fancy threads implementation but my
21754 # perl doesn't have it" and from people trying to
21755 # (re)install the threads module using CPAN.pm and
21756 # CPAN.pm then offering to reinstall Perl 5.8.0,
21757 # the threads.pm and threads/shared.pm will always be
21758 # there, croaking informatively ("you need to rebuild
21759 # all of Perl with threads, sorry") when threads haven't
21760 # been compiled in.
21762 avail_ext="$avail_ext $xxx"
21768 cygwin) avail_ext="$avail_ext $xxx" ;;
21771 XS/APItest|xs/apitest)
21772 # This is just for testing. Skip it unless we have dynamic loading.
21775 $define) avail_ext="$avail_ext $xxx" ;;
21778 XS/Typemap|xs/typemap)
21779 # This is just for testing. Skip it unless we have dynamic loading.
21781 $define) avail_ext="$avail_ext $xxx" ;;
21784 *) avail_ext="$avail_ext $xxx"
21793 case "$onlyextensions" in
21795 *) keepextensions=''
21796 echo "You have requested that only certains extensions be included..." >&4
21797 for i in $onlyextensions; do
21798 case " $avail_ext " in
21800 echo "Keeping extension $i."
21801 keepextensions="$keepextensions $i"
21803 *) echo "Ignoring extension $i." ;;
21806 avail_ext="$keepextensions"
21810 case "$noextensions" in
21812 *) keepextensions=''
21813 echo "You have requested that certain extensions be ignored..." >&4
21814 for i in $avail_ext; do
21815 case " $noextensions " in
21816 *" $i "*) echo "Ignoring extension $i." ;;
21817 *) echo "Keeping extension $i.";
21818 keepextensions="$keepextensions $i"
21822 avail_ext="$keepextensions"
21826 : Now see which nonxs extensions are supported on this system.
21827 : For now assume all are.
21829 for xxx in $nonxs_extensions ; do
21831 *) nonxs_ext="$nonxs_ext $xxx"
21843 A number of extensions are supplied with $package. You may choose to
21844 compile these extensions for dynamic loading (the default), compile
21845 them into the $package executable (static loading), or not include
21846 them at all. Answer "none" to include no extensions.
21847 Note that DynaLoader is always built and need not be mentioned here.
21850 case "$dynamic_ext" in
21852 : Exclude those listed in static_ext
21854 for xxx in $avail_ext; do
21855 case " $static_ext " in
21857 *) dflt="$dflt $xxx" ;;
21864 *) dflt="$dynamic_ext"
21865 # Perhaps we are reusing an old out-of-date config.sh.
21868 if test X"$dynamic_ext" != X"$avail_ext"; then
21870 NOTICE: Your previous config.sh list may be incorrect.
21871 The extensions now available to you are
21873 but the default list from your previous config.sh is
21885 rp="What extensions do you wish to load dynamically?"
21888 none) dynamic_ext=' ' ;;
21889 *) dynamic_ext="$ans" ;;
21892 case "$static_ext" in
21894 : Exclude those already listed in dynamic linking
21896 for xxx in $avail_ext; do
21897 case " $dynamic_ext " in
21899 *) dflt="$dflt $xxx" ;;
21906 *) dflt="$static_ext"
21913 rp="What extensions do you wish to load statically?"
21916 none) static_ext=' ' ;;
21917 *) static_ext="$ans" ;;
21922 A number of extensions are supplied with $package. Answer "none"
21923 to include no extensions.
21924 Note that DynaLoader is always built and need not be mentioned here.
21927 case "$static_ext" in
21928 '') dflt="$avail_ext" ;;
21929 *) dflt="$static_ext"
21930 # Perhaps we are reusing an old out-of-date config.sh.
21933 if test X"$static_ext" != X"$avail_ext"; then
21935 NOTICE: Your previous config.sh list may be incorrect.
21936 The extensions now available to you are
21938 but the default list from your previous config.sh is
21947 : Exclude those that are not xs extensions
21951 rp="What extensions do you wish to include?"
21954 none) static_ext=' ' ;;
21955 *) static_ext="$ans" ;;
21960 # Encode is a special case. If we are building Encode as a static
21961 # extension, we need to explicitly list its subextensions as well.
21962 # For other nested extensions, this is handled automatically by
21963 # the appropriate Makefile.PL.
21964 case " $static_ext " in
21965 *" Encode "*) # Add the subextensions of Encode
21967 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21968 static_ext="$static_ext Encode/$xxx"
21974 set X $dynamic_ext $static_ext $nonxs_ext
21978 # Sanity check: We require an extension suitable for use with
21979 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21980 # should show up as failures in the test suite, but it's helpful to
21981 # catch them now.) The 'extensions' list is normally sorted
21982 # alphabetically, so we need to accept either
21983 # DB_File ... Fcntl ... IO ....
21984 # or something like
21985 # Fcntl ... NDBM_File ... IO ....
21986 case " $extensions" in
21987 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21988 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21989 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21990 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21991 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21995 : Remove libraries needed only for extensions
21996 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21997 : The exception is SunOS 4.x, which needs them.
21998 case "${osname}X${osvers}" in
22002 *) case "$usedl" in
22003 $define|true|[yY]*)
22004 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22008 *) perllibs="$libs"
22014 : Remove build directory name from cppstdin so it can be used from
22015 : either the present location or the final installed location.
22017 : Get out of the UU directory to get correct path name.
22019 case "$cppstdin" in
22021 echo "Stripping down cppstdin path name"
22027 : end of configuration questions
22029 echo "End of configuration questions."
22032 : back to where it started
22033 if test -d ../UU; then
22037 : configuration may be unconditionally patched via a 'config.arch' file
22038 if $test -f config.arch; then
22039 echo "I see a config.arch file, loading it." >&4
22043 : configuration may be patched via a 'config.over' file
22044 if $test -f config.over; then
22047 rp='I see a config.over file. Do you wish to load it?'
22050 n*) echo "OK, I'll ignore it.";;
22052 echo "Configuration override changes have been loaded."
22057 : in case they want portability, strip down executable paths
22058 case "$d_portable" in
22061 echo "Stripping down executable paths..." >&4
22062 for file in $loclist $trylist; do
22064 eval $file=`basename $temp`
22069 : create config.sh file
22071 echo "Creating config.sh..." >&4
22072 $spitshell <<EOT >config.sh
22075 # This file was produced by running the Configure script. It holds all the
22076 # definitions figured out by Configure. Should you modify one of these values,
22077 # do not forget to propagate your changes by running "Configure -der". You may
22078 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22081 # Package name : $package
22082 # Source directory : $src
22083 # Configuration time: $cf_time
22084 # Configured by : $cf_by
22085 # Target system : $myuname
22088 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22089 $spitshell <<EOT >>config.sh
22098 Revision='$Revision'
22106 alignbytes='$alignbytes'
22107 ansi2knr='$ansi2knr'
22108 aphostname='$aphostname'
22109 api_revision='$api_revision'
22110 api_subversion='$api_subversion'
22111 api_version='$api_version'
22112 api_versionstring='$api_versionstring'
22115 archlibexp='$archlibexp'
22116 archname64='$archname64'
22117 archname='$archname'
22118 archobjs='$archobjs'
22119 asctime_r_proto='$asctime_r_proto'
22127 byteorder='$byteorder'
22129 castflags='$castflags'
22132 cccdlflags='$cccdlflags'
22133 ccdlflags='$ccdlflags'
22135 ccflags_uselargefiles='$ccflags_uselargefiles'
22137 ccsymbols='$ccsymbols'
22138 ccversion='$ccversion'
22140 cf_email='$cf_email'
22145 clocktype='$clocktype'
22147 compress='$compress'
22148 contains='$contains'
22152 cpp_stuff='$cpp_stuff'
22153 cppccsymbols='$cppccsymbols'
22154 cppflags='$cppflags'
22156 cppminus='$cppminus'
22158 cppstdin='$cppstdin'
22159 cppsymbols='$cppsymbols'
22160 crypt_r_proto='$crypt_r_proto'
22161 cryptlib='$cryptlib'
22163 ctermid_r_proto='$ctermid_r_proto'
22164 ctime_r_proto='$ctime_r_proto'
22165 d_Gconvert='$d_Gconvert'
22166 d_PRIEUldbl='$d_PRIEUldbl'
22167 d_PRIFUldbl='$d_PRIFUldbl'
22168 d_PRIGUldbl='$d_PRIGUldbl'
22169 d_PRIXU64='$d_PRIXU64'
22170 d_PRId64='$d_PRId64'
22171 d_PRIeldbl='$d_PRIeldbl'
22172 d_PRIfldbl='$d_PRIfldbl'
22173 d_PRIgldbl='$d_PRIgldbl'
22174 d_PRIi64='$d_PRIi64'
22175 d_PRIo64='$d_PRIo64'
22176 d_PRIu64='$d_PRIu64'
22177 d_PRIx64='$d_PRIx64'
22178 d_SCNfldbl='$d_SCNfldbl'
22179 d__fwalk='$d__fwalk'
22180 d_access='$d_access'
22181 d_accessx='$d_accessx'
22184 d_archlib='$d_archlib'
22185 d_asctime64='$d_asctime64'
22186 d_asctime_r='$d_asctime_r'
22189 d_attribute_deprecated='$d_attribute_deprecated'
22190 d_attribute_format='$d_attribute_format'
22191 d_attribute_malloc='$d_attribute_malloc'
22192 d_attribute_nonnull='$d_attribute_nonnull'
22193 d_attribute_noreturn='$d_attribute_noreturn'
22194 d_attribute_pure='$d_attribute_pure'
22195 d_attribute_unused='$d_attribute_unused'
22196 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22200 d_bsdgetpgrp='$d_bsdgetpgrp'
22201 d_bsdsetpgrp='$d_bsdsetpgrp'
22202 d_builtin_choose_expr='$d_builtin_choose_expr'
22203 d_builtin_expect='$d_builtin_expect'
22205 d_c99_variadic_macros='$d_c99_variadic_macros'
22206 d_casti32='$d_casti32'
22207 d_castneg='$d_castneg'
22208 d_charvspr='$d_charvspr'
22210 d_chroot='$d_chroot'
22211 d_chsize='$d_chsize'
22213 d_clearenv='$d_clearenv'
22214 d_closedir='$d_closedir'
22215 d_cmsghdr_s='$d_cmsghdr_s'
22217 d_copysignl='$d_copysignl'
22218 d_cplusplus='$d_cplusplus'
22220 d_crypt_r='$d_crypt_r'
22222 d_ctermid='$d_ctermid'
22223 d_ctermid_r='$d_ctermid_r'
22224 d_ctime64='$d_ctime64'
22225 d_ctime_r='$d_ctime_r'
22226 d_cuserid='$d_cuserid'
22227 d_dbl_dig='$d_dbl_dig'
22228 d_dbminitproto='$d_dbminitproto'
22229 d_difftime64='$d_difftime64'
22230 d_difftime='$d_difftime'
22231 d_dir_dd_fd='$d_dir_dd_fd'
22233 d_dirnamlen='$d_dirnamlen'
22234 d_dlerror='$d_dlerror'
22235 d_dlopen='$d_dlopen'
22236 d_dlsymun='$d_dlsymun'
22237 d_dosuid='$d_dosuid'
22238 d_drand48_r='$d_drand48_r'
22239 d_drand48proto='$d_drand48proto'
22241 d_eaccess='$d_eaccess'
22242 d_endgrent='$d_endgrent'
22243 d_endgrent_r='$d_endgrent_r'
22244 d_endhent='$d_endhent'
22245 d_endhostent_r='$d_endhostent_r'
22246 d_endnent='$d_endnent'
22247 d_endnetent_r='$d_endnetent_r'
22248 d_endpent='$d_endpent'
22249 d_endprotoent_r='$d_endprotoent_r'
22250 d_endpwent='$d_endpwent'
22251 d_endpwent_r='$d_endpwent_r'
22252 d_endsent='$d_endsent'
22253 d_endservent_r='$d_endservent_r'
22254 d_eofnblk='$d_eofnblk'
22255 d_eunice='$d_eunice'
22256 d_faststdio='$d_faststdio'
22257 d_fchdir='$d_fchdir'
22258 d_fchmod='$d_fchmod'
22259 d_fchown='$d_fchown'
22261 d_fcntl_can_lock='$d_fcntl_can_lock'
22262 d_fd_macros='$d_fd_macros'
22263 d_fd_set='$d_fd_set'
22264 d_fds_bits='$d_fds_bits'
22265 d_fgetpos='$d_fgetpos'
22266 d_finite='$d_finite'
22267 d_finitel='$d_finitel'
22268 d_flexfnam='$d_flexfnam'
22270 d_flockproto='$d_flockproto'
22272 d_fp_class='$d_fp_class'
22273 d_fpathconf='$d_fpathconf'
22274 d_fpclass='$d_fpclass'
22275 d_fpclassify='$d_fpclassify'
22276 d_fpclassl='$d_fpclassl'
22277 d_fpos64_t='$d_fpos64_t'
22278 d_frexpl='$d_frexpl'
22279 d_fs_data_s='$d_fs_data_s'
22280 d_fseeko='$d_fseeko'
22281 d_fsetpos='$d_fsetpos'
22282 d_fstatfs='$d_fstatfs'
22283 d_fstatvfs='$d_fstatvfs'
22285 d_ftello='$d_ftello'
22287 d_futimes='$d_futimes'
22288 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
22289 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
22290 d_getcwd='$d_getcwd'
22291 d_getespwnam='$d_getespwnam'
22292 d_getfsstat='$d_getfsstat'
22293 d_getgrent='$d_getgrent'
22294 d_getgrent_r='$d_getgrent_r'
22295 d_getgrgid_r='$d_getgrgid_r'
22296 d_getgrnam_r='$d_getgrnam_r'
22297 d_getgrps='$d_getgrps'
22298 d_gethbyaddr='$d_gethbyaddr'
22299 d_gethbyname='$d_gethbyname'
22300 d_gethent='$d_gethent'
22301 d_gethname='$d_gethname'
22302 d_gethostbyaddr_r='$d_gethostbyaddr_r'
22303 d_gethostbyname_r='$d_gethostbyname_r'
22304 d_gethostent_r='$d_gethostent_r'
22305 d_gethostprotos='$d_gethostprotos'
22306 d_getitimer='$d_getitimer'
22307 d_getlogin='$d_getlogin'
22308 d_getlogin_r='$d_getlogin_r'
22309 d_getmnt='$d_getmnt'
22310 d_getmntent='$d_getmntent'
22311 d_getnbyaddr='$d_getnbyaddr'
22312 d_getnbyname='$d_getnbyname'
22313 d_getnent='$d_getnent'
22314 d_getnetbyaddr_r='$d_getnetbyaddr_r'
22315 d_getnetbyname_r='$d_getnetbyname_r'
22316 d_getnetent_r='$d_getnetent_r'
22317 d_getnetprotos='$d_getnetprotos'
22318 d_getpagsz='$d_getpagsz'
22319 d_getpbyname='$d_getpbyname'
22320 d_getpbynumber='$d_getpbynumber'
22321 d_getpent='$d_getpent'
22322 d_getpgid='$d_getpgid'
22323 d_getpgrp2='$d_getpgrp2'
22324 d_getpgrp='$d_getpgrp'
22325 d_getppid='$d_getppid'
22326 d_getprior='$d_getprior'
22327 d_getprotobyname_r='$d_getprotobyname_r'
22328 d_getprotobynumber_r='$d_getprotobynumber_r'
22329 d_getprotoent_r='$d_getprotoent_r'
22330 d_getprotoprotos='$d_getprotoprotos'
22331 d_getprpwnam='$d_getprpwnam'
22332 d_getpwent='$d_getpwent'
22333 d_getpwent_r='$d_getpwent_r'
22334 d_getpwnam_r='$d_getpwnam_r'
22335 d_getpwuid_r='$d_getpwuid_r'
22336 d_getsbyname='$d_getsbyname'
22337 d_getsbyport='$d_getsbyport'
22338 d_getsent='$d_getsent'
22339 d_getservbyname_r='$d_getservbyname_r'
22340 d_getservbyport_r='$d_getservbyport_r'
22341 d_getservent_r='$d_getservent_r'
22342 d_getservprotos='$d_getservprotos'
22343 d_getspnam='$d_getspnam'
22344 d_getspnam_r='$d_getspnam_r'
22345 d_gettimeod='$d_gettimeod'
22346 d_gmtime64='$d_gmtime64'
22347 d_gmtime_r='$d_gmtime_r'
22348 d_gnulibc='$d_gnulibc'
22349 d_grpasswd='$d_grpasswd'
22350 d_hasmntopt='$d_hasmntopt'
22352 d_ilogbl='$d_ilogbl'
22353 d_inc_version_list='$d_inc_version_list'
22355 d_inetaton='$d_inetaton'
22356 d_int64_t='$d_int64_t'
22357 d_isascii='$d_isascii'
22358 d_isfinite='$d_isfinite'
22361 d_isnanl='$d_isnanl'
22362 d_killpg='$d_killpg'
22363 d_lchown='$d_lchown'
22364 d_ldbl_dig='$d_ldbl_dig'
22365 d_libm_lib_version='$d_libm_lib_version'
22367 d_localtime64='$d_localtime64'
22368 d_localtime_r='$d_localtime_r'
22369 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
22370 d_locconv='$d_locconv'
22372 d_longdbl='$d_longdbl'
22373 d_longlong='$d_longlong'
22374 d_lseekproto='$d_lseekproto'
22376 d_madvise='$d_madvise'
22377 d_malloc_good_size='$d_malloc_good_size'
22378 d_malloc_size='$d_malloc_size'
22380 d_mbstowcs='$d_mbstowcs'
22381 d_mbtowc='$d_mbtowc'
22382 d_memchr='$d_memchr'
22383 d_memcmp='$d_memcmp'
22384 d_memcpy='$d_memcpy'
22385 d_memmove='$d_memmove'
22386 d_memset='$d_memset'
22388 d_mkdtemp='$d_mkdtemp'
22389 d_mkfifo='$d_mkfifo'
22390 d_mkstemp='$d_mkstemp'
22391 d_mkstemps='$d_mkstemps'
22392 d_mktime64='$d_mktime64'
22393 d_mktime='$d_mktime'
22396 d_modfl_pow32_bug='$d_modfl_pow32_bug'
22397 d_modflproto='$d_modflproto'
22398 d_mprotect='$d_mprotect'
22400 d_msg_ctrunc='$d_msg_ctrunc'
22401 d_msg_dontroute='$d_msg_dontroute'
22402 d_msg_oob='$d_msg_oob'
22403 d_msg_peek='$d_msg_peek'
22404 d_msg_proxy='$d_msg_proxy'
22405 d_msgctl='$d_msgctl'
22406 d_msgget='$d_msgget'
22407 d_msghdr_s='$d_msghdr_s'
22408 d_msgrcv='$d_msgrcv'
22409 d_msgsnd='$d_msgsnd'
22411 d_munmap='$d_munmap'
22412 d_mymalloc='$d_mymalloc'
22414 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
22416 d_nl_langinfo='$d_nl_langinfo'
22417 d_nv_preserves_uv='$d_nv_preserves_uv'
22418 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
22419 d_off64_t='$d_off64_t'
22420 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
22421 d_oldpthreads='$d_oldpthreads'
22422 d_oldsock='$d_oldsock'
22424 d_pathconf='$d_pathconf'
22426 d_perl_otherlibdirs='$d_perl_otherlibdirs'
22427 d_phostname='$d_phostname'
22430 d_portable='$d_portable'
22431 d_printf_format_null='$d_printf_format_null'
22432 d_procselfexe='$d_procselfexe'
22433 d_pseudofork='$d_pseudofork'
22434 d_pthread_atfork='$d_pthread_atfork'
22435 d_pthread_attr_setscope='$d_pthread_attr_setscope'
22436 d_pthread_yield='$d_pthread_yield'
22438 d_pwchange='$d_pwchange'
22439 d_pwclass='$d_pwclass'
22440 d_pwcomment='$d_pwcomment'
22441 d_pwexpire='$d_pwexpire'
22442 d_pwgecos='$d_pwgecos'
22443 d_pwpasswd='$d_pwpasswd'
22444 d_pwquota='$d_pwquota'
22447 d_random_r='$d_random_r'
22448 d_readdir64_r='$d_readdir64_r'
22449 d_readdir='$d_readdir'
22450 d_readdir_r='$d_readdir_r'
22451 d_readlink='$d_readlink'
22453 d_recvmsg='$d_recvmsg'
22454 d_rename='$d_rename'
22455 d_rewinddir='$d_rewinddir'
22457 d_safebcpy='$d_safebcpy'
22458 d_safemcpy='$d_safemcpy'
22459 d_sanemcmp='$d_sanemcmp'
22460 d_sbrkproto='$d_sbrkproto'
22461 d_scalbnl='$d_scalbnl'
22462 d_sched_yield='$d_sched_yield'
22463 d_scm_rights='$d_scm_rights'
22464 d_seekdir='$d_seekdir'
22465 d_select='$d_select'
22467 d_semctl='$d_semctl'
22468 d_semctl_semid_ds='$d_semctl_semid_ds'
22469 d_semctl_semun='$d_semctl_semun'
22470 d_semget='$d_semget'
22472 d_sendmsg='$d_sendmsg'
22473 d_setegid='$d_setegid'
22474 d_seteuid='$d_seteuid'
22475 d_setgrent='$d_setgrent'
22476 d_setgrent_r='$d_setgrent_r'
22477 d_setgrps='$d_setgrps'
22478 d_sethent='$d_sethent'
22479 d_sethostent_r='$d_sethostent_r'
22480 d_setitimer='$d_setitimer'
22481 d_setlinebuf='$d_setlinebuf'
22482 d_setlocale='$d_setlocale'
22483 d_setlocale_r='$d_setlocale_r'
22484 d_setnent='$d_setnent'
22485 d_setnetent_r='$d_setnetent_r'
22486 d_setpent='$d_setpent'
22487 d_setpgid='$d_setpgid'
22488 d_setpgrp2='$d_setpgrp2'
22489 d_setpgrp='$d_setpgrp'
22490 d_setprior='$d_setprior'
22491 d_setproctitle='$d_setproctitle'
22492 d_setprotoent_r='$d_setprotoent_r'
22493 d_setpwent='$d_setpwent'
22494 d_setpwent_r='$d_setpwent_r'
22495 d_setregid='$d_setregid'
22496 d_setresgid='$d_setresgid'
22497 d_setresuid='$d_setresuid'
22498 d_setreuid='$d_setreuid'
22499 d_setrgid='$d_setrgid'
22500 d_setruid='$d_setruid'
22501 d_setsent='$d_setsent'
22502 d_setservent_r='$d_setservent_r'
22503 d_setsid='$d_setsid'
22504 d_setvbuf='$d_setvbuf'
22508 d_shmatprototype='$d_shmatprototype'
22509 d_shmctl='$d_shmctl'
22511 d_shmget='$d_shmget'
22512 d_sigaction='$d_sigaction'
22513 d_signbit='$d_signbit'
22514 d_sigprocmask='$d_sigprocmask'
22515 d_sigsetjmp='$d_sigsetjmp'
22516 d_sitearch='$d_sitearch'
22517 d_snprintf='$d_snprintf'
22518 d_sockatmark='$d_sockatmark'
22519 d_sockatmarkproto='$d_sockatmarkproto'
22520 d_socket='$d_socket'
22521 d_socklen_t='$d_socklen_t'
22522 d_sockpair='$d_sockpair'
22523 d_socks5_init='$d_socks5_init'
22524 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
22526 d_srand48_r='$d_srand48_r'
22527 d_srandom_r='$d_srandom_r'
22528 d_sresgproto='$d_sresgproto'
22529 d_sresuproto='$d_sresuproto'
22530 d_statblks='$d_statblks'
22531 d_statfs_f_flags='$d_statfs_f_flags'
22532 d_statfs_s='$d_statfs_s'
22533 d_statvfs='$d_statvfs'
22534 d_stdio_cnt_lval='$d_stdio_cnt_lval'
22535 d_stdio_ptr_lval='$d_stdio_ptr_lval'
22536 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
22537 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
22538 d_stdio_stream_array='$d_stdio_stream_array'
22539 d_stdiobase='$d_stdiobase'
22540 d_stdstdio='$d_stdstdio'
22541 d_strchr='$d_strchr'
22542 d_strcoll='$d_strcoll'
22543 d_strctcpy='$d_strctcpy'
22544 d_strerrm='$d_strerrm'
22545 d_strerror='$d_strerror'
22546 d_strerror_r='$d_strerror_r'
22547 d_strftime='$d_strftime'
22548 d_strlcat='$d_strlcat'
22549 d_strlcpy='$d_strlcpy'
22550 d_strtod='$d_strtod'
22551 d_strtol='$d_strtol'
22552 d_strtold='$d_strtold'
22553 d_strtoll='$d_strtoll'
22554 d_strtoq='$d_strtoq'
22555 d_strtoul='$d_strtoul'
22556 d_strtoull='$d_strtoull'
22557 d_strtouq='$d_strtouq'
22558 d_strxfrm='$d_strxfrm'
22559 d_suidsafe='$d_suidsafe'
22560 d_symlink='$d_symlink'
22561 d_syscall='$d_syscall'
22562 d_syscallproto='$d_syscallproto'
22563 d_sysconf='$d_sysconf'
22564 d_sysernlst='$d_sysernlst'
22565 d_syserrlst='$d_syserrlst'
22566 d_system='$d_system'
22567 d_tcgetpgrp='$d_tcgetpgrp'
22568 d_tcsetpgrp='$d_tcsetpgrp'
22569 d_telldir='$d_telldir'
22570 d_telldirproto='$d_telldirproto'
22572 d_timegm='$d_timegm'
22574 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
22575 d_tm_tm_zone='$d_tm_tm_zone'
22576 d_tmpnam_r='$d_tmpnam_r'
22577 d_truncate='$d_truncate'
22578 d_ttyname_r='$d_ttyname_r'
22579 d_tzname='$d_tzname'
22580 d_u32align='$d_u32align'
22581 d_ualarm='$d_ualarm'
22584 d_union_semun='$d_union_semun'
22585 d_unordered='$d_unordered'
22586 d_unsetenv='$d_unsetenv'
22587 d_usleep='$d_usleep'
22588 d_usleepproto='$d_usleepproto'
22590 d_vendorarch='$d_vendorarch'
22591 d_vendorbin='$d_vendorbin'
22592 d_vendorlib='$d_vendorlib'
22593 d_vendorscript='$d_vendorscript'
22595 d_void_closedir='$d_void_closedir'
22596 d_voidsig='$d_voidsig'
22597 d_voidtty='$d_voidtty'
22598 d_volatile='$d_volatile'
22599 d_vprintf='$d_vprintf'
22600 d_vsnprintf='$d_vsnprintf'
22602 d_waitpid='$d_waitpid'
22603 d_wcstombs='$d_wcstombs'
22604 d_wctomb='$d_wctomb'
22605 d_writev='$d_writev'
22608 db_hashtype='$db_hashtype'
22609 db_prefixtype='$db_prefixtype'
22610 db_version_major='$db_version_major'
22611 db_version_minor='$db_version_minor'
22612 db_version_patch='$db_version_patch'
22613 defvoidused='$defvoidused'
22614 direntrytype='$direntrytype'
22617 doublesize='$doublesize'
22619 drand48_r_proto='$drand48_r_proto'
22621 dynamic_ext='$dynamic_ext'
22627 endgrent_r_proto='$endgrent_r_proto'
22628 endhostent_r_proto='$endhostent_r_proto'
22629 endnetent_r_proto='$endnetent_r_proto'
22630 endprotoent_r_proto='$endprotoent_r_proto'
22631 endpwent_r_proto='$endpwent_r_proto'
22632 endservent_r_proto='$endservent_r_proto'
22633 eunicefix='$eunicefix'
22636 extensions='$extensions'
22637 extern_C='$extern_C'
22639 fflushNULL='$fflushNULL'
22640 fflushall='$fflushall'
22642 firstmakefile='$firstmakefile'
22644 fpossize='$fpossize'
22645 fpostype='$fpostype'
22646 freetype='$freetype'
22649 full_csh='$full_csh'
22650 full_sed='$full_sed'
22651 gccansipedantic='$gccansipedantic'
22652 gccosandvers='$gccosandvers'
22653 gccversion='$gccversion'
22654 getgrent_r_proto='$getgrent_r_proto'
22655 getgrgid_r_proto='$getgrgid_r_proto'
22656 getgrnam_r_proto='$getgrnam_r_proto'
22657 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22658 gethostbyname_r_proto='$gethostbyname_r_proto'
22659 gethostent_r_proto='$gethostent_r_proto'
22660 getlogin_r_proto='$getlogin_r_proto'
22661 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22662 getnetbyname_r_proto='$getnetbyname_r_proto'
22663 getnetent_r_proto='$getnetent_r_proto'
22664 getprotobyname_r_proto='$getprotobyname_r_proto'
22665 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22666 getprotoent_r_proto='$getprotoent_r_proto'
22667 getpwent_r_proto='$getpwent_r_proto'
22668 getpwnam_r_proto='$getpwnam_r_proto'
22669 getpwuid_r_proto='$getpwuid_r_proto'
22670 getservbyname_r_proto='$getservbyname_r_proto'
22671 getservbyport_r_proto='$getservbyport_r_proto'
22672 getservent_r_proto='$getservent_r_proto'
22673 getspnam_r_proto='$getspnam_r_proto'
22674 gidformat='$gidformat'
22680 gmtime_r_proto='$gmtime_r_proto'
22681 gnulibc_version='$gnulibc_version'
22683 groupcat='$groupcat'
22684 groupstype='$groupstype'
22687 h_sysfile='$h_sysfile'
22690 html1dir='$html1dir'
22691 html1direxp='$html1direxp'
22692 html3dir='$html3dir'
22693 html3direxp='$html3direxp'
22702 i_arpainet='$i_arpainet'
22703 i_assert='$i_assert'
22704 i_bsdioctl='$i_bsdioctl'
22708 i_dirent='$i_dirent'
22714 i_fp_class='$i_fp_class'
22716 i_gdbm_ndbm='$i_gdbm_ndbm'
22717 i_gdbmndbm='$i_gdbmndbm'
22719 i_ieeefp='$i_ieeefp'
22720 i_inttypes='$i_inttypes'
22721 i_langinfo='$i_langinfo'
22722 i_libutil='$i_libutil'
22723 i_limits='$i_limits'
22724 i_locale='$i_locale'
22725 i_machcthr='$i_machcthr'
22726 i_malloc='$i_malloc'
22727 i_mallocmalloc='$i_mallocmalloc'
22729 i_memory='$i_memory'
22730 i_mntent='$i_mntent'
22733 i_neterrno='$i_neterrno'
22734 i_netinettcp='$i_netinettcp'
22738 i_pthread='$i_pthread'
22740 i_rpcsvcdbm='$i_rpcsvcdbm'
22743 i_shadow='$i_shadow'
22745 i_stdarg='$i_stdarg'
22746 i_stddef='$i_stddef'
22747 i_stdlib='$i_stdlib'
22748 i_string='$i_string'
22749 i_sunmath='$i_sunmath'
22750 i_sysaccess='$i_sysaccess'
22751 i_sysdir='$i_sysdir'
22752 i_sysfile='$i_sysfile'
22753 i_sysfilio='$i_sysfilio'
22755 i_sysioctl='$i_sysioctl'
22756 i_syslog='$i_syslog'
22757 i_sysmman='$i_sysmman'
22758 i_sysmode='$i_sysmode'
22759 i_sysmount='$i_sysmount'
22760 i_sysndir='$i_sysndir'
22761 i_sysparam='$i_sysparam'
22762 i_syspoll='$i_syspoll'
22763 i_sysresrc='$i_sysresrc'
22764 i_syssecrt='$i_syssecrt'
22765 i_sysselct='$i_sysselct'
22766 i_syssockio='$i_syssockio'
22767 i_sysstat='$i_sysstat'
22768 i_sysstatfs='$i_sysstatfs'
22769 i_sysstatvfs='$i_sysstatvfs'
22770 i_systime='$i_systime'
22771 i_systimek='$i_systimek'
22772 i_systimes='$i_systimes'
22773 i_systypes='$i_systypes'
22774 i_sysuio='$i_sysuio'
22776 i_sysutsname='$i_sysutsname'
22777 i_sysvfs='$i_sysvfs'
22778 i_syswait='$i_syswait'
22779 i_termio='$i_termio'
22780 i_termios='$i_termios'
22782 i_unistd='$i_unistd'
22785 i_values='$i_values'
22786 i_varargs='$i_varargs'
22787 i_varhdr='$i_varhdr'
22789 ignore_versioned_solibs='$ignore_versioned_solibs'
22790 inc_version_list='$inc_version_list'
22791 inc_version_list_init='$inc_version_list_init'
22794 initialinstalllocation='$initialinstalllocation'
22795 installarchlib='$installarchlib'
22796 installbin='$installbin'
22797 installhtml1dir='$installhtml1dir'
22798 installhtml3dir='$installhtml3dir'
22799 installman1dir='$installman1dir'
22800 installman3dir='$installman3dir'
22801 installprefix='$installprefix'
22802 installprefixexp='$installprefixexp'
22803 installprivlib='$installprivlib'
22804 installscript='$installscript'
22805 installsitearch='$installsitearch'
22806 installsitebin='$installsitebin'
22807 installsitehtml1dir='$installsitehtml1dir'
22808 installsitehtml3dir='$installsitehtml3dir'
22809 installsitelib='$installsitelib'
22810 installsiteman1dir='$installsiteman1dir'
22811 installsiteman3dir='$installsiteman3dir'
22812 installsitescript='$installsitescript'
22813 installstyle='$installstyle'
22814 installusrbinperl='$installusrbinperl'
22815 installvendorarch='$installvendorarch'
22816 installvendorbin='$installvendorbin'
22817 installvendorhtml1dir='$installvendorhtml1dir'
22818 installvendorhtml3dir='$installvendorhtml3dir'
22819 installvendorlib='$installvendorlib'
22820 installvendorman1dir='$installvendorman1dir'
22821 installvendorman3dir='$installvendorman3dir'
22822 installvendorscript='$installvendorscript'
22824 issymlink='$issymlink'
22825 ivdformat='$ivdformat'
22828 known_extensions='$known_extensions'
22831 lddlflags='$lddlflags'
22833 ldflags_uselargefiles='$ldflags_uselargefiles'
22834 ldlibpthname='$ldlibpthname'
22841 libsdirs='$libsdirs'
22842 libsfiles='$libsfiles'
22843 libsfound='$libsfound'
22844 libspath='$libspath'
22845 libswanted='$libswanted'
22846 libswanted_uselargefiles='$libswanted_uselargefiles'
22852 localtime_r_proto='$localtime_r_proto'
22853 locincpth='$locincpth'
22854 loclibpth='$loclibpth'
22855 longdblsize='$longdblsize'
22856 longlongsize='$longlongsize'
22857 longsize='$longsize'
22861 lseeksize='$lseeksize'
22862 lseektype='$lseektype'
22865 madlyobj='$madlyobj'
22866 madlysrc='$madlysrc'
22870 make_set_make='$make_set_make'
22871 mallocobj='$mallocobj'
22872 mallocsrc='$mallocsrc'
22873 malloctype='$malloctype'
22875 man1direxp='$man1direxp'
22878 man3direxp='$man3direxp'
22880 mips_type='$mips_type'
22881 mistrustnm='$mistrustnm'
22883 mmaptype='$mmaptype'
22884 modetype='$modetype'
22886 multiarch='$multiarch'
22888 myarchname='$myarchname'
22889 mydomain='$mydomain'
22890 myhostname='$myhostname'
22893 need_va_copy='$need_va_copy'
22894 netdb_hlen_type='$netdb_hlen_type'
22895 netdb_host_type='$netdb_host_type'
22896 netdb_name_type='$netdb_name_type'
22897 netdb_net_type='$netdb_net_type'
22900 nm_so_opt='$nm_so_opt'
22901 nonxs_ext='$nonxs_ext'
22903 nvEUformat='$nvEUformat'
22904 nvFUformat='$nvFUformat'
22905 nvGUformat='$nvGUformat'
22906 nv_overflows_integers_at='$nv_overflows_integers_at'
22907 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22908 nveformat='$nveformat'
22909 nvfformat='$nvfformat'
22910 nvgformat='$nvgformat'
22913 o_nonblock='$o_nonblock'
22915 old_pthread_create_joinable='$old_pthread_create_joinable'
22916 optimize='$optimize'
22917 orderlib='$orderlib'
22920 otherlibdirs='$otherlibdirs'
22924 patchlevel='$patchlevel'
22925 path_sep='$path_sep'
22928 perl_patchlevel='$perl_patchlevel'
22929 perladmin='$perladmin'
22930 perllibs='$perllibs'
22931 perlpath='$perlpath'
22933 phostname='$phostname'
22939 prefixexp='$prefixexp'
22941 privlibexp='$privlibexp'
22942 procselfexe='$procselfexe'
22943 prototype='$prototype'
22945 quadkind='$quadkind'
22946 quadtype='$quadtype'
22947 randbits='$randbits'
22948 randfunc='$randfunc'
22949 random_r_proto='$random_r_proto'
22950 randseedtype='$randseedtype'
22952 rd_nodata='$rd_nodata'
22953 readdir64_r_proto='$readdir64_r_proto'
22954 readdir_r_proto='$readdir_r_proto'
22955 revision='$revision'
22961 sGMTIME_max='$sGMTIME_max'
22962 sGMTIME_min='$sGMTIME_min'
22963 sLOCALTIME_max='$sLOCALTIME_max'
22964 sLOCALTIME_min='$sLOCALTIME_min'
22965 sPRIEUldbl='$sPRIEUldbl'
22966 sPRIFUldbl='$sPRIFUldbl'
22967 sPRIGUldbl='$sPRIGUldbl'
22968 sPRIXU64='$sPRIXU64'
22970 sPRIeldbl='$sPRIeldbl'
22971 sPRIfldbl='$sPRIfldbl'
22972 sPRIgldbl='$sPRIgldbl'
22977 sSCNfldbl='$sSCNfldbl'
22978 sched_yield='$sched_yield'
22979 scriptdir='$scriptdir'
22980 scriptdirexp='$scriptdirexp'
22982 seedfunc='$seedfunc'
22983 selectminbits='$selectminbits'
22984 selecttype='$selecttype'
22985 sendmail='$sendmail'
22986 setgrent_r_proto='$setgrent_r_proto'
22987 sethostent_r_proto='$sethostent_r_proto'
22988 setlocale_r_proto='$setlocale_r_proto'
22989 setnetent_r_proto='$setnetent_r_proto'
22990 setprotoent_r_proto='$setprotoent_r_proto'
22991 setpwent_r_proto='$setpwent_r_proto'
22992 setservent_r_proto='$setservent_r_proto'
22995 sharpbang='$sharpbang'
22996 shmattype='$shmattype'
22997 shortsize='$shortsize'
23000 sig_count='$sig_count'
23001 sig_name='$sig_name'
23002 sig_name_init='$sig_name_init'
23004 sig_num_init='$sig_num_init'
23005 sig_size='$sig_size'
23006 signal_t='$signal_t'
23007 sitearch='$sitearch'
23008 sitearchexp='$sitearchexp'
23010 sitebinexp='$sitebinexp'
23011 sitehtml1dir='$sitehtml1dir'
23012 sitehtml1direxp='$sitehtml1direxp'
23013 sitehtml3dir='$sitehtml3dir'
23014 sitehtml3direxp='$sitehtml3direxp'
23016 sitelib_stem='$sitelib_stem'
23017 sitelibexp='$sitelibexp'
23018 siteman1dir='$siteman1dir'
23019 siteman1direxp='$siteman1direxp'
23020 siteman3dir='$siteman3dir'
23021 siteman3direxp='$siteman3direxp'
23022 siteprefix='$siteprefix'
23023 siteprefixexp='$siteprefixexp'
23024 sitescript='$sitescript'
23025 sitescriptexp='$sitescriptexp'
23026 sizesize='$sizesize'
23027 sizetype='$sizetype'
23031 sockethdr='$sockethdr'
23032 socketlib='$socketlib'
23033 socksizetype='$socksizetype'
23035 spackage='$spackage'
23036 spitshell='$spitshell'
23037 srand48_r_proto='$srand48_r_proto'
23038 srandom_r_proto='$srandom_r_proto'
23040 ssizetype='$ssizetype'
23041 startperl='$startperl'
23043 static_ext='$static_ext'
23045 stdio_base='$stdio_base'
23046 stdio_bufsiz='$stdio_bufsiz'
23047 stdio_cnt='$stdio_cnt'
23048 stdio_filbuf='$stdio_filbuf'
23049 stdio_ptr='$stdio_ptr'
23050 stdio_stream_array='$stdio_stream_array'
23051 strerror_r_proto='$strerror_r_proto'
23054 subversion='$subversion'
23058 targetarch='$targetarch'
23062 timeincl='$timeincl'
23063 timetype='$timetype'
23064 tmpnam_r_proto='$tmpnam_r_proto'
23070 ttyname_r_proto='$ttyname_r_proto'
23079 uidformat='$uidformat'
23085 uquadtype='$uquadtype'
23086 use5005threads='$use5005threads'
23087 use64bitall='$use64bitall'
23088 use64bitint='$use64bitint'
23089 usecrosscompile='$usecrosscompile'
23090 usedevel='$usedevel'
23092 usedtrace='$usedtrace'
23093 usefaststdio='$usefaststdio'
23094 useithreads='$useithreads'
23095 uselargefiles='$uselargefiles'
23096 uselongdouble='$uselongdouble'
23097 usemallocwrap='$usemallocwrap'
23098 usemorebits='$usemorebits'
23099 usemultiplicity='$usemultiplicity'
23100 usemymalloc='$usemymalloc'
23102 useopcode='$useopcode'
23103 useperlio='$useperlio'
23104 useposix='$useposix'
23105 usereentrant='$usereentrant'
23106 userelocatableinc='$userelocatableinc'
23108 useshrplib='$useshrplib'
23109 usesitecustomize='$usesitecustomize'
23110 usesocks='$usesocks'
23111 usethreads='$usethreads'
23112 usevendorprefix='$usevendorprefix'
23113 usevfork='$usevfork'
23116 uvXUformat='$uvXUformat'
23117 uvoformat='$uvoformat'
23120 uvuformat='$uvuformat'
23121 uvxformat='$uvxformat'
23122 vendorarch='$vendorarch'
23123 vendorarchexp='$vendorarchexp'
23124 vendorbin='$vendorbin'
23125 vendorbinexp='$vendorbinexp'
23126 vendorhtml1dir='$vendorhtml1dir'
23127 vendorhtml1direxp='$vendorhtml1direxp'
23128 vendorhtml3dir='$vendorhtml3dir'
23129 vendorhtml3direxp='$vendorhtml3direxp'
23130 vendorlib='$vendorlib'
23131 vendorlib_stem='$vendorlib_stem'
23132 vendorlibexp='$vendorlibexp'
23133 vendorman1dir='$vendorman1dir'
23134 vendorman1direxp='$vendorman1direxp'
23135 vendorman3dir='$vendorman3dir'
23136 vendorman3direxp='$vendorman3direxp'
23137 vendorprefix='$vendorprefix'
23138 vendorprefixexp='$vendorprefixexp'
23139 vendorscript='$vendorscript'
23140 vendorscriptexp='$vendorscriptexp'
23142 version_patchlevel_string='$version_patchlevel_string'
23143 versiononly='$versiononly'
23145 voidflags='$voidflags'
23148 yaccflags='$yaccflags'
23153 : Add in command line options if available
23154 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23156 : add special variables
23157 $test -f $src/patchlevel.h && \
23158 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23159 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
23160 echo "PERL_CONFIG_SH=true" >>config.sh
23162 : propagate old symbols
23163 if $test -f UU/config.sh; then
23164 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23165 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23166 config.sh config.sh UU/oldconfig.sh |\
23167 $sort | $uniq -u >UU/oldsyms
23168 set X `cat UU/oldsyms`
23174 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23176 echo ": Variables propagated from previous config.sh file." >>config.sh
23177 for sym in `cat UU/oldsyms`; do
23178 echo " Propagating $hint variable "'$'"$sym..."
23179 eval 'tmp="$'"${sym}"'"'
23181 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23187 : Finish up by extracting the .SH files
23191 echo "Extraction done."
23201 If you'd like to make any changes to the config.sh file before I begin
23202 to configure things, do it as a shell escape now (e.g. !vi config.sh).
23205 rp="Press return or use a shell escape to edit config.sh:"
23210 *) : in case they cannot read
23211 sh 1>&4 -c "$ans";;
23216 : if this fails, just run all the .SH files by hand
23225 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
23232 Now you need to generate make dependencies by running "$make depend".
23233 You might prefer to run it in background: "$make depend > makedepend.out &"
23234 It can take a while, so you might not want to run it right now.
23239 rp="Run $make depend now?"
23243 $make depend && echo "Now you must run '$make'."
23246 echo "You must run '$make depend' then '$make'."
23249 elif test -f [Mm]akefile; then
23251 echo "Now you must run a $make."
23253 echo "Configure done."
23256 if $test -f Policy.sh; then
23259 If you compile $package on a different machine or from a different object
23260 directory, copy the Policy.sh file from this object directory to the
23261 new one before you run Configure -- this will help you with most of
23262 the policy defaults.
23266 if $test -f config.msg; then
23267 echo "Hmm. I also noted the following information while running:"
23269 $cat config.msg >&4
23272 $rm -f kit*isdone ark*isdone