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 14 17:33:05 CET 2008 [metaconfig 3.0 PL70]
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
336 initialinstalllocation=''
363 d_attribute_format=''
364 d_attribute_malloc=''
365 d_attribute_nonnull=''
366 d_attribute_noreturn=''
368 d_attribute_unused=''
369 d_attribute_warn_unused_result=''
370 d_printf_format_null=''
373 d_builtin_choose_expr=''
376 d_c99_variadic_macros=''
423 endhostent_r_proto=''
429 endprotoent_r_proto=''
435 endservent_r_proto=''
487 gethostbyaddr_r_proto=''
489 gethostbyname_r_proto=''
491 gethostent_r_proto=''
503 getnetbyaddr_r_proto=''
505 getnetbyname_r_proto=''
519 d_getprotobyname_r=''
520 getprotobyname_r_proto=''
521 d_getprotobynumber_r=''
522 getprotobynumber_r_proto=''
524 getprotoent_r_proto=''
536 getservbyname_r_proto=''
538 getservbyport_r_proto=''
540 getservent_r_proto=''
564 d_libm_lib_version=''
567 d_localtime_r_needs_tzset=''
578 d_malloc_good_size=''
620 d_old_pthread_create_joinable=''
621 old_pthread_create_joinable=''
623 d_pthread_attr_setscope=''
662 sethostent_r_proto=''
679 setprotoent_r_proto=''
691 setservent_r_proto=''
725 d_sprintf_returns_strlen=''
740 d_stdio_ptr_lval_nochange_cnt=''
741 d_stdio_ptr_lval_sets_cnt=''
946 d_inc_version_list=''
948 inc_version_list_init=''
967 ignore_versioned_solibs=''
1031 d_perl_otherlibdirs=''
1039 api_versionstring=''
1045 version_patchlevel_string=''
1049 d_nv_preserves_uv=''
1050 d_nv_zero_is_allbits_zero=''
1061 nv_preserves_uv_bits=''
1133 installsitehtml1dir=''
1136 installsitehtml3dir=''
1143 installsiteman1dir=''
1146 installsiteman3dir=''
1151 installsitescript=''
1166 d_stdio_stream_array=''
1167 stdio_stream_array=''
1180 ccflags_uselargefiles=''
1181 ldflags_uselargefiles=''
1182 libswanted_uselargefiles=''
1202 installvendorarch=''
1209 installvendorhtml1dir=''
1211 vendorhtml1direxp=''
1212 installvendorhtml3dir=''
1214 vendorhtml3direxp=''
1220 installvendorman1dir=''
1223 installvendorman3dir=''
1230 installvendorscript=''
1243 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1246 : We must find out about Eunice early
1248 if test -f /etc/unixtovms; then
1249 eunicefix=/etc/unixtovms
1251 if test -f /etc/unixtovms.exe; then
1252 eunicefix=/etc/unixtovms.exe
1255 : Set executable suffix now -- needed before hints available
1256 if test -f "/libs/version.library"; then
1259 elif test -f "/system/gnu_library/bin/ar.pm"; then
1262 elif test -n "$DJGPP"; then
1265 elif test -d c:/. -o -n "$is_os2" ; then
1271 : Trailing extension. Override this in a hint file, if needed.
1272 : Extra object files, if any, needed on this platform.
1277 : change the next line if compiling for Xenix/286 on Xenix/386
1278 xlibpth='/usr/lib/386 /lib/386'
1279 : Possible local library directories to search.
1280 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1281 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1283 : general looking path for locating libraries
1284 glibpth="/lib /usr/lib $xlibpth"
1285 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1286 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1287 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1288 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1290 : Private path used by Configure to find libraries. Its value
1291 : is prepended to libpth. This variable takes care of special
1292 : machines, like the mips. Usually, it should be empty.
1295 : default library list
1297 : some systems want to use only the non-versioned libso:s
1298 ignore_versioned_solibs=''
1302 : set usethreads on the Configure command line to enable threads.
1303 usereentrant='undef'
1304 : full support for void wanted by default
1307 : Possible local include directories to search.
1308 : Set locincpth to "" in a hint file to defeat local include searches.
1309 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1310 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1312 : no include file wanted by default
1315 : Enable -DEBUGGING and -DDEBUGGING from the command line
1322 : set useposix=false in your hint file to disable the POSIX extension.
1324 : set useopcode=false in your hint file to disable the Opcode extension.
1327 ccflags_uselargefiles=''
1328 ldflags_uselargefiles=''
1329 libswanted_uselargefiles=''
1330 : set usemultiplicity on the Configure command line to enable multiplicity.
1331 : set usesocks on the Configure command line to enable socks.
1332 : List of libraries we want.
1333 : If anyone needs extra -lxxx, put those in a hint file.
1334 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1335 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1336 : We probably want to search /usr/shlib before most other libraries.
1337 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1338 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1339 glibpth="/usr/shlib $glibpth"
1340 : Do not use vfork unless overridden by a hint file.
1343 : Find the basic shell for Bourne shell scripts
1347 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1350 if test -f "$xxx"; then
1353 : Build up a list and do a single loop so we can 'break' out.
1354 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1355 for xxx in sh bash ksh pdksh ash; do
1357 try="$try ${p}/${xxx}"
1361 if test -f "$xxx"; then
1364 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1367 elif test -f "$xxx.exe"; then
1378 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1380 Usually it's in /bin/sh. How did you even get this far?
1381 Please contact me (Perl Maintainers) at perlbug@perl.org and
1382 we'll try to straighten this all out.
1388 : see if sh knows # comments
1389 if `$sh -c '#' >/dev/null 2>&1`; then
1393 test -f $xcat$_exe || xcat=/usr/bin/cat
1394 if test ! -f $xcat$_exe; then
1395 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1396 if test -f $p/cat$_exe; then
1401 if test ! -f $xcat$_exe; then
1402 echo "Can't find cat anywhere!"
1406 echo "#!$xcat" >sharp
1410 if test -s today; then
1413 echo "#! $xcat" > sharp
1417 if test -s today; then
1425 echo "Your $sh doesn't grok # comments--I will strip them later on."
1428 echo "exec grep -v '^[ ]*#'" >spitshell
1430 $eunicefix spitshell
1431 spitshell=`pwd`/spitshell
1433 echo "I presume that if # doesn't work, #! won't work either!"
1438 : figure out how to guarantee sh startup
1440 '') startsh=${sharpbang}${sh} ;;
1452 : echo "Yup, it does."
1454 echo "Hmm... '$startsh' does not guarantee sh startup..."
1455 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1459 : Save command line options in file UU/cmdline.opt for later use in
1460 : generating config.sh.
1461 cat > cmdline.opt <<EOSH
1462 : Configure command line arguments.
1471 cat >>cmdline.opt <<EOSH
1472 config_arg$argn='$arg'
1474 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1477 arg_exp=`cat cmdl.opt`
1478 args_exp="$args_exp$args_sep'$arg_exp'"
1479 argn=`expr $argn + 1`
1484 : produce awk script to parse command line options
1485 cat >options.awk <<'EOF'
1487 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1489 len = length(optstr);
1490 for (i = 1; i <= len; i++) {
1491 c = substr(optstr, i, 1);
1492 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1503 if (substr(str, 1, 1) != "-") {
1504 printf("'%s'\n", str);
1508 for (i = 2; i <= len; i++) {
1509 c = substr(str, i, 1);
1511 printf("-%s\n", substr(str, i));
1517 printf("'%s'\n", substr(str, i + 1));
1530 : process the command line options
1531 set X `for arg in "$@"; do echo "X$arg"; done |
1532 sed -e s/X// | awk -f options.awk`
1537 : set up default values
1547 rm -f optdef.sh posthint.sh
1548 cat >optdef.sh <<EOS
1554 while test $# -gt 0; do
1556 -d) shift; fastread=yes;;
1557 -e) shift; alldone=cont;;
1561 if test -r "$1"; then
1564 echo "$me: cannot read config file $1." >&2
1570 -h) shift; error=true;;
1571 -r) shift; reuseval=true;;
1572 -s) shift; silent=true; realsilent=true;;
1573 -E) shift; alldone=exit;;
1574 -K) shift; knowitall=true;;
1575 -O) shift; override=true;;
1576 -S) shift; silent=true; extractsh=true;;
1581 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1582 echo "$me: ignoring -D $1" >&2
1585 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1586 *) echo "$1='define'" >> optdef.sh;;
1593 *=) echo "$1" >> optdef.sh;;
1595 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1596 echo "$me: ignoring -U $1" >&2
1598 *) echo "$1='undef'" >> optdef.sh;;
1609 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1613 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1614 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1620 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1621 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1622 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1623 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1624 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1625 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1631 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1633 echo "$yyy=''" >> posthint.sh ;;
1638 echo "$yyy='$zzz'" >> posthint.sh ;;
1640 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1642 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1647 echo "$yyy=$zzz" >> posthint.sh ;;
1648 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1652 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1655 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1663 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1664 [-U symbol] [-U symbol=] [-A command:symbol...]
1665 -d : use defaults for all answers.
1666 -e : go on without questioning past the production of config.sh.
1667 -f : specify an alternate default configuration file.
1668 -h : print this help message and exit (with an error status).
1669 -r : reuse C symbols value if possible (skips costly nm extraction).
1670 -s : silent mode, only echoes questions and essential information.
1671 -D : define symbol to have some value:
1672 -D symbol symbol gets the value 'define'
1673 -D symbol=value symbol gets the value 'value'
1674 common used examples (see INSTALL for more info):
1675 -Duse64bitint use 64bit integers
1676 -Duse64bitall use 64bit integers and pointers
1677 -Dusethreads use thread support
1678 -Dinc_version_list=none do not include older perl trees in @INC
1679 -DEBUGGING=none DEBUGGING options
1680 -Dcc=gcc choose your compiler
1681 -Dprefix=/opt/perl5 choose your destination
1682 -E : stop at the end of questions, after having produced config.sh.
1683 -K : do not use unless you know what you are doing.
1684 -O : let -D and -U override definitions from loaded configuration file.
1685 -S : perform variable substitutions on all .SH files (can mix with -f)
1686 -U : undefine symbol:
1687 -U symbol symbol gets the value 'undef'
1688 -U symbol= symbol gets completely empty
1690 -A : manipulate symbol after the platform specific hints have been applied:
1691 -A append:symbol=value append value to symbol
1692 -A symbol=value like append:, but with a separating space
1693 -A define:symbol=value define symbol to have value
1694 -A clear:symbol define symbol to be ''
1695 -A define:symbol define symbol to be 'define'
1696 -A eval:symbol=value define symbol to be eval of value
1697 -A prepend:symbol=value prepend value to symbol
1698 -A undef:symbol define symbol to be 'undef'
1699 -A undef:symbol= define symbol to be ''
1700 e.g.: -A prepend:libswanted='cl pthread '
1701 -A ccflags=-DSOME_MACRO
1702 -V : print version number and exit (with a zero status).
1709 case "$fastread$alldone" in
1712 case "$extractsh" in
1715 if test ! -t 0; then
1716 echo "Say 'sh Configure', not 'sh <Configure'"
1726 true) exec 1>/dev/null;;
1729 : run the defines and the undefines, if any, but leave the file out there...
1732 : create the posthint manipulation script and leave the file out there...
1737 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1738 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1739 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1740 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1741 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1744 : Some greps do not return status, grrr.
1745 echo "grimblepritz" >grimble
1746 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1748 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1754 : the following should work in any shell
1758 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1759 cat >contains <<'EOSS'
1760 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1765 : Find the path to the source tree
1768 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1772 *) src=`cd ../$src && pwd` ;;
1785 if test -f $rsrc/Configure && \
1786 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1788 : found it, so we are ok.
1791 for src in . .. ../.. ../../.. ../../../..; do
1792 if test -f ../$src/Configure && \
1793 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1804 Sorry, I can't seem to locate the source dir for $package. Please start
1805 Configure with an explicit path -- i.e. /some/path/Configure.
1813 echo "Sources for $package found in \"$src\"." >&4
1817 : script used to extract .SH files with variable substitutions
1818 cat >extract <<'EOS'
1820 echo "Doing variable substitutions on .SH files..."
1821 if test -f MANIFEST; then
1822 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1824 echo "(Looking for .SH files under the source directory.)"
1825 set x `(cd "$src"; find . -name "*.SH" -print)`
1829 0) set x `(cd "$src"; echo *.SH)`; shift;;
1831 if test ! -f "$src/$1"; then
1837 while test $name; do
1838 if test ! -d "$name"; then
1839 create="$name $create";
1840 name=`echo $name | sed -e "s|^[^/]*$||"`;
1841 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1846 for file in $create; do
1855 dir=`expr X$file : 'X\(.*\)/'`
1856 file=`expr X$file : 'X.*/\(.*\)'`
1857 (cd "$dir" && . ./$file)
1867 dir=`expr X$file : 'X\(.*\)/'`
1868 file=`expr X$file : 'X.*/\(.*\)'`
1869 (set x $dir; shift; eval $mkdir_p)
1870 sh <"$src/$dir/$file"
1879 if test -f "$src/config_h.SH"; then
1880 if test ! -f config.h; then
1881 : oops, they left it out of MANIFEST, probably, so do it anyway.
1882 . "$src/config_h.SH"
1887 : extract files and exit if asked to do so
1888 case "$extractsh" in
1890 case "$realsilent" in
1894 case "$config_sh" in
1895 '') config_sh='config.sh';;
1898 echo "Fetching answers from $config_sh..."
1901 test "$override" && . ./optdef.sh
1905 echo "Extraction done."
1910 : Eunice requires " " instead of "", can you believe it
1913 echo "Beginning of configuration questions for $package."
1915 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1917 : first determine how to suppress newline on echo command
1919 echo "Checking echo to see how to suppress newlines..."
1920 (echo "hi there\c" ; echo " ") >.echotmp
1921 if $contains c .echotmp >/dev/null 2>&1 ; then
1932 echo $n "The star should be here-->$c"
1936 : Now test for existence of everything in MANIFEST
1938 if test -f "$rsrc/MANIFEST"; then
1939 echo "First let's make sure your kit is complete. Checking..." >&4
1940 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1943 for filelist in x??; do
1944 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1946 if test -s missing; then
1950 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1952 You have the option of continuing the configuration process, despite the
1953 distinct possibility that your kit is damaged, by typing 'y'es. If you
1954 do, don't blame me if something goes wrong. I advise you to type 'n'o
1955 and contact the author (perlbug@perl.org).
1958 echo $n "Continue? [n] $c" >&4
1962 echo "Continuing..." >&4
1966 echo "ABORTING..." >&4
1971 echo "Looks good..."
1974 echo "There is no MANIFEST file. I hope your kit is complete !"
1978 : Find the appropriate value for a newline for tr
1980 if test -n "$DJGPP"; then
1983 if test X"$trnl" = X; then
1984 case "`echo foo|tr '\n' x 2>/dev/null`" in
1988 if test X"$trnl" = X; then
1989 case "`echo foo|tr '\012' x 2>/dev/null`" in
1990 foox) trnl='\012' ;;
1993 if test X"$trnl" = X; then
1994 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1995 fooxy) trnl='\n\r' ;;
1998 if test X"$trnl" = X; then
2001 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2007 : compute the number of columns on the terminal for proper question formatting
2012 : set up the echo used in my read
2013 myecho="case \"\$xxxm\" in
2014 '') echo $n \"\$rp $c\" >&4;;
2016 '') echo $n \"[\$xxxm] $c\";;
2018 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2020 echo $n \"[\$xxxm] $c\" >&4
2022 echo $n \"\$rp [\$xxxm] $c\" >&4
2028 : now set up to do reads with possible shell escape and default assignment
2034 case "\$fastread" in
2035 yes) case "\$dflt" in
2038 case "\$silent-\$rp" in
2043 *) case "\$silent" in
2044 true) case "\$rp" in
2049 while expr "X\$ans" : "X!" >/dev/null; do
2053 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2061 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2070 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2075 echo "(OK, I'll run with -d after this question.)" >&4
2078 echo "*** Sorry, \$1 not supported yet." >&4
2088 echo "*** Substitution done -- please confirm."
2090 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2095 echo "*** Error -- try again."
2102 case "\$ans\$xxxm\$nostick" in
2114 : create .config dir to save info across Configure sessions
2115 test -d ../.config || mkdir ../.config
2116 cat >../.config/README <<EOF
2117 This directory created by Configure to save information that should
2118 persist across sessions for $package.
2120 You may safely delete it if you wish.
2123 : See if we are using a devel version and want that
2124 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2126 $define|true|[yY]*) ;;
2127 *) case "$xversion" in
2130 *** WHOA THERE!!! ***
2132 This is an UNSTABLE DEVELOPMENT release.
2133 The version of this $package distribution is $xversion, that is, odd,
2134 (as opposed to even) and that signifies a development release.
2135 If you want a maintenance release, you want an even-numbered version.
2137 Do ***NOT*** install this into production use.
2138 Data corruption and crashes are possible.
2140 It is most seriously suggested that you do not continue any further
2141 unless you want to help in developing and debugging Perl.
2143 If you *still* want to build perl, you can answer 'y' now,
2144 or pass -Dusedevel to Configure.
2147 rp='Do you really want to continue?'
2151 [yY]) echo >&4 "Okay, continuing."
2152 usedevel="$define" ;;
2153 *) echo >&4 "Okay, bye."
2163 case "$versiononly" in
2164 '') versiononly="$define" ;;
2166 case "$installusrbinperl" in
2167 '') installusrbinperl="$undef" ;;
2172 : general instructions
2175 user=`(logname) 2>/dev/null`
2177 '') user=`whoami 2>&1`;;
2179 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2182 rp='Would you like to see the instructions?'
2193 This installation shell script will examine your system and ask you questions
2194 to determine how the perl5 package should be installed. If you get
2195 stuck on a question, you may use a ! shell escape to start a subshell or
2196 execute a command. Many of the questions will have default answers in square
2197 brackets; typing carriage return will give you the default.
2199 On some of the questions which ask for file or directory names you are allowed
2200 to use the ~name construct to specify the login directory belonging to "name",
2201 even if you don't have a shell which knows about that. Questions where this is
2202 allowed will be marked "(~name ok)".
2206 dflt='Type carriage return to continue'
2210 The prompter used in this script allows you to use shell variables and
2211 backticks in your answers. You may use $1, $2, etc... to refer to the words
2212 in the default answer, as if the default line was a set of arguments given to a
2213 script shell. This means you may also use $* to repeat the whole default line,
2214 so you do not have to re-type everything to add something to the default.
2216 Everytime there is a substitution, you will have to confirm. If there is an
2217 error (e.g. an unmatched backtick), the default answer will remain unchanged
2218 and you will be prompted again.
2220 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2221 the questions and use the computed defaults (or the previous answers if there
2222 was already a config.sh file). Type 'Configure -h' for a list of options.
2223 You may also start interactively and then answer '& -d' at any prompt to turn
2224 on the non-interactive behaviour for the remainder of the execution.
2230 Much effort has been expended to ensure that this shell script will run on any
2231 Unix system. If despite that it blows up on yours, your best bet is to edit
2232 Configure and run it again. If you can't run Configure for some reason,
2233 you'll have to generate a config.sh file by hand. Whatever problems you
2234 have, let me (perlbug@perl.org) know how I blew it.
2236 This installation script affects things in two ways:
2238 1) it may do direct variable substitutions on some of the files included
2240 2) it builds a config.h file for inclusion in C programs. You may edit
2241 any of these files as the need arises after running this script.
2243 If you make a mistake on a question, there is no easy way to back up to it
2244 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2245 files. Configure will offer to let you do this before it runs the SH files.
2248 dflt='Type carriage return to continue'
2250 case "$firsttime" in
2251 true) echo $user >>../.config/instruct;;
2255 : find out where common programs are
2257 echo "Locating common programs..." >&4
2270 if test -d \$dir/\$thing; then
2276 for thisthing in \$dir/\$thing; do
2277 : just loop through to pick last item
2279 if test -f \$thisthing; then
2282 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2285 elif test -f \$dir/\$thing.exe; then
2286 if test -n "$DJGPP"; then
2287 echo \$dir/\$thing.exe
2288 elif test "$eunicefix" != ":"; then
2289 : on Eunice apparently
2343 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2344 pth="$pth /lib /usr/lib"
2345 for file in $loclist; do
2349 if test -f "$xxx"; then
2352 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2353 xxx=`./loc $file $file $pth`
2356 '') xxx=`./loc $file $file $pth`;;
2357 *) xxx=`./loc $xxx $xxx $pth`;;
2359 eval $file=$xxx$_exe
2363 echo $file is in $xxx.
2366 echo $file is in $xxx.
2369 echo "I don't know where '$file' is, and my life depends on it." >&4
2370 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2376 echo "Don't worry if any of the following aren't found..."
2378 for file in $trylist; do
2382 if test -f "$xxx"; then
2385 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2386 xxx=`./loc $file $file $pth`
2389 '') xxx=`./loc $file $file $pth`;;
2390 *) xxx=`./loc $xxx $xxx $pth`;;
2392 eval $file=$xxx$_exe
2396 echo $file is in $xxx.
2399 echo $file is in $xxx.
2402 echo "I don't see $file out there, $say."
2409 echo "Substituting grep for egrep."
2416 echo "Substituting cp for ln."
2425 echo "I can't find make or gmake, and my life depends on it." >&4
2426 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2434 *) # We can't have osname yet.
2435 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2436 # Assume that gmake, if found, is definitely GNU make
2437 # and prefer it over the system make.
2438 echo "Substituting gmake for make."
2446 echo "Hopefully test is built into your sh."
2449 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2450 echo "Using the test built into your sh."
2458 echo "Hopefully echo is built into your sh."
2463 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2464 $echo $n "hi there$c" >foo1
2465 echo $n "hi there$c" >foo2
2466 if cmp foo1 foo2 >/dev/null 2>&1; then
2467 echo "They are compatible. In fact, they may be identical."
2474 They are not compatible! You are probably running ksh on a non-USG system.
2475 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2476 have echo built in and we may have to run some Bourne shell scripts. That
2477 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2480 $echo $n "The star should be here-->$c"
2487 # This question was auctioned at YAPC::Europe-2007 in Vienna
2488 # I never promised you could answer it. I only auctioned the question.
2490 The following message is sponsored by
2492 Dresden.pm<--The stars should be here.
2494 Dear Perl user, system administrator or package
2495 maintainer, the Perl community sends greetings to
2496 you. Do you (emblematical) greet back [Y/n]? n
2500 : Check what type of C compiler we use
2504 cat <<'EOSC' >>trygcc
2509 int main(int argc, char *argv[]) {
2513 if $cc -o try $ccflags $ldflags try.c; then
2516 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2522 # Skip this test because it gives a false match on output like:
2523 # ./trygcc: line 23: cc: command not found
2524 # case "`$cc -v -c try.c 2>&1`" in
2525 # *gcc*) trygcc=no ;;
2527 if $test X"$trygcc" = Xyes; then
2528 if gcc -o try -c try.c; then
2530 echo "You seem to have a working gcc, though." >&4
2531 # Switching compilers may undo the work of hints files.
2532 # The most common problem is -D_REENTRANT for threads.
2533 # This heuristic catches that case, but gets false positives
2534 # if -Dusethreads was not actually specified. Better to
2535 # bail out here with a useful message than fail
2536 # mysteriously later. Should we perhaps just try to
2537 # re-invoke Configure -Dcc=gcc config_args ?
2538 if $test -f usethreads.cbu; then
2541 *** However, any setting of the C compiler flags (e.g. for thread support)
2542 *** will be lost. It may be necessary for you to restart Configure and
2543 *** add -Dcc=gcc to your Configure command line.
2546 rp="Would you like to go ahead and try gcc anyway?"
2549 rp="Would you like to use it?"
2552 if $test -f myread; then
2555 if $test -f UU/myread; then
2558 echo "Cannot find myread, sorry. Aborting." >&2
2563 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2576 cat <<'EOSC' >>checkcc
2581 int main(int argc, char *argv[]) {
2585 if $cc -o try $ccflags $ldflags try.c; then
2588 if $test X"$despair" = Xyes; then
2589 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2592 You need to find a working C compiler.
2593 Either (purchase and) install the C compiler supplied by your OS vendor,
2594 or for a free C compiler try http://gcc.gnu.org/
2595 I cannot continue any further, aborting.
2604 : determine whether symbolic links are supported
2607 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2608 echo "Symbolic links are supported." >&4
2611 echo "Symbolic links are NOT supported." >&4
2616 : determine whether symbolic links are supported
2620 echo "Checking how to test for symbolic links..." >&4
2622 if $test "X$issymlink" = X; then
2624 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2625 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2627 if test $? = 0; then
2630 echo "Your builtin 'test -h' may be broken." >&4
2633 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2636 if test -f "$p/$test"; then
2645 echo "Trying external '$test -h'." >&4
2646 issymlink="$test -h"
2647 if $test ! -h sym >/dev/null 2>&1; then
2648 echo "External '$test -h' is broken, too." >&4
2656 if $test "X$issymlink" = X; then
2657 if $test -L sym 2>/dev/null; then
2658 issymlink="$test -L"
2659 echo "The builtin '$test -L' worked." >&4
2662 if $test "X$issymlink" != X; then
2663 echo "You can test for symbolic links with '$issymlink'." >&4
2665 echo "I do not know how you can test for symbolic links." >&4
2669 *) echo "No symbolic links, so not testing for their testing..." >&4
2674 : Make symlinks util
2675 case "$mksymlinks" in
2678 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2681 *) case "$lns:$issymlink" in
2682 *"ln"*" -s:"*"test -"?)
2683 echo "Creating the symbolic links..." >&4
2684 echo "(First creating the subdirectories...)" >&4
2686 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2688 test -z "$directory" && break
2692 if test ! -d t/base; then
2693 echo "Failed to create the subdirectories. Aborting." >&4
2696 echo "(Then creating the symlinks...)" >&4
2697 awk '{print $1}' $src/MANIFEST | while true; do
2699 test -z "$filename" && break
2700 if test -f $filename; then
2701 if $issymlink $filename; then
2705 if test -f $filename; then
2706 echo "$filename already exists, not symlinking."
2708 ln -s $src/$filename $filename
2712 if test ! -f t/base/lex.t; then
2713 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2718 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2726 : Check for Cross-Compilation
2727 case "$usecrosscompile" in
2729 $echo "Cross-compiling..."
2732 *-*-gcc) # A cross-compiling gcc, probably.
2733 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2735 # leave out ld, choosing it is more complex
2737 ranlib=$targetarch-ranlib
2738 $echo 'extern int foo;' > try.c
2739 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2741 if $test $# -gt 0; then
2743 incpth="`$echo $incpth|$sed 's/^ //'`"
2744 echo "Guessing incpth '$incpth'." >&4
2746 j="`$echo $i|$sed 's,/include$,/lib,'`"
2747 if $test -d $j; then
2751 libpth="`$echo $libpth|$sed 's/^ //'`"
2752 echo "Guessing libpth '$libpth'." >&4
2757 case "$targetarch" in
2758 '') echo "Targetarch not defined." >&4; croak=y ;;
2759 *) echo "Using targetarch $targetarch." >&4 ;;
2762 '') echo "Incpth not defined." >&4; croak=y ;;
2763 *) echo "Using incpth '$incpth'." >&4 ;;
2766 '') echo "Libpth not defined." >&4; croak=y ;;
2767 *) echo "Using libpth '$libpth'." >&4 ;;
2770 '') for i in $incpth; do
2771 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2773 echo "Guessing usrinc $usrinc." >&4
2778 '') echo "Usrinc not defined." >&4; croak=y ;;
2781 *) echo "Using usrinc $usrinc." >&4 ;;
2783 case "$targethost" in
2784 '') echo "Targethost not defined." >&4; croak=y ;;
2785 *) echo "Using targethost $targethost." >&4
2790 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2793 /*) run=$src/Cross/run
2794 targetmkdir=$src/Cross/mkdir
2796 from=$src/Cross/from
2798 *) pwd=`$test -f ../Configure & cd ..; pwd`
2800 targetmkdir=$pwd/Cross/mkdir
2802 from=$pwd/Cross/from
2805 case "$targetrun" in
2806 '') targetrun=ssh ;;
2811 case "$targetfrom" in
2812 '') targetfrom=scp ;;
2816 from=$from-$targetfrom
2817 case "$targetdir" in
2819 echo "Guessing targetdir $targetdir." >&4
2822 case "$targetuser" in
2824 echo "Guessing targetuser $targetuser." >&4
2827 case "$targetfrom" in
2831 case "$targetrun" in
2843 '') cwd=$targetdir ;;
2847 if $test ! -f \$exe.xok; then
2851 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2854 *) echo "Unknown targetrun '$targetrun'" >&4
2858 case "$targetmkdir" in
2860 cat >$targetmkdir <<EOF
2862 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2864 $chmod a+rx $targetmkdir
2866 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2878 $targetmkdir \`dirname \$f\`
2879 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2882 $targetmkdir $targetdir/\`dirname \$f\`
2883 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2896 $mkdir -p $targetdir/\`dirname \$f\`
2897 $cp \$f $targetdir/\$f || exit 1
2900 $targetmkdir $targetdir/\`dirname \$f\`
2901 $cp \$f $targetdir/\$f || exit 1
2908 *) echo "Unknown targetto '$targetto'" >&4
2912 case "$targetfrom" in
2919 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2924 cp) cat >$from <<EOF
2929 cp $targetdir/\$f . || exit 1
2934 *) echo "Unknown targetfrom '$targetfrom'" >&4
2938 if $test ! -f $run; then
2939 echo "Target 'run' script '$run' not found." >&4
2943 if $test ! -f $to; then
2944 echo "Target 'to' script '$to' not found." >&4
2948 if $test ! -f $from; then
2949 echo "Target 'from' script '$from' not found." >&4
2953 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2957 Using '$run' for remote execution,
2958 and '$from' and '$to'
2959 for remote file transfer.
2965 usecrosscompile='undef'
2970 : see whether [:lower:] and [:upper:] are supported character classes
2972 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2974 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2978 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2979 # (0xd9 and 0xe2), therefore that is a nice testing point.
2980 if test "X$up" = X -o "X$low" = X; then
2981 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2987 if test "X$up" = X -o "X$low" = X; then
2988 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2994 if test "X$up" = X -o "X$low" = X; then
2995 case "`echo RS | od -x 2>/dev/null`" in
2997 echo "Hey, this might be EBCDIC." >&4
2998 if test "X$up" = X -o "X$low" = X; then
2999 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3000 rs) up='[A-IJ-RS-Z]'
3005 if test "X$up" = X -o "X$low" = X; then
3006 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3016 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3018 echo "Using $up and $low to convert case." >&4
3021 echo "I don't know how to translate letters from upper to lower case." >&4
3022 echo "Your tr is not acting any way I know of." >&4
3026 : set up the translation script tr, must be called with ./tr of course
3030 '[A-Z][a-z]') exec $tr '$up' '$low';;
3031 '[a-z][A-Z]') exec $tr '$low' '$up';;
3038 : Try to determine whether config.sh was made on this system
3039 case "$config_sh" in
3041 myuname=`$uname -a 2>/dev/null`
3042 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3043 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3044 # because the A-Z/a-z are not consecutive.
3045 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3046 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3047 newmyuname="$myuname"
3049 case "$knowitall" in
3051 if test -f ../config.sh; then
3052 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3053 eval "`grep myuname= ../config.sh`"
3055 if test "X$myuname" = "X$newmyuname"; then
3063 : Get old answers from old config file if Configure was run on the
3064 : same system, otherwise use the hints.
3067 if test -f config.sh; then
3069 rp="I see a config.sh file. Shall I use it to set the defaults?"
3072 n*|N*) echo "OK, I'll ignore it."
3073 mv config.sh config.sh.old
3074 myuname="$newmyuname"
3076 *) echo "Fetching default answers from your old config.sh file..." >&4
3084 : Older versions did not always set $sh. Catch re-use of such
3094 if test ! -f config.sh; then
3097 First time through, eh? I have some defaults handy for some systems
3098 that need some extra help getting the Configure answers right:
3101 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3103 : Half the following guesses are probably wrong... If you have better
3104 : tests or hints, please send them to perlbug@perl.org
3105 : The metaconfig authors would also appreciate a copy...
3106 $test -f /irix && osname=irix
3107 $test -f /xenix && osname=sco_xenix
3108 $test -f /dynix && osname=dynix
3109 $test -f /dnix && osname=dnix
3110 $test -f /lynx.os && osname=lynxos
3111 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3112 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3113 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3114 $test -f /bin/mips && /bin/mips && osname=mips
3115 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3116 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3117 $test -d /usr/apollo/bin && osname=apollo
3118 $test -f /etc/saf/_sactab && osname=svr4
3119 $test -d /usr/include/minix && osname=minix
3120 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3121 if $test -d /MachTen -o -d /MachTen_Folder; then
3123 if $test -x /sbin/version; then
3124 osvers=`/sbin/version | $awk '{print $2}' |
3125 $sed -e 's/[A-Za-z]$//'`
3126 elif $test -x /usr/etc/version; then
3127 osvers=`/usr/etc/version | $awk '{print $2}' |
3128 $sed -e 's/[A-Za-z]$//'`
3134 $test -f /sys/posix.dll &&
3135 $test -f /usr/bin/what &&
3136 set X `/usr/bin/what /sys/posix.dll` &&
3137 $test "$3" = UWIN &&
3141 if $test -f $uname; then
3149 umips) osname=umips ;;
3152 [23]100) osname=mips ;;
3153 next*) osname=next ;;
3155 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3156 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3159 elif $test -f /etc/kconfig; then
3161 if test "$lns" = "$ln -s"; then
3163 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3165 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3172 if test -n "$DJGPP"; then
3181 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3183 # oslevel can fail with:
3184 # oslevel: Unable to acquire lock.
3185 *not\ found) osvers="$4"."$3" ;;
3186 '<3240'|'<>3240') osvers=3.2.0 ;;
3187 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3188 '=3250'|'>3250') osvers=3.2.5 ;;
3192 bsd386) osname=bsd386
3195 cygwin*) osname=cygwin
3198 *dc.osx) osname=dcosx
3204 domainos) osname=apollo
3210 dragonfly) osname=dragonfly
3213 dynixptx*) osname=dynixptx
3214 osvers=`echo "$4"|sed 's/^v//'`
3216 freebsd) osname=freebsd
3218 genix) osname=genix ;;
3222 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3238 netbsd*) osname=netbsd
3241 news-os) osvers="$3"
3243 4*) osname=newsos4 ;;
3247 next*) osname=next ;;
3248 nonstop-ux) osname=nonstopux ;;
3249 openbsd) osname=openbsd
3255 POSIX-BC | posix-bc ) osname=posix-bc
3258 powerux | power_ux | powermax_os | powermaxos | \
3259 powerunix | power_unix) osname=powerux
3265 solaris) osname=solaris
3267 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3274 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3278 titanos) osname=titanos
3287 ultrix) osname=ultrix
3290 osf1|mls+) case "$5" in
3293 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3296 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3299 hp*) osname=hp_osf1 ;;
3300 mips) osname=mips_osf1 ;;
3303 # UnixWare 7.1.2 is known as Open UNIX 8
3304 openunix|unixware) osname=svr5
3312 $2) case "$osname" in
3316 : svr4.x or possibly later
3326 if test -f /stand/boot ; then
3327 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3328 if test -n "$INITPROG" -a -f "$INITPROG"; then
3329 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3330 if test -n "$isesix"; then
3338 *) if test -f /etc/systemid; then
3340 set `echo $3 | $sed 's/\./ /g'` $4
3341 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3343 elif $test -f $src/hints/sco_$1_$2.sh; then
3345 elif $test -f $src/hints/sco_$1.sh; then
3350 '') : Still unknown. Probably a generic Sys V.
3359 *) case "$osname" in
3360 '') : Still unknown. Probably a generic BSD.
3368 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3369 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3370 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3373 $rm -f UU/kernel.what
3374 elif test -d c:/. -o -n "$is_os2" ; then
3381 case "$targetarch" in
3384 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3389 : Now look for a hint file osname_osvers, unless one has been
3390 : specified already.
3393 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3394 : Also try without trailing minor version numbers.
3395 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3396 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3397 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3398 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3401 *) case "$osvers" in
3404 *) if $test -f $src/hints/$file.sh ; then
3406 elif $test -f $src/hints/$xfile.sh ; then
3408 elif $test -f $src/hints/$xxfile.sh ; then
3410 elif $test -f $src/hints/$xxxfile.sh ; then
3412 elif $test -f $src/hints/$xxxxfile.sh ; then
3414 elif $test -f "$src/hints/${osname}.sh" ; then
3423 if $test -f Policy.sh ; then
3426 none) dflt="Policy" ;;
3427 *) dflt="Policy $dflt" ;;
3432 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3436 if $test -f Policy.sh ; then
3439 There's also a Policy hint file available, which should make the
3440 site-specific (policy) questions easier to answer.
3447 You may give one or more space-separated answers, or "none" if appropriate.
3448 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3449 previous run of Configure, you may specify it as well as or instead of
3450 OS-specific hints. If hints are provided for your OS, you should use them:
3451 although Perl can probably be built without hints on many platforms, using
3452 hints often improve performance and may enable features that Configure can't
3453 set up on its own. If there are no hints that match your OS, specify "none";
3454 DO NOT give a wrong version or a wrong OS.
3458 rp="Which of these apply, if any?"
3461 for file in $tans; do
3462 if $test X$file = XPolicy -a -f Policy.sh; then
3464 $cat Policy.sh >> UU/config.sh
3465 elif $test -f $src/hints/$file.sh; then
3466 . $src/hints/$file.sh
3467 $cat $src/hints/$file.sh >> UU/config.sh
3468 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3471 : Give one chance to correct a possible typo.
3472 echo "$file.sh does not exist"
3474 rp="hint to use instead?"
3476 for file in $ans; do
3477 if $test -f "$src/hints/$file.sh"; then
3478 . $src/hints/$file.sh
3479 $cat $src/hints/$file.sh >> UU/config.sh
3480 elif $test X$ans = X -o X$ans = Xnone ; then
3483 echo "$file.sh does not exist -- ignored."
3490 : Remember our hint file for later.
3491 if $test -f "$src/hints/$file.sh" ; then
3501 echo "Fetching default answers from $config_sh..." >&4
3505 cp $config_sh config.sh 2>/dev/null
3515 test "$override" && . ./optdef.sh
3517 : Restore computed paths
3518 for file in $loclist $trylist; do
3519 eval $file="\$_$file"
3524 Configure uses the operating system name and version to set some defaults.
3525 The default value is probably right if the name rings a bell. Otherwise,
3526 since spelling matters for me, either accept the default or answer "none"
3533 ''|' '|none) dflt=none ;;
3534 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3537 *) dflt="$osname" ;;
3539 rp="Operating system name?"
3543 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3549 ''|' '|none) dflt=none ;;
3550 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3551 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3553 ''|' ') dflt=none ;;
3558 *) dflt="$osvers" ;;
3560 rp="Operating system version?"
3570 : who configured the system
3571 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3574 cf_by=`(logname) 2>/dev/null`
3577 cf_by=`(whoami) 2>/dev/null`
3579 "") cf_by=unknown ;;
3584 : decide how portable to be. Allow command line overrides.
3585 case "$d_portable" in
3587 *) d_portable="$define" ;;
3590 : set up shell script to do ~ expansion
3596 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3599 if $test -f /bin/csh; then
3600 /bin/csh -f -c "glob \$1"
3605 name=\`$expr x\$1 : '..\([^/]*\)'\`
3606 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3607 if $test ! -d "\$dir"; then
3609 echo "\$me: can't locate home directory for: \$name" >&2
3614 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3630 : now set up to get a file name
3634 cat <<'EOSC' >>getfile
3650 : getfile will accept an answer from the comma-separated list
3651 : enclosed in parentheses even if it does not meet other criteria.
3652 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3653 fn=`echo $fn | sed 's/(.*)//'`
3659 loc_file=`expr $fn : '.*:\(.*\)'`
3660 fn=`expr $fn : '\(.*\):.*'`
3668 */*) fullpath=true;;
3677 *e*) exp_file=true;;
3680 *p*) nopath_ok=true;;
3685 *d*) type='Directory';;
3686 *l*) type='Locate';;
3691 Locate) what='File';;
3696 case "$d_portable" in
3704 while test "$type"; do
3709 true) rp="$rp (~name ok)";;
3712 if test -f UU/getfile.ok && \
3713 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3732 value=`UU/filexp $ans`
3735 if test "$ans" != "$value"; then
3736 echo "(That expands to $value on this system.)"
3750 /*) value="$ansexp" ;;
3751 [a-zA-Z]:/*) value="$ansexp" ;;
3756 echo "I shall only accept a full path name, as in /bin/ls." >&4
3757 echo "Use a ! shell escape if you wish to check pathnames." >&4
3760 echo "Please give a full path name, starting with slash." >&4
3763 echo "Note that using ~name is ok provided it expands well." >&4
3776 for fp in $gfpth; do
3777 if test "X$fp" = X.; then
3782 if test -f "$pf"; then
3784 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3786 echo "($value is not a plain file, but that's ok.)"
3789 if test X"$type" = X; then
3796 for fp in $gfpth; do
3797 if test "X$fp" = X.; then
3802 direxp="$fp/$ansexp"
3804 if test -d "$direxp"; then
3812 if test -d "$ansexp"; then
3813 echo "(Looking for $loc_file in directory $value.)"
3814 value="$value/$loc_file"
3815 ansexp="$ansexp/$loc_file"
3817 if test -f "$ansexp"; then
3820 case "$nopath_ok" in
3821 true) case "$value" in
3823 *) echo "Assuming $value will be in people's path."
3839 if test "$fastread" = yes; then
3844 rp="$what $value doesn't exist. Use that name anyway?"
3863 test "X$gfpthkeep" != Xy && gfpth=""
3866 : determine root of directory hierarchy where package will be installed.
3869 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3872 dflt=`echo "$prefix" | sed 's/.$//'`
3880 By default, $package will be installed in $dflt/bin, manual pages
3881 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3882 installation directories. Typically this is something like /usr/local.
3883 If you wish to have binaries under /usr/bin but other parts of the
3884 installation under /usr/local, that's ok: you will be prompted
3885 separately for each of the installation directories, the prefix being
3886 only used to set the defaults.
3890 rp='Installation prefix to use?'
3898 *) oldprefix="$prefix";;
3908 *) afsroot=$afsroot ;;
3913 $define|true) afs=true ;;
3914 $undef|false) afs=false ;;
3915 *) if test -d $afsroot; then
3923 echo "AFS may be running... I'll be extra cautious then..." >&4
3925 echo "AFS does not seem to be running..." >&4
3928 : determine installation prefix for where package is to be installed.
3932 Since you are running AFS, I need to distinguish the directory in which
3933 files will reside from the directory in which they are installed (and from
3934 which they are presumably copied to the former directory by occult means).
3937 case "$installprefix" in
3938 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3939 *) dflt="$installprefix";;
3944 In some special cases, particularly when building $package for distribution,
3945 it is convenient to distinguish the directory in which files should be
3946 installed from the directory ($prefix) in which they will
3947 eventually reside. For most users, these two directories are the same.
3950 case "$installprefix" in
3952 *) dflt=$installprefix;;
3956 rp='What installation prefix should I use for installing files?'
3958 installprefix="$ans"
3959 installprefixexp="$ansexp"
3961 : Perform the prefixexp/installprefixexp correction if necessary
3962 cat <<EOS >installprefix
3965 cat <<'EOSC' >>installprefix
3966 : Change installation prefix, if necessary.
3967 if $test X"$prefix" != X"$installprefix"; then
3968 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3970 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3973 chmod +x installprefix
3974 $eunicefix installprefix
3976 : Set variables such as privlib and privlibexp from the output of ./getfile
3977 : performing the prefixexp/installprefixexp correction if necessary.
3978 cat <<EOS >setprefixvar
3981 cat <<'EOSC' >>setprefixvar
3982 eval "${prefixvar}=\"\$ans\""
3983 eval "${prefixvar}exp=\"\$ansexp\""
3986 chmod +x setprefixvar
3987 $eunicefix setprefixvar
3989 : set up the script used to warn in case of inconsistency
3998 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4000 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4001 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4006 echo "*** WHOA THERE!!! ***" >&4
4007 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4010 rp=" Keep the $hint value?"
4013 y) td=$was; tu=$was;;
4017 : function used to set $1 to $val
4018 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4020 $define$undef) . ./whoa; eval "$var=\$td";;
4021 $undef$define) . ./whoa; eval "$var=\$tu";;
4022 *) eval "$var=$val";;
4025 : Check is we will use socks
4027 $define|true|[yY]*) dflt='y';;
4032 Perl can be built to use the SOCKS proxy protocol library. To do so,
4033 Configure must be run with -Dusesocks. If you use SOCKS you also need
4034 to use the PerlIO abstraction layer, this will be implicitly selected.
4036 If this doesn't make any sense to you, just accept the default '$dflt'.
4038 rp='Build Perl for SOCKS?'
4041 y|Y) val="$define" ;;
4048 $define|true|[yY]*) useperlio="$define";;
4051 : Check if we want perlio
4052 case "$useperlio" in
4053 $define|true|[yY]*|'') dflt='y';;
4058 Previous version of $package used the standard IO mechanisms as
4059 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4060 alternate IO mechanisms via the PerlIO abstraction layer, but the
4061 stdio mechanism is still available if needed. The abstraction layer
4062 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4063 Using PerlIO with sfio may cause problems with some extension modules.
4065 If this doesn't make any sense to you, just accept the default '$dflt'.
4067 rp='Use the PerlIO abstraction layer?'
4074 echo "Ok, doing things the stdio way."
4083 case "$useperlio" in
4084 $define|true|[yY]*) ;;
4087 You are using the SOCKS proxy protocol library which means that you
4088 should also use the PerlIO layer. You may be headed for trouble.
4096 : get the patchlevel
4098 echo "Getting the current patchlevel..." >&4
4099 if $test -r $rsrc/patchlevel.h;then
4100 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4101 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4102 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4103 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4104 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4105 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4106 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4115 $echo "(You do not have patchlevel.h. Eek.)"
4117 if $test -r $rsrc/.patch ; then
4118 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
4119 perl_patchlevel=`cat $rsrc/.patch`
4122 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4123 version_patchlevel_string="version $patchlevel subversion $subversion"
4124 case "$perl_patchlevel" in
4126 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
4129 $echo "(You have $package $version_patchlevel_string.)"
4133 : XXX Should be a Configure test for double-dots in filenames.
4134 version=`echo $revision $patchlevel $subversion | \
4135 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4136 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4137 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4140 version=`echo $revision $patchlevel $subversion | \
4141 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4142 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4143 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4146 : Special case the 5.005_xx maintenance series, which used 5.005
4147 : without any subversion label as a subdirectory in $sitelib
4148 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4149 api_versionstring='5.005'
4152 : Do we want threads support and if so, what type
4153 case "$usethreads" in
4154 $define|true|[yY]*) dflt='y';;
4155 *) # Catch case where user specified ithreads or 5005threads but
4156 # forgot -Dusethreads (A.D. 4/2002)
4157 case "$useithreads$use5005threads" in
4159 case "$useperlio" in
4160 "$define") dflt='y' ;;
4170 Perl can be built to take advantage of threads on some systems.
4171 To do so, Configure can be run with -Dusethreads.
4173 Note that Perl built with threading support runs slightly slower
4174 and uses more memory than plain Perl. The current implementation
4175 is believed to be stable, but it is fairly new, and so should be
4176 treated with caution.
4178 If this doesn't make any sense to you, just accept the default '$dflt'.
4180 rp='Build a threading Perl?'
4183 y|Y) val="$define" ;;
4189 if $test $patchlevel -lt 9; then
4190 case "$usethreads" in
4194 Since release 5.6, Perl has had two different threading implementations,
4195 the newer interpreter-based version (ithreads) with one interpreter per
4196 thread, and the older 5.005 version (5005threads).
4197 The 5005threads version is effectively unmaintained and will probably be
4198 removed in Perl 5.10, so there should be no need to build a Perl using it
4199 unless needed for backwards compatibility with some existing 5.005threads
4203 : Default to ithreads unless overridden on command line or with
4206 case "$use5005threads" in
4207 $define|true|[yY]*) dflt='n';;
4209 case "$useithreads" in
4210 $undef|false|[nN]*) dflt='n';;
4212 rp='Use the newer interpreter-based ithreads?'
4215 y|Y) val="$define" ;;
4220 : Now set use5005threads to the opposite value.
4221 case "$useithreads" in
4222 $define) val="$undef" ;;
4229 useithreads="$undef"
4230 use5005threads="$undef"
4234 case "$useithreads$use5005threads" in
4238 You cannot have both the ithreads and the 5.005 threads enabled
4239 at the same time. Disabling the 5.005 threads since they are
4240 much less stable than the ithreads.
4243 use5005threads="$undef"
4248 : perl-5.9.x and later
4250 if test X"$usethreads" = "X$define"; then
4251 case "$use5005threads" in
4255 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4262 use5005threads="$undef"
4263 useithreads="$usethreads"
4266 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4269 *** To build with ithreads you must also use the PerlIO layer.
4270 *** Cannot continue, aborting.
4276 case "$d_oldpthreads" in
4277 '') : Configure tests would be welcome here. For now, assume undef.
4279 *) val="$d_oldpthreads" ;;
4285 : Look for a hint-file generated 'call-back-unit'. If the
4286 : user has specified that a threading perl is to be built,
4287 : we may need to set or change some other defaults.
4288 if $test -f usethreads.cbu; then
4289 echo "Your platform has some specific hints regarding threaded builds, using them..."
4292 case "$usethreads" in
4293 "$define"|true|[yY]*)
4295 (Your platform does not have any specific hints for threaded builds.
4296 Assuming POSIX threads, then.)
4302 : Check if multiplicity is required
4305 Perl can be built so that multiple Perl interpreters can coexist
4306 within the same Perl executable.
4309 case "$useithreads" in
4312 This multiple interpreter support is required for interpreter-based threads.
4316 *) case "$usemultiplicity" in
4317 $define|true|[yY]*) dflt='y';;
4321 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4322 rp='Build Perl for multiplicity?'
4325 y|Y) val="$define" ;;
4333 : Check if morebits is requested
4334 case "$usemorebits" in
4335 "$define"|true|[yY]*)
4336 use64bitint="$define"
4337 uselongdouble="$define"
4338 usemorebits="$define"
4340 *) usemorebits="$undef"
4344 : make some quick guesses about what we are up against
4346 $echo $n "Hmm... $c"
4356 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4357 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4359 echo "Looks kind of like an OSF/1 system, but we'll see..."
4361 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4362 xxx=`./loc addbib blurfl $pth`
4363 if $test -f $xxx; then
4364 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4368 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4369 echo "Looks kind of like an extended USG system, but we'll see..."
4371 echo "Looks kind of like a USG system, but we'll see..."
4375 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4376 echo "Looks kind of like a BSD system, but we'll see..."
4380 echo "Looks kind of like a Version 7 system, but we'll see..."
4383 case "$eunicefix" in
4386 There is, however, a strange, musty smell in the air that reminds me of
4387 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4391 : it so happens the Eunice I know will not run shell scripts in Unix format
4395 echo "Congratulations. You aren't running Eunice."
4399 : Detect OS2. The p_ variable is set above in the Head.U unit.
4400 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4401 : semicolon as a patch separator
4406 I have the feeling something is not exactly right, however...don't tell me...
4407 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4408 (Or you may be running DOS with DJGPP.)
4413 if test -f /xenix; then
4414 echo "Actually, this looks more like a XENIX system..."
4419 echo "It's not Xenix..."
4424 if test -f /venix; then
4425 echo "Actually, this looks more like a VENIX system..."
4432 echo "Nor is it Venix..."
4435 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4436 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4439 : Checking the C compiler
4444 rp="Use which C compiler?"
4448 : See if they have not cc but they do have gcc
4450 : Look for a hint-file generated 'call-back-unit'. Now that the
4451 : user has specified the compiler, we may need to set or change some
4453 if $test -f cc.cbu; then
4458 : Check if we are using GNU gcc and what its version is
4460 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4464 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4466 printf("%s\n", __VERSION__);
4468 printf("%s\n", "1");
4474 if $cc -o try $ccflags $ldflags try.c; then
4475 gccversion=`$run ./try`
4476 case "$gccversion" in
4477 '') echo "You are not using GNU cc." ;;
4478 *) echo "You are using GNU cc $gccversion."
4484 echo "*** WHOA THERE!!! ***" >&4
4485 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4486 case "$knowitall" in
4488 echo " You'd better start hunting for one and let me know about it." >&4
4494 case "$gccversion" in
4495 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4497 case "$gccversion" in
4498 '') gccosandvers='' ;;
4499 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4500 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4502 case "$gccosandvers" in
4503 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4504 $osname$osvers) ;; # looking good
4505 $osname*) cat <<EOM >&4
4507 *** WHOA THERE!!! ***
4509 Your gcc has not been compiled for the exact release of
4510 your operating system ($gccosandvers versus $osname$osvers).
4512 In general it is a good idea to keep gcc synchronized with
4513 the operating system because otherwise serious problems
4514 may ensue when trying to compile software, like Perl.
4516 I'm trying to be optimistic here, though, and will continue.
4517 If later during the configuration and build icky compilation
4518 problems appear (headerfile conflicts being the most common
4519 manifestation), I suggest reinstalling the gcc to match
4520 your operating system release.
4524 *) gccosandvers='' ;; # failed to parse, better be silent
4532 # gcc 3.* complain about adding -Idirectories that they already know about,
4533 # so we will take those off from locincpth.
4534 case "$gccversion" in
4536 echo "main(){}">try.c
4537 for incdir in $locincpth; do
4538 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4539 grep '^c[cp]p*[01]: warning: changing search order '`
4540 if test "X$warn" != X; then
4541 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4547 : What should the include directory be ?
4549 $echo $n "Hmm... $c"
4553 if $test -f /bin/mips && /bin/mips; then
4554 echo "Looks like a MIPS system..."
4555 $cat >usr.c <<'EOCP'
4556 #ifdef SYSTYPE_BSD43
4560 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4561 dflt='/bsd43/usr/include'
4565 mips_type='System V'
4567 $rm -f usr.c usr.out
4568 echo "and you're compiling with the $mips_type compiler and libraries."
4572 echo "Doesn't look like a MIPS system."
4582 case "$xxx_prompt" in
4585 rp='Where are the include files you want to use?'
4593 : see how we invoke the C preprocessor
4595 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4596 cat <<'EOT' >testcpp.c
4602 if test ! -f cppstdin; then
4603 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4604 # AIX cc -E doesn't show the absolute headerfile
4605 # locations but we'll cheat by using the -M flag.
4606 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
4608 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4611 echo "Keeping your $hint cppstdin wrapper."
4614 wrapper=`pwd`/cppstdin
4618 if $test "X$cppstdin" != "X" && \
4619 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4620 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4622 echo "You used to use $cppstdin $cppminus so we'll use that again."
4624 '') echo "But let's see if we can live without a wrapper..." ;;
4626 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4627 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4629 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4632 echo "(However, $cpprun $cpplast does not work, let's see...)"
4640 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4647 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4648 $cc -E <testcpp.c >testcpp.out 2>&1; \
4649 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4650 echo "Yup, it does."
4653 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4654 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4655 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4656 echo "Yup, it does."
4659 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4660 $cc -P <testcpp.c >testcpp.out 2>&1; \
4661 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4662 echo "Yipee, that works!"
4665 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4666 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4667 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4668 echo "At long last!"
4671 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4672 $cpp <testcpp.c >testcpp.out 2>&1; \
4673 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4677 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4678 $cpp - <testcpp.c >testcpp.out 2>&1; \
4679 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4680 echo "Hooray, it works! I was beginning to wonder."
4683 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4684 $wrapper <testcpp.c >testcpp.out 2>&1; \
4685 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4691 rp="No dice. I can't find a C preprocessor. Name one:"
4695 $x_cpp <testcpp.c >testcpp.out 2>&1
4696 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4697 echo "OK, that will do." >&4
4699 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4714 echo "Perhaps can we force $cc -E using a wrapper..."
4715 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4716 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4722 echo "Nope, we'll have to live without it..."
4736 "$wrapper"|'cppstdin') ;;
4737 *) $rm -f $wrapper;;
4739 $rm -f testcpp.c testcpp.out
4741 : Set private lib path
4744 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4749 '') dlist="$loclibpth $plibpth $glibpth";;
4750 *) dlist="$libpth";;
4753 : Now check and see which directories actually exist, avoiding duplicates
4757 if $test -d $xxx; then
4760 *) libpth="$libpth $xxx";;
4766 Some systems have incompatible or broken versions of libraries. Among
4767 the directories listed in the question below, please remove any you
4768 know not to be holding relevant libraries, and add any that are needed.
4769 Say "none" for none.
4780 rp="Directories to use for library searches?"
4787 : compute shared library extension
4790 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4800 On some systems, shared libraries may be available. Answer 'none' if
4801 you want to suppress searching of shared libraries for the remainder
4802 of this configuration.
4805 rp='What is the file extension used for shared libraries?'
4809 : Define several unixisms.
4810 : Hints files or command line option can be used to override them.
4811 : The convoluted testing is in case hints files set either the old
4814 '') case "$exe_ext" in
4816 *) _exe="$exe_ext" ;;
4821 '') case "$lib_ext" in
4828 '') case "$obj_ext" in
4835 '') case "$path_sep" in
4846 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4848 : Which makefile gets called first. This is used by make depend.
4849 case "$firstmakefile" in
4850 '') firstmakefile='makefile';;
4853 : Check for uselongdouble support
4855 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4858 case "$uselongdouble" in
4859 $define|true|[yY]*) dflt='y';;
4864 Perl can be built to take advantage of long doubles which
4865 (if available) may give more accuracy and range for floating point numbers.
4867 If this doesn't make any sense to you, just accept the default '$dflt'.
4869 rp='Try to use long doubles if available?'
4872 y|Y) val="$define" ;;
4878 case "$uselongdouble" in
4879 true|[yY]*) uselongdouble="$define" ;;
4882 : Look for a hint-file generated 'call-back-unit'. If the
4883 : user has specified that long doubles should be used,
4884 : we may need to set or change some other defaults.
4885 if $test -f uselongdouble.cbu; then
4886 echo "Your platform has some specific hints regarding long doubles, using them..."
4887 . ./uselongdouble.cbu
4889 case "$uselongdouble" in
4892 (Your platform does not have any specific hints for long doubles.)
4898 : Looking for optional libraries
4900 echo "Checking for optional libraries..." >&4
4905 case "$libswanted" in
4906 '') libswanted='c_s';;
4909 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4915 for thisdir in $libpth $xlibpth; do
4916 test -d $thisdir && libspath="$libspath $thisdir"
4918 for thislib in $libswanted; do
4919 for thisdir in $libspath; do
4921 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4922 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4923 $test -f "$xxx" && eval $libscheck
4924 $test -f "$xxx" && libstyle=shared
4926 if test ! -f "$xxx"; then
4927 xxx=$thisdir/lib$thislib.$so
4928 $test -f "$xxx" && eval $libscheck
4929 $test -f "$xxx" && libstyle=shared
4931 if test ! -f "$xxx"; then
4932 xxx=$thisdir/lib$thislib$_a
4933 $test -f "$xxx" && eval $libscheck
4934 $test -f "$xxx" && libstyle=static
4936 if test ! -f "$xxx"; then
4937 xxx=$thisdir/$thislib$_a
4938 $test -f "$xxx" && eval $libscheck
4939 $test -f "$xxx" && libstyle=static
4941 if test ! -f "$xxx"; then
4942 xxx=$thisdir/lib${thislib}_s$_a
4943 $test -f "$xxx" && eval $libscheck
4944 $test -f "$xxx" && libstyle=static
4945 $test -f "$xxx" && thislib=${thislib}_s
4947 if test ! -f "$xxx"; then
4948 xxx=$thisdir/Slib$thislib$_a
4949 $test -f "$xxx" && eval $libscheck
4950 $test -f "$xxx" && libstyle=static
4952 if $test -f "$xxx"; then
4954 shared) echo "Found -l$thislib (shared)." ;;
4955 static) echo "Found -l$thislib." ;;
4956 *) echo "Found -l$thislib ($libstyle)." ;;
4960 *) dflt="$dflt -l$thislib"
4961 libsfound="$libsfound $xxx"
4963 libsfiles="$libsfiles $yyy"
4964 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4965 case " $libsdirs " in
4967 *) libsdirs="$libsdirs $yyy" ;;
4974 if $test ! -f "$xxx"; then
4975 echo "No -l$thislib."
4986 ' '|'') dflt='none';;
4991 In order to compile $package on your machine, a number of libraries
4992 are usually needed. Include any other special libraries here as well.
4993 Say "none" for none. The default list is almost always right.
4997 rp="What libraries to use?"
5004 : determine optimization, if desired, or use for debug flag also
5006 ' '|$undef) dflt='none';;
5008 *) dflt="$optimize";;
5012 By default, $package compiles with the -O flag to use the optimizer.
5013 Alternately, you might want to use the symbolic debugger, which uses
5014 the -g flag (on traditional Unix systems). Either flag can be
5015 specified here. To use neither flag, specify the word "none".
5018 rp="What optimizer/debugger flag should be used?"
5022 'none') optimize=" ";;
5025 : Check what DEBUGGING is required from the command line
5026 : -DEBUGGING or -DDEBUGGING or
5027 : -DEBUGGING=both = -g + -DDEBUGGING
5028 : -DEBUGGING=-g or -Doptimize=-g = -g
5029 : -DEBUGGING=none or -UDEBUGGING =
5030 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5033 *) DEBUGGING=$EBUGGING ;;
5036 case "$DEBUGGING" in
5040 *) optimize="$optimize -g" ;;
5044 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5052 case "$DEBUGGING" in
5053 both|$define) dflt='-DDEBUGGING'
5056 : argument order is deliberate, as the flag will start with - which set could
5057 : think is an option
5058 checkccflag='check=$1; flag=$2; callback=$3;
5060 echo "Checking if your compiler accepts $flag" 2>&1;
5061 echo "int main(void) { return 0; }" > gcctest.c;
5062 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5063 echo "Yes, it does." 2>&1;
5064 if $test -s gcctest.out ; then
5065 echo "But your platform does not like it:";
5070 echo "Leaving current flags $ccflags alone." 2>&1
5072 *) dflt="$dflt $flag";
5078 echo "Nope, it does not, but that is ok." 2>&1;
5082 : We will not override a previous value, but we might want to
5083 : augment a hint file
5085 default|recommended)
5086 case "$gccversion" in
5087 1*) dflt="$dflt -fpcc-struct-return" ;;
5089 case "$optimize:$DEBUGGING" in
5090 *-g*:old) dflt="$dflt -DDEBUGGING";;
5092 case "$gccversion" in
5093 2*) if $test -d /etc/conf/kconfig.d &&
5094 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5096 # Interactive Systems (ISC) POSIX mode.
5101 case "$gccversion" in
5104 ?*) set strict-aliasing -fno-strict-aliasing
5108 # For gcc, adding -pipe speeds up compilations for some, but apparently
5109 # some assemblers can't read from stdin. (It also slows down compilations
5110 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5111 case "$gccversion" in
5117 # on x86_64 (at least) we require an extra library (libssp) in the
5118 # link command line. This library is not named, so I infer that it is
5119 # an implementation detail that may change. Hence the safest approach
5120 # is to add the flag to the flags passed to the compiler at link time,
5121 # as that way the compiler can do the right implementation dependant
5123 case "$gccversion" in
5124 ?*) set stack-protector -fstack-protector 'ldflags="$ldflags -fstack-protector"'
5131 case "$mips_type" in
5132 *BSD*|'') inclwanted="$locincpth $usrinc";;
5133 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5135 for thisincl in $inclwanted; do
5136 if $test -d $thisincl; then
5137 if $test x$thisincl != x$usrinc; then
5139 *" -I$thisincl "*);;
5140 *) dflt="$dflt -I$thisincl ";;
5146 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5148 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5156 *) dflt="$dflt -D$2";;
5160 set signal.h LANGUAGE_C; eval $inctest
5164 ccflags="$ccflags -DSOCKS"
5169 default|recommended) dflt="$ccflags $dflt" ;;
5170 *) dflt="$ccflags";;
5179 Your C compiler may want other flags. For this question you should include
5180 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5181 but you should NOT include libraries or ld flags like -lwhatever. If you
5182 want $package to honor its debug switch, you should include -DDEBUGGING here.
5183 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5185 To use no flags, specify the word "none".
5191 rp="Any additional cc flags?"
5198 : the following weeds options from ccflags that are of no interest to cpp
5200 '') cppflags="$ccflags" ;;
5201 *) cppflags="$cppflags $ccflags" ;;
5203 case "$gccversion" in
5204 1*) cppflags="$cppflags -D__GNUC__"
5206 case "$mips_type" in
5208 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5214 echo "Let me guess what the preprocessor flags are..." >&4
5228 *) ftry="$previous $flag";;
5230 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5231 >cpp1.out 2>/dev/null && \
5232 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5233 >cpp2.out 2>/dev/null && \
5234 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5235 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5237 cppflags="$cppflags $ftry"
5247 *-*) echo "They appear to be: $cppflags";;
5249 $rm -f cpp.c cpp?.out
5253 : flags used in final linking phase
5255 '') if ./venix; then
5261 *-posix*) dflt="$dflt -posix" ;;
5264 *) dflt="$ldflags";;
5267 : Try to guess additional flags to pick up local libraries.
5268 for thislibdir in $libpth; do
5269 case " $loclibpth " in
5272 *"-L$thislibdir "*) ;;
5273 *) dflt="$dflt -L$thislibdir" ;;
5285 Your C linker may need flags. For this question you should
5286 include -L/whatever and any other flags used by the C linker, but you
5287 should NOT include libraries like -lwhatever.
5289 Make sure you include the appropriate -L/path flags if your C linker
5290 does not normally search all of the directories you specified above,
5293 To use no flags, specify the word "none".
5297 rp="Any additional ld flags (NOT including libraries)?"
5303 rmlist="$rmlist pdp11"
5307 echo "Checking your choice of C compiler and flags for coherency..." >&4
5308 $cat > try.c <<'EOF'
5310 int main() { printf("Ok\n"); return(0); }
5312 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5314 $cat >try.msg <<'EOM'
5315 I've tried to compile and run the following simple program:
5318 $cat try.c >> try.msg
5320 $cat >> try.msg <<EOM
5327 and I got the following output:
5331 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5332 if $sh -c "$run ./try " >>try.msg 2>&1; then
5336 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5339 cat >> try.msg <<'EOQS'
5340 If $libs contains -lsfio, and sfio is mis-configured, then it
5341 sometimes (apparently) runs and exits with a 0 status, but with no
5342 output! It may have to do with sfio's use of _exit vs. exit.
5345 rp="You have a big problem. Shall I abort Configure"
5352 echo "The program compiled OK, but exited with status $?." >>try.msg
5353 rp="You have a problem. Shall I abort Configure"
5357 echo "I can't compile the test program." >>try.msg
5358 rp="You have a BIG problem. Shall I abort Configure"
5364 case "$knowitall" in
5366 echo "(The supplied flags or libraries might be incorrect.)"
5374 *) echo "Ok. Stopping Configure." >&4
5379 n) echo "OK, that should do.";;
5381 $rm_try gcctest gcctest.out
5383 : define a shorthand compile call
5387 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5388 : define a shorthand compile call for compilations that should be ok.
5392 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5394 : determine filename position in cpp output
5396 echo "Computing filename position in cpp output for #include directives..." >&4
5398 vos) testaccess=-e ;;
5401 echo '#include <stdio.h>' > foo.c
5404 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5405 $grep '^[ ]*#.*stdio\.h' | \
5406 while read cline; do
5409 while $test \$# -gt 0; do
5410 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5415 pos=\`expr \$pos + 1\`
5427 *) pos="${fieldn}th";;
5429 echo "Your cpp writes the filename in the $pos field of the line."
5432 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5433 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5436 : locate header file
5441 for usrincdir in $usrinc
5443 if test -f \$usrincdir/\$wanted; then
5444 echo "\$usrincdir/\$wanted"
5448 awkprg='{ print \$$fieldn }'
5449 echo "#include <\$wanted>" > foo\$\$.c
5450 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5451 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5452 while read cline; do
5453 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5455 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5456 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5461 # status = 0: grep returned 0 lines, case statement not executed
5462 # status = 1: headerfile found
5463 # status = 2: while loop executed, no headerfile found
5467 if test \$status -eq 1; then
5474 : define an alternate in-header-list? function
5475 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5476 cont=true; xxf="echo \"<\$1> found.\" >&4";
5477 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5478 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5480 case $# in 4) instead=instead;; *) instead="at last";; esac;
5481 while $test "$cont"; do
5483 var=$2; eval "was=\$$2";
5484 if $test "$xxx" && $test -r "$xxx";
5486 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5489 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5490 set $yyy; shift; shift; yyy=$@;
5491 case $# in 0) cont="";;
5492 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5493 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5494 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5495 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5499 do set $yyy; var=$2; eval "was=\$$2";
5500 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5501 set $yyy; shift; shift; yyy=$@;
5504 : see if stdlib is available
5505 set stdlib.h i_stdlib
5508 : check for lengths of integral types
5512 echo "Checking to see how big your integers are..." >&4
5521 printf("intsize=%d;\n", (int)sizeof(int));
5522 printf("longsize=%d;\n", (int)sizeof(long));
5523 printf("shortsize=%d;\n", (int)sizeof(short));
5528 if eval $compile_ok && $run ./try > /dev/null; then
5530 echo "Your integers are $intsize bytes long."
5531 echo "Your long integers are $longsize bytes long."
5532 echo "Your short integers are $shortsize bytes long."
5536 Help! I can't compile and run the intsize test program: please enlighten me!
5537 (This is probably a misconfiguration in your system or libraries, and
5538 you really ought to fix it. Still, I'll try anyway.)
5542 rp="What is the size of an integer (in bytes)?"
5546 rp="What is the size of a long integer (in bytes)?"
5550 rp="What is the size of a short integer (in bytes)?"
5558 : check for long long
5560 echo "Checking to see if you have long long..." >&4
5561 echo 'int main() { long long x = 7; return 0; }' > try.c
5563 if eval $compile; then
5565 echo "You have long long."
5568 echo "You do not have long long."
5574 : check for length of long long
5575 case "${d_longlong}${longlongsize}" in
5578 echo "Checking to see how big your long longs are..." >&4
5579 $cat >try.c <<'EOCP'
5583 printf("%d\n", (int)sizeof(long long));
5588 if eval $compile_ok; then
5589 longlongsize=`$run ./try`
5590 echo "Your long longs are $longlongsize bytes long."
5594 echo "(I can't seem to compile the test program. Guessing...)"
5595 rp="What is the size of a long long (in bytes)?"
5599 if $test "X$longsize" = "X$longlongsize"; then
5600 echo "(That isn't any different from an ordinary long.)"
5606 : see if inttypes.h is available
5607 : we want a real compile instead of Inhdr because some systems
5608 : have an inttypes.h which includes non-existent headers
5611 #include <inttypes.h>
5613 static int32_t foo32 = 0x12345678;
5617 if eval $compile; then
5618 echo "<inttypes.h> found." >&4
5621 echo "<inttypes.h> NOT found." >&4
5630 echo "Checking to see if you have int64_t..." >&4
5632 #include <sys/types.h>
5633 #$i_inttypes I_INTTYPES
5635 #include <inttypes.h>
5637 int main() { int64_t x = 7; }
5640 if eval $compile; then
5642 echo "You have int64_t."
5645 echo "You do not have int64_t."
5651 : Check if 64bit ints have a quad type
5653 echo "Checking which 64-bit integer type we could use..." >&4
5659 val='"unsigned int"'
5664 *) case "$longsize" in
5668 val='"unsigned long"'
5673 *) case "$d_longlong:$longlongsize" in
5678 val='"unsigned long long"'
5683 *) case "$d_int64_t" in
5702 '') echo "Alas, no 64-bit integer types in sight." >&4
5705 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5710 : Do we want 64bit support
5711 case "$uselonglong" in
5712 "$define"|true|[yY]*)
5715 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5717 use64bitint="$define"
5720 case "$use64bits" in
5721 "$define"|true|[yY]*)
5724 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5726 use64bitint="$define"
5729 case "$use64bitints" in
5730 "$define"|true|[yY]*)
5733 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5735 use64bitint="$define"
5738 case "$use64bitsint" in
5739 "$define"|true|[yY]*)
5742 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5744 use64bitint="$define"
5747 case "$uselonglongs" in
5748 "$define"|true|[yY]*)
5751 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5753 use64bitint="$define"
5756 case "$use64bitsall" in
5757 "$define"|true|[yY]*)
5760 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5762 use64bitall="$define"
5767 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5769 case "$use64bitall" in
5770 "$define"|true|[yY]*) use64bitint="$define" ;;
5776 You have natively 64-bit long integers.
5780 *) case "$use64bitint" in
5781 "$define"|true|[yY]*) dflt='y';;
5790 Perl can be built to take advantage of 64-bit integer types
5791 on some systems. To do so, Configure can be run with -Duse64bitint.
5792 Choosing this option will most probably introduce binary incompatibilities.
5794 If this doesn't make any sense to you, just accept the default '$dflt'.
5795 (The default has been chosen based on your configuration.)
5797 rp='Try to use 64-bit integers, if available?'
5800 [yY]*) val="$define" ;;
5808 case "$use64bitall" in
5809 "$define"|true|[yY]*) dflt='y' ;;
5810 *) case "$longsize" in
5818 You may also choose to try maximal 64-bitness. It means using as much
5819 64-bitness as possible on the platform. This in turn means even more
5820 binary incompatibilities. On the other hand, your platform may not
5821 have any more 64-bitness available than what you already have chosen.
5823 If this doesn't make any sense to you, just accept the default '$dflt'.
5824 (The default has been chosen based on your configuration.)
5826 rp='Try to use maximal 64-bit support, if available?'
5829 [yY]*) val="$define" ;;
5834 case "$use64bitall" in
5836 case "$use64bitint" in
5840 Since you have chosen a maximally 64-bit build, I'm also turning on
5841 the use of 64-bit integers.
5843 use64bitint="$define" ;;
5848 : Look for a hint-file generated 'call-back-unit'. If the
5849 : user has specified that a 64-bit perl is to be built,
5850 : we may need to set or change some other defaults.
5851 if $test -f use64bitint.cbu; then
5852 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5855 case "$use64bitint" in
5856 "$define"|true|[yY]*)
5858 4) case "$archname64" in
5859 '') archname64=64int ;;
5866 : Look for a hint-file generated 'call-back-unit'. If the
5867 : user has specified that a maximally 64-bit perl is to be built,
5868 : we may need to set or change some other defaults.
5869 if $test -f use64bitall.cbu; then
5870 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5873 case "$use64bitall" in
5874 "$define"|true|[yY]*)
5876 4) case "$archname64" in
5877 ''|64int) archname64=64all ;;
5884 case "$d_quad:$use64bitint" in
5888 *** You have chosen to use 64-bit integers,
5889 *** but none can be found.
5890 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5891 *** Cannot continue, aborting.
5898 : check for length of double
5900 case "$doublesize" in
5902 echo "Checking to see how big your double precision numbers are..." >&4
5911 printf("%d\n", (int)sizeof(double));
5916 if eval $compile_ok; then
5917 doublesize=`$run ./try`
5918 echo "Your double is $doublesize bytes long."
5921 echo "(I can't seem to compile the test program. Guessing...)"
5922 rp="What is the size of a double precision number (in bytes)?"
5930 : check for long doubles
5932 echo "Checking to see if you have long double..." >&4
5933 echo 'int main() { long double x = 7.0; }' > try.c
5935 if eval $compile; then
5937 echo "You have long double."
5940 echo "You do not have long double."
5946 : check for length of long double
5947 case "${d_longdbl}${longdblsize}" in
5950 echo "Checking to see how big your long doubles are..." >&4
5951 $cat >try.c <<'EOCP'
5955 printf("%d\n", sizeof(long double));
5960 if eval $compile; then
5961 longdblsize=`$run ./try`
5962 echo "Your long doubles are $longdblsize bytes long."
5966 echo "(I can't seem to compile the test program. Guessing...)" >&4
5967 rp="What is the size of a long double (in bytes)?"
5971 if $test "X$doublesize" = "X$longdblsize"; then
5972 echo "That isn't any different from an ordinary double."
5973 echo "I'll keep your setting anyway, but you may see some"
5974 echo "harmless compilation warnings."
5980 : determine the architecture name
5982 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5983 tarch=`arch`"-$osname"
5984 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5985 if uname -m > tmparch 2>&1 ; then
5986 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5987 -e 's/$/'"-$osname/" tmparch`
5995 case "$myarchname" in
5998 echo "(Your architecture name used to be $myarchname.)"
6002 case "$targetarch" in
6004 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6009 *) dflt="$archname";;
6011 rp='What is your architecture name'
6014 case "$usethreads" in
6016 echo "Threads selected." >&4
6018 *-thread*) echo "...and architecture name already has -thread." >&4
6020 *) archname="$archname-thread"
6021 echo "...setting architecture name to $archname." >&4
6026 case "$usemultiplicity" in
6028 echo "Multiplicity selected." >&4
6030 *-multi*) echo "...and architecture name already has -multi." >&4
6032 *) archname="$archname-multi"
6033 echo "...setting architecture name to $archname." >&4
6038 case "$use64bitint$use64bitall" in
6040 case "$archname64" in
6042 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6045 case "$use64bitint" in
6046 "$define") echo "64 bit integers selected." >&4 ;;
6048 case "$use64bitall" in
6049 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6052 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6054 *) archname="$archname-$archname64"
6055 echo "...setting architecture name to $archname." >&4
6061 case "$uselongdouble" in
6063 echo "Long doubles selected." >&4
6064 case "$longdblsize" in
6066 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6070 *-ld*) echo "...and architecture name already has -ld." >&4
6072 *) archname="$archname-ld"
6073 echo "...setting architecture name to $archname." >&4
6080 case "$useperlio" in
6082 echo "Perlio selected." >&4
6085 echo "Perlio not selected, using stdio." >&4
6087 *-stdio*) echo "...and architecture name already has -stdio." >&4
6089 *) archname="$archname-stdio"
6090 echo "...setting architecture name to $archname." >&4
6095 if $test -f archname.cbu; then
6096 echo "Your platform has some specific hints for architecture name, using them..."
6100 : set the prefixit variable, to compute a suitable default value
6101 prefixit='case "$3" in
6103 case "$oldprefix" in
6104 "") eval "$1=\"\$$2\"";;
6111 ""|" ") eval "$1=\"\$$2\"";;
6117 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6119 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6120 /*-$oldprefix/*|\~*-$oldprefix/*)
6121 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6122 *) eval "$1=\"\$$2\"";;
6126 : determine installation style
6127 : For now, try to deduce it from prefix unless it is already set.
6128 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6129 case "$installstyle" in
6130 '') case "$prefix" in
6131 *perl*) dflt='lib';;
6132 *) dflt='lib/perl5' ;;
6135 *) dflt="$installstyle" ;;
6137 : Probably not worth prompting for this since we prompt for all
6138 : the directories individually, and the prompt would be too long and
6142 : determine where public executables go
6147 rp='Pathname where the public executables will reside?'
6149 if $test "X$ansexp" != "X$binexp"; then
6153 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6154 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6155 : this via initialinstalllocation
6158 case "$userelocatableinc" in
6159 $define|true|[yY]*) dflt='y' ;;
6164 Would you like to build Perl so that the installation is relocatable, so that
6165 library paths in @INC are determined relative to the path of the perl binary?
6166 This is not advised for system Perl installs, or if you need to run setid
6167 scripts or scripts under taint mode.
6169 If this doesn't make any sense to you, just accept the default '$dflt'.
6171 rp='Use relocatable @INC?'
6174 y|Y) val="$define" ;;
6177 set userelocatableinc
6180 initialinstalllocation="$binexp"
6181 : Default prefix is now "up one level from where the binaries are"
6182 case "$userelocatableinc" in
6188 installprefixexp=".../.."
6192 : determine where private library files go
6193 : Usual default is /usr/local/lib/perl5/$version.
6194 : Also allow things like /opt/perl/lib/$version, since
6195 : /opt/perl/lib/perl5... would be redundant.
6196 : The default "style" setting is made in installstyle.U
6197 case "$installstyle" in
6198 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6199 *) set dflt privlib lib/$version ;;
6204 There are some auxiliary files for $package that need to be put into a
6205 private library directory that is accessible by everyone.
6210 rp='Pathname where the private library files will reside?'
6215 : set the prefixup variable, to restore leading tilda escape
6216 prefixup='case "$prefixexp" in
6218 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6221 : determine where public architecture dependent libraries go
6224 : privlib default is /usr/local/lib/$package/$version
6225 : archlib default is /usr/local/lib/$package/$version/$archname
6226 : privlib may have an optional trailing /share.
6227 tdflt=`echo $privlib | $sed 's,/share$,,'`
6228 tdflt=$tdflt/$archname
6237 $spackage contains architecture-dependent library files. If you are
6238 sharing libraries in a heterogeneous environment, you might store
6239 these files in a separate location. Otherwise, you can just include
6240 them with the rest of the public library files.
6245 rp='Where do you want to put the public architecture-dependent libraries?'
6249 if $test X"$archlib" = X"$privlib"; then
6255 : see if setuid scripts can be secure
6258 Some kernels have a bug that prevents setuid #! scripts from being
6259 secure. Some sites have disabled setuid #! scripts because of this.
6261 First let's decide if your kernel supports secure setuid #! scripts.
6262 (If setuid #! scripts would be secure but have been disabled anyway,
6263 don't say that they are secure if asked.)
6268 if $test -d /dev/fd; then
6269 echo "#!$ls" >reflect
6270 chmod +x,u+s reflect
6271 ./reflect >flect 2>&1
6272 if $contains "/dev/fd" flect >/dev/null; then
6273 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6277 If you are not sure if they are secure, I can check but I'll need a
6278 username and password different from the one you are using right now.
6279 If you don't have such a username or don't want me to test, simply
6283 rp='Other username to test security of setuid scripts with?'
6288 case "$d_suidsafe" in
6289 '') echo "I'll assume setuid scripts are *not* secure." >&4
6292 echo "Well, the $hint value is *not* secure." >&4
6294 *) echo "Well, the $hint value *is* secure." >&4
6299 $rm -f reflect flect
6300 echo "#!$ls" >reflect
6301 chmod +x,u+s reflect
6304 echo '"su" will (probably) prompt you for '"$ans's password."
6305 su $ans -c './reflect >flect'
6306 if $contains "/dev/fd" flect >/dev/null; then
6307 echo "Okay, it looks like setuid scripts are secure." >&4
6310 echo "I don't think setuid scripts are secure." >&4
6315 rp='Does your kernel have *secure* setuid scripts?'
6318 [yY]*) val="$define";;
6323 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6324 echo "(That's for file descriptors, not floppy disks.)"
6330 $rm -f reflect flect
6332 : now see if they want to do setuid emulation
6335 case "$d_suidsafe" in
6338 echo "No need to emulate SUID scripts since they are secure here." >&4
6342 Some systems have disabled setuid scripts, especially systems where
6343 setuid scripts cannot be secure. On systems where setuid scripts have
6344 been disabled, the setuid/setgid bits on scripts are currently
6345 useless. It is possible for $package to detect those bits and emulate
6346 setuid/setgid in a secure fashion. This emulation will only work if
6347 setuid scripts have been disabled in your kernel.
6351 "$define") dflt=y ;;
6354 rp="Do you want to do setuid/setgid emulation?"
6357 [yY]*) val="$define";;
6365 : Find perl5.005 or later.
6366 echo "Looking for a previously installed perl5.005 or later... "
6368 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6369 : Check if this perl is recent and can load a simple module
6370 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6373 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6383 '') echo "None found. That's ok.";;
6384 *) echo "Using $perl5." ;;
6387 : Set the siteprefix variables
6390 After $package is installed, you may wish to install various
6391 add-on modules and utilities. Typically, these add-ons will
6392 be installed under $prefix with the rest
6393 of this package. However, you may wish to install such add-ons
6394 elsewhere under a different prefix.
6396 If you do not wish to put everything under a single prefix, that's
6397 ok. You will be prompted for the individual locations; this siteprefix
6398 is only used to suggest the defaults.
6400 The default should be fine for most people.
6404 rp='Installation prefix to use for add-on modules and utilities?'
6405 : XXX Here might be another good place for an installstyle setting.
6406 case "$siteprefix" in
6408 *) dflt=$siteprefix ;;
6411 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6413 case "$siteprefix" in
6417 *) oldsiteprefix="$prefix";;
6422 siteprefixexp="$ansexp"
6424 : determine where site specific libraries go.
6425 : Usual default is /usr/local/lib/perl5/site_perl/$version
6426 : The default "style" setting is made in installstyle.U
6427 : XXX No longer works with Prefixit stuff.
6428 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6430 '') case "$installstyle" in
6431 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6432 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6440 The installation process will create a directory for
6441 site-specific extensions and modules. Most users find it convenient
6442 to place all site-specific files in this directory rather than in the
6443 main distribution directory.
6447 rp='Pathname for the site-specific library files?'
6451 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6453 : Determine list of previous versions to include in @INC
6454 $cat > getverlist <<EOPL
6457 \$api_versionstring = "$api_versionstring";
6458 \$version = "$version";
6459 \$stem = "$sitelib_stem";
6460 \$archname = "$archname";
6462 $cat >> getverlist <<'EOPL'
6463 # The list found is store twice for each entry: the original name, and
6464 # the binary broken down version as pack "sss", so sorting is easy and
6465 # unambiguous. This will work for all versions that have a maximum of
6466 # three digit groups, separate by '.'s or '_'s. Names are extended with
6467 # ".0.0" to ensure at least three elements for the pack.
6468 # -- H.Merijn Brand (m)'06 23-10-2006
6470 # Can't have leading @ because metaconfig interprets it as a command!
6471 ;@inc_version_list=();
6472 # XXX Redo to do opendir/readdir?
6475 ;@candidates = map {
6476 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6482 ($pversion, $aversion, $vsn5005) = map {
6483 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6484 foreach $d (@candidates) {
6485 if ($d->[1] lt $pversion) {
6486 if ($d->[1] ge $aversion) {
6487 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6489 elsif ($d->[1] ge $vsn5005) {
6490 unshift(@inc_version_list, grep { -d } $d->[0]);
6494 # Skip newer version. I.e. don't look in
6495 # 5.7.0 if we're installing 5.6.1.
6499 if (@inc_version_list) {
6500 print join(' ', @inc_version_list);
6503 # Blank space to preserve value for next Configure run.
6508 case "$inc_version_list" in
6509 '') if test -x "$perl5$exe_ext"; then
6510 dflt=`$perl5 getverlist`
6515 $undef) dflt='none' ;;
6516 *) eval dflt=\"$inc_version_list\" ;;
6519 ''|' ') dflt=none ;;
6526 In order to ease the process of upgrading, this version of perl
6527 can be configured to use modules built and installed with earlier
6528 versions of perl that were installed under $prefix. Specify here
6529 the list of earlier versions that this version of perl should check.
6530 If Configure detected no earlier versions of perl installed under
6531 $prefix, then the list will be empty. Answer 'none' to tell perl
6532 to not search earlier versions.
6534 The default should almost always be sensible, so if you're not sure,
6535 just accept the default.
6538 rp='List of earlier versions to include in @INC?'
6541 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6542 *) inc_version_list="$ans" ;;
6544 case "$inc_version_list" in
6546 inc_version_list_init='0'
6547 d_inc_version_list="$undef"
6549 *) inc_version_list_init=`echo $inc_version_list |
6550 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6551 d_inc_version_list="$define"
6556 : see if this is a malloc.h system
6557 : we want a real compile instead of Inhdr because some systems have a
6558 : malloc.h that just gives a compile error saying to use stdlib.h instead
6563 int main () { return 0; }
6566 if eval $compile; then
6567 echo "<malloc.h> found." >&4
6570 echo "<malloc.h> NOT found." >&4
6577 : check for void type
6579 echo "Checking to see how well your C compiler groks the void type..." >&4
6580 case "$voidflags" in
6592 extern void moo(); /* function returning void */
6593 void (*goo)(); /* ptr to func returning void */
6595 void *hue; /* generic ptr */
6608 int main() { sub(); }
6610 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6611 voidflags=$defvoidused
6612 echo "Good. It appears to support void to the level $package wants.">&4
6613 if $contains warning .out >/dev/null 2>&1; then
6614 echo "However, you might get some warnings that look like this:"
6618 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6619 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6620 echo "It supports 1..."
6621 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6622 echo "It also supports 2..."
6623 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6625 echo "And it supports 4 but not 8 definitely."
6627 echo "It doesn't support 4..."
6628 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6630 echo "But it supports 8."
6633 echo "Neither does it support 8."
6637 echo "It does not support 2..."
6638 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6640 echo "But it supports 4 and 8."
6642 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6644 echo "And it supports 4 but has not heard about 8."
6646 echo "However it supports 8 but not 4."
6651 echo "There is no support at all for void."
6656 case "$voidflags" in
6659 Support flag bits are:
6660 1: basic void declarations.
6661 2: arrays of pointers to functions returning void.
6662 4: operations between pointers to and addresses of void functions.
6663 8: generic void pointers.
6666 rp="Your void support flags add up to what?"
6673 : check for length of pointer
6677 echo "Checking to see how big your pointers are..." >&4
6678 if test "$voidflags" -gt 7; then
6679 echo '#define VOID_PTR char *' > try.c
6681 echo '#define VOID_PTR void *' > try.c
6691 printf("%d\n", (int)sizeof(VOID_PTR));
6696 if eval $compile_ok; then
6697 ptrsize=`$run ./try`
6698 echo "Your pointers are $ptrsize bytes long."
6701 echo "(I can't seem to compile the test program. Guessing...)" >&4
6702 rp="What is the size of a pointer (in bytes)?"
6709 case "$use64bitall" in
6710 "$define"|true|[yY]*)
6714 *** You have chosen a maximally 64-bit build,
6715 *** but your pointers are only 4 bytes wide.
6716 *** Please rerun Configure without -Duse64bitall.
6721 *** Since you have quads, you could possibly try with -Duse64bitint.
6726 *** Cannot continue, aborting.
6737 : determine whether to use malloc wrapping
6739 case "$usemallocwrap" in
6740 [yY]*|true|$define) dflt='y' ;;
6741 [nN]*|false|$undef) dflt='n' ;;
6742 *) case "$usedevel" in
6743 [yY]*|true|$define) dflt='y' ;;
6748 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6750 usemallocwrap="$ans"
6753 usemallocwrap="$define" ;;
6755 usemallocwrap="$undef" ;;
6758 : determine which malloc to compile in
6760 case "$usemymalloc" in
6761 [yY]*|true|$define) dflt='y' ;;
6762 [nN]*|false|$undef) dflt='n' ;;
6763 *) case "$ptrsize" in
6769 rp="Do you wish to attempt to use the malloc that comes with $package?"
6775 mallocsrc='malloc.c'
6776 mallocobj="malloc$_o"
6777 d_mymalloc="$define"
6780 : Remove malloc from list of libraries to use
6781 echo "Removing unneeded -lmalloc from library list" >&4
6782 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6785 echo "libs = $libs" >&4
6797 : compute the return types of malloc and free
6799 $cat >malloc.c <<END
6803 #include <sys/types.h>
6817 case "$malloctype" in
6819 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6826 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6830 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6837 echo "Your system uses $freetype free(), it would seem." >&4
6839 : determine where site specific architecture-dependent libraries go.
6840 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6841 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6842 : sitelib may have an optional trailing /share.
6844 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6845 dflt="$dflt/$archname"
6850 set sitearch sitearch none
6854 The installation process will also create a directory for
6855 architecture-dependent site-specific extensions and modules.
6859 rp='Pathname for the site-specific architecture-dependent library files?'
6863 if $test X"$sitearch" = X"$sitelib"; then
6866 d_sitearch="$define"
6869 : Set the vendorprefix variables
6872 The installation process will also create a directory for
6873 vendor-supplied add-ons. Vendors who supply perl with their system
6874 may find it convenient to place all vendor-supplied files in this
6875 directory rather than in the main distribution directory. This will
6876 ease upgrades between binary-compatible maintenance versions of perl.
6878 Of course you may also use these directories in whatever way you see
6879 fit. For example, you might use them to access modules shared over a
6880 company-wide network.
6882 The default answer should be fine for most people.
6883 This causes further questions about vendor add-ons to be skipped
6884 and no vendor-specific directories will be configured for perl.
6887 rp='Do you want to configure vendor-specific add-on directories?'
6888 case "$usevendorprefix" in
6889 define|true|[yY]*) dflt=y ;;
6890 *) : User may have set vendorprefix directly on Configure command line.
6891 case "$vendorprefix" in
6900 rp='Installation prefix to use for vendor-supplied add-ons?'
6901 case "$vendorprefix" in
6903 *) dflt=$vendorprefix ;;
6906 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6908 case "$vendorprefix" in
6912 *) oldvendorprefix="$prefix";;
6916 usevendorprefix="$define"
6918 vendorprefixexp="$ansexp"
6920 *) usevendorprefix="$undef"
6926 : Set the vendorlib variables
6927 case "$vendorprefix" in
6928 '') d_vendorlib="$undef"
6932 *) d_vendorlib="$define"
6933 : determine where vendor-supplied modules go.
6934 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6935 case "$vendorlib" in
6937 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6938 case "$installstyle" in
6939 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6940 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6943 *) dflt="$vendorlib"
6947 rp='Pathname for the vendor-supplied library files?'
6950 vendorlibexp="$ansexp"
6953 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6957 : Set the vendorarch variables
6958 case "$vendorprefix" in
6959 '') d_vendorarch="$undef"
6963 *) d_vendorarch="$define"
6964 : determine where vendor-supplied architecture-dependent libraries go.
6965 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6966 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6967 : vendorlib may have an optional trailing /share.
6968 case "$vendorarch" in
6969 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6970 dflt="$dflt/$archname"
6972 *) dflt="$vendorarch" ;;
6975 rp='Pathname for vendor-supplied architecture-dependent files?'
6978 vendorarchexp="$ansexp"
6981 prefixvar=vendorarch
6984 : Final catch-all directories to search
6987 Lastly, you can have perl look in other directories for extensions and
6988 modules in addition to those already specified.
6989 These directories will be searched after
6993 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6994 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6996 case "$otherlibdirs" in
6997 ''|' ') dflt='none' ;;
6998 *) dflt="$otherlibdirs" ;;
7001 Enter a colon-separated set of extra paths to include in perl's @INC
7002 search path, or enter 'none' for no extra paths.
7006 rp='Colon-separated list of additional directories for perl to search?'
7009 ' '|''|none) otherlibdirs=' ' ;;
7010 *) otherlibdirs="$ans" ;;
7012 case "$otherlibdirs" in
7016 set d_perl_otherlibdirs
7019 : Cruising for prototypes
7021 echo "Checking out function prototypes..." >&4
7022 $cat >prototype.c <<EOCP
7027 int main(int argc, char *argv[]) {
7030 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7031 echo "Your C compiler appears to support function prototypes."
7034 echo "Your C compiler doesn't seem to understand function prototypes."
7041 : Check if ansi2knr is required
7042 case "$prototype" in
7044 *) ansi2knr='ansi2knr'
7049 This version of $package can only be compiled by a compiler that
7050 understands function prototypes. Unfortunately, your C compiler
7052 doesn't seem to understand them. Sorry about that.
7054 If GNU cc is available for your system, perhaps you could try that instead.
7056 Eventually, we hope to support building Perl with pre-ANSI compilers.
7057 If you would like to help in that effort, please contact <perlbug@perl.org>.
7059 Aborting Configure now.
7066 dflt_dtrace='/usr/sbin/dtrace'
7069 Perl can be built to support DTrace on platforms that support it.
7070 DTrace is a diagnosis and performance analysis tool from Sun.
7072 If this doesn't make any sense to you, just accept the default '$dflt'.
7076 case "$usedtrace" in
7082 dflt_dtrace=$usedtrace
7089 rp='Support DTrace if available?'
7092 y|Y) val="$define" ;;
7098 test "X$usedtrace" != "X$define" && break
7101 rp='Where is the dtrace executable?'
7110 if $dtrace -h -s ../perldtrace.d \
7111 -o perldtrace.tmp >/dev/null 2>&1 \
7112 && rm -f perldtrace.tmp
7115 echo "Good: your $dtrace knows about the -h flag."
7119 *** $me: Fatal Error: $dtrace doesn't support -h flag
7121 *** Your installed dtrace doesn't support the -h switch to compile a D
7122 *** program into a C header. Can't continue.
7134 *** $me: Fatal Error: $dtrace not found.
7141 echo "*** $dtrace was not found."
7147 : See if we want extra modules installed
7154 Perl can be built with extra modules or bundles of modules which
7155 will be fetched from the CPAN and installed alongside Perl.
7157 Notice that you will need access to the CPAN; either via the Internet,
7158 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7159 be asked later to configure the CPAN.pm module which will in turn do
7160 the installation of the rest of the extra modules or bundles.)
7162 Notice also that if the modules require any external software such as
7163 libraries and headers (the libz library and the zlib.h header for the
7164 Compress::Zlib module, for example) you MUST have any such software
7165 already installed, this configuration process will NOT install such
7168 If this doesn't make any sense to you, just accept the default '$dflt'.
7170 rp='Install any extra modules (y or n)?'
7176 Please list any extra modules or bundles to be installed from CPAN,
7177 with spaces between the names. The names can be in any format the
7178 'install' command of CPAN.pm will understand. (Answer 'none',
7179 without the quotes, to install no extra modules or bundles.)
7189 $rm -f ../extras.lst
7191 *) echo "(Saving the list of extras for later...)"
7192 echo "$extras" > ../extras.lst
7200 : determine where html pages for programs go
7201 set html1dir html1dir none
7205 If you wish to install html files for programs in $spackage, indicate
7206 the appropriate directory here. To skip installing html files,
7210 ''|none|$undef|' ') dflt=none ;;
7211 *) dflt=$html1dir ;;
7214 rp="Directory for the main $spackage html pages?"
7218 : Use ' ' for none so value is preserved next time through Configure
7219 $test X"$html1dir" = "X" && html1dir=' '
7221 : determine where html pages for libraries and modules go
7222 set html3dir html3dir none
7226 If you wish to install html files for modules associated with $spackage,
7227 indicate the appropriate directory here. To skip installing html files,
7230 : There is no obvious default. If they have specified html1dir, then
7231 : try to key off that, possibly changing .../html1 into .../html3.
7233 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7234 *) dflt=$html3dir ;;
7237 rp="Directory for the $spackage module html pages?"
7241 : Use ' ' for none so value is preserved next time through Configure
7242 $test X"$html3dir" = "X" && html3dir=' '
7244 : determine whether to install perl also as /usr/bin/perl
7247 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7249 Many scripts expect perl to be installed as /usr/bin/perl.
7251 If you want to, I can install the perl you are about to compile
7252 as /usr/bin/perl (in addition to $bin/perl).
7254 if test -f /usr/bin/perl; then
7257 However, please note that because you already have a /usr/bin/perl,
7258 overwriting that with a new Perl would very probably cause problems.
7259 Therefore I'm assuming you don't want to do that (unless you insist).
7262 case "$installusrbinperl" in
7263 "$define"|[yY]*) dflt='y';;
7269 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7272 case "$installusrbinperl" in
7273 "$undef"|[nN]*) dflt='n';;
7277 rp="Do you want to install perl as /usr/bin/perl?"
7280 [yY]*) val="$define";;
7286 set installusrbinperl
7289 : Check if we are using the GNU C library
7291 echo "Checking for GNU C Library..." >&4
7293 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7294 alone are insufficient to distinguish different versions, such as
7295 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7296 libc version 2.1.0. A. Dougherty, June 3, 2002.
7302 # ifdef __GLIBC_MINOR__
7303 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7304 # include <gnu/libc-version.h>
7305 printf("%s\n", gnu_get_libc_version());
7307 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7310 printf("%d\n", __GLIBC__);
7319 if eval $compile_ok && $run ./try > glibc.ver; then
7321 gnulibc_version=`$cat glibc.ver`
7322 echo "You are using the GNU C Library version $gnulibc_version"
7326 echo "You are not using the GNU C Library"
7332 : see if nm is to be used to determine whether a symbol is defined or not
7336 case "$d_gnulibc" in
7339 echo "nm probably won't work on the GNU C Library." >&4
7345 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7347 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7348 echo "'nm' won't be sufficient on this sytem." >&4
7354 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7355 if $test $dflt -gt 20; then
7365 true|$define) dflt=y;;
7372 I can use $nm to extract the symbols from your C libraries. This
7373 is a time consuming task which may generate huge output on the disk (up
7374 to 3 megabytes) but that should make the symbols extraction faster. The
7375 alternative is to skip the 'nm' extraction part and to compile a small
7376 test program instead to determine whether each symbol is present. If
7377 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7378 this may be the best solution.
7380 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7383 rp="Shall I use $nm to extract C symbols from the libraries?"
7386 [Nn]*) usenm=false;;
7395 : nm options which may be necessary
7397 '') if $test -f /mach_boot; then
7399 elif $test -d /usr/ccs/lib; then
7400 nm_opt='-p' # Solaris (and SunOS?)
7401 elif $test -f /dgux; then
7403 elif $test -f /lib64/rld; then
7404 nm_opt='-p' # 64-bit Irix
7410 : nm options which may be necessary for shared libraries but illegal
7411 : for archive libraries. Thank you, Linux.
7412 case "$nm_so_opt" in
7413 '') case "$myuname" in
7415 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7416 nm_so_opt='--dynamic'
7423 : get list of predefined functions in a handy place
7430 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7436 *) for thislib in $libs; do
7439 : Handle C library specially below.
7442 thislib=`echo $thislib | $sed -e 's/^-l//'`
7443 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7445 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7447 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7449 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7451 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7453 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7455 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7460 libnames="$libnames $try"
7462 *) libnames="$libnames $thislib" ;;
7471 for xxx in $libpth; do
7472 $test -r $1 || set $xxx/libc.$so
7473 : The messy sed command sorts on library version numbers.
7475 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7476 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7478 s/[0-9][0-9]*/0000&/g
7479 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7482 $sort | $sed -e 's/^.* //'`
7485 $test -r $1 || set /usr/ccs/lib/libc.$so
7486 $test -r $1 || set /lib/libsys_s$_a
7492 if $test -r "$1"; then
7493 echo "Your (shared) C library seems to be in $1."
7495 elif $test -r /lib/libc && $test -r /lib/clib; then
7496 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7498 libc='/lib/clib /lib/libc'
7499 if $test -r /lib/syslib; then
7500 echo "(Your math library is in /lib/syslib.)"
7501 libc="$libc /lib/syslib"
7503 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7504 echo "Your C library seems to be in $libc, as you said before."
7505 elif $test -r $incpath/usr/lib/libc$_a; then
7506 libc=$incpath/usr/lib/libc$_a;
7507 echo "Your C library seems to be in $libc. That's fine."
7508 elif $test -r /lib/libc$_a; then
7510 echo "Your C library seems to be in $libc. You're normal."
7512 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7514 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7515 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7516 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7518 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7520 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7523 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7525 if $test -r "$tans"; then
7526 echo "Your C library seems to be in $tans, of all places."
7532 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7536 If the guess above is wrong (which it might be if you're using a strange
7537 compiler, or your machine supports multiple models), you can override it here.
7542 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7544 I can't seem to find your C library. I've looked in the following places:
7547 $sed 's/^/ /' libpath
7550 None of these seems to contain your C library. I need to get its name...
7555 rp='Where is your C library?'
7560 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7561 set X `cat libnames`
7564 case $# in 1) xxx=file; esac
7565 echo "Extracting names from the following $xxx for later perusal:" >&4
7567 $sed 's/^/ /' libnames >&4
7569 $echo $n "This may take a while...$c" >&4
7573 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7574 *) $nm $nm_opt $file 2>/dev/null;;
7579 $grep fprintf libc.tmp > libc.ptf
7580 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7581 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7583 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7585 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7587 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7589 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7591 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7593 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7595 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7597 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7599 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7601 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7603 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7605 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7607 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7608 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7610 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7612 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7614 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7616 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7618 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7620 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7622 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7624 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7626 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7628 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7630 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7632 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7634 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7636 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7638 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7641 $nm -p $* 2>/dev/null >libc.tmp
7642 $grep fprintf libc.tmp > libc.ptf
7643 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7644 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7650 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7652 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7653 for thisname in $libnames $libc; do
7654 $ar t $thisname >>libc.tmp
7656 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7658 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7659 # Repeat libc to extract forwarders to DLL entries too
7660 for thisname in $libnames $libc; do
7661 $ar tv $thisname >>libc.tmp
7662 # Revision 50 of EMX has bug in $ar.
7663 # it will not extract forwarders to DLL entries
7664 # Use emximp which will extract exactly them.
7665 emximp -o tmp.imp $thisname \
7667 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7668 < tmp.imp >>libc.tmp
7671 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7674 echo "$ar didn't seem to work right." >&4
7675 echo "Maybe this is a Cray...trying bld instead..." >&4
7676 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7678 for thisname in $libnames; do
7680 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7681 $ar t $thisname >>libc.tmp
7685 echo "That didn't work either. Giving up." >&4
7695 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7696 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7698 *) if $test -f /lib/syscalls.exp; then
7700 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7701 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7707 $rm -f libnames libpath
7709 : see if dld is available
7713 : Check if we are using C++
7715 echo "Checking for C++..." >&4
7716 $cat >try.c <<'EOCP'
7728 if eval $compile_ok && $run ./try; then
7730 echo "You are using a C++ compiler."
7733 echo "You are not using a C++ compiler."
7739 : is a C symbol defined?
7742 -v) tf=libc.tmp; tdc="";;
7743 -a) tf=libc.tmp; tdc="[]";;
7744 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7747 case "$reuseval-$4" in
7749 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7754 case "$d_cplusplus" in
7755 $define) extern_C=\"C\";;
7757 if $test "$runnm" = true; then
7758 if $contains $tlook $tf >/dev/null 2>&1; then
7760 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7761 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7762 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7763 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7767 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7768 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7774 $define) tval=true;;
7781 : define an is-in-libc? function
7782 inlibc='echo " "; td=$define; tu=$undef;
7783 sym=$1; var=$2; eval "was=\$$2";
7785 case "$reuseval$was" in
7795 echo "$sym() found." >&4;
7796 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7798 echo "$sym() NOT found." >&4;
7799 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7803 $define) echo "$sym() found." >&4;;
7804 *) echo "$sym() NOT found." >&4;;
7808 : see if dlopen exists
7810 xxx_ccflags="$ccflags"
7812 : with g++ one needs -shared to get is-in-libc to work for dlopen
7813 case "$gccversion" in
7815 *) case "$d_cplusplus" in
7816 "$define") ccflags="$ccflags -shared" ;;
7823 ccflags="$xxx_ccflags"
7825 : see if this is a unistd.h system
7826 set unistd.h i_unistd
7829 : determine which dynamic loading, if any, to compile in
7831 dldir="ext/DynaLoader"
7844 $define) dflt='y' ;;
7847 $define) dflt='y' ;;
7849 : Does a dl_xxx.xs file exist for this operating system
7850 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7853 rp="Do you wish to use dynamic loading?"
7860 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7861 dflt="$dldir/dl_${osname}.xs"
7862 elif $test "$d_dlopen" = "$define" ; then
7863 dflt="$dldir/dl_dlopen.xs"
7864 elif $test "$i_dld" = "$define" ; then
7865 dflt="$dldir/dl_dld.xs"
7870 *) dflt="$dldir/$dlsrc"
7873 echo "The following dynamic loading files are available:"
7874 : Can not go over to $dldir because getfile has path hard-coded in.
7875 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7876 rp="Source file to use for dynamic loading"
7882 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7886 Some systems may require passing special flags to $cc -c to
7887 compile modules that will be used to create a shared library.
7888 To use no flags, say "none".
7891 case "$cccdlflags" in
7892 '') case "$gccversion" in
7893 '') case "$osname" in
7895 next) dflt='none' ;;
7896 irix*) dflt='-KPIC' ;;
7897 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7898 sunos) dflt='-pic' ;;
7902 *) case "$osname" in
7903 darwin) dflt='none' ;;
7904 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7909 *) dflt="$cccdlflags" ;;
7911 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7914 none) cccdlflags=' ' ;;
7915 *) cccdlflags="$ans" ;;
7920 Some systems use ld to create libraries that can be dynamically loaded,
7921 while other systems (such as those using ELF) use $cc.
7925 '') $cat >try.c <<EOM
7926 /* Test for whether ELF binaries are produced */
7938 int i = open("a.out",O_RDONLY);
7941 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7942 exit(0); /* succeed (yes, it's ELF) */
7947 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7949 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7953 echo "I'll use ld to build dynamic libraries."
7962 rp="What command should be used to create dynamic libraries?"
7968 Some systems may require passing special flags to $ld to create a
7969 library that can be dynamically loaded. If your ld flags include
7970 -L/other/path options to locate libraries outside your loader's normal
7971 search path, you may need to specify those -L options here as well. To
7972 use no flags, say "none".
7975 case "$lddlflags" in
7976 '') case "$osname" in
7977 beos) dflt='-nostart' ;;
7979 case "$gccversion" in
7980 '') dflt="$dflt +vnocompatwarnings" ;;
7983 linux|irix*|gnu*) dflt="-shared $optimize" ;;
7984 next) dflt='none' ;;
7985 solaris) dflt='-G' ;;
7986 sunos) dflt='-assert nodefinitions' ;;
7987 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7991 *) dflt="$lddlflags" ;;
7994 : Try to guess additional flags to pick up local libraries.
7995 : Be careful not to append to a plain 'none'
7999 for thisflag in $ldflags; do
8004 *) dflt="$dflt $thisflag" ;;
8011 ''|' ') dflt='none' ;;
8014 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8017 none) lddlflags=' ' ;;
8018 *) lddlflags="$ans" ;;
8023 Some systems may require passing special flags to $cc to indicate that
8024 the resulting executable will use dynamic linking. To use no flags,
8028 case "$ccdlflags" in
8029 '') case "$osname" in
8030 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8031 next|sunos) dflt='none' ;;
8035 *) dflt="$ccdlflags" ;;
8037 rp="Any special flags to pass to $cc to use dynamic linking?"
8040 none) ccdlflags=' ' ;;
8041 *) ccdlflags="$ans" ;;
8052 : Do we want a shared libperl?
8056 # No dynamic loading being used, so don't bother even to prompt.
8059 *) case "$useshrplib" in
8060 '') case "$osname" in
8061 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
8063 also='Building a shared libperl is required for dynamic loading to work on your system.'
8068 also='Building a shared libperl is needed for MAB support.'
8086 The perl executable is normally obtained by linking perlmain.c with
8087 libperl${_a}, any static extensions (usually just DynaLoader), and
8088 any other libraries needed on this system (such as -lm, etc.). Since
8089 your system supports dynamic loading, it is probably possible to build
8090 a shared libperl.$so. If you will have more than one executable linked
8091 to libperl.$so, this will significantly reduce the size of each
8092 executable, but it may have a noticeable effect on performance. The
8093 default is probably sensible for your system.
8097 rp="Build a shared libperl.$so (y/n)"
8101 useshrplib='true' ;;
8102 *) useshrplib='false' ;;
8107 case "$useshrplib" in
8111 # Figure out a good name for libperl.so. Since it gets stored in
8112 # a version-specific architecture-dependent library, the version
8113 # number isn't really that important, except for making cc/ld happy.
8115 # A name such as libperl.so.3.1
8116 majmin="libperl.$so.$patchlevel.$subversion"
8117 # A name such as libperl.so.301
8118 majonly=`echo $patchlevel $subversion |
8119 $awk '{printf "%d%02d", $1, $2}'`
8120 majonly=libperl.$so.$majonly
8121 # I'd prefer to keep the os-specific stuff here to a minimum, and
8122 # rely on figuring it out from the naming of libc.
8123 case "${osname}${osvers}" in
8126 # XXX How handle the --version stuff for MAB?
8128 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8131 cygwin*) # ld links against an importlib
8132 dflt=libperl$lib_ext
8134 *) # Try to guess based on whether libc has major.minor.
8136 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8137 *libc.$so.[0-9]*) dflt=$majonly ;;
8138 *) dflt=libperl.$so ;;
8148 I need to select a good name for the shared libperl. If your system uses
8149 library names with major and minor numbers, then you might want something
8150 like $majmin. Alternatively, if your system uses a single version
8151 number for shared libraries, then you might want to use $majonly.
8152 Or, your system might be quite happy with a simple libperl.$so.
8154 Since the shared libperl will get installed into a version-specific
8155 architecture-dependent directory, the version number of the shared perl
8156 library probably isn't important, so the default should be o.k.
8159 rp='What name do you want to give to the shared libperl?'
8162 echo "Ok, I'll use $libperl"
8165 libperl="libperl${_a}"
8169 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8173 WARNING: Use of the shrpdir variable for the installation location of
8174 the shared $libperl is not supported. It was never documented and
8175 will not work in this version. Let me (perlbug@perl.org)
8176 know of any problems this may cause.
8182 But your current setting of $shrpdir is
8183 the default anyway, so it's harmless.
8188 Further, your current attempted setting of $shrpdir
8189 conflicts with the value of $archlibexp/CORE
8190 that installperl will use.
8197 # How will the perl executable find the installed shared $libperl?
8198 # Add $xxx to ccdlflags.
8199 # If we can't figure out a command-line option, use $shrpenv to
8200 # set env LD_RUN_PATH. The main perl makefile uses this.
8201 shrpdir=$archlibexp/CORE
8204 if "$useshrplib"; then
8207 # We'll set it in Makefile.SH...
8212 freebsd|netbsd|openbsd|interix|dragonfly)
8213 xxx="-Wl,-R$shrpdir"
8215 bsdos|linux|irix*|dec_osf|gnu*)
8216 xxx="-Wl,-rpath,$shrpdir"
8219 # next doesn't like the default...
8222 # beos doesn't like the default, either.
8225 # hpux doesn't like the default, either.
8226 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8229 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8235 # Only add $xxx if it isn't already in ccdlflags.
8236 case " $ccdlflags " in
8238 *) ccdlflags="$ccdlflags $xxx"
8241 Adding $xxx to the flags
8242 passed to $ld so that the perl executable will find the
8243 installed shared $libperl.
8251 # Fix ccdlflags in AIX for building external extensions.
8252 # (For building Perl itself bare -bE:perl.exp is needed,
8253 # Makefile.SH takes care of this.)
8255 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8257 # Respect a hint or command-line value.
8259 '') shrpenv="$tmp_shrpenv" ;;
8261 case "$ldlibpthname" in
8262 '') ldlibpthname=LD_LIBRARY_PATH ;;
8263 none) ldlibpthname='' ;;
8266 : determine where manual pages are on this system
8270 syspath='/usr/share/man/man1 /usr/man/man1'
8271 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8272 syspath="$syspath /usr/man/u_man/man1"
8273 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8274 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8275 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8276 sysman=`./loc . /usr/man/man1 $syspath`
8279 if $test -d "$sysman"; then
8280 echo "System manual is in $sysman." >&4
8282 echo "Could not find manual pages in source form." >&4
8285 : determine where manual pages go
8286 set man1dir man1dir none
8290 $spackage has manual pages available in source form.
8294 echo "However, you don't have nroff, so they're probably useless to you."
8296 '') man1dir="none";;
8299 echo "If you don't want the manual sources installed, answer 'none'."
8304 lookpath="$prefixexp/share/man/man1"
8305 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8306 lookpath="$lookpath $prefixexp/man/p_man/man1"
8307 lookpath="$lookpath $prefixexp/man/u_man/man1"
8308 lookpath="$lookpath $prefixexp/man/man.1"
8310 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8311 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8321 rp="Where do the main $spackage manual pages (source) go?"
8323 if $test "X$man1direxp" != "X$ansexp"; then
8334 : What suffix to use on installed man pages
8341 rp="What suffix should be used for the main $spackage man pages?"
8343 '') case "$man1dir" in
8357 *) dflt="$man1ext";;
8364 : see if we can have long filenames
8366 first=123456789abcdef
8368 if (echo hi >$first) 2>/dev/null; then
8369 if $test -f 123456789abcde; then
8370 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8373 echo 'You can have filenames longer than 14 characters.'>&4
8378 You can't have filenames longer than 14 chars.
8379 You can't even think about them!
8385 $rm -rf 123456789abcde*
8387 : determine where library module manual pages go
8388 set man3dir man3dir none
8392 $spackage has manual pages for many of the library modules.
8398 However, you don't have nroff, so they're probably useless to you.
8401 '') man3dir="none";;
8405 case "$d_flexfnam" in
8408 However, your system can't handle the long file names like File::Basename.3.
8411 '') man3dir="none";;
8415 echo "If you don't want the manual sources installed, answer 'none'."
8416 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8418 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8419 if $test -d "$privlib/man/man3"; then
8422 WARNING: Previous versions of perl installed man3 pages into
8423 $privlib/man/man3. This version will suggest a
8424 new default of $dflt.
8428 rp='Do you wish to preserve the old behavior?(y/n)'
8431 y*) dflt="$privlib/man/man3" ;;
8436 *) dflt="$man3dir" ;;
8443 rp="Where do the $package library man pages (source) go?"
8453 : What suffix to use on installed man pages
8459 rp="What suffix should be used for the $package library man pages?"
8461 '') case "$man3dir" in
8475 *) dflt="$man3ext";;
8482 : see if we have to deal with yellow pages, now NIS.
8483 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8484 if $test -f /usr/etc/nibindd; then
8486 echo "I'm fairly confident you're on a NeXT."
8488 rp='Do you get the hosts file via NetInfo?'
8497 y*) hostcat='nidump hosts .';;
8498 *) case "$hostcat" in
8499 nidump*) hostcat='';;
8509 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8517 rp='Are you getting the hosts file via yellow pages?'
8520 y*) hostcat='ypcat hosts';;
8521 *) hostcat='cat /etc/hosts';;
8527 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8530 '') test -f /etc/group && groupcat='cat /etc/group';;
8533 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8536 : now get the host name
8538 echo "Figuring out host name..." >&4
8539 case "$myhostname" in
8541 echo 'Maybe "hostname" will work...'
8542 if tans=`sh -c hostname 2>&1` ; then
8550 if $test "$cont"; then
8552 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8553 if tans=`cat /etc/systemid 2>&1` ; then
8555 phostname='cat /etc/systemid'
8556 echo "Whadyaknow. Xenix always was a bit strange..."
8559 elif $test -r /etc/systemid; then
8560 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8563 if $test "$cont"; then
8564 echo 'No, maybe "uuname -l" will work...'
8565 if tans=`sh -c 'uuname -l' 2>&1` ; then
8567 phostname='uuname -l'
8569 echo 'Strange. Maybe "uname -n" will work...'
8570 if tans=`sh -c 'uname -n' 2>&1` ; then
8572 phostname='uname -n'
8574 echo 'Oh well, maybe I can mine it out of whoami.h...'
8575 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8576 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8577 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8579 case "$myhostname" in
8580 '') echo "Does this machine have an identity crisis or something?"
8583 echo "Well, you said $myhostname before..."
8584 phostname='echo $myhostname';;
8590 case "$myhostname" in
8591 '') myhostname=noname ;;
8593 : you do not want to know about this
8598 if $test "$myhostname" ; then
8600 rp='Your host name appears to be "'$myhostname'".'" Right?"
8608 : bad guess or no guess
8609 while $test "X$myhostname" = X ; do
8611 rp="Please type the (one word) name of your host:"
8616 : translate upper to lower if necessary
8617 case "$myhostname" in
8619 echo "(Normalizing case in your host name)"
8620 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8624 case "$myhostname" in
8626 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8627 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8628 echo "(Trimming domain name from host name--host name is now $myhostname)"
8630 *) case "$mydomain" in
8633 test "X$hostcat" = "Xypcat hosts" &&
8634 ypmatch "$myhostname" hosts 2>/dev/null |\
8635 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8638 test "X$hostcat" != "X" &&
8639 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8640 /[ ]$myhostname[ . ]/p" > hosts
8643 if $test -f hosts; then
8644 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8645 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8646 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8647 hosts | $sort | $uniq | \
8648 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8649 case `$echo X$dflt` in
8650 X*\ *) echo "(Several hosts in the database matched hostname)"
8653 X.) echo "(You do not have fully-qualified names in the hosts database)"
8657 echo "(I cannot locate a hosts database anywhere)"
8662 tans=`./loc resolv.conf X /etc /usr/etc`
8663 if $test -f "$tans"; then
8664 echo "(Attempting domain name extraction from $tans)"
8665 dflt=.`$sed -n -e 's/ / /g' \
8666 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8667 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8669 .) dflt=.`$sed -n -e 's/ / /g' \
8670 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8671 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8678 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8679 dflt=.`sh -c domainname 2>/dev/null`
8682 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8686 case "$dflt$osname" in
8687 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8688 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8692 .) echo "(Lost all hope -- silly guess then)"
8698 *) dflt="$mydomain";;
8702 rp="What is your domain name?"
8712 : translate upper to lower if necessary
8715 echo "(Normalizing case in your domain name)"
8716 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8720 : a little sanity check here
8721 case "$phostname" in
8724 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8725 $myhostname$mydomain|$myhostname) ;;
8727 case "$phostname" in
8729 echo "(That doesn't agree with your whoami.h file, by the way.)"
8732 echo "(That doesn't agree with your $phostname command, by the way.)"
8743 I need to get your e-mail address in Internet format if possible, i.e.
8744 something like user@host.domain. Please answer accurately since I have
8745 no easy means to double check it. The default value provided below
8746 is most probably close to reality but may not be valid from outside
8747 your organization...
8751 while test "$cont"; do
8753 '') dflt="$cf_by@$myhostname$mydomain";;
8754 *) dflt="$cf_email";;
8756 rp='What is your e-mail address?'
8762 rp='Address does not look like an Internet one. Use it anyway?'
8776 : Ask e-mail of administrator
8779 If you or somebody else will be maintaining perl at your site, please
8780 fill in the correct e-mail address here so that they may be contacted
8781 if necessary. Currently, the "perlbug" program included with perl
8782 will send mail to this address in addition to perlbug@perl.org. You may
8783 enter "none" for no administrator.
8786 case "$perladmin" in
8787 '') dflt="$cf_email";;
8788 *) dflt="$perladmin";;
8790 rp='Perl administrator e-mail address'
8794 : determine whether to only install version-specific parts.
8797 Do you want to install only the version-specific parts of the perl
8798 distribution? Usually you do *not* want to do this.
8800 case "$versiononly" in
8801 "$define"|[Yy]*|true) dflt='y' ;;
8804 rp="Do you want to install only the version-specific parts of perl?"
8807 [yY]*) val="$define";;
8813 case "$versiononly" in
8814 "$define") inc_version_list=''
8815 inc_version_list_init=0
8819 : figure out how to guarantee perl startup
8820 : XXX Note that this currently takes advantage of the bug that binexp ignores
8821 : the Configure -Dinstallprefix setting, which in turn means that under
8822 : relocatable @INC, initialinstalllocation is what binexp started as.
8823 case "$startperl" in
8825 case "$sharpbang" in
8829 I can use the #! construct to start perl on your system. This will
8830 make startup of perl scripts faster, but may cause problems if you
8831 want to share those scripts and perl is not in a standard place
8832 ($initialinstalllocation/perl) on all your platforms. The alternative
8833 is to force a shell by starting the script with a single ':' character.
8836 case "$versiononly" in
8837 "$define") dflt="$initialinstalllocation/perl$version";;
8838 *) dflt="$initialinstalllocation/perl";;
8840 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8843 none) startperl=": # use perl";;
8844 *) startperl="#!$ans"
8845 if $test 30 -lt `echo "$ans" | wc -c`; then
8848 WARNING: Some systems limit the #! command to 32 characters.
8849 If you experience difficulty running Perl scripts with #!, try
8850 installing Perl in a directory with a shorter pathname.
8856 *) startperl=": # use perl"
8861 echo "I'll use $startperl to start perl scripts."
8863 : figure best path for perl in scripts
8866 case "$versiononly" in
8867 "$define") perlpath="$initialinstalllocation/perl$version";;
8868 *) perlpath="$initialinstalllocation/perl";;
8870 case "$startperl" in
8875 I will use the "eval 'exec'" idiom to start Perl on your system.
8876 I can use the full path of your Perl binary for this purpose, but
8877 doing so may cause problems if you want to share those scripts and
8878 Perl is not always in a standard place ($initialinstalllocation/perl).
8881 dflt="$initialinstalllocation/perl"
8882 rp="What path shall I use in \"eval 'exec'\"?"
8889 case "$startperl" in
8891 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8894 : determine where public executable scripts go
8895 set scriptdir scriptdir
8897 case "$scriptdir" in
8900 : guess some guesses
8901 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8902 $test -d /usr/share/bin && dflt=/usr/share/bin
8903 $test -d /usr/local/script && dflt=/usr/local/script
8904 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8905 $test -d $prefixexp/script && dflt=$prefixexp/script
8909 *) dflt="$scriptdir"
8914 Some installations have a separate directory just for executable scripts so
8915 that they can mount it across multiple architectures but keep the scripts in
8916 one spot. You might, for example, have a subdirectory of /usr/share for this.
8917 Or you might just lump your scripts in with all your other executables.
8921 rp='Where do you keep publicly executable scripts?'
8923 if $test "X$ansexp" != "X$scriptdirexp"; then
8929 : A little fix up for an irregularly named variable.
8930 installscript="$installscriptdir"
8932 : determine where add-on public executables go
8934 '') dflt=$siteprefix/bin ;;
8938 rp='Pathname where the add-on public executables should be installed?'
8943 : determine where add-on html pages go
8944 : There is no standard location, so try to copy the previously-selected
8945 : directory structure for the core html pages.
8946 case "$sitehtml1dir" in
8947 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8948 *) dflt=$sitehtml1dir ;;
8951 ''|' ') dflt=none ;;
8954 rp='Pathname where the site-specific html pages should be installed?'
8956 prefixvar=sitehtml1dir
8959 : determine where add-on library html pages go
8960 : There is no standard location, so try to copy the previously-selected
8961 : directory structure for the core html pages.
8962 case "$sitehtml3dir" in
8963 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8964 *) dflt=$sitehtml3dir ;;
8967 ''|' ') dflt=none ;;
8970 rp='Pathname where the site-specific library html pages should be installed?'
8972 prefixvar=sitehtml3dir
8975 : determine where add-on manual pages go
8976 case "$siteman1dir" in
8977 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8978 *) dflt=$siteman1dir ;;
8981 ''|' ') dflt=none ;;
8984 rp='Pathname where the site-specific manual pages should be installed?'
8986 prefixvar=siteman1dir
8989 : determine where add-on library man pages go
8990 case "$siteman3dir" in
8991 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8992 *) dflt=$siteman3dir ;;
8995 ''|' ') dflt=none ;;
8998 rp='Pathname where the site-specific library manual pages should be installed?'
9000 prefixvar=siteman3dir
9003 : determine where add-on public executable scripts go
9004 case "$sitescript" in
9005 '') dflt=$siteprefix/script
9006 $test -d $dflt || dflt=$sitebin ;;
9007 *) dflt="$sitescript" ;;
9010 rp='Pathname where add-on public executable scripts should be installed?'
9012 prefixvar=sitescript
9015 : Check if faststdio is requested and available
9016 case "$usefaststdio" in
9017 $define|true|[yY]*|'')
9018 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9028 Perl can be built to use 'fast stdio', which means using the stdio
9029 library but also directly manipulating the stdio buffers to enable
9030 faster I/O. Using stdio is better for backward compatibility (especially
9031 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9032 interface has been preferred instead of stdio.
9034 If this doesn't make any sense to you, just accept the default '$dflt'.
9036 rp='Use the "fast stdio" if available?'
9039 y|Y) val="$define" ;;
9046 : define an is-a-typedef? function
9047 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9049 "") inclist="sys/types.h";;
9051 eval "varval=\$$var";
9055 for inc in $inclist; do
9056 echo "#include <$inc>" >>temp.c;
9058 echo "#ifdef $type" >> temp.c;
9059 echo "printf(\"We have $type\");" >> temp.c;
9060 echo "#endif" >> temp.c;
9061 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9062 if $contains $type temp.E >/dev/null 2>&1; then
9068 *) eval "$var=\$varval";;
9071 : define an is-a-typedef? function that prompts if the type is not available.
9072 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9074 "") inclist="sys/types.h";;
9076 eval "varval=\$$var";
9080 for inc in $inclist; do
9081 echo "#include <$inc>" >>temp.c;
9083 echo "#ifdef $type" >> temp.c;
9084 echo "printf(\"We have $type\");" >> temp.c;
9085 echo "#endif" >> temp.c;
9086 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9088 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9089 if $contains $type temp.E >/dev/null 2>&1; then
9090 echo "$type found." >&4;
9093 echo "$type NOT found." >&4;
9099 *) eval "$var=\$varval";;
9102 : see what type lseek is declared as in the kernel
9103 rp="What is the type used for lseek's offset on this system?"
9104 set off_t lseektype long stdio.h sys/types.h
9108 echo "Checking to see how big your file offsets are..." >&4
9110 #include <sys/types.h>
9114 printf("%d\n", (int)sizeof($lseektype));
9119 if eval $compile_ok; then
9120 lseeksize=`$run ./try`
9121 echo "Your file offsets are $lseeksize bytes long."
9125 echo "(I can't seem to compile the test program. Guessing...)"
9126 rp="What is the size of your file offsets (in bytes)?"
9132 : see what type file positions are declared as in the library
9133 rp="What is the type for file position used by fsetpos()?"
9134 set fpos_t fpostype long stdio.h sys/types.h
9137 : Check size for Fpos_t
9140 *_t) zzz="$fpostype" ;;
9143 echo "Checking the size of $zzz..." >&4
9145 #include <sys/types.h>
9152 printf("%d\n", (int)sizeof($fpostype));
9157 if eval $compile_ok; then
9161 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9164 echo "Your $zzz is $fpossize bytes long."
9170 echo "(I can't compile the test program. Guessing...)" >&4
9171 rp="What is the size of your file positions (in bytes)?"
9176 : Check for large file support
9177 # Backward compatibility (uselfs is deprecated).
9179 "$define"|true|[yY]*)
9182 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9184 uselargefiles="$define"
9188 case "$lseeksize:$fpossize" in
9191 You can have files larger than 2 gigabytes.
9194 *) case "$uselargefiles" in
9195 "$undef"|false|[nN]*) dflt='n' ;;
9200 Perl can be built to understand large files (files larger than 2 gigabytes)
9201 on some systems. To do so, Configure can be run with -Duselargefiles.
9203 If this doesn't make any sense to you, just accept the default '$dflt'.
9205 rp='Try to understand large files, if available?'
9208 y|Y) val="$define" ;;
9215 : Look for a hint-file generated 'call-back-unit'. If the
9216 : user has specified that a large files perl is to be built,
9217 : we may need to set or change some other defaults.
9218 if $test -f uselargefiles.cbu; then
9219 echo "Your platform has some specific hints regarding large file builds, using them..."
9220 . ./uselargefiles.cbu
9222 case "$uselargefiles" in
9224 if $test -f uselargefiles.cbu; then
9226 echo "Rechecking to see how big your file offsets are..." >&4
9228 #include <sys/types.h>
9232 printf("%d\n", (int)sizeof($lseektype));
9237 if eval $compile_ok; then
9238 lseeksize=`$run ./try`
9239 $echo "Your file offsets are now $lseeksize bytes long."
9243 echo "(I can't seem to compile the test program. Guessing...)"
9244 rp="What is the size of your file offsets (in bytes)?"
9249 *_t) zzz="$fpostype" ;;
9252 $echo $n "Rechecking the size of $zzz...$c" >&4
9254 #include <sys/types.h>
9261 printf("%d\n", (int)sizeof($fpostype));
9266 if eval $compile_ok; then
9271 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9274 echo " $fpossize bytes." >&4
9280 echo "(I can't compile the test program. Guessing...)" >&4
9281 rp="What is the size of your file positions (in bytes)?"
9290 : Set the vendorbin variables
9291 case "$vendorprefix" in
9292 '') d_vendorbin="$undef"
9296 *) d_vendorbin="$define"
9297 : determine where vendor-supplied executables go.
9298 case "$vendorbin" in
9299 '') dflt=$vendorprefix/bin ;;
9300 *) dflt="$vendorbin" ;;
9303 rp='Pathname for the vendor-supplied executables directory?'
9306 vendorbinexp="$ansexp"
9312 : Set the vendorhtml1dir variables
9313 case "$vendorprefix" in
9314 '') vendorhtml1dir=''
9315 vendorhtml1direxp=''
9317 *) : determine where vendor-supplied html pages go.
9318 : There is no standard location, so try to copy the previously-selected
9319 : directory structure for the core html pages.
9320 : XXX Better default suggestions would be welcome.
9321 case "$vendorhtml1dir" in
9322 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9323 *) dflt=$vendorhtml1dir ;;
9326 ''|' ') dflt=none ;;
9329 rp='Pathname for the vendor-supplied html pages?'
9331 vendorhtml1dir="$ans"
9332 vendorhtml1direxp="$ansexp"
9335 : Use ' ' for none so value is preserved next time through Configure
9336 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9337 prefixvar=vendorhtml1dir
9340 : Set the vendorhtml3dir variables
9341 case "$vendorprefix" in
9342 '') vendorhtml3dir=''
9343 vendorhtml3direxp=''
9345 *) : determine where vendor-supplied module html pages go.
9346 : There is no standard location, so try to copy the previously-selected
9347 : directory structure for the core html pages.
9348 : XXX Better default suggestions would be welcome.
9349 case "$vendorhtml3dir" in
9350 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9351 *) dflt=$vendorhtml3dir ;;
9354 ''|' ') dflt=none ;;
9357 rp='Pathname for the vendor-supplied html pages?'
9359 vendorhtml3dir="$ans"
9360 vendorhtml3direxp="$ansexp"
9363 : Use ' ' for none so value is preserved next time through Configure
9364 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9365 prefixvar=vendorhtml3dir
9368 : Set the vendorman1dir variables
9369 case "$vendorprefix" in
9370 '') vendorman1dir=''
9373 *) : determine where vendor-supplied manual pages go.
9374 case "$vendorman1dir" in
9375 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9376 *) dflt=$vendorman1dir ;;
9379 ''|' ') dflt=none ;;
9382 rp='Pathname for the vendor-supplied manual section 1 pages?'
9384 vendorman1dir="$ans"
9385 vendorman1direxp="$ansexp"
9388 : Use ' ' for none so value is preserved next time through Configure
9389 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9390 prefixvar=vendorman1dir
9393 : Set the vendorman3dir variables
9394 case "$vendorprefix" in
9395 '') vendorman3dir=''
9398 *) : determine where vendor-supplied module manual pages go.
9399 case "$vendorman3dir" in
9400 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9401 *) dflt=$vendorman3dir ;;
9404 ''|' ') dflt=none ;;
9407 rp='Pathname for the vendor-supplied manual section 3 pages?'
9409 vendorman3dir="$ans"
9410 vendorman3direxp="$ansexp"
9413 : Use ' ' for none so value is preserved next time through Configure
9414 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9415 prefixvar=vendorman3dir
9418 : Set the vendorscript variables
9419 case "$vendorprefix" in
9420 '') d_vendorscript="$undef"
9424 *) d_vendorscript="$define"
9425 : determine where vendor-supplied scripts go.
9426 case "$vendorscript" in
9427 '') dflt=$vendorprefix/script
9428 $test -d $dflt || dflt=$vendorbin ;;
9429 *) dflt="$vendorscript" ;;
9433 The installation process will create a directory for
9434 vendor-supplied scripts.
9438 rp='Pathname for the vendor-supplied scripts directory?'
9441 vendorscriptexp="$ansexp"
9444 prefixvar=vendorscript
9447 : see if qgcvt exists
9451 : Check print/scan long double stuff
9454 if $test X"$d_longdbl" = X"$define"; then
9456 echo "Checking how to print long doubles..." >&4
9458 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9459 $cat >try.c <<'EOCP'
9460 #include <sys/types.h>
9464 printf("%.3f\n", d);
9468 if eval $compile; then
9472 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9473 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9474 echo "We will use %f."
9480 if $test X"$sPRIfldbl" = X; then
9481 $cat >try.c <<'EOCP'
9482 #include <sys/types.h>
9485 long double d = 123.456;
9486 printf("%.3Lf\n", d);
9490 if eval $compile; then
9494 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9495 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9496 echo "We will use %Lf."
9502 if $test X"$sPRIfldbl" = X; then
9503 $cat >try.c <<'EOCP'
9504 #include <sys/types.h>
9507 long double d = 123.456;
9508 printf("%.3llf\n", d);
9512 if eval $compile; then
9516 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9517 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9518 echo "We will use %llf."
9524 if $test X"$sPRIfldbl" = X; then
9525 $cat >try.c <<'EOCP'
9526 #include <sys/types.h>
9529 long double d = 123.456;
9530 printf("%.3lf\n", d);
9534 if eval $compile; then
9538 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9539 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9540 echo "We will use %lf."
9546 if $test X"$sPRIfldbl" = X; then
9547 echo "Cannot figure out how to print long doubles." >&4
9549 sSCNfldbl=$sPRIfldbl # expect consistency
9556 case "$sPRIfldbl" in
9557 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9558 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9559 d_SCNfldbl="$undef";
9561 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9562 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9563 d_SCNfldbl="$define";
9567 : Check how to convert floats to strings.
9569 if test "X$d_Gconvert" = X; then
9572 echo "Checking for an efficient way to convert floats to strings."
9574 case "$uselongdouble" in
9575 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9577 case "$d_longdbl" in
9578 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9580 case "$d_PRIgldbl" in
9581 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9585 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9586 char *myname = "gconvert";
9589 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9590 char *myname = "gcvt";
9593 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9594 char *myname = "qgcvt";
9595 #define DOUBLETYPE long double
9598 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9600 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9602 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9605 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9607 char *myname = "sprintf";
9611 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9612 #define DOUBLETYPE long double
9614 #define DOUBLETYPE double
9620 #define I_STDLIB $i_stdlib
9626 checkit(expect, got)
9630 if (strcmp(expect, got)) {
9631 printf("%s oddity: Expected %s, got %s\n",
9632 myname, expect, got);
9642 /* This must be 1st test on (which?) platform */
9643 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9644 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9645 checkit("0.1", buf);
9647 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9648 checkit("0.01", buf);
9650 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9651 checkit("0.001", buf);
9653 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9654 checkit("0.0001", buf);
9656 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9657 if (strlen(buf) > 5)
9658 checkit("9e-005", buf); /* for Microsoft ?? */
9660 checkit("9e-05", buf);
9662 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9665 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9666 checkit("1.1", buf);
9668 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9669 checkit("1.01", buf);
9671 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9672 checkit("1.001", buf);
9674 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9675 checkit("1.0001", buf);
9677 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9678 checkit("1.00001", buf);
9680 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9681 checkit("1.000001", buf);
9683 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9686 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9689 /* Some Linux gcvt's give 1.e+5 here. */
9690 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9691 checkit("100000", buf);
9693 /* Some Linux gcvt's give -1.e+5 here. */
9694 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9695 checkit("-100000", buf);
9697 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9698 checkit("123.456", buf);
9700 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9701 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9702 /* 34 should be enough to scare even long double
9703 * places into using the e notation. */
9704 if (strlen(buf) > 5)
9705 checkit("1e+034", buf); /* for Microsoft */
9707 checkit("1e+34", buf);
9709 /* For Perl, if you add additional tests here, also add them to
9710 * t/base/num.t for benefit of platforms not using Configure or
9711 * overriding d_Gconvert */
9716 : first add preferred functions to our list
9718 for xxx_convert in $gconvert_preference; do
9719 case $xxx_convert in
9720 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9721 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9724 : then add any others
9725 for xxx_convert in gconvert gcvt sprintf; do
9728 *) xxx_list="$xxx_list $xxx_convert" ;;
9732 case "$d_longdbl$uselongdouble" in
9734 : again, add prefered functions to our list first
9736 for xxx_convert in $gconvert_ld_preference; do
9737 case $xxx_convert in
9738 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9739 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9742 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9743 for xxx_convert in qgcvt sprintf $xxx_list; do
9744 case "$xxx_ld_list" in
9745 $xxx_convert*|*" $xxx_convert"*) ;;
9746 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9749 : if sprintf cannot do long doubles, move it to the end
9750 if test "$d_PRIgldbl" != "$define"; then
9751 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9753 : if no qgcvt, remove it
9754 if test "$d_qgcvt" != "$define"; then
9755 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9758 xxx_list="$xxx_ld_list"
9762 for xxx_convert in $xxx_list; do
9763 echo "Trying $xxx_convert..."
9764 $rm -f try try$_o core
9765 set try -DTRY_$xxx_convert
9766 if eval $compile; then
9767 echo "$xxx_convert() found." >&4
9769 echo "I'll use $xxx_convert to convert floats into a string." >&4
9772 echo "...But $xxx_convert didn't work as I expected."
9776 echo "$xxx_convert NOT found." >&4
9780 if test X$xxx_convert = X; then
9781 echo "*** WHOA THERE!!! ***" >&4
9782 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9786 case "$xxx_convert" in
9787 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9788 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9789 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9790 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9791 "$define$define$define")
9792 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9793 "$define$define$undef")
9794 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9795 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9803 : see if _fwalk exists
9807 : Initialize h_fcntl
9810 : Initialize h_sysfile
9813 : access call always available on UNIX
9817 : locate the flags for 'access()'
9821 $cat >access.c <<EOCP
9822 #include <sys/types.h>
9827 #include <sys/file.h>
9840 : check sys/file.h first, no particular reason here
9841 if $test `./findhdr sys/file.h` && \
9842 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9844 echo "<sys/file.h> defines the *_OK access constants." >&4
9845 elif $test `./findhdr fcntl.h` && \
9846 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9848 echo "<fcntl.h> defines the *_OK access constants." >&4
9849 elif $test `./findhdr unistd.h` && \
9850 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9851 echo "<unistd.h> defines the *_OK access constants." >&4
9853 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9859 : see if accessx exists
9860 set accessx d_accessx
9863 : see if aintl exists
9867 : see if alarm exists
9871 : see if POSIX threads are available
9872 set pthread.h i_pthread
9875 : define a fucntion to check prototypes
9876 $cat > protochk <<EOSH
9879 optimize="$optimize"
9881 prototype="$prototype"
9884 usethreads=$usethreads
9885 i_pthread=$i_pthread
9886 pthread_h_first=$pthread_h_first
9889 $cat >> protochk <<'EOSH'
9894 while test $# -ge 2; do
9896 $define) echo "#include <$2>" >> try.c ;;
9897 literal) echo "$2" >> try.c ;;
9899 # Extra magic for the benefit of systems that need pthread.h
9900 # to be included early to correctly detect threadsafe functions.
9901 # Such functions must guarantee themselves, though, that the usethreads
9902 # and i_pthread have been defined, before calling protochk.
9903 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9904 echo "#include <pthread.h>" >> try.c
9909 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9910 cat >> try.c <<'EOCP'
9911 #ifdef CAN_PROTOTYPE
9912 #define _(args) args
9917 echo "$foo" >> try.c
9918 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9919 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9927 : Define hasproto macro for Configure internal use
9928 hasproto='varname=$1; func=$2; shift; shift;
9929 while $test $# -ge 2; do
9931 $define) echo "#include <$2>";;
9935 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9936 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9937 echo "$func() prototype found.";
9940 echo "$func() prototype NOT found.";
9947 : see if sys/types.h has to be included
9948 set sys/types.h i_systypes
9951 : see if sys/select.h has to be included
9952 set sys/select.h i_sysselct
9955 : Define hasfield macro for Configure internal use
9956 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9957 while $test $# -ge 2; do
9959 $define) echo "#include <$2>";;
9963 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9965 if eval $compile; then
9974 : see if we should include time.h, sys/time.h, or both
9976 if test "X$timeincl" = X; then
9977 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9978 $echo $n "I'm now running the test program...$c"
9980 #include <sys/types.h>
9985 #ifdef SYSTIMEKERNEL
9988 #include <sys/time.h>
9991 #include <sys/select.h>
10001 struct timeval bar;
10004 struct timezone tzp;
10006 if (foo.tm_sec == foo.tm_sec)
10009 if (bar.tv_sec == bar.tv_sec)
10016 for s_timezone in '-DS_TIMEZONE' ''; do
10018 for s_timeval in '-DS_TIMEVAL' ''; do
10019 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10020 for i_time in '' '-DI_TIME'; do
10021 for i_systime in '-DI_SYSTIME' ''; do
10024 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10025 if eval $compile; then
10026 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10030 $echo $n "Succeeded with $flags$c"
10042 *SYSTIMEKERNEL*) i_systimek="$define"
10043 timeincl=`./findhdr sys/time.h`
10044 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10045 *) i_systimek="$undef";;
10048 *I_TIME*) i_time="$define"
10049 timeincl=`./findhdr time.h`" $timeincl"
10050 echo "We'll include <time.h>." >&4;;
10051 *) i_time="$undef";;
10054 *I_SYSTIME*) i_systime="$define"
10055 timeincl=`./findhdr sys/time.h`" $timeincl"
10056 echo "We'll include <sys/time.h>." >&4;;
10057 *) i_systime="$undef";;
10061 : see if struct tm knows about tm_zone
10062 case "$i_systime$i_time" in
10065 echo "Checking to see if your struct tm has tm_zone field..." >&4
10066 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10074 case "$d_tm_tm_zone" in
10075 "$define") echo "Yes, it does." ;;
10076 *) echo "No, it doesn't." ;;
10078 : see if struct tm knows about tm_gmtoff
10079 case "$i_systime$i_time" in
10082 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10083 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10091 case "$d_tm_tm_gmtoff" in
10092 "$define") echo "Yes, it does." ;;
10093 *) echo "No, it doesn't." ;;
10096 : see if asctime_r exists
10097 set asctime_r d_asctime_r
10099 case "$d_asctime_r" in
10101 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10102 case "$d_asctime_r_proto:$usethreads" in
10103 ":define") d_asctime_r_proto=define
10104 set d_asctime_r_proto asctime_r $hdrs
10108 case "$d_asctime_r_proto" in
10110 case "$asctime_r_proto" in
10111 ''|0) try='char* asctime_r(const struct tm*, char*);'
10112 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
10114 case "$asctime_r_proto" in
10115 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10116 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
10118 case "$asctime_r_proto" in
10119 ''|0) try='int asctime_r(const struct tm*, char*);'
10120 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
10122 case "$asctime_r_proto" in
10123 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10124 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
10126 case "$asctime_r_proto" in
10127 ''|0) d_asctime_r=undef
10129 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10130 * ) case "$asctime_r_proto" in
10131 REENTRANT_PROTO*) ;;
10132 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10134 echo "Prototype: $try" ;;
10137 *) case "$usethreads" in
10138 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10145 *) asctime_r_proto=0
10149 : see if atolf exists
10153 : see if atoll exists
10157 : Look for GCC-style attribute format
10158 case "$d_attribute_format" in
10161 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10162 $cat >attrib.c <<'EOCP'
10164 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10166 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10167 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10168 echo "Your C compiler doesn't support __attribute__((format))."
10171 echo "Your C compiler supports __attribute__((format))."
10175 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10179 *) val="$d_attribute_format" ;;
10181 set d_attribute_format
10185 : Look for GCC-style attribute format with null format allowed
10186 case "$d_printf_format_null" in
10187 '') case "$d_attribute_format" in
10190 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10191 $cat >attrib.c <<EOCP
10193 #$i_stdlib I_STDLIB
10195 #include <stdlib.h>
10197 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10198 int null_printf (char* pat,...) { return (int)pat; }
10199 int main () { exit(null_printf(NULL)); }
10201 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10202 : run the executable in case it produces a run-time warning
10203 if $run ./attrib >>attrib.out 2>&1; then
10204 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10205 echo "Your C compiler doesn't allow __printf__ format to be null."
10208 echo "Your C compiler allows __printf__ format to be null."
10212 echo "Your C compiler executable failed with __printf__ format null."
10216 echo "Your C compiler fails with __printf__ format null."
10223 *) val="$d_printf_format_null" ;;
10225 set d_printf_format_null
10229 : Look for GCC-style attribute malloc
10230 case "$d_attribute_malloc" in
10233 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10234 $cat >attrib.c <<'EOCP'
10236 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10238 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10239 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10240 echo "Your C compiler doesn't support __attribute__((malloc))."
10243 echo "Your C compiler supports __attribute__((malloc))."
10247 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10251 *) val="$d_attribute_malloc" ;;
10253 set d_attribute_malloc
10257 : Look for GCC-style attribute nonnull
10258 case "$d_attribute_nonnull" in
10261 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10262 $cat >attrib.c <<'EOCP'
10264 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10266 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10267 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10268 echo "Your C compiler doesn't support __attribute__((nonnull))."
10271 echo "Your C compiler supports __attribute__((nonnull))."
10275 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10279 *) val="$d_attribute_nonnull" ;;
10281 set d_attribute_nonnull
10285 : Look for GCC-style attribute noreturn
10286 case "$d_attribute_noreturn" in
10289 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10290 $cat >attrib.c <<'EOCP'
10292 void fall_over_dead( void ) __attribute__((noreturn));
10294 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10295 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10296 echo "Your C compiler doesn't support __attribute__((noreturn))."
10299 echo "Your C compiler supports __attribute__((noreturn))."
10303 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10307 *) val="$d_attribute_noreturn" ;;
10309 set d_attribute_noreturn
10313 : Look for GCC-style attribute pure
10314 case "$d_attribute_pure" in
10317 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10318 $cat >attrib.c <<'EOCP'
10320 int square( int n ) __attribute__((pure));
10322 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10323 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10324 echo "Your C compiler doesn't support __attribute__((pure))."
10327 echo "Your C compiler supports __attribute__((pure))."
10331 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10335 *) val="$d_attribute_pure" ;;
10337 set d_attribute_pure
10341 : Look for GCC-style attribute unused
10342 case "$d_attribute_unused" in
10345 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10346 $cat >attrib.c <<'EOCP'
10348 int do_something( int dummy __attribute__((unused)), int n );
10350 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10351 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10352 echo "Your C compiler doesn't support __attribute__((unused))."
10355 echo "Your C compiler supports __attribute__((unused))."
10359 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10363 *) val="$d_attribute_unused" ;;
10365 set d_attribute_unused
10369 : Look for GCC-style attribute warn_unused_result
10370 case "$d_attribute_warn_unused_result" in
10373 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10374 $cat >attrib.c <<'EOCP'
10376 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10378 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10379 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10380 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10383 echo "Your C compiler supports __attribute__((warn_unused_result))."
10387 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10391 *) val="$d_attribute_warn_unused_result" ;;
10393 set d_attribute_warn_unused_result
10397 : see if bcmp exists
10401 : see if bcopy exists
10405 : see if getpgrp exists
10406 set getpgrp d_getpgrp
10409 case "$d_getpgrp" in
10412 echo "Checking to see which flavor of getpgrp is in use..."
10414 #$i_unistd I_UNISTD
10415 #include <sys/types.h>
10417 # include <unistd.h>
10419 #$i_stdlib I_STDLIB
10421 #include <stdlib.h>
10425 if (getuid() == 0) {
10426 printf("(I see you are running Configure as super-user...)\n");
10429 #ifdef TRY_BSD_PGRP
10430 if (getpgrp(1) == 0)
10439 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10440 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10442 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10443 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10446 echo "I can't seem to compile and run the test program."
10448 xxx="a USG one, i.e. you use getpgrp()."
10450 # SVR4 systems can appear rather BSD-ish.
10451 case "$i_unistd" in
10453 xxx="a BSD one, i.e. you use getpgrp(pid)."
10457 xxx="probably a USG one, i.e. you use getpgrp()."
10462 echo "Assuming your getpgrp is $xxx" >&4
10471 : see if setpgrp exists
10472 set setpgrp d_setpgrp
10475 case "$d_setpgrp" in
10478 echo "Checking to see which flavor of setpgrp is in use..."
10480 #$i_unistd I_UNISTD
10481 #include <sys/types.h>
10483 # include <unistd.h>
10485 #$i_stdlib I_STDLIB
10487 #include <stdlib.h>
10491 if (getuid() == 0) {
10492 printf("(I see you are running Configure as super-user...)\n");
10495 #ifdef TRY_BSD_PGRP
10496 if (-1 == setpgrp(1, 1))
10499 if (setpgrp() != -1)
10505 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10506 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10508 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10509 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10512 echo "(I can't seem to compile and run the test program.)"
10514 xxx="a USG one, i.e. you use setpgrp()."
10516 # SVR4 systems can appear rather BSD-ish.
10517 case "$i_unistd" in
10519 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10523 xxx="probably a USG one, i.e. you use setpgrp()."
10528 echo "Assuming your setpgrp is $xxx" >&4
10537 : Look for GCC-style __builtin_choose_expr
10538 case "$d_builtin_choose_expr" in
10541 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10542 $cat >try.c <<'EOCP'
10543 #include <assert.h>
10544 #include <stdlib.h>
10547 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10550 assert( SYRINX(1) == 2112 );
10551 assert( SYRINX(1) != 5150 );
10552 assert( SYRINX(0) == 5150 );
10553 assert( SYRINX(0) != 2112 );
10554 puts( "All good!" );
10560 if eval $compile; then
10561 echo "Your C compiler supports __builtin_choose_expr."
10564 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10568 *) val="$d_builtin_choose_expr" ;;
10571 set d_builtin_choose_expr
10575 : Look for GCC-style __builtin_expect
10576 case "$d_builtin_expect" in
10579 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10580 $cat >builtin.c <<'EOCP'
10583 if ( __builtin_expect(n, 0) ) n = 1;
10587 if eval $compile; then
10588 echo "Your C compiler supports __builtin_choose_expr."
10591 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10595 *) val="$d_builtin_expect" ;;
10598 set d_builtin_expect
10602 : see if bzero exists
10606 : see if stdarg is available
10608 if $test `./findhdr stdarg.h`; then
10609 echo "<stdarg.h> found." >&4
10612 echo "<stdarg.h> NOT found." >&4
10616 : see if varags is available
10618 if $test `./findhdr varargs.h`; then
10619 echo "<varargs.h> found." >&4
10621 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10624 : set up the varargs testing programs
10625 $cat > varargs.c <<EOP
10627 #include <stdarg.h>
10630 #include <varargs.h>
10634 int f(char *p, ...)
10648 p = va_arg(ap, char *);
10654 $cat > varargs <<EOP
10656 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10665 : now check which varargs header should be included
10670 if `./varargs I_STDARG`; then
10672 elif `./varargs I_VARARGS`; then
10677 if `./varargs I_VARARGS`; then
10684 echo "I could not find the definition for va_dcl... You have problems..." >&4
10685 val="$undef"; set i_stdarg; eval $setvar
10686 val="$undef"; set i_varargs; eval $setvar
10691 case "$i_varhdr" in
10693 val="$define"; set i_stdarg; eval $setvar
10694 val="$undef"; set i_varargs; eval $setvar
10697 val="$undef"; set i_stdarg; eval $setvar
10698 val="$define"; set i_varargs; eval $setvar
10701 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10705 : see if the Compiler supports C99 variadic macros
10706 case "$i_stdarg$i_stdlib" in
10708 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10711 #include <stdarg.h>
10713 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10717 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10723 if eval $compile && $run ./try 2>&1 >/dev/null; then
10724 case "`$run ./try`" in
10726 echo "You have C99 variadic macros." >&4
10727 d_c99_variadic_macros="$define"
10730 echo "You don't have functional C99 variadic macros." >&4
10731 d_c99_variadic_macros="$undef"
10735 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10736 d_c99_variadic_macros="$undef"
10741 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10742 d_c99_variadic_macros="$undef"
10746 : see if signal is declared as pointer to function returning int or void
10748 xxx=`./findhdr signal.h`
10749 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10750 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10751 echo "You have int (*signal())() instead of void." >&4
10753 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10754 echo "You have void (*signal())()." >&4
10756 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10757 echo "You have int (*signal())() instead of void." >&4
10759 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10760 echo "You have void (*signal())()." >&4
10763 case "$d_voidsig" in
10765 echo "I can't determine whether signal handler returns void or int..." >&4
10767 rp="What type does your signal handler return?"
10770 v*) val="$define";;
10774 echo "As you already told me, signal handler returns void." >&4
10777 *) echo "As you already told me, signal handler returns int." >&4
10784 case "$d_voidsig" in
10785 "$define") signal_t="void";;
10786 *) signal_t="int";;
10790 : check for ability to cast large floats to 32-bit ints.
10792 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10793 if $test "$intsize" -ge 4; then
10800 #$i_stdlib I_STDLIB
10802 #include <stdlib.h>
10804 #include <sys/types.h>
10805 #include <signal.h>
10806 $signal_t blech(int s) { exit(3); }
10813 signal(SIGFPE, blech);
10815 /* Don't let compiler optimize the test away. Store the number
10816 in a writable string for gcc to pass to sscanf under HP/UX.
10818 sprintf(str, "2147483647");
10819 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10823 /* x86 processors will probably give 0x8000 0000, which is a
10824 sign change. We don't want that. We want to mimic SPARC
10825 behavior here, which is to preserve the sign and give
10828 if (i32 != ($xxx) f)
10834 if eval $compile_ok; then
10838 echo "(I can't seem to compile the test program--assuming it can't)"
10843 echo "Yup, it can."
10846 echo "Nope, it can't."
10853 : check for ability to cast negative floats to unsigned
10855 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10858 #$i_stdlib I_STDLIB
10860 #include <stdlib.h>
10862 #include <sys/types.h>
10863 #include <signal.h>
10864 $signal_t blech(int s) { exit(7); }
10865 $signal_t blech_in_list(int s) { exit(4); }
10866 unsigned long dummy_long(unsigned long p) { return p; }
10867 unsigned int dummy_int(unsigned int p) { return p; }
10868 unsigned short dummy_short(unsigned short p) { return p; }
10872 unsigned long along;
10874 unsigned short ashort;
10878 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10879 a direct f = -123. assignment. gcc-2.8.0 reportedly
10880 optimized the whole file away
10882 /* Store the number in a writable string for gcc to pass to
10883 sscanf under HP/UX.
10885 sprintf(str, "-123");
10886 sscanf(str, "%lf", &f); /* f = -123.; */
10888 signal(SIGFPE, blech);
10889 along = (unsigned long)f;
10890 aint = (unsigned int)f;
10891 ashort = (unsigned short)f;
10892 if (along != (unsigned long)-123)
10894 if (aint != (unsigned int)-123)
10896 if (ashort != (unsigned short)-123)
10898 sprintf(str, "1073741824.");
10899 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10902 along = (unsigned long)f;
10903 if (along != 0x80000000)
10907 along = (unsigned long)f;
10908 if (along != 0x7fffffff)
10912 along = (unsigned long)f;
10913 if (along != 0x80000001)
10917 signal(SIGFPE, blech_in_list);
10918 sprintf(str, "123.");
10919 sscanf(str, "%lf", &f); /* f = 123.; */
10920 along = dummy_long((unsigned long)f);
10921 aint = dummy_int((unsigned int)f);
10922 ashort = dummy_short((unsigned short)f);
10923 if (along != (unsigned long)123)
10925 if (aint != (unsigned int)123)
10927 if (ashort != (unsigned short)123)
10934 if eval $compile_ok; then
10938 echo "(I can't seem to compile the test program--assuming it can't)"
10941 case "$castflags" in
10943 echo "Yup, it can."
10946 echo "Nope, it can't."
10953 : see if vprintf exists
10955 if set vprintf val -f d_vprintf; eval $csym; $val; then
10956 echo 'vprintf() found.' >&4
10959 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
10960 #$i_varargs I_VARARGS
10962 #$i_stdlib I_STDLIB
10963 #$i_unistd I_UNISTD
10966 # include <stdarg.h>
10967 #else /* I_VARARGS */
10968 # include <varargs.h>
10972 # include <unistd.h>
10976 # include <stdlib.h>
10979 #include <stdio.h> /* vsprintf prototype */
10982 void xxx(int n, ...)
10987 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10989 int main() { xxx(1, "foo"); }
10991 #else /* I_VARARGS */
10999 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11001 int main() { xxx("foo"); }
11007 if eval $compile_ok; then
11008 if $run ./try; then
11009 echo "Your vsprintf() returns (int)." >&4
11012 echo "Your vsprintf() returns (char*)." >&4
11016 echo 'I am unable to compile the vsprintf() test program.' >&4
11017 # We shouldn't get here. If we do, assume the standard signature,
11018 # not the old BSD one.
11019 echo 'Guessing that vsprintf() returns (int).' >&4
11023 echo 'vprintf() NOT found.' >&4
11034 : see if chown exists
11038 : see if chroot exists
11039 set chroot d_chroot
11042 : see if chsize exists
11043 set chsize d_chsize
11046 : see if class exists
11050 : see if clearenv exists
11051 set clearenv d_clearenv
11054 : Define hasstruct macro for Configure internal use
11055 hasstruct='varname=$1; struct=$2; shift; shift;
11056 while $test $# -ge 2; do
11058 $define) echo "#include <$2>";;
11062 echo "int main () { struct $struct foo; }" >> try.c;
11064 if eval $compile; then
11073 : see whether socket exists
11077 $echo $n "Hmm... $c" >&4
11078 if set socket val -f d_socket; eval $csym; $val; then
11079 echo "Looks like you have Berkeley networking support." >&4
11081 if set setsockopt val -f; eval $csym; $val; then
11084 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11085 d_oldsock="$define"
11088 if $contains socklib libc.list >/dev/null 2>&1; then
11089 echo "Looks like you have Berkeley networking support." >&4
11091 : we will have to assume that it supports the 4.2 BSD interface
11094 echo "You don't have Berkeley networking in libc$_a..." >&4
11095 if test "X$d_socket" = "X$define"; then
11096 echo "...but you seem to believe that you have sockets." >&4
11098 for net in net socket
11100 if test -f /usr/lib/lib$net$_a; then
11101 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11102 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11103 if $contains socket libc.list >/dev/null 2>&1; then
11108 echo "...but the Wollongong group seems to have hacked it in." >&4
11109 sockethdr="-I/usr/netinclude"
11112 echo "Found Berkeley sockets interface in lib$net." >&4
11113 if $contains setsockopt libc.list >/dev/null 2>&1; then
11116 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11117 d_oldsock="$define"
11123 if test "X$d_socket" != "X$define"; then
11124 echo "or anywhere else I see." >&4
11132 : see if socketpair exists
11133 set socketpair d_sockpair
11138 echo "Checking the availability of certain socket constants..." >&4
11139 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11140 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11142 #include <sys/types.h>
11143 #include <sys/socket.h>
11149 set try; if eval $compile; then
11152 set d_${enum}; eval $setvar
11156 : see if this is a sys/uio.h system
11157 set sys/uio.h i_sysuio
11160 : Check for cmsghdr support
11162 echo "Checking to see if your system supports struct cmsghdr..." >&4
11163 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11165 case "$d_cmsghdr_s" in
11166 "$define") echo "Yes, it does." ;;
11167 *) echo "No, it doesn't." ;;
11171 : check for const keyword
11173 echo 'Checking to see if your C compiler knows about "const"...' >&4
11174 $cat >const.c <<'EOCP'
11175 typedef struct spug { int drokk; } spug;
11179 const spug y = { 0 };
11182 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11184 echo "Yup, it does."
11187 echo "Nope, it doesn't."
11192 : see if copysignl exists
11193 set copysignl d_copysignl
11196 : see if crypt exists
11201 $define) cryptlib='' ;;
11202 *) if set crypt val -f d_crypt; eval $csym; $val; then
11203 echo 'crypt() found.' >&4
11207 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11208 if $test -z "$cryptlib"; then
11209 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11213 if $test -z "$cryptlib"; then
11214 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11218 if $test -z "$cryptlib"; then
11219 cryptlib=`./loc libcrypt$_a "" $libpth`
11223 if $test -z "$cryptlib"; then
11224 echo 'crypt() NOT found.' >&4
11235 : see if this is a crypt.h system
11236 set crypt.h i_crypt
11239 : see if crypt_r exists
11240 set crypt_r d_crypt_r
11242 case "$d_crypt_r" in
11244 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11245 case "$d_crypt_r_proto:$usethreads" in
11246 ":define") d_crypt_r_proto=define
11247 set d_crypt_r_proto crypt_r $hdrs
11251 case "$d_crypt_r_proto" in
11253 case "$crypt_r_proto" in
11254 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11255 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
11257 case "$crypt_r_proto" in
11258 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11259 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
11261 case "$crypt_r_proto" in
11262 ''|0) d_crypt_r=undef
11264 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11265 * ) case "$crypt_r_proto" in
11266 REENTRANT_PROTO*) ;;
11267 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11269 echo "Prototype: $try" ;;
11272 *) case "$usethreads" in
11273 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11284 : get csh whereabouts
11286 'csh') val="$undef" ;;
11287 *) val="$define" ;;
11291 : Respect a hint or command line value for full_csh.
11292 case "$full_csh" in
11293 '') full_csh=$csh ;;
11296 : see if ctermid exists
11297 set ctermid d_ctermid
11300 : see if ctermid_r exists
11301 set ctermid_r d_ctermid_r
11303 case "$d_ctermid_r" in
11305 hdrs="$i_systypes sys/types.h define stdio.h "
11306 case "$d_ctermid_r_proto:$usethreads" in
11307 ":define") d_ctermid_r_proto=define
11308 set d_ctermid_r_proto ctermid_r $hdrs
11312 case "$d_ctermid_r_proto" in
11314 case "$ctermid_r_proto" in
11315 ''|0) try='char* ctermid_r(char*);'
11316 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
11318 case "$ctermid_r_proto" in
11319 ''|0) d_ctermid_r=undef
11321 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11322 * ) case "$ctermid_r_proto" in
11323 REENTRANT_PROTO*) ;;
11324 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11326 echo "Prototype: $try" ;;
11329 *) case "$usethreads" in
11330 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11337 *) ctermid_r_proto=0
11341 : see if ctime_r exists
11342 set ctime_r d_ctime_r
11344 case "$d_ctime_r" in
11346 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11347 case "$d_ctime_r_proto:$usethreads" in
11348 ":define") d_ctime_r_proto=define
11349 set d_ctime_r_proto ctime_r $hdrs
11353 case "$d_ctime_r_proto" in
11355 case "$ctime_r_proto" in
11356 ''|0) try='char* ctime_r(const time_t*, char*);'
11357 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
11359 case "$ctime_r_proto" in
11360 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11361 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
11363 case "$ctime_r_proto" in
11364 ''|0) try='int ctime_r(const time_t*, char*);'
11365 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
11367 case "$ctime_r_proto" in
11368 ''|0) try='int ctime_r(const time_t*, char*, int);'
11369 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
11371 case "$ctime_r_proto" in
11372 ''|0) d_ctime_r=undef
11374 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11375 * ) case "$ctime_r_proto" in
11376 REENTRANT_PROTO*) ;;
11377 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11379 echo "Prototype: $try" ;;
11382 *) case "$usethreads" in
11383 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11394 : see if cuserid exists
11395 set cuserid d_cuserid
11398 : see if this is a limits.h system
11399 set limits.h i_limits
11402 : see if this is a float.h system
11403 set float.h i_float
11406 : See if number of significant digits in a double precision number is known
11408 $cat >dbl_dig.c <<EOM
11409 #$i_limits I_LIMITS
11412 #include <limits.h>
11418 printf("Contains DBL_DIG");
11421 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11422 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11423 echo "DBL_DIG found." >&4
11426 echo "DBL_DIG NOT found." >&4
11433 : see if dbm.h is available
11434 : see if dbmclose exists
11435 set dbmclose d_dbmclose
11438 case "$d_dbmclose" in
11448 *) set rpcsvc/dbm.h i_rpcsvcdbm
11453 *) echo "We won't be including <dbm.h>"
11463 : see if prototype for dbminit is available
11465 set d_dbminitproto dbminit $i_dbm dbm.h
11468 : see if difftime exists
11469 set difftime d_difftime
11472 : see if this is a dirent system
11474 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11476 echo "<dirent.h> found." >&4
11479 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11480 echo "<sys/dir.h> found." >&4
11483 xinc=`./findhdr sys/ndir.h`
11485 echo "<dirent.h> NOT found." >&4
11490 : Look for type of directory structure.
11492 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11494 case "$direntrytype" in
11496 case "$i_dirent" in
11497 $define) guess1='struct dirent' ;;
11498 *) guess1='struct direct' ;;
11501 *) guess1="$direntrytype"
11506 'struct dirent') guess2='struct direct' ;;
11507 *) guess2='struct dirent' ;;
11510 if $contains "$guess1" try.c >/dev/null 2>&1; then
11511 direntrytype="$guess1"
11512 echo "Your directory entries are $direntrytype." >&4
11513 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11514 direntrytype="$guess2"
11515 echo "Your directory entries seem to be $direntrytype." >&4
11517 echo "I don't recognize your system's directory entries." >&4
11518 rp="What type is used for directory entries on this system?"
11521 direntrytype="$ans"
11525 : see if the directory entry stores field length
11527 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11528 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11529 echo "Good, your directory entry keeps length information in d_namlen." >&4
11532 echo "Your directory entry does not know about the d_namlen field." >&4
11539 : Look for DIR.dd_fd
11540 case "$i_dirent" in
11542 echo "Checking to see if DIR has a dd_fd member variable" >&4
11544 #$i_stdlib I_STDLIB
11546 #include <stdlib.h>
11548 #include <dirent.h>
11558 if eval $compile; then
11559 echo "Yes, it does."
11562 echo "No, it does not."
11567 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11575 : see if this is an sysdir system
11576 set sys/dir.h i_sysdir
11579 : see if this is an sysndir system
11580 set sys/ndir.h i_sysndir
11585 $cat >dirfd.c <<EOM
11587 #$i_stdlib I_STDLIB
11589 #include <stdlib.h>
11591 #$i_dirent I_DIRENT /**/
11592 #$i_sysdir I_SYS_DIR /**/
11593 #$i_sysndir I_SYS_NDIR /**/
11594 #$i_systypes I_SYS_TYPES /**/
11595 #if defined(I_SYS_TYPES)
11596 #include <sys/types.h>
11598 #if defined(I_DIRENT)
11599 #include <dirent.h>
11600 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11601 #include <sys/dir.h>
11605 #include <sys/ndir.h>
11609 #include <ndir.h> /* may be wrong in the future */
11611 #include <sys/dir.h>
11617 DIR *dirp = opendir(".");
11618 if (dirfd(dirp) >= 0)
11626 if eval $compile; then
11630 $define) echo "dirfd() found." >&4 ;;
11631 *) echo "dirfd() NOT found." >&4 ;;
11637 : see if dlerror exists
11640 set dlerror d_dlerror
11644 : see if dlfcn is available
11645 set dlfcn.h i_dlfcn
11648 : Check what extension to use for shared libs
11653 On a few systems, the dynamically loaded modules that perl generates and uses
11654 will need a different extension than shared libs. The default will probably
11660 *) dflt="$dlext" ;;
11662 rp='What is the extension of dynamically loaded modules'
11671 : Check if dlsym need a leading underscore
11677 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11678 $cat >dyna.c <<'EOM'
11685 #$i_stdlib I_STDLIB
11687 #include <stdlib.h>
11691 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11693 #include <sys/types.h>
11698 extern int fred() ;
11707 int mode = RTLD_LAZY ;
11709 handle = dlopen("./dyna.$dlext", mode) ;
11710 if (handle == NULL) {
11715 symbol = dlsym(handle, "fred") ;
11716 if (symbol == NULL) {
11717 /* try putting a leading underscore */
11718 symbol = dlsym(handle, "_fred") ;
11719 if (symbol == NULL) {
11732 : Call the object file tmp-dyna.o in case dlext=o.
11733 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11734 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11735 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11736 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11739 1) echo "Test program failed using dlopen." >&4
11740 echo "Perhaps you should not use dynamic loading." >&4;;
11741 2) echo "Test program failed using dlsym." >&4
11742 echo "Perhaps you should not use dynamic loading." >&4;;
11743 3) echo "dlsym needs a leading underscore" >&4
11745 4) echo "dlsym doesn't need a leading underscore." >&4;;
11748 echo "I can't compile and run the test program." >&4
11749 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11754 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11759 : see if drand48_r exists
11760 set drand48_r d_drand48_r
11762 case "$d_drand48_r" in
11764 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11765 case "$d_drand48_r_proto:$usethreads" in
11766 ":define") d_drand48_r_proto=define
11767 set d_drand48_r_proto drand48_r $hdrs
11771 case "$d_drand48_r_proto" in
11773 case "$drand48_r_proto" in
11774 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11775 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11777 case "$drand48_r_proto" in
11778 ''|0) d_drand48_r=undef
11780 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11781 * ) case "$drand48_r_proto" in
11782 REENTRANT_PROTO*) ;;
11783 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11785 echo "Prototype: $try" ;;
11788 *) case "$usethreads" in
11789 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11796 *) drand48_r_proto=0
11800 : see if prototype for drand48 is available
11802 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11805 : see if dup2 exists
11809 : see if eaccess exists
11810 set eaccess d_eaccess
11813 : see if endgrent exists
11814 set endgrent d_endgrent
11817 : see if this is an grp system
11823 xxx=`./findhdr grp.h`
11824 $cppstdin $cppflags $cppminus < $xxx >$$.h
11826 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11838 set d_grpasswd; eval $setvar
11842 : see if endgrent_r exists
11843 set endgrent_r d_endgrent_r
11845 case "$d_endgrent_r" in
11847 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11848 case "$d_endgrent_r_proto:$usethreads" in
11849 ":define") d_endgrent_r_proto=define
11850 set d_endgrent_r_proto endgrent_r $hdrs
11854 case "$d_endgrent_r_proto" in
11856 case "$endgrent_r_proto" in
11857 ''|0) try='int endgrent_r(FILE**);'
11858 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11860 case "$endgrent_r_proto" in
11861 ''|0) try='void endgrent_r(FILE**);'
11862 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11864 case "$endgrent_r_proto" in
11865 ''|0) d_endgrent_r=undef
11867 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11868 * ) case "$endgrent_r_proto" in
11869 REENTRANT_PROTO*) ;;
11870 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11872 echo "Prototype: $try" ;;
11875 *) case "$usethreads" in
11876 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11883 *) endgrent_r_proto=0
11887 : see if endhostent exists
11888 set endhostent d_endhent
11891 : see if this is a netdb.h system
11892 set netdb.h i_netdb
11895 : see if endhostent_r exists
11896 set endhostent_r d_endhostent_r
11898 case "$d_endhostent_r" in
11900 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11901 case "$d_endhostent_r_proto:$usethreads" in
11902 ":define") d_endhostent_r_proto=define
11903 set d_endhostent_r_proto endhostent_r $hdrs
11907 case "$d_endhostent_r_proto" in
11909 case "$endhostent_r_proto" in
11910 ''|0) try='int endhostent_r(struct hostent_data*);'
11911 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11913 case "$endhostent_r_proto" in
11914 ''|0) try='void endhostent_r(struct hostent_data*);'
11915 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11917 case "$endhostent_r_proto" in
11918 ''|0) d_endhostent_r=undef
11919 endhostent_r_proto=0
11920 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11921 * ) case "$endhostent_r_proto" in
11922 REENTRANT_PROTO*) ;;
11923 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11925 echo "Prototype: $try" ;;
11928 *) case "$usethreads" in
11929 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11931 d_endhostent_r=undef
11932 endhostent_r_proto=0
11936 *) endhostent_r_proto=0
11940 : see if endnetent exists
11941 set endnetent d_endnent
11944 : see if endnetent_r exists
11945 set endnetent_r d_endnetent_r
11947 case "$d_endnetent_r" in
11949 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11950 case "$d_endnetent_r_proto:$usethreads" in
11951 ":define") d_endnetent_r_proto=define
11952 set d_endnetent_r_proto endnetent_r $hdrs
11956 case "$d_endnetent_r_proto" in
11958 case "$endnetent_r_proto" in
11959 ''|0) try='int endnetent_r(struct netent_data*);'
11960 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11962 case "$endnetent_r_proto" in
11963 ''|0) try='void endnetent_r(struct netent_data*);'
11964 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11966 case "$endnetent_r_proto" in
11967 ''|0) d_endnetent_r=undef
11968 endnetent_r_proto=0
11969 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11970 * ) case "$endnetent_r_proto" in
11971 REENTRANT_PROTO*) ;;
11972 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11974 echo "Prototype: $try" ;;
11977 *) case "$usethreads" in
11978 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11980 d_endnetent_r=undef
11981 endnetent_r_proto=0
11985 *) endnetent_r_proto=0
11989 : see if endprotoent exists
11990 set endprotoent d_endpent
11993 : see if endprotoent_r exists
11994 set endprotoent_r d_endprotoent_r
11996 case "$d_endprotoent_r" in
11998 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11999 case "$d_endprotoent_r_proto:$usethreads" in
12000 ":define") d_endprotoent_r_proto=define
12001 set d_endprotoent_r_proto endprotoent_r $hdrs
12005 case "$d_endprotoent_r_proto" in
12007 case "$endprotoent_r_proto" in
12008 ''|0) try='int endprotoent_r(struct protoent_data*);'
12009 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
12011 case "$endprotoent_r_proto" in
12012 ''|0) try='void endprotoent_r(struct protoent_data*);'
12013 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
12015 case "$endprotoent_r_proto" in
12016 ''|0) d_endprotoent_r=undef
12017 endprotoent_r_proto=0
12018 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12019 * ) case "$endprotoent_r_proto" in
12020 REENTRANT_PROTO*) ;;
12021 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12023 echo "Prototype: $try" ;;
12026 *) case "$usethreads" in
12027 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12029 d_endprotoent_r=undef
12030 endprotoent_r_proto=0
12034 *) endprotoent_r_proto=0
12038 : see if endpwent exists
12039 set endpwent d_endpwent
12042 : see if this is a pwd.h system
12048 xxx=`./findhdr pwd.h`
12049 $cppstdin $cppflags $cppminus < $xxx >$$.h
12051 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12059 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12067 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12075 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12083 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12091 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12099 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12107 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12119 set d_pwquota; eval $setvar
12120 set d_pwage; eval $setvar
12121 set d_pwchange; eval $setvar
12122 set d_pwclass; eval $setvar
12123 set d_pwexpire; eval $setvar
12124 set d_pwcomment; eval $setvar
12125 set d_pwgecos; eval $setvar
12126 set d_pwpasswd; eval $setvar
12130 : see if endpwent_r exists
12131 set endpwent_r d_endpwent_r
12133 case "$d_endpwent_r" in
12135 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12136 case "$d_endpwent_r_proto:$usethreads" in
12137 ":define") d_endpwent_r_proto=define
12138 set d_endpwent_r_proto endpwent_r $hdrs
12142 case "$d_endpwent_r_proto" in
12144 case "$endpwent_r_proto" in
12145 ''|0) try='int endpwent_r(FILE**);'
12146 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
12148 case "$endpwent_r_proto" in
12149 ''|0) try='void endpwent_r(FILE**);'
12150 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
12152 case "$endpwent_r_proto" in
12153 ''|0) d_endpwent_r=undef
12155 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12156 * ) case "$endpwent_r_proto" in
12157 REENTRANT_PROTO*) ;;
12158 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12160 echo "Prototype: $try" ;;
12163 *) case "$usethreads" in
12164 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12171 *) endpwent_r_proto=0
12175 : see if endservent exists
12176 set endservent d_endsent
12179 : see if endservent_r exists
12180 set endservent_r d_endservent_r
12182 case "$d_endservent_r" in
12184 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12185 case "$d_endservent_r_proto:$usethreads" in
12186 ":define") d_endservent_r_proto=define
12187 set d_endservent_r_proto endservent_r $hdrs
12191 case "$d_endservent_r_proto" in
12193 case "$endservent_r_proto" in
12194 ''|0) try='int endservent_r(struct servent_data*);'
12195 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
12197 case "$endservent_r_proto" in
12198 ''|0) try='void endservent_r(struct servent_data*);'
12199 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
12201 case "$endservent_r_proto" in
12202 ''|0) d_endservent_r=undef
12203 endservent_r_proto=0
12204 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12205 * ) case "$endservent_r_proto" in
12206 REENTRANT_PROTO*) ;;
12207 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12209 echo "Prototype: $try" ;;
12212 *) case "$usethreads" in
12213 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12215 d_endservent_r=undef
12216 endservent_r_proto=0
12220 *) endservent_r_proto=0
12224 : Locate the flags for 'open()'
12227 #include <sys/types.h>
12232 #include <sys/file.h>
12234 #$i_stdlib I_STDLIB
12236 #include <stdlib.h>
12247 : check sys/file.h first to get FREAD on Sun
12248 if $test `./findhdr sys/file.h` && \
12249 set try -DI_SYS_FILE && eval $compile; then
12251 echo "<sys/file.h> defines the O_* constants..." >&4
12252 if $run ./try; then
12253 echo "and you have the 3 argument form of open()." >&4
12256 echo "but not the 3 argument form of open(). Oh, well." >&4
12259 elif $test `./findhdr fcntl.h` && \
12260 set try -DI_FCNTL && eval $compile; then
12262 echo "<fcntl.h> defines the O_* constants..." >&4
12263 if $run ./try; then
12264 echo "and you have the 3 argument form of open()." >&4
12267 echo "but not the 3 argument form of open(). Oh, well." >&4
12272 echo "I can't find the O_* constant definitions! You got problems." >&4
12278 : see which of string.h or strings.h is needed
12280 strings=`./findhdr string.h`
12281 if $test "$strings" && $test -r "$strings"; then
12282 echo "Using <string.h> instead of <strings.h>." >&4
12286 strings=`./findhdr strings.h`
12287 if $test "$strings" && $test -r "$strings"; then
12288 echo "Using <strings.h> instead of <string.h>." >&4
12290 echo "No string header found -- You'll surely have problems." >&4
12295 case "$i_string" in
12296 "$undef") strings=`./findhdr strings.h`;;
12297 *) strings=`./findhdr string.h`;;
12300 : see if this is a sys/file.h system
12305 : do we need to include sys/file.h ?
12309 if $h_sysfile; then
12311 echo "We'll be including <sys/file.h>." >&4
12314 echo "We won't be including <sys/file.h>." >&4
12324 : see if fcntl.h is there
12329 : see if we can include fcntl.h
12335 echo "We'll be including <fcntl.h>." >&4
12338 if $h_sysfile; then
12339 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12341 echo "We won't be including <fcntl.h>." >&4
12353 : see if fork exists
12357 : see if pipe exists
12361 : check for non-blocking I/O stuff
12362 case "$h_sysfile" in
12363 true) echo "#include <sys/file.h>" > head.c;;
12366 true) echo "#include <fcntl.h>" > head.c;;
12367 *) echo "#include <sys/fcntl.h>" > head.c;;
12372 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12373 case "$o_nonblock" in
12375 $cat head.c > try.c
12376 $cat >>try.c <<EOCP
12378 #$i_stdlib I_STDLIB
12380 #include <stdlib.h>
12388 printf("O_NONBLOCK\n");
12392 printf("O_NDELAY\n");
12396 printf("FNDELAY\n");
12403 if eval $compile_ok; then
12404 o_nonblock=`$run ./try`
12405 case "$o_nonblock" in
12406 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12407 *) echo "Seems like we can use $o_nonblock.";;
12410 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12413 *) echo "Using $hint value $o_nonblock.";;
12418 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12421 case "$d_fork:$d_pipe" in
12423 $cat head.c > try.c
12424 $cat >>try.c <<EOCP
12426 #include <sys/types.h>
12427 #include <signal.h>
12429 #$i_stdlib I_STDLIB
12431 #include <stdlib.h>
12437 #define MY_O_NONBLOCK $o_nonblock
12438 #ifndef errno /* XXX need better Configure test */
12441 #$i_unistd I_UNISTD
12443 #include <unistd.h>
12445 #$i_string I_STRING
12447 #include <string.h>
12449 #include <strings.h>
12451 $signal_t blech(int x) { exit(3); }
12453 $cat >> try.c <<'EOCP'
12461 pipe(pd); /* Down: child -> parent */
12462 pipe(pu); /* Up: parent -> child */
12465 close(pd[1]); /* Parent reads from pd[0] */
12466 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12468 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12473 signal(SIGALRM, blech);
12475 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12477 sprintf(string, "%d\n", ret);
12478 write(2, string, strlen(string));
12481 if (errno == EAGAIN) {
12482 printf("EAGAIN\n");
12487 if (errno == EWOULDBLOCK)
12488 printf("EWOULDBLOCK\n");
12491 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12492 sleep(2); /* Give it time to close our pipe */
12494 ret = read(pd[0], buf, 1); /* Should read EOF */
12496 sprintf(string, "%d\n", ret);
12497 write(4, string, strlen(string));
12501 close(pd[0]); /* We write to pd[1] */
12502 close(pu[1]); /* We read from pu[0] */
12503 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12504 close(pd[1]); /* Pipe pd is now fully closed! */
12505 exit(0); /* Bye bye, thank you for playing! */
12509 if eval $compile_ok; then
12510 echo "$startsh" >mtry
12511 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12513 ./mtry >/dev/null 2>&1
12515 0) eagain=`$cat try.out`;;
12516 1) echo "Could not perform non-blocking setting!";;
12517 2) echo "I did a successful read() for something that was not there!";;
12518 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12519 4) echo "Could not find F_SETFL!";;
12520 *) echo "Something terribly wrong happened during testing.";;
12522 rd_nodata=`$cat try.ret`
12523 echo "A read() system call with no data present returns $rd_nodata."
12524 case "$rd_nodata" in
12527 echo "(That's peculiar, fixing that to be -1.)"
12533 echo "Forcing errno EAGAIN on read() with no data available."
12537 echo "Your read() sets errno to $eagain when no data is available."
12540 status=`$cat try.err`
12542 0) echo "And it correctly returns 0 to signal EOF.";;
12543 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12544 *) echo "However, your read() returns '$status' on EOF??";;
12547 if test "$status" = "$rd_nodata"; then
12548 echo "WARNING: you can't distinguish between EOF and no data!"
12552 echo "I can't compile the test program--assuming errno EAGAIN will do."
12556 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12565 echo "Using $hint value $eagain."
12566 echo "Your read() returns $rd_nodata when no data is present."
12567 case "$d_eofnblk" in
12568 "$define") echo "And you can see EOF because read() returns 0.";;
12569 "$undef") echo "But you can't see EOF status from read() returned value.";;
12571 echo "(Assuming you can't see EOF status from read anyway.)"
12577 $rm_try head.c mtry
12579 : see if _ptr and _cnt from stdio act std
12582 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12583 echo "(Looks like you have stdio.h from BSD.)"
12584 case "$stdio_ptr" in
12585 '') stdio_ptr='((fp)->_p)'
12588 *) ptr_lval=$d_stdio_ptr_lval;;
12590 case "$stdio_cnt" in
12591 '') stdio_cnt='((fp)->_r)'
12594 *) cnt_lval=$d_stdio_cnt_lval;;
12596 case "$stdio_base" in
12597 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12599 case "$stdio_bufsiz" in
12600 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12602 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12603 echo "(Looks like you have stdio.h from Linux.)"
12604 case "$stdio_ptr" in
12605 '') stdio_ptr='((fp)->_IO_read_ptr)'
12608 *) ptr_lval=$d_stdio_ptr_lval;;
12610 case "$stdio_cnt" in
12611 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12614 *) cnt_lval=$d_stdio_cnt_lval;;
12616 case "$stdio_base" in
12617 '') stdio_base='((fp)->_IO_read_base)';;
12619 case "$stdio_bufsiz" in
12620 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12623 case "$stdio_ptr" in
12624 '') stdio_ptr='((fp)->_ptr)'
12627 *) ptr_lval=$d_stdio_ptr_lval;;
12629 case "$stdio_cnt" in
12630 '') stdio_cnt='((fp)->_cnt)'
12633 *) cnt_lval=$d_stdio_cnt_lval;;
12635 case "$stdio_base" in
12636 '') stdio_base='((fp)->_base)';;
12638 case "$stdio_bufsiz" in
12639 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12643 : test whether _ptr and _cnt really work
12644 echo "Checking how std your stdio is..." >&4
12647 #$i_stdlib I_STDLIB
12649 #include <stdlib.h>
12651 #define FILE_ptr(fp) $stdio_ptr
12652 #define FILE_cnt(fp) $stdio_cnt
12654 FILE *fp = fopen("try.c", "r");
12657 18 <= FILE_cnt(fp) &&
12658 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12666 if eval $compile && $to try.c; then
12667 if $run ./try; then
12668 echo "Your stdio acts pretty std."
12671 echo "Your stdio isn't very std."
12674 echo "Your stdio doesn't appear very std."
12678 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12679 # direct buffer manipulation no longer works. The Configure tests
12680 # should be changed to correctly detect this, but until then,
12681 # the following check should at least let perl compile and run.
12682 # (This quick fix should be updated before 5.8.1.)
12683 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12684 # A. Dougherty, June 3, 2002.
12685 case "$d_gnulibc" in
12687 case "$gnulibc_version" in
12691 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12700 : Can _ptr be used as an lvalue?
12701 case "$d_stdstdio$ptr_lval" in
12702 $define$define) val=$define ;;
12705 set d_stdio_ptr_lval
12708 : Can _cnt be used as an lvalue?
12709 case "$d_stdstdio$cnt_lval" in
12710 $define$define) val=$define ;;
12713 set d_stdio_cnt_lval
12717 : test whether setting _ptr sets _cnt as a side effect
12718 d_stdio_ptr_lval_sets_cnt="$undef"
12719 d_stdio_ptr_lval_nochange_cnt="$undef"
12720 case "$d_stdio_ptr_lval$d_stdstdio" in
12722 echo "Checking to see what happens if we set the stdio ptr..." >&4
12725 /* Can we scream? */
12726 /* Eat dust sed :-) */
12727 /* In the buffer space, no one can hear you scream. */
12728 #$i_stdlib I_STDLIB
12730 #include <stdlib.h>
12732 #define FILE_ptr(fp) $stdio_ptr
12733 #define FILE_cnt(fp) $stdio_cnt
12734 #include <sys/types.h>
12736 FILE *fp = fopen("try.c", "r");
12741 puts("Fail even to read");
12744 c = getc(fp); /* Read away the first # */
12746 puts("Fail even to read");
12750 18 <= FILE_cnt(fp) &&
12751 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12753 puts("Fail even to read");
12756 ptr = (char*) FILE_ptr(fp);
12757 cnt = (size_t)FILE_cnt(fp);
12759 FILE_ptr(fp) += 42;
12761 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12762 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12765 if (FILE_cnt(fp) <= 20) {
12766 printf ("Fail (<20 chars to test)");
12769 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12770 puts("Fail compare");
12773 if (cnt == FILE_cnt(fp)) {
12774 puts("Pass_unchanged");
12777 if (FILE_cnt(fp) == (cnt - 42)) {
12778 puts("Pass_changed");
12781 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12787 if eval $compile && $to try.c; then
12788 case `$run ./try` in
12790 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12791 d_stdio_ptr_lval_sets_cnt="$define" ;;
12793 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12794 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12796 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12798 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12801 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12807 : see if _base is also standard
12809 case "$d_stdstdio" in
12813 #$i_stdlib I_STDLIB
12815 #include <stdlib.h>
12817 #define FILE_base(fp) $stdio_base
12818 #define FILE_bufsiz(fp) $stdio_bufsiz
12820 FILE *fp = fopen("try.c", "r");
12823 19 <= FILE_bufsiz(fp) &&
12824 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12831 if eval $compile && $to try.c; then
12832 if $run ./try; then
12833 echo "And its _base field acts std."
12836 echo "But its _base field isn't std."
12839 echo "However, it seems to be lacking the _base field."
12847 : see if fast_stdio exists
12849 case "$d_stdstdio:$d_stdio_ptr_lval" in
12851 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12853 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12864 : see if fchdir exists
12865 set fchdir d_fchdir
12868 : see if fchmod exists
12869 set fchmod d_fchmod
12872 : see if fchown exists
12873 set fchown d_fchown
12876 : see if this is an fcntl system
12880 : See if fcntl-based locking works.
12883 #$i_stdlib I_STDLIB
12885 #include <stdlib.h>
12887 #include <unistd.h>
12889 #include <signal.h>
12890 $signal_t blech(int x) { exit(3); }
12892 #if defined(F_SETLK) && defined(F_SETLKW)
12893 struct flock flock;
12895 fd = open("try.c", O_RDONLY);
12896 flock.l_type = F_RDLCK;
12897 flock.l_whence = SEEK_SET;
12898 flock.l_start = flock.l_len = 0;
12899 signal(SIGALRM, blech);
12901 retval = fcntl(fd, F_SETLK, &flock);
12903 (retval < 0 ? exit(2) : exit(0));
12909 echo "Checking if fcntl-based file locking works... "
12913 if eval $compile_ok; then
12914 if $run ./try; then
12915 echo "Yes, it seems to work."
12918 echo "Nope, it didn't work."
12923 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12924 *** This is (almost) impossible.
12925 *** If your NFS lock daemons are not feeling well, something like
12926 *** this may happen, please investigate. Cannot continue, aborting.
12934 echo "I'm unable to compile the test program, so I'll assume not."
12939 echo "Nope, since you don't even have fcntl()."
12942 set d_fcntl_can_lock
12946 : check for fd_set items
12949 Checking to see how well your C compiler handles fd_set and friends ...
12952 #$i_stdlib I_STDLIB
12954 #include <stdlib.h>
12956 #$i_systime I_SYS_TIME
12957 #$i_sysselct I_SYS_SELECT
12958 #$d_socket HAS_SOCKET
12959 #include <sys/types.h>
12961 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12964 #include <sys/time.h>
12966 #ifdef I_SYS_SELECT
12967 #include <sys/select.h>
12976 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12984 if eval $compile; then
12985 d_fds_bits="$define"
12987 echo "Well, your system knows about the normal fd_set typedef..." >&4
12988 if $run ./try; then
12989 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12990 d_fd_macros="$define"
12993 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12995 d_fd_macros="$undef"
12999 Hmm, your compiler has some difficulty with fd_set. Checking further...
13002 if eval $compile; then
13003 d_fds_bits="$undef"
13005 echo "Well, your system has some sort of fd_set available..." >&4
13006 if $run ./try; then
13007 echo "and you have the normal fd_set macros." >&4
13008 d_fd_macros="$define"
13011 but not the normal fd_set macros! Gross! More work for me...
13013 d_fd_macros="$undef"
13016 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13018 d_fds_bits="$undef"
13019 d_fd_macros="$undef"
13024 : see if fgetpos exists
13025 set fgetpos d_fgetpos
13028 : see if finite exists
13029 set finite d_finite
13032 : see if finitel exists
13033 set finitel d_finitel
13036 : see if flock exists
13040 : see if prototype for flock is available
13042 set d_flockproto flock $i_sysfile sys/file.h
13045 : see if fp_class exists
13046 set fp_class d_fp_class
13049 : see if pathconf exists
13050 set pathconf d_pathconf
13053 : see if fpathconf exists
13054 set fpathconf d_fpathconf
13057 : see if fpclass exists
13058 set fpclass d_fpclass
13061 : see if fpclassify exists
13062 set fpclassify d_fpclassify
13065 : see if fpclassl exists
13066 set fpclassl d_fpclassl
13069 : check for fpos64_t
13071 echo "Checking to see if you have fpos64_t..." >&4
13074 int main() { fpos64_t x = 7; }
13077 if eval $compile; then
13079 echo "You have fpos64_t."
13082 echo "You do not have fpos64_t."
13083 case "$fpossize" in
13084 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13091 : see if frexpl exists
13092 set frexpl d_frexpl
13095 : see if this is a sys/param system
13096 set sys/param.h i_sysparam
13099 : see if this is a sys/mount.h system
13100 set sys/mount.h i_sysmount
13103 : Check for fs_data_s
13105 echo "Checking to see if your system supports struct fs_data..." >&4
13106 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13108 case "$d_fs_data_s" in
13109 "$define") echo "Yes, it does." ;;
13110 *) echo "No, it doesn't." ;;
13113 : see if fseeko exists
13114 set fseeko d_fseeko
13116 case "$longsize" in
13117 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13120 : see if fsetpos exists
13121 set fsetpos d_fsetpos
13124 : see if fstatfs exists
13125 set fstatfs d_fstatfs
13128 : see if statvfs exists
13129 set statvfs d_statvfs
13132 : see if fstatvfs exists
13133 set fstatvfs d_fstatvfs
13137 : see if fsync exists
13141 : see if ftello exists
13142 set ftello d_ftello
13144 case "$longsize" in
13145 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13148 : check for a working futimes
13151 echo "Checking if you have a working futimes()" >&4
13154 #include <sys/time.h>
13161 fd = open ("try.c", O_RDWR);
13162 if (-1 == fd) exit (1);
13163 rv = futimes (fd, NULL);
13164 exit (rv == -1 ? errno : 0);
13168 if eval $compile; then
13172 0) echo "Yes, you have" >&4
13173 d_futimes="$define"
13175 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13179 echo "No, it does not (probably harmless)" >&4
13183 : see if getcwd exists
13184 set getcwd d_getcwd
13187 : see if getespwnam exists
13188 set getespwnam d_getespwnam
13191 : see if getfsstat exists
13192 set getfsstat d_getfsstat
13195 : see if getgrent exists
13196 set getgrent d_getgrent
13199 : see if getgrent_r exists
13200 set getgrent_r d_getgrent_r
13202 case "$d_getgrent_r" in
13204 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13205 case "$d_getgrent_r_proto:$usethreads" in
13206 ":define") d_getgrent_r_proto=define
13207 set d_getgrent_r_proto getgrent_r $hdrs
13211 case "$d_getgrent_r_proto" in
13213 case "$getgrent_r_proto" in
13214 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13215 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13217 case "$getgrent_r_proto" in
13218 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13219 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13221 case "$getgrent_r_proto" in
13222 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13223 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
13225 case "$getgrent_r_proto" in
13226 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13227 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
13229 case "$getgrent_r_proto" in
13230 ''|0) try='int getgrent_r(struct group*, char*, int);'
13231 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
13233 case "$getgrent_r_proto" in
13234 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13235 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13237 case "$getgrent_r_proto" in
13238 ''|0) d_getgrent_r=undef
13240 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13241 * ) case "$getgrent_r_proto" in
13242 REENTRANT_PROTO*) ;;
13243 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13245 echo "Prototype: $try" ;;
13248 *) case "$usethreads" in
13249 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13256 *) getgrent_r_proto=0
13260 : see if getgrgid_r exists
13261 set getgrgid_r d_getgrgid_r
13263 case "$d_getgrgid_r" in
13265 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13266 case "$d_getgrgid_r_proto:$usethreads" in
13267 ":define") d_getgrgid_r_proto=define
13268 set d_getgrgid_r_proto getgrgid_r $hdrs
13272 case "$d_getgrgid_r_proto" in
13274 case "$getgrgid_r_proto" in
13275 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13276 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13278 case "$getgrgid_r_proto" in
13279 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13280 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13282 case "$getgrgid_r_proto" in
13283 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13284 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13286 case "$getgrgid_r_proto" in
13287 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13288 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13290 case "$getgrgid_r_proto" in
13291 ''|0) d_getgrgid_r=undef
13293 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13294 * ) case "$getgrgid_r_proto" in
13295 REENTRANT_PROTO*) ;;
13296 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13298 echo "Prototype: $try" ;;
13301 *) case "$usethreads" in
13302 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13309 *) getgrgid_r_proto=0
13313 : see if getgrnam_r exists
13314 set getgrnam_r d_getgrnam_r
13316 case "$d_getgrnam_r" in
13318 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13319 case "$d_getgrnam_r_proto:$usethreads" in
13320 ":define") d_getgrnam_r_proto=define
13321 set d_getgrnam_r_proto getgrnam_r $hdrs
13325 case "$d_getgrnam_r_proto" in
13327 case "$getgrnam_r_proto" in
13328 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13329 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13331 case "$getgrnam_r_proto" in
13332 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13333 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13335 case "$getgrnam_r_proto" in
13336 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13337 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13339 case "$getgrnam_r_proto" in
13340 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13341 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13343 case "$getgrnam_r_proto" in
13344 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13345 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13347 case "$getgrnam_r_proto" in
13348 ''|0) d_getgrnam_r=undef
13350 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13351 * ) case "$getgrnam_r_proto" in
13352 REENTRANT_PROTO*) ;;
13353 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13355 echo "Prototype: $try" ;;
13358 *) case "$usethreads" in
13359 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13366 *) getgrnam_r_proto=0
13370 : see if gethostbyaddr exists
13371 set gethostbyaddr d_gethbyaddr
13374 : see if gethostbyname exists
13375 set gethostbyname d_gethbyname
13378 : see if gethostent exists
13379 set gethostent d_gethent
13382 : see how we will look up host name
13385 if set gethostname val -f d_gethname; eval $csym; $val; then
13386 echo 'gethostname() found.' >&4
13387 d_gethname="$define"
13390 if set uname val -f d_uname; eval $csym; $val; then
13393 uname() was found, but you're running xenix, and older versions of xenix
13394 have a broken uname(). If you don't really know whether your xenix is old
13395 enough to have a broken system call, use the default answer.
13400 "$define") dflt=n;;
13402 rp='Is your uname() broken?'
13405 n*) d_uname="$define"; call=uname;;
13408 echo 'uname() found.' >&4
13415 case "$d_gethname" in
13416 '') d_gethname="$undef";;
13419 '') d_uname="$undef";;
13421 case "$d_uname$d_gethname" in
13426 Every now and then someone has a $call() that lies about the hostname
13427 but can't be fixed for political or economic reasons. If you wish, I can
13428 pretend $call() isn't there and maybe compute hostname at run-time
13429 thanks to the '$phostname' command.
13432 rp="Shall I ignore $call() from now on?"
13435 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13438 case "$phostname" in
13439 '') aphostname='';;
13440 *) case "$aphostname" in
13442 *) set X $phostname
13446 file=`./loc $file $file $pth`
13447 aphostname=`echo $file $*`
13452 case "$d_uname$d_gethname" in
13455 case "$phostname" in
13457 echo "There will be no way for $package to get your hostname." >&4;;
13459 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13463 case "$d_phostname" in
13464 '') d_phostname="$undef";;
13467 : see if gethostbyaddr_r exists
13468 set gethostbyaddr_r d_gethostbyaddr_r
13470 case "$d_gethostbyaddr_r" in
13472 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13473 case "$d_gethostbyaddr_r_proto:$usethreads" in
13474 ":define") d_gethostbyaddr_r_proto=define
13475 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13479 case "$d_gethostbyaddr_r_proto" in
13481 case "$gethostbyaddr_r_proto" in
13482 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13483 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13485 case "$gethostbyaddr_r_proto" in
13486 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13487 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13489 case "$gethostbyaddr_r_proto" in
13490 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13491 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13493 case "$gethostbyaddr_r_proto" in
13494 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13495 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13497 case "$gethostbyaddr_r_proto" in
13498 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13499 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13501 case "$gethostbyaddr_r_proto" in
13502 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13503 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13505 case "$gethostbyaddr_r_proto" in
13506 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13507 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13509 case "$gethostbyaddr_r_proto" in
13510 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13511 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13513 case "$gethostbyaddr_r_proto" in
13514 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13515 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13517 case "$gethostbyaddr_r_proto" in
13518 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13519 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13521 case "$gethostbyaddr_r_proto" in
13522 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13523 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13525 case "$gethostbyaddr_r_proto" in
13526 ''|0) d_gethostbyaddr_r=undef
13527 gethostbyaddr_r_proto=0
13528 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13529 * ) case "$gethostbyaddr_r_proto" in
13530 REENTRANT_PROTO*) ;;
13531 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13533 echo "Prototype: $try" ;;
13536 *) case "$usethreads" in
13537 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13539 d_gethostbyaddr_r=undef
13540 gethostbyaddr_r_proto=0
13544 *) gethostbyaddr_r_proto=0
13548 : see if gethostbyname_r exists
13549 set gethostbyname_r d_gethostbyname_r
13551 case "$d_gethostbyname_r" in
13553 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13554 case "$d_gethostbyname_r_proto:$usethreads" in
13555 ":define") d_gethostbyname_r_proto=define
13556 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13560 case "$d_gethostbyname_r_proto" in
13562 case "$gethostbyname_r_proto" in
13563 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13564 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13566 case "$gethostbyname_r_proto" in
13567 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13568 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13570 case "$gethostbyname_r_proto" in
13571 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13572 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13574 case "$gethostbyname_r_proto" in
13575 ''|0) d_gethostbyname_r=undef
13576 gethostbyname_r_proto=0
13577 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13578 * ) case "$gethostbyname_r_proto" in
13579 REENTRANT_PROTO*) ;;
13580 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13582 echo "Prototype: $try" ;;
13585 *) case "$usethreads" in
13586 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13588 d_gethostbyname_r=undef
13589 gethostbyname_r_proto=0
13593 *) gethostbyname_r_proto=0
13597 : see if gethostent_r exists
13598 set gethostent_r d_gethostent_r
13600 case "$d_gethostent_r" in
13602 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13603 case "$d_gethostent_r_proto:$usethreads" in
13604 ":define") d_gethostent_r_proto=define
13605 set d_gethostent_r_proto gethostent_r $hdrs
13609 case "$d_gethostent_r_proto" in
13611 case "$gethostent_r_proto" in
13612 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13613 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13615 case "$gethostent_r_proto" in
13616 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13617 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13619 case "$gethostent_r_proto" in
13620 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13621 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13623 case "$gethostent_r_proto" in
13624 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13625 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13627 case "$gethostent_r_proto" in
13628 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13629 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13631 case "$gethostent_r_proto" in
13632 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13633 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13635 case "$gethostent_r_proto" in
13636 ''|0) d_gethostent_r=undef
13637 gethostent_r_proto=0
13638 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13639 * ) case "$gethostent_r_proto" in
13640 REENTRANT_PROTO*) ;;
13641 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13643 echo "Prototype: $try" ;;
13646 *) case "$usethreads" in
13647 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13649 d_gethostent_r=undef
13650 gethostent_r_proto=0
13654 *) gethostent_r_proto=0
13658 : see if prototypes for various gethostxxx netdb.h functions are available
13660 set d_gethostprotos gethostent $i_netdb netdb.h
13663 : see if getitimer exists
13664 set getitimer d_getitimer
13667 : see if getlogin exists
13668 set getlogin d_getlogin
13671 : see if getlogin_r exists
13672 set getlogin_r d_getlogin_r
13674 case "$d_getlogin_r" in
13676 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13677 case "$d_getlogin_r_proto:$usethreads" in
13678 ":define") d_getlogin_r_proto=define
13679 set d_getlogin_r_proto getlogin_r $hdrs
13683 case "$d_getlogin_r_proto" in
13685 case "$getlogin_r_proto" in
13686 ''|0) try='int getlogin_r(char*, size_t);'
13687 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13689 case "$getlogin_r_proto" in
13690 ''|0) try='int getlogin_r(char*, int);'
13691 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13693 case "$getlogin_r_proto" in
13694 ''|0) try='char* getlogin_r(char*, size_t);'
13695 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13697 case "$getlogin_r_proto" in
13698 ''|0) try='char* getlogin_r(char*, int);'
13699 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13701 case "$getlogin_r_proto" in
13702 ''|0) d_getlogin_r=undef
13704 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13705 * ) case "$getlogin_r_proto" in
13706 REENTRANT_PROTO*) ;;
13707 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13709 echo "Prototype: $try" ;;
13712 *) case "$usethreads" in
13713 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13720 *) getlogin_r_proto=0
13724 : see if getmnt exists
13725 set getmnt d_getmnt
13728 : see if getmntent exists
13729 set getmntent d_getmntent
13732 : see if getnetbyaddr exists
13733 set getnetbyaddr d_getnbyaddr
13736 : see if getnetbyname exists
13737 set getnetbyname d_getnbyname
13740 : see if getnetent exists
13741 set getnetent d_getnent
13744 : see if getnetbyaddr_r exists
13745 set getnetbyaddr_r d_getnetbyaddr_r
13747 case "$d_getnetbyaddr_r" in
13749 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13750 case "$d_getnetbyaddr_r_proto:$usethreads" in
13751 ":define") d_getnetbyaddr_r_proto=define
13752 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13756 case "$d_getnetbyaddr_r_proto" in
13758 case "$getnetbyaddr_r_proto" in
13759 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13760 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13762 case "$getnetbyaddr_r_proto" in
13763 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13764 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13766 case "$getnetbyaddr_r_proto" in
13767 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13768 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13770 case "$getnetbyaddr_r_proto" in
13771 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13772 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13774 case "$getnetbyaddr_r_proto" in
13775 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13776 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13778 case "$getnetbyaddr_r_proto" in
13779 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13780 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13782 case "$getnetbyaddr_r_proto" in
13783 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13784 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13786 case "$getnetbyaddr_r_proto" in
13787 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13788 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13790 case "$getnetbyaddr_r_proto" in
13791 ''|0) d_getnetbyaddr_r=undef
13792 getnetbyaddr_r_proto=0
13793 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13794 * ) case "$getnetbyaddr_r_proto" in
13795 REENTRANT_PROTO*) ;;
13796 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13798 echo "Prototype: $try" ;;
13801 *) case "$usethreads" in
13802 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13804 d_getnetbyaddr_r=undef
13805 getnetbyaddr_r_proto=0
13809 *) getnetbyaddr_r_proto=0
13813 : see if getnetbyname_r exists
13814 set getnetbyname_r d_getnetbyname_r
13816 case "$d_getnetbyname_r" in
13818 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13819 case "$d_getnetbyname_r_proto:$usethreads" in
13820 ":define") d_getnetbyname_r_proto=define
13821 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13825 case "$d_getnetbyname_r_proto" in
13827 case "$getnetbyname_r_proto" in
13828 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13829 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13831 case "$getnetbyname_r_proto" in
13832 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13833 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13835 case "$getnetbyname_r_proto" in
13836 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13837 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13839 case "$getnetbyname_r_proto" in
13840 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13841 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13843 case "$getnetbyname_r_proto" in
13844 ''|0) d_getnetbyname_r=undef
13845 getnetbyname_r_proto=0
13846 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13847 * ) case "$getnetbyname_r_proto" in
13848 REENTRANT_PROTO*) ;;
13849 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13851 echo "Prototype: $try" ;;
13854 *) case "$usethreads" in
13855 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13857 d_getnetbyname_r=undef
13858 getnetbyname_r_proto=0
13862 *) getnetbyname_r_proto=0
13866 : see if getnetent_r exists
13867 set getnetent_r d_getnetent_r
13869 case "$d_getnetent_r" in
13871 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13872 case "$d_getnetent_r_proto:$usethreads" in
13873 ":define") d_getnetent_r_proto=define
13874 set d_getnetent_r_proto getnetent_r $hdrs
13878 case "$d_getnetent_r_proto" in
13880 case "$getnetent_r_proto" in
13881 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13882 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13884 case "$getnetent_r_proto" in
13885 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13886 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13888 case "$getnetent_r_proto" in
13889 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13890 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13892 case "$getnetent_r_proto" in
13893 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13894 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13896 case "$getnetent_r_proto" in
13897 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13898 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13900 case "$getnetent_r_proto" in
13901 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13902 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13904 case "$getnetent_r_proto" in
13905 ''|0) d_getnetent_r=undef
13906 getnetent_r_proto=0
13907 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13908 * ) case "$getnetent_r_proto" in
13909 REENTRANT_PROTO*) ;;
13910 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13912 echo "Prototype: $try" ;;
13915 *) case "$usethreads" in
13916 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13918 d_getnetent_r=undef
13919 getnetent_r_proto=0
13923 *) getnetent_r_proto=0
13927 : see if prototypes for various getnetxxx netdb.h functions are available
13929 set d_getnetprotos getnetent $i_netdb netdb.h
13932 : see if getpagesize exists
13933 set getpagesize d_getpagsz
13936 : Optional checks for getprotobyname and getprotobynumber
13938 : see if getprotobyname exists
13939 set getprotobyname d_getpbyname
13942 : see if getprotobynumber exists
13943 set getprotobynumber d_getpbynumber
13946 : see if getprotoent exists
13947 set getprotoent d_getpent
13950 : see if getpgid exists
13951 set getpgid d_getpgid
13954 : see if getpgrp2 exists
13955 set getpgrp2 d_getpgrp2
13958 : see if getppid exists
13959 set getppid d_getppid
13962 : see if getpriority exists
13963 set getpriority d_getprior
13966 : see if getprotobyname_r exists
13967 set getprotobyname_r d_getprotobyname_r
13969 case "$d_getprotobyname_r" in
13971 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13972 case "$d_getprotobyname_r_proto:$usethreads" in
13973 ":define") d_getprotobyname_r_proto=define
13974 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13978 case "$d_getprotobyname_r_proto" in
13980 case "$getprotobyname_r_proto" in
13981 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13982 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13984 case "$getprotobyname_r_proto" in
13985 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13986 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13988 case "$getprotobyname_r_proto" in
13989 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13990 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13992 case "$getprotobyname_r_proto" in
13993 ''|0) d_getprotobyname_r=undef
13994 getprotobyname_r_proto=0
13995 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13996 * ) case "$getprotobyname_r_proto" in
13997 REENTRANT_PROTO*) ;;
13998 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14000 echo "Prototype: $try" ;;
14003 *) case "$usethreads" in
14004 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14006 d_getprotobyname_r=undef
14007 getprotobyname_r_proto=0
14011 *) getprotobyname_r_proto=0
14015 : see if getprotobynumber_r exists
14016 set getprotobynumber_r d_getprotobynumber_r
14018 case "$d_getprotobynumber_r" in
14020 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14021 case "$d_getprotobynumber_r_proto:$usethreads" in
14022 ":define") d_getprotobynumber_r_proto=define
14023 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14027 case "$d_getprotobynumber_r_proto" in
14029 case "$getprotobynumber_r_proto" in
14030 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14031 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14033 case "$getprotobynumber_r_proto" in
14034 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14035 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14037 case "$getprotobynumber_r_proto" in
14038 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14039 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14041 case "$getprotobynumber_r_proto" in
14042 ''|0) d_getprotobynumber_r=undef
14043 getprotobynumber_r_proto=0
14044 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14045 * ) case "$getprotobynumber_r_proto" in
14046 REENTRANT_PROTO*) ;;
14047 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14049 echo "Prototype: $try" ;;
14052 *) case "$usethreads" in
14053 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14055 d_getprotobynumber_r=undef
14056 getprotobynumber_r_proto=0
14060 *) getprotobynumber_r_proto=0
14064 : see if getprotoent_r exists
14065 set getprotoent_r d_getprotoent_r
14067 case "$d_getprotoent_r" in
14069 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14070 case "$d_getprotoent_r_proto:$usethreads" in
14071 ":define") d_getprotoent_r_proto=define
14072 set d_getprotoent_r_proto getprotoent_r $hdrs
14076 case "$d_getprotoent_r_proto" in
14078 case "$getprotoent_r_proto" in
14079 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14080 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14082 case "$getprotoent_r_proto" in
14083 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14084 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14086 case "$getprotoent_r_proto" in
14087 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14088 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14090 case "$getprotoent_r_proto" in
14091 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14092 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
14094 case "$getprotoent_r_proto" in
14095 ''|0) d_getprotoent_r=undef
14096 getprotoent_r_proto=0
14097 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14098 * ) case "$getprotoent_r_proto" in
14099 REENTRANT_PROTO*) ;;
14100 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14102 echo "Prototype: $try" ;;
14105 *) case "$usethreads" in
14106 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14108 d_getprotoent_r=undef
14109 getprotoent_r_proto=0
14113 *) getprotoent_r_proto=0
14117 : see if prototypes for various getprotoxxx netdb.h functions are available
14119 set d_getprotoprotos getprotoent $i_netdb netdb.h
14122 : see if getprpwnam exists
14123 set getprpwnam d_getprpwnam
14126 : see if getpwent exists
14127 set getpwent d_getpwent
14130 : see if getpwent_r exists
14131 set getpwent_r d_getpwent_r
14133 case "$d_getpwent_r" in
14135 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14136 case "$d_getpwent_r_proto:$usethreads" in
14137 ":define") d_getpwent_r_proto=define
14138 set d_getpwent_r_proto getpwent_r $hdrs
14142 case "$d_getpwent_r_proto" in
14144 case "$getpwent_r_proto" in
14145 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14146 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14148 case "$getpwent_r_proto" in
14149 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14150 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14152 case "$getpwent_r_proto" in
14153 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14154 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
14156 case "$getpwent_r_proto" in
14157 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14158 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
14160 case "$getpwent_r_proto" in
14161 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14162 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
14164 case "$getpwent_r_proto" in
14165 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14166 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14168 case "$getpwent_r_proto" in
14169 ''|0) d_getpwent_r=undef
14171 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14172 * ) case "$getpwent_r_proto" in
14173 REENTRANT_PROTO*) ;;
14174 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14176 echo "Prototype: $try" ;;
14179 *) case "$usethreads" in
14180 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14187 *) getpwent_r_proto=0
14191 : see if getpwnam_r exists
14192 set getpwnam_r d_getpwnam_r
14194 case "$d_getpwnam_r" in
14196 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14197 case "$d_getpwnam_r_proto:$usethreads" in
14198 ":define") d_getpwnam_r_proto=define
14199 set d_getpwnam_r_proto getpwnam_r $hdrs
14203 case "$d_getpwnam_r_proto" in
14205 case "$getpwnam_r_proto" in
14206 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14207 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14209 case "$getpwnam_r_proto" in
14210 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14211 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14213 case "$getpwnam_r_proto" in
14214 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14215 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14217 case "$getpwnam_r_proto" in
14218 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14219 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14221 case "$getpwnam_r_proto" in
14222 ''|0) d_getpwnam_r=undef
14224 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14225 * ) case "$getpwnam_r_proto" in
14226 REENTRANT_PROTO*) ;;
14227 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14229 echo "Prototype: $try" ;;
14232 *) case "$usethreads" in
14233 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14240 *) getpwnam_r_proto=0
14244 : see if getpwuid_r exists
14245 set getpwuid_r d_getpwuid_r
14247 case "$d_getpwuid_r" in
14249 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14250 case "$d_getpwuid_r_proto:$usethreads" in
14251 ":define") d_getpwuid_r_proto=define
14252 set d_getpwuid_r_proto getpwuid_r $hdrs
14256 case "$d_getpwuid_r_proto" in
14258 case "$getpwuid_r_proto" in
14259 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14260 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14262 case "$getpwuid_r_proto" in
14263 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14264 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14266 case "$getpwuid_r_proto" in
14267 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14268 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14270 case "$getpwuid_r_proto" in
14271 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14272 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14274 case "$getpwuid_r_proto" in
14275 ''|0) d_getpwuid_r=undef
14277 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14278 * ) case "$getpwuid_r_proto" in
14279 REENTRANT_PROTO*) ;;
14280 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14282 echo "Prototype: $try" ;;
14285 *) case "$usethreads" in
14286 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14293 *) getpwuid_r_proto=0
14297 : Optional checks for getsbyname and getsbyport
14299 : see if getservbyname exists
14300 set getservbyname d_getsbyname
14303 : see if getservbyport exists
14304 set getservbyport d_getsbyport
14307 : see if getservent exists
14308 set getservent d_getsent
14311 : see if getservbyname_r exists
14312 set getservbyname_r d_getservbyname_r
14314 case "$d_getservbyname_r" in
14316 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14317 case "$d_getservbyname_r_proto:$usethreads" in
14318 ":define") d_getservbyname_r_proto=define
14319 set d_getservbyname_r_proto getservbyname_r $hdrs
14323 case "$d_getservbyname_r_proto" in
14325 case "$getservbyname_r_proto" in
14326 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14327 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14329 case "$getservbyname_r_proto" in
14330 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14331 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14333 case "$getservbyname_r_proto" in
14334 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14335 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14337 case "$getservbyname_r_proto" in
14338 ''|0) d_getservbyname_r=undef
14339 getservbyname_r_proto=0
14340 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14341 * ) case "$getservbyname_r_proto" in
14342 REENTRANT_PROTO*) ;;
14343 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14345 echo "Prototype: $try" ;;
14348 *) case "$usethreads" in
14349 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14351 d_getservbyname_r=undef
14352 getservbyname_r_proto=0
14356 *) getservbyname_r_proto=0
14360 : see if getservbyport_r exists
14361 set getservbyport_r d_getservbyport_r
14363 case "$d_getservbyport_r" in
14365 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14366 case "$d_getservbyport_r_proto:$usethreads" in
14367 ":define") d_getservbyport_r_proto=define
14368 set d_getservbyport_r_proto getservbyport_r $hdrs
14372 case "$d_getservbyport_r_proto" in
14374 case "$getservbyport_r_proto" in
14375 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14376 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14378 case "$getservbyport_r_proto" in
14379 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14380 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14382 case "$getservbyport_r_proto" in
14383 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14384 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14386 case "$getservbyport_r_proto" in
14387 ''|0) d_getservbyport_r=undef
14388 getservbyport_r_proto=0
14389 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14390 * ) case "$getservbyport_r_proto" in
14391 REENTRANT_PROTO*) ;;
14392 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14394 echo "Prototype: $try" ;;
14397 *) case "$usethreads" in
14398 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14400 d_getservbyport_r=undef
14401 getservbyport_r_proto=0
14405 *) getservbyport_r_proto=0
14409 : see if getservent_r exists
14410 set getservent_r d_getservent_r
14412 case "$d_getservent_r" in
14414 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14415 case "$d_getservent_r_proto:$usethreads" in
14416 ":define") d_getservent_r_proto=define
14417 set d_getservent_r_proto getservent_r $hdrs
14421 case "$d_getservent_r_proto" in
14423 case "$getservent_r_proto" in
14424 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14425 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
14427 case "$getservent_r_proto" in
14428 ''|0) try='int getservent_r(struct servent*, char*, int);'
14429 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
14431 case "$getservent_r_proto" in
14432 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14433 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
14435 case "$getservent_r_proto" in
14436 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14437 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
14439 case "$getservent_r_proto" in
14440 ''|0) d_getservent_r=undef
14441 getservent_r_proto=0
14442 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14443 * ) case "$getservent_r_proto" in
14444 REENTRANT_PROTO*) ;;
14445 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14447 echo "Prototype: $try" ;;
14450 *) case "$usethreads" in
14451 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14453 d_getservent_r=undef
14454 getservent_r_proto=0
14458 *) getservent_r_proto=0
14462 : see if prototypes for various getservxxx netdb.h functions are available
14464 set d_getservprotos getservent $i_netdb netdb.h
14467 : see if getspnam exists
14468 set getspnam d_getspnam
14471 : see if this is a shadow.h system
14472 set shadow.h i_shadow
14475 : see if getspnam_r exists
14476 set getspnam_r d_getspnam_r
14478 case "$d_getspnam_r" in
14480 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14481 case "$d_getspnam_r_proto:$usethreads" in
14482 ":define") d_getspnam_r_proto=define
14483 set d_getspnam_r_proto getspnam_r $hdrs
14487 case "$d_getspnam_r_proto" in
14489 case "$getspnam_r_proto" in
14490 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14491 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14493 case "$getspnam_r_proto" in
14494 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14495 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14497 case "$getspnam_r_proto" in
14498 ''|0) d_getspnam_r=undef
14500 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14501 * ) case "$getspnam_r_proto" in
14502 REENTRANT_PROTO*) ;;
14503 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14505 echo "Prototype: $try" ;;
14508 *) case "$usethreads" in
14509 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14516 *) getspnam_r_proto=0
14520 : see if gettimeofday or ftime exists
14521 set gettimeofday d_gettimeod
14523 case "$d_gettimeod" in
14529 val="$undef"; set d_ftime; eval $setvar
14532 case "$d_gettimeod$d_ftime" in
14535 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14539 : see if gmtime_r exists
14540 set gmtime_r d_gmtime_r
14542 case "$d_gmtime_r" in
14544 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14545 case "$d_gmtime_r_proto:$usethreads" in
14546 ":define") d_gmtime_r_proto=define
14547 set d_gmtime_r_proto gmtime_r $hdrs
14551 case "$d_gmtime_r_proto" in
14553 case "$gmtime_r_proto" in
14554 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14555 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14557 case "$gmtime_r_proto" in
14558 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14559 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14561 case "$gmtime_r_proto" in
14562 ''|0) d_gmtime_r=undef
14564 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14565 * ) case "$gmtime_r_proto" in
14566 REENTRANT_PROTO*) ;;
14567 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14569 echo "Prototype: $try" ;;
14572 *) case "$usethreads" in
14573 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14580 *) gmtime_r_proto=0
14584 : see if hasmntopt exists
14585 set hasmntopt d_hasmntopt
14588 : see if this is a netinet/in.h or sys/in.h system
14589 set netinet/in.h i_niin sys/in.h i_sysin
14592 : see if arpa/inet.h has to be included
14593 set arpa/inet.h i_arpainet
14596 : see if htonl --and friends-- exists
14601 : Maybe they are macros.
14604 $cat >htonl.c <<EOM
14606 #include <sys/types.h>
14607 #$i_niin I_NETINET_IN
14609 #$i_arpainet I_ARPA_INET
14610 #ifdef I_NETINET_IN
14611 #include <netinet/in.h>
14614 #include <sys/in.h>
14617 #include <arpa/inet.h>
14620 printf("Defined as a macro.");
14623 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14624 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14626 echo "But it seems to be defined as a macro." >&4
14634 : see if ilogbl exists
14635 set ilogbl d_ilogbl
14640 if set index val -f; eval $csym; $val; then
14641 if set strchr val -f d_strchr; eval $csym; $val; then
14642 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14645 echo "strchr() found." >&4
14649 echo "index() found." >&4
14654 echo "index() found." >&4
14657 if set strchr val -f d_strchr; eval $csym; $val; then
14660 echo "strchr() found." >&4
14662 echo "No index() or strchr() found!" >&4
14667 set d_strchr; eval $setvar
14669 set d_index; eval $setvar
14671 : check whether inet_aton exists
14672 set inet_aton d_inetaton
14677 $cat >isascii.c <<EOCP
14680 #$i_stdlib I_STDLIB
14682 #include <stdlib.h>
14693 if eval $compile; then
14694 echo "isascii() found." >&4
14697 echo "isascii() NOT found." >&4
14704 : see if isfinite exists
14705 set isfinite d_isfinite
14708 : see if isinf exists
14712 : see if isnan exists
14716 : see if isnanl exists
14717 set isnanl d_isnanl
14720 : see if killpg exists
14721 set killpg d_killpg
14724 : see if lchown exists
14726 $cat > try.c <<'EOCP'
14727 /* System header to define __stub macros and hopefully few prototypes,
14728 which can conflict with char lchown(); below. */
14729 #include <assert.h>
14730 /* Override any gcc2 internal prototype to avoid an error. */
14731 /* We use char because int might match the return type of a gcc2
14732 builtin and then its argument prototype would still apply. */
14735 /* The GNU C library defines this for functions which it implements
14736 to always fail with ENOSYS. Some functions are actually named
14737 something starting with __ and the normal name is an alias. */
14738 #if defined (__stub_lchown) || defined (__stub___lchown)
14746 if eval $compile; then
14747 $echo "lchown() found." >&4
14750 $echo "lchown() NOT found." >&4
14756 : See if number of significant digits in a double precision number is known
14758 $cat >ldbl_dig.c <<EOM
14759 #$i_limits I_LIMITS
14762 #include <limits.h>
14768 printf("Contains LDBL_DIG");
14771 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14772 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14773 echo "LDBL_DIG found." >&4
14776 echo "LDBL_DIG NOT found." >&4
14783 : see if this is a math.h system
14787 : check to see if math.h defines _LIB_VERSION
14788 d_libm_lib_version="$undef"
14792 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14794 #include <unistd.h>
14796 int main (int argc, char *argv[])
14798 printf ("%d\n", _LIB_VERSION);
14803 if eval $compile; then
14805 echo "Yes, it does ($foo)" >&4
14806 d_libm_lib_version="$define"
14808 echo "No, it does not (probably harmless)" >&4
14815 : see if link exists
14819 : see if localtime_r exists
14820 set localtime_r d_localtime_r
14822 case "$d_localtime_r" in
14824 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14825 case "$d_localtime_r_proto:$usethreads" in
14826 ":define") d_localtime_r_proto=define
14827 set d_localtime_r_proto localtime_r $hdrs
14831 case "$d_localtime_r_proto" in
14833 case "$localtime_r_proto" in
14834 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14835 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14837 case "$localtime_r_proto" in
14838 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14839 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14841 case "$localtime_r_proto" in
14842 ''|0) d_localtime_r=undef
14843 localtime_r_proto=0
14844 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14845 * ) case "$localtime_r_proto" in
14846 REENTRANT_PROTO*) ;;
14847 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14849 echo "Prototype: $try" ;;
14852 *) case "$usethreads" in
14853 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14855 d_localtime_r=undef
14856 localtime_r_proto=0
14860 *) localtime_r_proto=0
14864 : see if localtime_r calls tzset
14865 case "$localtime_r_proto" in
14868 /* Does our libc's localtime_r call tzset ?
14869 * return 0 if so, 1 otherwise.
14871 #include <sys/types.h>
14872 #include <unistd.h>
14874 #include <string.h>
14875 #include <malloc.h>
14878 time_t t = time(0L);
14879 char w_tz[]="TZ" "=GMT+5",
14880 e_tz[]="TZ" "=GMT-5",
14881 *tz_e = (char*)malloc(16),
14882 *tz_w = (char*)malloc(16);
14883 struct tm tm_e, tm_w;
14884 memset(&tm_e,'\0',sizeof(struct tm));
14885 memset(&tm_w,'\0',sizeof(struct tm));
14890 localtime_r(&t, &tm_e);
14893 localtime_r(&t, &tm_w);
14895 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
14901 if eval $compile; then
14902 if $run ./try; then
14903 d_localtime_r_needs_tzset=undef;
14905 d_localtime_r_needs_tzset=define;
14908 d_localtime_r_needs_tzset=undef;
14912 d_localtime_r_needs_tzset=undef;
14917 : see if localeconv exists
14918 set localeconv d_locconv
14921 : see if lockf exists
14925 : see if prototype for lseek is available
14927 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14930 : see if lstat exists
14934 : see if madvise exists
14935 set madvise d_madvise
14938 : see if malloc_size exists
14939 set malloc_size d_malloc_size
14942 : see if malloc_size_good exists
14943 set malloc_good_size d_malloc_good_size
14946 : see if mblen exists
14950 : see if mbstowcs exists
14951 set mbstowcs d_mbstowcs
14954 : see if mbtowc exists
14955 set mbtowc d_mbtowc
14958 : see if memchr exists
14959 set memchr d_memchr
14962 : see if memcmp exists
14963 set memcmp d_memcmp
14966 : see if memcpy exists
14967 set memcpy d_memcpy
14970 : see if memmove exists
14971 set memmove d_memmove
14974 : see if memset exists
14975 set memset d_memset
14978 : see if mkdir exists
14982 : see if mkdtemp exists
14983 set mkdtemp d_mkdtemp
14986 : see if mkfifo exists
14987 set mkfifo d_mkfifo
14990 : see if mkstemp exists
14991 set mkstemp d_mkstemp
14994 : see if mkstemps exists
14995 set mkstemps d_mkstemps
14998 : see if mktime exists
14999 set mktime d_mktime
15002 : see if this is a sys/mman.h system
15003 set sys/mman.h i_sysmman
15006 : see if mmap exists
15009 : see what shmat returns
15010 : default to something harmless
15012 case "$i_sysmman$d_mmap" in
15014 $cat >mmap.c <<'END'
15015 #include <sys/mman.h>
15018 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15023 echo "and it returns ($mmaptype)." >&4
15029 : see if sqrtl exists
15033 : see if scalbnl exists
15034 set scalbnl d_scalbnl
15037 : see if modfl exists
15041 : see if prototype for modfl is available
15043 set d_modflproto modfl $i_math math.h
15046 d_modfl_pow32_bug="$undef"
15048 case "$d_longdbl$d_modfl" in
15051 Checking to see whether your modfl() is okay for large values...
15057 if $test "X$d_modflproto" != "X$define"; then
15058 $cat >>try.c <<EOCP
15059 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15060 long double modfl (long double, long double *);
15063 $cat >>try.c <<EOCP
15065 long double nv = 4294967303.15;
15071 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15075 case "$osname:$gccversion" in
15076 aix:) saveccflags="$ccflags"
15077 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15080 if eval $compile; then
15083 *" 4294967303.150000 1.150000 4294967302.000000")
15084 echo >&4 "Your modfl() is broken for large values."
15085 d_modfl_pow32_bug="$define"
15087 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15091 *" 4294967303.150000 0.150000 4294967303.000000")
15092 echo >&4 "Your modfl() seems okay for large values."
15094 *) echo >&4 "I don't understand your modfl() at all."
15100 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15103 case "$osname:$gccversion" in
15104 aix:) ccflags="$saveccflags" ;; # restore
15109 if $test "$uselongdouble" = "$define"; then
15111 if $test "$d_sqrtl" != "$define"; then
15112 message="$message sqrtl"
15114 if $test "$d_modfl" != "$define"; then
15115 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15116 echo "You have both aintl and copysignl, so I can emulate modfl."
15118 message="$message modfl"
15121 if $test "$d_frexpl" != "$define"; then
15122 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15123 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15125 message="$message frexpl"
15129 if $test "$message" != ""; then
15132 *** You requested the use of long doubles but you do not seem to have
15133 *** the following mathematical functions needed for long double support:
15135 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15136 *** Cannot continue, aborting.
15144 : see if mprotect exists
15145 set mprotect d_mprotect
15148 : see if msgctl exists
15149 set msgctl d_msgctl
15152 : see if msgget exists
15153 set msgget d_msgget
15156 : see if msgsnd exists
15157 set msgsnd d_msgsnd
15160 : see if msgrcv exists
15161 set msgrcv d_msgrcv
15164 : see how much of the 'msg*(2)' library is present.
15167 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15168 *"$undef"*) h_msg=false;;
15172 case "`ipcs 2>&1`" in
15173 "SVID messages"*"not configured"*)
15174 echo "Your $osname does not have the msg*(2) configured." >&4
15177 set msgctl d_msgctl
15179 set msgget d_msgget
15181 set msgsnd d_msgsnd
15183 set msgrcv d_msgrcv
15189 : we could also check for sys/ipc.h ...
15190 if $h_msg && $test `./findhdr sys/msg.h`; then
15191 echo "You have the full msg*(2) library." >&4
15194 echo "You don't have the full msg*(2) library." >&4
15200 : Check for msghdr_s
15202 echo "Checking to see if your system supports struct msghdr..." >&4
15203 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15205 case "$d_msghdr_s" in
15206 "$define") echo "Yes, it does." ;;
15207 *) echo "No, it doesn't." ;;
15211 : see if msync exists
15215 : see if munmap exists
15216 set munmap d_munmap
15219 : see if nice exists
15223 : see if this is a langinfo.h system
15224 set langinfo.h i_langinfo
15227 : see if nl_langinfo exists
15228 set nl_langinfo d_nl_langinfo
15231 : check for volatile keyword
15233 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15234 $cat >try.c <<'EOCP'
15237 typedef struct _goo_struct goo_struct;
15238 goo_struct * volatile goo = ((goo_struct *)0);
15239 struct _goo_struct {
15244 typedef unsigned short foo_t;
15245 char *volatile foo;
15247 volatile foo_t blech;
15251 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15253 echo "Yup, it does."
15256 echo "Nope, it doesn't."
15262 : Check basic sizes
15264 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15266 case "$use64bitint:$d_quad:$quadtype" in
15269 uvtype="$uquadtype"
15274 uvtype="unsigned long"
15280 case "$uselongdouble:$d_longdbl" in
15282 nvtype="long double"
15283 nvsize=$longdblsize
15290 $echo "(IV will be "$ivtype", $ivsize bytes)"
15291 $echo "(UV will be "$uvtype", $uvsize bytes)"
15292 $echo "(NV will be "$nvtype", $nvsize bytes)"
15295 #$i_inttypes I_INTTYPES
15297 #include <inttypes.h>
15302 int8_t i = INT8_MAX;
15303 uint8_t u = UINT8_MAX;
15304 printf("int8_t\n");
15307 int16_t i = INT16_MAX;
15308 uint16_t i = UINT16_MAX;
15309 printf("int16_t\n");
15312 int32_t i = INT32_MAX;
15313 uint32_t u = UINT32_MAX;
15314 printf("int32_t\n");
15319 i8type="signed char"
15320 u8type="unsigned char"
15325 '') case "$shortsize" in
15327 u16type="unsigned short"
15335 '') set try -DINT16
15336 if eval $compile; then
15337 case "`$run ./try`" in
15349 '') if $test $shortsize -ge 2; then
15351 u16type="unsigned short"
15359 '') case "$longsize" in
15361 u32type="unsigned long"
15365 *) case "$intsize" in
15367 u32type="unsigned int"
15377 '') set try -DINT32
15378 if eval $compile; then
15379 case "`$run ./try`" in
15391 '') if $test $intsize -ge 4; then
15393 u32type="unsigned int"
15401 '') case "$d_quad:$quadtype" in
15403 i64type="$quadtype"
15404 u64type="$uquadtype"
15412 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15413 : volatile so that the compiler has to store it out to memory.
15414 if test X"$d_volatile" = X"$define"; then
15419 #$i_stdlib I_STDLIB
15421 #include <stdlib.h>
15423 #include <sys/types.h>
15424 #include <signal.h>
15426 $volatile int bletched = 0;
15427 $signal_t blech(int s) { bletched = 1; }
15432 int n = 8 * $uvsize;
15435 signal(SIGFPE, blech);
15438 for (i = 0; i < n; i++) {
15439 u = u << 1 | ($uvtype)1;
15441 if (($uvtype)d != u)
15445 d = ($nvtype)(u - 1);
15446 if (($uvtype)d != (u - 1))
15453 printf("%d\n", ((i == n) ? -n : i));
15459 d_nv_preserves_uv="$undef"
15460 if eval $compile; then
15461 nv_preserves_uv_bits="`$run ./try`"
15463 case "$nv_preserves_uv_bits" in
15465 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15466 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15467 d_nv_preserves_uv="$define"
15469 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15470 d_nv_preserves_uv="$undef" ;;
15471 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15472 nv_preserves_uv_bits="0" ;;
15476 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15477 : volatile so that the compiler has to store it out to memory.
15478 if test X"$d_volatile" = X"$define"; then
15483 #$i_stdlib I_STDLIB
15485 #include <stdlib.h>
15487 #$i_string I_STRING
15489 # include <string.h>
15491 # include <strings.h>
15493 #include <sys/types.h>
15494 #include <signal.h>
15496 $volatile int bletched = 0;
15497 $signal_t blech(int s) { bletched = 1; }
15500 int checkit($nvtype d, char *where) {
15501 unsigned char *p = (char *)&d;
15502 unsigned char *end = p + sizeof(d);
15512 printf("No - %s: 0x", where);
15514 printf ("%02X", *p++);
15519 int main(int argc, char **argv) {
15522 fail += checkit(d, "0.0");
15524 /* The compiler shouldn't be assuming that bletched is 0 */
15527 fail += checkit(d, "bleched");
15530 signal(SIGFPE, blech);
15533 /* Paranoia - the compiler should have no way of knowing that ANSI says
15534 that argv[argc] will always be NULL. Actually, if it did assume this it
15535 would be buggy, as this is C and main() can be called from elsewhere in
15537 d = argv[argc] ? 1 : 0;
15540 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15543 fail += checkit(d, "ternary");
15545 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15548 printf("No - memset doesn't give 0.0\n");
15549 /* This might just blow up: */
15550 printf("(gives %g)\n", d);
15556 printf("No - something bleched\n");
15561 printf("No - %d fail(s)\n", fail);
15570 d_nv_zero_is_allbits_zero="$undef"
15571 if eval $compile; then
15577 0.0 is represented as all bits zero in memory
15579 d_nv_zero_is_allbits_zero="$define"
15582 0.0 is not represented as all bits zero in memory
15584 d_nv_zero_is_allbits_zero="$undef"
15589 0.0 is not represented as all bits zero in memory
15591 d_nv_zero_is_allbits_zero="$undef"
15597 : check for off64_t
15599 echo "Checking to see if you have off64_t..." >&4
15601 #include <sys/types.h>
15602 #include <unistd.h>
15603 int main() { off64_t x = 7; }
15606 if eval $compile; then
15608 echo "You have off64_t."
15611 echo "You do not have off64_t."
15612 case "$lseeksize" in
15613 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15620 : how to create joinable pthreads
15621 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15623 echo "Checking what constant to use for creating joinable pthreads..." >&4
15624 $cat >try.c <<'EOCP'
15625 #include <pthread.h>
15627 int detachstate = JOINABLE;
15630 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15631 if eval $compile; then
15632 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15633 val="$undef" # Yes, undef.
15634 set d_old_pthread_create_joinable
15637 set old_pthread_create_joinable
15640 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15641 if eval $compile; then
15642 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15644 set d_old_pthread_create_joinable
15646 val=PTHREAD_CREATE_UNDETACHED
15647 set old_pthread_create_joinable
15650 set try -DJOINABLE=__UNDETACHED
15651 if eval $compile; then
15652 echo "You seem to use __UNDETACHED." >&4
15654 set d_old_pthread_create_joinable
15657 set old_pthread_create_joinable
15660 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15662 set d_old_pthread_create_joinable
15665 set old_pthread_create_joinable
15672 d_old_pthread_create_joinable="$undef"
15673 old_pthread_create_joinable=""
15676 : see if pause exists
15680 : see if poll exists
15684 : see if readlink exists
15685 set readlink d_readlink
15688 : Check if exe is symlink to abs path of executing program
15692 case "$d_readlink" in
15694 if $issymlink /proc/self/exe ; then
15695 $ls -l /proc/self/exe > reflect
15696 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15697 echo "You have Linux-like /proc/self/exe."
15698 procselfexe='"/proc/self/exe"'
15702 if $issymlink /proc/curproc/file ; then
15703 $ls -l /proc/curproc/file > reflect
15704 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15705 echo "You have BSD-like /proc/curproc/file."
15706 procselfexe='"/proc/curproc/file"'
15716 : backward compatibility for d_hvfork
15717 if test X$d_hvfork != X; then
15718 d_vfork="$d_hvfork"
15721 : see if there is a vfork
15726 d_pseudofork=$undef
15728 : Ok, but do we want to use it. vfork is reportedly unreliable in
15729 : perl on Solaris 2.x, and probably elsewhere.
15733 case "$usevfork" in
15739 Perl can only use a vfork() that doesn't suffer from strict
15740 restrictions on calling functions or modifying global data in
15741 the child. For example, glibc-2.1 contains such a vfork()
15742 that is unsuitable. If your system provides a proper fork()
15743 call, chances are that you do NOT want perl to use vfork().
15746 rp="Do you still want to use vfork()?"
15751 echo "Ok, we won't use vfork()."
15760 $define) usevfork='true';;
15761 *) usevfork='false';;
15764 : see whether the pthread_atfork exists
15766 #include <pthread.h>
15769 #ifdef PTHREAD_ATFORK
15770 pthread_atfork(NULL,NULL,NULL);
15775 : see if pthread_atfork exists
15776 set try -DPTHREAD_ATFORK
15777 if eval $compile; then
15782 case "$usethreads" in
15785 $define) echo 'pthread_atfork found.' >&4 ;;
15786 *) echo 'pthread_atfork NOT found.' >&4 ;;
15789 set d_pthread_atfork
15792 : see if pthread_attr_setscope exists
15793 set pthread_attr_setscope d_pthread_attr_setscope
15796 : see whether the various POSIXish _yields exist
15798 #include <pthread.h>
15804 #ifdef PTHREAD_YIELD
15807 #ifdef PTHREAD_YIELD_NULL
15808 pthread_yield(NULL);
15814 : see if sched_yield exists
15815 set try -DSCHED_YIELD
15816 if eval $compile; then
15818 sched_yield='sched_yield()'
15822 case "$usethreads" in
15825 $define) echo 'sched_yield() found.' >&4 ;;
15826 *) echo 'sched_yield() NOT found.' >&4 ;;
15832 : see if pthread_yield exists
15833 set try -DPTHREAD_YIELD
15834 if eval $compile; then
15836 case "$sched_yield" in
15837 '') sched_yield='pthread_yield()' ;;
15840 set try -DPTHREAD_YIELD_NULL
15841 if eval $compile; then
15843 case "$sched_yield" in
15844 '') sched_yield='pthread_yield(NULL)' ;;
15850 case "$usethreads" in
15853 $define) echo 'pthread_yield() found.' >&4 ;;
15854 *) echo 'pthread_yield() NOT found.' >&4 ;;
15858 set d_pthread_yield
15860 case "$sched_yield" in
15861 '') sched_yield=undef ;;
15865 : see if random_r exists
15866 set random_r d_random_r
15868 case "$d_random_r" in
15870 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15871 case "$d_random_r_proto:$usethreads" in
15872 ":define") d_random_r_proto=define
15873 set d_random_r_proto random_r $hdrs
15877 case "$d_random_r_proto" in
15879 case "$random_r_proto" in
15880 ''|0) try='int random_r(int*, struct random_data*);'
15881 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15883 case "$random_r_proto" in
15884 ''|0) try='int random_r(long*, struct random_data*);'
15885 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15887 case "$random_r_proto" in
15888 ''|0) try='int random_r(struct random_data*, int32_t*);'
15889 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15891 case "$random_r_proto" in
15892 ''|0) d_random_r=undef
15894 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15895 * ) case "$random_r_proto" in
15896 REENTRANT_PROTO*) ;;
15897 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15899 echo "Prototype: $try" ;;
15902 *) case "$usethreads" in
15903 define) echo "random_r has no prototype, not using it." >&4 ;;
15910 *) random_r_proto=0
15914 : see if readdir and friends exist
15915 set readdir d_readdir
15917 set seekdir d_seekdir
15919 set telldir d_telldir
15921 set rewinddir d_rewinddir
15924 : see if readdir64_r exists
15925 set readdir64_r d_readdir64_r
15927 case "$d_readdir64_r" in
15929 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15930 case "$d_readdir64_r_proto:$usethreads" in
15931 ":define") d_readdir64_r_proto=define
15932 set d_readdir64_r_proto readdir64_r $hdrs
15936 case "$d_readdir64_r_proto" in
15938 case "$readdir64_r_proto" in
15939 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15940 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15942 case "$readdir64_r_proto" in
15943 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15944 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15946 case "$readdir64_r_proto" in
15947 ''|0) d_readdir64_r=undef
15948 readdir64_r_proto=0
15949 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15950 * ) case "$readdir64_r_proto" in
15951 REENTRANT_PROTO*) ;;
15952 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15954 echo "Prototype: $try" ;;
15957 *) case "$usethreads" in
15958 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15960 d_readdir64_r=undef
15961 readdir64_r_proto=0
15965 *) readdir64_r_proto=0
15969 : see if readdir_r exists
15970 set readdir_r d_readdir_r
15972 case "$d_readdir_r" in
15974 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15975 case "$d_readdir_r_proto:$usethreads" in
15976 ":define") d_readdir_r_proto=define
15977 set d_readdir_r_proto readdir_r $hdrs
15981 case "$d_readdir_r_proto" in
15983 case "$readdir_r_proto" in
15984 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15985 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15987 case "$readdir_r_proto" in
15988 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15989 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15991 case "$readdir_r_proto" in
15992 ''|0) d_readdir_r=undef
15994 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15995 * ) case "$readdir_r_proto" in
15996 REENTRANT_PROTO*) ;;
15997 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15999 echo "Prototype: $try" ;;
16002 *) case "$usethreads" in
16003 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16010 *) readdir_r_proto=0
16014 : see if readv exists
16018 : see if recvmsg exists
16019 set recvmsg d_recvmsg
16022 : see if rename exists
16023 set rename d_rename
16026 : see if rmdir exists
16030 : see if memory.h is available.
16035 : See if it conflicts with string.h
16041 $cppstdin $cppflags $cppminus < $strings > mem.h
16042 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16044 echo "We won't be including <memory.h>."
16054 : can bcopy handle overlapping blocks?
16057 case "$d_memmove" in
16058 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16059 *) case "$d_bcopy" in
16061 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16063 #$i_memory I_MEMORY
16064 #$i_stdlib I_STDLIB
16065 #$i_string I_STRING
16066 #$i_unistd I_UNISTD
16068 $cat >>try.c <<'EOCP'
16071 # include <memory.h>
16074 # include <stdlib.h>
16077 # include <string.h>
16079 # include <strings.h>
16082 # include <unistd.h> /* Needed for NetBSD */
16086 char buf[128], abc[128];
16092 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16093 try to store the string in read-only memory. */
16094 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16096 for (align = 7; align >= 0; align--) {
16097 for (len = 36; len; len--) {
16099 bcopy(abc, b, len);
16100 for (off = 1; off <= len; off++) {
16101 bcopy(b, b+off, len);
16102 bcopy(b+off, b, len);
16103 if (bcmp(b, abc, len))
16112 if eval $compile_ok; then
16113 if $run ./try 2>/dev/null; then
16114 echo "Yes, it can."
16117 echo "It can't, sorry."
16120 echo "(I can't compile the test program, so we'll assume not...)"
16130 : can memcpy handle overlapping blocks?
16133 case "$d_memmove" in
16134 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16135 *) case "$d_memcpy" in
16137 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16139 #$i_memory I_MEMORY
16140 #$i_stdlib I_STDLIB
16141 #$i_string I_STRING
16142 #$i_unistd I_UNISTD
16144 $cat >>try.c <<'EOCP'
16147 # include <memory.h>
16150 # include <stdlib.h>
16153 # include <string.h>
16155 # include <strings.h>
16158 # include <unistd.h> /* Needed for NetBSD */
16162 char buf[128], abc[128];
16168 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16169 try to store the string in read-only memory. */
16170 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16172 for (align = 7; align >= 0; align--) {
16173 for (len = 36; len; len--) {
16175 memcpy(b, abc, len);
16176 for (off = 1; off <= len; off++) {
16177 memcpy(b+off, b, len);
16178 memcpy(b, b+off, len);
16179 if (memcmp(b, abc, len))
16188 if eval $compile_ok; then
16189 if $run ./try 2>/dev/null; then
16190 echo "Yes, it can."
16193 echo "It can't, sorry."
16196 echo "(I can't compile the test program, so we'll assume not...)"
16206 : can memcmp be trusted to compare relative magnitude?
16208 case "$d_memcmp" in
16211 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16213 #$i_memory I_MEMORY
16214 #$i_stdlib I_STDLIB
16215 #$i_string I_STRING
16216 #$i_unistd I_UNISTD
16218 $cat >>try.c <<'EOCP'
16221 # include <memory.h>
16224 # include <stdlib.h>
16227 # include <string.h>
16229 # include <strings.h>
16232 # include <unistd.h> /* Needed for NetBSD */
16238 if ((a < b) && memcmp(&a, &b, 1) < 0)
16244 if eval $compile_ok; then
16245 if $run ./try 2>/dev/null; then
16246 echo "Yes, it can."
16249 echo "No, it can't (it uses signed chars)."
16252 echo "(I can't compile the test program, so we'll assume not...)"
16260 : see if prototype for sbrk is available
16262 set d_sbrkproto sbrk $i_unistd unistd.h
16265 : see if select exists
16266 set select d_select
16269 : see if semctl exists
16270 set semctl d_semctl
16273 : see if semget exists
16274 set semget d_semget
16277 : see if semop exists
16281 : see how much of the 'sem*(2)' library is present.
16284 case "$d_semctl$d_semget$d_semop" in
16285 *"$undef"*) h_sem=false;;
16289 case "`ipcs 2>&1`" in
16290 "SVID messages"*"not configured"*)
16291 echo "Your $osname does not have the sem*(2) configured." >&4
16294 set semctl d_semctl
16296 set semget d_semget
16304 : we could also check for sys/ipc.h ...
16305 if $h_sem && $test `./findhdr sys/sem.h`; then
16306 echo "You have the full sem*(2) library." >&4
16309 echo "You don't have the full sem*(2) library." >&4
16315 : see whether sys/sem.h defines union semun
16317 $cat > try.c <<'END'
16318 #include <sys/types.h>
16319 #include <sys/ipc.h>
16320 #include <sys/sem.h>
16321 int main () { union semun semun; semun.buf = 0; }
16324 if eval $compile; then
16325 echo "You have union semun in <sys/sem.h>." >&4
16328 echo "You do not have union semun in <sys/sem.h>." >&4
16335 : see how to do semctl IPC_STAT
16339 $cat > tryh.h <<END
16342 # define S_IRUSR S_IREAD
16343 # define S_IWUSR S_IWRITE
16344 # define S_IXUSR S_IEXEC
16346 # define S_IRUSR 0400
16347 # define S_IWUSR 0200
16348 # define S_IXUSR 0100
16350 # define S_IRGRP (S_IRUSR>>3)
16351 # define S_IWGRP (S_IWUSR>>3)
16352 # define S_IXGRP (S_IXUSR>>3)
16353 # define S_IROTH (S_IRUSR>>6)
16354 # define S_IWOTH (S_IWUSR>>6)
16355 # define S_IXOTH (S_IXUSR>>6)
16358 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16359 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16360 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16363 : see whether semctl IPC_STAT can use union semun
16364 case "$d_semctl_semun" in
16368 #include <sys/types.h>
16369 #include <sys/ipc.h>
16370 #include <sys/sem.h>
16371 #include <sys/stat.h>
16378 #$d_union_semun HAS_UNION_SEMUN
16381 #ifndef HAS_UNION_SEMUN
16384 struct semid_ds *buf;
16385 unsigned short *array;
16391 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16392 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16394 struct semid_ds argbuf;
16397 st = semctl(sem, 0, IPC_STAT, arg);
16401 # endif /* IPC_STAT */
16402 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16404 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16405 # endif /* IPC_RMID */
16406 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16408 #endif /* IPC_PRIVATE && ... */
16409 printf("semget failed: errno = %d\n", errno);
16414 if eval $compile; then
16417 semun) val="$define" ;;
16425 case "$d_semctl_semun" in
16427 echo "You can use union semun for semctl IPC_STAT." >&4
16430 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16435 : see whether semctl IPC_STAT can use struct semid_ds pointer
16436 case "$d_semctl_semid_ds" in
16439 $cat > try.c <<'END'
16440 #include <sys/types.h>
16441 #include <sys/ipc.h>
16442 #include <sys/sem.h>
16443 #include <sys/stat.h>
16451 struct semid_ds arg;
16454 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16455 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16458 st = semctl(sem, 0, IPC_STAT, &arg);
16460 printf("semid_ds\n");
16462 # endif /* IPC_STAT */
16463 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16465 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16466 # endif /* IPC_RMID */
16467 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16469 #endif /* IPC_PRIVATE && ... */
16470 printf("semget failed: errno = %d\n", errno);
16476 if eval $compile; then
16479 semid_ds) val="$define" ;;
16483 set d_semctl_semid_ds
16487 case "$d_semctl_semid_ds" in
16489 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16491 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16497 # We do not have the full sem*(2) library, so assume we can not
16503 set d_semctl_semid_ds
16509 : see if sendmsg exists
16510 set sendmsg d_sendmsg
16513 : see if setegid exists
16514 set setegid d_setegid
16517 : see if seteuid exists
16518 set seteuid d_seteuid
16521 : see if setgrent exists
16522 set setgrent d_setgrent
16525 : see if setgrent_r exists
16526 set setgrent_r d_setgrent_r
16528 case "$d_setgrent_r" in
16530 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16531 case "$d_setgrent_r_proto:$usethreads" in
16532 ":define") d_setgrent_r_proto=define
16533 set d_setgrent_r_proto setgrent_r $hdrs
16537 case "$d_setgrent_r_proto" in
16539 case "$setgrent_r_proto" in
16540 ''|0) try='int setgrent_r(FILE**);'
16541 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
16543 case "$setgrent_r_proto" in
16544 ''|0) try='void setgrent_r(FILE**);'
16545 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
16547 case "$setgrent_r_proto" in
16548 ''|0) d_setgrent_r=undef
16550 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16551 * ) case "$setgrent_r_proto" in
16552 REENTRANT_PROTO*) ;;
16553 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16555 echo "Prototype: $try" ;;
16558 *) case "$usethreads" in
16559 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16566 *) setgrent_r_proto=0
16570 : see if sethostent exists
16571 set sethostent d_sethent
16574 : see if sethostent_r exists
16575 set sethostent_r d_sethostent_r
16577 case "$d_sethostent_r" in
16579 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16580 case "$d_sethostent_r_proto:$usethreads" in
16581 ":define") d_sethostent_r_proto=define
16582 set d_sethostent_r_proto sethostent_r $hdrs
16586 case "$d_sethostent_r_proto" in
16588 case "$sethostent_r_proto" in
16589 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16590 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16592 case "$sethostent_r_proto" in
16593 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16594 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16596 case "$sethostent_r_proto" in
16597 ''|0) d_sethostent_r=undef
16598 sethostent_r_proto=0
16599 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16600 * ) case "$sethostent_r_proto" in
16601 REENTRANT_PROTO*) ;;
16602 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16604 echo "Prototype: $try" ;;
16607 *) case "$usethreads" in
16608 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16610 d_sethostent_r=undef
16611 sethostent_r_proto=0
16615 *) sethostent_r_proto=0
16619 : see if setitimer exists
16620 set setitimer d_setitimer
16623 : see if setlinebuf exists
16624 set setlinebuf d_setlinebuf
16627 : see if setlocale exists
16628 set setlocale d_setlocale
16631 : see if locale.h is available
16632 set locale.h i_locale
16635 : see if setlocale_r exists
16636 set setlocale_r d_setlocale_r
16638 case "$d_setlocale_r" in
16640 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16641 case "$d_setlocale_r_proto:$usethreads" in
16642 ":define") d_setlocale_r_proto=define
16643 set d_setlocale_r_proto setlocale_r $hdrs
16647 case "$d_setlocale_r_proto" in
16649 case "$setlocale_r_proto" in
16650 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16651 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16653 case "$setlocale_r_proto" in
16654 ''|0) d_setlocale_r=undef
16655 setlocale_r_proto=0
16656 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16657 * ) case "$setlocale_r_proto" in
16658 REENTRANT_PROTO*) ;;
16659 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16661 echo "Prototype: $try" ;;
16664 *) case "$usethreads" in
16665 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16667 d_setlocale_r=undef
16668 setlocale_r_proto=0
16672 *) setlocale_r_proto=0
16676 : see if setnetent exists
16677 set setnetent d_setnent
16680 : see if setnetent_r exists
16681 set setnetent_r d_setnetent_r
16683 case "$d_setnetent_r" in
16685 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16686 case "$d_setnetent_r_proto:$usethreads" in
16687 ":define") d_setnetent_r_proto=define
16688 set d_setnetent_r_proto setnetent_r $hdrs
16692 case "$d_setnetent_r_proto" in
16694 case "$setnetent_r_proto" in
16695 ''|0) try='int setnetent_r(int, struct netent_data*);'
16696 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16698 case "$setnetent_r_proto" in
16699 ''|0) try='void setnetent_r(int, struct netent_data*);'
16700 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16702 case "$setnetent_r_proto" in
16703 ''|0) d_setnetent_r=undef
16704 setnetent_r_proto=0
16705 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16706 * ) case "$setnetent_r_proto" in
16707 REENTRANT_PROTO*) ;;
16708 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16710 echo "Prototype: $try" ;;
16713 *) case "$usethreads" in
16714 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16716 d_setnetent_r=undef
16717 setnetent_r_proto=0
16721 *) setnetent_r_proto=0
16725 : see if setprotoent exists
16726 set setprotoent d_setpent
16729 : see if setpgid exists
16730 set setpgid d_setpgid
16733 : see if setpgrp2 exists
16734 set setpgrp2 d_setpgrp2
16737 : see if setpriority exists
16738 set setpriority d_setprior
16741 : see if setproctitle exists
16742 set setproctitle d_setproctitle
16745 : see if setprotoent_r exists
16746 set setprotoent_r d_setprotoent_r
16748 case "$d_setprotoent_r" in
16750 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16751 case "$d_setprotoent_r_proto:$usethreads" in
16752 ":define") d_setprotoent_r_proto=define
16753 set d_setprotoent_r_proto setprotoent_r $hdrs
16757 case "$d_setprotoent_r_proto" in
16759 case "$setprotoent_r_proto" in
16760 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16761 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16763 case "$setprotoent_r_proto" in
16764 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16765 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16767 case "$setprotoent_r_proto" in
16768 ''|0) d_setprotoent_r=undef
16769 setprotoent_r_proto=0
16770 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16771 * ) case "$setprotoent_r_proto" in
16772 REENTRANT_PROTO*) ;;
16773 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16775 echo "Prototype: $try" ;;
16778 *) case "$usethreads" in
16779 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16781 d_setprotoent_r=undef
16782 setprotoent_r_proto=0
16786 *) setprotoent_r_proto=0
16790 : see if setpwent exists
16791 set setpwent d_setpwent
16794 : see if setpwent_r exists
16795 set setpwent_r d_setpwent_r
16797 case "$d_setpwent_r" in
16799 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16800 case "$d_setpwent_r_proto:$usethreads" in
16801 ":define") d_setpwent_r_proto=define
16802 set d_setpwent_r_proto setpwent_r $hdrs
16806 case "$d_setpwent_r_proto" in
16808 case "$setpwent_r_proto" in
16809 ''|0) try='int setpwent_r(FILE**);'
16810 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16812 case "$setpwent_r_proto" in
16813 ''|0) try='void setpwent_r(FILE**);'
16814 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16816 case "$setpwent_r_proto" in
16817 ''|0) d_setpwent_r=undef
16819 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16820 * ) case "$setpwent_r_proto" in
16821 REENTRANT_PROTO*) ;;
16822 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16824 echo "Prototype: $try" ;;
16827 *) case "$usethreads" in
16828 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16835 *) setpwent_r_proto=0
16839 : see if setregid exists
16840 set setregid d_setregid
16842 set setresgid d_setresgid
16845 : see if setreuid exists
16846 set setreuid d_setreuid
16848 set setresuid d_setresuid
16851 : see if setrgid exists
16852 set setrgid d_setrgid
16855 : see if setruid exists
16856 set setruid d_setruid
16859 : see if setservent exists
16860 set setservent d_setsent
16863 : see if setservent_r exists
16864 set setservent_r d_setservent_r
16866 case "$d_setservent_r" in
16868 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16869 case "$d_setservent_r_proto:$usethreads" in
16870 ":define") d_setservent_r_proto=define
16871 set d_setservent_r_proto setservent_r $hdrs
16875 case "$d_setservent_r_proto" in
16877 case "$setservent_r_proto" in
16878 ''|0) try='int setservent_r(int, struct servent_data*);'
16879 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16881 case "$setservent_r_proto" in
16882 ''|0) try='void setservent_r(int, struct servent_data*);'
16883 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16885 case "$setservent_r_proto" in
16886 ''|0) d_setservent_r=undef
16887 setservent_r_proto=0
16888 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16889 * ) case "$setservent_r_proto" in
16890 REENTRANT_PROTO*) ;;
16891 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16893 echo "Prototype: $try" ;;
16896 *) case "$usethreads" in
16897 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16899 d_setservent_r=undef
16900 setservent_r_proto=0
16904 *) setservent_r_proto=0
16908 : see if setsid exists
16909 set setsid d_setsid
16912 : see if setvbuf exists
16913 set setvbuf d_setvbuf
16916 : see if sfio.h is available
16920 : see if sfio library is available
16931 : Ok, but do we want to use it.
16935 true|$define|[yY]*) dflt='y';;
16938 echo "$package can use the sfio library, but it is experimental."
16939 case "$useperlio" in
16941 echo "For sfio also the PerlIO abstraction layer is needed."
16942 echo "Earlier you said you wouldn't want that."
16945 rp="You seem to have sfio available, do you want to try using it?"
16948 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16949 useperlio="$define"
16952 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16957 *) case "$usesfio" in
16958 true|$define|[yY]*)
16959 echo "Sorry, cannot find sfio on this machine." >&4
16960 echo "Ignoring your setting of usesfio=$usesfio." >&4
16969 $define) usesfio='true';;
16970 *) usesfio='false';;
16974 *) : Remove sfio from list of libraries to use
16977 echo "Removing unneeded -lsfio from library list" >&4
16978 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16981 echo "libs = $libs" >&4
16988 : see if shmctl exists
16989 set shmctl d_shmctl
16992 : see if shmget exists
16993 set shmget d_shmget
16996 : see if shmat exists
16999 : see what shmat returns
17002 $cat >shmat.c <<'END'
17003 #include <sys/shm.h>
17006 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17011 echo "and it returns ($shmattype)." >&4
17012 : see if a prototype for shmat is available
17013 xxx=`./findhdr sys/shm.h`
17014 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17015 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17026 set d_shmatprototype
17029 : see if shmdt exists
17033 : see how much of the 'shm*(2)' library is present.
17036 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17037 *"$undef"*) h_shm=false;;
17041 case "`ipcs 2>&1`" in
17042 "SVID shared memory"*"not configured"*)
17043 echo "Your $osname does not have the shm*(2) configured." >&4
17046 set shmctl d_shmctl
17048 set shmget d_shmget
17058 : we could also check for sys/ipc.h ...
17059 if $h_shm && $test `./findhdr sys/shm.h`; then
17060 echo "You have the full shm*(2) library." >&4
17063 echo "You don't have the full shm*(2) library." >&4
17069 : see if we have sigaction
17071 if set sigaction val -f d_sigaction; eval $csym; $val; then
17072 echo 'sigaction() found.' >&4
17075 #include <sys/types.h>
17076 #include <signal.h>
17077 #$i_stdlib I_STDLIB
17079 #include <stdlib.h>
17083 struct sigaction act, oact;
17085 oact.sa_handler = 0;
17086 /* so that act and oact are used */
17087 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17091 if eval $compile_ok; then
17094 echo "But you don't seem to have a useable struct sigaction." >&4
17098 echo 'sigaction NOT found.' >&4
17101 set d_sigaction; eval $setvar
17104 : see if this is a sunmath.h system
17105 set sunmath.h i_sunmath
17108 : see if signbit exists
17109 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17112 #$i_sunmath I_SUNMATH
17116 #ifdef I_SUNMATH /* Solaris special math library */
17117 # include <sunmath.h>
17120 int main(int argc, char **argv)
17124 if ((signbit(x) == 0) && (signbit(y) != 0))
17132 if eval $compile; then
17133 if $run ./try; then
17137 $echo "Signbit seems to be available, but doesn't work as I expected."
17138 $echo "I won't use it." >&4
17149 : see if sigprocmask exists
17150 set sigprocmask d_sigprocmask
17153 : see if sigsetjmp exists
17155 case "$d_sigsetjmp" in
17158 #include <setjmp.h>
17159 #$i_stdlib I_STDLIB
17161 #include <stdlib.h>
17167 if (sigsetjmp(env,1))
17170 siglongjmp(env, 1);
17175 if eval $compile; then
17176 if $run ./try >/dev/null 2>&1; then
17177 echo "POSIX sigsetjmp found." >&4
17181 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17187 echo "sigsetjmp not found." >&4
17191 *) val="$d_sigsetjmp"
17192 case "$d_sigsetjmp" in
17193 $define) echo "POSIX sigsetjmp found." >&4;;
17194 $undef) echo "sigsetjmp not found." >&4;;
17202 : see if snprintf exists
17203 set snprintf d_snprintf
17206 : see if vsnprintf exists
17207 set vsnprintf d_vsnprintf
17210 case "$d_snprintf-$d_vsnprintf" in
17213 Checking whether your snprintf() and vsnprintf() work okay...
17215 $cat >try.c <<'EOCP'
17216 /* v?snprintf testing logic courtesy of Russ Allbery.
17217 * According to C99:
17218 * - if the buffer is too short it still must be \0-terminated
17219 * - if the buffer is too short the potentially required length
17220 * must be returned and not -1
17221 * - if the buffer is NULL the potentially required length
17222 * must be returned and not -1 or core dump
17225 #include <stdarg.h>
17229 int test (char *format, ...)
17234 va_start (args, format);
17235 count = vsnprintf (buf, sizeof buf, format, args);
17242 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17243 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17247 if eval $compile; then
17250 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17252 Your snprintf() and snprintf() don't seem to be working okay.
17254 d_snprintf="$undef"
17255 d_vsnprintf="$undef"
17259 echo "(I can't seem to compile the test program--assuming they don't)"
17260 d_snprintf="$undef"
17261 d_vsnprintf="$undef"
17267 : see if sockatmark exists
17268 set sockatmark d_sockatmark
17271 : see if prototype for sockatmark is available
17273 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17276 : see if socks5_init exists
17277 set socks5_init d_socks5_init
17280 : see if sprintf returns the length of the string in the buffer as per ANSI
17281 $echo "Checking whether sprintf returns the length of the string..." >&4
17284 #$i_stdlib I_STDLIB
17286 #include <stdlib.h>
17288 #$i_string I_STRING
17290 # include <string.h>
17292 # include <strings.h>
17301 int check (size_t expect, int test) {
17302 size_t got = strlen(buffer);
17306 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17311 int main(int argc, char **argv) {
17314 check(sprintf(buffer, ""), ++test);
17315 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17316 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17323 d_sprintf_returns_strlen="$undef"
17324 if eval $compile; then
17328 sprintf returns the length of the string (as ANSI says it should)
17330 d_sprintf_returns_strlen="$define"
17333 sprintf does not return the length of the string (how old is this system?)
17335 d_sprintf_returns_strlen="$undef"
17341 : see if srand48_r exists
17342 set srand48_r d_srand48_r
17344 case "$d_srand48_r" in
17346 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17347 case "$d_srand48_r_proto:$usethreads" in
17348 ":define") d_srand48_r_proto=define
17349 set d_srand48_r_proto srand48_r $hdrs
17353 case "$d_srand48_r_proto" in
17355 case "$srand48_r_proto" in
17356 ''|0) try='int srand48_r(long, struct drand48_data*);'
17357 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
17359 case "$srand48_r_proto" in
17360 ''|0) d_srand48_r=undef
17362 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17363 * ) case "$srand48_r_proto" in
17364 REENTRANT_PROTO*) ;;
17365 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17367 echo "Prototype: $try" ;;
17370 *) case "$usethreads" in
17371 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17378 *) srand48_r_proto=0
17382 : see if srandom_r exists
17383 set srandom_r d_srandom_r
17385 case "$d_srandom_r" in
17387 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17388 case "$d_srandom_r_proto:$usethreads" in
17389 ":define") d_srandom_r_proto=define
17390 set d_srandom_r_proto srandom_r $hdrs
17394 case "$d_srandom_r_proto" in
17396 case "$srandom_r_proto" in
17397 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17398 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
17400 case "$srandom_r_proto" in
17401 ''|0) d_srandom_r=undef
17403 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17404 * ) case "$srandom_r_proto" in
17405 REENTRANT_PROTO*) ;;
17406 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17408 echo "Prototype: $try" ;;
17411 *) case "$usethreads" in
17412 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17419 *) srandom_r_proto=0
17423 : see if prototype for setresgid is available
17425 set d_sresgproto setresgid $i_unistd unistd.h
17428 : see if prototype for setresuid is available
17430 set d_sresuproto setresuid $i_unistd unistd.h
17433 : see if sys/stat.h is available
17434 set sys/stat.h i_sysstat
17437 : see if stat knows about block sizes
17439 echo "Checking to see if your struct stat has st_blocks field..." >&4
17440 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17443 : see if this is a sys/vfs.h system
17444 set sys/vfs.h i_sysvfs
17447 : see if this is a sys/statfs.h system
17448 set sys/statfs.h i_sysstatfs
17451 : Check for statfs_s
17453 echo "Checking to see if your system supports struct statfs..." >&4
17454 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
17456 case "$d_statfs_s" in
17457 "$define") echo "Yes, it does." ;;
17458 *) echo "No, it doesn't." ;;
17462 : see if struct statfs knows about f_flags
17463 case "$d_statfs_s" in
17466 echo "Checking to see if your struct statfs has f_flags field..." >&4
17467 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
17471 set d_statfs_f_flags
17475 case "$d_statfs_f_flags" in
17476 "$define") echo "Yes, it does." ;;
17477 *) echo "No, it doesn't." ;;
17480 : Check stream access
17482 Checking how to access stdio streams by file descriptor number...
17484 case "$stdio_stream_array" in
17485 '') $cat >try.c <<EOCP
17488 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17492 for s in _iob __iob __sF
17494 set try -DSTDIO_STREAM_ARRAY=$s
17495 if eval $compile; then
17496 case "`$run ./try`" in
17497 yes) stdio_stream_array=$s; break ;;
17503 case "$stdio_stream_array" in
17505 I can't figure out how to access stdio streams by file descriptor number.
17507 d_stdio_stream_array="$undef"
17510 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17512 d_stdio_stream_array="$define"
17516 : see if strcoll exists
17517 set strcoll d_strcoll
17520 : check for structure copying
17522 echo "Checking to see if your C compiler can copy structs..." >&4
17523 $cat >try.c <<'EOCP'
17533 if $cc -c try.c >/dev/null 2>&1 ; then
17535 echo "Yup, it can."
17538 echo "Nope, it can't."
17544 : see if strerror and/or sys_errlist[] exist
17546 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17547 if set strerror val -f d_strerror; eval $csym; $val; then
17548 echo 'strerror() found.' >&4
17549 d_strerror="$define"
17550 d_strerrm='strerror(e)'
17551 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17552 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17553 d_syserrlst="$define"
17555 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17556 d_syserrlst="$undef"
17558 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17559 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17560 echo 'strerror() found in string header.' >&4
17561 d_strerror="$define"
17562 d_strerrm='strerror(e)'
17563 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17564 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17565 d_syserrlst="$define"
17567 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17568 d_syserrlst="$undef"
17570 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17571 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17572 d_strerror="$undef"
17573 d_syserrlst="$define"
17574 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17576 echo 'strerror() and sys_errlist[] NOT found.' >&4
17577 d_strerror="$undef"
17578 d_syserrlst="$undef"
17579 d_strerrm='"unknown"'
17583 : see if strerror_r exists
17584 set strerror_r d_strerror_r
17586 case "$d_strerror_r" in
17588 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17589 case "$d_strerror_r_proto:$usethreads" in
17590 ":define") d_strerror_r_proto=define
17591 set d_strerror_r_proto strerror_r $hdrs
17595 case "$d_strerror_r_proto" in
17597 case "$strerror_r_proto" in
17598 ''|0) try='int strerror_r(int, char*, size_t);'
17599 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
17601 case "$strerror_r_proto" in
17602 ''|0) try='int strerror_r(int, char*, int);'
17603 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17605 case "$strerror_r_proto" in
17606 ''|0) try='char* strerror_r(int, char*, size_t);'
17607 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17609 case "$strerror_r_proto" in
17610 ''|0) d_strerror_r=undef
17612 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17613 * ) case "$strerror_r_proto" in
17614 REENTRANT_PROTO*) ;;
17615 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17617 echo "Prototype: $try" ;;
17620 *) case "$usethreads" in
17621 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17628 *) strerror_r_proto=0
17632 : see if strftime exists
17633 set strftime d_strftime
17636 : see if strlcat exists
17637 set strlcat d_strlcat
17640 : see if strlcpy exists
17641 set strlcpy d_strlcpy
17644 : see if strtod exists
17645 set strtod d_strtod
17648 : see if strtol exists
17649 set strtol d_strtol
17652 : see if strtold exists
17653 set strtold d_strtold
17656 : see if strtoll exists
17657 set strtoll d_strtoll
17660 case "$d_longlong-$d_strtoll" in
17663 Checking whether your strtoll() works okay...
17665 $cat >try.c <<'EOCP'
17668 #define strtoll __strtoll
17671 #define strtoll _strtoll
17674 extern long long int strtoll(char *s, char **, int);
17675 static int bad = 0;
17676 int check(char *s, long long ell, int een) {
17679 gll = strtoll(s, 0, 10);
17680 if (!((gll == ell) && (errno == een)))
17684 check(" 1", 1LL, 0);
17685 check(" 0", 0LL, 0);
17686 check("-1", -1LL, 0);
17687 check("-9223372036854775808", -9223372036854775808LL, 0);
17688 check("-9223372036854775808", -9223372036854775808LL, 0);
17689 check(" 9223372036854775807", 9223372036854775807LL, 0);
17690 check("-9223372036854775808", -9223372036854775808LL, 0);
17691 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17692 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17698 if eval $compile; then
17701 ok) echo "Your strtoll() seems to be working okay." ;;
17703 Your strtoll() doesn't seem to be working okay.
17709 echo "(I can't seem to compile the test program--assuming it doesn't)"
17715 : see if strtoq exists
17716 set strtoq d_strtoq
17719 : see if strtoul exists
17720 set strtoul d_strtoul
17723 case "$d_strtoul" in
17726 Checking whether your strtoul() works okay...
17728 $cat >try.c <<'EOCP'
17731 extern unsigned long int strtoul(char *s, char **, int);
17732 static int bad = 0;
17733 void check(char *s, unsigned long eul, int een) {
17736 gul = strtoul(s, 0, 10);
17737 if (!((gul == eul) && (errno == een)))
17741 check(" 1", 1L, 0);
17742 check(" 0", 0L, 0);
17744 case "$longsize" in
17746 $cat >>try.c <<'EOCP'
17747 check("18446744073709551615", 18446744073709551615UL, 0);
17748 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17749 #if 0 /* strtoul() for /^-/ strings is undefined. */
17750 check("-1", 18446744073709551615UL, 0);
17751 check("-18446744073709551614", 2, 0);
17752 check("-18446744073709551615", 1, 0);
17753 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17754 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17759 $cat >>try.c <<'EOCP'
17760 check("4294967295", 4294967295UL, 0);
17761 check("4294967296", 4294967295UL, ERANGE);
17762 #if 0 /* strtoul() for /^-/ strings is undefined. */
17763 check("-1", 4294967295UL, 0);
17764 check("-4294967294", 2, 0);
17765 check("-4294967295", 1, 0);
17766 check("-4294967296", 4294967295UL, ERANGE);
17767 check("-4294967297", 4294967295UL, ERANGE);
17772 : Should we write these tests to be more portable by sprintf-ing
17773 : ~0 and then manipulating that char string as input for strtol?
17776 $cat >>try.c <<'EOCP'
17783 if eval $compile; then
17784 case "`$run ./try`" in
17785 ok) echo "Your strtoul() seems to be working okay." ;;
17787 Your strtoul() doesn't seem to be working okay.
17793 echo "(I can't seem to compile the test program--assuming it doesn't)"
17799 : see if strtoull exists
17800 set strtoull d_strtoull
17803 case "$d_longlong-$d_strtoull" in
17806 Checking whether your strtoull() works okay...
17808 $cat >try.c <<'EOCP'
17811 #define strtoull __strtoull
17814 extern unsigned long long int strtoull(char *s, char **, int);
17815 static int bad = 0;
17816 int check(char *s, long long eull, int een) {
17819 gull = strtoull(s, 0, 10);
17820 if (!((gull == eull) && (errno == een)))
17824 check(" 1", 1LL, 0);
17825 check(" 0", 0LL, 0);
17826 check("18446744073709551615", 18446744073709551615ULL, 0);
17827 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17828 #if 0 /* strtoull() for /^-/ strings is undefined. */
17829 check("-1", 18446744073709551615ULL, 0);
17830 check("-18446744073709551614", 2LL, 0);
17831 check("-18446744073709551615", 1LL, 0);
17832 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17833 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17840 if eval $compile; then
17841 case "`$run ./try`" in
17842 ok) echo "Your strtoull() seems to be working okay." ;;
17844 Your strtoull() doesn't seem to be working okay.
17846 d_strtoull="$undef"
17850 echo "(I can't seem to compile the test program--assuming it doesn't)"
17851 d_strtoull="$undef"
17856 : see if strtouq exists
17857 set strtouq d_strtouq
17860 case "$d_strtouq" in
17863 Checking whether your strtouq() works okay...
17865 $cat >try.c <<'EOCP'
17868 extern unsigned long long int strtouq(char *s, char **, int);
17869 static int bad = 0;
17870 void check(char *s, unsigned long long eull, int een) {
17871 unsigned long long gull;
17873 gull = strtouq(s, 0, 10);
17874 if (!((gull == eull) && (errno == een)))
17878 check(" 1", 1LL, 0);
17879 check(" 0", 0LL, 0);
17880 check("18446744073709551615", 18446744073709551615ULL, 0);
17881 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17882 #if 0 /* strtouq() for /^-/ strings is undefined. */
17883 check("-1", 18446744073709551615ULL, 0);
17884 check("-18446744073709551614", 2LL, 0);
17885 check("-18446744073709551615", 1LL, 0);
17886 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17887 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17895 if eval $compile; then
17896 case "`$run ./try`" in
17897 ok) echo "Your strtouq() seems to be working okay." ;;
17899 Your strtouq() doesn't seem to be working okay.
17905 echo "(I can't seem to compile the test program--assuming it doesn't)"
17911 : see if strxfrm exists
17912 set strxfrm d_strxfrm
17915 : see if symlink exists
17916 set symlink d_symlink
17919 : see if syscall exists
17920 set syscall d_syscall
17923 : see if prototype for syscall is available
17925 set d_syscallproto syscall $i_unistd unistd.h
17928 : see if sysconf exists
17929 set sysconf d_sysconf
17932 : see if system exists
17933 set system d_system
17936 : see if tcgetpgrp exists
17937 set tcgetpgrp d_tcgetpgrp
17940 : see if tcsetpgrp exists
17941 set tcsetpgrp d_tcsetpgrp
17944 : see if prototype for telldir is available
17946 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17949 : see if time exists
17951 if test "X$d_time" = X -o X"$timetype" = X; then
17952 if set time val -f d_time; eval $csym; $val; then
17953 echo 'time() found.' >&4
17955 rp="What is the type returned by time() on this system?"
17956 set time_t timetype long stdio.h sys/types.h
17959 echo 'time() not found, hope that will do.' >&4
17967 : see if this is a sys/times.h system
17968 set sys/times.h i_systimes
17971 : see if times exists
17973 if set times val -f d_times; eval $csym; $val; then
17974 echo 'times() found.' >&4
17977 case "$i_systimes" in
17978 "$define") inc='sys/times.h';;
17980 rp="What is the type returned by times() on this system?"
17981 set clock_t clocktype long stdio.h sys/types.h $inc
17984 echo 'times() NOT found, hope that will do.' >&4
17989 : see if tmpnam_r exists
17990 set tmpnam_r d_tmpnam_r
17992 case "$d_tmpnam_r" in
17994 hdrs="$i_systypes sys/types.h define stdio.h "
17995 case "$d_tmpnam_r_proto:$usethreads" in
17996 ":define") d_tmpnam_r_proto=define
17997 set d_tmpnam_r_proto tmpnam_r $hdrs
18001 case "$d_tmpnam_r_proto" in
18003 case "$tmpnam_r_proto" in
18004 ''|0) try='char* tmpnam_r(char*);'
18005 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
18007 case "$tmpnam_r_proto" in
18008 ''|0) d_tmpnam_r=undef
18010 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18011 * ) case "$tmpnam_r_proto" in
18012 REENTRANT_PROTO*) ;;
18013 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18015 echo "Prototype: $try" ;;
18018 *) case "$usethreads" in
18019 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18026 *) tmpnam_r_proto=0
18030 : see if truncate exists
18031 set truncate d_truncate
18034 : see if ttyname_r exists
18035 set ttyname_r d_ttyname_r
18037 case "$d_ttyname_r" in
18039 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18040 case "$d_ttyname_r_proto:$usethreads" in
18041 ":define") d_ttyname_r_proto=define
18042 set d_ttyname_r_proto ttyname_r $hdrs
18046 case "$d_ttyname_r_proto" in
18048 case "$ttyname_r_proto" in
18049 ''|0) try='int ttyname_r(int, char*, size_t);'
18050 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
18052 case "$ttyname_r_proto" in
18053 ''|0) try='int ttyname_r(int, char*, int);'
18054 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
18056 case "$ttyname_r_proto" in
18057 ''|0) try='char* ttyname_r(int, char*, int);'
18058 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
18060 case "$ttyname_r_proto" in
18061 ''|0) d_ttyname_r=undef
18063 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18064 * ) case "$ttyname_r_proto" in
18065 REENTRANT_PROTO*) ;;
18066 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18068 echo "Prototype: $try" ;;
18071 *) case "$usethreads" in
18072 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18079 *) ttyname_r_proto=0
18083 : see if tzname[] exists
18085 if set tzname val -a d_tzname; eval $csym; $val; then
18087 echo 'tzname[] found.' >&4
18090 echo 'tzname[] NOT found.' >&4
18095 : Check if is a multiplatform env
18097 next|rhapsody|darwin) multiarch="$define" ;;
18099 case "$multiarch" in
18100 ''|[nN]*) multiarch="$undef" ;;
18103 : check for ordering of bytes in a UV
18105 case "$usecrosscompile$multiarch" in
18108 You seem to be either cross-compiling or doing a multiarchitecture build,
18109 skipping the byteorder check.
18115 case "$byteorder" in
18118 In the following, larger digits indicate more significance. A big-endian
18119 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18120 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18121 machines may have weird orders like 3412. A Cray will report 87654321,
18122 an Alpha will report 12345678. If the test program works the default is
18124 I'm now running the test program...
18128 #$i_stdlib I_STDLIB
18130 #include <stdlib.h>
18132 #include <sys/types.h>
18133 typedef $uvtype UV;
18143 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18145 u.l = (UV)0x04030201;
18146 for (i = 0; i < $uvsize; i++)
18147 printf("%c", u.c[i]+'0');
18154 if eval $compile && $run ./try > /dev/null; then
18157 [1-4][1-4][1-4][1-4]|12345678|87654321)
18158 echo "(The test program ran ok.)"
18159 echo "byteorder=$dflt"
18162 ????|????????) echo "(The test program ran ok.)" ;;
18163 *) echo "(The test program didn't run right for some reason.)" ;;
18168 (I can't seem to compile the test program. Guessing big-endian...)
18171 case "$xxx_prompt" in
18173 rp="What is the order of bytes in $uvtype?"
18186 : Checking 32bit aligndness
18189 Checking to see whether you can access character data unalignedly...
18191 case "$d_u32align" in
18192 '') $cat >try.c <<EOCP
18194 #$i_stdlib I_STDLIB
18196 #include <stdlib.h>
18198 #define U32 $u32type
18199 #define BYTEORDER 0x$byteorder
18201 #include <signal.h>
18203 $signal_t bletch(int s) { exit(4); }
18206 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18211 if (sizeof(U32) != 4) {
18212 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18219 signal(SIGBUS, bletch);
18231 for (i = 0; i < 4; i++) {
18232 up = (U32*)(buf + i);
18233 if (! ((*up == 1 << (8*i)) || /* big-endian */
18234 (*up == 1 << (8*(3-i))) /* little-endian */
18238 printf("read failed (%x)\n", *up);
18244 for (i = 0; i < 4; i++) {
18245 up = (U32*)(buf + i);
18247 if (*up != 0xBeef) {
18248 printf("write failed (%x)\n", *up);
18262 if eval $compile_ok; then
18263 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18264 $run ./try 2>&1 >/dev/null
18267 You can access character data pretty unalignedly.
18269 d_u32align="$undef"
18272 It seems that you must access character data in an aligned manner.
18274 d_u32align="$define"
18278 rp='Can you access character data at unaligned addresses?'
18282 [yY]*) d_u32align="$undef" ;;
18283 *) d_u32align="$define" ;;
18290 : see if ualarm exists
18291 set ualarm d_ualarm
18294 : see if umask exists
18298 : see if unordered exists
18299 set unordered d_unordered
18302 : see if unsetenv exists
18303 set unsetenv d_unsetenv
18306 : see if usleep exists
18307 set usleep d_usleep
18310 : see if prototype for usleep is available
18312 set d_usleepproto usleep $i_unistd unistd.h
18315 : see if ustat exists
18319 : see if closedir exists
18320 set closedir d_closedir
18323 case "$d_closedir" in
18326 echo "Checking whether closedir() returns a status..." >&4
18328 #$i_dirent I_DIRENT /**/
18329 #$i_sysdir I_SYS_DIR /**/
18330 #$i_sysndir I_SYS_NDIR /**/
18331 #$i_systypes I_SYS_TYPES /**/
18333 #if defined(I_SYS_TYPES)
18334 #include <sys/types.h>
18336 #if defined(I_DIRENT)
18337 #include <dirent.h>
18338 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18339 #include <sys/dir.h>
18343 #include <sys/ndir.h>
18347 #include <ndir.h> /* may be wrong in the future */
18349 #include <sys/dir.h>
18354 int main() { return closedir(opendir(".")); }
18357 if eval $compile_ok; then
18358 if $run ./try > /dev/null 2>&1 ; then
18359 echo "Yes, it does."
18362 echo "No, it doesn't."
18366 echo "(I can't seem to compile the test program--assuming it doesn't)"
18374 set d_void_closedir
18378 : see if there is a wait4
18382 : see if waitpid exists
18383 set waitpid d_waitpid
18386 : see if wcstombs exists
18387 set wcstombs d_wcstombs
18390 : see if wctomb exists
18391 set wctomb d_wctomb
18394 : see if writev exists
18395 set writev d_writev
18398 : preserve RCS keywords in files with variable substitution, grrr
18403 Revision='$Revision'
18405 : check for alignment requirements
18407 case "$usecrosscompile$multiarch" in
18410 You seem to be either cross-compiling or doing a multiarchitecture build,
18411 skipping the memory alignment check.
18414 case "$alignbytes" in
18415 '') alignbytes=8 ;;
18419 case "$alignbytes" in
18420 '') echo "Checking alignment constraints..." >&4
18421 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18422 $cat >try.c <<'EOCP'
18423 typedef long double NV;
18426 $cat >try.c <<'EOCP'
18430 $cat >>try.c <<'EOCP'
18438 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18443 if eval $compile_ok; then
18447 echo "(I can't seem to compile the test program...)"
18450 *) dflt="$alignbytes"
18453 rp="Doubles must be aligned on a how-many-byte boundary?"
18461 : set the base revision
18464 : how do we concatenate cpp tokens here?
18466 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18467 $cat >cpp_stuff.c <<'EOCP'
18468 #define RCAT(a,b)a/**/b
18469 #define ACAT(a,b)a ## b
18473 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18474 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18475 echo "Oh! Smells like ANSI's been here." >&4
18476 echo "We can catify or stringify, separately or together!"
18478 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18479 echo "Ah, yes! The good old days!" >&4
18480 echo "However, in the good old days we don't know how to stringify and"
18481 echo "catify at the same time."
18485 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18486 You're going to have to edit the values of CAT[2-5] in config.h...
18488 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18492 : see if this is a db.h system
18498 : Check db version.
18500 echo "Checking Berkeley DB version ..." >&4
18506 #include <sys/types.h>
18508 #$i_stdlib I_STDLIB
18510 #include <stdlib.h>
18513 int main(int argc, char *argv[])
18515 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18516 int Major, Minor, Patch ;
18517 unsigned long Version ;
18518 (void)db_version(&Major, &Minor, &Patch) ;
18520 printf("%d %d %d %d %d %d\n",
18521 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18522 Major, Minor, Patch);
18525 printf("You have Berkeley DB Version 2 or greater.\n");
18527 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18528 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18529 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18530 Major, Minor, Patch) ;
18532 /* check that db.h & libdb are compatible */
18533 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18534 printf("db.h and libdb are incompatible.\n") ;
18538 printf("db.h and libdb are compatible.\n") ;
18540 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18541 + DB_VERSION_PATCH ;
18543 /* needs to be >= 2.3.4 */
18544 if (Version < 2003004) {
18545 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18546 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18552 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18557 printf("You have Berkeley DB Version 1.\n");
18558 exit(0); /* DB version < 2: the coast is clear. */
18560 exit(1); /* <db.h> not Berkeley DB? */
18566 if eval $compile_ok && $run ./try; then
18567 echo 'Looks OK.' >&4
18569 db_version_major=$1
18570 db_version_minor=$2
18571 db_version_patch=$3
18573 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18577 : Remove db from list of libraries to use
18578 echo "Removing unusable -ldb from library list" >&4
18579 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18582 echo "libs = $libs" >&4
18592 : Check the return type needed for hash
18594 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18600 #include <sys/types.h>
18603 #ifndef DB_VERSION_MAJOR
18604 u_int32_t hash_cb (ptr, size)
18612 info.hash = hash_cb;
18616 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18617 if $contains warning try.out >>/dev/null 2>&1 ; then
18620 db_hashtype='u_int32_t'
18623 : XXX Maybe we should just give up here.
18624 db_hashtype=u_int32_t
18626 echo "Help: I can't seem to compile the db test program." >&4
18627 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18630 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18632 *) db_hashtype=u_int32_t
18637 : Check the return type needed for prefix
18639 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18645 #include <sys/types.h>
18648 #ifndef DB_VERSION_MAJOR
18649 size_t prefix_cb (key1, key2)
18657 info.prefix = prefix_cb;
18661 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18662 if $contains warning try.out >>/dev/null 2>&1 ; then
18663 db_prefixtype='int'
18665 db_prefixtype='size_t'
18668 db_prefixtype='size_t'
18669 : XXX Maybe we should just give up here.
18671 echo "Help: I can't seem to compile the db test program." >&4
18672 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18675 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18677 *) db_prefixtype='size_t'
18681 : How can we generate normalized random numbers ?
18683 echo "Looking for a random number function..." >&4
18684 case "$randfunc" in
18686 if set drand48 val -f; eval $csym; $val; then
18688 echo "Good, found drand48()." >&4
18689 elif set random val -f; eval $csym; $val; then
18691 echo "OK, found random()." >&4
18694 echo "Yick, looks like I have to use rand()." >&4
18705 *-Dmy_rand=*|*-Dmy_srand=*)
18706 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18707 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18708 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18709 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18713 while $test "$cont"; do
18714 rp="Use which function to generate random numbers?"
18716 if $test "$ans" = "$dflt"; then
18722 if set $ans val -f; eval $csym; $val; then
18726 rp="I cannot find function $ans. Use that name anyway?"
18735 case "$randfunc" in
18737 drand01="drand48()"
18743 case "$randbits" in
18745 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18747 #$i_unistd I_UNISTD
18748 #$i_stdlib I_STDLIB
18751 # include <unistd.h>
18754 # include <stdlib.h>
18759 register unsigned long tmp;
18760 register unsigned long max = 0L;
18762 for (i = 1000; i; i--) {
18763 tmp = (unsigned long) $randfunc();
18764 if (tmp > max) max = tmp;
18766 for (i = 0; max; i++)
18772 if eval $compile_ok; then
18776 echo "(I can't seem to compile the test program...)"
18783 rp="How many bits does your $randfunc() function produce?"
18787 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18788 seedfunc="s$randfunc"
18789 randseedtype=unsigned
18793 rp="How many bits does your $randfunc() function produce?"
18796 seedfunc="s$randfunc"
18797 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18798 if set $seedfunc val -f; eval $csym; $val; then
18799 echo "(Using $seedfunc() to seed random generator)"
18801 echo "(Warning: no $seedfunc() to seed random generator)"
18804 randseedtype=unsigned
18811 : Determine if this is an EBCDIC system
18813 echo "Determining whether or not we are on an EBCDIC system..." >&4
18814 $cat >try.c <<'EOM'
18817 if ('M'==0xd4) return 0;
18824 if eval $compile_ok; then
18825 if $run ./try; then
18826 echo "You seem to speak EBCDIC." >&4
18829 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18832 echo "I'm unable to compile the test program." >&4
18833 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18839 : Check how to flush
18842 Checking how to flush all pending stdio output...
18844 # I only know how to find the first 32 possibly open files on SunOS.
18845 # See also hints/sunos_4_1.sh and util.c --AD
18847 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18849 $cat >>try.c <<EOCP
18851 #$i_stdlib I_STDLIB
18853 #include <stdlib.h>
18855 #$i_unistd I_UNISTD
18857 # include <unistd.h>
18859 #$d_sysconf HAS_SYSCONF
18860 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18861 #ifdef HAS_STDIO_STREAM_ARRAY
18862 # define STDIO_STREAM_ARRAY $stdio_stream_array
18867 p = fopen("try.out", "w");
18871 # ifdef TRY_FPRINTF
18875 #ifdef TRY_FFLUSH_NULL
18878 #ifdef TRY_FFLUSH_ALL
18880 long open_max = -1;
18881 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18882 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18884 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18885 open_max = sysconf(_SC_OPEN_MAX);
18888 open_max = FOPEN_MAX;
18891 open_max = OPEN_MAX;
18900 # ifdef HAS_STDIO_STREAM_ARRAY
18901 if (open_max > 0) {
18903 for (i = 0; i < open_max; i++)
18904 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18905 STDIO_STREAM_ARRAY[i]._file < open_max &&
18906 STDIO_STREAM_ARRAY[i]._flag)
18907 fflush(&STDIO_STREAM_ARRAY[i]);
18915 : first we have to find out how _not_ to flush
18917 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18919 set try -DTRY_FPUTC
18920 if eval $compile; then
18921 $run ./try 2>/dev/null
18924 if $test ! -s try.out -a "X$code" = X42; then
18930 set try -DTRY_FPRINTF
18931 if eval $compile; then
18932 $run ./try 2>/dev/null
18935 if $test ! -s try.out -a "X$code" = X42; then
18936 output=-DTRY_FPRINTF
18942 : check for fflush NULL behaviour
18943 case "$fflushNULL" in
18944 '') set try -DTRY_FFLUSH_NULL $output
18945 if eval $compile; then
18946 $run ./try 2>/dev/null
18949 if $test -s try.out -a "X$code" = X42; then
18950 fflushNULL="`$cat try.out`"
18952 if $test "X$code" != X42; then
18954 (If this test failed, don't worry, we'll try another method shortly.)
18960 case "$fflushNULL" in
18962 Your fflush(NULL) works okay for output streams.
18963 Let's see if it clobbers input pipes...
18965 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18966 # bug that improperly flushes the input end of pipes. So we avoid the
18967 # autoflush on fork/system/exec support for now. :-(
18968 $cat >tryp.c <<EOCP
18971 main(int argc, char **argv)
18977 while ((i = getc(stdin)) != -1
18978 && (*bp++ = i) != '\n'
18979 && bp < &buf[1024])
18982 fprintf(stdout, "%s", buf);
18990 fflushNULL="$define"
18992 if eval $compile; then
18994 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18995 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18997 fflush(NULL) seems to behave okay with input streams.
18999 fflushNULL="$define"
19002 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19004 fflushNULL="$undef"
19007 $rm -f core tryp.c tryp.core core.tryp.*
19010 Your fflush(NULL) isn't working (contrary to ANSI C).
19012 fflushNULL="$undef"
19015 Cannot figure out whether your fflush(NULL) works or not.
19016 I'm assuming it doesn't (contrary to ANSI C).
19018 fflushNULL="$undef"
19022 $define|true|[yY]*)
19023 fflushNULL="$define"
19026 fflushNULL="$undef"
19029 : check explicit looping only if NULL did not work, and if the pipe
19030 : bug does not show up on an explicit flush too
19031 case "$fflushNULL" in
19033 $cat >tryp.c <<EOCP
19036 main(int argc, char **argv)
19042 while ((i = getc(stdin)) != -1
19043 && (*bp++ = i) != '\n'
19044 && bp < &buf[1024])
19047 fprintf(stdout, "%s", buf);
19056 if eval $compile; then
19058 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19059 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19061 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19063 : now check for fflushall behaviour
19064 case "$fflushall" in
19065 '') set try -DTRY_FFLUSH_ALL $output
19066 if eval $compile; then
19068 (Now testing the other method--but note that this also may fail.)
19070 $run ./try 2>/dev/null
19073 if $test -s try.out -a "X$code" = X42; then
19074 fflushall="`$cat try.out`"
19078 case "$fflushall" in
19080 Whew. Flushing explicitly all the stdio streams works.
19082 fflushall="$define"
19085 Sigh. Flushing explicitly all the stdio streams doesn't work.
19090 Cannot figure out whether flushing stdio streams explicitly works or not.
19091 I'm assuming it doesn't.
19097 "$define"|true|[yY]*)
19098 fflushall="$define"
19106 All is futile. Even fflush(stdin) clobbers input pipes!
19113 $rm -f core tryp.c tryp.core core.tryp.*
19115 *) fflushall="$undef"
19119 case "$fflushNULL$fflushall" in
19122 OK, I give up. I cannot figure out how to flush pending stdio output.
19123 We won't be flushing handles at all before fork/exec/popen.
19129 : Store the full pathname to the ar program for use in the C program
19130 : Respect a hint or command line value for full_ar.
19135 : Store the full pathname to the sed program for use in the C program
19138 : see what type gids are declared as in the kernel
19140 echo "Looking for the type for group ids returned by getgid()."
19141 set gid_t gidtype xxx stdio.h sys/types.h
19145 xxx=`./findhdr sys/user.h`
19146 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19148 unsigned) dflt="$1 $2" ;;
19152 *) dflt="$gidtype";;
19155 gid_t) echo "gid_t found." ;;
19156 *) rp="What is the type for group ids returned by getgid()?"
19162 : Check the size of GID
19165 *_t) zzz="$gidtype" ;;
19168 echo "Checking the size of $zzz..." >&4
19170 #include <sys/types.h>
19172 #$i_stdlib I_STDLIB
19174 #include <stdlib.h>
19177 printf("%d\n", (int)sizeof($gidtype));
19182 if eval $compile_ok; then
19186 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19189 echo "Your $zzz is $gidsize bytes long."
19194 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19198 : Check if GID is signed
19201 *_t) zzz="$gidtype" ;;
19204 echo "Checking the sign of $zzz..." >&4
19206 #include <sys/types.h>
19217 if eval $compile; then
19221 echo "(I can't execute the test program--guessing unsigned.)" >&4
19225 1) echo "Your $zzz is unsigned." ;;
19226 -1) echo "Your $zzz is signed." ;;
19232 echo "(I can't compile the test program--guessing unsigned.)" >&4
19236 : Check 64bit sizes
19239 if $test X"$quadtype" != X; then
19241 echo "Checking how to print 64-bit integers..." >&4
19243 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19244 $cat >try.c <<'EOCP'
19245 #include <sys/types.h>
19248 int q = 12345678901;
19249 printf("%ld\n", q);
19253 if eval $compile; then
19257 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19258 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19259 echo "We will use %d."
19265 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19266 $cat >try.c <<'EOCP'
19267 #include <sys/types.h>
19270 long q = 12345678901;
19271 printf("%ld\n", q);
19275 if eval $compile; then
19279 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19280 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19281 echo "We will use %ld."
19287 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19288 $cat >try.c <<'EOCP'
19289 #include <sys/types.h>
19290 #include <inttypes.h>
19293 int64_t q = 12345678901;
19294 printf("%" PRId64 "\n", q);
19298 if eval $compile; then
19302 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19303 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19304 echo "We will use the C9X style."
19310 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19312 #include <sys/types.h>
19315 $quadtype q = 12345678901;
19316 printf("%Ld\n", q);
19320 if eval $compile; then
19324 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19325 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19326 echo "We will use %Ld."
19332 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19333 $cat >try.c <<'EOCP'
19334 #include <sys/types.h>
19337 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19338 printf("%lld\n", q);
19342 if eval $compile; then
19346 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19347 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19348 echo "We will use the %lld style."
19354 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19356 #include <sys/types.h>
19359 $quadtype q = 12345678901;
19360 printf("%qd\n", q);
19364 if eval $compile; then
19368 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19369 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19370 echo "We will use %qd."
19376 if $test X"$sPRId64" = X; then
19377 echo "Cannot figure out how to print 64-bit integers." >&4
19384 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19385 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19387 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19388 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19392 : Check format strings for internal types
19394 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19396 if $test X"$ivsize" = X8; then
19397 ivdformat="$sPRId64"
19398 uvuformat="$sPRIu64"
19399 uvoformat="$sPRIo64"
19400 uvxformat="$sPRIx64"
19401 uvXUformat="$sPRIXU64"
19403 if $test X"$ivsize" = X"$longsize"; then
19410 if $test X"$ivsize" = X"$intsize"; then
19418 if $test X"$ivsize" = X"$shortsize"; then
19429 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19430 nveformat="$sPRIeldbl"
19431 nvfformat="$sPRIfldbl"
19432 nvgformat="$sPRIgldbl"
19433 nvEUformat="$sPRIEUldbl"
19434 nvFUformat="$sPRIFUldbl"
19435 nvGUformat="$sPRIGUldbl"
19445 case "$ivdformat" in
19446 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19451 : Check format string for GID
19454 $echo "Checking the format string to be used for gids..." >&4
19457 -1) if $test X"$gidsize" = X"$ivsize"; then
19458 gidformat="$ivdformat"
19460 if $test X"$gidsize" = X"$longsize"; then
19463 if $test X"$gidsize" = X"$intsize"; then
19466 if $test X"$gidsize" = X"$shortsize"; then
19473 *) if $test X"$gidsize" = X"$uvsize"; then
19474 gidformat="$uvuformat"
19476 if $test X"$gidsize" = X"$longsize"; then
19479 if $test X"$gidsize" = X"$intsize"; then
19482 if $test X"$gidsize" = X"$shortsize"; then
19491 : see if getgroups exists
19492 set getgroups d_getgrps
19495 : see if setgroups exists
19496 set setgroups d_setgrps
19499 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19501 case "$d_getgrps$d_setgrps" in
19503 case "$groupstype" in
19504 '') dflt="$gidtype" ;;
19505 *) dflt="$groupstype" ;;
19508 What type of pointer is the second argument to getgroups() and setgroups()?
19509 Usually this is the same as group ids, $gidtype, but not always.
19512 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19516 *) groupstype="$gidtype";;
19519 : MAD = Misc Attribute Definition
19521 if $test $patchlevel -lt 9; then
19522 : MAD is not available in 5.8.x or earlier.
19526 $define|true|[yY]*) dflt='y' ;;
19531 Would you like to build with Misc Attribute Decoration? This is development
19532 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19533 overhead on the interpreter.
19535 If this doesn't make any sense to you, just accept the default '$dflt'.
19537 rp='Build Perl with MAD?'
19542 madlyh='madly.h madly.act madly.tab'
19544 madlyobj="madly$_o" ;;
19554 echo "Checking if your $make program sets \$(MAKE)..." >&4
19555 case "$make_set_make" in
19557 $sed 's/^X //' > testmake.mak << 'EOF'
19559 X @echo 'maketemp="$(MAKE)"'
19561 case "`$make -f testmake.mak 2>/dev/null`" in
19562 *maketemp=*) make_set_make='#' ;;
19563 *) make_set_make="MAKE=$make" ;;
19565 $rm -f testmake.mak
19568 case "$make_set_make" in
19569 '#') echo "Yup, it does.";;
19570 *) echo "Nope, it doesn't.";;
19573 : see what type is used for mode_t
19574 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19575 set mode_t modetype int stdio.h sys/types.h
19578 : see if we need va_copy
19580 case "$i_stdarg" in
19583 #include <stdarg.h>
19585 #$i_stdlib I_STDLIB
19587 #include <stdlib.h>
19589 #include <signal.h>
19592 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19594 return vfprintf(f, fmt, *valp);
19598 myvfprintf(FILE *f, const char *fmt, va_list val)
19600 return ivfprintf(f, fmt, &val);
19604 myprintf(char *fmt, ...)
19607 va_start(val, fmt);
19608 return myvfprintf(stdout, fmt, val);
19612 main(int ac, char **av)
19614 signal(SIGSEGV, exit);
19616 myprintf("%s%cs all right, then\n", "that", '\'');
19621 if eval $compile && $run ./try 2>&1 >/dev/null; then
19622 case "`$run ./try`" in
19623 "that's all right, then")
19629 yes) echo "It seems that you don't need va_copy()." >&4
19630 need_va_copy="$undef"
19632 *) echo "It seems that va_copy() or similar will be needed." >&4
19633 need_va_copy="$define"
19638 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19642 : see what type is used for size_t
19643 rp="What is the type used for the length parameter for string functions?"
19644 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19647 : check for type of arguments to gethostbyaddr.
19648 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19649 case "$d_gethbyaddr" in
19653 Checking to see what type of arguments are accepted by gethostbyaddr().
19655 hdrs="$define sys/types.h
19656 $d_socket sys/socket.h
19657 $i_niin netinet/in.h
19659 $i_unistd unistd.h"
19660 : The first arg can 'char *' or 'void *'
19661 : The second arg is some of integral type
19662 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19663 for yyy in size_t long int; do
19664 case "$netdb_host_type" in
19665 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19666 if ./protochk "$try" $hdrs; then
19667 echo "Your system accepts $xxx for the first arg."
19668 echo "...and $yyy for the second arg."
19669 netdb_host_type="$xxx"
19670 netdb_hlen_type="$yyy"
19676 : In case none of those worked, prompt the user.
19677 case "$netdb_host_type" in
19678 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19681 netdb_host_type=$ans
19682 rp='What is the type for the 2nd argument to gethostbyaddr?'
19685 netdb_hlen_type=$ans
19689 *) : no gethostbyaddr, so pick harmless defaults
19690 netdb_host_type='char *'
19691 netdb_hlen_type="$sizetype"
19694 # Remove the "const" if needed. -- but then we'll have a
19696 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19699 : check for type of argument to gethostbyname.
19700 if test "X$netdb_name_type" = X ; then
19701 case "$d_gethbyname" in
19705 Checking to see what type of argument is accepted by gethostbyname().
19707 hdrs="$define sys/types.h
19708 $d_socket sys/socket.h
19709 $i_niin netinet/in.h
19711 $i_unistd unistd.h"
19712 for xxx in "const char *" "char *"; do
19713 case "$netdb_name_type" in
19714 '') try="extern struct hostent *gethostbyname($xxx);"
19715 if ./protochk "$try" $hdrs; then
19716 echo "Your system accepts $xxx."
19717 netdb_name_type="$xxx"
19722 : In case none of those worked, prompt the user.
19723 case "$netdb_name_type" in
19724 '') rp='What is the type for the 1st argument to gethostbyname?'
19727 netdb_name_type=$ans
19731 *) : no gethostbyname, so pick harmless default
19732 netdb_name_type='char *'
19737 : check for type of 1st argument to getnetbyaddr.
19738 if test "X$netdb_net_type" = X ; then
19739 case "$d_getnbyaddr" in
19743 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19745 hdrs="$define sys/types.h
19746 $d_socket sys/socket.h
19747 $i_niin netinet/in.h
19749 $i_unistd unistd.h"
19750 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19751 case "$netdb_net_type" in
19752 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19753 if ./protochk "$try" $hdrs; then
19754 echo "Your system accepts $xxx."
19755 netdb_net_type="$xxx"
19760 : In case none of those worked, prompt the user.
19761 case "$netdb_net_type" in
19762 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19765 netdb_net_type=$ans
19769 *) : no getnetbyaddr, so pick harmless default
19770 netdb_net_type='long'
19774 : locate the preferred pager for this system
19781 [a-zA-Z]:/*) dflt=$pg;;
19785 [a-zA-Z]:/*) dflt=$more;;
19789 [a-zA-Z]:/*) dflt=$less;;
19792 '') dflt=/usr/ucb/more;;
19796 : Instruct ./getfile to trust the hinted or previous pager value,
19797 : even if it does not begin with a slash. For example, on os2,
19798 : pager might be cmd /c more. See comments in UU/getfile.
19803 rp='What pager is used on your system?'
19807 : see what type pids are declared as in the kernel
19808 rp="What is the type of process ids on this system?"
19809 set pid_t pidtype int stdio.h sys/types.h
19812 : see if ar generates random libraries by itself
19814 echo "Checking how to generate random libraries on your machine..." >&4
19815 echo 'int bar1() { return bar2(); }' > bar1.c
19816 echo 'int bar2() { return 2; }' > bar2.c
19818 #$i_stdlib I_STDLIB
19820 #include <stdlib.h>
19822 int main() { printf("%d\n", bar1()); exit(0); }
19824 $cc $ccflags -c bar1.c >/dev/null 2>&1
19825 $cc $ccflags -c bar2.c >/dev/null 2>&1
19826 $cc $ccflags -c foo.c >/dev/null 2>&1
19827 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19828 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19829 $run ./foobar >/dev/null 2>&1; then
19830 echo "$ar appears to generate random libraries itself."
19832 if [ "X$ranlib" = "X" ]; then
19835 elif $ar s bar$_a >/dev/null 2>&1 &&
19836 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19837 $run ./foobar >/dev/null 2>&1; then
19838 echo "a table of contents needs to be added with '$ar s'."
19841 elif $ar ts bar$_a >/dev/null 2>&1 &&
19842 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19843 $run ./foobar >/dev/null 2>&1; then
19844 echo "a table of contents needs to be added with '$ar ts'."
19851 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19852 $test -f $ranlib || ranlib=''
19855 if $test -n "$ranlib"; then
19856 echo "your system has '$ranlib'; we'll use that."
19859 echo "your system doesn't seem to support random libraries"
19860 echo "so we'll use lorder and tsort to order the libraries."
19867 : check for type of arguments to select.
19868 case "$selecttype" in
19869 '') case "$d_select" in
19873 Checking to see what type of arguments are accepted by select().
19875 hdrs="$define sys/types.h
19876 $i_systime sys/time.h
19877 $i_sysselct sys/select.h
19878 $d_socket sys/socket.h"
19879 : The first arg can be int, unsigned, or size_t
19880 : The last arg may or may not be 'const'
19882 : void pointer has been seen but using that
19883 : breaks the selectminbits test
19884 for xxx in 'fd_set *' 'int *'; do
19885 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19886 for tmo in 'struct timeval *' 'const struct timeval *'; do
19888 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19889 if ./protochk "$try" $hdrs; then
19890 echo "Your system accepts $xxx."
19899 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19900 case "$d_fd_set" in
19901 $define) dflt="fd_set *" ;;
19910 *) : no select, so pick a harmless default
19917 : check for the select 'width'
19918 case "$selectminbits" in
19919 '') safebits=`expr $ptrsize \* 8`
19920 case "$d_select" in
19924 Checking to see on how many bits at a time your select() operates...
19927 #include <sys/types.h>
19929 #$i_systime I_SYS_TIME
19930 #$i_systimek I_SYS_TIME_KERNEL
19935 # ifdef I_SYS_TIME_KERNEL
19938 # include <sys/time.h>
19939 # ifdef I_SYS_TIME_KERNEL
19943 #$i_sysselct I_SYS_SELECT
19944 #ifdef I_SYS_SELECT
19945 #include <sys/select.h>
19947 #$d_socket HAS_SOCKET
19949 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19952 #$i_stdlib I_STDLIB
19954 #include <stdlib.h>
19957 #define S sizeof(*(b))
19959 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19960 #define NBITS (NBYTES * 8)
19962 char *s = (char *)malloc(NBYTES);
19971 fp = fopen("try.c", "r");
19977 b = ($selecttype)s;
19978 for (i = 0; i < NBITS; i++)
19982 select(fd + 1, b, 0, 0, &t);
19983 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19985 printf("%d\n", i + 1);
19990 if eval $compile_ok; then
19991 selectminbits=`$run ./try`
19992 case "$selectminbits" in
19994 Cannot figure out on how many bits at a time your select() operates.
19995 I'll play safe and guess it is $safebits bits.
19997 selectminbits=$safebits
19998 bits="$safebits bits"
20001 *) bits="$selectminbits bits" ;;
20003 echo "Your select() operates on $bits at a time." >&4
20005 rp='What is the minimum number of bits your select() operates on?'
20006 case "$byteorder" in
20007 12345678) dflt=64 ;;
20013 selectminbits="$val"
20017 *) : no select, so pick a harmless default
20018 selectminbits=$safebits
20024 : Trace out the files included by signal.h, then look for SIGxxx names.
20025 : Remove SIGARRAYSIZE used by HPUX.
20026 : Remove SIGSTKSIZE used by Linux.
20027 : Remove SIGSTKSZ used by Posix.
20028 : Remove SIGTYP void lines used by OS2.
20029 : Some cpps, like os390, dont give the file name anywhere
20030 if [ "X$fieldn" = X ]; then
20031 : Just make some guesses. We check them later.
20032 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20034 xxx=`echo '#include <signal.h>' |
20035 $cppstdin $cppminus $cppflags 2>/dev/null |
20036 $grep '^[ ]*#.*include' |
20037 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20039 : Check this list of files to be sure we have parsed the cpp output ok.
20040 : This will also avoid potentially non-existent files, such
20043 for xx in $xxx /dev/null ; do
20044 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20046 : If we have found no files, at least try signal.h
20047 case "$xxxfiles" in
20048 '') xxxfiles=`./findhdr signal.h` ;;
20051 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20052 print substr($2, 4, 20)
20054 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20055 print substr($3, 4, 20)
20057 : Append some common names just in case the awk scan failed.
20058 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20059 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20060 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20061 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20062 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20064 : generate a few handy files for later
20065 $cat > signal.c <<EOCP
20066 #include <sys/types.h>
20067 #include <signal.h>
20068 #$i_stdlib I_STDLIB
20070 #include <stdlib.h>
20075 /* Strange style to avoid deeply-nested #if/#else/#endif */
20078 # define NSIG (_NSIG)
20084 # define NSIG (SIGMAX+1)
20090 # define NSIG (SIG_MAX+1)
20096 # define NSIG (_SIG_MAX+1)
20102 # define NSIG (MAXSIG+1)
20108 # define NSIG (MAX_SIG+1)
20113 # ifdef SIGARRAYSIZE
20114 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20120 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20124 /* Default to some arbitrary number that's big enough to get most
20125 of the common signals.
20131 printf("NSIG %d\n", NSIG);
20137 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20139 printf "#ifdef SIG"; printf $1; printf "\n"
20140 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20141 printf $1; printf ");\n"
20145 printf "#endif /* JUST_NSIG */\n";
20146 printf "exit(0);\n}\n";
20149 $cat >signal.awk <<'EOP'
20150 BEGIN { ndups = 0 }
20151 $1 ~ /^NSIG$/ { nsig = $2 }
20152 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20153 if ($2 > maxsig) { maxsig = $2 }
20154 if (sig_name[$2]) {
20155 dup_name[ndups] = $1
20156 dup_num[ndups] = $2
20168 printf("NSIG %d\n", nsig);
20169 for (n = 1; n < nsig; n++) {
20171 printf("%s %d\n", sig_name[n], sig_num[n])
20174 printf("NUM%d %d\n", n, n)
20177 for (n = 0; n < ndups; n++) {
20178 printf("%s %d\n", dup_name[n], dup_num[n])
20182 $cat >signal_cmd <<EOS
20184 if $test -s signal.lst; then
20185 echo "Using your existing signal.lst file"
20190 $cat >>signal_cmd <<'EOS'
20193 if eval $compile_ok; then
20194 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
20196 echo "(I can't seem be able to compile the whole test program)" >&4
20197 echo "(I'll try it in little pieces.)" >&4
20198 set signal -DJUST_NSIG
20199 if eval $compile_ok; then
20200 $run ./signal$_exe > signal.nsg
20203 echo "I can't seem to figure out how many signals you have." >&4
20204 echo "Guessing 50." >&4
20205 echo 'NSIG 50' > signal.nsg
20207 : Now look at all the signal names, one at a time.
20208 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20209 $cat > signal.c <<EOCP
20210 #include <sys/types.h>
20211 #include <signal.h>
20214 printf("$xx %d\n", SIG${xx});
20219 if eval $compile; then
20220 echo "SIG${xx} found."
20221 $run ./signal$_exe >> signal.ls1
20223 echo "SIG${xx} NOT found."
20226 if $test -s signal.ls1; then
20227 $cat signal.nsg signal.ls1 |
20228 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20232 if $test -s signal.lst; then
20235 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20236 echo 'kill -l' >signal
20237 set X `csh -f <signal`
20241 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20243 echo $@ | $tr ' ' $trnl | \
20244 $awk '{ printf "%s %d\n", $1, ++s; }
20245 END { printf "NSIG %d\n", ++s }' >signal.lst
20247 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20249 chmod a+x signal_cmd
20250 $eunicefix signal_cmd
20252 : generate list of signal names
20254 case "$sig_name_init" in
20256 *) case "$sig_num_init" in
20257 ''|*,*) doinit=yes ;;
20262 echo "Generating a list of signal names and numbers..." >&4
20264 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20265 sig_name=`$awk 'BEGIN { printf "ZERO " }
20266 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20267 sig_num=`$awk 'BEGIN { printf "0 " }
20268 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20269 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20270 !/^NSIG/ { printf "\"%s\", ", $1 }
20271 END { printf "0\n" }' signal.lst`
20272 sig_num_init=`$awk 'BEGIN { printf "0, " }
20273 !/^NSIG/ { printf "%d, ", $2}
20274 END { printf "0\n"}' signal.lst`
20277 echo "The following $sig_count signals are available:"
20279 echo $sig_name | $awk \
20280 'BEGIN { linelen = 0 }
20282 for (i = 1; i <= NF; i++) {
20283 name = "SIG" $i " "
20284 linelen = linelen + length(name)
20285 if (linelen > 70) {
20287 linelen = length(name)
20293 sig_size=`echo $sig_name | awk '{print NF}'`
20294 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20296 : Check size of size
20298 case "$sizetype" in
20299 *_t) zzz="$sizetype" ;;
20300 *) zzz="filesize" ;;
20302 echo "Checking the size of $zzz..." >&4
20304 #include <sys/types.h>
20306 #$i_stdlib I_STDLIB
20308 #include <stdlib.h>
20311 printf("%d\n", (int)sizeof($sizetype));
20316 if eval $compile_ok; then
20320 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20323 echo "Your $zzz size is $sizesize bytes."
20328 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20332 : check for socklen_t
20334 echo "Checking to see if you have socklen_t..." >&4
20336 #include <sys/types.h>
20337 #$d_socket HAS_SOCKET
20339 #include <sys/socket.h>
20341 int main() { socklen_t x = 16; }
20344 if eval $compile; then
20346 echo "You have socklen_t."
20349 echo "You do not have socklen_t."
20350 case "$sizetype" in
20351 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20358 : see if this is a socks.h system
20359 set socks.h i_socks
20362 : check for type of the size argument to socket calls
20363 case "$d_socket" in
20367 Checking to see what type is the last argument of accept().
20370 case "$d_socklen_t" in
20371 "$define") yyy="$yyy socklen_t"
20373 yyy="$yyy $sizetype int long unsigned"
20374 for xxx in $yyy; do
20375 case "$socksizetype" in
20376 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
20377 case "$usesocks" in
20379 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20380 echo "Your system accepts '$xxx *' for the last argument of accept()."
20381 socksizetype="$xxx"
20384 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20385 echo "Your system accepts '$xxx *' for the last argument of accept()."
20386 socksizetype="$xxx"
20393 : In case none of those worked, prompt the user.
20394 case "$socksizetype" in
20395 '') rp='What is the type for socket address structure sizes?'
20402 *) : no sockets, so pick relatively harmless default
20407 : see what type is used for signed size_t
20408 set ssize_t ssizetype int stdio.h sys/types.h
20413 #$i_stdlib I_STDLIB
20415 #include <stdlib.h>
20417 #include <sys/types.h>
20418 #define Size_t $sizetype
20419 #define SSize_t $dflt
20422 if (sizeof(Size_t) == sizeof(SSize_t))
20424 else if (sizeof(Size_t) == sizeof(int))
20433 if eval $compile_ok && $run ./try > /dev/null; then
20434 ssizetype=`$run ./try`
20435 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20438 Help! I can't compile and run the ssize_t test program: please enlighten me!
20439 (This is probably a misconfiguration in your system or libraries, and
20440 you really ought to fix it. Still, I'll try anyway.)
20442 I need a type that is the same size as $sizetype, but is guaranteed to
20443 be signed. Common values are ssize_t, int and long.
20446 rp="What signed type is the same size as $sizetype?"
20452 : see what type of char stdio uses.
20454 echo '#include <stdio.h>' > stdio.c
20455 $cppstdin $cppminus < stdio.c > stdioh
20456 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20457 echo "Your stdio uses unsigned chars." >&4
20458 stdchar="unsigned char"
20460 echo "Your stdio uses signed chars." >&4
20463 $rm -f stdio.* stdioh
20465 : see what type uids are declared as in the kernel
20467 echo "Looking for the type for user ids returned by getuid()."
20468 set uid_t uidtype xxx stdio.h sys/types.h
20472 xxx=`./findhdr sys/user.h`
20473 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20475 unsigned) dflt="$1 $2" ;;
20479 *) dflt="$uidtype";;
20482 uid_t) echo "uid_t found." ;;
20483 *) rp="What is the type for user ids returned by getuid()?"
20489 : Check size of UID
20492 *_t) zzz="$uidtype" ;;
20495 echo "Checking the size of $zzz..." >&4
20497 #include <sys/types.h>
20499 #$i_stdlib I_STDLIB
20501 #include <stdlib.h>
20504 printf("%d\n", (int)sizeof($uidtype));
20509 if eval $compile_ok; then
20513 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20516 echo "Your $zzz is $uidsize bytes long."
20521 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20524 : Check if UID is signed
20527 *_t) zzz="$uidtype" ;;
20530 echo "Checking the sign of $zzz..." >&4
20532 #include <sys/types.h>
20543 if eval $compile; then
20547 echo "(I can't execute the test program--guessing unsigned.)" >&4
20551 1) echo "Your $zzz is unsigned." ;;
20552 -1) echo "Your $zzz is signed." ;;
20558 echo "(I can't compile the test program--guessing unsigned.)" >&4
20562 : Check format string for UID
20564 $echo "Checking the format string to be used for uids..." >&4
20567 -1) if $test X"$uidsize" = X"$ivsize"; then
20568 uidformat="$ivdformat"
20570 if $test X"$uidsize" = X"$longsize"; then
20573 if $test X"$uidsize" = X"$intsize"; then
20576 if $test X"$uidsize" = X"$shortsize"; then
20583 *) if $test X"$uidsize" = X"$uvsize"; then
20584 uidformat="$uvuformat"
20586 if $test X"$uidsize" = X"$longsize"; then
20589 if $test X"$uidsize" = X"$intsize"; then
20592 if $test X"$uidsize" = X"$shortsize"; then
20601 : Check if site customization support was requested
20602 case "$usesitecustomize" in
20603 $define|true|[Yy]*)
20604 usesitecustomize="$define"
20607 usesitecustomize="$undef"
20611 : determine compiler compiler
20620 if $test -f "$byacc$_exe"; then
20622 comp="byacc or $comp"
20624 if $test -f "$bison$_exe"; then
20625 comp="$comp or bison -y"
20627 rp="Which compiler compiler ($comp) shall I use?"
20636 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20642 : see if this is a assert.h system
20643 set assert.h i_assert
20646 : see if this is a fp.h system
20650 : see if this is a fp_class.h system
20651 set fp_class.h i_fp_class
20654 : see if gdbm.h is available
20659 : see if gdbm_open exists
20660 set gdbm_open d_gdbm_open
20662 case "$d_gdbm_open" in
20665 echo "We won't be including <gdbm.h>"
20674 : see if this is a ieeefp.h system
20675 case "$i_ieeefp" in
20676 '' ) set ieeefp.h i_ieeefp
20681 : see if this is a libutil.h system
20682 set libutil.h i_libutil
20685 : see if mach cthreads are available
20686 if test "X$usethreads" = "X$define"; then
20687 set mach/cthreads.h i_machcthr
20690 i_machcthr="$undef"
20693 : see if this is a mntent.h system
20694 set mntent.h i_mntent
20697 : see if ndbm.h is available
20703 # Some Linux distributions such as RedHat 7.1 put the
20704 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20705 if $test -f /usr/include/gdbm/ndbm.h; then
20706 echo '<gdbm/ndbm.h> found.'
20707 ccflags="$ccflags -I/usr/include/gdbm"
20708 cppflags="$cppflags -I/usr/include/gdbm"
20716 : see if dbm_open exists
20717 set dbm_open d_dbm_open
20719 case "$d_dbm_open" in
20722 echo "We won't be including <ndbm.h>"
20731 : see if net/errno.h is available
20733 set net/errno.h val
20736 : Unfortunately, it causes problems on some systems. Arrgh.
20739 cat > try.c <<'EOM'
20742 #include <net/errno.h>
20748 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20749 echo "We'll be including <net/errno.h>." >&4
20751 echo "We won't be including <net/errno.h>." >&4
20760 : see if netinet/tcp.h is available
20761 set netinet/tcp.h i_netinettcp
20764 : see if this is a poll.h system
20768 : see if this is a prot.h system
20772 : Preprocessor symbols
20774 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20775 $cat <<'EOSH' > Cppsym.know
20776 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20777 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20778 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20779 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20780 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20781 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20782 bull c cadmus clipper CMU COFF COMPILER_VERSION
20783 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20784 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20785 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20786 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20788 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20789 H3050R H3050RX hbullx20 hcx host_mips
20790 hp200 hp300 hp700 HP700 hp800 hp9000
20791 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20792 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20793 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20794 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20795 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20796 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20797 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20798 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20799 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20800 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20801 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20802 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20803 MATH_HAS_NO_SIDE_EFFECTS
20804 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20805 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20806 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20807 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20808 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20809 NetBSD news1500 news1700 news1800 news1900 news3700
20810 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20811 ns32016 ns32332 ns32k nsc32000
20812 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20813 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20814 pc532 pdp11 PGC PIC plexus PORTAR posix
20815 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20816 POSIX_C_SOURCE POSIX_SOURCE POWER
20817 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
20818 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20819 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20820 sony sony_news sonyrisc sparc sparclite spectrum
20821 stardent stdc STDC_EXT stratos sun sun3 sun386
20822 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20823 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20824 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20825 sysV68 sysV88 Tek4132 Tek4300 titan
20826 TM3200 TM5400 TM5600
20827 tower tower32 tower32_200 tower32_600 tower32_700
20828 tower32_800 tower32_850 tss
20829 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20830 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20831 unix UNIX95 UNIX99 unixpc unos
20832 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20833 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20834 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20836 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20837 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20838 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20841 # Maybe put other stuff here too.
20842 cat <<EOSH >>Cppsym.know
20845 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20846 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20847 $cat Cppsym.know > Cppsym.c
20848 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20849 $rm -f Cppsym.a Cppsym.b Cppsym.c
20850 cat <<EOSH > Cppsym
20852 if $test \$# -gt 0; then
20853 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20854 if $test -s Cppsym.got; then
20861 $tr " " "$trnl" | ./Cppsym.try
20867 cat <<EOSH > Cppsym.try
20869 cat <<'EOCP' > try.c
20872 #define STRINGIFY(a) "a"
20874 #if cpp_stuff == 42
20875 #define StGiFy(a) #a
20876 #define STRINGIFY(a) StGiFy(a)
20878 #if $cpp_stuff != 1 && $cpp_stuff != 42
20879 # include "Bletch: How does this C preprocessor stringify macros?"
20885 cat <<'EOSH' >> Cppsym.try
20887 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20888 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20889 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20890 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
20892 echo 'return 0;}' >> try.c
20894 cat <<EOSH >> Cppsym.try
20896 case "$osname-$gccversion" in
20897 irix-) ccflags="\$ccflags -woff 1178" ;;
20898 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20900 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
20902 chmod +x Cppsym.try
20903 $eunicefix Cppsym.try
20904 ./Cppsym < Cppsym.know > Cppsym.true
20905 : Add in any linux cpp "predefined macros":
20906 case "$osname::$gccversion" in
20909 rm -f $tHdrH'.h' $tHdrH
20911 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
20912 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
20913 if [ -s $tHdrH'_cppsym.real' ]; then
20914 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
20917 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
20920 : now check the C compiler for additional symbols
20921 postprocess_cc_v=''
20923 aix) postprocess_cc_v="|$tr , ' '" ;;
20930 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20933 -D*) echo "\$i" | $sed 's/^-D//';;
20934 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20939 postprocess_cc_v=''
20942 ./ccsym > ccsym1.raw
20943 if $test -s ccsym1.raw; then
20944 $sort ccsym1.raw | $uniq >ccsym.raw
20946 mv ccsym1.raw ccsym.raw
20949 $awk '/\=/ { print $0; next }
20950 { print $0"=1" }' ccsym.raw >ccsym.list
20951 $comm -13 Cppsym.true ccsym.list >ccsym.own
20952 $comm -12 Cppsym.true ccsym.list >ccsym.com
20953 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
20955 if $test -z ccsym.raw; then
20956 echo "Your C compiler doesn't seem to define any symbols!" >&4
20958 echo "However, your C preprocessor defines the following symbols:"
20961 cppsymbols=`$cat Cppsym.true`
20962 cppsymbols=`echo $cppsymbols`
20963 cppccsymbols="$cppsymbols"
20965 if $test -s ccsym.com; then
20966 echo "Your C compiler and pre-processor define these symbols:"
20967 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20970 cppccsymbols=`$cat ccsym.com`
20971 cppccsymbols=`echo $cppccsymbols`
20972 $test "$silent" || sleep 1
20974 if $test -s ccsym.cpp; then
20975 $test "$also" && echo " "
20976 echo "Your C pre-processor ${also}defines the following symbols:"
20977 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20979 cppsymbols=`$cat ccsym.cpp`
20980 cppsymbols=`echo $cppsymbols`
20981 $test "$silent" || sleep 1
20983 if $test -s ccsym.own; then
20984 $test "$also" && echo " "
20985 echo "Your C compiler ${also}defines the following cpp symbols:"
20986 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20987 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20988 ccsymbols=`$cat ccsym.own`
20989 ccsymbols=`echo $ccsymbols`
20990 $test "$silent" || sleep 1
20994 : see if this is a termio system
20998 if $test `./findhdr termios.h`; then
20999 set tcsetattr i_termios
21005 "$define") echo "You have POSIX termios.h... good!" >&4;;
21006 *) if ./Cppsym pyr; then
21007 case "`/bin/universe`" in
21008 ucb) if $test `./findhdr sgtty.h`; then
21010 echo "<sgtty.h> found." >&4
21012 echo "System is pyramid with BSD universe."
21013 echo "<sgtty.h> not found--you could have problems." >&4
21015 *) if $test `./findhdr termio.h`; then
21017 echo "<termio.h> found." >&4
21019 echo "System is pyramid with USG universe."
21020 echo "<termio.h> not found--you could have problems." >&4
21024 if $test `./findhdr termio.h`; then
21025 echo "<termio.h> found." >&4
21027 elif $test `./findhdr sgtty.h`; then
21028 echo "<sgtty.h> found." >&4
21031 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
21034 if $test `./findhdr sgtty.h`; then
21035 echo "<sgtty.h> found." >&4
21037 elif $test `./findhdr termio.h`; then
21038 echo "<termio.h> found." >&4
21041 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
21045 set i_termio; eval $setvar
21046 val=$val2; set i_sgtty; eval $setvar
21047 val=$val3; set i_termios; eval $setvar
21049 : see if stddef is available
21050 set stddef.h i_stddef
21053 : see if sys/access.h is available
21054 set sys/access.h i_sysaccess
21057 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
21058 set sys/filio.h i_sysfilio
21061 if $test `./findhdr sys/ioctl.h`; then
21063 echo '<sys/ioctl.h> found.' >&4
21066 if $test $i_sysfilio = "$define"; then
21067 echo '<sys/ioctl.h> NOT found.' >&4
21069 $test $i_sgtty = "$define" && xxx="sgtty.h"
21070 $test $i_termio = "$define" && xxx="termio.h"
21071 $test $i_termios = "$define" && xxx="termios.h"
21072 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
21078 : see if socket ioctl defs are in sys/sockio.h
21080 xxx=`./findhdr sys/sockio.h`
21081 if $test "$xxx"; then
21082 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
21084 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
21087 echo "No socket ioctls found in <sys/sockio.h>." >&4
21092 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
21098 : see if this is a syslog.h system
21099 set syslog.h i_syslog
21102 : see if this is a sys/mode.h system
21103 set sys/mode.h i_sysmode
21106 : see if sys/resource.h has to be included
21107 set sys/resource.h i_sysresrc
21110 : see if sys/security.h is available
21111 set sys/security.h i_syssecrt
21114 : see if this is a sys/statvfs.h system
21115 set sys/statvfs.h i_sysstatvfs
21118 : see if this is a sys/un.h system
21119 set sys/un.h i_sysun
21122 : see if this is a sys/utsname.h system
21123 set sys/utsname.h i_sysutsname
21126 : see if this is a syswait system
21127 set sys/wait.h i_syswait
21130 : see if this is a ustat.h system
21131 set ustat.h i_ustat
21134 : see if this is an utime system
21135 set utime.h i_utime
21138 : see if this is a values.h system
21139 set values.h i_values
21142 : see if this is a vfork system
21145 set vfork.h i_vfork
21155 echo "Looking for extensions..." >&4
21156 : If we are using the old config.sh, known_extensions may contain
21157 : old or inaccurate or duplicate values.
21158 known_extensions=''
21159 nonxs_extensions=''
21160 : We do not use find because it might not be available.
21161 : We do not just use MANIFEST because the user may have dropped
21162 : some additional extensions into the source tree and expect them
21165 : Function to recursively find available extensions, ignoring DynaLoader
21166 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21170 DynaLoader|dynaload) ;;
21172 if $test -f $xxx/$xxx.xs -o -f $xxx/$xxx.c; then
21173 known_extensions="$known_extensions $1$xxx";
21174 elif $test -f $xxx/Makefile.PL; then
21175 nonxs_extensions="$nonxs_extensions $1$xxx";
21177 if $test -d $xxx -a $# -lt 10; then
21180 eval $find_extensions;
21192 eval $find_extensions
21193 # Special case: Add in modules that nest beyond the first level.
21194 # Currently threads/shared and Hash/Util/FieldHash, since they are
21195 # not picked up by the recursive find above (and adding in general
21196 # recursive finding breaks SDBM_File/sdbm).
21197 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
21198 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
21199 set X $known_extensions
21201 known_extensions="$*"
21202 set X $nonxs_extensions
21204 nonxs_extensions="$*"
21207 : Now see which are supported on this system.
21209 for xxx in $known_extensions ; do
21213 $define) avail_ext="$avail_ext $xxx" ;;
21216 GDBM_File|gdbm_fil)
21218 $define) avail_ext="$avail_ext $xxx" ;;
21221 I18N/Langinfo|i18n_lan)
21222 case "$i_langinfo$d_nl_langinfo" in
21223 $define$define) avail_ext="$avail_ext $xxx" ;;
21227 : XXX Do we need a useipcsysv variable here
21228 case "${d_msg}${d_sem}${d_shm}" in
21229 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21232 NDBM_File|ndbm_fil)
21235 case "$osname-$use64bitint" in
21238 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21241 *) avail_ext="$avail_ext $xxx" ;;
21246 ODBM_File|odbm_fil)
21247 case "${i_dbm}${i_rpcsvcdbm}" in
21249 case "$d_cplusplus" in
21250 define) ;; # delete as a function name will not work
21251 *) case "$osname-$use64bitint" in
21254 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21257 *) avail_ext="$avail_ext $xxx" ;;
21265 case "$useopcode" in
21266 true|define|y) avail_ext="$avail_ext $xxx" ;;
21270 case "$useposix" in
21271 true|define|y) avail_ext="$avail_ext $xxx" ;;
21275 case "$d_socket" in
21278 beos) ;; # not unless BONE
21279 *) avail_ext="$avail_ext $xxx" ;;
21284 Sys/Syslog|sys/syslog)
21285 : XXX syslog requires socket
21286 case "$d_socket" in
21287 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21291 case "$usethreads" in
21293 case "$use5005threads" in
21294 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
21298 threads|threads/shared)
21299 # threads and threads::shared are special cases.
21300 # To stop people from asking "Perl 5.8.0 was supposed
21301 # to have this new fancy threads implementation but my
21302 # perl doesn't have it" and from people trying to
21303 # (re)install the threads module using CPAN.pm and
21304 # CPAN.pm then offering to reinstall Perl 5.8.0,
21305 # the threads.pm and threads/shared.pm will always be
21306 # there, croaking informatively ("you need to rebuild
21307 # all of Perl with threads, sorry") when threads haven't
21308 # been compiled in.
21310 avail_ext="$avail_ext $xxx"
21314 cygwin) avail_ext="$avail_ext $xxx" ;;
21317 XS/APItest|xs/apitest)
21318 # This is just for testing. Skip it unless we have dynamic loading.
21321 $define) avail_ext="$avail_ext $xxx" ;;
21324 XS/Typemap|xs/typemap)
21325 # This is just for testing. Skip it unless we have dynamic loading.
21327 $define) avail_ext="$avail_ext $xxx" ;;
21330 *) avail_ext="$avail_ext $xxx"
21339 case "$onlyextensions" in
21341 *) keepextensions=''
21342 echo "You have requested that only certains extensions be included..." >&4
21343 for i in $onlyextensions; do
21344 case " $avail_ext " in
21346 echo "Keeping extension $i."
21347 keepextensions="$keepextensions $i"
21349 *) echo "Ignoring extension $i." ;;
21352 avail_ext="$keepextensions"
21356 case "$noextensions" in
21358 *) keepextensions=''
21359 echo "You have requested that certain extensions be ignored..." >&4
21360 for i in $avail_ext; do
21361 case " $noextensions " in
21362 *" $i "*) echo "Ignoring extension $i." ;;
21363 *) echo "Keeping extension $i.";
21364 keepextensions="$keepextensions $i"
21368 avail_ext="$keepextensions"
21372 : Now see which nonxs extensions are supported on this system.
21373 : For now assume all are.
21375 for xxx in $nonxs_extensions ; do
21377 *) nonxs_ext="$nonxs_ext $xxx"
21389 A number of extensions are supplied with $package. You may choose to
21390 compile these extensions for dynamic loading (the default), compile
21391 them into the $package executable (static loading), or not include
21392 them at all. Answer "none" to include no extensions.
21393 Note that DynaLoader is always built and need not be mentioned here.
21396 case "$dynamic_ext" in
21398 : Exclude those listed in static_ext
21400 for xxx in $avail_ext; do
21401 case " $static_ext " in
21403 *) dflt="$dflt $xxx" ;;
21410 *) dflt="$dynamic_ext"
21411 # Perhaps we are reusing an old out-of-date config.sh.
21414 if test X"$dynamic_ext" != X"$avail_ext"; then
21416 NOTICE: Your previous config.sh list may be incorrect.
21417 The extensions now available to you are
21419 but the default list from your previous config.sh is
21431 rp="What extensions do you wish to load dynamically?"
21434 none) dynamic_ext=' ' ;;
21435 *) dynamic_ext="$ans" ;;
21438 case "$static_ext" in
21440 : Exclude those already listed in dynamic linking
21442 for xxx in $avail_ext; do
21443 case " $dynamic_ext " in
21445 *) dflt="$dflt $xxx" ;;
21452 *) dflt="$static_ext"
21459 rp="What extensions do you wish to load statically?"
21462 none) static_ext=' ' ;;
21463 *) static_ext="$ans" ;;
21468 A number of extensions are supplied with $package. Answer "none"
21469 to include no extensions.
21470 Note that DynaLoader is always built and need not be mentioned here.
21473 case "$static_ext" in
21474 '') dflt="$avail_ext" ;;
21475 *) dflt="$static_ext"
21476 # Perhaps we are reusing an old out-of-date config.sh.
21479 if test X"$static_ext" != X"$avail_ext"; then
21481 NOTICE: Your previous config.sh list may be incorrect.
21482 The extensions now available to you are
21484 but the default list from your previous config.sh is
21493 : Exclude those that are not xs extensions
21497 rp="What extensions do you wish to include?"
21500 none) static_ext=' ' ;;
21501 *) static_ext="$ans" ;;
21506 # Encode is a special case. If we are building Encode as a static
21507 # extension, we need to explicitly list its subextensions as well.
21508 # For other nested extensions, this is handled automatically by
21509 # the appropriate Makefile.PL.
21510 case " $static_ext " in
21511 *" Encode "*) # Add the subextensions of Encode
21513 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21514 static_ext="$static_ext Encode/$xxx"
21520 set X $dynamic_ext $static_ext $nonxs_ext
21524 # Sanity check: We require an extension suitable for use with
21525 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21526 # should show up as failures in the test suite, but it's helpful to
21527 # catch them now.) The 'extensions' list is normally sorted
21528 # alphabetically, so we need to accept either
21529 # DB_File ... Fcntl ... IO ....
21530 # or something like
21531 # Fcntl ... NDBM_File ... IO ....
21532 case " $extensions" in
21533 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21534 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21535 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21536 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21537 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21541 : Remove libraries needed only for extensions
21542 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21543 : The exception is SunOS 4.x, which needs them.
21544 case "${osname}X${osvers}" in
21548 *) case "$usedl" in
21549 $define|true|[yY]*)
21550 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21554 *) perllibs="$libs"
21560 : Remove build directory name from cppstdin so it can be used from
21561 : either the present location or the final installed location.
21563 : Get out of the UU directory to get correct path name.
21565 case "$cppstdin" in
21567 echo "Stripping down cppstdin path name"
21573 : end of configuration questions
21575 echo "End of configuration questions."
21578 : back to where it started
21579 if test -d ../UU; then
21583 : configuration may be patched via a 'config.arch' file
21584 if $test -f config.arch; then
21585 echo "I see a config.arch file, loading it."
21589 : configuration may be patched via a 'config.over' file
21590 if $test -f config.over; then
21593 rp='I see a config.over file. Do you wish to load it?'
21596 n*) echo "OK, I'll ignore it.";;
21598 echo "Configuration override changes have been loaded."
21603 : in case they want portability, strip down executable paths
21604 case "$d_portable" in
21607 echo "Stripping down executable paths..." >&4
21608 for file in $loclist $trylist; do
21610 eval $file=`basename $temp`
21615 : create config.sh file
21617 echo "Creating config.sh..." >&4
21618 $spitshell <<EOT >config.sh
21621 # This file was produced by running the Configure script. It holds all the
21622 # definitions figured out by Configure. Should you modify one of these values,
21623 # do not forget to propagate your changes by running "Configure -der". You may
21624 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21627 # Package name : $package
21628 # Source directory : $src
21629 # Configuration time: $cf_time
21630 # Configured by : $cf_by
21631 # Target system : $myuname
21641 Revision='$Revision'
21649 alignbytes='$alignbytes'
21650 ansi2knr='$ansi2knr'
21651 aphostname='$aphostname'
21652 api_revision='$api_revision'
21653 api_subversion='$api_subversion'
21654 api_version='$api_version'
21655 api_versionstring='$api_versionstring'
21658 archlibexp='$archlibexp'
21659 archname64='$archname64'
21660 archname='$archname'
21661 archobjs='$archobjs'
21662 asctime_r_proto='$asctime_r_proto'
21670 byteorder='$byteorder'
21672 castflags='$castflags'
21675 cccdlflags='$cccdlflags'
21676 ccdlflags='$ccdlflags'
21678 ccflags_uselargefiles='$ccflags_uselargefiles'
21680 ccsymbols='$ccsymbols'
21681 ccversion='$ccversion'
21683 cf_email='$cf_email'
21688 clocktype='$clocktype'
21690 compress='$compress'
21691 contains='$contains'
21695 cpp_stuff='$cpp_stuff'
21696 cppccsymbols='$cppccsymbols'
21697 cppflags='$cppflags'
21699 cppminus='$cppminus'
21701 cppstdin='$cppstdin'
21702 cppsymbols='$cppsymbols'
21703 crypt_r_proto='$crypt_r_proto'
21704 cryptlib='$cryptlib'
21706 ctermid_r_proto='$ctermid_r_proto'
21707 ctime_r_proto='$ctime_r_proto'
21708 d_Gconvert='$d_Gconvert'
21709 d_PRIEUldbl='$d_PRIEUldbl'
21710 d_PRIFUldbl='$d_PRIFUldbl'
21711 d_PRIGUldbl='$d_PRIGUldbl'
21712 d_PRIXU64='$d_PRIXU64'
21713 d_PRId64='$d_PRId64'
21714 d_PRIeldbl='$d_PRIeldbl'
21715 d_PRIfldbl='$d_PRIfldbl'
21716 d_PRIgldbl='$d_PRIgldbl'
21717 d_PRIi64='$d_PRIi64'
21718 d_PRIo64='$d_PRIo64'
21719 d_PRIu64='$d_PRIu64'
21720 d_PRIx64='$d_PRIx64'
21721 d_SCNfldbl='$d_SCNfldbl'
21722 d__fwalk='$d__fwalk'
21723 d_access='$d_access'
21724 d_accessx='$d_accessx'
21727 d_archlib='$d_archlib'
21728 d_asctime_r='$d_asctime_r'
21731 d_attribute_format='$d_attribute_format'
21732 d_attribute_malloc='$d_attribute_malloc'
21733 d_attribute_nonnull='$d_attribute_nonnull'
21734 d_attribute_noreturn='$d_attribute_noreturn'
21735 d_attribute_pure='$d_attribute_pure'
21736 d_attribute_unused='$d_attribute_unused'
21737 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21741 d_bsdgetpgrp='$d_bsdgetpgrp'
21742 d_bsdsetpgrp='$d_bsdsetpgrp'
21743 d_builtin_choose_expr='$d_builtin_choose_expr'
21744 d_builtin_expect='$d_builtin_expect'
21746 d_c99_variadic_macros='$d_c99_variadic_macros'
21747 d_casti32='$d_casti32'
21748 d_castneg='$d_castneg'
21749 d_charvspr='$d_charvspr'
21751 d_chroot='$d_chroot'
21752 d_chsize='$d_chsize'
21754 d_clearenv='$d_clearenv'
21755 d_closedir='$d_closedir'
21756 d_cmsghdr_s='$d_cmsghdr_s'
21758 d_copysignl='$d_copysignl'
21759 d_cplusplus='$d_cplusplus'
21761 d_crypt_r='$d_crypt_r'
21763 d_ctermid='$d_ctermid'
21764 d_ctermid_r='$d_ctermid_r'
21765 d_ctime_r='$d_ctime_r'
21766 d_cuserid='$d_cuserid'
21767 d_dbl_dig='$d_dbl_dig'
21768 d_dbminitproto='$d_dbminitproto'
21769 d_difftime='$d_difftime'
21770 d_dir_dd_fd='$d_dir_dd_fd'
21772 d_dirnamlen='$d_dirnamlen'
21773 d_dlerror='$d_dlerror'
21774 d_dlopen='$d_dlopen'
21775 d_dlsymun='$d_dlsymun'
21776 d_dosuid='$d_dosuid'
21777 d_drand48_r='$d_drand48_r'
21778 d_drand48proto='$d_drand48proto'
21780 d_eaccess='$d_eaccess'
21781 d_endgrent='$d_endgrent'
21782 d_endgrent_r='$d_endgrent_r'
21783 d_endhent='$d_endhent'
21784 d_endhostent_r='$d_endhostent_r'
21785 d_endnent='$d_endnent'
21786 d_endnetent_r='$d_endnetent_r'
21787 d_endpent='$d_endpent'
21788 d_endprotoent_r='$d_endprotoent_r'
21789 d_endpwent='$d_endpwent'
21790 d_endpwent_r='$d_endpwent_r'
21791 d_endsent='$d_endsent'
21792 d_endservent_r='$d_endservent_r'
21793 d_eofnblk='$d_eofnblk'
21794 d_eunice='$d_eunice'
21795 d_faststdio='$d_faststdio'
21796 d_fchdir='$d_fchdir'
21797 d_fchmod='$d_fchmod'
21798 d_fchown='$d_fchown'
21800 d_fcntl_can_lock='$d_fcntl_can_lock'
21801 d_fd_macros='$d_fd_macros'
21802 d_fd_set='$d_fd_set'
21803 d_fds_bits='$d_fds_bits'
21804 d_fgetpos='$d_fgetpos'
21805 d_finite='$d_finite'
21806 d_finitel='$d_finitel'
21807 d_flexfnam='$d_flexfnam'
21809 d_flockproto='$d_flockproto'
21811 d_fp_class='$d_fp_class'
21812 d_fpathconf='$d_fpathconf'
21813 d_fpclass='$d_fpclass'
21814 d_fpclassify='$d_fpclassify'
21815 d_fpclassl='$d_fpclassl'
21816 d_fpos64_t='$d_fpos64_t'
21817 d_frexpl='$d_frexpl'
21818 d_fs_data_s='$d_fs_data_s'
21819 d_fseeko='$d_fseeko'
21820 d_fsetpos='$d_fsetpos'
21821 d_fstatfs='$d_fstatfs'
21822 d_fstatvfs='$d_fstatvfs'
21824 d_ftello='$d_ftello'
21826 d_futimes='$d_futimes'
21827 d_getcwd='$d_getcwd'
21828 d_getespwnam='$d_getespwnam'
21829 d_getfsstat='$d_getfsstat'
21830 d_getgrent='$d_getgrent'
21831 d_getgrent_r='$d_getgrent_r'
21832 d_getgrgid_r='$d_getgrgid_r'
21833 d_getgrnam_r='$d_getgrnam_r'
21834 d_getgrps='$d_getgrps'
21835 d_gethbyaddr='$d_gethbyaddr'
21836 d_gethbyname='$d_gethbyname'
21837 d_gethent='$d_gethent'
21838 d_gethname='$d_gethname'
21839 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21840 d_gethostbyname_r='$d_gethostbyname_r'
21841 d_gethostent_r='$d_gethostent_r'
21842 d_gethostprotos='$d_gethostprotos'
21843 d_getitimer='$d_getitimer'
21844 d_getlogin='$d_getlogin'
21845 d_getlogin_r='$d_getlogin_r'
21846 d_getmnt='$d_getmnt'
21847 d_getmntent='$d_getmntent'
21848 d_getnbyaddr='$d_getnbyaddr'
21849 d_getnbyname='$d_getnbyname'
21850 d_getnent='$d_getnent'
21851 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21852 d_getnetbyname_r='$d_getnetbyname_r'
21853 d_getnetent_r='$d_getnetent_r'
21854 d_getnetprotos='$d_getnetprotos'
21855 d_getpagsz='$d_getpagsz'
21856 d_getpbyname='$d_getpbyname'
21857 d_getpbynumber='$d_getpbynumber'
21858 d_getpent='$d_getpent'
21859 d_getpgid='$d_getpgid'
21860 d_getpgrp2='$d_getpgrp2'
21861 d_getpgrp='$d_getpgrp'
21862 d_getppid='$d_getppid'
21863 d_getprior='$d_getprior'
21864 d_getprotobyname_r='$d_getprotobyname_r'
21865 d_getprotobynumber_r='$d_getprotobynumber_r'
21866 d_getprotoent_r='$d_getprotoent_r'
21867 d_getprotoprotos='$d_getprotoprotos'
21868 d_getprpwnam='$d_getprpwnam'
21869 d_getpwent='$d_getpwent'
21870 d_getpwent_r='$d_getpwent_r'
21871 d_getpwnam_r='$d_getpwnam_r'
21872 d_getpwuid_r='$d_getpwuid_r'
21873 d_getsbyname='$d_getsbyname'
21874 d_getsbyport='$d_getsbyport'
21875 d_getsent='$d_getsent'
21876 d_getservbyname_r='$d_getservbyname_r'
21877 d_getservbyport_r='$d_getservbyport_r'
21878 d_getservent_r='$d_getservent_r'
21879 d_getservprotos='$d_getservprotos'
21880 d_getspnam='$d_getspnam'
21881 d_getspnam_r='$d_getspnam_r'
21882 d_gettimeod='$d_gettimeod'
21883 d_gmtime_r='$d_gmtime_r'
21884 d_gnulibc='$d_gnulibc'
21885 d_grpasswd='$d_grpasswd'
21886 d_hasmntopt='$d_hasmntopt'
21888 d_ilogbl='$d_ilogbl'
21889 d_inc_version_list='$d_inc_version_list'
21891 d_inetaton='$d_inetaton'
21892 d_int64_t='$d_int64_t'
21893 d_isascii='$d_isascii'
21894 d_isfinite='$d_isfinite'
21897 d_isnanl='$d_isnanl'
21898 d_killpg='$d_killpg'
21899 d_lchown='$d_lchown'
21900 d_ldbl_dig='$d_ldbl_dig'
21901 d_libm_lib_version='$d_libm_lib_version'
21903 d_localtime_r='$d_localtime_r'
21904 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
21905 d_locconv='$d_locconv'
21907 d_longdbl='$d_longdbl'
21908 d_longlong='$d_longlong'
21909 d_lseekproto='$d_lseekproto'
21911 d_madvise='$d_madvise'
21912 d_malloc_good_size='$d_malloc_good_size'
21913 d_malloc_size='$d_malloc_size'
21915 d_mbstowcs='$d_mbstowcs'
21916 d_mbtowc='$d_mbtowc'
21917 d_memchr='$d_memchr'
21918 d_memcmp='$d_memcmp'
21919 d_memcpy='$d_memcpy'
21920 d_memmove='$d_memmove'
21921 d_memset='$d_memset'
21923 d_mkdtemp='$d_mkdtemp'
21924 d_mkfifo='$d_mkfifo'
21925 d_mkstemp='$d_mkstemp'
21926 d_mkstemps='$d_mkstemps'
21927 d_mktime='$d_mktime'
21930 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21931 d_modflproto='$d_modflproto'
21932 d_mprotect='$d_mprotect'
21934 d_msg_ctrunc='$d_msg_ctrunc'
21935 d_msg_dontroute='$d_msg_dontroute'
21936 d_msg_oob='$d_msg_oob'
21937 d_msg_peek='$d_msg_peek'
21938 d_msg_proxy='$d_msg_proxy'
21939 d_msgctl='$d_msgctl'
21940 d_msgget='$d_msgget'
21941 d_msghdr_s='$d_msghdr_s'
21942 d_msgrcv='$d_msgrcv'
21943 d_msgsnd='$d_msgsnd'
21945 d_munmap='$d_munmap'
21946 d_mymalloc='$d_mymalloc'
21948 d_nl_langinfo='$d_nl_langinfo'
21949 d_nv_preserves_uv='$d_nv_preserves_uv'
21950 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21951 d_off64_t='$d_off64_t'
21952 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21953 d_oldpthreads='$d_oldpthreads'
21954 d_oldsock='$d_oldsock'
21956 d_pathconf='$d_pathconf'
21958 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21959 d_phostname='$d_phostname'
21962 d_portable='$d_portable'
21963 d_printf_format_null='$d_printf_format_null'
21964 d_procselfexe='$d_procselfexe'
21965 d_pseudofork='$d_pseudofork'
21966 d_pthread_atfork='$d_pthread_atfork'
21967 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21968 d_pthread_yield='$d_pthread_yield'
21970 d_pwchange='$d_pwchange'
21971 d_pwclass='$d_pwclass'
21972 d_pwcomment='$d_pwcomment'
21973 d_pwexpire='$d_pwexpire'
21974 d_pwgecos='$d_pwgecos'
21975 d_pwpasswd='$d_pwpasswd'
21976 d_pwquota='$d_pwquota'
21979 d_random_r='$d_random_r'
21980 d_readdir64_r='$d_readdir64_r'
21981 d_readdir='$d_readdir'
21982 d_readdir_r='$d_readdir_r'
21983 d_readlink='$d_readlink'
21985 d_recvmsg='$d_recvmsg'
21986 d_rename='$d_rename'
21987 d_rewinddir='$d_rewinddir'
21989 d_safebcpy='$d_safebcpy'
21990 d_safemcpy='$d_safemcpy'
21991 d_sanemcmp='$d_sanemcmp'
21992 d_sbrkproto='$d_sbrkproto'
21993 d_scalbnl='$d_scalbnl'
21994 d_sched_yield='$d_sched_yield'
21995 d_scm_rights='$d_scm_rights'
21996 d_seekdir='$d_seekdir'
21997 d_select='$d_select'
21999 d_semctl='$d_semctl'
22000 d_semctl_semid_ds='$d_semctl_semid_ds'
22001 d_semctl_semun='$d_semctl_semun'
22002 d_semget='$d_semget'
22004 d_sendmsg='$d_sendmsg'
22005 d_setegid='$d_setegid'
22006 d_seteuid='$d_seteuid'
22007 d_setgrent='$d_setgrent'
22008 d_setgrent_r='$d_setgrent_r'
22009 d_setgrps='$d_setgrps'
22010 d_sethent='$d_sethent'
22011 d_sethostent_r='$d_sethostent_r'
22012 d_setitimer='$d_setitimer'
22013 d_setlinebuf='$d_setlinebuf'
22014 d_setlocale='$d_setlocale'
22015 d_setlocale_r='$d_setlocale_r'
22016 d_setnent='$d_setnent'
22017 d_setnetent_r='$d_setnetent_r'
22018 d_setpent='$d_setpent'
22019 d_setpgid='$d_setpgid'
22020 d_setpgrp2='$d_setpgrp2'
22021 d_setpgrp='$d_setpgrp'
22022 d_setprior='$d_setprior'
22023 d_setproctitle='$d_setproctitle'
22024 d_setprotoent_r='$d_setprotoent_r'
22025 d_setpwent='$d_setpwent'
22026 d_setpwent_r='$d_setpwent_r'
22027 d_setregid='$d_setregid'
22028 d_setresgid='$d_setresgid'
22029 d_setresuid='$d_setresuid'
22030 d_setreuid='$d_setreuid'
22031 d_setrgid='$d_setrgid'
22032 d_setruid='$d_setruid'
22033 d_setsent='$d_setsent'
22034 d_setservent_r='$d_setservent_r'
22035 d_setsid='$d_setsid'
22036 d_setvbuf='$d_setvbuf'
22040 d_shmatprototype='$d_shmatprototype'
22041 d_shmctl='$d_shmctl'
22043 d_shmget='$d_shmget'
22044 d_sigaction='$d_sigaction'
22045 d_signbit='$d_signbit'
22046 d_sigprocmask='$d_sigprocmask'
22047 d_sigsetjmp='$d_sigsetjmp'
22048 d_sitearch='$d_sitearch'
22049 d_snprintf='$d_snprintf'
22050 d_sockatmark='$d_sockatmark'
22051 d_sockatmarkproto='$d_sockatmarkproto'
22052 d_socket='$d_socket'
22053 d_socklen_t='$d_socklen_t'
22054 d_sockpair='$d_sockpair'
22055 d_socks5_init='$d_socks5_init'
22056 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
22058 d_srand48_r='$d_srand48_r'
22059 d_srandom_r='$d_srandom_r'
22060 d_sresgproto='$d_sresgproto'
22061 d_sresuproto='$d_sresuproto'
22062 d_statblks='$d_statblks'
22063 d_statfs_f_flags='$d_statfs_f_flags'
22064 d_statfs_s='$d_statfs_s'
22065 d_statvfs='$d_statvfs'
22066 d_stdio_cnt_lval='$d_stdio_cnt_lval'
22067 d_stdio_ptr_lval='$d_stdio_ptr_lval'
22068 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
22069 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
22070 d_stdio_stream_array='$d_stdio_stream_array'
22071 d_stdiobase='$d_stdiobase'
22072 d_stdstdio='$d_stdstdio'
22073 d_strchr='$d_strchr'
22074 d_strcoll='$d_strcoll'
22075 d_strctcpy='$d_strctcpy'
22076 d_strerrm='$d_strerrm'
22077 d_strerror='$d_strerror'
22078 d_strerror_r='$d_strerror_r'
22079 d_strftime='$d_strftime'
22080 d_strlcat='$d_strlcat'
22081 d_strlcpy='$d_strlcpy'
22082 d_strtod='$d_strtod'
22083 d_strtol='$d_strtol'
22084 d_strtold='$d_strtold'
22085 d_strtoll='$d_strtoll'
22086 d_strtoq='$d_strtoq'
22087 d_strtoul='$d_strtoul'
22088 d_strtoull='$d_strtoull'
22089 d_strtouq='$d_strtouq'
22090 d_strxfrm='$d_strxfrm'
22091 d_suidsafe='$d_suidsafe'
22092 d_symlink='$d_symlink'
22093 d_syscall='$d_syscall'
22094 d_syscallproto='$d_syscallproto'
22095 d_sysconf='$d_sysconf'
22096 d_sysernlst='$d_sysernlst'
22097 d_syserrlst='$d_syserrlst'
22098 d_system='$d_system'
22099 d_tcgetpgrp='$d_tcgetpgrp'
22100 d_tcsetpgrp='$d_tcsetpgrp'
22101 d_telldir='$d_telldir'
22102 d_telldirproto='$d_telldirproto'
22105 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
22106 d_tm_tm_zone='$d_tm_tm_zone'
22107 d_tmpnam_r='$d_tmpnam_r'
22108 d_truncate='$d_truncate'
22109 d_ttyname_r='$d_ttyname_r'
22110 d_tzname='$d_tzname'
22111 d_u32align='$d_u32align'
22112 d_ualarm='$d_ualarm'
22115 d_union_semun='$d_union_semun'
22116 d_unordered='$d_unordered'
22117 d_unsetenv='$d_unsetenv'
22118 d_usleep='$d_usleep'
22119 d_usleepproto='$d_usleepproto'
22121 d_vendorarch='$d_vendorarch'
22122 d_vendorbin='$d_vendorbin'
22123 d_vendorlib='$d_vendorlib'
22124 d_vendorscript='$d_vendorscript'
22126 d_void_closedir='$d_void_closedir'
22127 d_voidsig='$d_voidsig'
22128 d_voidtty='$d_voidtty'
22129 d_volatile='$d_volatile'
22130 d_vprintf='$d_vprintf'
22131 d_vsnprintf='$d_vsnprintf'
22133 d_waitpid='$d_waitpid'
22134 d_wcstombs='$d_wcstombs'
22135 d_wctomb='$d_wctomb'
22136 d_writev='$d_writev'
22139 db_hashtype='$db_hashtype'
22140 db_prefixtype='$db_prefixtype'
22141 db_version_major='$db_version_major'
22142 db_version_minor='$db_version_minor'
22143 db_version_patch='$db_version_patch'
22144 defvoidused='$defvoidused'
22145 direntrytype='$direntrytype'
22148 doublesize='$doublesize'
22150 drand48_r_proto='$drand48_r_proto'
22152 dynamic_ext='$dynamic_ext'
22158 endgrent_r_proto='$endgrent_r_proto'
22159 endhostent_r_proto='$endhostent_r_proto'
22160 endnetent_r_proto='$endnetent_r_proto'
22161 endprotoent_r_proto='$endprotoent_r_proto'
22162 endpwent_r_proto='$endpwent_r_proto'
22163 endservent_r_proto='$endservent_r_proto'
22164 eunicefix='$eunicefix'
22167 extensions='$extensions'
22169 fflushNULL='$fflushNULL'
22170 fflushall='$fflushall'
22172 firstmakefile='$firstmakefile'
22174 fpossize='$fpossize'
22175 fpostype='$fpostype'
22176 freetype='$freetype'
22179 full_csh='$full_csh'
22180 full_sed='$full_sed'
22181 gccansipedantic='$gccansipedantic'
22182 gccosandvers='$gccosandvers'
22183 gccversion='$gccversion'
22184 getgrent_r_proto='$getgrent_r_proto'
22185 getgrgid_r_proto='$getgrgid_r_proto'
22186 getgrnam_r_proto='$getgrnam_r_proto'
22187 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22188 gethostbyname_r_proto='$gethostbyname_r_proto'
22189 gethostent_r_proto='$gethostent_r_proto'
22190 getlogin_r_proto='$getlogin_r_proto'
22191 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22192 getnetbyname_r_proto='$getnetbyname_r_proto'
22193 getnetent_r_proto='$getnetent_r_proto'
22194 getprotobyname_r_proto='$getprotobyname_r_proto'
22195 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22196 getprotoent_r_proto='$getprotoent_r_proto'
22197 getpwent_r_proto='$getpwent_r_proto'
22198 getpwnam_r_proto='$getpwnam_r_proto'
22199 getpwuid_r_proto='$getpwuid_r_proto'
22200 getservbyname_r_proto='$getservbyname_r_proto'
22201 getservbyport_r_proto='$getservbyport_r_proto'
22202 getservent_r_proto='$getservent_r_proto'
22203 getspnam_r_proto='$getspnam_r_proto'
22204 gidformat='$gidformat'
22210 gmtime_r_proto='$gmtime_r_proto'
22211 gnulibc_version='$gnulibc_version'
22213 groupcat='$groupcat'
22214 groupstype='$groupstype'
22217 h_sysfile='$h_sysfile'
22220 html1dir='$html1dir'
22221 html1direxp='$html1direxp'
22222 html3dir='$html3dir'
22223 html3direxp='$html3direxp'
22232 i_arpainet='$i_arpainet'
22233 i_assert='$i_assert'
22234 i_bsdioctl='$i_bsdioctl'
22238 i_dirent='$i_dirent'
22244 i_fp_class='$i_fp_class'
22247 i_ieeefp='$i_ieeefp'
22248 i_inttypes='$i_inttypes'
22249 i_langinfo='$i_langinfo'
22250 i_libutil='$i_libutil'
22251 i_limits='$i_limits'
22252 i_locale='$i_locale'
22253 i_machcthr='$i_machcthr'
22254 i_malloc='$i_malloc'
22256 i_memory='$i_memory'
22257 i_mntent='$i_mntent'
22260 i_neterrno='$i_neterrno'
22261 i_netinettcp='$i_netinettcp'
22265 i_pthread='$i_pthread'
22267 i_rpcsvcdbm='$i_rpcsvcdbm'
22270 i_shadow='$i_shadow'
22272 i_stdarg='$i_stdarg'
22273 i_stddef='$i_stddef'
22274 i_stdlib='$i_stdlib'
22275 i_string='$i_string'
22276 i_sunmath='$i_sunmath'
22277 i_sysaccess='$i_sysaccess'
22278 i_sysdir='$i_sysdir'
22279 i_sysfile='$i_sysfile'
22280 i_sysfilio='$i_sysfilio'
22282 i_sysioctl='$i_sysioctl'
22283 i_syslog='$i_syslog'
22284 i_sysmman='$i_sysmman'
22285 i_sysmode='$i_sysmode'
22286 i_sysmount='$i_sysmount'
22287 i_sysndir='$i_sysndir'
22288 i_sysparam='$i_sysparam'
22289 i_sysresrc='$i_sysresrc'
22290 i_syssecrt='$i_syssecrt'
22291 i_sysselct='$i_sysselct'
22292 i_syssockio='$i_syssockio'
22293 i_sysstat='$i_sysstat'
22294 i_sysstatfs='$i_sysstatfs'
22295 i_sysstatvfs='$i_sysstatvfs'
22296 i_systime='$i_systime'
22297 i_systimek='$i_systimek'
22298 i_systimes='$i_systimes'
22299 i_systypes='$i_systypes'
22300 i_sysuio='$i_sysuio'
22302 i_sysutsname='$i_sysutsname'
22303 i_sysvfs='$i_sysvfs'
22304 i_syswait='$i_syswait'
22305 i_termio='$i_termio'
22306 i_termios='$i_termios'
22308 i_unistd='$i_unistd'
22311 i_values='$i_values'
22312 i_varargs='$i_varargs'
22313 i_varhdr='$i_varhdr'
22315 ignore_versioned_solibs='$ignore_versioned_solibs'
22316 inc_version_list='$inc_version_list'
22317 inc_version_list_init='$inc_version_list_init'
22320 initialinstalllocation='$initialinstalllocation'
22321 installarchlib='$installarchlib'
22322 installbin='$installbin'
22323 installhtml1dir='$installhtml1dir'
22324 installhtml3dir='$installhtml3dir'
22325 installman1dir='$installman1dir'
22326 installman3dir='$installman3dir'
22327 installprefix='$installprefix'
22328 installprefixexp='$installprefixexp'
22329 installprivlib='$installprivlib'
22330 installscript='$installscript'
22331 installsitearch='$installsitearch'
22332 installsitebin='$installsitebin'
22333 installsitehtml1dir='$installsitehtml1dir'
22334 installsitehtml3dir='$installsitehtml3dir'
22335 installsitelib='$installsitelib'
22336 installsiteman1dir='$installsiteman1dir'
22337 installsiteman3dir='$installsiteman3dir'
22338 installsitescript='$installsitescript'
22339 installstyle='$installstyle'
22340 installusrbinperl='$installusrbinperl'
22341 installvendorarch='$installvendorarch'
22342 installvendorbin='$installvendorbin'
22343 installvendorhtml1dir='$installvendorhtml1dir'
22344 installvendorhtml3dir='$installvendorhtml3dir'
22345 installvendorlib='$installvendorlib'
22346 installvendorman1dir='$installvendorman1dir'
22347 installvendorman3dir='$installvendorman3dir'
22348 installvendorscript='$installvendorscript'
22350 issymlink='$issymlink'
22351 ivdformat='$ivdformat'
22354 known_extensions='$known_extensions'
22357 lddlflags='$lddlflags'
22359 ldflags_uselargefiles='$ldflags_uselargefiles'
22360 ldlibpthname='$ldlibpthname'
22367 libsdirs='$libsdirs'
22368 libsfiles='$libsfiles'
22369 libsfound='$libsfound'
22370 libspath='$libspath'
22371 libswanted='$libswanted'
22372 libswanted_uselargefiles='$libswanted_uselargefiles'
22378 localtime_r_proto='$localtime_r_proto'
22379 locincpth='$locincpth'
22380 loclibpth='$loclibpth'
22381 longdblsize='$longdblsize'
22382 longlongsize='$longlongsize'
22383 longsize='$longsize'
22387 lseeksize='$lseeksize'
22388 lseektype='$lseektype'
22391 madlyobj='$madlyobj'
22392 madlysrc='$madlysrc'
22396 make_set_make='$make_set_make'
22397 mallocobj='$mallocobj'
22398 mallocsrc='$mallocsrc'
22399 malloctype='$malloctype'
22401 man1direxp='$man1direxp'
22404 man3direxp='$man3direxp'
22406 mips_type='$mips_type'
22407 mistrustnm='$mistrustnm'
22409 mmaptype='$mmaptype'
22410 modetype='$modetype'
22412 multiarch='$multiarch'
22414 myarchname='$myarchname'
22415 mydomain='$mydomain'
22416 myhostname='$myhostname'
22419 need_va_copy='$need_va_copy'
22420 netdb_hlen_type='$netdb_hlen_type'
22421 netdb_host_type='$netdb_host_type'
22422 netdb_name_type='$netdb_name_type'
22423 netdb_net_type='$netdb_net_type'
22426 nm_so_opt='$nm_so_opt'
22427 nonxs_ext='$nonxs_ext'
22429 nvEUformat='$nvEUformat'
22430 nvFUformat='$nvFUformat'
22431 nvGUformat='$nvGUformat'
22432 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22433 nveformat='$nveformat'
22434 nvfformat='$nvfformat'
22435 nvgformat='$nvgformat'
22438 o_nonblock='$o_nonblock'
22440 old_pthread_create_joinable='$old_pthread_create_joinable'
22441 optimize='$optimize'
22442 orderlib='$orderlib'
22445 otherlibdirs='$otherlibdirs'
22449 patchlevel='$patchlevel'
22450 path_sep='$path_sep'
22453 perl_patchlevel='$perl_patchlevel'
22454 perladmin='$perladmin'
22455 perllibs='$perllibs'
22456 perlpath='$perlpath'
22458 phostname='$phostname'
22464 prefixexp='$prefixexp'
22466 privlibexp='$privlibexp'
22467 procselfexe='$procselfexe'
22468 prototype='$prototype'
22470 quadkind='$quadkind'
22471 quadtype='$quadtype'
22472 randbits='$randbits'
22473 randfunc='$randfunc'
22474 random_r_proto='$random_r_proto'
22475 randseedtype='$randseedtype'
22477 rd_nodata='$rd_nodata'
22478 readdir64_r_proto='$readdir64_r_proto'
22479 readdir_r_proto='$readdir_r_proto'
22480 revision='$revision'
22486 sPRIEUldbl='$sPRIEUldbl'
22487 sPRIFUldbl='$sPRIFUldbl'
22488 sPRIGUldbl='$sPRIGUldbl'
22489 sPRIXU64='$sPRIXU64'
22491 sPRIeldbl='$sPRIeldbl'
22492 sPRIfldbl='$sPRIfldbl'
22493 sPRIgldbl='$sPRIgldbl'
22498 sSCNfldbl='$sSCNfldbl'
22499 sched_yield='$sched_yield'
22500 scriptdir='$scriptdir'
22501 scriptdirexp='$scriptdirexp'
22503 seedfunc='$seedfunc'
22504 selectminbits='$selectminbits'
22505 selecttype='$selecttype'
22506 sendmail='$sendmail'
22507 setgrent_r_proto='$setgrent_r_proto'
22508 sethostent_r_proto='$sethostent_r_proto'
22509 setlocale_r_proto='$setlocale_r_proto'
22510 setnetent_r_proto='$setnetent_r_proto'
22511 setprotoent_r_proto='$setprotoent_r_proto'
22512 setpwent_r_proto='$setpwent_r_proto'
22513 setservent_r_proto='$setservent_r_proto'
22516 sharpbang='$sharpbang'
22517 shmattype='$shmattype'
22518 shortsize='$shortsize'
22521 sig_count='$sig_count'
22522 sig_name='$sig_name'
22523 sig_name_init='$sig_name_init'
22525 sig_num_init='$sig_num_init'
22526 sig_size='$sig_size'
22527 signal_t='$signal_t'
22528 sitearch='$sitearch'
22529 sitearchexp='$sitearchexp'
22531 sitebinexp='$sitebinexp'
22532 sitehtml1dir='$sitehtml1dir'
22533 sitehtml1direxp='$sitehtml1direxp'
22534 sitehtml3dir='$sitehtml3dir'
22535 sitehtml3direxp='$sitehtml3direxp'
22537 sitelib_stem='$sitelib_stem'
22538 sitelibexp='$sitelibexp'
22539 siteman1dir='$siteman1dir'
22540 siteman1direxp='$siteman1direxp'
22541 siteman3dir='$siteman3dir'
22542 siteman3direxp='$siteman3direxp'
22543 siteprefix='$siteprefix'
22544 siteprefixexp='$siteprefixexp'
22545 sitescript='$sitescript'
22546 sitescriptexp='$sitescriptexp'
22547 sizesize='$sizesize'
22548 sizetype='$sizetype'
22552 sockethdr='$sockethdr'
22553 socketlib='$socketlib'
22554 socksizetype='$socksizetype'
22556 spackage='$spackage'
22557 spitshell='$spitshell'
22558 srand48_r_proto='$srand48_r_proto'
22559 srandom_r_proto='$srandom_r_proto'
22561 ssizetype='$ssizetype'
22562 startperl='$startperl'
22564 static_ext='$static_ext'
22566 stdio_base='$stdio_base'
22567 stdio_bufsiz='$stdio_bufsiz'
22568 stdio_cnt='$stdio_cnt'
22569 stdio_filbuf='$stdio_filbuf'
22570 stdio_ptr='$stdio_ptr'
22571 stdio_stream_array='$stdio_stream_array'
22572 strerror_r_proto='$strerror_r_proto'
22575 subversion='$subversion'
22579 targetarch='$targetarch'
22583 timeincl='$timeincl'
22584 timetype='$timetype'
22585 tmpnam_r_proto='$tmpnam_r_proto'
22591 ttyname_r_proto='$ttyname_r_proto'
22600 uidformat='$uidformat'
22606 uquadtype='$uquadtype'
22607 use5005threads='$use5005threads'
22608 use64bitall='$use64bitall'
22609 use64bitint='$use64bitint'
22610 usecrosscompile='$usecrosscompile'
22612 usedtrace='$usedtrace'
22613 usefaststdio='$usefaststdio'
22614 useithreads='$useithreads'
22615 uselargefiles='$uselargefiles'
22616 uselongdouble='$uselongdouble'
22617 usemallocwrap='$usemallocwrap'
22618 usemorebits='$usemorebits'
22619 usemultiplicity='$usemultiplicity'
22620 usemymalloc='$usemymalloc'
22622 useopcode='$useopcode'
22623 useperlio='$useperlio'
22624 useposix='$useposix'
22625 usereentrant='$usereentrant'
22626 userelocatableinc='$userelocatableinc'
22628 useshrplib='$useshrplib'
22629 usesitecustomize='$usesitecustomize'
22630 usesocks='$usesocks'
22631 usethreads='$usethreads'
22632 usevendorprefix='$usevendorprefix'
22633 usevfork='$usevfork'
22636 uvXUformat='$uvXUformat'
22637 uvoformat='$uvoformat'
22640 uvuformat='$uvuformat'
22641 uvxformat='$uvxformat'
22642 vendorarch='$vendorarch'
22643 vendorarchexp='$vendorarchexp'
22644 vendorbin='$vendorbin'
22645 vendorbinexp='$vendorbinexp'
22646 vendorhtml1dir='$vendorhtml1dir'
22647 vendorhtml1direxp='$vendorhtml1direxp'
22648 vendorhtml3dir='$vendorhtml3dir'
22649 vendorhtml3direxp='$vendorhtml3direxp'
22650 vendorlib='$vendorlib'
22651 vendorlib_stem='$vendorlib_stem'
22652 vendorlibexp='$vendorlibexp'
22653 vendorman1dir='$vendorman1dir'
22654 vendorman1direxp='$vendorman1direxp'
22655 vendorman3dir='$vendorman3dir'
22656 vendorman3direxp='$vendorman3direxp'
22657 vendorprefix='$vendorprefix'
22658 vendorprefixexp='$vendorprefixexp'
22659 vendorscript='$vendorscript'
22660 vendorscriptexp='$vendorscriptexp'
22662 version_patchlevel_string='$version_patchlevel_string'
22663 versiononly='$versiononly'
22665 voidflags='$voidflags'
22668 yaccflags='$yaccflags'
22673 : Add in command line options if available
22674 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22676 : add special variables
22677 $test -f $src/patchlevel.h && \
22678 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22679 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22680 echo "PERL_CONFIG_SH=true" >>config.sh
22682 : propagate old symbols
22683 if $test -f UU/config.sh; then
22684 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22685 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
22686 $sort | $uniq -u >UU/oldsyms
22687 set X `cat UU/oldsyms`
22693 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22695 echo "# Variables propagated from previous config.sh file." >>config.sh
22696 for sym in `cat UU/oldsyms`; do
22697 echo " Propagating $hint variable "'$'"$sym..."
22698 eval 'tmp="$'"${sym}"'"'
22700 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22706 : Finish up by extracting the .SH files
22710 echo "Extraction done."
22720 If you'd like to make any changes to the config.sh file before I begin
22721 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22724 rp="Press return or use a shell escape to edit config.sh:"
22729 *) : in case they cannot read
22730 sh 1>&4 -c "$ans";;
22735 : if this fails, just run all the .SH files by hand
22744 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22751 Now you need to generate make dependencies by running "$make depend".
22752 You might prefer to run it in background: "$make depend > makedepend.out &"
22753 It can take a while, so you might not want to run it right now.
22758 rp="Run $make depend now?"
22762 $make depend && echo "Now you must run '$make'."
22765 echo "You must run '$make depend' then '$make'."
22768 elif test -f [Mm]akefile; then
22770 echo "Now you must run a $make."
22772 echo "Configure done."
22775 if $test -f Policy.sh; then
22778 If you compile $package on a different machine or from a different object
22779 directory, copy the Policy.sh file from this object directory to the
22780 new one before you run Configure -- this will help you with most of
22781 the policy defaults.
22785 if $test -f config.msg; then
22786 echo "Hmm. I also noted the following information while running:"
22788 $cat config.msg >&4
22791 $rm -f kit*isdone ark*isdone