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-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # Though this script was generated by metaconfig, it is OK to send
22 # patches against it. It's up to the Configure pumpkin to backport
23 # the patch to the metaunits if it is accepted.
24 # See Porting/pumpkin.pod for more information on metaconfig.
27 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
29 # Generated on Sun Sep 9 11:36:23 CEST 2007 [metaconfig 3.0 PL70]
30 # (with additional metaconfig patches by perlbug@perl.org)
35 SCO csh still thinks true is false. Write to SCO today and tell them that next
36 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
38 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
39 we'd have to do is go in and swap the && and || tokens, wherever they are.)
41 [End of diatribe. We now return you to your regularly scheduled programming...]
45 OOPS! You naughty creature! You didn't run Configure with sh!
46 I will attempt to remedy the situation by running sh for you...
50 true || exec sh $0 $argv:q
52 (exit $?0) || cat c2$$
53 (exit $?0) || exec sh $0 $argv:q
56 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
59 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
60 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
61 *** Please read the README.plan9 for further instructions.
62 *** Cannot continue, aborting.
68 if test ! -c /dev/null ; then
71 *** I'm sorry, but /dev/null appears to be a file rather than a device.
72 *** Please consult your operating sytem's notes for making a device
74 *** Cannot continue, aborting.
80 : compute my invocation name
84 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
89 : Proper separator for the PATH environment variable
91 : On OS/2 this directory should exist if this is not floppy only system :-]
92 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
93 if test -n "$OS2_SHELL"; then
95 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
96 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
98 elif test -n "$DJGPP"; then
99 case "X${MACHTYPE:-nonesuchmach}" in
106 : Proper PATH setting
107 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
108 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
109 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
110 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
111 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
112 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
113 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
114 paths="$paths /sbin /usr/sbin /usr/libexec"
115 paths="$paths /system/gnu_library/bin"
119 case "$p_$PATH$p_" in
121 *) test -d $p && PATH=$PATH$p_$p ;;
128 : shall we be using ksh?
134 if (PATH=.; alias -x) >/dev/null 2>&1; then
137 if test -f /hp-ux -a -f /bin/ksh; then
138 needksh='to avoid sh bug in "here document" expansion'
140 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
141 if test X`/usr/bin/uname -v` = X4; then
142 avoidksh="to avoid AIX 4's /bin/sh"
146 if test -f /osf_boot -a -f /usr/sbin/setld; then
147 if test X`/usr/bin/uname -s` = XOSF1; then
148 avoidksh="to avoid Digital UNIX' ksh"
150 unset BIN_SH # if this is 'xpg4' sh will start up ksh
153 case "$inksh/$needksh" in
160 case "$inksh/$avoidksh" in
166 case "$inksh/$needksh-$avoidksh-" in
169 (I see you are using the Korn shell. Some ksh's blow up on $me,
170 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
177 echo "(Feeding myself to $newsh $reason.)"
179 Configure|*/Configure) exec $newsh $0 "$@";;
180 *) exec $newsh Configure "$@";;
184 test -x "${newsh}" || unset newsh
186 : if needed set CDPATH to a harmless value that is not chatty
187 : avoid bash 2.02 problems with empty CDPATH.
191 *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=''
945 d_inc_version_list=''
947 inc_version_list_init=''
966 ignore_versioned_solibs=''
1030 d_perl_otherlibdirs=''
1038 api_versionstring=''
1044 version_patchlevel_string=''
1048 d_nv_preserves_uv=''
1049 d_nv_zero_is_allbits_zero=''
1060 nv_preserves_uv_bits=''
1132 installsitehtml1dir=''
1135 installsitehtml3dir=''
1142 installsiteman1dir=''
1145 installsiteman3dir=''
1150 installsitescript=''
1165 d_stdio_stream_array=''
1166 stdio_stream_array=''
1177 ccflags_uselargefiles=''
1178 ldflags_uselargefiles=''
1179 libswanted_uselargefiles=''
1199 installvendorarch=''
1206 installvendorhtml1dir=''
1208 vendorhtml1direxp=''
1209 installvendorhtml3dir=''
1211 vendorhtml3direxp=''
1217 installvendorman1dir=''
1220 installvendorman3dir=''
1227 installvendorscript=''
1239 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1242 : We must find out about Eunice early
1244 if test -f /etc/unixtovms; then
1245 eunicefix=/etc/unixtovms
1247 if test -f /etc/unixtovms.exe; then
1248 eunicefix=/etc/unixtovms.exe
1251 : Set executable suffix now -- needed before hints available
1252 if test -f "/libs/version.library"; then
1255 elif test -f "/system/gnu_library/bin/ar.pm"; then
1258 elif test -n "$DJGPP"; then
1261 elif test -d c:/. -o -n "$is_os2" ; then
1267 : Trailing extension. Override this in a hint file, if needed.
1268 : Extra object files, if any, needed on this platform.
1273 : change the next line if compiling for Xenix/286 on Xenix/386
1274 xlibpth='/usr/lib/386 /lib/386'
1275 : Possible local library directories to search.
1276 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1277 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1279 : general looking path for locating libraries
1280 glibpth="/lib /usr/lib $xlibpth"
1281 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1282 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1283 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1284 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1286 : Private path used by Configure to find libraries. Its value
1287 : is prepended to libpth. This variable takes care of special
1288 : machines, like the mips. Usually, it should be empty.
1291 : default library list
1293 : some systems want to use only the non-versioned libso:s
1294 ignore_versioned_solibs=''
1298 : set usethreads on the Configure command line to enable threads.
1299 usereentrant='undef'
1300 : full support for void wanted by default
1303 : Possible local include directories to search.
1304 : Set locincpth to "" in a hint file to defeat local include searches.
1305 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1306 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1308 : no include file wanted by default
1311 : Enable -DEBUGGING and -DDEBUGGING from the command line
1318 : set useposix=false in your hint file to disable the POSIX extension.
1320 : set useopcode=false in your hint file to disable the Opcode extension.
1323 ccflags_uselargefiles=''
1324 ldflags_uselargefiles=''
1325 libswanted_uselargefiles=''
1326 : set usemultiplicity on the Configure command line to enable multiplicity.
1327 : set usesocks on the Configure command line to enable socks.
1328 : List of libraries we want.
1329 : If anyone needs extra -lxxx, put those in a hint file.
1330 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1331 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1332 : We probably want to search /usr/shlib before most other libraries.
1333 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1334 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1335 glibpth="/usr/shlib $glibpth"
1336 : Do not use vfork unless overridden by a hint file.
1339 : Find the basic shell for Bourne shell scripts
1343 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1346 if test -f "$xxx"; then
1349 : Build up a list and do a single loop so we can 'break' out.
1350 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1351 for xxx in sh bash ksh pdksh ash; do
1353 try="$try ${p}/${xxx}"
1357 if test -f "$xxx"; then
1360 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1363 elif test -f "$xxx.exe"; then
1374 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1376 Usually it's in /bin/sh. How did you even get this far?
1377 Please contact me (Perl Maintainers) at perlbug@perl.org and
1378 we'll try to straighten this all out.
1384 : see if sh knows # comments
1385 if `$sh -c '#' >/dev/null 2>&1`; then
1389 test -f $xcat$_exe || xcat=/usr/bin/cat
1390 if test ! -f $xcat$_exe; then
1391 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1392 if test -f $p/cat$_exe; then
1397 if test ! -f $xcat$_exe; then
1398 echo "Can't find cat anywhere!"
1402 echo "#!$xcat" >sharp
1406 if test -s today; then
1409 echo "#! $xcat" > sharp
1413 if test -s today; then
1421 echo "Your $sh doesn't grok # comments--I will strip them later on."
1424 echo "exec grep -v '^[ ]*#'" >spitshell
1426 $eunicefix spitshell
1427 spitshell=`pwd`/spitshell
1429 echo "I presume that if # doesn't work, #! won't work either!"
1434 : figure out how to guarantee sh startup
1436 '') startsh=${sharpbang}${sh} ;;
1448 : echo "Yup, it does."
1450 echo "Hmm... '$startsh' does not guarantee sh startup..."
1451 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1456 : Save command line options in file UU/cmdline.opt for later use in
1457 : generating config.sh.
1458 cat > cmdline.opt <<EOSH
1459 # Configure command line arguments.
1468 cat >>cmdline.opt <<EOSH
1469 config_arg$argn='$arg'
1471 # Extreme backslashitis: replace each ' by '"'"'
1472 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1475 arg_exp=`cat cmdl.opt`
1476 args_exp="$args_exp$args_sep'$arg_exp'"
1477 argn=`expr $argn + 1`
1480 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1481 # used by ./hints/os2.sh
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 !"
1979 : 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 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2125 $define|true|[yY]*) ;;
2126 *) case "$xversion" in
2129 *** WHOA THERE!!! ***
2131 This is an UNSTABLE DEVELOPMENT release.
2132 The version of this $package distribution is $xversion, that is, odd,
2133 (as opposed to even) and that signifies a development release.
2134 If you want a maintenance release, you want an even-numbered version.
2136 Do ***NOT*** install this into production use.
2137 Data corruption and crashes are possible.
2139 It is most seriously suggested that you do not continue any further
2140 unless you want to help in developing and debugging Perl.
2142 If you *still* want to build perl, you can answer 'y' now,
2143 or pass -Dusedevel to Configure.
2146 rp='Do you really want to continue?'
2150 [yY]) echo >&4 "Okay, continuing."
2151 usedevel="$define" ;;
2152 *) echo >&4 "Okay, bye."
2162 case "$versiononly" in
2163 '') versiononly="$define" ;;
2165 case "$installusrbinperl" in
2166 '') installusrbinperl="$undef" ;;
2171 : general instructions
2174 user=`(logname) 2>/dev/null`
2176 '') user=`whoami 2>&1`;;
2178 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2181 rp='Would you like to see the instructions?'
2192 This installation shell script will examine your system and ask you questions
2193 to determine how the perl5 package should be installed. If you get
2194 stuck on a question, you may use a ! shell escape to start a subshell or
2195 execute a command. Many of the questions will have default answers in square
2196 brackets; typing carriage return will give you the default.
2198 On some of the questions which ask for file or directory names you are allowed
2199 to use the ~name construct to specify the login directory belonging to "name",
2200 even if you don't have a shell which knows about that. Questions where this is
2201 allowed will be marked "(~name ok)".
2205 dflt='Type carriage return to continue'
2209 The prompter used in this script allows you to use shell variables and
2210 backticks in your answers. You may use $1, $2, etc... to refer to the words
2211 in the default answer, as if the default line was a set of arguments given to a
2212 script shell. This means you may also use $* to repeat the whole default line,
2213 so you do not have to re-type everything to add something to the default.
2215 Everytime there is a substitution, you will have to confirm. If there is an
2216 error (e.g. an unmatched backtick), the default answer will remain unchanged
2217 and you will be prompted again.
2219 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2220 the questions and use the computed defaults (or the previous answers if there
2221 was already a config.sh file). Type 'Configure -h' for a list of options.
2222 You may also start interactively and then answer '& -d' at any prompt to turn
2223 on the non-interactive behaviour for the remainder of the execution.
2229 Much effort has been expended to ensure that this shell script will run on any
2230 Unix system. If despite that it blows up on yours, your best bet is to edit
2231 Configure and run it again. If you can't run Configure for some reason,
2232 you'll have to generate a config.sh file by hand. Whatever problems you
2233 have, let me (perlbug@perl.org) know how I blew it.
2235 This installation script affects things in two ways:
2237 1) it may do direct variable substitutions on some of the files included
2239 2) it builds a config.h file for inclusion in C programs. You may edit
2240 any of these files as the need arises after running this script.
2242 If you make a mistake on a question, there is no easy way to back up to it
2243 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2244 files. Configure will offer to let you do this before it runs the SH files.
2247 dflt='Type carriage return to continue'
2249 case "$firsttime" in
2250 true) echo $user >>../.config/instruct;;
2254 : find out where common programs are
2256 echo "Locating common programs..." >&4
2269 if test -d \$dir/\$thing; then
2275 for thisthing in \$dir/\$thing; do
2276 : just loop through to pick last item
2278 if test -f \$thisthing; then
2281 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2284 elif test -f \$dir/\$thing.exe; then
2285 if test -n "$DJGPP"; then
2286 echo \$dir/\$thing.exe
2287 elif test "$eunicefix" != ":"; then
2288 : on Eunice apparently
2342 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2343 pth="$pth /lib /usr/lib"
2344 for file in $loclist; do
2348 if test -f "$xxx"; then
2351 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2352 xxx=`./loc $file $file $pth`
2355 '') xxx=`./loc $file $file $pth`;;
2356 *) xxx=`./loc $xxx $xxx $pth`;;
2358 eval $file=$xxx$_exe
2362 echo $file is in $xxx.
2365 echo $file is in $xxx.
2368 echo "I don't know where '$file' is, and my life depends on it." >&4
2369 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2375 echo "Don't worry if any of the following aren't found..."
2377 for file in $trylist; do
2381 if test -f "$xxx"; then
2384 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2385 xxx=`./loc $file $file $pth`
2388 '') xxx=`./loc $file $file $pth`;;
2389 *) xxx=`./loc $xxx $xxx $pth`;;
2391 eval $file=$xxx$_exe
2395 echo $file is in $xxx.
2398 echo $file is in $xxx.
2401 echo "I don't see $file out there, $say."
2408 echo "Substituting grep for egrep."
2415 echo "Substituting cp for ln."
2424 echo "I can't find make or gmake, and my life depends on it." >&4
2425 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2433 *) # We can't have osname yet.
2434 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2435 # Assume that gmake, if found, is definitely GNU make
2436 # and prefer it over the system make.
2437 echo "Substituting gmake for make."
2445 echo "Hopefully test is built into your sh."
2448 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2449 echo "Using the test built into your sh."
2457 echo "Hopefully echo is built into your sh."
2462 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2463 $echo $n "hi there$c" >foo1
2464 echo $n "hi there$c" >foo2
2465 if cmp foo1 foo2 >/dev/null 2>&1; then
2466 echo "They are compatible. In fact, they may be identical."
2473 They are not compatible! You are probably running ksh on a non-USG system.
2474 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2475 have echo built in and we may have to run some Bourne shell scripts. That
2476 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2479 $echo $n "The star should be here-->$c"
2486 # This question was auctioned at YAPC::Europe-2007 in Vienna
2487 # I never promised you could answer it. I only auctioned the question.
2489 The following message is sponsored by
2491 Dresden.pm<--The stars should be here.
2493 Dear Perl user, system administrator or package
2494 maintainer, the Perl community sends greetings to
2495 you. Do you (emblematical) greet back [Y/n]? n
2502 cat <<'EOSC' >>trygcc
2507 int main(int argc, char *argv[]) {
2511 if $cc -o try $ccflags $ldflags try.c; then
2514 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2520 # Skip this test because it gives a false match on output like:
2521 # ./trygcc: line 23: cc: command not found
2522 # case "`$cc -v -c try.c 2>&1`" in
2523 # *gcc*) trygcc=no ;;
2525 if $test X"$trygcc" = Xyes; then
2526 if gcc -o try -c try.c; then
2528 echo "You seem to have a working gcc, though." >&4
2529 # Switching compilers may undo the work of hints files.
2530 # The most common problem is -D_REENTRANT for threads.
2531 # This heuristic catches that case, but gets false positives
2532 # if -Dusethreads was not actually specified. Better to
2533 # bail out here with a useful message than fail
2534 # mysteriously later. Should we perhaps just try to
2535 # re-invoke Configure -Dcc=gcc config_args ?
2536 if $test -f usethreads.cbu; then
2539 *** However, any setting of the C compiler flags (e.g. for thread support)
2540 *** will be lost. It may be necessary for you to restart Configure and
2541 *** add -Dcc=gcc to your Configure command line.
2544 rp="Would you like to go ahead and try gcc anyway?"
2547 rp="Would you like to use it?"
2550 if $test -f myread; then
2553 if $test -f UU/myread; then
2556 echo "Cannot find myread, sorry. Aborting." >&2
2561 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2574 cat <<'EOSC' >>checkcc
2579 int main(int argc, char *argv[]) {
2583 if $cc -o try $ccflags $ldflags try.c; then
2586 if $test X"$despair" = Xyes; then
2587 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2590 You need to find a working C compiler.
2591 Either (purchase and) install the C compiler supplied by your OS vendor,
2592 or for a free C compiler try http://gcc.gnu.org/
2593 I cannot continue any further, aborting.
2602 : determine whether symbolic links are supported
2605 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2606 echo "Symbolic links are supported." >&4
2609 echo "Symbolic links are NOT supported." >&4
2614 : determine whether symbolic links are supported
2618 echo "Checking how to test for symbolic links..." >&4
2620 if $test "X$issymlink" = X; then
2622 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2623 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2625 if test $? = 0; then
2628 echo "Your builtin 'test -h' may be broken." >&4
2631 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2634 if test -f "$p/$test"; then
2643 echo "Trying external '$test -h'." >&4
2644 issymlink="$test -h"
2645 if $test ! -h sym >/dev/null 2>&1; then
2646 echo "External '$test -h' is broken, too." >&4
2654 if $test "X$issymlink" = X; then
2655 if $test -L sym 2>/dev/null; then
2656 issymlink="$test -L"
2657 echo "The builtin '$test -L' worked." >&4
2660 if $test "X$issymlink" != X; then
2661 echo "You can test for symbolic links with '$issymlink'." >&4
2663 echo "I do not know how you can test for symbolic links." >&4
2667 *) echo "No symbolic links, so not testing for their testing..." >&4
2673 case "$mksymlinks" in
2676 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2679 *) case "$lns:$issymlink" in
2680 *"ln"*" -s:"*"test -"?)
2681 echo "Creating the symbolic links..." >&4
2682 echo "(First creating the subdirectories...)" >&4
2684 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2686 test -z "$directory" && break
2690 if test ! -d t/base; then
2691 echo "Failed to create the subdirectories. Aborting." >&4
2694 echo "(Then creating the symlinks...)" >&4
2695 awk '{print $1}' $src/MANIFEST | while true; do
2697 test -z "$filename" && break
2698 if test -f $filename; then
2699 if $issymlink $filename; then
2703 if test -f $filename; then
2704 echo "$filename already exists, not symlinking."
2706 ln -s $src/$filename $filename
2710 if test ! -f t/base/lex.t; then
2711 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2716 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2725 case "$usecrosscompile" in
2727 $echo "Cross-compiling..."
2730 *-*-gcc) # A cross-compiling gcc, probably.
2731 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2733 # leave out ld, choosing it is more complex
2735 ranlib=$targetarch-ranlib
2736 $echo 'extern int foo;' > try.c
2737 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2739 if $test $# -gt 0; then
2741 incpth="`$echo $incpth|$sed 's/^ //'`"
2742 echo "Guessing incpth '$incpth'." >&4
2744 j="`$echo $i|$sed 's,/include$,/lib,'`"
2745 if $test -d $j; then
2749 libpth="`$echo $libpth|$sed 's/^ //'`"
2750 echo "Guessing libpth '$libpth'." >&4
2755 case "$targetarch" in
2756 '') echo "Targetarch not defined." >&4; croak=y ;;
2757 *) echo "Using targetarch $targetarch." >&4 ;;
2760 '') echo "Incpth not defined." >&4; croak=y ;;
2761 *) echo "Using incpth '$incpth'." >&4 ;;
2764 '') echo "Libpth not defined." >&4; croak=y ;;
2765 *) echo "Using libpth '$libpth'." >&4 ;;
2768 '') for i in $incpth; do
2769 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2771 echo "Guessing usrinc $usrinc." >&4
2776 '') echo "Usrinc not defined." >&4; croak=y ;;
2779 *) echo "Using usrinc $usrinc." >&4 ;;
2781 case "$targethost" in
2782 '') echo "Targethost not defined." >&4; croak=y ;;
2783 *) echo "Using targethost $targethost." >&4
2788 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2791 /*) run=$src/Cross/run
2792 targetmkdir=$src/Cross/mkdir
2794 from=$src/Cross/from
2796 *) pwd=`$test -f ../Configure & cd ..; pwd`
2798 targetmkdir=$pwd/Cross/mkdir
2800 from=$pwd/Cross/from
2803 case "$targetrun" in
2804 '') targetrun=ssh ;;
2809 case "$targetfrom" in
2810 '') targetfrom=scp ;;
2814 from=$from-$targetfrom
2815 case "$targetdir" in
2817 echo "Guessing targetdir $targetdir." >&4
2820 case "$targetuser" in
2822 echo "Guessing targetuser $targetuser." >&4
2825 case "$targetfrom" in
2829 case "$targetrun" in
2841 '') cwd=$targetdir ;;
2845 if $test ! -f \$exe.xok; then
2849 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2852 *) echo "Unknown targetrun '$targetrun'" >&4
2856 case "$targetmkdir" in
2858 cat >$targetmkdir <<EOF
2860 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2862 $chmod a+rx $targetmkdir
2864 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2876 $targetmkdir \`dirname \$f\`
2877 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2880 $targetmkdir $targetdir/\`dirname \$f\`
2881 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2894 $mkdir -p $targetdir/\`dirname \$f\`
2895 $cp \$f $targetdir/\$f || exit 1
2898 $targetmkdir $targetdir/\`dirname \$f\`
2899 $cp \$f $targetdir/\$f || exit 1
2906 *) echo "Unknown targetto '$targetto'" >&4
2910 case "$targetfrom" in
2917 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2922 cp) cat >$from <<EOF
2927 cp $targetdir/\$f . || exit 1
2932 *) echo "Unknown targetfrom '$targetfrom'" >&4
2936 if $test ! -f $run; then
2937 echo "Target 'run' script '$run' not found." >&4
2941 if $test ! -f $to; then
2942 echo "Target 'to' script '$to' not found." >&4
2946 if $test ! -f $from; then
2947 echo "Target 'from' script '$from' not found." >&4
2951 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2955 Using '$run' for remote execution,
2956 and '$from' and '$to'
2957 for remote file transfer.
2963 usecrosscompile='undef'
2968 : see whether [:lower:] and [:upper:] are supported character classes
2970 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2972 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2976 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2977 # (0xd9 and 0xe2), therefore that is a nice testing point.
2978 if test "X$up" = X -o "X$low" = X; then
2979 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2985 if test "X$up" = X -o "X$low" = X; then
2986 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2992 if test "X$up" = X -o "X$low" = X; then
2993 case "`echo RS | od -x 2>/dev/null`" in
2995 echo "Hey, this might be EBCDIC." >&4
2996 if test "X$up" = X -o "X$low" = X; then
2997 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2998 rs) up='[A-IJ-RS-Z]'
3003 if test "X$up" = X -o "X$low" = X; then
3004 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3014 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3016 echo "Using $up and $low to convert case." >&4
3019 echo "I don't know how to translate letters from upper to lower case." >&4
3020 echo "Your tr is not acting any way I know of." >&4
3024 : set up the translation script tr, must be called with ./tr of course
3028 '[A-Z][a-z]') exec $tr '$up' '$low';;
3029 '[a-z][A-Z]') exec $tr '$low' '$up';;
3036 : Try to determine whether config.sh was made on this system
3037 case "$config_sh" in
3039 myuname=`$uname -a 2>/dev/null`
3040 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3041 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3042 # because the A-Z/a-z are not consecutive.
3043 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3044 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3045 newmyuname="$myuname"
3047 case "$knowitall" in
3049 if test -f ../config.sh; then
3050 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3051 eval "`grep myuname= ../config.sh`"
3053 if test "X$myuname" = "X$newmyuname"; then
3061 : Get old answers from old config file if Configure was run on the
3062 : same system, otherwise use the hints.
3065 if test -f config.sh; then
3067 rp="I see a config.sh file. Shall I use it to set the defaults?"
3070 n*|N*) echo "OK, I'll ignore it."
3071 mv config.sh config.sh.old
3072 myuname="$newmyuname"
3074 *) echo "Fetching default answers from your old config.sh file..." >&4
3082 : Older versions did not always set $sh. Catch re-use of such
3092 if test ! -f config.sh; then
3095 First time through, eh? I have some defaults handy for some systems
3096 that need some extra help getting the Configure answers right:
3099 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3101 : Half the following guesses are probably wrong... If you have better
3102 : tests or hints, please send them to perlbug@perl.org
3103 : The metaconfig authors would also appreciate a copy...
3104 $test -f /irix && osname=irix
3105 $test -f /xenix && osname=sco_xenix
3106 $test -f /dynix && osname=dynix
3107 $test -f /dnix && osname=dnix
3108 $test -f /lynx.os && osname=lynxos
3109 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3110 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3111 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3112 $test -f /bin/mips && /bin/mips && osname=mips
3113 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3114 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3115 $test -d /usr/apollo/bin && osname=apollo
3116 $test -f /etc/saf/_sactab && osname=svr4
3117 $test -d /usr/include/minix && osname=minix
3118 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3119 if $test -d /MachTen -o -d /MachTen_Folder; then
3121 if $test -x /sbin/version; then
3122 osvers=`/sbin/version | $awk '{print $2}' |
3123 $sed -e 's/[A-Za-z]$//'`
3124 elif $test -x /usr/etc/version; then
3125 osvers=`/usr/etc/version | $awk '{print $2}' |
3126 $sed -e 's/[A-Za-z]$//'`
3132 $test -f /sys/posix.dll &&
3133 $test -f /usr/bin/what &&
3134 set X `/usr/bin/what /sys/posix.dll` &&
3135 $test "$3" = UWIN &&
3139 if $test -f $uname; then
3147 umips) osname=umips ;;
3150 [23]100) osname=mips ;;
3151 next*) osname=next ;;
3153 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3154 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3157 elif $test -f /etc/kconfig; then
3159 if test "$lns" = "$ln -s"; then
3161 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3163 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3170 if test -n "$DJGPP"; then
3179 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3181 # oslevel can fail with:
3182 # oslevel: Unable to acquire lock.
3183 *not\ found) osvers="$4"."$3" ;;
3184 '<3240'|'<>3240') osvers=3.2.0 ;;
3185 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3186 '=3250'|'>3250') osvers=3.2.5 ;;
3190 bsd386) osname=bsd386
3193 cygwin*) osname=cygwin
3196 *dc.osx) osname=dcosx
3202 domainos) osname=apollo
3208 dragonfly) osname=dragonfly
3211 dynixptx*) osname=dynixptx
3212 osvers=`echo "$4"|sed 's/^v//'`
3214 freebsd) osname=freebsd
3216 genix) osname=genix ;;
3220 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3236 netbsd*) osname=netbsd
3239 news-os) osvers="$3"
3241 4*) osname=newsos4 ;;
3245 next*) osname=next ;;
3246 nonstop-ux) osname=nonstopux ;;
3247 openbsd) osname=openbsd
3253 POSIX-BC | posix-bc ) osname=posix-bc
3256 powerux | power_ux | powermax_os | powermaxos | \
3257 powerunix | power_unix) osname=powerux
3263 solaris) osname=solaris
3265 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3272 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3276 titanos) osname=titanos
3285 ultrix) osname=ultrix
3288 osf1|mls+) case "$5" in
3291 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3294 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3297 hp*) osname=hp_osf1 ;;
3298 mips) osname=mips_osf1 ;;
3301 # UnixWare 7.1.2 is known as Open UNIX 8
3302 openunix|unixware) osname=svr5
3310 $2) case "$osname" in
3314 : svr4.x or possibly later
3324 if test -f /stand/boot ; then
3325 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3326 if test -n "$INITPROG" -a -f "$INITPROG"; then
3327 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3328 if test -n "$isesix"; then
3336 *) if test -f /etc/systemid; then
3338 set `echo $3 | $sed 's/\./ /g'` $4
3339 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3341 elif $test -f $src/hints/sco_$1_$2.sh; then
3343 elif $test -f $src/hints/sco_$1.sh; then
3348 '') : Still unknown. Probably a generic Sys V.
3357 *) case "$osname" in
3358 '') : Still unknown. Probably a generic BSD.
3366 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3367 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3368 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3371 $rm -f UU/kernel.what
3372 elif test -d c:/. -o -n "$is_os2" ; then
3379 case "$targetarch" in
3382 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3387 : Now look for a hint file osname_osvers, unless one has been
3388 : specified already.
3391 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3392 : Also try without trailing minor version numbers.
3393 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3394 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3395 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3396 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3399 *) case "$osvers" in
3402 *) if $test -f $src/hints/$file.sh ; then
3404 elif $test -f $src/hints/$xfile.sh ; then
3406 elif $test -f $src/hints/$xxfile.sh ; then
3408 elif $test -f $src/hints/$xxxfile.sh ; then
3410 elif $test -f $src/hints/$xxxxfile.sh ; then
3412 elif $test -f "$src/hints/${osname}.sh" ; then
3421 if $test -f Policy.sh ; then
3424 none) dflt="Policy" ;;
3425 *) dflt="Policy $dflt" ;;
3430 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3434 if $test -f Policy.sh ; then
3437 There's also a Policy hint file available, which should make the
3438 site-specific (policy) questions easier to answer.
3445 You may give one or more space-separated answers, or "none" if appropriate.
3446 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3447 previous run of Configure, you may specify it as well as or instead of
3448 OS-specific hints. If hints are provided for your OS, you should use them:
3449 although Perl can probably be built without hints on many platforms, using
3450 hints often improve performance and may enable features that Configure can't
3451 set up on its own. If there are no hints that match your OS, specify "none";
3452 DO NOT give a wrong version or a wrong OS.
3456 rp="Which of these apply, if any?"
3459 for file in $tans; do
3460 if $test X$file = XPolicy -a -f Policy.sh; then
3462 $cat Policy.sh >> UU/config.sh
3463 elif $test -f $src/hints/$file.sh; then
3464 . $src/hints/$file.sh
3465 $cat $src/hints/$file.sh >> UU/config.sh
3466 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3469 : Give one chance to correct a possible typo.
3470 echo "$file.sh does not exist"
3472 rp="hint to use instead?"
3474 for file in $ans; do
3475 if $test -f "$src/hints/$file.sh"; then
3476 . $src/hints/$file.sh
3477 $cat $src/hints/$file.sh >> UU/config.sh
3478 elif $test X$ans = X -o X$ans = Xnone ; then
3481 echo "$file.sh does not exist -- ignored."
3488 : Remember our hint file for later.
3489 if $test -f "$src/hints/$file.sh" ; then
3499 echo "Fetching default answers from $config_sh..." >&4
3503 cp $config_sh config.sh 2>/dev/null
3513 test "$override" && . ./optdef.sh
3515 : Restore computed paths
3516 for file in $loclist $trylist; do
3517 eval $file="\$_$file"
3522 Configure uses the operating system name and version to set some defaults.
3523 The default value is probably right if the name rings a bell. Otherwise,
3524 since spelling matters for me, either accept the default or answer "none"
3531 ''|' '|none) dflt=none ;;
3532 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3535 *) dflt="$osname" ;;
3537 rp="Operating system name?"
3541 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3547 ''|' '|none) dflt=none ;;
3548 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3549 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3551 ''|' ') dflt=none ;;
3556 *) dflt="$osvers" ;;
3558 rp="Operating system version?"
3568 : who configured the system
3569 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3572 cf_by=`(logname) 2>/dev/null`
3575 cf_by=`(whoami) 2>/dev/null`
3577 "") cf_by=unknown ;;
3582 : decide how portable to be. Allow command line overrides.
3583 case "$d_portable" in
3585 *) d_portable="$define" ;;
3588 : set up shell script to do ~ expansion
3594 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3597 if $test -f /bin/csh; then
3598 /bin/csh -f -c "glob \$1"
3603 name=\`$expr x\$1 : '..\([^/]*\)'\`
3604 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3605 if $test ! -d "\$dir"; then
3607 echo "\$me: can't locate home directory for: \$name" >&2
3612 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3628 : now set up to get a file name
3632 cat <<'EOSC' >>getfile
3648 : getfile will accept an answer from the comma-separated list
3649 : enclosed in parentheses even if it does not meet other criteria.
3650 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3651 fn=`echo $fn | sed 's/(.*)//'`
3657 loc_file=`expr $fn : '.*:\(.*\)'`
3658 fn=`expr $fn : '\(.*\):.*'`
3666 */*) fullpath=true;;
3675 *e*) exp_file=true;;
3678 *p*) nopath_ok=true;;
3683 *d*) type='Directory';;
3684 *l*) type='Locate';;
3689 Locate) what='File';;
3694 case "$d_portable" in
3702 while test "$type"; do
3707 true) rp="$rp (~name ok)";;
3710 if test -f UU/getfile.ok && \
3711 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3730 value=`UU/filexp $ans`
3733 if test "$ans" != "$value"; then
3734 echo "(That expands to $value on this system.)"
3748 /*) value="$ansexp" ;;
3749 [a-zA-Z]:/*) value="$ansexp" ;;
3754 echo "I shall only accept a full path name, as in /bin/ls." >&4
3755 echo "Use a ! shell escape if you wish to check pathnames." >&4
3758 echo "Please give a full path name, starting with slash." >&4
3761 echo "Note that using ~name is ok provided it expands well." >&4
3774 for fp in $gfpth; do
3775 if test "X$fp" = X.; then
3780 if test -f "$pf"; then
3782 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3784 echo "($value is not a plain file, but that's ok.)"
3787 if test X"$type" = X; then
3794 for fp in $gfpth; do
3795 if test "X$fp" = X.; then
3800 direxp="$fp/$ansexp"
3802 if test -d "$direxp"; then
3810 if test -d "$ansexp"; then
3811 echo "(Looking for $loc_file in directory $value.)"
3812 value="$value/$loc_file"
3813 ansexp="$ansexp/$loc_file"
3815 if test -f "$ansexp"; then
3818 case "$nopath_ok" in
3819 true) case "$value" in
3821 *) echo "Assuming $value will be in people's path."
3837 if test "$fastread" = yes; then
3842 rp="$what $value doesn't exist. Use that name anyway?"
3861 test "X$gfpthkeep" != Xy && gfpth=""
3864 : determine root of directory hierarchy where package will be installed.
3867 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3870 dflt=`echo "$prefix" | sed 's/.$//'`
3878 By default, $package will be installed in $dflt/bin, manual pages
3879 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3880 installation directories. Typically this is something like /usr/local.
3881 If you wish to have binaries under /usr/bin but other parts of the
3882 installation under /usr/local, that's ok: you will be prompted
3883 separately for each of the installation directories, the prefix being
3884 only used to set the defaults.
3888 rp='Installation prefix to use?'
3896 *) oldprefix="$prefix";;
3905 *) afsroot=$afsroot ;;
3911 $define|true) afs=true ;;
3912 $undef|false) afs=false ;;
3913 *) if test -d $afsroot; then
3921 echo "AFS may be running... I'll be extra cautious then..." >&4
3923 echo "AFS does not seem to be running..." >&4
3926 : determine installation prefix for where package is to be installed.
3930 Since you are running AFS, I need to distinguish the directory in which
3931 files will reside from the directory in which they are installed (and from
3932 which they are presumably copied to the former directory by occult means).
3935 case "$installprefix" in
3936 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3937 *) dflt="$installprefix";;
3942 In some special cases, particularly when building $package for distribution,
3943 it is convenient to distinguish the directory in which files should be
3944 installed from the directory ($prefix) in which they will
3945 eventually reside. For most users, these two directories are the same.
3948 case "$installprefix" in
3950 *) dflt=$installprefix;;
3954 rp='What installation prefix should I use for installing files?'
3956 installprefix="$ans"
3957 installprefixexp="$ansexp"
3959 : Perform the prefixexp/installprefixexp correction if necessary
3960 cat <<EOS >installprefix
3963 cat <<'EOSC' >>installprefix
3964 : Change installation prefix, if necessary.
3965 if $test X"$prefix" != X"$installprefix"; then
3966 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3968 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3971 chmod +x installprefix
3972 $eunicefix installprefix
3974 : Set variables such as privlib and privlibexp from the output of ./getfile
3975 : performing the prefixexp/installprefixexp correction if necessary.
3976 cat <<EOS >setprefixvar
3979 cat <<'EOSC' >>setprefixvar
3980 eval "${prefixvar}=\"\$ans\""
3981 eval "${prefixvar}exp=\"\$ansexp\""
3984 chmod +x setprefixvar
3985 $eunicefix setprefixvar
3987 : set up the script used to warn in case of inconsistency
3996 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
3998 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
3999 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4004 echo "*** WHOA THERE!!! ***" >&4
4005 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4008 rp=" Keep the $hint value?"
4011 y) td=$was; tu=$was;;
4015 : function used to set $1 to $val
4016 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4018 $define$undef) . ./whoa; eval "$var=\$td";;
4019 $undef$define) . ./whoa; eval "$var=\$tu";;
4020 *) eval "$var=$val";;
4024 $define|true|[yY]*) dflt='y';;
4029 Perl can be built to use the SOCKS proxy protocol library. To do so,
4030 Configure must be run with -Dusesocks. If you use SOCKS you also need
4031 to use the PerlIO abstraction layer, this will be implicitly selected.
4033 If this doesn't make any sense to you, just accept the default '$dflt'.
4035 rp='Build Perl for SOCKS?'
4038 y|Y) val="$define" ;;
4045 $define|true|[yY]*) useperlio="$define";;
4048 case "$useperlio" in
4049 $define|true|[yY]*|'') dflt='y';;
4054 Previous version of $package used the standard IO mechanisms as
4055 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4056 alternate IO mechanisms via the PerlIO abstraction layer, but the
4057 stdio mechanism is still available if needed. The abstraction layer
4058 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4059 Using PerlIO with sfio may cause problems with some extension modules.
4061 If this doesn't make any sense to you, just accept the default '$dflt'.
4063 rp='Use the PerlIO abstraction layer?'
4070 echo "Ok, doing things the stdio way."
4079 case "$useperlio" in
4080 $define|true|[yY]*) ;;
4083 You are using the SOCKS proxy protocol library which means that you
4084 should also use the PerlIO layer. You may be headed for trouble.
4093 : get the patchlevel
4095 echo "Getting the current patchlevel..." >&4
4096 if $test -r $rsrc/patchlevel.h;then
4097 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4098 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4099 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4100 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4101 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4102 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4103 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4112 $echo "(You do not have patchlevel.h. Eek.)"
4114 if $test -r $rsrc/.patch ; then
4115 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
4116 perl_patchlevel=`cat $rsrc/.patch`
4119 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4120 version_patchlevel_string="version $patchlevel subversion $subversion"
4121 case "$perl_patchlevel" in
4123 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
4126 $echo "(You have $package $version_patchlevel_string.)"
4130 : XXX Should be a Configure test for double-dots in filenames.
4131 version=`echo $revision $patchlevel $subversion | \
4132 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4133 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4134 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4137 version=`echo $revision $patchlevel $subversion | \
4138 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4139 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4140 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4143 : Special case the 5.005_xx maintenance series, which used 5.005
4144 : without any subversion label as a subdirectory in $sitelib
4145 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4146 api_versionstring='5.005'
4149 case "$usethreads" in
4150 $define|true|[yY]*) dflt='y';;
4151 *) # Catch case where user specified ithreads or 5005threads but
4152 # forgot -Dusethreads (A.D. 4/2002)
4153 case "$useithreads$use5005threads" in
4155 case "$useperlio" in
4156 "$define") dflt='y' ;;
4166 Perl can be built to take advantage of threads on some systems.
4167 To do so, Configure can be run with -Dusethreads.
4169 Note that Perl built with threading support runs slightly slower
4170 and uses more memory than plain Perl. The current implementation
4171 is believed to be stable, but it is fairly new, and so should be
4172 treated with caution.
4174 If this doesn't make any sense to you, just accept the default '$dflt'.
4176 rp='Build a threading Perl?'
4179 y|Y) val="$define" ;;
4185 if $test $patchlevel -lt 9; then
4186 case "$usethreads" in
4190 Since release 5.6, Perl has had two different threading implementations,
4191 the newer interpreter-based version (ithreads) with one interpreter per
4192 thread, and the older 5.005 version (5005threads).
4193 The 5005threads version is effectively unmaintained and will probably be
4194 removed in Perl 5.10, so there should be no need to build a Perl using it
4195 unless needed for backwards compatibility with some existing 5.005threads
4199 : Default to ithreads unless overridden on command line or with
4202 case "$use5005threads" in
4203 $define|true|[yY]*) dflt='n';;
4205 case "$useithreads" in
4206 $undef|false|[nN]*) dflt='n';;
4208 rp='Use the newer interpreter-based ithreads?'
4211 y|Y) val="$define" ;;
4216 : Now set use5005threads to the opposite value.
4217 case "$useithreads" in
4218 $define) val="$undef" ;;
4225 useithreads="$undef"
4226 use5005threads="$undef"
4230 case "$useithreads$use5005threads" in
4234 You cannot have both the ithreads and the 5.005 threads enabled
4235 at the same time. Disabling the 5.005 threads since they are
4236 much less stable than the ithreads.
4239 use5005threads="$undef"
4244 : perl-5.9.x and later
4246 if test X"$usethreads" = "X$define"; then
4247 case "$use5005threads" in
4251 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4258 use5005threads="$undef"
4259 useithreads="$usethreads"
4262 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4265 *** To build with ithreads you must also use the PerlIO layer.
4266 *** Cannot continue, aborting.
4272 case "$d_oldpthreads" in
4273 '') : Configure tests would be welcome here. For now, assume undef.
4275 *) val="$d_oldpthreads" ;;
4281 : Look for a hint-file generated 'call-back-unit'. If the
4282 : user has specified that a threading perl is to be built,
4283 : we may need to set or change some other defaults.
4284 if $test -f usethreads.cbu; then
4285 echo "Your platform has some specific hints regarding threaded builds, using them..."
4288 case "$usethreads" in
4289 "$define"|true|[yY]*)
4291 (Your platform does not have any specific hints for threaded builds.
4292 Assuming POSIX threads, then.)
4300 Perl can be built so that multiple Perl interpreters can coexist
4301 within the same Perl executable.
4304 case "$useithreads" in
4307 This multiple interpreter support is required for interpreter-based threads.
4311 *) case "$usemultiplicity" in
4312 $define|true|[yY]*) dflt='y';;
4316 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4317 rp='Build Perl for multiplicity?'
4320 y|Y) val="$define" ;;
4329 case "$usemorebits" in
4330 "$define"|true|[yY]*)
4331 use64bitint="$define"
4332 uselongdouble="$define"
4333 usemorebits="$define"
4335 *) usemorebits="$undef"
4339 : make some quick guesses about what we are up against
4341 $echo $n "Hmm... $c"
4351 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4352 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4354 echo "Looks kind of like an OSF/1 system, but we'll see..."
4356 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4357 xxx=`./loc addbib blurfl $pth`
4358 if $test -f $xxx; then
4359 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4363 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4364 echo "Looks kind of like an extended USG system, but we'll see..."
4366 echo "Looks kind of like a USG system, but we'll see..."
4370 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4371 echo "Looks kind of like a BSD system, but we'll see..."
4375 echo "Looks kind of like a Version 7 system, but we'll see..."
4378 case "$eunicefix" in
4381 There is, however, a strange, musty smell in the air that reminds me of
4382 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4386 : it so happens the Eunice I know will not run shell scripts in Unix format
4390 echo "Congratulations. You aren't running Eunice."
4394 : Detect OS2. The p_ variable is set above in the Head.U unit.
4395 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4396 : semicolon as a patch separator
4401 I have the feeling something is not exactly right, however...don't tell me...
4402 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4403 (Or you may be running DOS with DJGPP.)
4408 if test -f /xenix; then
4409 echo "Actually, this looks more like a XENIX system..."
4414 echo "It's not Xenix..."
4419 if test -f /venix; then
4420 echo "Actually, this looks more like a VENIX system..."
4427 echo "Nor is it Venix..."
4430 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4431 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4438 rp="Use which C compiler?"
4442 : See if they have not cc but they do have gcc
4444 : Look for a hint-file generated 'call-back-unit'. Now that the
4445 : user has specified the compiler, we may need to set or change some
4447 if $test -f cc.cbu; then
4453 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4457 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4459 printf("%s\n", __VERSION__);
4461 printf("%s\n", "1");
4467 if $cc -o try $ccflags $ldflags try.c; then
4468 gccversion=`$run ./try`
4469 case "$gccversion" in
4470 '') echo "You are not using GNU cc." ;;
4471 *) echo "You are using GNU cc $gccversion."
4477 echo "*** WHOA THERE!!! ***" >&4
4478 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4479 case "$knowitall" in
4481 echo " You'd better start hunting for one and let me know about it." >&4
4487 case "$gccversion" in
4488 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4490 case "$gccversion" in
4491 '') gccosandvers='' ;;
4492 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4493 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4495 case "$gccosandvers" in
4496 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4497 $osname$osvers) ;; # looking good
4498 $osname*) cat <<EOM >&4
4500 *** WHOA THERE!!! ***
4502 Your gcc has not been compiled for the exact release of
4503 your operating system ($gccosandvers versus $osname$osvers).
4505 In general it is a good idea to keep gcc synchronized with
4506 the operating system because otherwise serious problems
4507 may ensue when trying to compile software, like Perl.
4509 I'm trying to be optimistic here, though, and will continue.
4510 If later during the configuration and build icky compilation
4511 problems appear (headerfile conflicts being the most common
4512 manifestation), I suggest reinstalling the gcc to match
4513 your operating system release.
4517 *) gccosandvers='' ;; # failed to parse, better be silent
4525 # gcc 3.* complain about adding -Idirectories that they already know about,
4526 # so we will take those off from locincpth.
4527 case "$gccversion" in
4529 echo "main(){}">try.c
4530 for incdir in $locincpth; do
4531 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4532 grep '^c[cp]p*[01]: warning: changing search order '`
4533 if test "X$warn" != X; then
4534 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4540 : What should the include directory be ?
4542 $echo $n "Hmm... $c"
4546 if $test -f /bin/mips && /bin/mips; then
4547 echo "Looks like a MIPS system..."
4548 $cat >usr.c <<'EOCP'
4549 #ifdef SYSTYPE_BSD43
4553 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4554 dflt='/bsd43/usr/include'
4558 mips_type='System V'
4560 $rm -f usr.c usr.out
4561 echo "and you're compiling with the $mips_type compiler and libraries."
4565 echo "Doesn't look like a MIPS system."
4575 case "$xxx_prompt" in
4578 rp='Where are the include files you want to use?'
4586 : see how we invoke the C preprocessor
4588 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4589 cat <<'EOT' >testcpp.c
4595 if test ! -f cppstdin; then
4596 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4597 # AIX cc -E doesn't show the absolute headerfile
4598 # locations but we'll cheat by using the -M flag.
4599 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
4601 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4604 echo "Keeping your $hint cppstdin wrapper."
4607 wrapper=`pwd`/cppstdin
4611 if $test "X$cppstdin" != "X" && \
4612 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4613 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4615 echo "You used to use $cppstdin $cppminus so we'll use that again."
4617 '') echo "But let's see if we can live without a wrapper..." ;;
4619 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4620 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4622 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4625 echo "(However, $cpprun $cpplast does not work, let's see...)"
4633 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4640 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4641 $cc -E <testcpp.c >testcpp.out 2>&1; \
4642 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4643 echo "Yup, it does."
4646 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4647 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4648 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4649 echo "Yup, it does."
4652 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4653 $cc -P <testcpp.c >testcpp.out 2>&1; \
4654 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4655 echo "Yipee, that works!"
4658 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4659 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4660 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4661 echo "At long last!"
4664 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4665 $cpp <testcpp.c >testcpp.out 2>&1; \
4666 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4670 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4671 $cpp - <testcpp.c >testcpp.out 2>&1; \
4672 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4673 echo "Hooray, it works! I was beginning to wonder."
4676 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4677 $wrapper <testcpp.c >testcpp.out 2>&1; \
4678 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4684 rp="No dice. I can't find a C preprocessor. Name one:"
4688 $x_cpp <testcpp.c >testcpp.out 2>&1
4689 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4690 echo "OK, that will do." >&4
4692 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4707 echo "Perhaps can we force $cc -E using a wrapper..."
4708 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4709 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4715 echo "Nope, we'll have to live without it..."
4729 "$wrapper"|'cppstdin') ;;
4730 *) $rm -f $wrapper;;
4732 $rm -f testcpp.c testcpp.out
4734 : Set private lib path
4737 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4742 '') dlist="$loclibpth $plibpth $glibpth";;
4743 *) dlist="$libpth";;
4746 : Now check and see which directories actually exist, avoiding duplicates
4750 if $test -d $xxx; then
4753 *) libpth="$libpth $xxx";;
4759 Some systems have incompatible or broken versions of libraries. Among
4760 the directories listed in the question below, please remove any you
4761 know not to be holding relevant libraries, and add any that are needed.
4762 Say "none" for none.
4773 rp="Directories to use for library searches?"
4780 : compute shared library extension
4783 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4793 On some systems, shared libraries may be available. Answer 'none' if
4794 you want to suppress searching of shared libraries for the remainder
4795 of this configuration.
4798 rp='What is the file extension used for shared libraries?'
4802 : Define several unixisms.
4803 : Hints files or command line option can be used to override them.
4804 : The convoluted testing is in case hints files set either the old
4807 '') case "$exe_ext" in
4809 *) _exe="$exe_ext" ;;
4814 '') case "$lib_ext" in
4821 '') case "$obj_ext" in
4828 '') case "$path_sep" in
4839 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4841 : Which makefile gets called first. This is used by make depend.
4842 case "$firstmakefile" in
4843 '') firstmakefile='makefile';;
4847 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4850 case "$uselongdouble" in
4851 $define|true|[yY]*) dflt='y';;
4856 Perl can be built to take advantage of long doubles which
4857 (if available) may give more accuracy and range for floating point numbers.
4859 If this doesn't make any sense to you, just accept the default '$dflt'.
4861 rp='Try to use long doubles if available?'
4864 y|Y) val="$define" ;;
4870 case "$uselongdouble" in
4871 true|[yY]*) uselongdouble="$define" ;;
4874 : Look for a hint-file generated 'call-back-unit'. If the
4875 : user has specified that long doubles should be used,
4876 : we may need to set or change some other defaults.
4877 if $test -f uselongdouble.cbu; then
4878 echo "Your platform has some specific hints regarding long doubles, using them..."
4879 . ./uselongdouble.cbu
4881 case "$uselongdouble" in
4884 (Your platform does not have any specific hints for long doubles.)
4890 : Looking for optional libraries
4892 echo "Checking for optional libraries..." >&4
4897 case "$libswanted" in
4898 '') libswanted='c_s';;
4901 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4907 for thisdir in $libpth $xlibpth; do
4908 test -d $thisdir && libspath="$libspath $thisdir"
4910 for thislib in $libswanted; do
4911 for thisdir in $libspath; do
4913 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4914 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4915 $test -f "$xxx" && eval $libscheck
4916 $test -f "$xxx" && libstyle=shared
4918 if test ! -f "$xxx"; then
4919 xxx=$thisdir/lib$thislib.$so
4920 $test -f "$xxx" && eval $libscheck
4921 $test -f "$xxx" && libstyle=shared
4923 if test ! -f "$xxx"; then
4924 xxx=$thisdir/lib$thislib$_a
4925 $test -f "$xxx" && eval $libscheck
4926 $test -f "$xxx" && libstyle=static
4928 if test ! -f "$xxx"; then
4929 xxx=$thisdir/$thislib$_a
4930 $test -f "$xxx" && eval $libscheck
4931 $test -f "$xxx" && libstyle=static
4933 if test ! -f "$xxx"; then
4934 xxx=$thisdir/lib${thislib}_s$_a
4935 $test -f "$xxx" && eval $libscheck
4936 $test -f "$xxx" && libstyle=static
4937 $test -f "$xxx" && thislib=${thislib}_s
4939 if test ! -f "$xxx"; then
4940 xxx=$thisdir/Slib$thislib$_a
4941 $test -f "$xxx" && eval $libscheck
4942 $test -f "$xxx" && libstyle=static
4944 if $test -f "$xxx"; then
4946 shared) echo "Found -l$thislib (shared)." ;;
4947 static) echo "Found -l$thislib." ;;
4948 *) echo "Found -l$thislib ($libstyle)." ;;
4952 *) dflt="$dflt -l$thislib"
4953 libsfound="$libsfound $xxx"
4955 libsfiles="$libsfiles $yyy"
4956 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4957 case " $libsdirs " in
4959 *) libsdirs="$libsdirs $yyy" ;;
4966 if $test ! -f "$xxx"; then
4967 echo "No -l$thislib."
4978 ' '|'') dflt='none';;
4983 In order to compile $package on your machine, a number of libraries
4984 are usually needed. Include any other special libraries here as well.
4985 Say "none" for none. The default list is almost always right.
4989 rp="What libraries to use?"
4996 : determine optimization, if desired, or use for debug flag also
4998 ' '|$undef) dflt='none';;
5000 *) dflt="$optimize";;
5004 By default, $package compiles with the -O flag to use the optimizer.
5005 Alternately, you might want to use the symbolic debugger, which uses
5006 the -g flag (on traditional Unix systems). Either flag can be
5007 specified here. To use neither flag, specify the word "none".
5010 rp="What optimizer/debugger flag should be used?"
5014 'none') optimize=" ";;
5017 : Check what DEBUGGING is required from the command line
5018 : -DEBUGGING or -DDEBUGGING or
5019 : -DEBUGGING=both = -g + -DDEBUGGING
5020 : -DEBUGGING=-g or -Doptimize=-g = -g
5021 : -DEBUGGING=none or -UDEBUGGING =
5022 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5025 *) DEBUGGING=$EBUGGING ;;
5028 case "$DEBUGGING" in
5032 *) optimize="$optimize -g" ;;
5036 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5044 case "$DEBUGGING" in
5045 both|$define) dflt='-DDEBUGGING'
5048 : We will not override a previous value, but we might want to
5049 : augment a hint file
5051 default|recommended)
5052 case "$gccversion" in
5053 1*) dflt="$dflt -fpcc-struct-return" ;;
5055 case "$optimize:$DEBUGGING" in
5056 *-g*:old) dflt="$dflt -DDEBUGGING";;
5058 case "$gccversion" in
5059 2*) if test -d /etc/conf/kconfig.d &&
5060 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5062 # Interactive Systems (ISC) POSIX mode.
5067 case "$gccversion" in
5071 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
5072 echo 'int main(void) { return 0; }' > gcctest.c
5073 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
5074 echo "Yes, it does." 2>&1
5077 echo "Leaving current flags $ccflags alone." 2>&1
5079 *) dflt="$dflt -fno-strict-aliasing" ;;
5082 echo "Nope, it doesn't, but that's ok." 2>&1
5086 # For gcc, adding -pipe speeds up compilations for some, but apparently
5087 # some assemblers can't read from stdin. (It also slows down compilations
5088 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5089 case "$gccversion" in
5091 echo "Checking if your compiler accepts -pipe" 2>&1
5092 echo 'int main(void) { return 0; }' > gcctest.c
5093 if $cc -pipe -o gcctest gcctest.c; then
5094 echo "Yes, it does." 2>&1
5097 echo "Leaving current flags $ccflags alone." 2>&1
5099 *) dflt="$dflt -pipe" ;;
5102 echo "Nope, it doesn't, but that's ok." 2>&1
5109 case "$mips_type" in
5110 *BSD*|'') inclwanted="$locincpth $usrinc";;
5111 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5113 for thisincl in $inclwanted; do
5114 if $test -d $thisincl; then
5115 if $test x$thisincl != x$usrinc; then
5117 *" -I$thisincl "*);;
5118 *) dflt="$dflt -I$thisincl ";;
5124 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5126 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5134 *) dflt="$dflt -D$2";;
5138 set signal.h LANGUAGE_C; eval $inctest
5142 ccflags="$ccflags -DSOCKS"
5147 default|recommended) dflt="$ccflags $dflt" ;;
5148 *) dflt="$ccflags";;
5157 Your C compiler may want other flags. For this question you should include
5158 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5159 but you should NOT include libraries or ld flags like -lwhatever. If you
5160 want $package to honor its debug switch, you should include -DDEBUGGING here.
5161 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5163 To use no flags, specify the word "none".
5169 rp="Any additional cc flags?"
5176 : the following weeds options from ccflags that are of no interest to cpp
5178 '') cppflags="$ccflags" ;;
5179 *) cppflags="$cppflags $ccflags" ;;
5181 case "$gccversion" in
5182 1*) cppflags="$cppflags -D__GNUC__"
5184 case "$mips_type" in
5186 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5192 echo "Let me guess what the preprocessor flags are..." >&4
5206 *) ftry="$previous $flag";;
5208 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5209 >cpp1.out 2>/dev/null && \
5210 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5211 >cpp2.out 2>/dev/null && \
5212 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5213 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5215 cppflags="$cppflags $ftry"
5225 *-*) echo "They appear to be: $cppflags";;
5227 $rm -f cpp.c cpp?.out
5231 : flags used in final linking phase
5233 '') if ./venix; then
5239 *-posix*) dflt="$dflt -posix" ;;
5242 *) dflt="$ldflags";;
5245 : Try to guess additional flags to pick up local libraries.
5246 for thislibdir in $libpth; do
5247 case " $loclibpth " in
5250 *"-L$thislibdir "*) ;;
5251 *) dflt="$dflt -L$thislibdir" ;;
5263 Your C linker may need flags. For this question you should
5264 include -L/whatever and any other flags used by the C linker, but you
5265 should NOT include libraries like -lwhatever.
5267 Make sure you include the appropriate -L/path flags if your C linker
5268 does not normally search all of the directories you specified above,
5271 To use no flags, specify the word "none".
5275 rp="Any additional ld flags (NOT including libraries)?"
5281 rmlist="$rmlist pdp11"
5285 echo "Checking your choice of C compiler and flags for coherency..." >&4
5286 $cat > try.c <<'EOF'
5288 int main() { printf("Ok\n"); return(0); }
5290 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5292 $cat >try.msg <<'EOM'
5293 I've tried to compile and run the following simple program:
5296 $cat try.c >> try.msg
5298 $cat >> try.msg <<EOM
5305 and I got the following output:
5309 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5310 if $sh -c "$run ./try" >>try.msg 2>&1; then
5314 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5317 cat >> try.msg <<'EOQS'
5318 If $libs contains -lsfio, and sfio is mis-configured, then it
5319 sometimes (apparently) runs and exits with a 0 status, but with no
5320 output! It may have to do with sfio's use of _exit vs. exit.
5323 rp="You have a big problem. Shall I abort Configure"
5330 echo "The program compiled OK, but exited with status $?." >>try.msg
5331 rp="You have a problem. Shall I abort Configure"
5335 echo "I can't compile the test program." >>try.msg
5336 rp="You have a BIG problem. Shall I abort Configure"
5342 case "$knowitall" in
5344 echo "(The supplied flags or libraries might be incorrect.)"
5352 *) echo "Ok. Stopping Configure." >&4
5357 n) echo "OK, that should do.";;
5361 : define a shorthand compile call
5365 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5366 : define a shorthand compile call for compilations that should be ok.
5370 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5372 : determine filename position in cpp output
5374 echo "Computing filename position in cpp output for #include directives..." >&4
5376 vos) testaccess=-e ;;
5379 echo '#include <stdio.h>' > foo.c
5382 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5383 $grep '^[ ]*#.*stdio\.h' | \
5384 while read cline; do
5387 while $test \$# -gt 0; do
5388 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5393 pos=\`expr \$pos + 1\`
5405 *) pos="${fieldn}th";;
5407 echo "Your cpp writes the filename in the $pos field of the line."
5410 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5411 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5414 : locate header file
5419 for usrincdir in $usrinc
5421 if test -f \$usrincdir/\$wanted; then
5422 echo "\$usrincdir/\$wanted"
5426 awkprg='{ print \$$fieldn }'
5427 echo "#include <\$wanted>" > foo\$\$.c
5428 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5429 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5430 while read cline; do
5431 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5433 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5434 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5439 # status = 0: grep returned 0 lines, case statement not executed
5440 # status = 1: headerfile found
5441 # status = 2: while loop executed, no headerfile found
5445 if test \$status -eq 1; then
5452 : define an alternate in-header-list? function
5453 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5454 cont=true; xxf="echo \"<\$1> found.\" >&4";
5455 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5456 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5458 case $# in 4) instead=instead;; *) instead="at last";; esac;
5459 while $test "$cont"; do
5461 var=$2; eval "was=\$$2";
5462 if $test "$xxx" && $test -r "$xxx";
5464 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5467 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5468 set $yyy; shift; shift; yyy=$@;
5469 case $# in 0) cont="";;
5470 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5471 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5472 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5473 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5477 do set $yyy; var=$2; eval "was=\$$2";
5478 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5479 set $yyy; shift; shift; yyy=$@;
5482 : see if stdlib is available
5483 set stdlib.h i_stdlib
5486 : check for lengths of integral types
5490 echo "Checking to see how big your integers are..." >&4
5499 printf("intsize=%d;\n", (int)sizeof(int));
5500 printf("longsize=%d;\n", (int)sizeof(long));
5501 printf("shortsize=%d;\n", (int)sizeof(short));
5506 if eval $compile_ok && $run ./try > /dev/null; then
5508 echo "Your integers are $intsize bytes long."
5509 echo "Your long integers are $longsize bytes long."
5510 echo "Your short integers are $shortsize bytes long."
5514 Help! I can't compile and run the intsize test program: please enlighten me!
5515 (This is probably a misconfiguration in your system or libraries, and
5516 you really ought to fix it. Still, I'll try anyway.)
5520 rp="What is the size of an integer (in bytes)?"
5524 rp="What is the size of a long integer (in bytes)?"
5528 rp="What is the size of a short integer (in bytes)?"
5536 : check for long long
5538 echo "Checking to see if you have long long..." >&4
5539 echo 'int main() { long long x = 7; return 0; }' > try.c
5541 if eval $compile; then
5543 echo "You have long long."
5546 echo "You do not have long long."
5552 : check for length of long long
5553 case "${d_longlong}${longlongsize}" in
5556 echo "Checking to see how big your long longs are..." >&4
5557 $cat >try.c <<'EOCP'
5561 printf("%d\n", (int)sizeof(long long));
5566 if eval $compile_ok; then
5567 longlongsize=`$run ./try`
5568 echo "Your long longs are $longlongsize bytes long."
5572 echo "(I can't seem to compile the test program. Guessing...)"
5573 rp="What is the size of a long long (in bytes)?"
5577 if $test "X$longsize" = "X$longlongsize"; then
5578 echo "(That isn't any different from an ordinary long.)"
5584 : see if inttypes.h is available
5585 : we want a real compile instead of Inhdr because some systems
5586 : have an inttypes.h which includes non-existent headers
5589 #include <inttypes.h>
5591 static int32_t foo32 = 0x12345678;
5595 if eval $compile; then
5596 echo "<inttypes.h> found." >&4
5599 echo "<inttypes.h> NOT found." >&4
5608 echo "Checking to see if you have int64_t..." >&4
5610 #include <sys/types.h>
5611 #$i_inttypes I_INTTYPES
5613 #include <inttypes.h>
5615 int main() { int64_t x = 7; }
5618 if eval $compile; then
5620 echo "You have int64_t."
5623 echo "You do not have int64_t."
5631 echo "Checking which 64-bit integer type we could use..." >&4
5637 val='"unsigned int"'
5642 *) case "$longsize" in
5646 val='"unsigned long"'
5651 *) case "$d_longlong:$longlongsize" in
5656 val='"unsigned long long"'
5661 *) case "$d_int64_t" in
5680 '') echo "Alas, no 64-bit integer types in sight." >&4
5683 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5689 case "$uselonglong" in
5690 "$define"|true|[yY]*)
5693 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5695 use64bitint="$define"
5698 case "$use64bits" in
5699 "$define"|true|[yY]*)
5702 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5704 use64bitint="$define"
5707 case "$use64bitints" in
5708 "$define"|true|[yY]*)
5711 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5713 use64bitint="$define"
5716 case "$use64bitsint" in
5717 "$define"|true|[yY]*)
5720 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5722 use64bitint="$define"
5725 case "$uselonglongs" in
5726 "$define"|true|[yY]*)
5729 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5731 use64bitint="$define"
5734 case "$use64bitsall" in
5735 "$define"|true|[yY]*)
5738 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5740 use64bitall="$define"
5745 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5747 case "$use64bitall" in
5748 "$define"|true|[yY]*) use64bitint="$define" ;;
5754 You have natively 64-bit long integers.
5758 *) case "$use64bitint" in
5759 "$define"|true|[yY]*) dflt='y';;
5768 Perl can be built to take advantage of 64-bit integer types
5769 on some systems. To do so, Configure can be run with -Duse64bitint.
5770 Choosing this option will most probably introduce binary incompatibilities.
5772 If this doesn't make any sense to you, just accept the default '$dflt'.
5773 (The default has been chosen based on your configuration.)
5775 rp='Try to use 64-bit integers, if available?'
5778 [yY]*) val="$define" ;;
5786 case "$use64bitall" in
5787 "$define"|true|[yY]*) dflt='y' ;;
5788 *) case "$longsize" in
5796 You may also choose to try maximal 64-bitness. It means using as much
5797 64-bitness as possible on the platform. This in turn means even more
5798 binary incompatibilities. On the other hand, your platform may not
5799 have any more 64-bitness available than what you already have chosen.
5801 If this doesn't make any sense to you, just accept the default '$dflt'.
5802 (The default has been chosen based on your configuration.)
5804 rp='Try to use maximal 64-bit support, if available?'
5807 [yY]*) val="$define" ;;
5812 case "$use64bitall" in
5814 case "$use64bitint" in
5818 Since you have chosen a maximally 64-bit build, I'm also turning on
5819 the use of 64-bit integers.
5821 use64bitint="$define" ;;
5826 : Look for a hint-file generated 'call-back-unit'. If the
5827 : user has specified that a 64-bit perl is to be built,
5828 : we may need to set or change some other defaults.
5829 if $test -f use64bitint.cbu; then
5830 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5833 case "$use64bitint" in
5834 "$define"|true|[yY]*)
5836 4) case "$archname64" in
5837 '') archname64=64int ;;
5844 : Look for a hint-file generated 'call-back-unit'. If the
5845 : user has specified that a maximally 64-bit perl is to be built,
5846 : we may need to set or change some other defaults.
5847 if $test -f use64bitall.cbu; then
5848 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5851 case "$use64bitall" in
5852 "$define"|true|[yY]*)
5854 4) case "$archname64" in
5855 ''|64int) archname64=64all ;;
5862 case "$d_quad:$use64bitint" in
5866 *** You have chosen to use 64-bit integers,
5867 *** but none can be found.
5868 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5869 *** Cannot continue, aborting.
5876 : check for length of double
5878 case "$doublesize" in
5880 echo "Checking to see how big your double precision numbers are..." >&4
5889 printf("%d\n", (int)sizeof(double));
5894 if eval $compile_ok; then
5895 doublesize=`$run ./try`
5896 echo "Your double is $doublesize bytes long."
5899 echo "(I can't seem to compile the test program. Guessing...)"
5900 rp="What is the size of a double precision number (in bytes)?"
5908 : check for long doubles
5910 echo "Checking to see if you have long double..." >&4
5911 echo 'int main() { long double x = 7.0; }' > try.c
5913 if eval $compile; then
5915 echo "You have long double."
5918 echo "You do not have long double."
5924 : check for length of long double
5925 case "${d_longdbl}${longdblsize}" in
5928 echo "Checking to see how big your long doubles are..." >&4
5929 $cat >try.c <<'EOCP'
5933 printf("%d\n", sizeof(long double));
5938 if eval $compile; then
5939 longdblsize=`$run ./try`
5940 echo "Your long doubles are $longdblsize bytes long."
5944 echo "(I can't seem to compile the test program. Guessing...)" >&4
5945 rp="What is the size of a long double (in bytes)?"
5949 if $test "X$doublesize" = "X$longdblsize"; then
5950 echo "That isn't any different from an ordinary double."
5951 echo "I'll keep your setting anyway, but you may see some"
5952 echo "harmless compilation warnings."
5958 : determine the architecture name
5960 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5961 tarch=`arch`"-$osname"
5962 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5963 if uname -m > tmparch 2>&1 ; then
5964 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5965 -e 's/$/'"-$osname/" tmparch`
5973 case "$myarchname" in
5976 echo "(Your architecture name used to be $myarchname.)"
5980 case "$targetarch" in
5982 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5987 *) dflt="$archname";;
5989 rp='What is your architecture name'
5992 case "$usethreads" in
5994 echo "Threads selected." >&4
5996 *-thread*) echo "...and architecture name already has -thread." >&4
5998 *) archname="$archname-thread"
5999 echo "...setting architecture name to $archname." >&4
6004 case "$usemultiplicity" in
6006 echo "Multiplicity selected." >&4
6008 *-multi*) echo "...and architecture name already has -multi." >&4
6010 *) archname="$archname-multi"
6011 echo "...setting architecture name to $archname." >&4
6016 case "$use64bitint$use64bitall" in
6018 case "$archname64" in
6020 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6023 case "$use64bitint" in
6024 "$define") echo "64 bit integers selected." >&4 ;;
6026 case "$use64bitall" in
6027 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6030 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6032 *) archname="$archname-$archname64"
6033 echo "...setting architecture name to $archname." >&4
6039 case "$uselongdouble" in
6041 echo "Long doubles selected." >&4
6042 case "$longdblsize" in
6044 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6048 *-ld*) echo "...and architecture name already has -ld." >&4
6050 *) archname="$archname-ld"
6051 echo "...setting architecture name to $archname." >&4
6058 case "$useperlio" in
6060 echo "Perlio selected." >&4
6063 echo "Perlio not selected, using stdio." >&4
6065 *-stdio*) echo "...and architecture name already has -stdio." >&4
6067 *) archname="$archname-stdio"
6068 echo "...setting architecture name to $archname." >&4
6073 if $test -f archname.cbu; then
6074 echo "Your platform has some specific hints for architecture name, using them..."
6078 : set the prefixit variable, to compute a suitable default value
6079 prefixit='case "$3" in
6081 case "$oldprefix" in
6082 "") eval "$1=\"\$$2\"";;
6089 ""|" ") eval "$1=\"\$$2\"";;
6095 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6097 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6098 /*-$oldprefix/*|\~*-$oldprefix/*)
6099 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6100 *) eval "$1=\"\$$2\"";;
6104 : determine installation style
6105 : For now, try to deduce it from prefix unless it is already set.
6106 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6107 case "$installstyle" in
6108 '') case "$prefix" in
6109 *perl*) dflt='lib';;
6110 *) dflt='lib/perl5' ;;
6113 *) dflt="$installstyle" ;;
6115 : Probably not worth prompting for this since we prompt for all
6116 : the directories individually, and the prompt would be too long and
6120 : determine where public executables go
6125 rp='Pathname where the public executables will reside?'
6127 if $test "X$ansexp" != "X$binexp"; then
6131 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6132 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6133 : this via initialinstalllocation
6136 case "$userelocatableinc" in
6137 $define|true|[yY]*) dflt='y' ;;
6142 Would you like to build Perl so that the installation is relocatable, so that
6143 library paths in @INC are determined relative to the path of the perl binary?
6144 This is not advised for system Perl installs, or if you need to run setid
6145 scripts or scripts under taint mode.
6147 If this doesn't make any sense to you, just accept the default '$dflt'.
6149 rp='Use relocatable @INC?'
6152 y|Y) val="$define" ;;
6155 set userelocatableinc
6158 initialinstalllocation="$binexp"
6159 : Default prefix is now "up one level from where the binaries are"
6160 case "$userelocatableinc" in
6166 installprefixexp=".../.."
6170 : determine where private library files go
6171 : Usual default is /usr/local/lib/perl5/$version.
6172 : Also allow things like /opt/perl/lib/$version, since
6173 : /opt/perl/lib/perl5... would be redundant.
6174 : The default "style" setting is made in installstyle.U
6175 case "$installstyle" in
6176 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6177 *) set dflt privlib lib/$version ;;
6182 There are some auxiliary files for $package that need to be put into a
6183 private library directory that is accessible by everyone.
6188 rp='Pathname where the private library files will reside?'
6193 : set the prefixup variable, to restore leading tilda escape
6194 prefixup='case "$prefixexp" in
6196 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6199 : determine where public architecture dependent libraries go
6202 : privlib default is /usr/local/lib/$package/$version
6203 : archlib default is /usr/local/lib/$package/$version/$archname
6204 : privlib may have an optional trailing /share.
6205 tdflt=`echo $privlib | $sed 's,/share$,,'`
6206 tdflt=$tdflt/$archname
6215 $spackage contains architecture-dependent library files. If you are
6216 sharing libraries in a heterogeneous environment, you might store
6217 these files in a separate location. Otherwise, you can just include
6218 them with the rest of the public library files.
6223 rp='Where do you want to put the public architecture-dependent libraries?'
6227 if $test X"$archlib" = X"$privlib"; then
6233 : see if setuid scripts can be secure
6236 Some kernels have a bug that prevents setuid #! scripts from being
6237 secure. Some sites have disabled setuid #! scripts because of this.
6239 First let's decide if your kernel supports secure setuid #! scripts.
6240 (If setuid #! scripts would be secure but have been disabled anyway,
6241 don't say that they are secure if asked.)
6246 if $test -d /dev/fd; then
6247 echo "#!$ls" >reflect
6248 chmod +x,u+s reflect
6249 ./reflect >flect 2>&1
6250 if $contains "/dev/fd" flect >/dev/null; then
6251 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6255 If you are not sure if they are secure, I can check but I'll need a
6256 username and password different from the one you are using right now.
6257 If you don't have such a username or don't want me to test, simply
6261 rp='Other username to test security of setuid scripts with?'
6266 case "$d_suidsafe" in
6267 '') echo "I'll assume setuid scripts are *not* secure." >&4
6270 echo "Well, the $hint value is *not* secure." >&4
6272 *) echo "Well, the $hint value *is* secure." >&4
6277 $rm -f reflect flect
6278 echo "#!$ls" >reflect
6279 chmod +x,u+s reflect
6282 echo '"su" will (probably) prompt you for '"$ans's password."
6283 su $ans -c './reflect >flect'
6284 if $contains "/dev/fd" flect >/dev/null; then
6285 echo "Okay, it looks like setuid scripts are secure." >&4
6288 echo "I don't think setuid scripts are secure." >&4
6293 rp='Does your kernel have *secure* setuid scripts?'
6296 [yY]*) val="$define";;
6301 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6302 echo "(That's for file descriptors, not floppy disks.)"
6308 $rm -f reflect flect
6310 : now see if they want to do setuid emulation
6313 case "$d_suidsafe" in
6316 echo "No need to emulate SUID scripts since they are secure here." >&4
6320 Some systems have disabled setuid scripts, especially systems where
6321 setuid scripts cannot be secure. On systems where setuid scripts have
6322 been disabled, the setuid/setgid bits on scripts are currently
6323 useless. It is possible for $package to detect those bits and emulate
6324 setuid/setgid in a secure fashion. This emulation will only work if
6325 setuid scripts have been disabled in your kernel.
6329 "$define") dflt=y ;;
6332 rp="Do you want to do setuid/setgid emulation?"
6335 [yY]*) val="$define";;
6343 : Find perl5.005 or later.
6344 echo "Looking for a previously installed perl5.005 or later... "
6346 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6347 : Check if this perl is recent and can load a simple module
6348 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6351 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6361 '') echo "None found. That's ok.";;
6362 *) echo "Using $perl5." ;;
6367 After $package is installed, you may wish to install various
6368 add-on modules and utilities. Typically, these add-ons will
6369 be installed under $prefix with the rest
6370 of this package. However, you may wish to install such add-ons
6371 elsewhere under a different prefix.
6373 If you do not wish to put everything under a single prefix, that's
6374 ok. You will be prompted for the individual locations; this siteprefix
6375 is only used to suggest the defaults.
6377 The default should be fine for most people.
6381 rp='Installation prefix to use for add-on modules and utilities?'
6382 : XXX Here might be another good place for an installstyle setting.
6383 case "$siteprefix" in
6385 *) dflt=$siteprefix ;;
6388 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6390 case "$siteprefix" in
6394 *) oldsiteprefix="$prefix";;
6399 siteprefixexp="$ansexp"
6401 : determine where site specific libraries go.
6402 : Usual default is /usr/local/lib/perl5/site_perl/$version
6403 : The default "style" setting is made in installstyle.U
6404 : XXX No longer works with Prefixit stuff.
6405 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6407 '') case "$installstyle" in
6408 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6409 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6417 The installation process will create a directory for
6418 site-specific extensions and modules. Most users find it convenient
6419 to place all site-specific files in this directory rather than in the
6420 main distribution directory.
6424 rp='Pathname for the site-specific library files?'
6428 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6430 : Determine list of previous versions to include in @INC
6431 $cat > getverlist <<EOPL
6434 \$api_versionstring = "$api_versionstring";
6435 \$version = "$version";
6436 \$stem = "$sitelib_stem";
6437 \$archname = "$archname";
6439 $cat >> getverlist <<'EOPL'
6440 # The list found is store twice for each entry: the original name, and
6441 # the binary broken down version as pack "sss", so sorting is easy and
6442 # unambiguous. This will work for all versions that have a maximum of
6443 # three digit groups, separate by '.'s or '_'s. Names are extended with
6444 # ".0.0" to ensure at least three elements for the pack.
6445 # -- H.Merijn Brand (m)'06 23-10-2006
6447 # Can't have leading @ because metaconfig interprets it as a command!
6448 ;@inc_version_list=();
6449 # XXX Redo to do opendir/readdir?
6452 ;@candidates = map {
6453 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6459 ($pversion, $aversion, $vsn5005) = map {
6460 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6461 foreach $d (@candidates) {
6462 if ($d->[1] lt $pversion) {
6463 if ($d->[1] ge $aversion) {
6464 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6466 elsif ($d->[1] ge $vsn5005) {
6467 unshift(@inc_version_list, grep { -d } $d->[0]);
6471 # Skip newer version. I.e. don't look in
6472 # 5.7.0 if we're installing 5.6.1.
6476 if (@inc_version_list) {
6477 print join(' ', @inc_version_list);
6480 # Blank space to preserve value for next Configure run.
6485 case "$inc_version_list" in
6486 '') if test -x "$perl5$exe_ext"; then
6487 dflt=`$perl5 getverlist`
6492 $undef) dflt='none' ;;
6493 *) eval dflt=\"$inc_version_list\" ;;
6496 ''|' ') dflt=none ;;
6503 In order to ease the process of upgrading, this version of perl
6504 can be configured to use modules built and installed with earlier
6505 versions of perl that were installed under $prefix. Specify here
6506 the list of earlier versions that this version of perl should check.
6507 If Configure detected no earlier versions of perl installed under
6508 $prefix, then the list will be empty. Answer 'none' to tell perl
6509 to not search earlier versions.
6511 The default should almost always be sensible, so if you're not sure,
6512 just accept the default.
6515 rp='List of earlier versions to include in @INC?'
6518 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6519 *) inc_version_list="$ans" ;;
6521 case "$inc_version_list" in
6523 inc_version_list_init='0'
6524 d_inc_version_list="$undef"
6526 *) inc_version_list_init=`echo $inc_version_list |
6527 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6528 d_inc_version_list="$define"
6533 : see if this is a malloc.h system
6534 : we want a real compile instead of Inhdr because some systems have a
6535 : malloc.h that just gives a compile error saying to use stdlib.h instead
6540 int main () { return 0; }
6543 if eval $compile; then
6544 echo "<malloc.h> found." >&4
6547 echo "<malloc.h> NOT found." >&4
6554 : check for void type
6556 echo "Checking to see how well your C compiler groks the void type..." >&4
6557 case "$voidflags" in
6569 extern void moo(); /* function returning void */
6570 void (*goo)(); /* ptr to func returning void */
6572 void *hue; /* generic ptr */
6585 int main() { sub(); }
6587 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6588 voidflags=$defvoidused
6589 echo "Good. It appears to support void to the level $package wants.">&4
6590 if $contains warning .out >/dev/null 2>&1; then
6591 echo "However, you might get some warnings that look like this:"
6595 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6596 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6597 echo "It supports 1..."
6598 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6599 echo "It also supports 2..."
6600 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6602 echo "And it supports 4 but not 8 definitely."
6604 echo "It doesn't support 4..."
6605 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6607 echo "But it supports 8."
6610 echo "Neither does it support 8."
6614 echo "It does not support 2..."
6615 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6617 echo "But it supports 4 and 8."
6619 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6621 echo "And it supports 4 but has not heard about 8."
6623 echo "However it supports 8 but not 4."
6628 echo "There is no support at all for void."
6633 case "$voidflags" in
6636 Support flag bits are:
6637 1: basic void declarations.
6638 2: arrays of pointers to functions returning void.
6639 4: operations between pointers to and addresses of void functions.
6640 8: generic void pointers.
6643 rp="Your void support flags add up to what?"
6650 : check for length of pointer
6654 echo "Checking to see how big your pointers are..." >&4
6655 if test "$voidflags" -gt 7; then
6656 echo '#define VOID_PTR char *' > try.c
6658 echo '#define VOID_PTR void *' > try.c
6668 printf("%d\n", (int)sizeof(VOID_PTR));
6673 if eval $compile_ok; then
6674 ptrsize=`$run ./try`
6675 echo "Your pointers are $ptrsize bytes long."
6678 echo "(I can't seem to compile the test program. Guessing...)" >&4
6679 rp="What is the size of a pointer (in bytes)?"
6686 case "$use64bitall" in
6687 "$define"|true|[yY]*)
6691 *** You have chosen a maximally 64-bit build,
6692 *** but your pointers are only 4 bytes wide.
6693 *** Please rerun Configure without -Duse64bitall.
6698 *** Since you have quads, you could possibly try with -Duse64bitint.
6703 *** Cannot continue, aborting.
6714 : determine whether to use malloc wrapping
6716 case "$usemallocwrap" in
6717 [yY]*|true|$define) dflt='y' ;;
6718 [nN]*|false|$undef) dflt='n' ;;
6719 *) case "$usedevel" in
6720 [yY]*|true|$define) dflt='y' ;;
6725 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6727 usemallocwrap="$ans"
6730 usemallocwrap="$define" ;;
6732 usemallocwrap="$undef" ;;
6735 : determine which malloc to compile in
6737 case "$usemymalloc" in
6738 [yY]*|true|$define) dflt='y' ;;
6739 [nN]*|false|$undef) dflt='n' ;;
6740 *) case "$ptrsize" in
6746 rp="Do you wish to attempt to use the malloc that comes with $package?"
6752 mallocsrc='malloc.c'
6753 mallocobj="malloc$_o"
6754 d_mymalloc="$define"
6757 : Remove malloc from list of libraries to use
6758 echo "Removing unneeded -lmalloc from library list" >&4
6759 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6762 echo "libs = $libs" >&4
6774 : compute the return types of malloc and free
6776 $cat >malloc.c <<END
6780 #include <sys/types.h>
6794 case "$malloctype" in
6796 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6803 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6807 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6814 echo "Your system uses $freetype free(), it would seem." >&4
6816 : determine where site specific architecture-dependent libraries go.
6817 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6818 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6819 : sitelib may have an optional trailing /share.
6821 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6822 dflt="$dflt/$archname"
6827 set sitearch sitearch none
6831 The installation process will also create a directory for
6832 architecture-dependent site-specific extensions and modules.
6836 rp='Pathname for the site-specific architecture-dependent library files?'
6840 if $test X"$sitearch" = X"$sitelib"; then
6843 d_sitearch="$define"
6848 The installation process will also create a directory for
6849 vendor-supplied add-ons. Vendors who supply perl with their system
6850 may find it convenient to place all vendor-supplied files in this
6851 directory rather than in the main distribution directory. This will
6852 ease upgrades between binary-compatible maintenance versions of perl.
6854 Of course you may also use these directories in whatever way you see
6855 fit. For example, you might use them to access modules shared over a
6856 company-wide network.
6858 The default answer should be fine for most people.
6859 This causes further questions about vendor add-ons to be skipped
6860 and no vendor-specific directories will be configured for perl.
6863 rp='Do you want to configure vendor-specific add-on directories?'
6864 case "$usevendorprefix" in
6865 define|true|[yY]*) dflt=y ;;
6866 *) : User may have set vendorprefix directly on Configure command line.
6867 case "$vendorprefix" in
6876 rp='Installation prefix to use for vendor-supplied add-ons?'
6877 case "$vendorprefix" in
6879 *) dflt=$vendorprefix ;;
6882 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6884 case "$vendorprefix" in
6888 *) oldvendorprefix="$prefix";;
6892 usevendorprefix="$define"
6894 vendorprefixexp="$ansexp"
6896 *) usevendorprefix="$undef"
6902 case "$vendorprefix" in
6903 '') d_vendorlib="$undef"
6907 *) d_vendorlib="$define"
6908 : determine where vendor-supplied modules go.
6909 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6910 case "$vendorlib" in
6912 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6913 case "$installstyle" in
6914 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6915 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6918 *) dflt="$vendorlib"
6922 rp='Pathname for the vendor-supplied library files?'
6925 vendorlibexp="$ansexp"
6928 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6932 case "$vendorprefix" in
6933 '') d_vendorarch="$undef"
6937 *) d_vendorarch="$define"
6938 : determine where vendor-supplied architecture-dependent libraries go.
6939 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6940 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6941 : vendorlib may have an optional trailing /share.
6942 case "$vendorarch" in
6943 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6944 dflt="$dflt/$archname"
6946 *) dflt="$vendorarch" ;;
6949 rp='Pathname for vendor-supplied architecture-dependent files?'
6952 vendorarchexp="$ansexp"
6955 prefixvar=vendorarch
6958 : Final catch-all directories to search
6961 Lastly, you can have perl look in other directories for extensions and
6962 modules in addition to those already specified.
6963 These directories will be searched after
6967 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6968 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6970 case "$otherlibdirs" in
6971 ''|' ') dflt='none' ;;
6972 *) dflt="$otherlibdirs" ;;
6975 Enter a colon-separated set of extra paths to include in perl's @INC
6976 search path, or enter 'none' for no extra paths.
6980 rp='Colon-separated list of additional directories for perl to search?'
6983 ' '|''|none) otherlibdirs=' ' ;;
6984 *) otherlibdirs="$ans" ;;
6986 case "$otherlibdirs" in
6990 set d_perl_otherlibdirs
6993 : Cruising for prototypes
6995 echo "Checking out function prototypes..." >&4
6996 $cat >prototype.c <<EOCP
7001 int main(int argc, char *argv[]) {
7004 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7005 echo "Your C compiler appears to support function prototypes."
7008 echo "Your C compiler doesn't seem to understand function prototypes."
7015 case "$prototype" in
7017 *) ansi2knr='ansi2knr'
7022 This version of $package can only be compiled by a compiler that
7023 understands function prototypes. Unfortunately, your C compiler
7025 doesn't seem to understand them. Sorry about that.
7027 If GNU cc is available for your system, perhaps you could try that instead.
7029 Eventually, we hope to support building Perl with pre-ANSI compilers.
7030 If you would like to help in that effort, please contact <perlbug@perl.org>.
7032 Aborting Configure now.
7044 Perl can be built with extra modules or bundles of modules which
7045 will be fetched from the CPAN and installed alongside Perl.
7047 Notice that you will need access to the CPAN; either via the Internet,
7048 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7049 be asked later to configure the CPAN.pm module which will in turn do
7050 the installation of the rest of the extra modules or bundles.)
7052 Notice also that if the modules require any external software such as
7053 libraries and headers (the libz library and the zlib.h header for the
7054 Compress::Zlib module, for example) you MUST have any such software
7055 already installed, this configuration process will NOT install such
7058 If this doesn't make any sense to you, just accept the default '$dflt'.
7060 rp='Install any extra modules (y or n)?'
7066 Please list any extra modules or bundles to be installed from CPAN,
7067 with spaces between the names. The names can be in any format the
7068 'install' command of CPAN.pm will understand. (Answer 'none',
7069 without the quotes, to install no extra modules or bundles.)
7079 $rm -f ../extras.lst
7081 *) echo "(Saving the list of extras for later...)"
7082 echo "$extras" > ../extras.lst
7090 : determine where html pages for programs go
7091 set html1dir html1dir none
7095 If you wish to install html files for programs in $spackage, indicate
7096 the appropriate directory here. To skip installing html files,
7100 ''|none|$undef|' ') dflt=none ;;
7101 *) dflt=$html1dir ;;
7104 rp="Directory for the main $spackage html pages?"
7108 : Use ' ' for none so value is preserved next time through Configure
7109 $test X"$html1dir" = "X" && html1dir=' '
7111 : determine where html pages for libraries and modules go
7112 set html3dir html3dir none
7116 If you wish to install html files for modules associated with $spackage,
7117 indicate the appropriate directory here. To skip installing html files,
7120 : There is no obvious default. If they have specified html1dir, then
7121 : try to key off that, possibly changing .../html1 into .../html3.
7123 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7124 *) dflt=$html3dir ;;
7127 rp="Directory for the $spackage module html pages?"
7131 : Use ' ' for none so value is preserved next time through Configure
7132 $test X"$html3dir" = "X" && html3dir=' '
7134 : determine whether to install perl also as /usr/bin/perl
7137 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7139 Many scripts expect perl to be installed as /usr/bin/perl.
7141 If you want to, I can install the perl you are about to compile
7142 as /usr/bin/perl (in addition to $bin/perl).
7144 if test -f /usr/bin/perl; then
7147 However, please note that because you already have a /usr/bin/perl,
7148 overwriting that with a new Perl would very probably cause problems.
7149 Therefore I'm assuming you don't want to do that (unless you insist).
7152 case "$installusrbinperl" in
7153 "$define"|[yY]*) dflt='y';;
7159 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7162 case "$installusrbinperl" in
7163 "$undef"|[nN]*) dflt='n';;
7167 rp="Do you want to install perl as /usr/bin/perl?"
7170 [yY]*) val="$define";;
7176 set installusrbinperl
7180 echo "Checking for GNU C Library..." >&4
7182 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7183 alone are insufficient to distinguish different versions, such as
7184 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7185 libc version 2.1.0. A. Dougherty, June 3, 2002.
7191 # ifdef __GLIBC_MINOR__
7192 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7193 # include <gnu/libc-version.h>
7194 printf("%s\n", gnu_get_libc_version());
7196 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7199 printf("%d\n", __GLIBC__);
7208 if eval $compile_ok && $run ./try > glibc.ver; then
7210 gnulibc_version=`$cat glibc.ver`
7211 echo "You are using the GNU C Library version $gnulibc_version"
7215 echo "You are not using the GNU C Library"
7221 : see if nm is to be used to determine whether a symbol is defined or not
7225 case "$d_gnulibc" in
7228 echo "nm probably won't work on the GNU C Library." >&4
7234 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7236 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7237 echo "'nm' won't be sufficient on this sytem." >&4
7243 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7244 if $test $dflt -gt 20; then
7254 true|$define) dflt=y;;
7261 I can use $nm to extract the symbols from your C libraries. This
7262 is a time consuming task which may generate huge output on the disk (up
7263 to 3 megabytes) but that should make the symbols extraction faster. The
7264 alternative is to skip the 'nm' extraction part and to compile a small
7265 test program instead to determine whether each symbol is present. If
7266 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7267 this may be the best solution.
7269 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7272 rp="Shall I use $nm to extract C symbols from the libraries?"
7275 [Nn]*) usenm=false;;
7284 : nm options which may be necessary
7286 '') if $test -f /mach_boot; then
7288 elif $test -d /usr/ccs/lib; then
7289 nm_opt='-p' # Solaris (and SunOS?)
7290 elif $test -f /dgux; then
7292 elif $test -f /lib64/rld; then
7293 nm_opt='-p' # 64-bit Irix
7299 : nm options which may be necessary for shared libraries but illegal
7300 : for archive libraries. Thank you, Linux.
7301 case "$nm_so_opt" in
7302 '') case "$myuname" in
7304 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7305 nm_so_opt='--dynamic'
7314 : get list of predefined functions in a handy place
7319 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7325 *) for thislib in $libs; do
7328 : Handle C library specially below.
7331 thislib=`echo $thislib | $sed -e 's/^-l//'`
7332 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7334 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7336 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7338 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7340 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7342 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7344 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7349 libnames="$libnames $try"
7351 *) libnames="$libnames $thislib" ;;
7360 for xxx in $libpth; do
7361 $test -r $1 || set $xxx/libc.$so
7362 : The messy sed command sorts on library version numbers.
7364 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7365 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7367 s/[0-9][0-9]*/0000&/g
7368 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7371 $sort | $sed -e 's/^.* //'`
7374 $test -r $1 || set /usr/ccs/lib/libc.$so
7375 $test -r $1 || set /lib/libsys_s$_a
7381 if $test -r "$1"; then
7382 echo "Your (shared) C library seems to be in $1."
7384 elif $test -r /lib/libc && $test -r /lib/clib; then
7385 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7387 libc='/lib/clib /lib/libc'
7388 if $test -r /lib/syslib; then
7389 echo "(Your math library is in /lib/syslib.)"
7390 libc="$libc /lib/syslib"
7392 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7393 echo "Your C library seems to be in $libc, as you said before."
7394 elif $test -r $incpath/usr/lib/libc$_a; then
7395 libc=$incpath/usr/lib/libc$_a;
7396 echo "Your C library seems to be in $libc. That's fine."
7397 elif $test -r /lib/libc$_a; then
7399 echo "Your C library seems to be in $libc. You're normal."
7401 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7403 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7404 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7405 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7407 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7409 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7412 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7414 if $test -r "$tans"; then
7415 echo "Your C library seems to be in $tans, of all places."
7421 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7425 If the guess above is wrong (which it might be if you're using a strange
7426 compiler, or your machine supports multiple models), you can override it here.
7431 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7433 I can't seem to find your C library. I've looked in the following places:
7436 $sed 's/^/ /' libpath
7439 None of these seems to contain your C library. I need to get its name...
7444 rp='Where is your C library?'
7449 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7450 set X `cat libnames`
7453 case $# in 1) xxx=file; esac
7454 echo "Extracting names from the following $xxx for later perusal:" >&4
7456 $sed 's/^/ /' libnames >&4
7458 $echo $n "This may take a while...$c" >&4
7462 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7463 *) $nm $nm_opt $file 2>/dev/null;;
7468 $grep fprintf libc.tmp > libc.ptf
7469 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7470 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7472 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7474 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7476 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7478 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7480 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7482 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7484 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7486 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7488 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7490 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7492 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7494 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7496 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7497 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7499 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7501 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7503 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7505 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7507 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7509 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7511 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7513 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7515 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7517 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7519 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7521 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7523 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7525 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7527 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7530 $nm -p $* 2>/dev/null >libc.tmp
7531 $grep fprintf libc.tmp > libc.ptf
7532 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7533 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7539 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7541 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7542 for thisname in $libnames $libc; do
7543 $ar t $thisname >>libc.tmp
7545 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7547 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7548 # Repeat libc to extract forwarders to DLL entries too
7549 for thisname in $libnames $libc; do
7550 $ar tv $thisname >>libc.tmp
7551 # Revision 50 of EMX has bug in $ar.
7552 # it will not extract forwarders to DLL entries
7553 # Use emximp which will extract exactly them.
7554 emximp -o tmp.imp $thisname \
7556 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7557 < tmp.imp >>libc.tmp
7560 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7563 echo "$ar didn't seem to work right." >&4
7564 echo "Maybe this is a Cray...trying bld instead..." >&4
7565 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7567 for thisname in $libnames; do
7569 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7570 $ar t $thisname >>libc.tmp
7574 echo "That didn't work either. Giving up." >&4
7584 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7585 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7587 *) if $test -f /lib/syscalls.exp; then
7589 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7590 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7596 $rm -f libnames libpath
7598 : see if dld is available
7604 echo "Checking for C++..." >&4
7605 $cat >try.c <<'EOCP'
7617 if eval $compile_ok && $run ./try; then
7619 echo "You are using a C++ compiler."
7622 echo "You are not using a C++ compiler."
7628 : is a C symbol defined?
7631 -v) tf=libc.tmp; tdc="";;
7632 -a) tf=libc.tmp; tdc="[]";;
7633 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7636 case "$reuseval-$4" in
7638 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7643 case "$d_cplusplus" in
7644 $define) extern_C=\"C\";;
7646 if $test "$runnm" = true; then
7647 if $contains $tlook $tf >/dev/null 2>&1; then
7649 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7650 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7651 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7652 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7656 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7657 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7663 $define) tval=true;;
7670 : define an is-in-libc? function
7671 inlibc='echo " "; td=$define; tu=$undef;
7672 sym=$1; var=$2; eval "was=\$$2";
7674 case "$reuseval$was" in
7684 echo "$sym() found." >&4;
7685 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7687 echo "$sym() NOT found." >&4;
7688 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7692 $define) echo "$sym() found." >&4;;
7693 *) echo "$sym() NOT found." >&4;;
7697 : see if dlopen exists
7699 xxx_ccflags="$ccflags"
7701 : with g++ one needs -shared to get is-in-libc to work for dlopen
7702 case "$gccversion" in
7704 *) case "$d_cplusplus" in
7705 "$define") ccflags="$ccflags -shared" ;;
7712 ccflags="$xxx_ccflags"
7714 : see if this is a unistd.h system
7715 set unistd.h i_unistd
7718 : determine which dynamic loading, if any, to compile in
7720 dldir="ext/DynaLoader"
7733 $define) dflt='y' ;;
7736 $define) dflt='y' ;;
7738 : Does a dl_xxx.xs file exist for this operating system
7739 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7742 rp="Do you wish to use dynamic loading?"
7749 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7750 dflt="$dldir/dl_${osname}.xs"
7751 elif $test "$d_dlopen" = "$define" ; then
7752 dflt="$dldir/dl_dlopen.xs"
7753 elif $test "$i_dld" = "$define" ; then
7754 dflt="$dldir/dl_dld.xs"
7759 *) dflt="$dldir/$dlsrc"
7762 echo "The following dynamic loading files are available:"
7763 : Can not go over to $dldir because getfile has path hard-coded in.
7764 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7765 rp="Source file to use for dynamic loading"
7771 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7775 Some systems may require passing special flags to $cc -c to
7776 compile modules that will be used to create a shared library.
7777 To use no flags, say "none".
7780 case "$cccdlflags" in
7781 '') case "$gccversion" in
7782 '') case "$osname" in
7784 next) dflt='none' ;;
7785 irix*) dflt='-KPIC' ;;
7786 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7787 sunos) dflt='-pic' ;;
7791 *) case "$osname" in
7792 darwin) dflt='none' ;;
7793 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7798 *) dflt="$cccdlflags" ;;
7800 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7803 none) cccdlflags=' ' ;;
7804 *) cccdlflags="$ans" ;;
7809 Some systems use ld to create libraries that can be dynamically loaded,
7810 while other systems (such as those using ELF) use $cc.
7814 '') $cat >try.c <<EOM
7815 /* Test for whether ELF binaries are produced */
7827 int i = open("a.out",O_RDONLY);
7830 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7831 exit(0); /* succeed (yes, it's ELF) */
7836 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7838 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7842 echo "I'll use ld to build dynamic libraries."
7851 rp="What command should be used to create dynamic libraries?"
7857 Some systems may require passing special flags to $ld to create a
7858 library that can be dynamically loaded. If your ld flags include
7859 -L/other/path options to locate libraries outside your loader's normal
7860 search path, you may need to specify those -L options here as well. To
7861 use no flags, say "none".
7864 case "$lddlflags" in
7865 '') case "$osname" in
7866 beos) dflt='-nostart' ;;
7868 case "$gccversion" in
7869 '') dflt="$dflt +vnocompatwarnings" ;;
7872 linux|irix*|gnu*) dflt="-shared $optimize" ;;
7873 next) dflt='none' ;;
7874 solaris) dflt='-G' ;;
7875 sunos) dflt='-assert nodefinitions' ;;
7876 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7880 *) dflt="$lddlflags" ;;
7883 : Try to guess additional flags to pick up local libraries.
7884 : Be careful not to append to a plain 'none'
7888 for thisflag in $ldflags; do
7893 *) dflt="$dflt $thisflag" ;;
7900 ''|' ') dflt='none' ;;
7903 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7906 none) lddlflags=' ' ;;
7907 *) lddlflags="$ans" ;;
7912 Some systems may require passing special flags to $cc to indicate that
7913 the resulting executable will use dynamic linking. To use no flags,
7917 case "$ccdlflags" in
7918 '') case "$osname" in
7919 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7920 next|sunos) dflt='none' ;;
7924 *) dflt="$ccdlflags" ;;
7926 rp="Any special flags to pass to $cc to use dynamic linking?"
7929 none) ccdlflags=' ' ;;
7930 *) ccdlflags="$ans" ;;
7944 # No dynamic loading being used, so don't bother even to prompt.
7947 *) case "$useshrplib" in
7948 '') case "$osname" in
7949 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7951 also='Building a shared libperl is required for dynamic loading to work on your system.'
7956 also='Building a shared libperl is needed for MAB support.'
7974 The perl executable is normally obtained by linking perlmain.c with
7975 libperl${_a}, any static extensions (usually just DynaLoader), and
7976 any other libraries needed on this system (such as -lm, etc.). Since
7977 your system supports dynamic loading, it is probably possible to build
7978 a shared libperl.$so. If you will have more than one executable linked
7979 to libperl.$so, this will significantly reduce the size of each
7980 executable, but it may have a noticeable effect on performance. The
7981 default is probably sensible for your system.
7985 rp="Build a shared libperl.$so (y/n)"
7989 useshrplib='true' ;;
7990 *) useshrplib='false' ;;
7995 case "$useshrplib" in
7999 # Figure out a good name for libperl.so. Since it gets stored in
8000 # a version-specific architecture-dependent library, the version
8001 # number isn't really that important, except for making cc/ld happy.
8003 # A name such as libperl.so.3.1
8004 majmin="libperl.$so.$patchlevel.$subversion"
8005 # A name such as libperl.so.301
8006 majonly=`echo $patchlevel $subversion |
8007 $awk '{printf "%d%02d", $1, $2}'`
8008 majonly=libperl.$so.$majonly
8009 # I'd prefer to keep the os-specific stuff here to a minimum, and
8010 # rely on figuring it out from the naming of libc.
8011 case "${osname}${osvers}" in
8014 # XXX How handle the --version stuff for MAB?
8016 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8019 cygwin*) # ld links against an importlib
8020 dflt=libperl$lib_ext
8022 *) # Try to guess based on whether libc has major.minor.
8024 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8025 *libc.$so.[0-9]*) dflt=$majonly ;;
8026 *) dflt=libperl.$so ;;
8036 I need to select a good name for the shared libperl. If your system uses
8037 library names with major and minor numbers, then you might want something
8038 like $majmin. Alternatively, if your system uses a single version
8039 number for shared libraries, then you might want to use $majonly.
8040 Or, your system might be quite happy with a simple libperl.$so.
8042 Since the shared libperl will get installed into a version-specific
8043 architecture-dependent directory, the version number of the shared perl
8044 library probably isn't important, so the default should be o.k.
8047 rp='What name do you want to give to the shared libperl?'
8050 echo "Ok, I'll use $libperl"
8053 libperl="libperl${_a}"
8057 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8061 WARNING: Use of the shrpdir variable for the installation location of
8062 the shared $libperl is not supported. It was never documented and
8063 will not work in this version. Let me (perlbug@perl.org)
8064 know of any problems this may cause.
8070 But your current setting of $shrpdir is
8071 the default anyway, so it's harmless.
8076 Further, your current attempted setting of $shrpdir
8077 conflicts with the value of $archlibexp/CORE
8078 that installperl will use.
8085 # How will the perl executable find the installed shared $libperl?
8086 # Add $xxx to ccdlflags.
8087 # If we can't figure out a command-line option, use $shrpenv to
8088 # set env LD_RUN_PATH. The main perl makefile uses this.
8089 shrpdir=$archlibexp/CORE
8092 if "$useshrplib"; then
8095 # We'll set it in Makefile.SH...
8100 freebsd|netbsd|openbsd|interix|dragonfly)
8101 xxx="-Wl,-R$shrpdir"
8103 bsdos|linux|irix*|dec_osf|gnu*)
8104 xxx="-Wl,-rpath,$shrpdir"
8107 # next doesn't like the default...
8110 # beos doesn't like the default, either.
8113 # hpux doesn't like the default, either.
8114 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8117 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8123 # Only add $xxx if it isn't already in ccdlflags.
8124 case " $ccdlflags " in
8126 *) ccdlflags="$ccdlflags $xxx"
8129 Adding $xxx to the flags
8130 passed to $ld so that the perl executable will find the
8131 installed shared $libperl.
8139 # Fix ccdlflags in AIX for building external extensions.
8140 # (For building Perl itself bare -bE:perl.exp is needed,
8141 # Makefile.SH takes care of this.)
8143 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8145 # Respect a hint or command-line value.
8147 '') shrpenv="$tmp_shrpenv" ;;
8149 case "$ldlibpthname" in
8150 '') ldlibpthname=LD_LIBRARY_PATH ;;
8151 none) ldlibpthname='' ;;
8154 : determine where manual pages are on this system
8158 syspath='/usr/share/man/man1 /usr/man/man1'
8159 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8160 syspath="$syspath /usr/man/u_man/man1"
8161 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8162 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8163 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8164 sysman=`./loc . /usr/man/man1 $syspath`
8167 if $test -d "$sysman"; then
8168 echo "System manual is in $sysman." >&4
8170 echo "Could not find manual pages in source form." >&4
8173 : determine where manual pages go
8174 set man1dir man1dir none
8178 $spackage has manual pages available in source form.
8182 echo "However, you don't have nroff, so they're probably useless to you."
8184 '') man1dir="none";;
8187 echo "If you don't want the manual sources installed, answer 'none'."
8192 lookpath="$prefixexp/share/man/man1"
8193 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8194 lookpath="$lookpath $prefixexp/man/p_man/man1"
8195 lookpath="$lookpath $prefixexp/man/u_man/man1"
8196 lookpath="$lookpath $prefixexp/man/man.1"
8198 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8199 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8209 rp="Where do the main $spackage manual pages (source) go?"
8211 if $test "X$man1direxp" != "X$ansexp"; then
8222 : What suffix to use on installed man pages
8229 rp="What suffix should be used for the main $spackage man pages?"
8231 '') case "$man1dir" in
8245 *) dflt="$man1ext";;
8252 : see if we can have long filenames
8254 first=123456789abcdef
8256 if (echo hi >$first) 2>/dev/null; then
8257 if $test -f 123456789abcde; then
8258 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8261 echo 'You can have filenames longer than 14 characters.'>&4
8266 You can't have filenames longer than 14 chars.
8267 You can't even think about them!
8273 $rm -rf 123456789abcde*
8275 : determine where library module manual pages go
8276 set man3dir man3dir none
8280 $spackage has manual pages for many of the library modules.
8286 However, you don't have nroff, so they're probably useless to you.
8289 '') man3dir="none";;
8293 case "$d_flexfnam" in
8296 However, your system can't handle the long file names like File::Basename.3.
8299 '') man3dir="none";;
8303 echo "If you don't want the manual sources installed, answer 'none'."
8304 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8306 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8307 if $test -d "$privlib/man/man3"; then
8310 WARNING: Previous versions of perl installed man3 pages into
8311 $privlib/man/man3. This version will suggest a
8312 new default of $dflt.
8316 rp='Do you wish to preserve the old behavior?(y/n)'
8319 y*) dflt="$privlib/man/man3" ;;
8324 *) dflt="$man3dir" ;;
8331 rp="Where do the $package library man pages (source) go?"
8341 : What suffix to use on installed man pages
8347 rp="What suffix should be used for the $package library man pages?"
8349 '') case "$man3dir" in
8363 *) dflt="$man3ext";;
8370 : see if we have to deal with yellow pages, now NIS.
8371 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8372 if $test -f /usr/etc/nibindd; then
8374 echo "I'm fairly confident you're on a NeXT."
8376 rp='Do you get the hosts file via NetInfo?'
8385 y*) hostcat='nidump hosts .';;
8386 *) case "$hostcat" in
8387 nidump*) hostcat='';;
8397 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8405 rp='Are you getting the hosts file via yellow pages?'
8408 y*) hostcat='ypcat hosts';;
8409 *) hostcat='cat /etc/hosts';;
8415 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8418 '') test -f /etc/group && groupcat='cat /etc/group';;
8421 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8424 : now get the host name
8426 echo "Figuring out host name..." >&4
8427 case "$myhostname" in
8429 echo 'Maybe "hostname" will work...'
8430 if tans=`sh -c hostname 2>&1` ; then
8438 if $test "$cont"; then
8440 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8441 if tans=`cat /etc/systemid 2>&1` ; then
8443 phostname='cat /etc/systemid'
8444 echo "Whadyaknow. Xenix always was a bit strange..."
8447 elif $test -r /etc/systemid; then
8448 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8451 if $test "$cont"; then
8452 echo 'No, maybe "uuname -l" will work...'
8453 if tans=`sh -c 'uuname -l' 2>&1` ; then
8455 phostname='uuname -l'
8457 echo 'Strange. Maybe "uname -n" will work...'
8458 if tans=`sh -c 'uname -n' 2>&1` ; then
8460 phostname='uname -n'
8462 echo 'Oh well, maybe I can mine it out of whoami.h...'
8463 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8464 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8465 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8467 case "$myhostname" in
8468 '') echo "Does this machine have an identity crisis or something?"
8471 echo "Well, you said $myhostname before..."
8472 phostname='echo $myhostname';;
8478 case "$myhostname" in
8479 '') myhostname=noname ;;
8481 : you do not want to know about this
8486 if $test "$myhostname" ; then
8488 rp='Your host name appears to be "'$myhostname'".'" Right?"
8496 : bad guess or no guess
8497 while $test "X$myhostname" = X ; do
8499 rp="Please type the (one word) name of your host:"
8504 : translate upper to lower if necessary
8505 case "$myhostname" in
8507 echo "(Normalizing case in your host name)"
8508 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8512 case "$myhostname" in
8514 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8515 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8516 echo "(Trimming domain name from host name--host name is now $myhostname)"
8518 *) case "$mydomain" in
8521 test "X$hostcat" = "Xypcat hosts" &&
8522 ypmatch "$myhostname" hosts 2>/dev/null |\
8523 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8526 test "X$hostcat" != "X" &&
8527 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8528 /[ ]$myhostname[ . ]/p" > hosts
8531 if $test -f hosts; then
8532 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8533 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8534 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8535 hosts | $sort | $uniq | \
8536 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8537 case `$echo X$dflt` in
8538 X*\ *) echo "(Several hosts in the database matched hostname)"
8541 X.) echo "(You do not have fully-qualified names in the hosts database)"
8545 echo "(I cannot locate a hosts database anywhere)"
8550 tans=`./loc resolv.conf X /etc /usr/etc`
8551 if $test -f "$tans"; then
8552 echo "(Attempting domain name extraction from $tans)"
8553 dflt=.`$sed -n -e 's/ / /g' \
8554 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8555 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8557 .) dflt=.`$sed -n -e 's/ / /g' \
8558 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8559 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8566 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8567 dflt=.`sh -c domainname 2>/dev/null`
8570 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8574 case "$dflt$osname" in
8575 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8576 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8580 .) echo "(Lost all hope -- silly guess then)"
8586 *) dflt="$mydomain";;
8590 rp="What is your domain name?"
8600 : translate upper to lower if necessary
8603 echo "(Normalizing case in your domain name)"
8604 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8608 : a little sanity check here
8609 case "$phostname" in
8612 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8613 $myhostname$mydomain|$myhostname) ;;
8615 case "$phostname" in
8617 echo "(That doesn't agree with your whoami.h file, by the way.)"
8620 echo "(That doesn't agree with your $phostname command, by the way.)"
8630 I need to get your e-mail address in Internet format if possible, i.e.
8631 something like user@host.domain. Please answer accurately since I have
8632 no easy means to double check it. The default value provided below
8633 is most probably close to reality but may not be valid from outside
8634 your organization...
8638 while test "$cont"; do
8640 '') dflt="$cf_by@$myhostname$mydomain";;
8641 *) dflt="$cf_email";;
8643 rp='What is your e-mail address?'
8649 rp='Address does not look like an Internet one. Use it anyway?'
8665 If you or somebody else will be maintaining perl at your site, please
8666 fill in the correct e-mail address here so that they may be contacted
8667 if necessary. Currently, the "perlbug" program included with perl
8668 will send mail to this address in addition to perlbug@perl.org. You may
8669 enter "none" for no administrator.
8672 case "$perladmin" in
8673 '') dflt="$cf_email";;
8674 *) dflt="$perladmin";;
8676 rp='Perl administrator e-mail address'
8680 : determine whether to only install version-specific parts.
8683 Do you want to install only the version-specific parts of the perl
8684 distribution? Usually you do *not* want to do this.
8686 case "$versiononly" in
8687 "$define"|[Yy]*|true) dflt='y' ;;
8690 rp="Do you want to install only the version-specific parts of perl?"
8693 [yY]*) val="$define";;
8699 case "$versiononly" in
8700 "$define") inc_version_list=''
8701 inc_version_list_init=0
8705 : figure out how to guarantee perl startup
8706 : XXX Note that this currently takes advantage of the bug that binexp ignores
8707 : the Configure -Dinstallprefix setting, which in turn means that under
8708 : relocatable @INC, initialinstalllocation is what binexp started as.
8709 case "$startperl" in
8711 case "$sharpbang" in
8715 I can use the #! construct to start perl on your system. This will
8716 make startup of perl scripts faster, but may cause problems if you
8717 want to share those scripts and perl is not in a standard place
8718 ($initialinstalllocation/perl) on all your platforms. The alternative
8719 is to force a shell by starting the script with a single ':' character.
8722 case "$versiononly" in
8723 "$define") dflt="$initialinstalllocation/perl$version";;
8724 *) dflt="$initialinstalllocation/perl";;
8726 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8729 none) startperl=": # use perl";;
8730 *) startperl="#!$ans"
8731 if $test 30 -lt `echo "$ans" | wc -c`; then
8734 WARNING: Some systems limit the #! command to 32 characters.
8735 If you experience difficulty running Perl scripts with #!, try
8736 installing Perl in a directory with a shorter pathname.
8742 *) startperl=": # use perl"
8747 echo "I'll use $startperl to start perl scripts."
8749 : figure best path for perl in scripts
8752 case "$versiononly" in
8753 "$define") perlpath="$initialinstalllocation/perl$version";;
8754 *) perlpath="$initialinstalllocation/perl";;
8756 case "$startperl" in
8761 I will use the "eval 'exec'" idiom to start Perl on your system.
8762 I can use the full path of your Perl binary for this purpose, but
8763 doing so may cause problems if you want to share those scripts and
8764 Perl is not always in a standard place ($initialinstalllocation/perl).
8767 dflt="$initialinstalllocation/perl"
8768 rp="What path shall I use in \"eval 'exec'\"?"
8775 case "$startperl" in
8777 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8780 : determine where public executable scripts go
8781 set scriptdir scriptdir
8783 case "$scriptdir" in
8786 : guess some guesses
8787 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8788 $test -d /usr/share/bin && dflt=/usr/share/bin
8789 $test -d /usr/local/script && dflt=/usr/local/script
8790 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8791 $test -d $prefixexp/script && dflt=$prefixexp/script
8795 *) dflt="$scriptdir"
8800 Some installations have a separate directory just for executable scripts so
8801 that they can mount it across multiple architectures but keep the scripts in
8802 one spot. You might, for example, have a subdirectory of /usr/share for this.
8803 Or you might just lump your scripts in with all your other executables.
8807 rp='Where do you keep publicly executable scripts?'
8809 if $test "X$ansexp" != "X$scriptdirexp"; then
8815 : A little fix up for an irregularly named variable.
8816 installscript="$installscriptdir"
8818 : determine where add-on public executables go
8820 '') dflt=$siteprefix/bin ;;
8824 rp='Pathname where the add-on public executables should be installed?'
8829 : determine where add-on html pages go
8830 : There is no standard location, so try to copy the previously-selected
8831 : directory structure for the core html pages.
8832 case "$sitehtml1dir" in
8833 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8834 *) dflt=$sitehtml1dir ;;
8837 ''|' ') dflt=none ;;
8840 rp='Pathname where the site-specific html pages should be installed?'
8842 prefixvar=sitehtml1dir
8845 : determine where add-on library html pages go
8846 : There is no standard location, so try to copy the previously-selected
8847 : directory structure for the core html pages.
8848 case "$sitehtml3dir" in
8849 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8850 *) dflt=$sitehtml3dir ;;
8853 ''|' ') dflt=none ;;
8856 rp='Pathname where the site-specific library html pages should be installed?'
8858 prefixvar=sitehtml3dir
8861 : determine where add-on manual pages go
8862 case "$siteman1dir" in
8863 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8864 *) dflt=$siteman1dir ;;
8867 ''|' ') dflt=none ;;
8870 rp='Pathname where the site-specific manual pages should be installed?'
8872 prefixvar=siteman1dir
8875 : determine where add-on library man pages go
8876 case "$siteman3dir" in
8877 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8878 *) dflt=$siteman3dir ;;
8881 ''|' ') dflt=none ;;
8884 rp='Pathname where the site-specific library manual pages should be installed?'
8886 prefixvar=siteman3dir
8889 : determine where add-on public executable scripts go
8890 case "$sitescript" in
8891 '') dflt=$siteprefix/script
8892 $test -d $dflt || dflt=$sitebin ;;
8893 *) dflt="$sitescript" ;;
8896 rp='Pathname where add-on public executable scripts should be installed?'
8898 prefixvar=sitescript
8901 case "$usefaststdio" in
8902 $define|true|[yY]*|'')
8903 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8913 Perl can be built to use 'fast stdio', which means using the stdio
8914 library but also directly manipulating the stdio buffers to enable
8915 faster I/O. Using stdio is better for backward compatibility (especially
8916 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8917 interface has been preferred instead of stdio.
8919 If this doesn't make any sense to you, just accept the default '$dflt'.
8921 rp='Use the "fast stdio" if available?'
8924 y|Y) val="$define" ;;
8931 : define an is-a-typedef? function
8932 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8934 "") inclist="sys/types.h";;
8936 eval "varval=\$$var";
8940 for inc in $inclist; do
8941 echo "#include <$inc>" >>temp.c;
8943 echo "#ifdef $type" >> temp.c;
8944 echo "printf(\"We have $type\");" >> temp.c;
8945 echo "#endif" >> temp.c;
8946 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8947 if $contains $type temp.E >/dev/null 2>&1; then
8953 *) eval "$var=\$varval";;
8956 : define an is-a-typedef? function that prompts if the type is not available.
8957 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8959 "") inclist="sys/types.h";;
8961 eval "varval=\$$var";
8965 for inc in $inclist; do
8966 echo "#include <$inc>" >>temp.c;
8968 echo "#ifdef $type" >> temp.c;
8969 echo "printf(\"We have $type\");" >> temp.c;
8970 echo "#endif" >> temp.c;
8971 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8973 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8974 if $contains $type temp.E >/dev/null 2>&1; then
8975 echo "$type found." >&4;
8978 echo "$type NOT found." >&4;
8984 *) eval "$var=\$varval";;
8987 : see what type lseek is declared as in the kernel
8988 rp="What is the type used for lseek's offset on this system?"
8989 set off_t lseektype long stdio.h sys/types.h
8993 echo "Checking to see how big your file offsets are..." >&4
8995 #include <sys/types.h>
8999 printf("%d\n", (int)sizeof($lseektype));
9004 if eval $compile_ok; then
9005 lseeksize=`$run ./try`
9006 echo "Your file offsets are $lseeksize bytes long."
9010 echo "(I can't seem to compile the test program. Guessing...)"
9011 rp="What is the size of your file offsets (in bytes)?"
9017 : see what type file positions are declared as in the library
9018 rp="What is the type for file position used by fsetpos()?"
9019 set fpos_t fpostype long stdio.h sys/types.h
9024 *_t) zzz="$fpostype" ;;
9027 echo "Checking the size of $zzz..." >&4
9029 #include <sys/types.h>
9036 printf("%d\n", (int)sizeof($fpostype));
9041 if eval $compile_ok; then
9045 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9048 echo "Your $zzz is $fpossize bytes long."
9054 echo "(I can't compile the test program. Guessing...)" >&4
9055 rp="What is the size of your file positions (in bytes)?"
9060 # Backward compatibility (uselfs is deprecated).
9062 "$define"|true|[yY]*)
9065 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9067 uselargefiles="$define"
9071 case "$lseeksize:$fpossize" in
9074 You can have files larger than 2 gigabytes.
9077 *) case "$uselargefiles" in
9078 "$undef"|false|[nN]*) dflt='n' ;;
9083 Perl can be built to understand large files (files larger than 2 gigabytes)
9084 on some systems. To do so, Configure can be run with -Duselargefiles.
9086 If this doesn't make any sense to you, just accept the default '$dflt'.
9088 rp='Try to understand large files, if available?'
9091 y|Y) val="$define" ;;
9098 : Look for a hint-file generated 'call-back-unit'. If the
9099 : user has specified that a large files perl is to be built,
9100 : we may need to set or change some other defaults.
9101 if $test -f uselargefiles.cbu; then
9102 echo "Your platform has some specific hints regarding large file builds, using them..."
9103 . ./uselargefiles.cbu
9105 case "$uselargefiles" in
9107 if $test -f uselargefiles.cbu; then
9109 echo "Rechecking to see how big your file offsets are..." >&4
9111 #include <sys/types.h>
9115 printf("%d\n", (int)sizeof($lseektype));
9120 if eval $compile_ok; then
9121 lseeksize=`$run ./try`
9122 $echo "Your file offsets are now $lseeksize bytes long."
9126 echo "(I can't seem to compile the test program. Guessing...)"
9127 rp="What is the size of your file offsets (in bytes)?"
9132 *_t) zzz="$fpostype" ;;
9135 $echo $n "Rechecking the size of $zzz...$c" >&4
9137 #include <sys/types.h>
9144 printf("%d\n", (int)sizeof($fpostype));
9149 if eval $compile_ok; then
9154 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9157 echo " $fpossize bytes." >&4
9163 echo "(I can't compile the test program. Guessing...)" >&4
9164 rp="What is the size of your file positions (in bytes)?"
9173 case "$vendorprefix" in
9174 '') d_vendorbin="$undef"
9178 *) d_vendorbin="$define"
9179 : determine where vendor-supplied executables go.
9180 case "$vendorbin" in
9181 '') dflt=$vendorprefix/bin ;;
9182 *) dflt="$vendorbin" ;;
9185 rp='Pathname for the vendor-supplied executables directory?'
9188 vendorbinexp="$ansexp"
9194 case "$vendorprefix" in
9195 '') vendorhtml1dir=''
9196 vendorhtml1direxp=''
9198 *) : determine where vendor-supplied html pages go.
9199 : There is no standard location, so try to copy the previously-selected
9200 : directory structure for the core html pages.
9201 : XXX Better default suggestions would be welcome.
9202 case "$vendorhtml1dir" in
9203 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9204 *) dflt=$vendorhtml1dir ;;
9207 ''|' ') dflt=none ;;
9210 rp='Pathname for the vendor-supplied html pages?'
9212 vendorhtml1dir="$ans"
9213 vendorhtml1direxp="$ansexp"
9216 : Use ' ' for none so value is preserved next time through Configure
9217 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9218 prefixvar=vendorhtml1dir
9221 case "$vendorprefix" in
9222 '') vendorhtml3dir=''
9223 vendorhtml3direxp=''
9225 *) : determine where vendor-supplied module html pages go.
9226 : There is no standard location, so try to copy the previously-selected
9227 : directory structure for the core html pages.
9228 : XXX Better default suggestions would be welcome.
9229 case "$vendorhtml3dir" in
9230 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9231 *) dflt=$vendorhtml3dir ;;
9234 ''|' ') dflt=none ;;
9237 rp='Pathname for the vendor-supplied html pages?'
9239 vendorhtml3dir="$ans"
9240 vendorhtml3direxp="$ansexp"
9243 : Use ' ' for none so value is preserved next time through Configure
9244 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9245 prefixvar=vendorhtml3dir
9248 case "$vendorprefix" in
9249 '') vendorman1dir=''
9252 *) : determine where vendor-supplied manual pages go.
9253 case "$vendorman1dir" in
9254 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9255 *) dflt=$vendorman1dir ;;
9258 ''|' ') dflt=none ;;
9261 rp='Pathname for the vendor-supplied manual section 1 pages?'
9263 vendorman1dir="$ans"
9264 vendorman1direxp="$ansexp"
9267 : Use ' ' for none so value is preserved next time through Configure
9268 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9269 prefixvar=vendorman1dir
9272 case "$vendorprefix" in
9273 '') vendorman3dir=''
9276 *) : determine where vendor-supplied module manual pages go.
9277 case "$vendorman3dir" in
9278 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9279 *) dflt=$vendorman3dir ;;
9282 ''|' ') dflt=none ;;
9285 rp='Pathname for the vendor-supplied manual section 3 pages?'
9287 vendorman3dir="$ans"
9288 vendorman3direxp="$ansexp"
9291 : Use ' ' for none so value is preserved next time through Configure
9292 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9293 prefixvar=vendorman3dir
9296 case "$vendorprefix" in
9297 '') d_vendorscript="$undef"
9301 *) d_vendorscript="$define"
9302 : determine where vendor-supplied scripts go.
9303 case "$vendorscript" in
9304 '') dflt=$vendorprefix/script
9305 $test -d $dflt || dflt=$vendorbin ;;
9306 *) dflt="$vendorscript" ;;
9310 The installation process will create a directory for
9311 vendor-supplied scripts.
9315 rp='Pathname for the vendor-supplied scripts directory?'
9318 vendorscriptexp="$ansexp"
9321 prefixvar=vendorscript
9324 : see if qgcvt exists
9330 if $test X"$d_longdbl" = X"$define"; then
9332 echo "Checking how to print long doubles..." >&4
9334 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9335 $cat >try.c <<'EOCP'
9336 #include <sys/types.h>
9340 printf("%.3f\n", d);
9344 if eval $compile; then
9348 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9349 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9350 echo "We will use %f."
9356 if $test X"$sPRIfldbl" = X; then
9357 $cat >try.c <<'EOCP'
9358 #include <sys/types.h>
9361 long double d = 123.456;
9362 printf("%.3Lf\n", d);
9366 if eval $compile; then
9370 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9371 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9372 echo "We will use %Lf."
9378 if $test X"$sPRIfldbl" = X; then
9379 $cat >try.c <<'EOCP'
9380 #include <sys/types.h>
9383 long double d = 123.456;
9384 printf("%.3llf\n", d);
9388 if eval $compile; then
9392 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9393 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9394 echo "We will use %llf."
9400 if $test X"$sPRIfldbl" = X; then
9401 $cat >try.c <<'EOCP'
9402 #include <sys/types.h>
9405 long double d = 123.456;
9406 printf("%.3lf\n", d);
9410 if eval $compile; then
9414 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9415 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9416 echo "We will use %lf."
9422 if $test X"$sPRIfldbl" = X; then
9423 echo "Cannot figure out how to print long doubles." >&4
9425 sSCNfldbl=$sPRIfldbl # expect consistency
9432 case "$sPRIfldbl" in
9433 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9434 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9435 d_SCNfldbl="$undef";
9437 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9438 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9439 d_SCNfldbl="$define";
9443 : Check how to convert floats to strings.
9445 if test "X$d_Gconvert" = X; then
9448 echo "Checking for an efficient way to convert floats to strings."
9450 case "$uselongdouble" in
9451 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9453 case "$d_longdbl" in
9454 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9456 case "$d_PRIgldbl" in
9457 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9461 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9462 char *myname = "gconvert";
9465 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9466 char *myname = "gcvt";
9469 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9470 char *myname = "qgcvt";
9471 #define DOUBLETYPE long double
9474 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9476 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9478 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9481 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9483 char *myname = "sprintf";
9487 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9488 #define DOUBLETYPE long double
9490 #define DOUBLETYPE double
9496 #define I_STDLIB $i_stdlib
9502 checkit(expect, got)
9506 if (strcmp(expect, got)) {
9507 printf("%s oddity: Expected %s, got %s\n",
9508 myname, expect, got);
9518 /* This must be 1st test on (which?) platform */
9519 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9520 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9521 checkit("0.1", buf);
9523 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9524 checkit("0.01", buf);
9526 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9527 checkit("0.001", buf);
9529 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9530 checkit("0.0001", buf);
9532 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9533 if (strlen(buf) > 5)
9534 checkit("9e-005", buf); /* for Microsoft ?? */
9536 checkit("9e-05", buf);
9538 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9541 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9542 checkit("1.1", buf);
9544 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9545 checkit("1.01", buf);
9547 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9548 checkit("1.001", buf);
9550 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9551 checkit("1.0001", buf);
9553 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9554 checkit("1.00001", buf);
9556 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9557 checkit("1.000001", buf);
9559 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9562 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9565 /* Some Linux gcvt's give 1.e+5 here. */
9566 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9567 checkit("100000", buf);
9569 /* Some Linux gcvt's give -1.e+5 here. */
9570 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9571 checkit("-100000", buf);
9573 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9574 checkit("123.456", buf);
9576 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9577 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9578 /* 34 should be enough to scare even long double
9579 * places into using the e notation. */
9580 if (strlen(buf) > 5)
9581 checkit("1e+034", buf); /* for Microsoft */
9583 checkit("1e+34", buf);
9585 /* For Perl, if you add additional tests here, also add them to
9586 * t/base/num.t for benefit of platforms not using Configure or
9587 * overriding d_Gconvert */
9592 : first add preferred functions to our list
9594 for xxx_convert in $gconvert_preference; do
9595 case $xxx_convert in
9596 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9597 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9600 : then add any others
9601 for xxx_convert in gconvert gcvt sprintf; do
9604 *) xxx_list="$xxx_list $xxx_convert" ;;
9608 case "$d_longdbl$uselongdouble" in
9610 : again, add prefered functions to our list first
9612 for xxx_convert in $gconvert_ld_preference; do
9613 case $xxx_convert in
9614 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9615 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9618 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9619 for xxx_convert in qgcvt sprintf $xxx_list; do
9620 case "$xxx_ld_list" in
9621 $xxx_convert*|*" $xxx_convert"*) ;;
9622 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9625 : if sprintf cannot do long doubles, move it to the end
9626 if test "$d_PRIgldbl" != "$define"; then
9627 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9629 : if no qgcvt, remove it
9630 if test "$d_qgcvt" != "$define"; then
9631 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9634 xxx_list="$xxx_ld_list"
9638 for xxx_convert in $xxx_list; do
9639 echo "Trying $xxx_convert..."
9640 $rm -f try try$_o core
9641 set try -DTRY_$xxx_convert
9642 if eval $compile; then
9643 echo "$xxx_convert() found." >&4
9645 echo "I'll use $xxx_convert to convert floats into a string." >&4
9648 echo "...But $xxx_convert didn't work as I expected."
9652 echo "$xxx_convert NOT found." >&4
9656 if test X$xxx_convert = X; then
9657 echo "*** WHOA THERE!!! ***" >&4
9658 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9662 case "$xxx_convert" in
9663 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9664 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9665 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9666 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9667 "$define$define$define")
9668 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9669 "$define$define$undef")
9670 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9671 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9679 : see if _fwalk exists
9683 : Initialize h_fcntl
9686 : Initialize h_sysfile
9689 : access call always available on UNIX
9693 : locate the flags for 'access()'
9697 $cat >access.c <<EOCP
9698 #include <sys/types.h>
9703 #include <sys/file.h>
9716 : check sys/file.h first, no particular reason here
9717 if $test `./findhdr sys/file.h` && \
9718 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9720 echo "<sys/file.h> defines the *_OK access constants." >&4
9721 elif $test `./findhdr fcntl.h` && \
9722 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9724 echo "<fcntl.h> defines the *_OK access constants." >&4
9725 elif $test `./findhdr unistd.h` && \
9726 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9727 echo "<unistd.h> defines the *_OK access constants." >&4
9729 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9735 : see if accessx exists
9736 set accessx d_accessx
9739 : see if aintl exists
9743 : see if alarm exists
9747 : see if POSIX threads are available
9748 set pthread.h i_pthread
9751 : define a fucntion to check prototypes
9752 $cat > protochk <<EOSH
9755 optimize="$optimize"
9757 prototype="$prototype"
9760 usethreads=$usethreads
9761 i_pthread=$i_pthread
9762 pthread_h_first=$pthread_h_first
9765 $cat >> protochk <<'EOSH'
9770 while test $# -ge 2; do
9772 $define) echo "#include <$2>" >> try.c ;;
9773 literal) echo "$2" >> try.c ;;
9775 # Extra magic for the benefit of systems that need pthread.h
9776 # to be included early to correctly detect threadsafe functions.
9777 # Such functions must guarantee themselves, though, that the usethreads
9778 # and i_pthread have been defined, before calling protochk.
9779 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9780 echo "#include <pthread.h>" >> try.c
9785 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9786 cat >> try.c <<'EOCP'
9787 #ifdef CAN_PROTOTYPE
9788 #define _(args) args
9793 echo "$foo" >> try.c
9794 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9795 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9803 hasproto='varname=$1; func=$2; shift; shift;
9804 while $test $# -ge 2; do
9806 $define) echo "#include <$2>";;
9810 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9811 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9812 echo "$func() prototype found.";
9815 echo "$func() prototype NOT found.";
9822 : see if sys/types.h has to be included
9823 set sys/types.h i_systypes
9826 : see if sys/select.h has to be included
9827 set sys/select.h i_sysselct
9830 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9831 while $test $# -ge 2; do
9833 $define) echo "#include <$2>";;
9837 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9839 if eval $compile; then
9848 : see if we should include time.h, sys/time.h, or both
9850 if test "X$timeincl" = X; then
9851 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9852 $echo $n "I'm now running the test program...$c"
9854 #include <sys/types.h>
9859 #ifdef SYSTIMEKERNEL
9862 #include <sys/time.h>
9865 #include <sys/select.h>
9878 struct timezone tzp;
9880 if (foo.tm_sec == foo.tm_sec)
9883 if (bar.tv_sec == bar.tv_sec)
9890 for s_timezone in '-DS_TIMEZONE' ''; do
9892 for s_timeval in '-DS_TIMEVAL' ''; do
9893 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9894 for i_time in '' '-DI_TIME'; do
9895 for i_systime in '-DI_SYSTIME' ''; do
9898 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9899 if eval $compile; then
9900 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9904 $echo $n "Succeeded with $flags$c"
9916 *SYSTIMEKERNEL*) i_systimek="$define"
9917 timeincl=`./findhdr sys/time.h`
9918 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9919 *) i_systimek="$undef";;
9922 *I_TIME*) i_time="$define"
9923 timeincl=`./findhdr time.h`" $timeincl"
9924 echo "We'll include <time.h>." >&4;;
9925 *) i_time="$undef";;
9928 *I_SYSTIME*) i_systime="$define"
9929 timeincl=`./findhdr sys/time.h`" $timeincl"
9930 echo "We'll include <sys/time.h>." >&4;;
9931 *) i_systime="$undef";;
9935 : see if struct tm knows about tm_zone
9936 case "$i_systime$i_time" in
9939 echo "Checking to see if your struct tm has tm_zone field..." >&4
9940 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9948 case "$d_tm_tm_zone" in
9949 "$define") echo "Yes, it does." ;;
9950 *) echo "No, it doesn't." ;;
9952 : see if struct tm knows about tm_gmtoff
9953 case "$i_systime$i_time" in
9956 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9957 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9965 case "$d_tm_tm_gmtoff" in
9966 "$define") echo "Yes, it does." ;;
9967 *) echo "No, it doesn't." ;;
9970 : see if asctime_r exists
9971 set asctime_r d_asctime_r
9973 case "$d_asctime_r" in
9975 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9976 case "$d_asctime_r_proto:$usethreads" in
9977 ":define") d_asctime_r_proto=define
9978 set d_asctime_r_proto asctime_r $hdrs
9982 case "$d_asctime_r_proto" in
9984 case "$asctime_r_proto" in
9985 ''|0) try='char* asctime_r(const struct tm*, char*);'
9986 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9988 case "$asctime_r_proto" in
9989 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9990 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9992 case "$asctime_r_proto" in
9993 ''|0) try='int asctime_r(const struct tm*, char*);'
9994 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9996 case "$asctime_r_proto" in
9997 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9998 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
10000 case "$asctime_r_proto" in
10001 ''|0) d_asctime_r=undef
10003 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10004 * ) case "$asctime_r_proto" in
10005 REENTRANT_PROTO*) ;;
10006 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10008 echo "Prototype: $try" ;;
10011 *) case "$usethreads" in
10012 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10019 *) asctime_r_proto=0
10023 : see if atolf exists
10027 : see if atoll exists
10031 : Look for GCC-style attribute format
10032 case "$d_attribute_format" in
10035 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10036 $cat >attrib.c <<'EOCP'
10038 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10040 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10041 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10042 echo "Your C compiler doesn't support __attribute__((format))."
10045 echo "Your C compiler supports __attribute__((format))."
10049 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10053 *) val="$d_attribute_format" ;;
10055 set d_attribute_format
10059 : Look for GCC-style attribute format with null format allowed
10060 case "$d_printf_format_null" in
10061 '') case "$d_attribute_format" in
10064 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10065 $cat >attrib.c <<EOCP
10067 #$i_stdlib I_STDLIB
10069 #include <stdlib.h>
10071 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10072 int null_printf (char* pat,...) { return (int)pat; }
10073 int main () { exit(null_printf(NULL)); }
10075 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10076 : run the executable in case it produces a run-time warning
10077 if $run ./attrib >>attrib.out 2>&1; then
10078 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10079 echo "Your C compiler doesn't allow __printf__ format to be null."
10082 echo "Your C compiler allows __printf__ format to be null."
10086 echo "Your C compiler executable failed with __printf__ format null."
10090 echo "Your C compiler fails with __printf__ format null."
10097 *) val="$d_printf_format_null" ;;
10099 set d_printf_format_null
10103 : Look for GCC-style attribute malloc
10104 case "$d_attribute_malloc" in
10107 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10108 $cat >attrib.c <<'EOCP'
10110 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10112 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10113 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10114 echo "Your C compiler doesn't support __attribute__((malloc))."
10117 echo "Your C compiler supports __attribute__((malloc))."
10121 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10125 *) val="$d_attribute_malloc" ;;
10127 set d_attribute_malloc
10131 : Look for GCC-style attribute nonnull
10132 case "$d_attribute_nonnull" in
10135 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10136 $cat >attrib.c <<'EOCP'
10138 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10140 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10141 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10142 echo "Your C compiler doesn't support __attribute__((nonnull))."
10145 echo "Your C compiler supports __attribute__((nonnull))."
10149 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10153 *) val="$d_attribute_nonnull" ;;
10155 set d_attribute_nonnull
10159 : Look for GCC-style attribute noreturn
10160 case "$d_attribute_noreturn" in
10163 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10164 $cat >attrib.c <<'EOCP'
10166 void fall_over_dead( void ) __attribute__((noreturn));
10168 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10169 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10170 echo "Your C compiler doesn't support __attribute__((noreturn))."
10173 echo "Your C compiler supports __attribute__((noreturn))."
10177 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10181 *) val="$d_attribute_noreturn" ;;
10183 set d_attribute_noreturn
10187 : Look for GCC-style attribute pure
10188 case "$d_attribute_pure" in
10191 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10192 $cat >attrib.c <<'EOCP'
10194 int square( int n ) __attribute__((pure));
10196 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10197 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10198 echo "Your C compiler doesn't support __attribute__((pure))."
10201 echo "Your C compiler supports __attribute__((pure))."
10205 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10209 *) val="$d_attribute_pure" ;;
10211 set d_attribute_pure
10215 : Look for GCC-style attribute unused
10216 case "$d_attribute_unused" in
10219 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10220 $cat >attrib.c <<'EOCP'
10222 int do_something( int dummy __attribute__((unused)), int n );
10224 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10225 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10226 echo "Your C compiler doesn't support __attribute__((unused))."
10229 echo "Your C compiler supports __attribute__((unused))."
10233 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10237 *) val="$d_attribute_unused" ;;
10239 set d_attribute_unused
10243 : Look for GCC-style attribute warn_unused_result
10244 case "$d_attribute_warn_unused_result" in
10247 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10248 $cat >attrib.c <<'EOCP'
10250 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10252 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10253 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10254 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10257 echo "Your C compiler supports __attribute__((warn_unused_result))."
10261 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10265 *) val="$d_attribute_warn_unused_result" ;;
10267 set d_attribute_warn_unused_result
10271 : see if bcmp exists
10275 : see if bcopy exists
10279 : see if getpgrp exists
10280 set getpgrp d_getpgrp
10283 case "$d_getpgrp" in
10286 echo "Checking to see which flavor of getpgrp is in use..."
10288 #$i_unistd I_UNISTD
10289 #include <sys/types.h>
10291 # include <unistd.h>
10293 #$i_stdlib I_STDLIB
10295 #include <stdlib.h>
10299 if (getuid() == 0) {
10300 printf("(I see you are running Configure as super-user...)\n");
10303 #ifdef TRY_BSD_PGRP
10304 if (getpgrp(1) == 0)
10313 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10314 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10316 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10317 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10320 echo "I can't seem to compile and run the test program."
10322 xxx="a USG one, i.e. you use getpgrp()."
10324 # SVR4 systems can appear rather BSD-ish.
10325 case "$i_unistd" in
10327 xxx="a BSD one, i.e. you use getpgrp(pid)."
10331 xxx="probably a USG one, i.e. you use getpgrp()."
10336 echo "Assuming your getpgrp is $xxx" >&4
10345 : see if setpgrp exists
10346 set setpgrp d_setpgrp
10349 case "$d_setpgrp" in
10352 echo "Checking to see which flavor of setpgrp is in use..."
10354 #$i_unistd I_UNISTD
10355 #include <sys/types.h>
10357 # include <unistd.h>
10359 #$i_stdlib I_STDLIB
10361 #include <stdlib.h>
10365 if (getuid() == 0) {
10366 printf("(I see you are running Configure as super-user...)\n");
10369 #ifdef TRY_BSD_PGRP
10370 if (-1 == setpgrp(1, 1))
10373 if (setpgrp() != -1)
10379 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10380 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10382 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10383 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10386 echo "(I can't seem to compile and run the test program.)"
10388 xxx="a USG one, i.e. you use setpgrp()."
10390 # SVR4 systems can appear rather BSD-ish.
10391 case "$i_unistd" in
10393 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10397 xxx="probably a USG one, i.e. you use setpgrp()."
10402 echo "Assuming your setpgrp is $xxx" >&4
10411 : Look for GCC-style __builtin_choose_expr
10412 case "$d_builtin_choose_expr" in
10415 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10416 $cat >try.c <<'EOCP'
10417 #include <assert.h>
10418 #include <stdlib.h>
10421 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10424 assert( SYRINX(1) == 2112 );
10425 assert( SYRINX(1) != 5150 );
10426 assert( SYRINX(0) == 5150 );
10427 assert( SYRINX(0) != 2112 );
10428 puts( "All good!" );
10434 if eval $compile; then
10435 echo "Your C compiler supports __builtin_choose_expr."
10438 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10442 *) val="$d_builtin_choose_expr" ;;
10445 set d_builtin_choose_expr
10449 : Look for GCC-style __builtin_expect
10450 case "$d_builtin_expect" in
10453 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10454 $cat >builtin.c <<'EOCP'
10457 if ( __builtin_expect(n, 0) ) n = 1;
10461 if eval $compile; then
10462 echo "Your C compiler supports __builtin_choose_expr."
10465 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10469 *) val="$d_builtin_expect" ;;
10472 set d_builtin_expect
10476 : see if bzero exists
10480 : see if stdarg is available
10482 if $test `./findhdr stdarg.h`; then
10483 echo "<stdarg.h> found." >&4
10486 echo "<stdarg.h> NOT found." >&4
10490 : see if varags is available
10492 if $test `./findhdr varargs.h`; then
10493 echo "<varargs.h> found." >&4
10495 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10498 : set up the varargs testing programs
10499 $cat > varargs.c <<EOP
10501 #include <stdarg.h>
10504 #include <varargs.h>
10508 int f(char *p, ...)
10522 p = va_arg(ap, char *);
10528 $cat > varargs <<EOP
10530 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10539 : now check which varargs header should be included
10544 if `./varargs I_STDARG`; then
10546 elif `./varargs I_VARARGS`; then
10551 if `./varargs I_VARARGS`; then
10558 echo "I could not find the definition for va_dcl... You have problems..." >&4
10559 val="$undef"; set i_stdarg; eval $setvar
10560 val="$undef"; set i_varargs; eval $setvar
10565 case "$i_varhdr" in
10567 val="$define"; set i_stdarg; eval $setvar
10568 val="$undef"; set i_varargs; eval $setvar
10571 val="$undef"; set i_stdarg; eval $setvar
10572 val="$define"; set i_varargs; eval $setvar
10575 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10579 : see if the Compiler supports C99 variadic macros
10580 case "$i_stdarg$i_stdlib" in
10582 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10585 #include <stdarg.h>
10587 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10591 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10597 if eval $compile && $run ./try 2>&1 >/dev/null; then
10598 case "`$run ./try`" in
10600 echo "You have C99 variadic macros." >&4
10601 d_c99_variadic_macros="$define"
10604 echo "You don't have functional C99 variadic macros." >&4
10605 d_c99_variadic_macros="$undef"
10609 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10610 d_c99_variadic_macros="$undef"
10615 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10616 d_c99_variadic_macros="$undef"
10620 : see if signal is declared as pointer to function returning int or void
10622 xxx=`./findhdr signal.h`
10623 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10624 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10625 echo "You have int (*signal())() instead of void." >&4
10627 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10628 echo "You have void (*signal())()." >&4
10630 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10631 echo "You have int (*signal())() instead of void." >&4
10633 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10634 echo "You have void (*signal())()." >&4
10637 case "$d_voidsig" in
10639 echo "I can't determine whether signal handler returns void or int..." >&4
10641 rp="What type does your signal handler return?"
10644 v*) val="$define";;
10648 echo "As you already told me, signal handler returns void." >&4
10651 *) echo "As you already told me, signal handler returns int." >&4
10658 case "$d_voidsig" in
10659 "$define") signal_t="void";;
10660 *) signal_t="int";;
10664 : check for ability to cast large floats to 32-bit ints.
10666 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10667 if $test "$intsize" -ge 4; then
10674 #$i_stdlib I_STDLIB
10676 #include <stdlib.h>
10678 #include <sys/types.h>
10679 #include <signal.h>
10680 $signal_t blech(int s) { exit(3); }
10687 signal(SIGFPE, blech);
10689 /* Don't let compiler optimize the test away. Store the number
10690 in a writable string for gcc to pass to sscanf under HP/UX.
10692 sprintf(str, "2147483647");
10693 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10697 /* x86 processors will probably give 0x8000 0000, which is a
10698 sign change. We don't want that. We want to mimic SPARC
10699 behavior here, which is to preserve the sign and give
10702 if (i32 != ($xxx) f)
10708 if eval $compile_ok; then
10712 echo "(I can't seem to compile the test program--assuming it can't)"
10717 echo "Yup, it can."
10720 echo "Nope, it can't."
10727 : check for ability to cast negative floats to unsigned
10729 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10732 #$i_stdlib I_STDLIB
10734 #include <stdlib.h>
10736 #include <sys/types.h>
10737 #include <signal.h>
10738 $signal_t blech(int s) { exit(7); }
10739 $signal_t blech_in_list(int s) { exit(4); }
10740 unsigned long dummy_long(unsigned long p) { return p; }
10741 unsigned int dummy_int(unsigned int p) { return p; }
10742 unsigned short dummy_short(unsigned short p) { return p; }
10746 unsigned long along;
10748 unsigned short ashort;
10752 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10753 a direct f = -123. assignment. gcc-2.8.0 reportedly
10754 optimized the whole file away
10756 /* Store the number in a writable string for gcc to pass to
10757 sscanf under HP/UX.
10759 sprintf(str, "-123");
10760 sscanf(str, "%lf", &f); /* f = -123.; */
10762 signal(SIGFPE, blech);
10763 along = (unsigned long)f;
10764 aint = (unsigned int)f;
10765 ashort = (unsigned short)f;
10766 if (along != (unsigned long)-123)
10768 if (aint != (unsigned int)-123)
10770 if (ashort != (unsigned short)-123)
10772 sprintf(str, "1073741824.");
10773 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10776 along = (unsigned long)f;
10777 if (along != 0x80000000)
10781 along = (unsigned long)f;
10782 if (along != 0x7fffffff)
10786 along = (unsigned long)f;
10787 if (along != 0x80000001)
10791 signal(SIGFPE, blech_in_list);
10792 sprintf(str, "123.");
10793 sscanf(str, "%lf", &f); /* f = 123.; */
10794 along = dummy_long((unsigned long)f);
10795 aint = dummy_int((unsigned int)f);
10796 ashort = dummy_short((unsigned short)f);
10797 if (along != (unsigned long)123)
10799 if (aint != (unsigned int)123)
10801 if (ashort != (unsigned short)123)
10808 if eval $compile_ok; then
10812 echo "(I can't seem to compile the test program--assuming it can't)"
10815 case "$castflags" in
10817 echo "Yup, it can."
10820 echo "Nope, it can't."
10827 : see if vprintf exists
10829 if set vprintf val -f d_vprintf; eval $csym; $val; then
10830 echo 'vprintf() found.' >&4
10833 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
10834 #$i_varargs I_VARARGS
10836 #$i_stdlib I_STDLIB
10837 #$i_unistd I_UNISTD
10840 # include <stdarg.h>
10841 #else /* I_VARARGS */
10842 # include <varargs.h>
10846 # include <unistd.h>
10850 # include <stdlib.h>
10853 #include <stdio.h> /* vsprintf prototype */
10856 void xxx(int n, ...)
10861 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10863 int main() { xxx(1, "foo"); }
10865 #else /* I_VARARGS */
10873 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10875 int main() { xxx("foo"); }
10881 if eval $compile_ok; then
10882 if $run ./try; then
10883 echo "Your vsprintf() returns (int)." >&4
10886 echo "Your vsprintf() returns (char*)." >&4
10890 echo 'I am unable to compile the vsprintf() test program.' >&4
10891 # We shouldn't get here. If we do, assume the standard signature,
10892 # not the old BSD one.
10893 echo 'Guessing that vsprintf() returns (int).' >&4
10897 echo 'vprintf() NOT found.' >&4
10908 : see if chown exists
10912 : see if chroot exists
10913 set chroot d_chroot
10916 : see if chsize exists
10917 set chsize d_chsize
10920 : see if class exists
10924 : see if clearenv exists
10925 set clearenv d_clearenv
10928 hasstruct='varname=$1; struct=$2; shift; shift;
10929 while $test $# -ge 2; do
10931 $define) echo "#include <$2>";;
10935 echo "int main () { struct $struct foo; }" >> try.c;
10937 if eval $compile; then
10948 : see whether socket exists
10950 $echo $n "Hmm... $c" >&4
10951 if set socket val -f d_socket; eval $csym; $val; then
10952 echo "Looks like you have Berkeley networking support." >&4
10954 if set setsockopt val -f; eval $csym; $val; then
10957 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10958 d_oldsock="$define"
10961 if $contains socklib libc.list >/dev/null 2>&1; then
10962 echo "Looks like you have Berkeley networking support." >&4
10964 : we will have to assume that it supports the 4.2 BSD interface
10967 echo "You don't have Berkeley networking in libc$_a..." >&4
10968 if test "X$d_socket" = "X$define"; then
10969 echo "...but you seem to believe that you have sockets." >&4
10971 for net in net socket
10973 if test -f /usr/lib/lib$net$_a; then
10974 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10975 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10976 if $contains socket libc.list >/dev/null 2>&1; then
10981 echo "...but the Wollongong group seems to have hacked it in." >&4
10982 sockethdr="-I/usr/netinclude"
10985 echo "Found Berkeley sockets interface in lib$net." >&4
10986 if $contains setsockopt libc.list >/dev/null 2>&1; then
10989 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10990 d_oldsock="$define"
10996 if test "X$d_socket" != "X$define"; then
10997 echo "or anywhere else I see." >&4
11005 : see if socketpair exists
11006 set socketpair d_sockpair
11011 echo "Checking the availability of certain socket constants..." >&4
11012 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11013 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11015 #include <sys/types.h>
11016 #include <sys/socket.h>
11022 set try; if eval $compile; then
11025 set d_${enum}; eval $setvar
11029 : see if this is a sys/uio.h system
11030 set sys/uio.h i_sysuio
11035 echo "Checking to see if your system supports struct cmsghdr..." >&4
11036 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11038 case "$d_cmsghdr_s" in
11039 "$define") echo "Yes, it does." ;;
11040 *) echo "No, it doesn't." ;;
11044 : check for const keyword
11046 echo 'Checking to see if your C compiler knows about "const"...' >&4
11047 $cat >const.c <<'EOCP'
11048 typedef struct spug { int drokk; } spug;
11052 const spug y = { 0 };
11055 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11057 echo "Yup, it does."
11060 echo "Nope, it doesn't."
11065 : see if copysignl exists
11066 set copysignl d_copysignl
11069 : see if crypt exists
11074 $define) cryptlib='' ;;
11075 *) if set crypt val -f d_crypt; eval $csym; $val; then
11076 echo 'crypt() found.' >&4
11080 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11081 if $test -z "$cryptlib"; then
11082 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11086 if $test -z "$cryptlib"; then
11087 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11091 if $test -z "$cryptlib"; then
11092 cryptlib=`./loc libcrypt$_a "" $libpth`
11096 if $test -z "$cryptlib"; then
11097 echo 'crypt() NOT found.' >&4
11108 : see if this is a crypt.h system
11109 set crypt.h i_crypt
11112 : see if crypt_r exists
11113 set crypt_r d_crypt_r
11115 case "$d_crypt_r" in
11117 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11118 case "$d_crypt_r_proto:$usethreads" in
11119 ":define") d_crypt_r_proto=define
11120 set d_crypt_r_proto crypt_r $hdrs
11124 case "$d_crypt_r_proto" in
11126 case "$crypt_r_proto" in
11127 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11128 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
11130 case "$crypt_r_proto" in
11131 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11132 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
11134 case "$crypt_r_proto" in
11135 ''|0) d_crypt_r=undef
11137 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11138 * ) case "$crypt_r_proto" in
11139 REENTRANT_PROTO*) ;;
11140 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11142 echo "Prototype: $try" ;;
11145 *) case "$usethreads" in
11146 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11157 : get csh whereabouts
11159 'csh') val="$undef" ;;
11160 *) val="$define" ;;
11164 : Respect a hint or command line value for full_csh.
11165 case "$full_csh" in
11166 '') full_csh=$csh ;;
11169 : see if ctermid exists
11170 set ctermid d_ctermid
11173 : see if ctermid_r exists
11174 set ctermid_r d_ctermid_r
11176 case "$d_ctermid_r" in
11178 hdrs="$i_systypes sys/types.h define stdio.h "
11179 case "$d_ctermid_r_proto:$usethreads" in
11180 ":define") d_ctermid_r_proto=define
11181 set d_ctermid_r_proto ctermid_r $hdrs
11185 case "$d_ctermid_r_proto" in
11187 case "$ctermid_r_proto" in
11188 ''|0) try='char* ctermid_r(char*);'
11189 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
11191 case "$ctermid_r_proto" in
11192 ''|0) d_ctermid_r=undef
11194 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11195 * ) case "$ctermid_r_proto" in
11196 REENTRANT_PROTO*) ;;
11197 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11199 echo "Prototype: $try" ;;
11202 *) case "$usethreads" in
11203 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11210 *) ctermid_r_proto=0
11214 : see if ctime_r exists
11215 set ctime_r d_ctime_r
11217 case "$d_ctime_r" in
11219 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11220 case "$d_ctime_r_proto:$usethreads" in
11221 ":define") d_ctime_r_proto=define
11222 set d_ctime_r_proto ctime_r $hdrs
11226 case "$d_ctime_r_proto" in
11228 case "$ctime_r_proto" in
11229 ''|0) try='char* ctime_r(const time_t*, char*);'
11230 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
11232 case "$ctime_r_proto" in
11233 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11234 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
11236 case "$ctime_r_proto" in
11237 ''|0) try='int ctime_r(const time_t*, char*);'
11238 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
11240 case "$ctime_r_proto" in
11241 ''|0) try='int ctime_r(const time_t*, char*, int);'
11242 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
11244 case "$ctime_r_proto" in
11245 ''|0) d_ctime_r=undef
11247 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11248 * ) case "$ctime_r_proto" in
11249 REENTRANT_PROTO*) ;;
11250 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11252 echo "Prototype: $try" ;;
11255 *) case "$usethreads" in
11256 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11267 : see if cuserid exists
11268 set cuserid d_cuserid
11271 : see if this is a limits.h system
11272 set limits.h i_limits
11275 : see if this is a float.h system
11276 set float.h i_float
11279 : See if number of significant digits in a double precision number is known
11281 $cat >dbl_dig.c <<EOM
11282 #$i_limits I_LIMITS
11285 #include <limits.h>
11291 printf("Contains DBL_DIG");
11294 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11295 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11296 echo "DBL_DIG found." >&4
11299 echo "DBL_DIG NOT found." >&4
11306 : see if dbm.h is available
11307 : see if dbmclose exists
11308 set dbmclose d_dbmclose
11311 case "$d_dbmclose" in
11321 *) set rpcsvc/dbm.h i_rpcsvcdbm
11326 *) echo "We won't be including <dbm.h>"
11336 : see if prototype for dbminit is available
11338 set d_dbminitproto dbminit $i_dbm dbm.h
11341 : see if difftime exists
11342 set difftime d_difftime
11345 : see if this is a dirent system
11347 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11349 echo "<dirent.h> found." >&4
11352 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11353 echo "<sys/dir.h> found." >&4
11356 xinc=`./findhdr sys/ndir.h`
11358 echo "<dirent.h> NOT found." >&4
11363 : Look for type of directory structure.
11365 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11367 case "$direntrytype" in
11369 case "$i_dirent" in
11370 $define) guess1='struct dirent' ;;
11371 *) guess1='struct direct' ;;
11374 *) guess1="$direntrytype"
11379 'struct dirent') guess2='struct direct' ;;
11380 *) guess2='struct dirent' ;;
11383 if $contains "$guess1" try.c >/dev/null 2>&1; then
11384 direntrytype="$guess1"
11385 echo "Your directory entries are $direntrytype." >&4
11386 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11387 direntrytype="$guess2"
11388 echo "Your directory entries seem to be $direntrytype." >&4
11390 echo "I don't recognize your system's directory entries." >&4
11391 rp="What type is used for directory entries on this system?"
11394 direntrytype="$ans"
11398 : see if the directory entry stores field length
11400 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11401 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11402 echo "Good, your directory entry keeps length information in d_namlen." >&4
11405 echo "Your directory entry does not know about the d_namlen field." >&4
11412 : Look for DIR.dd_fd
11413 case "$i_dirent" in
11415 echo "Checking to see if DIR has a dd_fd member variable" >&4
11417 #$i_stdlib I_STDLIB
11419 #include <stdlib.h>
11421 #include <dirent.h>
11431 if eval $compile; then
11432 echo "Yes, it does."
11435 echo "No, it does not."
11440 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11448 : see if this is an sysdir system
11449 set sys/dir.h i_sysdir
11452 : see if this is an sysndir system
11453 set sys/ndir.h i_sysndir
11458 $cat >dirfd.c <<EOM
11460 #$i_stdlib I_STDLIB
11462 #include <stdlib.h>
11464 #$i_dirent I_DIRENT /**/
11465 #$i_sysdir I_SYS_DIR /**/
11466 #$i_sysndir I_SYS_NDIR /**/
11467 #$i_systypes I_SYS_TYPES /**/
11468 #if defined(I_SYS_TYPES)
11469 #include <sys/types.h>
11471 #if defined(I_DIRENT)
11472 #include <dirent.h>
11473 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11474 #include <sys/dir.h>
11478 #include <sys/ndir.h>
11482 #include <ndir.h> /* may be wrong in the future */
11484 #include <sys/dir.h>
11490 DIR *dirp = opendir(".");
11491 if (dirfd(dirp) >= 0)
11499 if eval $compile; then
11503 $define) echo "dirfd() found." >&4 ;;
11504 *) echo "dirfd() NOT found." >&4 ;;
11510 : see if dlerror exists
11513 set dlerror d_dlerror
11517 : see if dlfcn is available
11518 set dlfcn.h i_dlfcn
11525 On a few systems, the dynamically loaded modules that perl generates and uses
11526 will need a different extension than shared libs. The default will probably
11532 *) dflt="$dlext" ;;
11534 rp='What is the extension of dynamically loaded modules'
11543 : Check if dlsym need a leading underscore
11549 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11550 $cat >dyna.c <<'EOM'
11557 #$i_stdlib I_STDLIB
11559 #include <stdlib.h>
11563 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11565 #include <sys/types.h>
11570 extern int fred() ;
11579 int mode = RTLD_LAZY ;
11581 handle = dlopen("./dyna.$dlext", mode) ;
11582 if (handle == NULL) {
11587 symbol = dlsym(handle, "fred") ;
11588 if (symbol == NULL) {
11589 /* try putting a leading underscore */
11590 symbol = dlsym(handle, "_fred") ;
11591 if (symbol == NULL) {
11604 : Call the object file tmp-dyna.o in case dlext=o.
11605 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11606 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11607 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11608 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11611 1) echo "Test program failed using dlopen." >&4
11612 echo "Perhaps you should not use dynamic loading." >&4;;
11613 2) echo "Test program failed using dlsym." >&4
11614 echo "Perhaps you should not use dynamic loading." >&4;;
11615 3) echo "dlsym needs a leading underscore" >&4
11617 4) echo "dlsym doesn't need a leading underscore." >&4;;
11620 echo "I can't compile and run the test program." >&4
11621 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11626 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11631 : see if drand48_r exists
11632 set drand48_r d_drand48_r
11634 case "$d_drand48_r" in
11636 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11637 case "$d_drand48_r_proto:$usethreads" in
11638 ":define") d_drand48_r_proto=define
11639 set d_drand48_r_proto drand48_r $hdrs
11643 case "$d_drand48_r_proto" in
11645 case "$drand48_r_proto" in
11646 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11647 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11649 case "$drand48_r_proto" in
11650 ''|0) d_drand48_r=undef
11652 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11653 * ) case "$drand48_r_proto" in
11654 REENTRANT_PROTO*) ;;
11655 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11657 echo "Prototype: $try" ;;
11660 *) case "$usethreads" in
11661 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11668 *) drand48_r_proto=0
11672 : see if prototype for drand48 is available
11674 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11677 : see if dup2 exists
11681 : see if eaccess exists
11682 set eaccess d_eaccess
11685 : see if endgrent exists
11686 set endgrent d_endgrent
11689 : see if this is an grp system
11695 xxx=`./findhdr grp.h`
11696 $cppstdin $cppflags $cppminus < $xxx >$$.h
11698 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11710 set d_grpasswd; eval $setvar
11714 : see if endgrent_r exists
11715 set endgrent_r d_endgrent_r
11717 case "$d_endgrent_r" in
11719 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11720 case "$d_endgrent_r_proto:$usethreads" in
11721 ":define") d_endgrent_r_proto=define
11722 set d_endgrent_r_proto endgrent_r $hdrs
11726 case "$d_endgrent_r_proto" in
11728 case "$endgrent_r_proto" in
11729 ''|0) try='int endgrent_r(FILE**);'
11730 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11732 case "$endgrent_r_proto" in
11733 ''|0) try='void endgrent_r(FILE**);'
11734 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11736 case "$endgrent_r_proto" in
11737 ''|0) d_endgrent_r=undef
11739 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11740 * ) case "$endgrent_r_proto" in
11741 REENTRANT_PROTO*) ;;
11742 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11744 echo "Prototype: $try" ;;
11747 *) case "$usethreads" in
11748 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11755 *) endgrent_r_proto=0
11759 : see if endhostent exists
11760 set endhostent d_endhent
11763 : see if this is a netdb.h system
11764 set netdb.h i_netdb
11767 : see if endhostent_r exists
11768 set endhostent_r d_endhostent_r
11770 case "$d_endhostent_r" in
11772 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11773 case "$d_endhostent_r_proto:$usethreads" in
11774 ":define") d_endhostent_r_proto=define
11775 set d_endhostent_r_proto endhostent_r $hdrs
11779 case "$d_endhostent_r_proto" in
11781 case "$endhostent_r_proto" in
11782 ''|0) try='int endhostent_r(struct hostent_data*);'
11783 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11785 case "$endhostent_r_proto" in
11786 ''|0) try='void endhostent_r(struct hostent_data*);'
11787 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11789 case "$endhostent_r_proto" in
11790 ''|0) d_endhostent_r=undef
11791 endhostent_r_proto=0
11792 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11793 * ) case "$endhostent_r_proto" in
11794 REENTRANT_PROTO*) ;;
11795 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11797 echo "Prototype: $try" ;;
11800 *) case "$usethreads" in
11801 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11803 d_endhostent_r=undef
11804 endhostent_r_proto=0
11808 *) endhostent_r_proto=0
11812 : see if endnetent exists
11813 set endnetent d_endnent
11816 : see if endnetent_r exists
11817 set endnetent_r d_endnetent_r
11819 case "$d_endnetent_r" in
11821 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11822 case "$d_endnetent_r_proto:$usethreads" in
11823 ":define") d_endnetent_r_proto=define
11824 set d_endnetent_r_proto endnetent_r $hdrs
11828 case "$d_endnetent_r_proto" in
11830 case "$endnetent_r_proto" in
11831 ''|0) try='int endnetent_r(struct netent_data*);'
11832 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11834 case "$endnetent_r_proto" in
11835 ''|0) try='void endnetent_r(struct netent_data*);'
11836 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11838 case "$endnetent_r_proto" in
11839 ''|0) d_endnetent_r=undef
11840 endnetent_r_proto=0
11841 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11842 * ) case "$endnetent_r_proto" in
11843 REENTRANT_PROTO*) ;;
11844 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11846 echo "Prototype: $try" ;;
11849 *) case "$usethreads" in
11850 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11852 d_endnetent_r=undef
11853 endnetent_r_proto=0
11857 *) endnetent_r_proto=0
11861 : see if endprotoent exists
11862 set endprotoent d_endpent
11865 : see if endprotoent_r exists
11866 set endprotoent_r d_endprotoent_r
11868 case "$d_endprotoent_r" in
11870 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11871 case "$d_endprotoent_r_proto:$usethreads" in
11872 ":define") d_endprotoent_r_proto=define
11873 set d_endprotoent_r_proto endprotoent_r $hdrs
11877 case "$d_endprotoent_r_proto" in
11879 case "$endprotoent_r_proto" in
11880 ''|0) try='int endprotoent_r(struct protoent_data*);'
11881 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11883 case "$endprotoent_r_proto" in
11884 ''|0) try='void endprotoent_r(struct protoent_data*);'
11885 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11887 case "$endprotoent_r_proto" in
11888 ''|0) d_endprotoent_r=undef
11889 endprotoent_r_proto=0
11890 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11891 * ) case "$endprotoent_r_proto" in
11892 REENTRANT_PROTO*) ;;
11893 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11895 echo "Prototype: $try" ;;
11898 *) case "$usethreads" in
11899 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11901 d_endprotoent_r=undef
11902 endprotoent_r_proto=0
11906 *) endprotoent_r_proto=0
11910 : see if endpwent exists
11911 set endpwent d_endpwent
11914 : see if this is a pwd.h system
11920 xxx=`./findhdr pwd.h`
11921 $cppstdin $cppflags $cppminus < $xxx >$$.h
11923 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11931 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11939 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11947 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11955 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11963 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11971 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11979 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11991 set d_pwquota; eval $setvar
11992 set d_pwage; eval $setvar
11993 set d_pwchange; eval $setvar
11994 set d_pwclass; eval $setvar
11995 set d_pwexpire; eval $setvar
11996 set d_pwcomment; eval $setvar
11997 set d_pwgecos; eval $setvar
11998 set d_pwpasswd; eval $setvar
12002 : see if endpwent_r exists
12003 set endpwent_r d_endpwent_r
12005 case "$d_endpwent_r" in
12007 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12008 case "$d_endpwent_r_proto:$usethreads" in
12009 ":define") d_endpwent_r_proto=define
12010 set d_endpwent_r_proto endpwent_r $hdrs
12014 case "$d_endpwent_r_proto" in
12016 case "$endpwent_r_proto" in
12017 ''|0) try='int endpwent_r(FILE**);'
12018 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
12020 case "$endpwent_r_proto" in
12021 ''|0) try='void endpwent_r(FILE**);'
12022 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
12024 case "$endpwent_r_proto" in
12025 ''|0) d_endpwent_r=undef
12027 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12028 * ) case "$endpwent_r_proto" in
12029 REENTRANT_PROTO*) ;;
12030 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12032 echo "Prototype: $try" ;;
12035 *) case "$usethreads" in
12036 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12043 *) endpwent_r_proto=0
12047 : see if endservent exists
12048 set endservent d_endsent
12051 : see if endservent_r exists
12052 set endservent_r d_endservent_r
12054 case "$d_endservent_r" in
12056 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12057 case "$d_endservent_r_proto:$usethreads" in
12058 ":define") d_endservent_r_proto=define
12059 set d_endservent_r_proto endservent_r $hdrs
12063 case "$d_endservent_r_proto" in
12065 case "$endservent_r_proto" in
12066 ''|0) try='int endservent_r(struct servent_data*);'
12067 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
12069 case "$endservent_r_proto" in
12070 ''|0) try='void endservent_r(struct servent_data*);'
12071 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
12073 case "$endservent_r_proto" in
12074 ''|0) d_endservent_r=undef
12075 endservent_r_proto=0
12076 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12077 * ) case "$endservent_r_proto" in
12078 REENTRANT_PROTO*) ;;
12079 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12081 echo "Prototype: $try" ;;
12084 *) case "$usethreads" in
12085 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12087 d_endservent_r=undef
12088 endservent_r_proto=0
12092 *) endservent_r_proto=0
12096 : Locate the flags for 'open()'
12099 #include <sys/types.h>
12104 #include <sys/file.h>
12106 #$i_stdlib I_STDLIB
12108 #include <stdlib.h>
12119 : check sys/file.h first to get FREAD on Sun
12120 if $test `./findhdr sys/file.h` && \
12121 set try -DI_SYS_FILE && eval $compile; then
12123 echo "<sys/file.h> defines the O_* constants..." >&4
12124 if $run ./try; then
12125 echo "and you have the 3 argument form of open()." >&4
12128 echo "but not the 3 argument form of open(). Oh, well." >&4
12131 elif $test `./findhdr fcntl.h` && \
12132 set try -DI_FCNTL && eval $compile; then
12134 echo "<fcntl.h> defines the O_* constants..." >&4
12135 if $run ./try; then
12136 echo "and you have the 3 argument form of open()." >&4
12139 echo "but not the 3 argument form of open(). Oh, well." >&4
12144 echo "I can't find the O_* constant definitions! You got problems." >&4
12150 : see which of string.h or strings.h is needed
12152 strings=`./findhdr string.h`
12153 if $test "$strings" && $test -r "$strings"; then
12154 echo "Using <string.h> instead of <strings.h>." >&4
12158 strings=`./findhdr strings.h`
12159 if $test "$strings" && $test -r "$strings"; then
12160 echo "Using <strings.h> instead of <string.h>." >&4
12162 echo "No string header found -- You'll surely have problems." >&4
12167 case "$i_string" in
12168 "$undef") strings=`./findhdr strings.h`;;
12169 *) strings=`./findhdr string.h`;;
12172 : see if this is a sys/file.h system
12177 : do we need to include sys/file.h ?
12181 if $h_sysfile; then
12183 echo "We'll be including <sys/file.h>." >&4
12186 echo "We won't be including <sys/file.h>." >&4
12196 : see if fcntl.h is there
12201 : see if we can include fcntl.h
12207 echo "We'll be including <fcntl.h>." >&4
12210 if $h_sysfile; then
12211 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12213 echo "We won't be including <fcntl.h>." >&4
12225 : see if fork exists
12229 : see if pipe exists
12233 : check for non-blocking I/O stuff
12234 case "$h_sysfile" in
12235 true) echo "#include <sys/file.h>" > head.c;;
12238 true) echo "#include <fcntl.h>" > head.c;;
12239 *) echo "#include <sys/fcntl.h>" > head.c;;
12244 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12245 case "$o_nonblock" in
12247 $cat head.c > try.c
12248 $cat >>try.c <<EOCP
12250 #$i_stdlib I_STDLIB
12252 #include <stdlib.h>
12260 printf("O_NONBLOCK\n");
12264 printf("O_NDELAY\n");
12268 printf("FNDELAY\n");
12275 if eval $compile_ok; then
12276 o_nonblock=`$run ./try`
12277 case "$o_nonblock" in
12278 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12279 *) echo "Seems like we can use $o_nonblock.";;
12282 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12285 *) echo "Using $hint value $o_nonblock.";;
12290 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12293 case "$d_fork:$d_pipe" in
12295 $cat head.c > try.c
12296 $cat >>try.c <<EOCP
12298 #include <sys/types.h>
12299 #include <signal.h>
12301 #$i_stdlib I_STDLIB
12303 #include <stdlib.h>
12309 #define MY_O_NONBLOCK $o_nonblock
12310 #ifndef errno /* XXX need better Configure test */
12313 #$i_unistd I_UNISTD
12315 #include <unistd.h>
12317 #$i_string I_STRING
12319 #include <string.h>
12321 #include <strings.h>
12323 $signal_t blech(int x) { exit(3); }
12325 $cat >> try.c <<'EOCP'
12333 pipe(pd); /* Down: child -> parent */
12334 pipe(pu); /* Up: parent -> child */
12337 close(pd[1]); /* Parent reads from pd[0] */
12338 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12340 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12345 signal(SIGALRM, blech);
12347 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12349 sprintf(string, "%d\n", ret);
12350 write(2, string, strlen(string));
12353 if (errno == EAGAIN) {
12354 printf("EAGAIN\n");
12359 if (errno == EWOULDBLOCK)
12360 printf("EWOULDBLOCK\n");
12363 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12364 sleep(2); /* Give it time to close our pipe */
12366 ret = read(pd[0], buf, 1); /* Should read EOF */
12368 sprintf(string, "%d\n", ret);
12369 write(4, string, strlen(string));
12373 close(pd[0]); /* We write to pd[1] */
12374 close(pu[1]); /* We read from pu[0] */
12375 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12376 close(pd[1]); /* Pipe pd is now fully closed! */
12377 exit(0); /* Bye bye, thank you for playing! */
12381 if eval $compile_ok; then
12382 echo "$startsh" >mtry
12383 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12385 ./mtry >/dev/null 2>&1
12387 0) eagain=`$cat try.out`;;
12388 1) echo "Could not perform non-blocking setting!";;
12389 2) echo "I did a successful read() for something that was not there!";;
12390 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12391 4) echo "Could not find F_SETFL!";;
12392 *) echo "Something terribly wrong happened during testing.";;
12394 rd_nodata=`$cat try.ret`
12395 echo "A read() system call with no data present returns $rd_nodata."
12396 case "$rd_nodata" in
12399 echo "(That's peculiar, fixing that to be -1.)"
12405 echo "Forcing errno EAGAIN on read() with no data available."
12409 echo "Your read() sets errno to $eagain when no data is available."
12412 status=`$cat try.err`
12414 0) echo "And it correctly returns 0 to signal EOF.";;
12415 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12416 *) echo "However, your read() returns '$status' on EOF??";;
12419 if test "$status" = "$rd_nodata"; then
12420 echo "WARNING: you can't distinguish between EOF and no data!"
12424 echo "I can't compile the test program--assuming errno EAGAIN will do."
12428 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12437 echo "Using $hint value $eagain."
12438 echo "Your read() returns $rd_nodata when no data is present."
12439 case "$d_eofnblk" in
12440 "$define") echo "And you can see EOF because read() returns 0.";;
12441 "$undef") echo "But you can't see EOF status from read() returned value.";;
12443 echo "(Assuming you can't see EOF status from read anyway.)"
12449 $rm_try head.c mtry
12451 : see if _ptr and _cnt from stdio act std
12454 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12455 echo "(Looks like you have stdio.h from BSD.)"
12456 case "$stdio_ptr" in
12457 '') stdio_ptr='((fp)->_p)'
12460 *) ptr_lval=$d_stdio_ptr_lval;;
12462 case "$stdio_cnt" in
12463 '') stdio_cnt='((fp)->_r)'
12466 *) cnt_lval=$d_stdio_cnt_lval;;
12468 case "$stdio_base" in
12469 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12471 case "$stdio_bufsiz" in
12472 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12474 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12475 echo "(Looks like you have stdio.h from Linux.)"
12476 case "$stdio_ptr" in
12477 '') stdio_ptr='((fp)->_IO_read_ptr)'
12480 *) ptr_lval=$d_stdio_ptr_lval;;
12482 case "$stdio_cnt" in
12483 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12486 *) cnt_lval=$d_stdio_cnt_lval;;
12488 case "$stdio_base" in
12489 '') stdio_base='((fp)->_IO_read_base)';;
12491 case "$stdio_bufsiz" in
12492 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12495 case "$stdio_ptr" in
12496 '') stdio_ptr='((fp)->_ptr)'
12499 *) ptr_lval=$d_stdio_ptr_lval;;
12501 case "$stdio_cnt" in
12502 '') stdio_cnt='((fp)->_cnt)'
12505 *) cnt_lval=$d_stdio_cnt_lval;;
12507 case "$stdio_base" in
12508 '') stdio_base='((fp)->_base)';;
12510 case "$stdio_bufsiz" in
12511 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12515 : test whether _ptr and _cnt really work
12516 echo "Checking how std your stdio is..." >&4
12519 #$i_stdlib I_STDLIB
12521 #include <stdlib.h>
12523 #define FILE_ptr(fp) $stdio_ptr
12524 #define FILE_cnt(fp) $stdio_cnt
12526 FILE *fp = fopen("try.c", "r");
12529 18 <= FILE_cnt(fp) &&
12530 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12538 if eval $compile && $to try.c; then
12539 if $run ./try; then
12540 echo "Your stdio acts pretty std."
12543 echo "Your stdio isn't very std."
12546 echo "Your stdio doesn't appear very std."
12550 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12551 # direct buffer manipulation no longer works. The Configure tests
12552 # should be changed to correctly detect this, but until then,
12553 # the following check should at least let perl compile and run.
12554 # (This quick fix should be updated before 5.8.1.)
12555 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12556 # A. Dougherty, June 3, 2002.
12557 case "$d_gnulibc" in
12559 case "$gnulibc_version" in
12563 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12572 : Can _ptr be used as an lvalue?
12573 case "$d_stdstdio$ptr_lval" in
12574 $define$define) val=$define ;;
12577 set d_stdio_ptr_lval
12580 : Can _cnt be used as an lvalue?
12581 case "$d_stdstdio$cnt_lval" in
12582 $define$define) val=$define ;;
12585 set d_stdio_cnt_lval
12589 : test whether setting _ptr sets _cnt as a side effect
12590 d_stdio_ptr_lval_sets_cnt="$undef"
12591 d_stdio_ptr_lval_nochange_cnt="$undef"
12592 case "$d_stdio_ptr_lval$d_stdstdio" in
12594 echo "Checking to see what happens if we set the stdio ptr..." >&4
12597 /* Can we scream? */
12598 /* Eat dust sed :-) */
12599 /* In the buffer space, no one can hear you scream. */
12600 #$i_stdlib I_STDLIB
12602 #include <stdlib.h>
12604 #define FILE_ptr(fp) $stdio_ptr
12605 #define FILE_cnt(fp) $stdio_cnt
12606 #include <sys/types.h>
12608 FILE *fp = fopen("try.c", "r");
12613 puts("Fail even to read");
12616 c = getc(fp); /* Read away the first # */
12618 puts("Fail even to read");
12622 18 <= FILE_cnt(fp) &&
12623 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12625 puts("Fail even to read");
12628 ptr = (char*) FILE_ptr(fp);
12629 cnt = (size_t)FILE_cnt(fp);
12631 FILE_ptr(fp) += 42;
12633 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12634 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12637 if (FILE_cnt(fp) <= 20) {
12638 printf ("Fail (<20 chars to test)");
12641 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12642 puts("Fail compare");
12645 if (cnt == FILE_cnt(fp)) {
12646 puts("Pass_unchanged");
12649 if (FILE_cnt(fp) == (cnt - 42)) {
12650 puts("Pass_changed");
12653 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12659 if eval $compile && $to try.c; then
12660 case `$run ./try` in
12662 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12663 d_stdio_ptr_lval_sets_cnt="$define" ;;
12665 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12666 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12668 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12670 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12673 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12679 : see if _base is also standard
12681 case "$d_stdstdio" in
12685 #$i_stdlib I_STDLIB
12687 #include <stdlib.h>
12689 #define FILE_base(fp) $stdio_base
12690 #define FILE_bufsiz(fp) $stdio_bufsiz
12692 FILE *fp = fopen("try.c", "r");
12695 19 <= FILE_bufsiz(fp) &&
12696 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12703 if eval $compile && $to try.c; then
12704 if $run ./try; then
12705 echo "And its _base field acts std."
12708 echo "But its _base field isn't std."
12711 echo "However, it seems to be lacking the _base field."
12719 : see if fast_stdio exists
12721 case "$d_stdstdio:$d_stdio_ptr_lval" in
12723 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12725 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12736 : see if fchdir exists
12737 set fchdir d_fchdir
12740 : see if fchmod exists
12741 set fchmod d_fchmod
12744 : see if fchown exists
12745 set fchown d_fchown
12748 : see if this is an fcntl system
12753 : See if fcntl-based locking works.
12755 #$i_stdlib I_STDLIB
12757 #include <stdlib.h>
12759 #include <unistd.h>
12761 #include <signal.h>
12762 $signal_t blech(int x) { exit(3); }
12764 #if defined(F_SETLK) && defined(F_SETLKW)
12765 struct flock flock;
12767 fd = open("try.c", O_RDONLY);
12768 flock.l_type = F_RDLCK;
12769 flock.l_whence = SEEK_SET;
12770 flock.l_start = flock.l_len = 0;
12771 signal(SIGALRM, blech);
12773 retval = fcntl(fd, F_SETLK, &flock);
12775 (retval < 0 ? exit(2) : exit(0));
12781 echo "Checking if fcntl-based file locking works... "
12785 if eval $compile_ok; then
12786 if $run ./try; then
12787 echo "Yes, it seems to work."
12790 echo "Nope, it didn't work."
12795 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12796 *** This is (almost) impossible.
12797 *** If your NFS lock daemons are not feeling well, something like
12798 *** this may happen, please investigate. Cannot continue, aborting.
12806 echo "I'm unable to compile the test program, so I'll assume not."
12811 echo "Nope, since you don't even have fcntl()."
12814 set d_fcntl_can_lock
12818 : check for fd_set items
12821 Checking to see how well your C compiler handles fd_set and friends ...
12824 #$i_stdlib I_STDLIB
12826 #include <stdlib.h>
12828 #$i_systime I_SYS_TIME
12829 #$i_sysselct I_SYS_SELECT
12830 #$d_socket HAS_SOCKET
12831 #include <sys/types.h>
12833 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12836 #include <sys/time.h>
12838 #ifdef I_SYS_SELECT
12839 #include <sys/select.h>
12848 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12856 if eval $compile; then
12857 d_fds_bits="$define"
12859 echo "Well, your system knows about the normal fd_set typedef..." >&4
12860 if $run ./try; then
12861 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12862 d_fd_macros="$define"
12865 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12867 d_fd_macros="$undef"
12871 Hmm, your compiler has some difficulty with fd_set. Checking further...
12874 if eval $compile; then
12875 d_fds_bits="$undef"
12877 echo "Well, your system has some sort of fd_set available..." >&4
12878 if $run ./try; then
12879 echo "and you have the normal fd_set macros." >&4
12880 d_fd_macros="$define"
12883 but not the normal fd_set macros! Gross! More work for me...
12885 d_fd_macros="$undef"
12888 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12890 d_fds_bits="$undef"
12891 d_fd_macros="$undef"
12896 : see if fgetpos exists
12897 set fgetpos d_fgetpos
12900 : see if finite exists
12901 set finite d_finite
12904 : see if finitel exists
12905 set finitel d_finitel
12908 : see if flock exists
12912 : see if prototype for flock is available
12914 set d_flockproto flock $i_sysfile sys/file.h
12917 : see if fp_class exists
12918 set fp_class d_fp_class
12921 : see if pathconf exists
12922 set pathconf d_pathconf
12925 : see if fpathconf exists
12926 set fpathconf d_fpathconf
12929 : see if fpclass exists
12930 set fpclass d_fpclass
12933 : see if fpclassify exists
12934 set fpclassify d_fpclassify
12937 : see if fpclassl exists
12938 set fpclassl d_fpclassl
12942 : check for fpos64_t
12944 echo "Checking to see if you have fpos64_t..." >&4
12947 int main() { fpos64_t x = 7; }
12950 if eval $compile; then
12952 echo "You have fpos64_t."
12955 echo "You do not have fpos64_t."
12956 case "$fpossize" in
12957 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12964 : see if frexpl exists
12965 set frexpl d_frexpl
12968 : see if this is a sys/param system
12969 set sys/param.h i_sysparam
12972 : see if this is a sys/mount.h system
12973 set sys/mount.h i_sysmount
12978 echo "Checking to see if your system supports struct fs_data..." >&4
12979 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12981 case "$d_fs_data_s" in
12982 "$define") echo "Yes, it does." ;;
12983 *) echo "No, it doesn't." ;;
12986 : see if fseeko exists
12987 set fseeko d_fseeko
12989 case "$longsize" in
12990 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12993 : see if fsetpos exists
12994 set fsetpos d_fsetpos
12998 : see if fstatfs exists
12999 set fstatfs d_fstatfs
13003 : see if statvfs exists
13004 set statvfs d_statvfs
13007 : see if fstatvfs exists
13008 set fstatvfs d_fstatvfs
13012 : see if fsync exists
13016 : see if ftello exists
13017 set ftello d_ftello
13019 case "$longsize" in
13020 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13024 : check for a working futimes
13026 echo "Checking if you have a working futimes()" >&4
13029 #include <sys/time.h>
13036 fd = open ("try.c", O_RDWR);
13037 if (-1 == fd) exit (1);
13038 rv = futimes (fd, NULL);
13039 exit (rv == -1 ? errno : 0);
13043 if eval $compile; then
13047 0) echo "Yes, you have" >&4
13048 d_futimes="$define"
13050 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13054 echo "No, it does not (probably harmless)" >&4
13058 : see if getcwd exists
13059 set getcwd d_getcwd
13062 : see if getespwnam exists
13063 set getespwnam d_getespwnam
13067 : see if getfsstat exists
13068 set getfsstat d_getfsstat
13071 : see if getgrent exists
13072 set getgrent d_getgrent
13075 : see if getgrent_r exists
13076 set getgrent_r d_getgrent_r
13078 case "$d_getgrent_r" in
13080 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13081 case "$d_getgrent_r_proto:$usethreads" in
13082 ":define") d_getgrent_r_proto=define
13083 set d_getgrent_r_proto getgrent_r $hdrs
13087 case "$d_getgrent_r_proto" in
13089 case "$getgrent_r_proto" in
13090 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13091 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13093 case "$getgrent_r_proto" in
13094 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13095 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13097 case "$getgrent_r_proto" in
13098 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13099 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
13101 case "$getgrent_r_proto" in
13102 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13103 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
13105 case "$getgrent_r_proto" in
13106 ''|0) try='int getgrent_r(struct group*, char*, int);'
13107 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
13109 case "$getgrent_r_proto" in
13110 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13111 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13113 case "$getgrent_r_proto" in
13114 ''|0) d_getgrent_r=undef
13116 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13117 * ) case "$getgrent_r_proto" in
13118 REENTRANT_PROTO*) ;;
13119 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13121 echo "Prototype: $try" ;;
13124 *) case "$usethreads" in
13125 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13132 *) getgrent_r_proto=0
13136 : see if getgrgid_r exists
13137 set getgrgid_r d_getgrgid_r
13139 case "$d_getgrgid_r" in
13141 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13142 case "$d_getgrgid_r_proto:$usethreads" in
13143 ":define") d_getgrgid_r_proto=define
13144 set d_getgrgid_r_proto getgrgid_r $hdrs
13148 case "$d_getgrgid_r_proto" in
13150 case "$getgrgid_r_proto" in
13151 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13152 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13154 case "$getgrgid_r_proto" in
13155 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13156 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13158 case "$getgrgid_r_proto" in
13159 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13160 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13162 case "$getgrgid_r_proto" in
13163 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13164 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13166 case "$getgrgid_r_proto" in
13167 ''|0) d_getgrgid_r=undef
13169 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13170 * ) case "$getgrgid_r_proto" in
13171 REENTRANT_PROTO*) ;;
13172 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13174 echo "Prototype: $try" ;;
13177 *) case "$usethreads" in
13178 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13185 *) getgrgid_r_proto=0
13189 : see if getgrnam_r exists
13190 set getgrnam_r d_getgrnam_r
13192 case "$d_getgrnam_r" in
13194 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13195 case "$d_getgrnam_r_proto:$usethreads" in
13196 ":define") d_getgrnam_r_proto=define
13197 set d_getgrnam_r_proto getgrnam_r $hdrs
13201 case "$d_getgrnam_r_proto" in
13203 case "$getgrnam_r_proto" in
13204 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13205 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13207 case "$getgrnam_r_proto" in
13208 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13209 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13211 case "$getgrnam_r_proto" in
13212 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13213 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13215 case "$getgrnam_r_proto" in
13216 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13217 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13219 case "$getgrnam_r_proto" in
13220 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13221 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13223 case "$getgrnam_r_proto" in
13224 ''|0) d_getgrnam_r=undef
13226 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13227 * ) case "$getgrnam_r_proto" in
13228 REENTRANT_PROTO*) ;;
13229 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13231 echo "Prototype: $try" ;;
13234 *) case "$usethreads" in
13235 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13242 *) getgrnam_r_proto=0
13246 : see if gethostbyaddr exists
13247 set gethostbyaddr d_gethbyaddr
13250 : see if gethostbyname exists
13251 set gethostbyname d_gethbyname
13254 : see if gethostent exists
13255 set gethostent d_gethent
13258 : see how we will look up host name
13261 if set gethostname val -f d_gethname; eval $csym; $val; then
13262 echo 'gethostname() found.' >&4
13263 d_gethname="$define"
13266 if set uname val -f d_uname; eval $csym; $val; then
13269 uname() was found, but you're running xenix, and older versions of xenix
13270 have a broken uname(). If you don't really know whether your xenix is old
13271 enough to have a broken system call, use the default answer.
13276 "$define") dflt=n;;
13278 rp='Is your uname() broken?'
13281 n*) d_uname="$define"; call=uname;;
13284 echo 'uname() found.' >&4
13291 case "$d_gethname" in
13292 '') d_gethname="$undef";;
13295 '') d_uname="$undef";;
13297 case "$d_uname$d_gethname" in
13302 Every now and then someone has a $call() that lies about the hostname
13303 but can't be fixed for political or economic reasons. If you wish, I can
13304 pretend $call() isn't there and maybe compute hostname at run-time
13305 thanks to the '$phostname' command.
13308 rp="Shall I ignore $call() from now on?"
13311 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13314 case "$phostname" in
13315 '') aphostname='';;
13316 *) case "$aphostname" in
13318 *) set X $phostname
13322 file=`./loc $file $file $pth`
13323 aphostname=`echo $file $*`
13328 case "$d_uname$d_gethname" in
13331 case "$phostname" in
13333 echo "There will be no way for $package to get your hostname." >&4;;
13335 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13339 case "$d_phostname" in
13340 '') d_phostname="$undef";;
13343 : see if gethostbyaddr_r exists
13344 set gethostbyaddr_r d_gethostbyaddr_r
13346 case "$d_gethostbyaddr_r" in
13348 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13349 case "$d_gethostbyaddr_r_proto:$usethreads" in
13350 ":define") d_gethostbyaddr_r_proto=define
13351 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13355 case "$d_gethostbyaddr_r_proto" in
13357 case "$gethostbyaddr_r_proto" in
13358 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13359 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13361 case "$gethostbyaddr_r_proto" in
13362 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13363 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13365 case "$gethostbyaddr_r_proto" in
13366 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13367 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13369 case "$gethostbyaddr_r_proto" in
13370 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13371 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13373 case "$gethostbyaddr_r_proto" in
13374 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13375 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13377 case "$gethostbyaddr_r_proto" in
13378 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13379 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13381 case "$gethostbyaddr_r_proto" in
13382 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13383 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13385 case "$gethostbyaddr_r_proto" in
13386 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13387 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13389 case "$gethostbyaddr_r_proto" in
13390 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13391 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13393 case "$gethostbyaddr_r_proto" in
13394 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13395 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13397 case "$gethostbyaddr_r_proto" in
13398 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13399 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13401 case "$gethostbyaddr_r_proto" in
13402 ''|0) d_gethostbyaddr_r=undef
13403 gethostbyaddr_r_proto=0
13404 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13405 * ) case "$gethostbyaddr_r_proto" in
13406 REENTRANT_PROTO*) ;;
13407 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13409 echo "Prototype: $try" ;;
13412 *) case "$usethreads" in
13413 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13415 d_gethostbyaddr_r=undef
13416 gethostbyaddr_r_proto=0
13420 *) gethostbyaddr_r_proto=0
13424 : see if gethostbyname_r exists
13425 set gethostbyname_r d_gethostbyname_r
13427 case "$d_gethostbyname_r" in
13429 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13430 case "$d_gethostbyname_r_proto:$usethreads" in
13431 ":define") d_gethostbyname_r_proto=define
13432 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13436 case "$d_gethostbyname_r_proto" in
13438 case "$gethostbyname_r_proto" in
13439 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13440 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13442 case "$gethostbyname_r_proto" in
13443 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13444 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13446 case "$gethostbyname_r_proto" in
13447 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13448 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13450 case "$gethostbyname_r_proto" in
13451 ''|0) d_gethostbyname_r=undef
13452 gethostbyname_r_proto=0
13453 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13454 * ) case "$gethostbyname_r_proto" in
13455 REENTRANT_PROTO*) ;;
13456 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13458 echo "Prototype: $try" ;;
13461 *) case "$usethreads" in
13462 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13464 d_gethostbyname_r=undef
13465 gethostbyname_r_proto=0
13469 *) gethostbyname_r_proto=0
13473 : see if gethostent_r exists
13474 set gethostent_r d_gethostent_r
13476 case "$d_gethostent_r" in
13478 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13479 case "$d_gethostent_r_proto:$usethreads" in
13480 ":define") d_gethostent_r_proto=define
13481 set d_gethostent_r_proto gethostent_r $hdrs
13485 case "$d_gethostent_r_proto" in
13487 case "$gethostent_r_proto" in
13488 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13489 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13491 case "$gethostent_r_proto" in
13492 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13493 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13495 case "$gethostent_r_proto" in
13496 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13497 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13499 case "$gethostent_r_proto" in
13500 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13501 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13503 case "$gethostent_r_proto" in
13504 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13505 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13507 case "$gethostent_r_proto" in
13508 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13509 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13511 case "$gethostent_r_proto" in
13512 ''|0) d_gethostent_r=undef
13513 gethostent_r_proto=0
13514 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13515 * ) case "$gethostent_r_proto" in
13516 REENTRANT_PROTO*) ;;
13517 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13519 echo "Prototype: $try" ;;
13522 *) case "$usethreads" in
13523 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13525 d_gethostent_r=undef
13526 gethostent_r_proto=0
13530 *) gethostent_r_proto=0
13534 : see if prototypes for various gethostxxx netdb.h functions are available
13536 set d_gethostprotos gethostent $i_netdb netdb.h
13539 : see if getitimer exists
13540 set getitimer d_getitimer
13543 : see if getlogin exists
13544 set getlogin d_getlogin
13547 : see if getlogin_r exists
13548 set getlogin_r d_getlogin_r
13550 case "$d_getlogin_r" in
13552 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13553 case "$d_getlogin_r_proto:$usethreads" in
13554 ":define") d_getlogin_r_proto=define
13555 set d_getlogin_r_proto getlogin_r $hdrs
13559 case "$d_getlogin_r_proto" in
13561 case "$getlogin_r_proto" in
13562 ''|0) try='int getlogin_r(char*, size_t);'
13563 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13565 case "$getlogin_r_proto" in
13566 ''|0) try='int getlogin_r(char*, int);'
13567 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13569 case "$getlogin_r_proto" in
13570 ''|0) try='char* getlogin_r(char*, size_t);'
13571 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13573 case "$getlogin_r_proto" in
13574 ''|0) try='char* getlogin_r(char*, int);'
13575 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13577 case "$getlogin_r_proto" in
13578 ''|0) d_getlogin_r=undef
13580 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13581 * ) case "$getlogin_r_proto" in
13582 REENTRANT_PROTO*) ;;
13583 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13585 echo "Prototype: $try" ;;
13588 *) case "$usethreads" in
13589 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13596 *) getlogin_r_proto=0
13600 : see if getmnt exists
13601 set getmnt d_getmnt
13604 : see if getmntent exists
13605 set getmntent d_getmntent
13608 : see if getnetbyaddr exists
13609 set getnetbyaddr d_getnbyaddr
13612 : see if getnetbyname exists
13613 set getnetbyname d_getnbyname
13616 : see if getnetent exists
13617 set getnetent d_getnent
13620 : see if getnetbyaddr_r exists
13621 set getnetbyaddr_r d_getnetbyaddr_r
13623 case "$d_getnetbyaddr_r" in
13625 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13626 case "$d_getnetbyaddr_r_proto:$usethreads" in
13627 ":define") d_getnetbyaddr_r_proto=define
13628 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13632 case "$d_getnetbyaddr_r_proto" in
13634 case "$getnetbyaddr_r_proto" in
13635 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13636 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13638 case "$getnetbyaddr_r_proto" in
13639 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13640 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13642 case "$getnetbyaddr_r_proto" in
13643 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13644 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13646 case "$getnetbyaddr_r_proto" in
13647 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13648 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13650 case "$getnetbyaddr_r_proto" in
13651 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13652 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13654 case "$getnetbyaddr_r_proto" in
13655 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13656 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13658 case "$getnetbyaddr_r_proto" in
13659 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13660 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13662 case "$getnetbyaddr_r_proto" in
13663 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13664 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13666 case "$getnetbyaddr_r_proto" in
13667 ''|0) d_getnetbyaddr_r=undef
13668 getnetbyaddr_r_proto=0
13669 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13670 * ) case "$getnetbyaddr_r_proto" in
13671 REENTRANT_PROTO*) ;;
13672 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13674 echo "Prototype: $try" ;;
13677 *) case "$usethreads" in
13678 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13680 d_getnetbyaddr_r=undef
13681 getnetbyaddr_r_proto=0
13685 *) getnetbyaddr_r_proto=0
13689 : see if getnetbyname_r exists
13690 set getnetbyname_r d_getnetbyname_r
13692 case "$d_getnetbyname_r" in
13694 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13695 case "$d_getnetbyname_r_proto:$usethreads" in
13696 ":define") d_getnetbyname_r_proto=define
13697 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13701 case "$d_getnetbyname_r_proto" in
13703 case "$getnetbyname_r_proto" in
13704 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13705 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13707 case "$getnetbyname_r_proto" in
13708 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13709 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13711 case "$getnetbyname_r_proto" in
13712 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13713 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13715 case "$getnetbyname_r_proto" in
13716 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13717 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13719 case "$getnetbyname_r_proto" in
13720 ''|0) d_getnetbyname_r=undef
13721 getnetbyname_r_proto=0
13722 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13723 * ) case "$getnetbyname_r_proto" in
13724 REENTRANT_PROTO*) ;;
13725 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13727 echo "Prototype: $try" ;;
13730 *) case "$usethreads" in
13731 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13733 d_getnetbyname_r=undef
13734 getnetbyname_r_proto=0
13738 *) getnetbyname_r_proto=0
13742 : see if getnetent_r exists
13743 set getnetent_r d_getnetent_r
13745 case "$d_getnetent_r" in
13747 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13748 case "$d_getnetent_r_proto:$usethreads" in
13749 ":define") d_getnetent_r_proto=define
13750 set d_getnetent_r_proto getnetent_r $hdrs
13754 case "$d_getnetent_r_proto" in
13756 case "$getnetent_r_proto" in
13757 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13758 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13760 case "$getnetent_r_proto" in
13761 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13762 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13764 case "$getnetent_r_proto" in
13765 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13766 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13768 case "$getnetent_r_proto" in
13769 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13770 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13772 case "$getnetent_r_proto" in
13773 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13774 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13776 case "$getnetent_r_proto" in
13777 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13778 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13780 case "$getnetent_r_proto" in
13781 ''|0) d_getnetent_r=undef
13782 getnetent_r_proto=0
13783 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13784 * ) case "$getnetent_r_proto" in
13785 REENTRANT_PROTO*) ;;
13786 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13788 echo "Prototype: $try" ;;
13791 *) case "$usethreads" in
13792 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13794 d_getnetent_r=undef
13795 getnetent_r_proto=0
13799 *) getnetent_r_proto=0
13803 : see if prototypes for various getnetxxx netdb.h functions are available
13805 set d_getnetprotos getnetent $i_netdb netdb.h
13808 : see if getpagesize exists
13809 set getpagesize d_getpagsz
13813 : see if getprotobyname exists
13814 set getprotobyname d_getpbyname
13817 : see if getprotobynumber exists
13818 set getprotobynumber d_getpbynumber
13821 : see if getprotoent exists
13822 set getprotoent d_getpent
13825 : see if getpgid exists
13826 set getpgid d_getpgid
13829 : see if getpgrp2 exists
13830 set getpgrp2 d_getpgrp2
13833 : see if getppid exists
13834 set getppid d_getppid
13837 : see if getpriority exists
13838 set getpriority d_getprior
13841 : see if getprotobyname_r exists
13842 set getprotobyname_r d_getprotobyname_r
13844 case "$d_getprotobyname_r" in
13846 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13847 case "$d_getprotobyname_r_proto:$usethreads" in
13848 ":define") d_getprotobyname_r_proto=define
13849 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13853 case "$d_getprotobyname_r_proto" in
13855 case "$getprotobyname_r_proto" in
13856 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13857 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13859 case "$getprotobyname_r_proto" in
13860 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13861 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13863 case "$getprotobyname_r_proto" in
13864 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13865 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13867 case "$getprotobyname_r_proto" in
13868 ''|0) d_getprotobyname_r=undef
13869 getprotobyname_r_proto=0
13870 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13871 * ) case "$getprotobyname_r_proto" in
13872 REENTRANT_PROTO*) ;;
13873 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13875 echo "Prototype: $try" ;;
13878 *) case "$usethreads" in
13879 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13881 d_getprotobyname_r=undef
13882 getprotobyname_r_proto=0
13886 *) getprotobyname_r_proto=0
13890 : see if getprotobynumber_r exists
13891 set getprotobynumber_r d_getprotobynumber_r
13893 case "$d_getprotobynumber_r" in
13895 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13896 case "$d_getprotobynumber_r_proto:$usethreads" in
13897 ":define") d_getprotobynumber_r_proto=define
13898 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13902 case "$d_getprotobynumber_r_proto" in
13904 case "$getprotobynumber_r_proto" in
13905 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13906 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13908 case "$getprotobynumber_r_proto" in
13909 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13910 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13912 case "$getprotobynumber_r_proto" in
13913 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13914 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13916 case "$getprotobynumber_r_proto" in
13917 ''|0) d_getprotobynumber_r=undef
13918 getprotobynumber_r_proto=0
13919 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13920 * ) case "$getprotobynumber_r_proto" in
13921 REENTRANT_PROTO*) ;;
13922 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13924 echo "Prototype: $try" ;;
13927 *) case "$usethreads" in
13928 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13930 d_getprotobynumber_r=undef
13931 getprotobynumber_r_proto=0
13935 *) getprotobynumber_r_proto=0
13939 : see if getprotoent_r exists
13940 set getprotoent_r d_getprotoent_r
13942 case "$d_getprotoent_r" in
13944 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13945 case "$d_getprotoent_r_proto:$usethreads" in
13946 ":define") d_getprotoent_r_proto=define
13947 set d_getprotoent_r_proto getprotoent_r $hdrs
13951 case "$d_getprotoent_r_proto" in
13953 case "$getprotoent_r_proto" in
13954 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13955 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13957 case "$getprotoent_r_proto" in
13958 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13959 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13961 case "$getprotoent_r_proto" in
13962 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13963 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13965 case "$getprotoent_r_proto" in
13966 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13967 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13969 case "$getprotoent_r_proto" in
13970 ''|0) d_getprotoent_r=undef
13971 getprotoent_r_proto=0
13972 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13973 * ) case "$getprotoent_r_proto" in
13974 REENTRANT_PROTO*) ;;
13975 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13977 echo "Prototype: $try" ;;
13980 *) case "$usethreads" in
13981 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13983 d_getprotoent_r=undef
13984 getprotoent_r_proto=0
13988 *) getprotoent_r_proto=0
13992 : see if prototypes for various getprotoxxx netdb.h functions are available
13994 set d_getprotoprotos getprotoent $i_netdb netdb.h
13997 : see if getprpwnam exists
13998 set getprpwnam d_getprpwnam
14001 : see if getpwent exists
14002 set getpwent d_getpwent
14005 : see if getpwent_r exists
14006 set getpwent_r d_getpwent_r
14008 case "$d_getpwent_r" in
14010 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14011 case "$d_getpwent_r_proto:$usethreads" in
14012 ":define") d_getpwent_r_proto=define
14013 set d_getpwent_r_proto getpwent_r $hdrs
14017 case "$d_getpwent_r_proto" in
14019 case "$getpwent_r_proto" in
14020 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14021 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14023 case "$getpwent_r_proto" in
14024 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14025 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14027 case "$getpwent_r_proto" in
14028 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14029 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
14031 case "$getpwent_r_proto" in
14032 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14033 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
14035 case "$getpwent_r_proto" in
14036 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14037 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
14039 case "$getpwent_r_proto" in
14040 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14041 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14043 case "$getpwent_r_proto" in
14044 ''|0) d_getpwent_r=undef
14046 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14047 * ) case "$getpwent_r_proto" in
14048 REENTRANT_PROTO*) ;;
14049 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14051 echo "Prototype: $try" ;;
14054 *) case "$usethreads" in
14055 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14062 *) getpwent_r_proto=0
14066 : see if getpwnam_r exists
14067 set getpwnam_r d_getpwnam_r
14069 case "$d_getpwnam_r" in
14071 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14072 case "$d_getpwnam_r_proto:$usethreads" in
14073 ":define") d_getpwnam_r_proto=define
14074 set d_getpwnam_r_proto getpwnam_r $hdrs
14078 case "$d_getpwnam_r_proto" in
14080 case "$getpwnam_r_proto" in
14081 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14082 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14084 case "$getpwnam_r_proto" in
14085 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14086 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14088 case "$getpwnam_r_proto" in
14089 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14090 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14092 case "$getpwnam_r_proto" in
14093 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14094 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14096 case "$getpwnam_r_proto" in
14097 ''|0) d_getpwnam_r=undef
14099 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14100 * ) case "$getpwnam_r_proto" in
14101 REENTRANT_PROTO*) ;;
14102 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14104 echo "Prototype: $try" ;;
14107 *) case "$usethreads" in
14108 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14115 *) getpwnam_r_proto=0
14119 : see if getpwuid_r exists
14120 set getpwuid_r d_getpwuid_r
14122 case "$d_getpwuid_r" in
14124 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14125 case "$d_getpwuid_r_proto:$usethreads" in
14126 ":define") d_getpwuid_r_proto=define
14127 set d_getpwuid_r_proto getpwuid_r $hdrs
14131 case "$d_getpwuid_r_proto" in
14133 case "$getpwuid_r_proto" in
14134 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14135 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14137 case "$getpwuid_r_proto" in
14138 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14139 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14141 case "$getpwuid_r_proto" in
14142 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14143 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14145 case "$getpwuid_r_proto" in
14146 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14147 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14149 case "$getpwuid_r_proto" in
14150 ''|0) d_getpwuid_r=undef
14152 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14153 * ) case "$getpwuid_r_proto" in
14154 REENTRANT_PROTO*) ;;
14155 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14157 echo "Prototype: $try" ;;
14160 *) case "$usethreads" in
14161 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14168 *) getpwuid_r_proto=0
14173 : see if getservbyname exists
14174 set getservbyname d_getsbyname
14177 : see if getservbyport exists
14178 set getservbyport d_getsbyport
14181 : see if getservent exists
14182 set getservent d_getsent
14185 : see if getservbyname_r exists
14186 set getservbyname_r d_getservbyname_r
14188 case "$d_getservbyname_r" in
14190 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14191 case "$d_getservbyname_r_proto:$usethreads" in
14192 ":define") d_getservbyname_r_proto=define
14193 set d_getservbyname_r_proto getservbyname_r $hdrs
14197 case "$d_getservbyname_r_proto" in
14199 case "$getservbyname_r_proto" in
14200 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14201 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14203 case "$getservbyname_r_proto" in
14204 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14205 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14207 case "$getservbyname_r_proto" in
14208 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14209 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14211 case "$getservbyname_r_proto" in
14212 ''|0) d_getservbyname_r=undef
14213 getservbyname_r_proto=0
14214 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14215 * ) case "$getservbyname_r_proto" in
14216 REENTRANT_PROTO*) ;;
14217 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14219 echo "Prototype: $try" ;;
14222 *) case "$usethreads" in
14223 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14225 d_getservbyname_r=undef
14226 getservbyname_r_proto=0
14230 *) getservbyname_r_proto=0
14234 : see if getservbyport_r exists
14235 set getservbyport_r d_getservbyport_r
14237 case "$d_getservbyport_r" in
14239 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14240 case "$d_getservbyport_r_proto:$usethreads" in
14241 ":define") d_getservbyport_r_proto=define
14242 set d_getservbyport_r_proto getservbyport_r $hdrs
14246 case "$d_getservbyport_r_proto" in
14248 case "$getservbyport_r_proto" in
14249 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14250 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14252 case "$getservbyport_r_proto" in
14253 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14254 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14256 case "$getservbyport_r_proto" in
14257 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14258 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14260 case "$getservbyport_r_proto" in
14261 ''|0) d_getservbyport_r=undef
14262 getservbyport_r_proto=0
14263 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14264 * ) case "$getservbyport_r_proto" in
14265 REENTRANT_PROTO*) ;;
14266 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14268 echo "Prototype: $try" ;;
14271 *) case "$usethreads" in
14272 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14274 d_getservbyport_r=undef
14275 getservbyport_r_proto=0
14279 *) getservbyport_r_proto=0
14283 : see if getservent_r exists
14284 set getservent_r d_getservent_r
14286 case "$d_getservent_r" in
14288 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14289 case "$d_getservent_r_proto:$usethreads" in
14290 ":define") d_getservent_r_proto=define
14291 set d_getservent_r_proto getservent_r $hdrs
14295 case "$d_getservent_r_proto" in
14297 case "$getservent_r_proto" in
14298 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14299 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
14301 case "$getservent_r_proto" in
14302 ''|0) try='int getservent_r(struct servent*, char*, int);'
14303 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
14305 case "$getservent_r_proto" in
14306 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14307 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
14309 case "$getservent_r_proto" in
14310 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14311 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
14313 case "$getservent_r_proto" in
14314 ''|0) d_getservent_r=undef
14315 getservent_r_proto=0
14316 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14317 * ) case "$getservent_r_proto" in
14318 REENTRANT_PROTO*) ;;
14319 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14321 echo "Prototype: $try" ;;
14324 *) case "$usethreads" in
14325 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14327 d_getservent_r=undef
14328 getservent_r_proto=0
14332 *) getservent_r_proto=0
14336 : see if prototypes for various getservxxx netdb.h functions are available
14338 set d_getservprotos getservent $i_netdb netdb.h
14341 : see if getspnam exists
14342 set getspnam d_getspnam
14345 : see if this is a shadow.h system
14346 set shadow.h i_shadow
14349 : see if getspnam_r exists
14350 set getspnam_r d_getspnam_r
14352 case "$d_getspnam_r" in
14354 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14355 case "$d_getspnam_r_proto:$usethreads" in
14356 ":define") d_getspnam_r_proto=define
14357 set d_getspnam_r_proto getspnam_r $hdrs
14361 case "$d_getspnam_r_proto" in
14363 case "$getspnam_r_proto" in
14364 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14365 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14367 case "$getspnam_r_proto" in
14368 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14369 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14371 case "$getspnam_r_proto" in
14372 ''|0) d_getspnam_r=undef
14374 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14375 * ) case "$getspnam_r_proto" in
14376 REENTRANT_PROTO*) ;;
14377 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14379 echo "Prototype: $try" ;;
14382 *) case "$usethreads" in
14383 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14390 *) getspnam_r_proto=0
14394 : see if gettimeofday or ftime exists
14395 set gettimeofday d_gettimeod
14397 case "$d_gettimeod" in
14403 val="$undef"; set d_ftime; eval $setvar
14406 case "$d_gettimeod$d_ftime" in
14409 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14413 : see if gmtime_r exists
14414 set gmtime_r d_gmtime_r
14416 case "$d_gmtime_r" in
14418 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14419 case "$d_gmtime_r_proto:$usethreads" in
14420 ":define") d_gmtime_r_proto=define
14421 set d_gmtime_r_proto gmtime_r $hdrs
14425 case "$d_gmtime_r_proto" in
14427 case "$gmtime_r_proto" in
14428 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14429 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14431 case "$gmtime_r_proto" in
14432 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14433 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14435 case "$gmtime_r_proto" in
14436 ''|0) d_gmtime_r=undef
14438 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14439 * ) case "$gmtime_r_proto" in
14440 REENTRANT_PROTO*) ;;
14441 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14443 echo "Prototype: $try" ;;
14446 *) case "$usethreads" in
14447 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14454 *) gmtime_r_proto=0
14458 : see if hasmntopt exists
14459 set hasmntopt d_hasmntopt
14462 : see if this is a netinet/in.h or sys/in.h system
14463 set netinet/in.h i_niin sys/in.h i_sysin
14466 : see if arpa/inet.h has to be included
14467 set arpa/inet.h i_arpainet
14470 : see if htonl --and friends-- exists
14475 : Maybe they are macros.
14478 $cat >htonl.c <<EOM
14480 #include <sys/types.h>
14481 #$i_niin I_NETINET_IN
14483 #$i_arpainet I_ARPA_INET
14484 #ifdef I_NETINET_IN
14485 #include <netinet/in.h>
14488 #include <sys/in.h>
14491 #include <arpa/inet.h>
14494 printf("Defined as a macro.");
14497 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14498 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14500 echo "But it seems to be defined as a macro." >&4
14508 : see if ilogbl exists
14509 set ilogbl d_ilogbl
14514 if set index val -f; eval $csym; $val; then
14515 if set strchr val -f d_strchr; eval $csym; $val; then
14516 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14519 echo "strchr() found." >&4
14523 echo "index() found." >&4
14528 echo "index() found." >&4
14531 if set strchr val -f d_strchr; eval $csym; $val; then
14534 echo "strchr() found." >&4
14536 echo "No index() or strchr() found!" >&4
14541 set d_strchr; eval $setvar
14543 set d_index; eval $setvar
14545 : check whether inet_aton exists
14546 set inet_aton d_inetaton
14551 $cat >isascii.c <<EOCP
14554 #$i_stdlib I_STDLIB
14556 #include <stdlib.h>
14567 if eval $compile; then
14568 echo "isascii() found." >&4
14571 echo "isascii() NOT found." >&4
14578 : see if isfinite exists
14579 set isfinite d_isfinite
14582 : see if isinf exists
14586 : see if isnan exists
14590 : see if isnanl exists
14591 set isnanl d_isnanl
14594 : see if killpg exists
14595 set killpg d_killpg
14598 : see if lchown exists
14600 $cat > try.c <<'EOCP'
14601 /* System header to define __stub macros and hopefully few prototypes,
14602 which can conflict with char lchown(); below. */
14603 #include <assert.h>
14604 /* Override any gcc2 internal prototype to avoid an error. */
14605 /* We use char because int might match the return type of a gcc2
14606 builtin and then its argument prototype would still apply. */
14609 /* The GNU C library defines this for functions which it implements
14610 to always fail with ENOSYS. Some functions are actually named
14611 something starting with __ and the normal name is an alias. */
14612 #if defined (__stub_lchown) || defined (__stub___lchown)
14620 if eval $compile; then
14621 $echo "lchown() found." >&4
14624 $echo "lchown() NOT found." >&4
14630 : See if number of significant digits in a double precision number is known
14632 $cat >ldbl_dig.c <<EOM
14633 #$i_limits I_LIMITS
14636 #include <limits.h>
14642 printf("Contains LDBL_DIG");
14645 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14646 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14647 echo "LDBL_DIG found." >&4
14650 echo "LDBL_DIG NOT found." >&4
14657 : see if this is a math.h system
14661 d_libm_lib_version="$undef"
14664 : check to see if math.h defines _LIB_VERSION
14666 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14668 #include <unistd.h>
14670 int main (int argc, char *argv[])
14672 printf ("%d\n", _LIB_VERSION);
14677 if eval $compile; then
14679 echo "Yes, it does ($foo)" >&4
14680 d_libm_lib_version="$define"
14682 echo "No, it does not (probably harmless)" >&4
14689 : see if link exists
14693 : see if localtime_r exists
14694 set localtime_r d_localtime_r
14696 case "$d_localtime_r" in
14698 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14699 case "$d_localtime_r_proto:$usethreads" in
14700 ":define") d_localtime_r_proto=define
14701 set d_localtime_r_proto localtime_r $hdrs
14705 case "$d_localtime_r_proto" in
14707 case "$localtime_r_proto" in
14708 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14709 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14711 case "$localtime_r_proto" in
14712 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14713 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14715 case "$localtime_r_proto" in
14716 ''|0) d_localtime_r=undef
14717 localtime_r_proto=0
14718 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14719 * ) case "$localtime_r_proto" in
14720 REENTRANT_PROTO*) ;;
14721 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14723 echo "Prototype: $try" ;;
14726 *) case "$usethreads" in
14727 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14729 d_localtime_r=undef
14730 localtime_r_proto=0
14734 *) localtime_r_proto=0
14738 : see if localtime_r calls tzset
14739 case "$localtime_r_proto" in
14742 /* Does our libc's localtime_r call tzset ?
14743 * return 0 if so, 1 otherwise.
14745 #include <sys/types.h>
14746 #include <unistd.h>
14748 #include <string.h>
14749 #include <malloc.h>
14752 time_t t = time(0L);
14753 char w_tz[]="TZ" "=GMT+5",
14754 e_tz[]="TZ" "=GMT-5",
14755 *tz_e = (char*)malloc(16),
14756 *tz_w = (char*)malloc(16);
14757 struct tm tm_e, tm_w;
14758 memset(&tm_e,'\0',sizeof(struct tm));
14759 memset(&tm_w,'\0',sizeof(struct tm));
14764 localtime_r(&t, &tm_e);
14767 localtime_r(&t, &tm_w);
14769 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
14775 if eval $compile; then
14776 if $run ./try; then
14777 d_localtime_r_needs_tzset=undef;
14779 d_localtime_r_needs_tzset=define;
14782 d_localtime_r_needs_tzset=undef;
14786 d_localtime_r_needs_tzset=undef;
14791 : see if localeconv exists
14792 set localeconv d_locconv
14795 : see if lockf exists
14799 : see if prototype for lseek is available
14801 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14804 : see if lstat exists
14808 : see if madvise exists
14809 set madvise d_madvise
14812 : see if malloc_size exists
14813 set malloc_size d_malloc_size
14816 : see if malloc_size_good exists
14817 set malloc_good_size d_malloc_good_size
14820 : see if mblen exists
14824 : see if mbstowcs exists
14825 set mbstowcs d_mbstowcs
14828 : see if mbtowc exists
14829 set mbtowc d_mbtowc
14832 : see if memchr exists
14833 set memchr d_memchr
14836 : see if memcmp exists
14837 set memcmp d_memcmp
14840 : see if memcpy exists
14841 set memcpy d_memcpy
14844 : see if memmove exists
14845 set memmove d_memmove
14848 : see if memset exists
14849 set memset d_memset
14852 : see if mkdir exists
14856 : see if mkdtemp exists
14857 set mkdtemp d_mkdtemp
14860 : see if mkfifo exists
14861 set mkfifo d_mkfifo
14864 : see if mkstemp exists
14865 set mkstemp d_mkstemp
14868 : see if mkstemps exists
14869 set mkstemps d_mkstemps
14872 : see if mktime exists
14873 set mktime d_mktime
14876 : see if this is a sys/mman.h system
14877 set sys/mman.h i_sysmman
14880 : see if mmap exists
14883 : see what shmat returns
14884 : default to something harmless
14886 case "$i_sysmman$d_mmap" in
14888 $cat >mmap.c <<'END'
14889 #include <sys/mman.h>
14892 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14897 echo "and it returns ($mmaptype)." >&4
14903 : see if sqrtl exists
14907 : see if scalbnl exists
14908 set scalbnl d_scalbnl
14911 : see if modfl exists
14915 : see if prototype for modfl is available
14917 set d_modflproto modfl $i_math math.h
14920 d_modfl_pow32_bug="$undef"
14922 case "$d_longdbl$d_modfl" in
14925 Checking to see whether your modfl() is okay for large values...
14931 if $test "X$d_modflproto" != "X$define"; then
14932 $cat >>try.c <<EOCP
14933 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14934 long double modfl (long double, long double *);
14937 $cat >>try.c <<EOCP
14939 long double nv = 4294967303.15;
14945 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14949 case "$osname:$gccversion" in
14950 aix:) saveccflags="$ccflags"
14951 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14954 if eval $compile; then
14957 *" 4294967303.150000 1.150000 4294967302.000000")
14958 echo >&4 "Your modfl() is broken for large values."
14959 d_modfl_pow32_bug="$define"
14961 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14965 *" 4294967303.150000 0.150000 4294967303.000000")
14966 echo >&4 "Your modfl() seems okay for large values."
14968 *) echo >&4 "I don't understand your modfl() at all."
14974 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14977 case "$osname:$gccversion" in
14978 aix:) ccflags="$saveccflags" ;; # restore
14983 if $test "$uselongdouble" = "$define"; then
14985 if $test "$d_sqrtl" != "$define"; then
14986 message="$message sqrtl"
14988 if $test "$d_modfl" != "$define"; then
14989 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14990 echo "You have both aintl and copysignl, so I can emulate modfl."
14992 message="$message modfl"
14995 if $test "$d_frexpl" != "$define"; then
14996 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14997 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14999 message="$message frexpl"
15003 if $test "$message" != ""; then
15006 *** You requested the use of long doubles but you do not seem to have
15007 *** the following mathematical functions needed for long double support:
15009 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15010 *** Cannot continue, aborting.
15018 : see if mprotect exists
15019 set mprotect d_mprotect
15022 : see if msgctl exists
15023 set msgctl d_msgctl
15026 : see if msgget exists
15027 set msgget d_msgget
15030 : see if msgsnd exists
15031 set msgsnd d_msgsnd
15034 : see if msgrcv exists
15035 set msgrcv d_msgrcv
15038 : see how much of the 'msg*(2)' library is present.
15041 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15042 *"$undef"*) h_msg=false;;
15046 case "`ipcs 2>&1`" in
15047 "SVID messages"*"not configured"*)
15048 echo "Your $osname does not have the msg*(2) configured." >&4
15051 set msgctl d_msgctl
15053 set msgget d_msgget
15055 set msgsnd d_msgsnd
15057 set msgrcv d_msgrcv
15063 : we could also check for sys/ipc.h ...
15064 if $h_msg && $test `./findhdr sys/msg.h`; then
15065 echo "You have the full msg*(2) library." >&4
15068 echo "You don't have the full msg*(2) library." >&4
15076 echo "Checking to see if your system supports struct msghdr..." >&4
15077 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15079 case "$d_msghdr_s" in
15080 "$define") echo "Yes, it does." ;;
15081 *) echo "No, it doesn't." ;;
15085 : see if msync exists
15089 : see if munmap exists
15090 set munmap d_munmap
15093 : see if nice exists
15097 : see if this is a langinfo.h system
15098 set langinfo.h i_langinfo
15101 : see if nl_langinfo exists
15102 set nl_langinfo d_nl_langinfo
15105 : check for volatile keyword
15107 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15108 $cat >try.c <<'EOCP'
15111 typedef struct _goo_struct goo_struct;
15112 goo_struct * volatile goo = ((goo_struct *)0);
15113 struct _goo_struct {
15118 typedef unsigned short foo_t;
15119 char *volatile foo;
15121 volatile foo_t blech;
15125 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15127 echo "Yup, it does."
15130 echo "Nope, it doesn't."
15138 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15140 case "$use64bitint:$d_quad:$quadtype" in
15143 uvtype="$uquadtype"
15148 uvtype="unsigned long"
15154 case "$uselongdouble:$d_longdbl" in
15156 nvtype="long double"
15157 nvsize=$longdblsize
15164 $echo "(IV will be "$ivtype", $ivsize bytes)"
15165 $echo "(UV will be "$uvtype", $uvsize bytes)"
15166 $echo "(NV will be "$nvtype", $nvsize bytes)"
15169 #$i_inttypes I_INTTYPES
15171 #include <inttypes.h>
15176 int8_t i = INT8_MAX;
15177 uint8_t u = UINT8_MAX;
15178 printf("int8_t\n");
15181 int16_t i = INT16_MAX;
15182 uint16_t i = UINT16_MAX;
15183 printf("int16_t\n");
15186 int32_t i = INT32_MAX;
15187 uint32_t u = UINT32_MAX;
15188 printf("int32_t\n");
15194 u8type="unsigned char"
15199 '') case "$shortsize" in
15201 u16type="unsigned short"
15209 '') set try -DINT16
15210 if eval $compile; then
15211 case "`$run ./try`" in
15223 '') if $test $shortsize -ge 2; then
15225 u16type="unsigned short"
15233 '') case "$longsize" in
15235 u32type="unsigned long"
15239 *) case "$intsize" in
15241 u32type="unsigned int"
15251 '') set try -DINT32
15252 if eval $compile; then
15253 case "`$run ./try`" in
15265 '') if $test $intsize -ge 4; then
15267 u32type="unsigned int"
15275 '') case "$d_quad:$quadtype" in
15277 i64type="$quadtype"
15278 u64type="$uquadtype"
15286 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15287 : volatile so that the compiler has to store it out to memory.
15288 if test X"$d_volatile" = X"$define"; then
15293 #$i_stdlib I_STDLIB
15295 #include <stdlib.h>
15297 #include <sys/types.h>
15298 #include <signal.h>
15300 $volatile int bletched = 0;
15301 $signal_t blech(int s) { bletched = 1; }
15306 int n = 8 * $uvsize;
15309 signal(SIGFPE, blech);
15312 for (i = 0; i < n; i++) {
15313 u = u << 1 | ($uvtype)1;
15315 if (($uvtype)d != u)
15319 d = ($nvtype)(u - 1);
15320 if (($uvtype)d != (u - 1))
15327 printf("%d\n", ((i == n) ? -n : i));
15333 d_nv_preserves_uv="$undef"
15334 if eval $compile; then
15335 nv_preserves_uv_bits="`$run ./try`"
15337 case "$nv_preserves_uv_bits" in
15339 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15340 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15341 d_nv_preserves_uv="$define"
15343 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15344 d_nv_preserves_uv="$undef" ;;
15345 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15346 nv_preserves_uv_bits="0" ;;
15350 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15351 : volatile so that the compiler has to store it out to memory.
15352 if test X"$d_volatile" = X"$define"; then
15357 #$i_stdlib I_STDLIB
15359 #include <stdlib.h>
15361 #$i_string I_STRING
15363 # include <string.h>
15365 # include <strings.h>
15367 #include <sys/types.h>
15368 #include <signal.h>
15370 $volatile int bletched = 0;
15371 $signal_t blech(int s) { bletched = 1; }
15374 int checkit($nvtype d, char *where) {
15375 unsigned char *p = (char *)&d;
15376 unsigned char *end = p + sizeof(d);
15386 printf("No - %s: 0x", where);
15388 printf ("%02X", *p++);
15393 int main(int argc, char **argv) {
15396 fail += checkit(d, "0.0");
15398 /* The compiler shouldn't be assuming that bletched is 0 */
15401 fail += checkit(d, "bleched");
15404 signal(SIGFPE, blech);
15407 /* Paranoia - the compiler should have no way of knowing that ANSI says
15408 that argv[argc] will always be NULL. Actually, if it did assume this it
15409 would be buggy, as this is C and main() can be called from elsewhere in
15411 d = argv[argc] ? 1 : 0;
15414 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15417 fail += checkit(d, "ternary");
15419 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15422 printf("No - memset doesn't give 0.0\n");
15423 /* This might just blow up: */
15424 printf("(gives %g)\n", d);
15430 printf("No - something bleched\n");
15435 printf("No - %d fail(s)\n", fail);
15444 d_nv_zero_is_allbits_zero="$undef"
15445 if eval $compile; then
15451 0.0 is represented as all bits zero in memory
15453 d_nv_zero_is_allbits_zero="$define"
15456 0.0 is not represented as all bits zero in memory
15458 d_nv_zero_is_allbits_zero="$undef"
15463 0.0 is not represented as all bits zero in memory
15465 d_nv_zero_is_allbits_zero="$undef"
15471 : check for off64_t
15473 echo "Checking to see if you have off64_t..." >&4
15475 #include <sys/types.h>
15476 #include <unistd.h>
15477 int main() { off64_t x = 7; }
15480 if eval $compile; then
15482 echo "You have off64_t."
15485 echo "You do not have off64_t."
15486 case "$lseeksize" in
15487 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15494 : how to create joinable pthreads
15495 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15497 echo "Checking what constant to use for creating joinable pthreads..." >&4
15498 $cat >try.c <<'EOCP'
15499 #include <pthread.h>
15501 int detachstate = JOINABLE;
15504 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15505 if eval $compile; then
15506 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15507 val="$undef" # Yes, undef.
15508 set d_old_pthread_create_joinable
15511 set old_pthread_create_joinable
15514 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15515 if eval $compile; then
15516 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15518 set d_old_pthread_create_joinable
15520 val=PTHREAD_CREATE_UNDETACHED
15521 set old_pthread_create_joinable
15524 set try -DJOINABLE=__UNDETACHED
15525 if eval $compile; then
15526 echo "You seem to use __UNDETACHED." >&4
15528 set d_old_pthread_create_joinable
15531 set old_pthread_create_joinable
15534 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15536 set d_old_pthread_create_joinable
15539 set old_pthread_create_joinable
15546 d_old_pthread_create_joinable="$undef"
15547 old_pthread_create_joinable=""
15550 : see if pause exists
15554 : see if poll exists
15558 : see if readlink exists
15559 set readlink d_readlink
15565 case "$d_readlink" in
15567 if $issymlink /proc/self/exe ; then
15568 $ls -l /proc/self/exe > reflect
15569 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15570 echo "You have Linux-like /proc/self/exe."
15571 procselfexe='"/proc/self/exe"'
15575 if $issymlink /proc/curproc/file ; then
15576 $ls -l /proc/curproc/file > reflect
15577 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15578 echo "You have BSD-like /proc/curproc/file."
15579 procselfexe='"/proc/curproc/file"'
15589 : backward compatibility for d_hvfork
15590 if test X$d_hvfork != X; then
15591 d_vfork="$d_hvfork"
15594 : see if there is a vfork
15599 d_pseudofork=$undef
15601 : Ok, but do we want to use it. vfork is reportedly unreliable in
15602 : perl on Solaris 2.x, and probably elsewhere.
15606 case "$usevfork" in
15612 Perl can only use a vfork() that doesn't suffer from strict
15613 restrictions on calling functions or modifying global data in
15614 the child. For example, glibc-2.1 contains such a vfork()
15615 that is unsuitable. If your system provides a proper fork()
15616 call, chances are that you do NOT want perl to use vfork().
15619 rp="Do you still want to use vfork()?"
15624 echo "Ok, we won't use vfork()."
15633 $define) usevfork='true';;
15634 *) usevfork='false';;
15637 : see whether the pthread_atfork exists
15639 #include <pthread.h>
15642 #ifdef PTHREAD_ATFORK
15643 pthread_atfork(NULL,NULL,NULL);
15648 : see if pthread_atfork exists
15649 set try -DPTHREAD_ATFORK
15650 if eval $compile; then
15655 case "$usethreads" in
15658 $define) echo 'pthread_atfork found.' >&4 ;;
15659 *) echo 'pthread_atfork NOT found.' >&4 ;;
15662 set d_pthread_atfork
15665 : see if pthread_attr_setscope exists
15666 set pthread_attr_setscope d_pthread_attr_setscope
15670 : see whether the various POSIXish _yields exist
15672 #include <pthread.h>
15678 #ifdef PTHREAD_YIELD
15681 #ifdef PTHREAD_YIELD_NULL
15682 pthread_yield(NULL);
15688 : see if sched_yield exists
15689 set try -DSCHED_YIELD
15690 if eval $compile; then
15692 sched_yield='sched_yield()'
15696 case "$usethreads" in
15699 $define) echo 'sched_yield() found.' >&4 ;;
15700 *) echo 'sched_yield() NOT found.' >&4 ;;
15706 : see if pthread_yield exists
15707 set try -DPTHREAD_YIELD
15708 if eval $compile; then
15710 case "$sched_yield" in
15711 '') sched_yield='pthread_yield()' ;;
15714 set try -DPTHREAD_YIELD_NULL
15715 if eval $compile; then
15717 case "$sched_yield" in
15718 '') sched_yield='pthread_yield(NULL)' ;;
15724 case "$usethreads" in
15727 $define) echo 'pthread_yield() found.' >&4 ;;
15728 *) echo 'pthread_yield() NOT found.' >&4 ;;
15732 set d_pthread_yield
15734 case "$sched_yield" in
15735 '') sched_yield=undef ;;
15739 : see if random_r exists
15740 set random_r d_random_r
15742 case "$d_random_r" in
15744 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15745 case "$d_random_r_proto:$usethreads" in
15746 ":define") d_random_r_proto=define
15747 set d_random_r_proto random_r $hdrs
15751 case "$d_random_r_proto" in
15753 case "$random_r_proto" in
15754 ''|0) try='int random_r(int*, struct random_data*);'
15755 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15757 case "$random_r_proto" in
15758 ''|0) try='int random_r(long*, struct random_data*);'
15759 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15761 case "$random_r_proto" in
15762 ''|0) try='int random_r(struct random_data*, int32_t*);'
15763 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15765 case "$random_r_proto" in
15766 ''|0) d_random_r=undef
15768 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15769 * ) case "$random_r_proto" in
15770 REENTRANT_PROTO*) ;;
15771 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15773 echo "Prototype: $try" ;;
15776 *) case "$usethreads" in
15777 define) echo "random_r has no prototype, not using it." >&4 ;;
15784 *) random_r_proto=0
15788 : see if readdir and friends exist
15789 set readdir d_readdir
15791 set seekdir d_seekdir
15793 set telldir d_telldir
15795 set rewinddir d_rewinddir
15798 : see if readdir64_r exists
15799 set readdir64_r d_readdir64_r
15801 case "$d_readdir64_r" in
15803 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15804 case "$d_readdir64_r_proto:$usethreads" in
15805 ":define") d_readdir64_r_proto=define
15806 set d_readdir64_r_proto readdir64_r $hdrs
15810 case "$d_readdir64_r_proto" in
15812 case "$readdir64_r_proto" in
15813 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15814 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15816 case "$readdir64_r_proto" in
15817 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15818 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15820 case "$readdir64_r_proto" in
15821 ''|0) d_readdir64_r=undef
15822 readdir64_r_proto=0
15823 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15824 * ) case "$readdir64_r_proto" in
15825 REENTRANT_PROTO*) ;;
15826 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15828 echo "Prototype: $try" ;;
15831 *) case "$usethreads" in
15832 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15834 d_readdir64_r=undef
15835 readdir64_r_proto=0
15839 *) readdir64_r_proto=0
15843 : see if readdir_r exists
15844 set readdir_r d_readdir_r
15846 case "$d_readdir_r" in
15848 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15849 case "$d_readdir_r_proto:$usethreads" in
15850 ":define") d_readdir_r_proto=define
15851 set d_readdir_r_proto readdir_r $hdrs
15855 case "$d_readdir_r_proto" in
15857 case "$readdir_r_proto" in
15858 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15859 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15861 case "$readdir_r_proto" in
15862 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15863 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15865 case "$readdir_r_proto" in
15866 ''|0) d_readdir_r=undef
15868 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15869 * ) case "$readdir_r_proto" in
15870 REENTRANT_PROTO*) ;;
15871 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15873 echo "Prototype: $try" ;;
15876 *) case "$usethreads" in
15877 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15884 *) readdir_r_proto=0
15888 : see if readv exists
15892 : see if recvmsg exists
15893 set recvmsg d_recvmsg
15896 : see if rename exists
15897 set rename d_rename
15900 : see if rmdir exists
15904 : see if memory.h is available.
15909 : See if it conflicts with string.h
15915 $cppstdin $cppflags $cppminus < $strings > mem.h
15916 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15918 echo "We won't be including <memory.h>."
15928 : can bcopy handle overlapping blocks?
15931 case "$d_memmove" in
15932 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15933 *) case "$d_bcopy" in
15935 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15937 #$i_memory I_MEMORY
15938 #$i_stdlib I_STDLIB
15939 #$i_string I_STRING
15940 #$i_unistd I_UNISTD
15942 $cat >>try.c <<'EOCP'
15945 # include <memory.h>
15948 # include <stdlib.h>
15951 # include <string.h>
15953 # include <strings.h>
15956 # include <unistd.h> /* Needed for NetBSD */
15960 char buf[128], abc[128];
15966 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15967 try to store the string in read-only memory. */
15968 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15970 for (align = 7; align >= 0; align--) {
15971 for (len = 36; len; len--) {
15973 bcopy(abc, b, len);
15974 for (off = 1; off <= len; off++) {
15975 bcopy(b, b+off, len);
15976 bcopy(b+off, b, len);
15977 if (bcmp(b, abc, len))
15986 if eval $compile_ok; then
15987 if $run ./try 2>/dev/null; then
15988 echo "Yes, it can."
15991 echo "It can't, sorry."
15994 echo "(I can't compile the test program, so we'll assume not...)"
16004 : can memcpy handle overlapping blocks?
16007 case "$d_memmove" in
16008 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16009 *) case "$d_memcpy" in
16011 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16013 #$i_memory I_MEMORY
16014 #$i_stdlib I_STDLIB
16015 #$i_string I_STRING
16016 #$i_unistd I_UNISTD
16018 $cat >>try.c <<'EOCP'
16021 # include <memory.h>
16024 # include <stdlib.h>
16027 # include <string.h>
16029 # include <strings.h>
16032 # include <unistd.h> /* Needed for NetBSD */
16036 char buf[128], abc[128];
16042 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16043 try to store the string in read-only memory. */
16044 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16046 for (align = 7; align >= 0; align--) {
16047 for (len = 36; len; len--) {
16049 memcpy(b, abc, len);
16050 for (off = 1; off <= len; off++) {
16051 memcpy(b+off, b, len);
16052 memcpy(b, b+off, len);
16053 if (memcmp(b, abc, len))
16062 if eval $compile_ok; then
16063 if $run ./try 2>/dev/null; then
16064 echo "Yes, it can."
16067 echo "It can't, sorry."
16070 echo "(I can't compile the test program, so we'll assume not...)"
16080 : can memcmp be trusted to compare relative magnitude?
16082 case "$d_memcmp" in
16085 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16087 #$i_memory I_MEMORY
16088 #$i_stdlib I_STDLIB
16089 #$i_string I_STRING
16090 #$i_unistd I_UNISTD
16092 $cat >>try.c <<'EOCP'
16095 # include <memory.h>
16098 # include <stdlib.h>
16101 # include <string.h>
16103 # include <strings.h>
16106 # include <unistd.h> /* Needed for NetBSD */
16112 if ((a < b) && memcmp(&a, &b, 1) < 0)
16118 if eval $compile_ok; then
16119 if $run ./try 2>/dev/null; then
16120 echo "Yes, it can."
16123 echo "No, it can't (it uses signed chars)."
16126 echo "(I can't compile the test program, so we'll assume not...)"
16134 : see if prototype for sbrk is available
16136 set d_sbrkproto sbrk $i_unistd unistd.h
16139 : see if select exists
16140 set select d_select
16143 : see if semctl exists
16144 set semctl d_semctl
16147 : see if semget exists
16148 set semget d_semget
16151 : see if semop exists
16155 : see how much of the 'sem*(2)' library is present.
16158 case "$d_semctl$d_semget$d_semop" in
16159 *"$undef"*) h_sem=false;;
16163 case "`ipcs 2>&1`" in
16164 "SVID messages"*"not configured"*)
16165 echo "Your $osname does not have the sem*(2) configured." >&4
16168 set semctl d_semctl
16170 set semget d_semget
16178 : we could also check for sys/ipc.h ...
16179 if $h_sem && $test `./findhdr sys/sem.h`; then
16180 echo "You have the full sem*(2) library." >&4
16183 echo "You don't have the full sem*(2) library." >&4
16189 : see whether sys/sem.h defines union semun
16191 $cat > try.c <<'END'
16192 #include <sys/types.h>
16193 #include <sys/ipc.h>
16194 #include <sys/sem.h>
16195 int main () { union semun semun; semun.buf = 0; }
16198 if eval $compile; then
16199 echo "You have union semun in <sys/sem.h>." >&4
16202 echo "You do not have union semun in <sys/sem.h>." >&4
16209 : see how to do semctl IPC_STAT
16213 $cat > tryh.h <<END
16216 # define S_IRUSR S_IREAD
16217 # define S_IWUSR S_IWRITE
16218 # define S_IXUSR S_IEXEC
16220 # define S_IRUSR 0400
16221 # define S_IWUSR 0200
16222 # define S_IXUSR 0100
16224 # define S_IRGRP (S_IRUSR>>3)
16225 # define S_IWGRP (S_IWUSR>>3)
16226 # define S_IXGRP (S_IXUSR>>3)
16227 # define S_IROTH (S_IRUSR>>6)
16228 # define S_IWOTH (S_IWUSR>>6)
16229 # define S_IXOTH (S_IXUSR>>6)
16232 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16233 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16234 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16237 : see whether semctl IPC_STAT can use union semun
16238 case "$d_semctl_semun" in
16242 #include <sys/types.h>
16243 #include <sys/ipc.h>
16244 #include <sys/sem.h>
16245 #include <sys/stat.h>
16252 #$d_union_semun HAS_UNION_SEMUN
16255 #ifndef HAS_UNION_SEMUN
16258 struct semid_ds *buf;
16259 unsigned short *array;
16265 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16266 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16268 struct semid_ds argbuf;
16271 st = semctl(sem, 0, IPC_STAT, arg);
16275 # endif /* IPC_STAT */
16276 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16278 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16279 # endif /* IPC_RMID */
16280 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16282 #endif /* IPC_PRIVATE && ... */
16283 printf("semget failed: errno = %d\n", errno);
16288 if eval $compile; then
16291 semun) val="$define" ;;
16299 case "$d_semctl_semun" in
16301 echo "You can use union semun for semctl IPC_STAT." >&4
16304 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16309 : see whether semctl IPC_STAT can use struct semid_ds pointer
16310 case "$d_semctl_semid_ds" in
16313 $cat > try.c <<'END'
16314 #include <sys/types.h>
16315 #include <sys/ipc.h>
16316 #include <sys/sem.h>
16317 #include <sys/stat.h>
16325 struct semid_ds arg;
16328 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16329 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16332 st = semctl(sem, 0, IPC_STAT, &arg);
16334 printf("semid_ds\n");
16336 # endif /* IPC_STAT */
16337 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16339 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16340 # endif /* IPC_RMID */
16341 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16343 #endif /* IPC_PRIVATE && ... */
16344 printf("semget failed: errno = %d\n", errno);
16350 if eval $compile; then
16353 semid_ds) val="$define" ;;
16357 set d_semctl_semid_ds
16361 case "$d_semctl_semid_ds" in
16363 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16365 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16371 # We do not have the full sem*(2) library, so assume we can not
16377 set d_semctl_semid_ds
16383 : see if sendmsg exists
16384 set sendmsg d_sendmsg
16387 : see if setegid exists
16388 set setegid d_setegid
16391 : see if seteuid exists
16392 set seteuid d_seteuid
16395 : see if setgrent exists
16396 set setgrent d_setgrent
16399 : see if setgrent_r exists
16400 set setgrent_r d_setgrent_r
16402 case "$d_setgrent_r" in
16404 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16405 case "$d_setgrent_r_proto:$usethreads" in
16406 ":define") d_setgrent_r_proto=define
16407 set d_setgrent_r_proto setgrent_r $hdrs
16411 case "$d_setgrent_r_proto" in
16413 case "$setgrent_r_proto" in
16414 ''|0) try='int setgrent_r(FILE**);'
16415 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
16417 case "$setgrent_r_proto" in
16418 ''|0) try='void setgrent_r(FILE**);'
16419 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
16421 case "$setgrent_r_proto" in
16422 ''|0) d_setgrent_r=undef
16424 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16425 * ) case "$setgrent_r_proto" in
16426 REENTRANT_PROTO*) ;;
16427 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16429 echo "Prototype: $try" ;;
16432 *) case "$usethreads" in
16433 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16440 *) setgrent_r_proto=0
16444 : see if sethostent exists
16445 set sethostent d_sethent
16448 : see if sethostent_r exists
16449 set sethostent_r d_sethostent_r
16451 case "$d_sethostent_r" in
16453 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16454 case "$d_sethostent_r_proto:$usethreads" in
16455 ":define") d_sethostent_r_proto=define
16456 set d_sethostent_r_proto sethostent_r $hdrs
16460 case "$d_sethostent_r_proto" in
16462 case "$sethostent_r_proto" in
16463 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16464 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16466 case "$sethostent_r_proto" in
16467 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16468 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16470 case "$sethostent_r_proto" in
16471 ''|0) d_sethostent_r=undef
16472 sethostent_r_proto=0
16473 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16474 * ) case "$sethostent_r_proto" in
16475 REENTRANT_PROTO*) ;;
16476 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16478 echo "Prototype: $try" ;;
16481 *) case "$usethreads" in
16482 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16484 d_sethostent_r=undef
16485 sethostent_r_proto=0
16489 *) sethostent_r_proto=0
16493 : see if setitimer exists
16494 set setitimer d_setitimer
16497 : see if setlinebuf exists
16498 set setlinebuf d_setlinebuf
16501 : see if setlocale exists
16502 set setlocale d_setlocale
16505 : see if locale.h is available
16506 set locale.h i_locale
16509 : see if setlocale_r exists
16510 set setlocale_r d_setlocale_r
16512 case "$d_setlocale_r" in
16514 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16515 case "$d_setlocale_r_proto:$usethreads" in
16516 ":define") d_setlocale_r_proto=define
16517 set d_setlocale_r_proto setlocale_r $hdrs
16521 case "$d_setlocale_r_proto" in
16523 case "$setlocale_r_proto" in
16524 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16525 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16527 case "$setlocale_r_proto" in
16528 ''|0) d_setlocale_r=undef
16529 setlocale_r_proto=0
16530 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16531 * ) case "$setlocale_r_proto" in
16532 REENTRANT_PROTO*) ;;
16533 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16535 echo "Prototype: $try" ;;
16538 *) case "$usethreads" in
16539 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16541 d_setlocale_r=undef
16542 setlocale_r_proto=0
16546 *) setlocale_r_proto=0
16550 : see if setnetent exists
16551 set setnetent d_setnent
16554 : see if setnetent_r exists
16555 set setnetent_r d_setnetent_r
16557 case "$d_setnetent_r" in
16559 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16560 case "$d_setnetent_r_proto:$usethreads" in
16561 ":define") d_setnetent_r_proto=define
16562 set d_setnetent_r_proto setnetent_r $hdrs
16566 case "$d_setnetent_r_proto" in
16568 case "$setnetent_r_proto" in
16569 ''|0) try='int setnetent_r(int, struct netent_data*);'
16570 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16572 case "$setnetent_r_proto" in
16573 ''|0) try='void setnetent_r(int, struct netent_data*);'
16574 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16576 case "$setnetent_r_proto" in
16577 ''|0) d_setnetent_r=undef
16578 setnetent_r_proto=0
16579 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16580 * ) case "$setnetent_r_proto" in
16581 REENTRANT_PROTO*) ;;
16582 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16584 echo "Prototype: $try" ;;
16587 *) case "$usethreads" in
16588 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16590 d_setnetent_r=undef
16591 setnetent_r_proto=0
16595 *) setnetent_r_proto=0
16599 : see if setprotoent exists
16600 set setprotoent d_setpent
16603 : see if setpgid exists
16604 set setpgid d_setpgid
16607 : see if setpgrp2 exists
16608 set setpgrp2 d_setpgrp2
16611 : see if setpriority exists
16612 set setpriority d_setprior
16615 : see if setproctitle exists
16616 set setproctitle d_setproctitle
16619 : see if setprotoent_r exists
16620 set setprotoent_r d_setprotoent_r
16622 case "$d_setprotoent_r" in
16624 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16625 case "$d_setprotoent_r_proto:$usethreads" in
16626 ":define") d_setprotoent_r_proto=define
16627 set d_setprotoent_r_proto setprotoent_r $hdrs
16631 case "$d_setprotoent_r_proto" in
16633 case "$setprotoent_r_proto" in
16634 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16635 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16637 case "$setprotoent_r_proto" in
16638 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16639 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16641 case "$setprotoent_r_proto" in
16642 ''|0) d_setprotoent_r=undef
16643 setprotoent_r_proto=0
16644 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16645 * ) case "$setprotoent_r_proto" in
16646 REENTRANT_PROTO*) ;;
16647 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16649 echo "Prototype: $try" ;;
16652 *) case "$usethreads" in
16653 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16655 d_setprotoent_r=undef
16656 setprotoent_r_proto=0
16660 *) setprotoent_r_proto=0
16664 : see if setpwent exists
16665 set setpwent d_setpwent
16668 : see if setpwent_r exists
16669 set setpwent_r d_setpwent_r
16671 case "$d_setpwent_r" in
16673 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16674 case "$d_setpwent_r_proto:$usethreads" in
16675 ":define") d_setpwent_r_proto=define
16676 set d_setpwent_r_proto setpwent_r $hdrs
16680 case "$d_setpwent_r_proto" in
16682 case "$setpwent_r_proto" in
16683 ''|0) try='int setpwent_r(FILE**);'
16684 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16686 case "$setpwent_r_proto" in
16687 ''|0) try='void setpwent_r(FILE**);'
16688 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16690 case "$setpwent_r_proto" in
16691 ''|0) d_setpwent_r=undef
16693 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16694 * ) case "$setpwent_r_proto" in
16695 REENTRANT_PROTO*) ;;
16696 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16698 echo "Prototype: $try" ;;
16701 *) case "$usethreads" in
16702 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16709 *) setpwent_r_proto=0
16713 : see if setregid exists
16714 set setregid d_setregid
16716 set setresgid d_setresgid
16719 : see if setreuid exists
16720 set setreuid d_setreuid
16722 set setresuid d_setresuid
16725 : see if setrgid exists
16726 set setrgid d_setrgid
16729 : see if setruid exists
16730 set setruid d_setruid
16733 : see if setservent exists
16734 set setservent d_setsent
16737 : see if setservent_r exists
16738 set setservent_r d_setservent_r
16740 case "$d_setservent_r" in
16742 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16743 case "$d_setservent_r_proto:$usethreads" in
16744 ":define") d_setservent_r_proto=define
16745 set d_setservent_r_proto setservent_r $hdrs
16749 case "$d_setservent_r_proto" in
16751 case "$setservent_r_proto" in
16752 ''|0) try='int setservent_r(int, struct servent_data*);'
16753 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16755 case "$setservent_r_proto" in
16756 ''|0) try='void setservent_r(int, struct servent_data*);'
16757 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16759 case "$setservent_r_proto" in
16760 ''|0) d_setservent_r=undef
16761 setservent_r_proto=0
16762 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16763 * ) case "$setservent_r_proto" in
16764 REENTRANT_PROTO*) ;;
16765 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16767 echo "Prototype: $try" ;;
16770 *) case "$usethreads" in
16771 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16773 d_setservent_r=undef
16774 setservent_r_proto=0
16778 *) setservent_r_proto=0
16782 : see if setsid exists
16783 set setsid d_setsid
16786 : see if setvbuf exists
16787 set setvbuf d_setvbuf
16790 : see if sfio.h is available
16795 : see if sfio library is available
16806 : Ok, but do we want to use it.
16810 true|$define|[yY]*) dflt='y';;
16813 echo "$package can use the sfio library, but it is experimental."
16814 case "$useperlio" in
16816 echo "For sfio also the PerlIO abstraction layer is needed."
16817 echo "Earlier you said you wouldn't want that."
16820 rp="You seem to have sfio available, do you want to try using it?"
16823 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16824 useperlio="$define"
16827 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16832 *) case "$usesfio" in
16833 true|$define|[yY]*)
16834 echo "Sorry, cannot find sfio on this machine." >&4
16835 echo "Ignoring your setting of usesfio=$usesfio." >&4
16844 $define) usesfio='true';;
16845 *) usesfio='false';;
16849 *) : Remove sfio from list of libraries to use
16852 echo "Removing unneeded -lsfio from library list" >&4
16853 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16856 echo "libs = $libs" >&4
16863 : see if shmctl exists
16864 set shmctl d_shmctl
16867 : see if shmget exists
16868 set shmget d_shmget
16871 : see if shmat exists
16874 : see what shmat returns
16877 $cat >shmat.c <<'END'
16878 #include <sys/shm.h>
16881 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16886 echo "and it returns ($shmattype)." >&4
16887 : see if a prototype for shmat is available
16888 xxx=`./findhdr sys/shm.h`
16889 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16890 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16901 set d_shmatprototype
16904 : see if shmdt exists
16908 : see how much of the 'shm*(2)' library is present.
16911 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16912 *"$undef"*) h_shm=false;;
16916 case "`ipcs 2>&1`" in
16917 "SVID shared memory"*"not configured"*)
16918 echo "Your $osname does not have the shm*(2) configured." >&4
16921 set shmctl d_shmctl
16923 set shmget d_shmget
16933 : we could also check for sys/ipc.h ...
16934 if $h_shm && $test `./findhdr sys/shm.h`; then
16935 echo "You have the full shm*(2) library." >&4
16938 echo "You don't have the full shm*(2) library." >&4
16945 : see if we have sigaction
16946 if set sigaction val -f d_sigaction; eval $csym; $val; then
16947 echo 'sigaction() found.' >&4
16950 #include <sys/types.h>
16951 #include <signal.h>
16952 #$i_stdlib I_STDLIB
16954 #include <stdlib.h>
16958 struct sigaction act, oact;
16960 oact.sa_handler = 0;
16961 /* so that act and oact are used */
16962 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16966 if eval $compile_ok; then
16969 echo "But you don't seem to have a useable struct sigaction." >&4
16973 echo 'sigaction NOT found.' >&4
16976 set d_sigaction; eval $setvar
16979 : see if this is a sunmath.h system
16980 set sunmath.h i_sunmath
16983 : see if signbit exists
16984 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
16987 #$i_sunmath I_SUNMATH
16991 #ifdef I_SUNMATH /* Solaris special math library */
16992 # include <sunmath.h>
16995 int main(int argc, char **argv)
16999 if ((signbit(x) == 0) && (signbit(y) != 0))
17007 if eval $compile; then
17008 if $run ./try; then
17012 $echo "Signbit seems to be available, but doesn't work as I expected."
17013 $echo "I won't use it." >&4
17024 : see if sigprocmask exists
17025 set sigprocmask d_sigprocmask
17028 : see if sigsetjmp exists
17030 case "$d_sigsetjmp" in
17033 #include <setjmp.h>
17034 #$i_stdlib I_STDLIB
17036 #include <stdlib.h>
17042 if (sigsetjmp(env,1))
17045 siglongjmp(env, 1);
17050 if eval $compile; then
17051 if $run ./try >/dev/null 2>&1; then
17052 echo "POSIX sigsetjmp found." >&4
17056 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17062 echo "sigsetjmp not found." >&4
17066 *) val="$d_sigsetjmp"
17067 case "$d_sigsetjmp" in
17068 $define) echo "POSIX sigsetjmp found." >&4;;
17069 $undef) echo "sigsetjmp not found." >&4;;
17077 : see if snprintf exists
17078 set snprintf d_snprintf
17081 : see if vsnprintf exists
17082 set vsnprintf d_vsnprintf
17085 case "$d_snprintf-$d_vsnprintf" in
17088 Checking whether your snprintf() and vsnprintf() work okay...
17090 $cat >try.c <<'EOCP'
17091 /* v?snprintf testing logic courtesy of Russ Allbery.
17092 * According to C99:
17093 * - if the buffer is too short it still must be \0-terminated
17094 * - if the buffer is too short the potentially required length
17095 * must be returned and not -1
17096 * - if the buffer is NULL the potentially required length
17097 * must be returned and not -1 or core dump
17100 #include <stdarg.h>
17104 int test (char *format, ...)
17109 va_start (args, format);
17110 count = vsnprintf (buf, sizeof buf, format, args);
17117 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17118 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17122 if eval $compile; then
17125 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17127 Your snprintf() and snprintf() don't seem to be working okay.
17129 d_snprintf="$undef"
17130 d_vsnprintf="$undef"
17134 echo "(I can't seem to compile the test program--assuming they don't)"
17135 d_snprintf="$undef"
17136 d_vsnprintf="$undef"
17142 : see if sockatmark exists
17143 set sockatmark d_sockatmark
17146 : see if prototype for sockatmark is available
17148 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17151 : see if socks5_init exists
17152 set socks5_init d_socks5_init
17155 : see if sprintf returns the length of the string in the buffer as per ANSI
17156 $echo "Checking whether sprintf returns the length of the string..." >&4
17159 #$i_stdlib I_STDLIB
17161 #include <stdlib.h>
17163 #$i_string I_STRING
17165 # include <string.h>
17167 # include <strings.h>
17176 int check (size_t expect, int test) {
17177 size_t got = strlen(buffer);
17181 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17186 int main(int argc, char **argv) {
17189 check(sprintf(buffer, ""), ++test);
17190 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17191 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17198 d_sprintf_returns_strlen="$undef"
17199 if eval $compile; then
17203 sprintf returns the length of the string (as ANSI says it should)
17205 d_sprintf_returns_strlen="$define"
17208 sprintf does not return the length of the string (how old is this system?)
17210 d_sprintf_returns_strlen="$undef"
17216 : see if srand48_r exists
17217 set srand48_r d_srand48_r
17219 case "$d_srand48_r" in
17221 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17222 case "$d_srand48_r_proto:$usethreads" in
17223 ":define") d_srand48_r_proto=define
17224 set d_srand48_r_proto srand48_r $hdrs
17228 case "$d_srand48_r_proto" in
17230 case "$srand48_r_proto" in
17231 ''|0) try='int srand48_r(long, struct drand48_data*);'
17232 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
17234 case "$srand48_r_proto" in
17235 ''|0) d_srand48_r=undef
17237 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17238 * ) case "$srand48_r_proto" in
17239 REENTRANT_PROTO*) ;;
17240 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17242 echo "Prototype: $try" ;;
17245 *) case "$usethreads" in
17246 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17253 *) srand48_r_proto=0
17257 : see if srandom_r exists
17258 set srandom_r d_srandom_r
17260 case "$d_srandom_r" in
17262 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17263 case "$d_srandom_r_proto:$usethreads" in
17264 ":define") d_srandom_r_proto=define
17265 set d_srandom_r_proto srandom_r $hdrs
17269 case "$d_srandom_r_proto" in
17271 case "$srandom_r_proto" in
17272 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17273 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
17275 case "$srandom_r_proto" in
17276 ''|0) d_srandom_r=undef
17278 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17279 * ) case "$srandom_r_proto" in
17280 REENTRANT_PROTO*) ;;
17281 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17283 echo "Prototype: $try" ;;
17286 *) case "$usethreads" in
17287 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17294 *) srandom_r_proto=0
17298 : see if prototype for setresgid is available
17300 set d_sresgproto setresgid $i_unistd unistd.h
17303 : see if prototype for setresuid is available
17305 set d_sresuproto setresuid $i_unistd unistd.h
17308 : see if sys/stat.h is available
17309 set sys/stat.h i_sysstat
17313 : see if stat knows about block sizes
17315 echo "Checking to see if your struct stat has st_blocks field..." >&4
17316 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17320 : see if this is a sys/vfs.h system
17321 set sys/vfs.h i_sysvfs
17325 : see if this is a sys/statfs.h system
17326 set sys/statfs.h i_sysstatfs
17331 echo "Checking to see if your system supports struct statfs..." >&4
17332 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
17334 case "$d_statfs_s" in
17335 "$define") echo "Yes, it does." ;;
17336 *) echo "No, it doesn't." ;;
17341 : see if struct statfs knows about f_flags
17342 case "$d_statfs_s" in
17345 echo "Checking to see if your struct statfs has f_flags field..." >&4
17346 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
17350 set d_statfs_f_flags
17354 case "$d_statfs_f_flags" in
17355 "$define") echo "Yes, it does." ;;
17356 *) echo "No, it doesn't." ;;
17360 Checking how to access stdio streams by file descriptor number...
17362 case "$stdio_stream_array" in
17363 '') $cat >try.c <<EOCP
17366 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17370 for s in _iob __iob __sF
17372 set try -DSTDIO_STREAM_ARRAY=$s
17373 if eval $compile; then
17374 case "`$run ./try`" in
17375 yes) stdio_stream_array=$s; break ;;
17381 case "$stdio_stream_array" in
17383 I can't figure out how to access stdio streams by file descriptor number.
17385 d_stdio_stream_array="$undef"
17388 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17390 d_stdio_stream_array="$define"
17394 : see if strcoll exists
17395 set strcoll d_strcoll
17398 : check for structure copying
17400 echo "Checking to see if your C compiler can copy structs..." >&4
17401 $cat >try.c <<'EOCP'
17411 if $cc -c try.c >/dev/null 2>&1 ; then
17413 echo "Yup, it can."
17416 echo "Nope, it can't."
17422 : see if strerror and/or sys_errlist[] exist
17424 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17425 if set strerror val -f d_strerror; eval $csym; $val; then
17426 echo 'strerror() found.' >&4
17427 d_strerror="$define"
17428 d_strerrm='strerror(e)'
17429 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17430 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17431 d_syserrlst="$define"
17433 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17434 d_syserrlst="$undef"
17436 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17437 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17438 echo 'strerror() found in string header.' >&4
17439 d_strerror="$define"
17440 d_strerrm='strerror(e)'
17441 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17442 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17443 d_syserrlst="$define"
17445 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17446 d_syserrlst="$undef"
17448 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17449 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17450 d_strerror="$undef"
17451 d_syserrlst="$define"
17452 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17454 echo 'strerror() and sys_errlist[] NOT found.' >&4
17455 d_strerror="$undef"
17456 d_syserrlst="$undef"
17457 d_strerrm='"unknown"'
17461 : see if strerror_r exists
17462 set strerror_r d_strerror_r
17464 case "$d_strerror_r" in
17466 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17467 case "$d_strerror_r_proto:$usethreads" in
17468 ":define") d_strerror_r_proto=define
17469 set d_strerror_r_proto strerror_r $hdrs
17473 case "$d_strerror_r_proto" in
17475 case "$strerror_r_proto" in
17476 ''|0) try='int strerror_r(int, char*, size_t);'
17477 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
17479 case "$strerror_r_proto" in
17480 ''|0) try='int strerror_r(int, char*, int);'
17481 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17483 case "$strerror_r_proto" in
17484 ''|0) try='char* strerror_r(int, char*, size_t);'
17485 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17487 case "$strerror_r_proto" in
17488 ''|0) d_strerror_r=undef
17490 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17491 * ) case "$strerror_r_proto" in
17492 REENTRANT_PROTO*) ;;
17493 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17495 echo "Prototype: $try" ;;
17498 *) case "$usethreads" in
17499 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17506 *) strerror_r_proto=0
17510 : see if strftime exists
17511 set strftime d_strftime
17514 : see if strlcat exists
17515 set strlcat d_strlcat
17518 : see if strlcpy exists
17519 set strlcpy d_strlcpy
17522 : see if strtod exists
17523 set strtod d_strtod
17526 : see if strtol exists
17527 set strtol d_strtol
17530 : see if strtold exists
17531 set strtold d_strtold
17534 : see if strtoll exists
17535 set strtoll d_strtoll
17538 case "$d_longlong-$d_strtoll" in
17541 Checking whether your strtoll() works okay...
17543 $cat >try.c <<'EOCP'
17546 #define strtoll __strtoll
17549 #define strtoll _strtoll
17552 extern long long int strtoll(char *s, char **, int);
17553 static int bad = 0;
17554 int check(char *s, long long ell, int een) {
17557 gll = strtoll(s, 0, 10);
17558 if (!((gll == ell) && (errno == een)))
17562 check(" 1", 1LL, 0);
17563 check(" 0", 0LL, 0);
17564 check("-1", -1LL, 0);
17565 check("-9223372036854775808", -9223372036854775808LL, 0);
17566 check("-9223372036854775808", -9223372036854775808LL, 0);
17567 check(" 9223372036854775807", 9223372036854775807LL, 0);
17568 check("-9223372036854775808", -9223372036854775808LL, 0);
17569 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17570 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17576 if eval $compile; then
17579 ok) echo "Your strtoll() seems to be working okay." ;;
17581 Your strtoll() doesn't seem to be working okay.
17587 echo "(I can't seem to compile the test program--assuming it doesn't)"
17593 : see if strtoq exists
17594 set strtoq d_strtoq
17597 : see if strtoul exists
17598 set strtoul d_strtoul
17601 case "$d_strtoul" in
17604 Checking whether your strtoul() works okay...
17606 $cat >try.c <<'EOCP'
17609 extern unsigned long int strtoul(char *s, char **, int);
17610 static int bad = 0;
17611 void check(char *s, unsigned long eul, int een) {
17614 gul = strtoul(s, 0, 10);
17615 if (!((gul == eul) && (errno == een)))
17619 check(" 1", 1L, 0);
17620 check(" 0", 0L, 0);
17622 case "$longsize" in
17624 $cat >>try.c <<'EOCP'
17625 check("18446744073709551615", 18446744073709551615UL, 0);
17626 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17627 #if 0 /* strtoul() for /^-/ strings is undefined. */
17628 check("-1", 18446744073709551615UL, 0);
17629 check("-18446744073709551614", 2, 0);
17630 check("-18446744073709551615", 1, 0);
17631 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17632 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17637 $cat >>try.c <<'EOCP'
17638 check("4294967295", 4294967295UL, 0);
17639 check("4294967296", 4294967295UL, ERANGE);
17640 #if 0 /* strtoul() for /^-/ strings is undefined. */
17641 check("-1", 4294967295UL, 0);
17642 check("-4294967294", 2, 0);
17643 check("-4294967295", 1, 0);
17644 check("-4294967296", 4294967295UL, ERANGE);
17645 check("-4294967297", 4294967295UL, ERANGE);
17650 : Should we write these tests to be more portable by sprintf-ing
17651 : ~0 and then manipulating that char string as input for strtol?
17654 $cat >>try.c <<'EOCP'
17661 if eval $compile; then
17662 case "`$run ./try`" in
17663 ok) echo "Your strtoul() seems to be working okay." ;;
17665 Your strtoul() doesn't seem to be working okay.
17671 echo "(I can't seem to compile the test program--assuming it doesn't)"
17677 : see if strtoull exists
17678 set strtoull d_strtoull
17681 case "$d_longlong-$d_strtoull" in
17684 Checking whether your strtoull() works okay...
17686 $cat >try.c <<'EOCP'
17689 #define strtoull __strtoull
17692 extern unsigned long long int strtoull(char *s, char **, int);
17693 static int bad = 0;
17694 int check(char *s, long long eull, int een) {
17697 gull = strtoull(s, 0, 10);
17698 if (!((gull == eull) && (errno == een)))
17702 check(" 1", 1LL, 0);
17703 check(" 0", 0LL, 0);
17704 check("18446744073709551615", 18446744073709551615ULL, 0);
17705 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17706 #if 0 /* strtoull() for /^-/ strings is undefined. */
17707 check("-1", 18446744073709551615ULL, 0);
17708 check("-18446744073709551614", 2LL, 0);
17709 check("-18446744073709551615", 1LL, 0);
17710 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17711 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17718 if eval $compile; then
17719 case "`$run ./try`" in
17720 ok) echo "Your strtoull() seems to be working okay." ;;
17722 Your strtoull() doesn't seem to be working okay.
17724 d_strtoull="$undef"
17728 echo "(I can't seem to compile the test program--assuming it doesn't)"
17729 d_strtoull="$undef"
17734 : see if strtouq exists
17735 set strtouq d_strtouq
17738 case "$d_strtouq" in
17741 Checking whether your strtouq() works okay...
17743 $cat >try.c <<'EOCP'
17746 extern unsigned long long int strtouq(char *s, char **, int);
17747 static int bad = 0;
17748 void check(char *s, unsigned long long eull, int een) {
17749 unsigned long long gull;
17751 gull = strtouq(s, 0, 10);
17752 if (!((gull == eull) && (errno == een)))
17756 check(" 1", 1LL, 0);
17757 check(" 0", 0LL, 0);
17758 check("18446744073709551615", 18446744073709551615ULL, 0);
17759 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17760 #if 0 /* strtouq() for /^-/ strings is undefined. */
17761 check("-1", 18446744073709551615ULL, 0);
17762 check("-18446744073709551614", 2LL, 0);
17763 check("-18446744073709551615", 1LL, 0);
17764 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17765 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17773 if eval $compile; then
17774 case "`$run ./try`" in
17775 ok) echo "Your strtouq() seems to be working okay." ;;
17777 Your strtouq() doesn't seem to be working okay.
17783 echo "(I can't seem to compile the test program--assuming it doesn't)"
17789 : see if strxfrm exists
17790 set strxfrm d_strxfrm
17793 : see if symlink exists
17794 set symlink d_symlink
17797 : see if syscall exists
17798 set syscall d_syscall
17801 : see if prototype for syscall is available
17803 set d_syscallproto syscall $i_unistd unistd.h
17806 : see if sysconf exists
17807 set sysconf d_sysconf
17810 : see if system exists
17811 set system d_system
17814 : see if tcgetpgrp exists
17815 set tcgetpgrp d_tcgetpgrp
17818 : see if tcsetpgrp exists
17819 set tcsetpgrp d_tcsetpgrp
17822 : see if prototype for telldir is available
17824 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17827 : see if time exists
17829 if test "X$d_time" = X -o X"$timetype" = X; then
17830 if set time val -f d_time; eval $csym; $val; then
17831 echo 'time() found.' >&4
17833 rp="What is the type returned by time() on this system?"
17834 set time_t timetype long stdio.h sys/types.h
17837 echo 'time() not found, hope that will do.' >&4
17845 : see if this is a sys/times.h system
17846 set sys/times.h i_systimes
17849 : see if times exists
17851 if set times val -f d_times; eval $csym; $val; then
17852 echo 'times() found.' >&4
17855 case "$i_systimes" in
17856 "$define") inc='sys/times.h';;
17858 rp="What is the type returned by times() on this system?"
17859 set clock_t clocktype long stdio.h sys/types.h $inc
17862 echo 'times() NOT found, hope that will do.' >&4
17867 : see if tmpnam_r exists
17868 set tmpnam_r d_tmpnam_r
17870 case "$d_tmpnam_r" in
17872 hdrs="$i_systypes sys/types.h define stdio.h "
17873 case "$d_tmpnam_r_proto:$usethreads" in
17874 ":define") d_tmpnam_r_proto=define
17875 set d_tmpnam_r_proto tmpnam_r $hdrs
17879 case "$d_tmpnam_r_proto" in
17881 case "$tmpnam_r_proto" in
17882 ''|0) try='char* tmpnam_r(char*);'
17883 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17885 case "$tmpnam_r_proto" in
17886 ''|0) d_tmpnam_r=undef
17888 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17889 * ) case "$tmpnam_r_proto" in
17890 REENTRANT_PROTO*) ;;
17891 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17893 echo "Prototype: $try" ;;
17896 *) case "$usethreads" in
17897 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
17904 *) tmpnam_r_proto=0
17908 : see if truncate exists
17909 set truncate d_truncate
17912 : see if ttyname_r exists
17913 set ttyname_r d_ttyname_r
17915 case "$d_ttyname_r" in
17917 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
17918 case "$d_ttyname_r_proto:$usethreads" in
17919 ":define") d_ttyname_r_proto=define
17920 set d_ttyname_r_proto ttyname_r $hdrs
17924 case "$d_ttyname_r_proto" in
17926 case "$ttyname_r_proto" in
17927 ''|0) try='int ttyname_r(int, char*, size_t);'
17928 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
17930 case "$ttyname_r_proto" in
17931 ''|0) try='int ttyname_r(int, char*, int);'
17932 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
17934 case "$ttyname_r_proto" in
17935 ''|0) try='char* ttyname_r(int, char*, int);'
17936 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
17938 case "$ttyname_r_proto" in
17939 ''|0) d_ttyname_r=undef
17941 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
17942 * ) case "$ttyname_r_proto" in
17943 REENTRANT_PROTO*) ;;
17944 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
17946 echo "Prototype: $try" ;;
17949 *) case "$usethreads" in
17950 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
17957 *) ttyname_r_proto=0
17961 : see if tzname[] exists
17963 if set tzname val -a d_tzname; eval $csym; $val; then
17965 echo 'tzname[] found.' >&4
17968 echo 'tzname[] NOT found.' >&4
17974 next|rhapsody|darwin) multiarch="$define" ;;
17976 case "$multiarch" in
17977 ''|[nN]*) multiarch="$undef" ;;
17980 : check for ordering of bytes in a UV
17982 case "$usecrosscompile$multiarch" in
17985 You seem to be either cross-compiling or doing a multiarchitecture build,
17986 skipping the byteorder check.
17992 case "$byteorder" in
17995 In the following, larger digits indicate more significance. A big-endian
17996 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
17997 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
17998 machines may have weird orders like 3412. A Cray will report 87654321,
17999 an Alpha will report 12345678. If the test program works the default is
18001 I'm now running the test program...
18005 #$i_stdlib I_STDLIB
18007 #include <stdlib.h>
18009 #include <sys/types.h>
18010 typedef $uvtype UV;
18020 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18022 u.l = (UV)0x04030201;
18023 for (i = 0; i < $uvsize; i++)
18024 printf("%c", u.c[i]+'0');
18031 if eval $compile && $run ./try > /dev/null; then
18034 [1-4][1-4][1-4][1-4]|12345678|87654321)
18035 echo "(The test program ran ok.)"
18036 echo "byteorder=$dflt"
18039 ????|????????) echo "(The test program ran ok.)" ;;
18040 *) echo "(The test program didn't run right for some reason.)" ;;
18045 (I can't seem to compile the test program. Guessing big-endian...)
18048 case "$xxx_prompt" in
18050 rp="What is the order of bytes in $uvtype?"
18065 Checking to see whether you can access character data unalignedly...
18067 case "$d_u32align" in
18068 '') $cat >try.c <<EOCP
18070 #$i_stdlib I_STDLIB
18072 #include <stdlib.h>
18074 #define U32 $u32type
18075 #define BYTEORDER 0x$byteorder
18077 #include <signal.h>
18079 $signal_t bletch(int s) { exit(4); }
18082 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18087 if (sizeof(U32) != 4) {
18088 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18095 signal(SIGBUS, bletch);
18107 for (i = 0; i < 4; i++) {
18108 up = (U32*)(buf + i);
18109 if (! ((*up == 1 << (8*i)) || /* big-endian */
18110 (*up == 1 << (8*(3-i))) /* little-endian */
18114 printf("read failed (%x)\n", *up);
18120 for (i = 0; i < 4; i++) {
18121 up = (U32*)(buf + i);
18123 if (*up != 0xBeef) {
18124 printf("write failed (%x)\n", *up);
18138 if eval $compile_ok; then
18139 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18140 $run ./try 2>&1 >/dev/null
18143 You can access character data pretty unalignedly.
18145 d_u32align="$undef"
18148 It seems that you must access character data in an aligned manner.
18150 d_u32align="$define"
18154 rp='Can you access character data at unaligned addresses?'
18158 [yY]*) d_u32align="$undef" ;;
18159 *) d_u32align="$define" ;;
18166 : see if ualarm exists
18167 set ualarm d_ualarm
18170 : see if umask exists
18174 : see if unordered exists
18175 set unordered d_unordered
18178 : see if unsetenv exists
18179 set unsetenv d_unsetenv
18182 : see if usleep exists
18183 set usleep d_usleep
18186 : see if prototype for usleep is available
18188 set d_usleepproto usleep $i_unistd unistd.h
18191 : see if ustat exists
18195 : see if closedir exists
18196 set closedir d_closedir
18199 case "$d_closedir" in
18202 echo "Checking whether closedir() returns a status..." >&4
18204 #$i_dirent I_DIRENT /**/
18205 #$i_sysdir I_SYS_DIR /**/
18206 #$i_sysndir I_SYS_NDIR /**/
18207 #$i_systypes I_SYS_TYPES /**/
18209 #if defined(I_SYS_TYPES)
18210 #include <sys/types.h>
18212 #if defined(I_DIRENT)
18213 #include <dirent.h>
18214 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18215 #include <sys/dir.h>
18219 #include <sys/ndir.h>
18223 #include <ndir.h> /* may be wrong in the future */
18225 #include <sys/dir.h>
18230 int main() { return closedir(opendir(".")); }
18233 if eval $compile_ok; then
18234 if $run ./try > /dev/null 2>&1 ; then
18235 echo "Yes, it does."
18238 echo "No, it doesn't."
18242 echo "(I can't seem to compile the test program--assuming it doesn't)"
18250 set d_void_closedir
18254 : see if there is a wait4
18258 : see if waitpid exists
18259 set waitpid d_waitpid
18262 : see if wcstombs exists
18263 set wcstombs d_wcstombs
18266 : see if wctomb exists
18267 set wctomb d_wctomb
18270 : see if writev exists
18271 set writev d_writev
18274 : preserve RCS keywords in files with variable substitution, grrr
18279 Revision='$Revision'
18281 : check for alignment requirements
18283 case "$usecrosscompile$multiarch" in
18286 You seem to be either cross-compiling or doing a multiarchitecture build,
18287 skipping the memory alignment check.
18290 case "$alignbytes" in
18291 '') alignbytes=8 ;;
18295 case "$alignbytes" in
18296 '') echo "Checking alignment constraints..." >&4
18297 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18298 $cat >try.c <<'EOCP'
18299 typedef long double NV;
18302 $cat >try.c <<'EOCP'
18306 $cat >>try.c <<'EOCP'
18314 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18319 if eval $compile_ok; then
18323 echo "(I can't seem to compile the test program...)"
18326 *) dflt="$alignbytes"
18329 rp="Doubles must be aligned on a how-many-byte boundary?"
18337 : set the base revision
18340 : how do we concatenate cpp tokens here?
18342 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18343 $cat >cpp_stuff.c <<'EOCP'
18344 #define RCAT(a,b)a/**/b
18345 #define ACAT(a,b)a ## b
18349 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18350 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18351 echo "Oh! Smells like ANSI's been here." >&4
18352 echo "We can catify or stringify, separately or together!"
18354 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18355 echo "Ah, yes! The good old days!" >&4
18356 echo "However, in the good old days we don't know how to stringify and"
18357 echo "catify at the same time."
18361 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18362 You're going to have to edit the values of CAT[2-5] in config.h...
18364 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18368 : see if this is a db.h system
18374 : Check db version.
18376 echo "Checking Berkeley DB version ..." >&4
18382 #include <sys/types.h>
18384 #$i_stdlib I_STDLIB
18386 #include <stdlib.h>
18389 int main(int argc, char *argv[])
18391 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18392 int Major, Minor, Patch ;
18393 unsigned long Version ;
18394 (void)db_version(&Major, &Minor, &Patch) ;
18396 printf("%d %d %d %d %d %d\n",
18397 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18398 Major, Minor, Patch);
18401 printf("You have Berkeley DB Version 2 or greater.\n");
18403 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18404 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18405 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18406 Major, Minor, Patch) ;
18408 /* check that db.h & libdb are compatible */
18409 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18410 printf("db.h and libdb are incompatible.\n") ;
18414 printf("db.h and libdb are compatible.\n") ;
18416 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18417 + DB_VERSION_PATCH ;
18419 /* needs to be >= 2.3.4 */
18420 if (Version < 2003004) {
18421 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18422 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18428 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18433 printf("You have Berkeley DB Version 1.\n");
18434 exit(0); /* DB version < 2: the coast is clear. */
18436 exit(1); /* <db.h> not Berkeley DB? */
18442 if eval $compile_ok && $run ./try; then
18443 echo 'Looks OK.' >&4
18445 db_version_major=$1
18446 db_version_minor=$2
18447 db_version_patch=$3
18449 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18453 : Remove db from list of libraries to use
18454 echo "Removing unusable -ldb from library list" >&4
18455 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18458 echo "libs = $libs" >&4
18468 : Check the return type needed for hash
18470 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18476 #include <sys/types.h>
18479 #ifndef DB_VERSION_MAJOR
18480 u_int32_t hash_cb (ptr, size)
18488 info.hash = hash_cb;
18492 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18493 if $contains warning try.out >>/dev/null 2>&1 ; then
18496 db_hashtype='u_int32_t'
18499 : XXX Maybe we should just give up here.
18500 db_hashtype=u_int32_t
18502 echo "Help: I can't seem to compile the db test program." >&4
18503 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18506 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18508 *) db_hashtype=u_int32_t
18513 : Check the return type needed for prefix
18515 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18521 #include <sys/types.h>
18524 #ifndef DB_VERSION_MAJOR
18525 size_t prefix_cb (key1, key2)
18533 info.prefix = prefix_cb;
18537 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18538 if $contains warning try.out >>/dev/null 2>&1 ; then
18539 db_prefixtype='int'
18541 db_prefixtype='size_t'
18544 db_prefixtype='size_t'
18545 : XXX Maybe we should just give up here.
18547 echo "Help: I can't seem to compile the db test program." >&4
18548 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18551 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18553 *) db_prefixtype='size_t'
18557 : How can we generate normalized random numbers ?
18559 echo "Looking for a random number function..." >&4
18560 case "$randfunc" in
18562 if set drand48 val -f; eval $csym; $val; then
18564 echo "Good, found drand48()." >&4
18565 elif set random val -f; eval $csym; $val; then
18567 echo "OK, found random()." >&4
18570 echo "Yick, looks like I have to use rand()." >&4
18581 *-Dmy_rand=*|*-Dmy_srand=*)
18582 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18583 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18584 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18585 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18589 while $test "$cont"; do
18590 rp="Use which function to generate random numbers?"
18592 if $test "$ans" = "$dflt"; then
18598 if set $ans val -f; eval $csym; $val; then
18602 rp="I cannot find function $ans. Use that name anyway?"
18611 case "$randfunc" in
18613 drand01="drand48()"
18619 case "$randbits" in
18621 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18623 #$i_unistd I_UNISTD
18624 #$i_stdlib I_STDLIB
18627 # include <unistd.h>
18630 # include <stdlib.h>
18635 register unsigned long tmp;
18636 register unsigned long max = 0L;
18638 for (i = 1000; i; i--) {
18639 tmp = (unsigned long) $randfunc();
18640 if (tmp > max) max = tmp;
18642 for (i = 0; max; i++)
18648 if eval $compile_ok; then
18652 echo "(I can't seem to compile the test program...)"
18659 rp="How many bits does your $randfunc() function produce?"
18663 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18664 seedfunc="s$randfunc"
18665 randseedtype=unsigned
18669 rp="How many bits does your $randfunc() function produce?"
18672 seedfunc="s$randfunc"
18673 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18674 if set $seedfunc val -f; eval $csym; $val; then
18675 echo "(Using $seedfunc() to seed random generator)"
18677 echo "(Warning: no $seedfunc() to seed random generator)"
18680 randseedtype=unsigned
18688 echo "Determining whether or not we are on an EBCDIC system..." >&4
18689 $cat >try.c <<'EOM'
18692 if ('M'==0xd4) return 0;
18699 if eval $compile_ok; then
18700 if $run ./try; then
18701 echo "You seem to speak EBCDIC." >&4
18704 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18707 echo "I'm unable to compile the test program." >&4
18708 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18716 Checking how to flush all pending stdio output...
18718 # I only know how to find the first 32 possibly open files on SunOS.
18719 # See also hints/sunos_4_1.sh and util.c --AD
18721 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18723 $cat >>try.c <<EOCP
18725 #$i_stdlib I_STDLIB
18727 #include <stdlib.h>
18729 #$i_unistd I_UNISTD
18731 # include <unistd.h>
18733 #$d_sysconf HAS_SYSCONF
18734 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18735 #ifdef HAS_STDIO_STREAM_ARRAY
18736 # define STDIO_STREAM_ARRAY $stdio_stream_array
18741 p = fopen("try.out", "w");
18745 # ifdef TRY_FPRINTF
18749 #ifdef TRY_FFLUSH_NULL
18752 #ifdef TRY_FFLUSH_ALL
18754 long open_max = -1;
18755 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18756 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18758 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18759 open_max = sysconf(_SC_OPEN_MAX);
18762 open_max = FOPEN_MAX;
18765 open_max = OPEN_MAX;
18774 # ifdef HAS_STDIO_STREAM_ARRAY
18775 if (open_max > 0) {
18777 for (i = 0; i < open_max; i++)
18778 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18779 STDIO_STREAM_ARRAY[i]._file < open_max &&
18780 STDIO_STREAM_ARRAY[i]._flag)
18781 fflush(&STDIO_STREAM_ARRAY[i]);
18789 : first we have to find out how _not_ to flush
18791 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18793 set try -DTRY_FPUTC
18794 if eval $compile; then
18795 $run ./try 2>/dev/null
18798 if $test ! -s try.out -a "X$code" = X42; then
18804 set try -DTRY_FPRINTF
18805 if eval $compile; then
18806 $run ./try 2>/dev/null
18809 if $test ! -s try.out -a "X$code" = X42; then
18810 output=-DTRY_FPRINTF
18816 : check for fflush NULL behaviour
18817 case "$fflushNULL" in
18818 '') set try -DTRY_FFLUSH_NULL $output
18819 if eval $compile; then
18820 $run ./try 2>/dev/null
18823 if $test -s try.out -a "X$code" = X42; then
18824 fflushNULL="`$cat try.out`"
18826 if $test "X$code" != X42; then
18828 (If this test failed, don't worry, we'll try another method shortly.)
18834 case "$fflushNULL" in
18836 Your fflush(NULL) works okay for output streams.
18837 Let's see if it clobbers input pipes...
18839 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18840 # bug that improperly flushes the input end of pipes. So we avoid the
18841 # autoflush on fork/system/exec support for now. :-(
18842 $cat >tryp.c <<EOCP
18845 main(int argc, char **argv)
18851 while ((i = getc(stdin)) != -1
18852 && (*bp++ = i) != '\n'
18853 && bp < &buf[1024])
18856 fprintf(stdout, "%s", buf);
18864 fflushNULL="$define"
18866 if eval $compile; then
18868 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18869 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18871 fflush(NULL) seems to behave okay with input streams.
18873 fflushNULL="$define"
18876 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18878 fflushNULL="$undef"
18881 $rm -f core tryp.c tryp.core core.tryp.*
18884 Your fflush(NULL) isn't working (contrary to ANSI C).
18886 fflushNULL="$undef"
18889 Cannot figure out whether your fflush(NULL) works or not.
18890 I'm assuming it doesn't (contrary to ANSI C).
18892 fflushNULL="$undef"
18896 $define|true|[yY]*)
18897 fflushNULL="$define"
18900 fflushNULL="$undef"
18903 : check explicit looping only if NULL did not work, and if the pipe
18904 : bug does not show up on an explicit flush too
18905 case "$fflushNULL" in
18907 $cat >tryp.c <<EOCP
18910 main(int argc, char **argv)
18916 while ((i = getc(stdin)) != -1
18917 && (*bp++ = i) != '\n'
18918 && bp < &buf[1024])
18921 fprintf(stdout, "%s", buf);
18930 if eval $compile; then
18932 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18933 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18935 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
18937 : now check for fflushall behaviour
18938 case "$fflushall" in
18939 '') set try -DTRY_FFLUSH_ALL $output
18940 if eval $compile; then
18942 (Now testing the other method--but note that this also may fail.)
18944 $run ./try 2>/dev/null
18947 if $test -s try.out -a "X$code" = X42; then
18948 fflushall="`$cat try.out`"
18952 case "$fflushall" in
18954 Whew. Flushing explicitly all the stdio streams works.
18956 fflushall="$define"
18959 Sigh. Flushing explicitly all the stdio streams doesn't work.
18964 Cannot figure out whether flushing stdio streams explicitly works or not.
18965 I'm assuming it doesn't.
18971 "$define"|true|[yY]*)
18972 fflushall="$define"
18980 All is futile. Even fflush(stdin) clobbers input pipes!
18987 $rm -f core tryp.c tryp.core core.tryp.*
18989 *) fflushall="$undef"
18993 case "$fflushNULL$fflushall" in
18996 OK, I give up. I cannot figure out how to flush pending stdio output.
18997 We won't be flushing handles at all before fork/exec/popen.
19003 : Store the full pathname to the ar program for use in the C program
19004 : Respect a hint or command line value for full_ar.
19009 : Store the full pathname to the sed program for use in the C program
19012 : see what type gids are declared as in the kernel
19014 echo "Looking for the type for group ids returned by getgid()."
19015 set gid_t gidtype xxx stdio.h sys/types.h
19019 xxx=`./findhdr sys/user.h`
19020 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19022 unsigned) dflt="$1 $2" ;;
19026 *) dflt="$gidtype";;
19029 gid_t) echo "gid_t found." ;;
19030 *) rp="What is the type for group ids returned by getgid()?"
19038 *_t) zzz="$gidtype" ;;
19041 echo "Checking the size of $zzz..." >&4
19043 #include <sys/types.h>
19045 #$i_stdlib I_STDLIB
19047 #include <stdlib.h>
19050 printf("%d\n", (int)sizeof($gidtype));
19055 if eval $compile_ok; then
19059 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19062 echo "Your $zzz is $gidsize bytes long."
19067 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19073 *_t) zzz="$gidtype" ;;
19076 echo "Checking the sign of $zzz..." >&4
19078 #include <sys/types.h>
19089 if eval $compile; then
19093 echo "(I can't execute the test program--guessing unsigned.)" >&4
19097 1) echo "Your $zzz is unsigned." ;;
19098 -1) echo "Your $zzz is signed." ;;
19104 echo "(I can't compile the test program--guessing unsigned.)" >&4
19110 if $test X"$quadtype" != X; then
19112 echo "Checking how to print 64-bit integers..." >&4
19114 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19115 $cat >try.c <<'EOCP'
19116 #include <sys/types.h>
19119 int q = 12345678901;
19120 printf("%ld\n", q);
19124 if eval $compile; then
19128 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19129 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19130 echo "We will use %d."
19136 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19137 $cat >try.c <<'EOCP'
19138 #include <sys/types.h>
19141 long q = 12345678901;
19142 printf("%ld\n", q);
19146 if eval $compile; then
19150 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19151 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19152 echo "We will use %ld."
19158 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19159 $cat >try.c <<'EOCP'
19160 #include <sys/types.h>
19161 #include <inttypes.h>
19164 int64_t q = 12345678901;
19165 printf("%" PRId64 "\n", q);
19169 if eval $compile; then
19173 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19174 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19175 echo "We will use the C9X style."
19181 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19183 #include <sys/types.h>
19186 $quadtype q = 12345678901;
19187 printf("%Ld\n", q);
19191 if eval $compile; then
19195 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19196 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19197 echo "We will use %Ld."
19203 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19204 $cat >try.c <<'EOCP'
19205 #include <sys/types.h>
19208 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19209 printf("%lld\n", q);
19213 if eval $compile; then
19217 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19218 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19219 echo "We will use the %lld style."
19225 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19227 #include <sys/types.h>
19230 $quadtype q = 12345678901;
19231 printf("%qd\n", q);
19235 if eval $compile; then
19239 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19240 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19241 echo "We will use %qd."
19247 if $test X"$sPRId64" = X; then
19248 echo "Cannot figure out how to print 64-bit integers." >&4
19255 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19256 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19258 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19259 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19265 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19267 if $test X"$ivsize" = X8; then
19268 ivdformat="$sPRId64"
19269 uvuformat="$sPRIu64"
19270 uvoformat="$sPRIo64"
19271 uvxformat="$sPRIx64"
19272 uvXUformat="$sPRIXU64"
19274 if $test X"$ivsize" = X"$longsize"; then
19281 if $test X"$ivsize" = X"$intsize"; then
19289 if $test X"$ivsize" = X"$shortsize"; then
19300 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19301 nveformat="$sPRIeldbl"
19302 nvfformat="$sPRIfldbl"
19303 nvgformat="$sPRIgldbl"
19304 nvEUformat="$sPRIEUldbl"
19305 nvFUformat="$sPRIFUldbl"
19306 nvGUformat="$sPRIGUldbl"
19316 case "$ivdformat" in
19317 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19324 $echo "Checking the format string to be used for gids..." >&4
19327 -1) if $test X"$gidsize" = X"$ivsize"; then
19328 gidformat="$ivdformat"
19330 if $test X"$gidsize" = X"$longsize"; then
19333 if $test X"$gidsize" = X"$intsize"; then
19336 if $test X"$gidsize" = X"$shortsize"; then
19343 *) if $test X"$gidsize" = X"$uvsize"; then
19344 gidformat="$uvuformat"
19346 if $test X"$gidsize" = X"$longsize"; then
19349 if $test X"$gidsize" = X"$intsize"; then
19352 if $test X"$gidsize" = X"$shortsize"; then
19361 : see if getgroups exists
19362 set getgroups d_getgrps
19365 : see if setgroups exists
19366 set setgroups d_setgrps
19370 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19372 case "$d_getgrps$d_setgrps" in
19374 case "$groupstype" in
19375 '') dflt="$gidtype" ;;
19376 *) dflt="$groupstype" ;;
19379 What type of pointer is the second argument to getgroups() and setgroups()?
19380 Usually this is the same as group ids, $gidtype, but not always.
19383 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19387 *) groupstype="$gidtype";;
19391 if $test $patchlevel -lt 9; then
19392 : MAD is not available in 5.8.x or earlier.
19396 $define|true|[yY]*) dflt='y' ;;
19401 Would you like to build with Misc Attribute Decoration? This is development
19402 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19403 overhead on the interpreter.
19405 If this doesn't make any sense to you, just accept the default '$dflt'.
19407 rp='Build Perl with MAD?'
19412 madlyh='madly.h madly.act madly.tab'
19414 madlyobj="madly$_o" ;;
19424 echo "Checking if your $make program sets \$(MAKE)..." >&4
19425 case "$make_set_make" in
19427 $sed 's/^X //' > testmake.mak << 'EOF'
19429 X @echo 'maketemp="$(MAKE)"'
19431 case "`$make -f testmake.mak 2>/dev/null`" in
19432 *maketemp=*) make_set_make='#' ;;
19433 *) make_set_make="MAKE=$make" ;;
19435 $rm -f testmake.mak
19438 case "$make_set_make" in
19439 '#') echo "Yup, it does.";;
19440 *) echo "Nope, it doesn't.";;
19443 : see what type is used for mode_t
19444 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19445 set mode_t modetype int stdio.h sys/types.h
19448 : see if we need va_copy
19450 case "$i_stdarg" in
19453 #include <stdarg.h>
19455 #$i_stdlib I_STDLIB
19457 #include <stdlib.h>
19459 #include <signal.h>
19462 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19464 return vfprintf(f, fmt, *valp);
19468 myvfprintf(FILE *f, const char *fmt, va_list val)
19470 return ivfprintf(f, fmt, &val);
19474 myprintf(char *fmt, ...)
19477 va_start(val, fmt);
19478 return myvfprintf(stdout, fmt, val);
19482 main(int ac, char **av)
19484 signal(SIGSEGV, exit);
19486 myprintf("%s%cs all right, then\n", "that", '\'');
19491 if eval $compile && $run ./try 2>&1 >/dev/null; then
19492 case "`$run ./try`" in
19493 "that's all right, then")
19499 yes) echo "It seems that you don't need va_copy()." >&4
19500 need_va_copy="$undef"
19502 *) echo "It seems that va_copy() or similar will be needed." >&4
19503 need_va_copy="$define"
19508 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19512 : see what type is used for size_t
19513 rp="What is the type used for the length parameter for string functions?"
19514 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19517 : check for type of arguments to gethostbyaddr.
19518 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19519 case "$d_gethbyaddr" in
19523 Checking to see what type of arguments are accepted by gethostbyaddr().
19525 hdrs="$define sys/types.h
19526 $d_socket sys/socket.h
19527 $i_niin netinet/in.h
19529 $i_unistd unistd.h"
19530 : The first arg can 'char *' or 'void *'
19531 : The second arg is some of integral type
19532 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19533 for yyy in size_t long int; do
19534 case "$netdb_host_type" in
19535 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19536 if ./protochk "$try" $hdrs; then
19537 echo "Your system accepts $xxx for the first arg."
19538 echo "...and $yyy for the second arg."
19539 netdb_host_type="$xxx"
19540 netdb_hlen_type="$yyy"
19546 : In case none of those worked, prompt the user.
19547 case "$netdb_host_type" in
19548 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19551 netdb_host_type=$ans
19552 rp='What is the type for the 2nd argument to gethostbyaddr?'
19555 netdb_hlen_type=$ans
19559 *) : no gethostbyaddr, so pick harmless defaults
19560 netdb_host_type='char *'
19561 netdb_hlen_type="$sizetype"
19564 # Remove the "const" if needed. -- but then we'll have a
19566 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19569 : check for type of argument to gethostbyname.
19570 if test "X$netdb_name_type" = X ; then
19571 case "$d_gethbyname" in
19575 Checking to see what type of argument is accepted by gethostbyname().
19577 hdrs="$define sys/types.h
19578 $d_socket sys/socket.h
19579 $i_niin netinet/in.h
19581 $i_unistd unistd.h"
19582 for xxx in "const char *" "char *"; do
19583 case "$netdb_name_type" in
19584 '') try="extern struct hostent *gethostbyname($xxx);"
19585 if ./protochk "$try" $hdrs; then
19586 echo "Your system accepts $xxx."
19587 netdb_name_type="$xxx"
19592 : In case none of those worked, prompt the user.
19593 case "$netdb_name_type" in
19594 '') rp='What is the type for the 1st argument to gethostbyname?'
19597 netdb_name_type=$ans
19601 *) : no gethostbyname, so pick harmless default
19602 netdb_name_type='char *'
19607 : check for type of 1st argument to getnetbyaddr.
19608 if test "X$netdb_net_type" = X ; then
19609 case "$d_getnbyaddr" in
19613 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19615 hdrs="$define sys/types.h
19616 $d_socket sys/socket.h
19617 $i_niin netinet/in.h
19619 $i_unistd unistd.h"
19620 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19621 case "$netdb_net_type" in
19622 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19623 if ./protochk "$try" $hdrs; then
19624 echo "Your system accepts $xxx."
19625 netdb_net_type="$xxx"
19630 : In case none of those worked, prompt the user.
19631 case "$netdb_net_type" in
19632 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19635 netdb_net_type=$ans
19639 *) : no getnetbyaddr, so pick harmless default
19640 netdb_net_type='long'
19644 : locate the preferred pager for this system
19651 [a-zA-Z]:/*) dflt=$pg;;
19655 [a-zA-Z]:/*) dflt=$more;;
19659 [a-zA-Z]:/*) dflt=$less;;
19662 '') dflt=/usr/ucb/more;;
19666 : Instruct ./getfile to trust the hinted or previous pager value,
19667 : even if it does not begin with a slash. For example, on os2,
19668 : pager might be cmd /c more. See comments in UU/getfile.
19673 rp='What pager is used on your system?'
19677 : see what type pids are declared as in the kernel
19678 rp="What is the type of process ids on this system?"
19679 set pid_t pidtype int stdio.h sys/types.h
19682 : see if ar generates random libraries by itself
19684 echo "Checking how to generate random libraries on your machine..." >&4
19685 echo 'int bar1() { return bar2(); }' > bar1.c
19686 echo 'int bar2() { return 2; }' > bar2.c
19688 #$i_stdlib I_STDLIB
19690 #include <stdlib.h>
19692 int main() { printf("%d\n", bar1()); exit(0); }
19694 $cc $ccflags -c bar1.c >/dev/null 2>&1
19695 $cc $ccflags -c bar2.c >/dev/null 2>&1
19696 $cc $ccflags -c foo.c >/dev/null 2>&1
19697 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19698 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19699 $run ./foobar >/dev/null 2>&1; then
19700 echo "$ar appears to generate random libraries itself."
19702 if [ "X$ranlib" = "X" ]; then
19705 elif $ar s bar$_a >/dev/null 2>&1 &&
19706 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19707 $run ./foobar >/dev/null 2>&1; then
19708 echo "a table of contents needs to be added with '$ar s'."
19711 elif $ar ts bar$_a >/dev/null 2>&1 &&
19712 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19713 $run ./foobar >/dev/null 2>&1; then
19714 echo "a table of contents needs to be added with '$ar ts'."
19721 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19722 $test -f $ranlib || ranlib=''
19725 if $test -n "$ranlib"; then
19726 echo "your system has '$ranlib'; we'll use that."
19729 echo "your system doesn't seem to support random libraries"
19730 echo "so we'll use lorder and tsort to order the libraries."
19737 : check for type of arguments to select.
19738 case "$selecttype" in
19739 '') case "$d_select" in
19743 Checking to see what type of arguments are accepted by select().
19745 hdrs="$define sys/types.h
19746 $i_systime sys/time.h
19747 $i_sysselct sys/select.h
19748 $d_socket sys/socket.h"
19749 : The first arg can be int, unsigned, or size_t
19750 : The last arg may or may not be 'const'
19752 : void pointer has been seen but using that
19753 : breaks the selectminbits test
19754 for xxx in 'fd_set *' 'int *'; do
19755 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19756 for tmo in 'struct timeval *' 'const struct timeval *'; do
19758 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19759 if ./protochk "$try" $hdrs; then
19760 echo "Your system accepts $xxx."
19769 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19770 case "$d_fd_set" in
19771 $define) dflt="fd_set *" ;;
19780 *) : no select, so pick a harmless default
19787 : check for the select 'width'
19788 case "$selectminbits" in
19789 '') safebits=`expr $ptrsize \* 8`
19790 case "$d_select" in
19794 Checking to see on how many bits at a time your select() operates...
19797 #include <sys/types.h>
19799 #$i_systime I_SYS_TIME
19800 #$i_systimek I_SYS_TIME_KERNEL
19805 # ifdef I_SYS_TIME_KERNEL
19808 # include <sys/time.h>
19809 # ifdef I_SYS_TIME_KERNEL
19813 #$i_sysselct I_SYS_SELECT
19814 #ifdef I_SYS_SELECT
19815 #include <sys/select.h>
19817 #$d_socket HAS_SOCKET
19819 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19822 #$i_stdlib I_STDLIB
19824 #include <stdlib.h>
19827 #define S sizeof(*(b))
19829 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19830 #define NBITS (NBYTES * 8)
19832 char *s = (char *)malloc(NBYTES);
19841 fp = fopen("try.c", "r");
19847 b = ($selecttype)s;
19848 for (i = 0; i < NBITS; i++)
19852 select(fd + 1, b, 0, 0, &t);
19853 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19855 printf("%d\n", i + 1);
19860 if eval $compile_ok; then
19861 selectminbits=`$run ./try`
19862 case "$selectminbits" in
19864 Cannot figure out on how many bits at a time your select() operates.
19865 I'll play safe and guess it is $safebits bits.
19867 selectminbits=$safebits
19868 bits="$safebits bits"
19871 *) bits="$selectminbits bits" ;;
19873 echo "Your select() operates on $bits at a time." >&4
19875 rp='What is the minimum number of bits your select() operates on?'
19876 case "$byteorder" in
19877 12345678) dflt=64 ;;
19883 selectminbits="$val"
19887 *) : no select, so pick a harmless default
19888 selectminbits=$safebits
19894 : Trace out the files included by signal.h, then look for SIGxxx names.
19895 : Remove SIGARRAYSIZE used by HPUX.
19896 : Remove SIGSTKSIZE used by Linux.
19897 : Remove SIGSTKSZ used by Posix.
19898 : Remove SIGTYP void lines used by OS2.
19899 : Some cpps, like os390, dont give the file name anywhere
19900 if [ "X$fieldn" = X ]; then
19901 : Just make some guesses. We check them later.
19902 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
19904 xxx=`echo '#include <signal.h>' |
19905 $cppstdin $cppminus $cppflags 2>/dev/null |
19906 $grep '^[ ]*#.*include' |
19907 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
19909 : Check this list of files to be sure we have parsed the cpp output ok.
19910 : This will also avoid potentially non-existent files, such
19913 for xx in $xxx /dev/null ; do
19914 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
19916 : If we have found no files, at least try signal.h
19917 case "$xxxfiles" in
19918 '') xxxfiles=`./findhdr signal.h` ;;
19921 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
19922 print substr($2, 4, 20)
19924 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
19925 print substr($3, 4, 20)
19927 : Append some common names just in case the awk scan failed.
19928 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
19929 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
19930 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19931 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19932 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19934 : generate a few handy files for later
19935 $cat > signal.c <<EOCP
19936 #include <sys/types.h>
19937 #include <signal.h>
19938 #$i_stdlib I_STDLIB
19940 #include <stdlib.h>
19945 /* Strange style to avoid deeply-nested #if/#else/#endif */
19948 # define NSIG (_NSIG)
19954 # define NSIG (SIGMAX+1)
19960 # define NSIG (SIG_MAX+1)
19966 # define NSIG (_SIG_MAX+1)
19972 # define NSIG (MAXSIG+1)
19978 # define NSIG (MAX_SIG+1)
19983 # ifdef SIGARRAYSIZE
19984 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
19990 # define NSIG (_sys_nsig) /* Solaris 2.5 */
19994 /* Default to some arbitrary number that's big enough to get most
19995 of the common signals.
20001 printf("NSIG %d\n", NSIG);
20007 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20009 printf "#ifdef SIG"; printf $1; printf "\n"
20010 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20011 printf $1; printf ");\n"
20015 printf "#endif /* JUST_NSIG */\n";
20016 printf "exit(0);\n}\n";
20019 $cat >signal.awk <<'EOP'
20020 BEGIN { ndups = 0 }
20021 $1 ~ /^NSIG$/ { nsig = $2 }
20022 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20023 if ($2 > maxsig) { maxsig = $2 }
20024 if (sig_name[$2]) {
20025 dup_name[ndups] = $1
20026 dup_num[ndups] = $2
20038 printf("NSIG %d\n", nsig);
20039 for (n = 1; n < nsig; n++) {
20041 printf("%s %d\n", sig_name[n], sig_num[n])
20044 printf("NUM%d %d\n", n, n)
20047 for (n = 0; n < ndups; n++) {
20048 printf("%s %d\n", dup_name[n], dup_num[n])
20052 $cat >signal_cmd <<EOS
20054 if $test -s signal.lst; then
20055 echo "Using your existing signal.lst file"
20060 $cat >>signal_cmd <<'EOS'
20063 if eval $compile_ok; then
20064 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
20066 echo "(I can't seem be able to compile the whole test program)" >&4
20067 echo "(I'll try it in little pieces.)" >&4
20068 set signal -DJUST_NSIG
20069 if eval $compile_ok; then
20070 $run ./signal$_exe > signal.nsg
20073 echo "I can't seem to figure out how many signals you have." >&4
20074 echo "Guessing 50." >&4
20075 echo 'NSIG 50' > signal.nsg
20077 : Now look at all the signal names, one at a time.
20078 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20079 $cat > signal.c <<EOCP
20080 #include <sys/types.h>
20081 #include <signal.h>
20084 printf("$xx %d\n", SIG${xx});
20089 if eval $compile; then
20090 echo "SIG${xx} found."
20091 $run ./signal$_exe >> signal.ls1
20093 echo "SIG${xx} NOT found."
20096 if $test -s signal.ls1; then
20097 $cat signal.nsg signal.ls1 |
20098 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20102 if $test -s signal.lst; then
20105 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20106 echo 'kill -l' >signal
20107 set X `csh -f <signal`
20111 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20113 echo $@ | $tr ' ' $trnl | \
20114 $awk '{ printf "%s %d\n", $1, ++s; }
20115 END { printf "NSIG %d\n", ++s }' >signal.lst
20117 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20119 chmod a+x signal_cmd
20120 $eunicefix signal_cmd
20122 : generate list of signal names
20124 case "$sig_name_init" in
20126 *) case "$sig_num_init" in
20127 ''|*,*) doinit=yes ;;
20132 echo "Generating a list of signal names and numbers..." >&4
20134 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20135 sig_name=`$awk 'BEGIN { printf "ZERO " }
20136 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20137 sig_num=`$awk 'BEGIN { printf "0 " }
20138 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20139 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20140 !/^NSIG/ { printf "\"%s\", ", $1 }
20141 END { printf "0\n" }' signal.lst`
20142 sig_num_init=`$awk 'BEGIN { printf "0, " }
20143 !/^NSIG/ { printf "%d, ", $2}
20144 END { printf "0\n"}' signal.lst`
20147 echo "The following $sig_count signals are available:"
20149 echo $sig_name | $awk \
20150 'BEGIN { linelen = 0 }
20152 for (i = 1; i <= NF; i++) {
20153 name = "SIG" $i " "
20154 linelen = linelen + length(name)
20155 if (linelen > 70) {
20157 linelen = length(name)
20163 sig_size=`echo $sig_name | awk '{print NF}'`
20164 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20167 case "$sizetype" in
20168 *_t) zzz="$sizetype" ;;
20169 *) zzz="filesize" ;;
20171 echo "Checking the size of $zzz..." >&4
20173 #include <sys/types.h>
20175 #$i_stdlib I_STDLIB
20177 #include <stdlib.h>
20180 printf("%d\n", (int)sizeof($sizetype));
20185 if eval $compile_ok; then
20189 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20192 echo "Your $zzz size is $sizesize bytes."
20197 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20201 : check for socklen_t
20203 echo "Checking to see if you have socklen_t..." >&4
20205 #include <sys/types.h>
20206 #$d_socket HAS_SOCKET
20208 #include <sys/socket.h>
20210 int main() { socklen_t x = 16; }
20213 if eval $compile; then
20215 echo "You have socklen_t."
20218 echo "You do not have socklen_t."
20219 case "$sizetype" in
20220 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20227 : see if this is a socks.h system
20228 set socks.h i_socks
20231 : check for type of the size argument to socket calls
20232 case "$d_socket" in
20236 Checking to see what type is the last argument of accept().
20239 case "$d_socklen_t" in
20240 "$define") yyy="$yyy socklen_t"
20242 yyy="$yyy $sizetype int long unsigned"
20243 for xxx in $yyy; do
20244 case "$socksizetype" in
20245 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
20246 case "$usesocks" in
20248 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20249 echo "Your system accepts '$xxx *' for the last argument of accept()."
20250 socksizetype="$xxx"
20253 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20254 echo "Your system accepts '$xxx *' for the last argument of accept()."
20255 socksizetype="$xxx"
20262 : In case none of those worked, prompt the user.
20263 case "$socksizetype" in
20264 '') rp='What is the type for socket address structure sizes?'
20271 *) : no sockets, so pick relatively harmless default
20276 : see what type is used for signed size_t
20277 set ssize_t ssizetype int stdio.h sys/types.h
20282 #$i_stdlib I_STDLIB
20284 #include <stdlib.h>
20286 #include <sys/types.h>
20287 #define Size_t $sizetype
20288 #define SSize_t $dflt
20291 if (sizeof(Size_t) == sizeof(SSize_t))
20293 else if (sizeof(Size_t) == sizeof(int))
20302 if eval $compile_ok && $run ./try > /dev/null; then
20303 ssizetype=`$run ./try`
20304 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20307 Help! I can't compile and run the ssize_t test program: please enlighten me!
20308 (This is probably a misconfiguration in your system or libraries, and
20309 you really ought to fix it. Still, I'll try anyway.)
20311 I need a type that is the same size as $sizetype, but is guaranteed to
20312 be signed. Common values are ssize_t, int and long.
20315 rp="What signed type is the same size as $sizetype?"
20321 : see what type of char stdio uses.
20323 echo '#include <stdio.h>' > stdio.c
20324 $cppstdin $cppminus < stdio.c > stdioh
20325 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20326 echo "Your stdio uses unsigned chars." >&4
20327 stdchar="unsigned char"
20329 echo "Your stdio uses signed chars." >&4
20332 $rm -f stdio.* stdioh
20334 : see what type uids are declared as in the kernel
20336 echo "Looking for the type for user ids returned by getuid()."
20337 set uid_t uidtype xxx stdio.h sys/types.h
20341 xxx=`./findhdr sys/user.h`
20342 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20344 unsigned) dflt="$1 $2" ;;
20348 *) dflt="$uidtype";;
20351 uid_t) echo "uid_t found." ;;
20352 *) rp="What is the type for user ids returned by getuid()?"
20360 *_t) zzz="$uidtype" ;;
20363 echo "Checking the size of $zzz..." >&4
20365 #include <sys/types.h>
20367 #$i_stdlib I_STDLIB
20369 #include <stdlib.h>
20372 printf("%d\n", (int)sizeof($uidtype));
20377 if eval $compile_ok; then
20381 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20384 echo "Your $zzz is $uidsize bytes long."
20389 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20394 *_t) zzz="$uidtype" ;;
20397 echo "Checking the sign of $zzz..." >&4
20399 #include <sys/types.h>
20410 if eval $compile; then
20414 echo "(I can't execute the test program--guessing unsigned.)" >&4
20418 1) echo "Your $zzz is unsigned." ;;
20419 -1) echo "Your $zzz is signed." ;;
20425 echo "(I can't compile the test program--guessing unsigned.)" >&4
20431 $echo "Checking the format string to be used for uids..." >&4
20434 -1) if $test X"$uidsize" = X"$ivsize"; then
20435 uidformat="$ivdformat"
20437 if $test X"$uidsize" = X"$longsize"; then
20440 if $test X"$uidsize" = X"$intsize"; then
20443 if $test X"$uidsize" = X"$shortsize"; then
20450 *) if $test X"$uidsize" = X"$uvsize"; then
20451 uidformat="$uvuformat"
20453 if $test X"$uidsize" = X"$longsize"; then
20456 if $test X"$uidsize" = X"$intsize"; then
20459 if $test X"$uidsize" = X"$shortsize"; then
20469 case "$usesitecustomize" in
20470 $define|true|[Yy]*)
20471 usesitecustomize="$define"
20474 usesitecustomize="$undef"
20478 : determine compiler compiler
20487 if $test -f "$byacc$_exe"; then
20489 comp="byacc or $comp"
20491 if $test -f "$bison$_exe"; then
20492 comp="$comp or bison -y"
20494 rp="Which compiler compiler ($comp) shall I use?"
20503 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20509 : see if this is a fp.h system
20513 : see if this is a fp_class.h system
20514 set fp_class.h i_fp_class
20517 : see if gdbm.h is available
20522 : see if gdbm_open exists
20523 set gdbm_open d_gdbm_open
20525 case "$d_gdbm_open" in
20528 echo "We won't be including <gdbm.h>"
20537 : see if this is a ieeefp.h system
20538 case "$i_ieeefp" in
20539 '' ) set ieeefp.h i_ieeefp
20544 : see if this is a libutil.h system
20545 set libutil.h i_libutil
20548 : see if mach cthreads are available
20549 if test "X$usethreads" = "X$define"; then
20550 set mach/cthreads.h i_machcthr
20553 i_machcthr="$undef"
20558 : see if this is a mntent.h system
20559 set mntent.h i_mntent
20562 : see if ndbm.h is available
20568 # Some Linux distributions such as RedHat 7.1 put the
20569 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20570 if $test -f /usr/include/gdbm/ndbm.h; then
20571 echo '<gdbm/ndbm.h> found.'
20572 ccflags="$ccflags -I/usr/include/gdbm"
20573 cppflags="$cppflags -I/usr/include/gdbm"
20581 : see if dbm_open exists
20582 set dbm_open d_dbm_open
20584 case "$d_dbm_open" in
20587 echo "We won't be including <ndbm.h>"
20596 : see if net/errno.h is available
20598 set net/errno.h val
20601 : Unfortunately, it causes problems on some systems. Arrgh.
20604 cat > try.c <<'EOM'
20607 #include <net/errno.h>
20613 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20614 echo "We'll be including <net/errno.h>." >&4
20616 echo "We won't be including <net/errno.h>." >&4
20625 : see if netinet/tcp.h is available
20626 set netinet/tcp.h i_netinettcp
20629 : see if this is a poll.h system
20633 : see if this is a prot.h system
20638 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20639 $cat <<'EOSH' > Cppsym.know
20640 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20641 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20642 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20643 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20644 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20645 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20646 bull c cadmus clipper CMU COFF COMPILER_VERSION
20647 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20648 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20649 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20650 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20652 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20653 H3050R H3050RX hbullx20 hcx host_mips
20654 hp200 hp300 hp700 HP700 hp800 hp9000
20655 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20656 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20657 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20658 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20659 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20660 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20661 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20662 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20663 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20664 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20665 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20666 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20667 MATH_HAS_NO_SIDE_EFFECTS
20668 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20669 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20670 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20671 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20672 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20673 NetBSD news1500 news1700 news1800 news1900 news3700
20674 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20675 ns32016 ns32332 ns32k nsc32000
20676 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20677 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20678 pc532 pdp11 PGC PIC plexus PORTAR posix
20679 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20680 POSIX_C_SOURCE POSIX_SOURCE POWER
20681 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
20682 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20683 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20684 sony sony_news sonyrisc sparc sparclite spectrum
20685 stardent stdc STDC_EXT stratos sun sun3 sun386
20686 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20687 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20688 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20689 sysV68 sysV88 Tek4132 Tek4300 titan
20690 TM3200 TM5400 TM5600
20691 tower tower32 tower32_200 tower32_600 tower32_700
20692 tower32_800 tower32_850 tss
20693 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20694 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20695 unix UNIX95 UNIX99 unixpc unos
20696 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20697 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20698 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20700 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20701 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20702 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20705 # Maybe put other stuff here too.
20706 cat <<EOSH >>Cppsym.know
20709 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20710 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20711 $cat Cppsym.know > Cppsym.c
20712 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20713 $rm -f Cppsym.a Cppsym.b Cppsym.c
20714 cat <<EOSH > Cppsym
20716 if $test \$# -gt 0; then
20717 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20718 if $test -s Cppsym.got; then
20725 $tr " " "$trnl" | ./Cppsym.try
20731 cat <<EOSH > Cppsym.try
20733 cat <<'EOCP' > try.c
20736 #define STRINGIFY(a) "a"
20738 #if cpp_stuff == 42
20739 #define StGiFy(a) #a
20740 #define STRINGIFY(a) StGiFy(a)
20742 #if $cpp_stuff != 1 && $cpp_stuff != 42
20743 # include "Bletch: How does this C preprocessor stringify macros?"
20749 cat <<'EOSH' >> Cppsym.try
20751 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20752 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20753 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20754 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
20756 echo 'return 0;}' >> try.c
20758 cat <<EOSH >> Cppsym.try
20760 case "$osname-$gccversion" in
20761 irix-) ccflags="\$ccflags -woff 1178" ;;
20762 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20764 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
20766 chmod +x Cppsym.try
20767 $eunicefix Cppsym.try
20768 ./Cppsym < Cppsym.know > Cppsym.true
20769 : Add in any linux cpp "predefined macros":
20770 case "$osname::$gccversion" in
20773 rm -f $tHdrH'.h' $tHdrH
20775 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
20776 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
20777 if [ -s $tHdrH'_cppsym.real' ]; then
20778 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
20781 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
20784 : now check the C compiler for additional symbols
20785 postprocess_cc_v=''
20787 aix) postprocess_cc_v="|$tr , ' '" ;;
20794 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20797 -D*) echo "\$i" | $sed 's/^-D//';;
20798 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20803 postprocess_cc_v=''
20806 ./ccsym > ccsym1.raw
20807 if $test -s ccsym1.raw; then
20808 $sort ccsym1.raw | $uniq >ccsym.raw
20810 mv ccsym1.raw ccsym.raw
20813 $awk '/\=/ { print $0; next }
20814 { print $0"=1" }' ccsym.raw >ccsym.list
20815 $comm -13 Cppsym.true ccsym.list >ccsym.own
20816 $comm -12 Cppsym.true ccsym.list >ccsym.com
20817 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
20819 if $test -z ccsym.raw; then
20820 echo "Your C compiler doesn't seem to define any symbols!" >&4
20822 echo "However, your C preprocessor defines the following symbols:"
20825 cppsymbols=`$cat Cppsym.true`
20826 cppsymbols=`echo $cppsymbols`
20827 cppccsymbols="$cppsymbols"
20829 if $test -s ccsym.com; then
20830 echo "Your C compiler and pre-processor define these symbols:"
20831 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20834 cppccsymbols=`$cat ccsym.com`
20835 cppccsymbols=`echo $cppccsymbols`
20836 $test "$silent" || sleep 1
20838 if $test -s ccsym.cpp; then
20839 $test "$also" && echo " "
20840 echo "Your C pre-processor ${also}defines the following symbols:"
20841 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20843 cppsymbols=`$cat ccsym.cpp`
20844 cppsymbols=`echo $cppsymbols`
20845 $test "$silent" || sleep 1
20847 if $test -s ccsym.own; then
20848 $test "$also" && echo " "
20849 echo "Your C compiler ${also}defines the following cpp symbols:"
20850 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20851 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20852 ccsymbols=`$cat ccsym.own`
20853 ccsymbols=`echo $ccsymbols`
20854 $test "$silent" || sleep 1
20858 : see if this is a termio system
20862 if $test `./findhdr termios.h`; then
20863 set tcsetattr i_termios
20869 "$define") echo "You have POSIX termios.h... good!" >&4;;
20870 *) if ./Cppsym pyr; then
20871 case "`/bin/universe`" in
20872 ucb) if $test `./findhdr sgtty.h`; then
20874 echo "<sgtty.h> found." >&4
20876 echo "System is pyramid with BSD universe."
20877 echo "<sgtty.h> not found--you could have problems." >&4
20879 *) if $test `./findhdr termio.h`; then
20881 echo "<termio.h> found." >&4
20883 echo "System is pyramid with USG universe."
20884 echo "<termio.h> not found--you could have problems." >&4
20888 if $test `./findhdr termio.h`; then
20889 echo "<termio.h> found." >&4
20891 elif $test `./findhdr sgtty.h`; then
20892 echo "<sgtty.h> found." >&4
20895 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
20898 if $test `./findhdr sgtty.h`; then
20899 echo "<sgtty.h> found." >&4
20901 elif $test `./findhdr termio.h`; then
20902 echo "<termio.h> found." >&4
20905 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
20909 set i_termio; eval $setvar
20910 val=$val2; set i_sgtty; eval $setvar
20911 val=$val3; set i_termios; eval $setvar
20913 : see if stddef is available
20914 set stddef.h i_stddef
20917 : see if sys/access.h is available
20918 set sys/access.h i_sysaccess
20921 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
20922 set sys/filio.h i_sysfilio
20925 if $test `./findhdr sys/ioctl.h`; then
20927 echo '<sys/ioctl.h> found.' >&4
20930 if $test $i_sysfilio = "$define"; then
20931 echo '<sys/ioctl.h> NOT found.' >&4
20933 $test $i_sgtty = "$define" && xxx="sgtty.h"
20934 $test $i_termio = "$define" && xxx="termio.h"
20935 $test $i_termios = "$define" && xxx="termios.h"
20936 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
20942 : see if socket ioctl defs are in sys/sockio.h
20944 xxx=`./findhdr sys/sockio.h`
20945 if $test "$xxx"; then
20946 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
20948 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
20951 echo "No socket ioctls found in <sys/sockio.h>." >&4
20956 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
20963 : see if this is a syslog.h system
20964 set syslog.h i_syslog
20968 : see if this is a sys/mode.h system
20969 set sys/mode.h i_sysmode
20972 : see if sys/resource.h has to be included
20973 set sys/resource.h i_sysresrc
20976 : see if sys/security.h is available
20977 set sys/security.h i_syssecrt
20980 : see if this is a sys/statvfs.h system
20981 set sys/statvfs.h i_sysstatvfs
20984 : see if this is a sys/un.h system
20985 set sys/un.h i_sysun
20989 : see if this is a sys/utsname.h system
20990 set sys/utsname.h i_sysutsname
20993 : see if this is a syswait system
20994 set sys/wait.h i_syswait
20997 : see if this is a ustat.h system
20998 set ustat.h i_ustat
21001 : see if this is an utime system
21002 set utime.h i_utime
21005 : see if this is a values.h system
21006 set values.h i_values
21009 : see if this is a vfork system
21012 set vfork.h i_vfork
21021 echo "Looking for extensions..." >&4
21022 : If we are using the old config.sh, known_extensions may contain
21023 : old or inaccurate or duplicate values.
21024 known_extensions=''
21025 nonxs_extensions=''
21026 : We do not use find because it might not be available.
21027 : We do not just use MANIFEST because the user may have dropped
21028 : some additional extensions into the source tree and expect them
21031 : Function to recursively find available extensions, ignoring DynaLoader
21032 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21036 DynaLoader|dynaload) ;;
21038 if $test -f $xxx/$xxx.xs -o -f $xxx/$xxx.c; then
21039 known_extensions="$known_extensions $1$xxx";
21040 elif $test -f $xxx/Makefile.PL; then
21041 nonxs_extensions="$nonxs_extensions $1$xxx";
21043 if $test -d $xxx -a $# -lt 10; then
21046 eval $find_extensions;
21058 eval $find_extensions
21059 # Special case: Add in threads/shared since it is not picked up by the
21060 # recursive find above (and adding in general recursive finding breaks
21061 # SDBM_File/sdbm). A.D. 10/25/2001.
21062 known_extensions="$known_extensions threads/shared"
21063 set X $known_extensions
21065 known_extensions="$*"
21066 set X $nonxs_extensions
21068 nonxs_extensions="$*"
21071 : Now see which are supported on this system.
21073 for xxx in $known_extensions ; do
21077 $define) avail_ext="$avail_ext $xxx" ;;
21080 GDBM_File|gdbm_fil)
21082 $define) avail_ext="$avail_ext $xxx" ;;
21085 I18N/Langinfo|i18n_lan)
21086 case "$i_langinfo$d_nl_langinfo" in
21087 $define$define) avail_ext="$avail_ext $xxx" ;;
21091 : XXX Do we need a useipcsysv variable here
21092 case "${d_msg}${d_sem}${d_shm}" in
21093 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21096 NDBM_File|ndbm_fil)
21099 case "$osname-$use64bitint" in
21102 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21105 *) avail_ext="$avail_ext $xxx" ;;
21110 ODBM_File|odbm_fil)
21111 case "${i_dbm}${i_rpcsvcdbm}" in
21113 case "$d_cplusplus" in
21114 define) ;; # delete as a function name will not work
21115 *) case "$osname-$use64bitint" in
21118 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21121 *) avail_ext="$avail_ext $xxx" ;;
21129 case "$useopcode" in
21130 true|define|y) avail_ext="$avail_ext $xxx" ;;
21134 case "$useposix" in
21135 true|define|y) avail_ext="$avail_ext $xxx" ;;
21139 case "$d_socket" in
21142 beos) ;; # not unless BONE
21143 *) avail_ext="$avail_ext $xxx" ;;
21148 Sys/Syslog|sys/syslog)
21149 : XXX syslog requires socket
21150 case "$d_socket" in
21151 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21155 case "$usethreads" in
21157 case "$use5005threads" in
21158 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
21162 threads|threads/shared)
21163 # threads and threads::shared are special cases.
21164 # To stop people from asking "Perl 5.8.0 was supposed
21165 # to have this new fancy threads implementation but my
21166 # perl doesn't have it" and from people trying to
21167 # (re)install the threads module using CPAN.pm and
21168 # CPAN.pm then offering to reinstall Perl 5.8.0,
21169 # the threads.pm and threads/shared.pm will always be
21170 # there, croaking informatively ("you need to rebuild
21171 # all of Perl with threads, sorry") when threads haven't
21172 # been compiled in.
21174 avail_ext="$avail_ext $xxx"
21178 cygwin) avail_ext="$avail_ext $xxx" ;;
21181 XS/APItest|xs/apitest)
21182 # This is just for testing. Skip it unless we have dynamic loading.
21185 $define) avail_ext="$avail_ext $xxx" ;;
21188 XS/Typemap|xs/typemap)
21189 # This is just for testing. Skip it unless we have dynamic loading.
21191 $define) avail_ext="$avail_ext $xxx" ;;
21194 *) avail_ext="$avail_ext $xxx"
21203 case "$onlyextensions" in
21205 *) keepextensions=''
21206 echo "You have requested that only certains extensions be included..." >&4
21207 for i in $onlyextensions; do
21208 case " $avail_ext " in
21210 echo "Keeping extension $i."
21211 keepextensions="$keepextensions $i"
21213 *) echo "Ignoring extension $i." ;;
21216 avail_ext="$keepextensions"
21220 case "$noextensions" in
21222 *) keepextensions=''
21223 echo "You have requested that certain extensions be ignored..." >&4
21224 for i in $avail_ext; do
21225 case " $noextensions " in
21226 *" $i "*) echo "Ignoring extension $i." ;;
21227 *) echo "Keeping extension $i.";
21228 keepextensions="$keepextensions $i"
21232 avail_ext="$keepextensions"
21236 : Now see which nonxs extensions are supported on this system.
21237 : For now assume all are.
21239 for xxx in $nonxs_extensions ; do
21241 *) nonxs_ext="$nonxs_ext $xxx"
21253 A number of extensions are supplied with $package. You may choose to
21254 compile these extensions for dynamic loading (the default), compile
21255 them into the $package executable (static loading), or not include
21256 them at all. Answer "none" to include no extensions.
21257 Note that DynaLoader is always built and need not be mentioned here.
21260 case "$dynamic_ext" in
21262 : Exclude those listed in static_ext
21264 for xxx in $avail_ext; do
21265 case " $static_ext " in
21267 *) dflt="$dflt $xxx" ;;
21274 *) dflt="$dynamic_ext"
21275 # Perhaps we are reusing an old out-of-date config.sh.
21278 if test X"$dynamic_ext" != X"$avail_ext"; then
21280 NOTICE: Your previous config.sh list may be incorrect.
21281 The extensions now available to you are
21283 but the default list from your previous config.sh is
21295 rp="What extensions do you wish to load dynamically?"
21298 none) dynamic_ext=' ' ;;
21299 *) dynamic_ext="$ans" ;;
21302 case "$static_ext" in
21304 : Exclude those already listed in dynamic linking
21306 for xxx in $avail_ext; do
21307 case " $dynamic_ext " in
21309 *) dflt="$dflt $xxx" ;;
21316 *) dflt="$static_ext"
21323 rp="What extensions do you wish to load statically?"
21326 none) static_ext=' ' ;;
21327 *) static_ext="$ans" ;;
21332 A number of extensions are supplied with $package. Answer "none"
21333 to include no extensions.
21334 Note that DynaLoader is always built and need not be mentioned here.
21337 case "$static_ext" in
21338 '') dflt="$avail_ext" ;;
21339 *) dflt="$static_ext"
21340 # Perhaps we are reusing an old out-of-date config.sh.
21343 if test X"$static_ext" != X"$avail_ext"; then
21345 NOTICE: Your previous config.sh list may be incorrect.
21346 The extensions now available to you are
21348 but the default list from your previous config.sh is
21357 : Exclude those that are not xs extensions
21361 rp="What extensions do you wish to include?"
21364 none) static_ext=' ' ;;
21365 *) static_ext="$ans" ;;
21370 # Encode is a special case. If we are building Encode as a static
21371 # extension, we need to explicitly list its subextensions as well.
21372 # For other nested extensions, this is handled automatically by
21373 # the appropriate Makefile.PL.
21374 case " $static_ext " in
21375 *" Encode "*) # Add the subextensions of Encode
21377 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21378 static_ext="$static_ext Encode/$xxx"
21384 set X $dynamic_ext $static_ext $nonxs_ext
21388 # Sanity check: We require an extension suitable for use with
21389 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21390 # should show up as failures in the test suite, but it's helpful to
21391 # catch them now.) The 'extensions' list is normally sorted
21392 # alphabetically, so we need to accept either
21393 # DB_File ... Fcntl ... IO ....
21394 # or something like
21395 # Fcntl ... NDBM_File ... IO ....
21396 case " $extensions" in
21397 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21398 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21399 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21400 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21401 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21405 : Remove libraries needed only for extensions
21406 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21407 : The exception is SunOS 4.x, which needs them.
21408 case "${osname}X${osvers}" in
21412 *) case "$usedl" in
21413 $define|true|[yY]*)
21414 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21418 *) perllibs="$libs"
21424 : Remove build directory name from cppstdin so it can be used from
21425 : either the present location or the final installed location.
21427 : Get out of the UU directory to get correct path name.
21429 case "$cppstdin" in
21431 echo "Stripping down cppstdin path name"
21437 : end of configuration questions
21439 echo "End of configuration questions."
21442 : back to where it started
21443 if test -d ../UU; then
21447 : configuration may be patched via a 'config.arch' file
21448 if $test -f config.arch; then
21449 echo "I see a config.arch file, loading it."
21453 : configuration may be patched via a 'config.over' file
21454 if $test -f config.over; then
21457 rp='I see a config.over file. Do you wish to load it?'
21460 n*) echo "OK, I'll ignore it.";;
21462 echo "Configuration override changes have been loaded."
21467 : in case they want portability, strip down executable paths
21468 case "$d_portable" in
21471 echo "Stripping down executable paths..." >&4
21472 for file in $loclist $trylist; do
21474 eval $file=`basename $temp`
21479 : create config.sh file
21481 echo "Creating config.sh..." >&4
21482 $spitshell <<EOT >config.sh
21485 # This file was produced by running the Configure script. It holds all the
21486 # definitions figured out by Configure. Should you modify one of these values,
21487 # do not forget to propagate your changes by running "Configure -der". You may
21488 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21491 # Package name : $package
21492 # Source directory : $src
21493 # Configuration time: $cf_time
21494 # Configured by : $cf_by
21495 # Target system : $myuname
21505 Revision='$Revision'
21513 alignbytes='$alignbytes'
21514 ansi2knr='$ansi2knr'
21515 aphostname='$aphostname'
21516 api_revision='$api_revision'
21517 api_subversion='$api_subversion'
21518 api_version='$api_version'
21519 api_versionstring='$api_versionstring'
21522 archlibexp='$archlibexp'
21523 archname64='$archname64'
21524 archname='$archname'
21525 archobjs='$archobjs'
21526 asctime_r_proto='$asctime_r_proto'
21534 byteorder='$byteorder'
21536 castflags='$castflags'
21539 cccdlflags='$cccdlflags'
21540 ccdlflags='$ccdlflags'
21542 ccflags_uselargefiles='$ccflags_uselargefiles'
21544 ccsymbols='$ccsymbols'
21545 ccversion='$ccversion'
21547 cf_email='$cf_email'
21552 clocktype='$clocktype'
21554 compress='$compress'
21555 contains='$contains'
21559 cpp_stuff='$cpp_stuff'
21560 cppccsymbols='$cppccsymbols'
21561 cppflags='$cppflags'
21563 cppminus='$cppminus'
21565 cppstdin='$cppstdin'
21566 cppsymbols='$cppsymbols'
21567 crypt_r_proto='$crypt_r_proto'
21568 cryptlib='$cryptlib'
21570 ctermid_r_proto='$ctermid_r_proto'
21571 ctime_r_proto='$ctime_r_proto'
21572 d_Gconvert='$d_Gconvert'
21573 d_PRIEUldbl='$d_PRIEUldbl'
21574 d_PRIFUldbl='$d_PRIFUldbl'
21575 d_PRIGUldbl='$d_PRIGUldbl'
21576 d_PRIXU64='$d_PRIXU64'
21577 d_PRId64='$d_PRId64'
21578 d_PRIeldbl='$d_PRIeldbl'
21579 d_PRIfldbl='$d_PRIfldbl'
21580 d_PRIgldbl='$d_PRIgldbl'
21581 d_PRIi64='$d_PRIi64'
21582 d_PRIo64='$d_PRIo64'
21583 d_PRIu64='$d_PRIu64'
21584 d_PRIx64='$d_PRIx64'
21585 d_SCNfldbl='$d_SCNfldbl'
21586 d__fwalk='$d__fwalk'
21587 d_access='$d_access'
21588 d_accessx='$d_accessx'
21591 d_archlib='$d_archlib'
21592 d_asctime_r='$d_asctime_r'
21595 d_attribute_format='$d_attribute_format'
21596 d_attribute_malloc='$d_attribute_malloc'
21597 d_attribute_nonnull='$d_attribute_nonnull'
21598 d_attribute_noreturn='$d_attribute_noreturn'
21599 d_attribute_pure='$d_attribute_pure'
21600 d_attribute_unused='$d_attribute_unused'
21601 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21605 d_bsdgetpgrp='$d_bsdgetpgrp'
21606 d_bsdsetpgrp='$d_bsdsetpgrp'
21607 d_builtin_choose_expr='$d_builtin_choose_expr'
21608 d_builtin_expect='$d_builtin_expect'
21610 d_c99_variadic_macros='$d_c99_variadic_macros'
21611 d_casti32='$d_casti32'
21612 d_castneg='$d_castneg'
21613 d_charvspr='$d_charvspr'
21615 d_chroot='$d_chroot'
21616 d_chsize='$d_chsize'
21618 d_clearenv='$d_clearenv'
21619 d_closedir='$d_closedir'
21620 d_cmsghdr_s='$d_cmsghdr_s'
21622 d_copysignl='$d_copysignl'
21623 d_cplusplus='$d_cplusplus'
21625 d_crypt_r='$d_crypt_r'
21627 d_ctermid='$d_ctermid'
21628 d_ctermid_r='$d_ctermid_r'
21629 d_ctime_r='$d_ctime_r'
21630 d_cuserid='$d_cuserid'
21631 d_dbl_dig='$d_dbl_dig'
21632 d_dbminitproto='$d_dbminitproto'
21633 d_difftime='$d_difftime'
21634 d_dir_dd_fd='$d_dir_dd_fd'
21636 d_dirnamlen='$d_dirnamlen'
21637 d_dlerror='$d_dlerror'
21638 d_dlopen='$d_dlopen'
21639 d_dlsymun='$d_dlsymun'
21640 d_dosuid='$d_dosuid'
21641 d_drand48_r='$d_drand48_r'
21642 d_drand48proto='$d_drand48proto'
21644 d_eaccess='$d_eaccess'
21645 d_endgrent='$d_endgrent'
21646 d_endgrent_r='$d_endgrent_r'
21647 d_endhent='$d_endhent'
21648 d_endhostent_r='$d_endhostent_r'
21649 d_endnent='$d_endnent'
21650 d_endnetent_r='$d_endnetent_r'
21651 d_endpent='$d_endpent'
21652 d_endprotoent_r='$d_endprotoent_r'
21653 d_endpwent='$d_endpwent'
21654 d_endpwent_r='$d_endpwent_r'
21655 d_endsent='$d_endsent'
21656 d_endservent_r='$d_endservent_r'
21657 d_eofnblk='$d_eofnblk'
21658 d_eunice='$d_eunice'
21659 d_faststdio='$d_faststdio'
21660 d_fchdir='$d_fchdir'
21661 d_fchmod='$d_fchmod'
21662 d_fchown='$d_fchown'
21664 d_fcntl_can_lock='$d_fcntl_can_lock'
21665 d_fd_macros='$d_fd_macros'
21666 d_fd_set='$d_fd_set'
21667 d_fds_bits='$d_fds_bits'
21668 d_fgetpos='$d_fgetpos'
21669 d_finite='$d_finite'
21670 d_finitel='$d_finitel'
21671 d_flexfnam='$d_flexfnam'
21673 d_flockproto='$d_flockproto'
21675 d_fp_class='$d_fp_class'
21676 d_fpathconf='$d_fpathconf'
21677 d_fpclass='$d_fpclass'
21678 d_fpclassify='$d_fpclassify'
21679 d_fpclassl='$d_fpclassl'
21680 d_fpos64_t='$d_fpos64_t'
21681 d_frexpl='$d_frexpl'
21682 d_fs_data_s='$d_fs_data_s'
21683 d_fseeko='$d_fseeko'
21684 d_fsetpos='$d_fsetpos'
21685 d_fstatfs='$d_fstatfs'
21686 d_fstatvfs='$d_fstatvfs'
21688 d_ftello='$d_ftello'
21690 d_futimes='$d_futimes'
21691 d_getcwd='$d_getcwd'
21692 d_getespwnam='$d_getespwnam'
21693 d_getfsstat='$d_getfsstat'
21694 d_getgrent='$d_getgrent'
21695 d_getgrent_r='$d_getgrent_r'
21696 d_getgrgid_r='$d_getgrgid_r'
21697 d_getgrnam_r='$d_getgrnam_r'
21698 d_getgrps='$d_getgrps'
21699 d_gethbyaddr='$d_gethbyaddr'
21700 d_gethbyname='$d_gethbyname'
21701 d_gethent='$d_gethent'
21702 d_gethname='$d_gethname'
21703 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21704 d_gethostbyname_r='$d_gethostbyname_r'
21705 d_gethostent_r='$d_gethostent_r'
21706 d_gethostprotos='$d_gethostprotos'
21707 d_getitimer='$d_getitimer'
21708 d_getlogin='$d_getlogin'
21709 d_getlogin_r='$d_getlogin_r'
21710 d_getmnt='$d_getmnt'
21711 d_getmntent='$d_getmntent'
21712 d_getnbyaddr='$d_getnbyaddr'
21713 d_getnbyname='$d_getnbyname'
21714 d_getnent='$d_getnent'
21715 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21716 d_getnetbyname_r='$d_getnetbyname_r'
21717 d_getnetent_r='$d_getnetent_r'
21718 d_getnetprotos='$d_getnetprotos'
21719 d_getpagsz='$d_getpagsz'
21720 d_getpbyname='$d_getpbyname'
21721 d_getpbynumber='$d_getpbynumber'
21722 d_getpent='$d_getpent'
21723 d_getpgid='$d_getpgid'
21724 d_getpgrp2='$d_getpgrp2'
21725 d_getpgrp='$d_getpgrp'
21726 d_getppid='$d_getppid'
21727 d_getprior='$d_getprior'
21728 d_getprotobyname_r='$d_getprotobyname_r'
21729 d_getprotobynumber_r='$d_getprotobynumber_r'
21730 d_getprotoent_r='$d_getprotoent_r'
21731 d_getprotoprotos='$d_getprotoprotos'
21732 d_getprpwnam='$d_getprpwnam'
21733 d_getpwent='$d_getpwent'
21734 d_getpwent_r='$d_getpwent_r'
21735 d_getpwnam_r='$d_getpwnam_r'
21736 d_getpwuid_r='$d_getpwuid_r'
21737 d_getsbyname='$d_getsbyname'
21738 d_getsbyport='$d_getsbyport'
21739 d_getsent='$d_getsent'
21740 d_getservbyname_r='$d_getservbyname_r'
21741 d_getservbyport_r='$d_getservbyport_r'
21742 d_getservent_r='$d_getservent_r'
21743 d_getservprotos='$d_getservprotos'
21744 d_getspnam='$d_getspnam'
21745 d_getspnam_r='$d_getspnam_r'
21746 d_gettimeod='$d_gettimeod'
21747 d_gmtime_r='$d_gmtime_r'
21748 d_gnulibc='$d_gnulibc'
21749 d_grpasswd='$d_grpasswd'
21750 d_hasmntopt='$d_hasmntopt'
21752 d_ilogbl='$d_ilogbl'
21753 d_inc_version_list='$d_inc_version_list'
21755 d_inetaton='$d_inetaton'
21756 d_int64_t='$d_int64_t'
21757 d_isascii='$d_isascii'
21758 d_isfinite='$d_isfinite'
21761 d_isnanl='$d_isnanl'
21762 d_killpg='$d_killpg'
21763 d_lchown='$d_lchown'
21764 d_ldbl_dig='$d_ldbl_dig'
21765 d_libm_lib_version='$d_libm_lib_version'
21767 d_localtime_r='$d_localtime_r'
21768 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
21769 d_locconv='$d_locconv'
21771 d_longdbl='$d_longdbl'
21772 d_longlong='$d_longlong'
21773 d_lseekproto='$d_lseekproto'
21775 d_madvise='$d_madvise'
21776 d_malloc_good_size='$d_malloc_good_size'
21777 d_malloc_size='$d_malloc_size'
21779 d_mbstowcs='$d_mbstowcs'
21780 d_mbtowc='$d_mbtowc'
21781 d_memchr='$d_memchr'
21782 d_memcmp='$d_memcmp'
21783 d_memcpy='$d_memcpy'
21784 d_memmove='$d_memmove'
21785 d_memset='$d_memset'
21787 d_mkdtemp='$d_mkdtemp'
21788 d_mkfifo='$d_mkfifo'
21789 d_mkstemp='$d_mkstemp'
21790 d_mkstemps='$d_mkstemps'
21791 d_mktime='$d_mktime'
21794 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21795 d_modflproto='$d_modflproto'
21796 d_mprotect='$d_mprotect'
21798 d_msg_ctrunc='$d_msg_ctrunc'
21799 d_msg_dontroute='$d_msg_dontroute'
21800 d_msg_oob='$d_msg_oob'
21801 d_msg_peek='$d_msg_peek'
21802 d_msg_proxy='$d_msg_proxy'
21803 d_msgctl='$d_msgctl'
21804 d_msgget='$d_msgget'
21805 d_msghdr_s='$d_msghdr_s'
21806 d_msgrcv='$d_msgrcv'
21807 d_msgsnd='$d_msgsnd'
21809 d_munmap='$d_munmap'
21810 d_mymalloc='$d_mymalloc'
21812 d_nl_langinfo='$d_nl_langinfo'
21813 d_nv_preserves_uv='$d_nv_preserves_uv'
21814 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21815 d_off64_t='$d_off64_t'
21816 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21817 d_oldpthreads='$d_oldpthreads'
21818 d_oldsock='$d_oldsock'
21820 d_pathconf='$d_pathconf'
21822 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21823 d_phostname='$d_phostname'
21826 d_portable='$d_portable'
21827 d_printf_format_null='$d_printf_format_null'
21828 d_procselfexe='$d_procselfexe'
21829 d_pseudofork='$d_pseudofork'
21830 d_pthread_atfork='$d_pthread_atfork'
21831 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21832 d_pthread_yield='$d_pthread_yield'
21834 d_pwchange='$d_pwchange'
21835 d_pwclass='$d_pwclass'
21836 d_pwcomment='$d_pwcomment'
21837 d_pwexpire='$d_pwexpire'
21838 d_pwgecos='$d_pwgecos'
21839 d_pwpasswd='$d_pwpasswd'
21840 d_pwquota='$d_pwquota'
21843 d_random_r='$d_random_r'
21844 d_readdir64_r='$d_readdir64_r'
21845 d_readdir='$d_readdir'
21846 d_readdir_r='$d_readdir_r'
21847 d_readlink='$d_readlink'
21849 d_recvmsg='$d_recvmsg'
21850 d_rename='$d_rename'
21851 d_rewinddir='$d_rewinddir'
21853 d_safebcpy='$d_safebcpy'
21854 d_safemcpy='$d_safemcpy'
21855 d_sanemcmp='$d_sanemcmp'
21856 d_sbrkproto='$d_sbrkproto'
21857 d_scalbnl='$d_scalbnl'
21858 d_sched_yield='$d_sched_yield'
21859 d_scm_rights='$d_scm_rights'
21860 d_seekdir='$d_seekdir'
21861 d_select='$d_select'
21863 d_semctl='$d_semctl'
21864 d_semctl_semid_ds='$d_semctl_semid_ds'
21865 d_semctl_semun='$d_semctl_semun'
21866 d_semget='$d_semget'
21868 d_sendmsg='$d_sendmsg'
21869 d_setegid='$d_setegid'
21870 d_seteuid='$d_seteuid'
21871 d_setgrent='$d_setgrent'
21872 d_setgrent_r='$d_setgrent_r'
21873 d_setgrps='$d_setgrps'
21874 d_sethent='$d_sethent'
21875 d_sethostent_r='$d_sethostent_r'
21876 d_setitimer='$d_setitimer'
21877 d_setlinebuf='$d_setlinebuf'
21878 d_setlocale='$d_setlocale'
21879 d_setlocale_r='$d_setlocale_r'
21880 d_setnent='$d_setnent'
21881 d_setnetent_r='$d_setnetent_r'
21882 d_setpent='$d_setpent'
21883 d_setpgid='$d_setpgid'
21884 d_setpgrp2='$d_setpgrp2'
21885 d_setpgrp='$d_setpgrp'
21886 d_setprior='$d_setprior'
21887 d_setproctitle='$d_setproctitle'
21888 d_setprotoent_r='$d_setprotoent_r'
21889 d_setpwent='$d_setpwent'
21890 d_setpwent_r='$d_setpwent_r'
21891 d_setregid='$d_setregid'
21892 d_setresgid='$d_setresgid'
21893 d_setresuid='$d_setresuid'
21894 d_setreuid='$d_setreuid'
21895 d_setrgid='$d_setrgid'
21896 d_setruid='$d_setruid'
21897 d_setsent='$d_setsent'
21898 d_setservent_r='$d_setservent_r'
21899 d_setsid='$d_setsid'
21900 d_setvbuf='$d_setvbuf'
21904 d_shmatprototype='$d_shmatprototype'
21905 d_shmctl='$d_shmctl'
21907 d_shmget='$d_shmget'
21908 d_sigaction='$d_sigaction'
21909 d_signbit='$d_signbit'
21910 d_sigprocmask='$d_sigprocmask'
21911 d_sigsetjmp='$d_sigsetjmp'
21912 d_sitearch='$d_sitearch'
21913 d_snprintf='$d_snprintf'
21914 d_sockatmark='$d_sockatmark'
21915 d_sockatmarkproto='$d_sockatmarkproto'
21916 d_socket='$d_socket'
21917 d_socklen_t='$d_socklen_t'
21918 d_sockpair='$d_sockpair'
21919 d_socks5_init='$d_socks5_init'
21920 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
21922 d_srand48_r='$d_srand48_r'
21923 d_srandom_r='$d_srandom_r'
21924 d_sresgproto='$d_sresgproto'
21925 d_sresuproto='$d_sresuproto'
21926 d_statblks='$d_statblks'
21927 d_statfs_f_flags='$d_statfs_f_flags'
21928 d_statfs_s='$d_statfs_s'
21929 d_statvfs='$d_statvfs'
21930 d_stdio_cnt_lval='$d_stdio_cnt_lval'
21931 d_stdio_ptr_lval='$d_stdio_ptr_lval'
21932 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
21933 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
21934 d_stdio_stream_array='$d_stdio_stream_array'
21935 d_stdiobase='$d_stdiobase'
21936 d_stdstdio='$d_stdstdio'
21937 d_strchr='$d_strchr'
21938 d_strcoll='$d_strcoll'
21939 d_strctcpy='$d_strctcpy'
21940 d_strerrm='$d_strerrm'
21941 d_strerror='$d_strerror'
21942 d_strerror_r='$d_strerror_r'
21943 d_strftime='$d_strftime'
21944 d_strlcat='$d_strlcat'
21945 d_strlcpy='$d_strlcpy'
21946 d_strtod='$d_strtod'
21947 d_strtol='$d_strtol'
21948 d_strtold='$d_strtold'
21949 d_strtoll='$d_strtoll'
21950 d_strtoq='$d_strtoq'
21951 d_strtoul='$d_strtoul'
21952 d_strtoull='$d_strtoull'
21953 d_strtouq='$d_strtouq'
21954 d_strxfrm='$d_strxfrm'
21955 d_suidsafe='$d_suidsafe'
21956 d_symlink='$d_symlink'
21957 d_syscall='$d_syscall'
21958 d_syscallproto='$d_syscallproto'
21959 d_sysconf='$d_sysconf'
21960 d_sysernlst='$d_sysernlst'
21961 d_syserrlst='$d_syserrlst'
21962 d_system='$d_system'
21963 d_tcgetpgrp='$d_tcgetpgrp'
21964 d_tcsetpgrp='$d_tcsetpgrp'
21965 d_telldir='$d_telldir'
21966 d_telldirproto='$d_telldirproto'
21969 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
21970 d_tm_tm_zone='$d_tm_tm_zone'
21971 d_tmpnam_r='$d_tmpnam_r'
21972 d_truncate='$d_truncate'
21973 d_ttyname_r='$d_ttyname_r'
21974 d_tzname='$d_tzname'
21975 d_u32align='$d_u32align'
21976 d_ualarm='$d_ualarm'
21979 d_union_semun='$d_union_semun'
21980 d_unordered='$d_unordered'
21981 d_unsetenv='$d_unsetenv'
21982 d_usleep='$d_usleep'
21983 d_usleepproto='$d_usleepproto'
21985 d_vendorarch='$d_vendorarch'
21986 d_vendorbin='$d_vendorbin'
21987 d_vendorlib='$d_vendorlib'
21988 d_vendorscript='$d_vendorscript'
21990 d_void_closedir='$d_void_closedir'
21991 d_voidsig='$d_voidsig'
21992 d_voidtty='$d_voidtty'
21993 d_volatile='$d_volatile'
21994 d_vprintf='$d_vprintf'
21995 d_vsnprintf='$d_vsnprintf'
21997 d_waitpid='$d_waitpid'
21998 d_wcstombs='$d_wcstombs'
21999 d_wctomb='$d_wctomb'
22000 d_writev='$d_writev'
22003 db_hashtype='$db_hashtype'
22004 db_prefixtype='$db_prefixtype'
22005 db_version_major='$db_version_major'
22006 db_version_minor='$db_version_minor'
22007 db_version_patch='$db_version_patch'
22008 defvoidused='$defvoidused'
22009 direntrytype='$direntrytype'
22012 doublesize='$doublesize'
22014 drand48_r_proto='$drand48_r_proto'
22015 dynamic_ext='$dynamic_ext'
22021 endgrent_r_proto='$endgrent_r_proto'
22022 endhostent_r_proto='$endhostent_r_proto'
22023 endnetent_r_proto='$endnetent_r_proto'
22024 endprotoent_r_proto='$endprotoent_r_proto'
22025 endpwent_r_proto='$endpwent_r_proto'
22026 endservent_r_proto='$endservent_r_proto'
22027 eunicefix='$eunicefix'
22030 extensions='$extensions'
22032 fflushNULL='$fflushNULL'
22033 fflushall='$fflushall'
22035 firstmakefile='$firstmakefile'
22037 fpossize='$fpossize'
22038 fpostype='$fpostype'
22039 freetype='$freetype'
22042 full_csh='$full_csh'
22043 full_sed='$full_sed'
22044 gccansipedantic='$gccansipedantic'
22045 gccosandvers='$gccosandvers'
22046 gccversion='$gccversion'
22047 getgrent_r_proto='$getgrent_r_proto'
22048 getgrgid_r_proto='$getgrgid_r_proto'
22049 getgrnam_r_proto='$getgrnam_r_proto'
22050 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22051 gethostbyname_r_proto='$gethostbyname_r_proto'
22052 gethostent_r_proto='$gethostent_r_proto'
22053 getlogin_r_proto='$getlogin_r_proto'
22054 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22055 getnetbyname_r_proto='$getnetbyname_r_proto'
22056 getnetent_r_proto='$getnetent_r_proto'
22057 getprotobyname_r_proto='$getprotobyname_r_proto'
22058 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22059 getprotoent_r_proto='$getprotoent_r_proto'
22060 getpwent_r_proto='$getpwent_r_proto'
22061 getpwnam_r_proto='$getpwnam_r_proto'
22062 getpwuid_r_proto='$getpwuid_r_proto'
22063 getservbyname_r_proto='$getservbyname_r_proto'
22064 getservbyport_r_proto='$getservbyport_r_proto'
22065 getservent_r_proto='$getservent_r_proto'
22066 getspnam_r_proto='$getspnam_r_proto'
22067 gidformat='$gidformat'
22073 gmtime_r_proto='$gmtime_r_proto'
22074 gnulibc_version='$gnulibc_version'
22076 groupcat='$groupcat'
22077 groupstype='$groupstype'
22080 h_sysfile='$h_sysfile'
22083 html1dir='$html1dir'
22084 html1direxp='$html1direxp'
22085 html3dir='$html3dir'
22086 html3direxp='$html3direxp'
22095 i_arpainet='$i_arpainet'
22096 i_bsdioctl='$i_bsdioctl'
22100 i_dirent='$i_dirent'
22106 i_fp_class='$i_fp_class'
22109 i_ieeefp='$i_ieeefp'
22110 i_inttypes='$i_inttypes'
22111 i_langinfo='$i_langinfo'
22112 i_libutil='$i_libutil'
22113 i_limits='$i_limits'
22114 i_locale='$i_locale'
22115 i_machcthr='$i_machcthr'
22116 i_malloc='$i_malloc'
22118 i_memory='$i_memory'
22119 i_mntent='$i_mntent'
22122 i_neterrno='$i_neterrno'
22123 i_netinettcp='$i_netinettcp'
22127 i_pthread='$i_pthread'
22129 i_rpcsvcdbm='$i_rpcsvcdbm'
22132 i_shadow='$i_shadow'
22134 i_stdarg='$i_stdarg'
22135 i_stddef='$i_stddef'
22136 i_stdlib='$i_stdlib'
22137 i_string='$i_string'
22138 i_sunmath='$i_sunmath'
22139 i_sysaccess='$i_sysaccess'
22140 i_sysdir='$i_sysdir'
22141 i_sysfile='$i_sysfile'
22142 i_sysfilio='$i_sysfilio'
22144 i_sysioctl='$i_sysioctl'
22145 i_syslog='$i_syslog'
22146 i_sysmman='$i_sysmman'
22147 i_sysmode='$i_sysmode'
22148 i_sysmount='$i_sysmount'
22149 i_sysndir='$i_sysndir'
22150 i_sysparam='$i_sysparam'
22151 i_sysresrc='$i_sysresrc'
22152 i_syssecrt='$i_syssecrt'
22153 i_sysselct='$i_sysselct'
22154 i_syssockio='$i_syssockio'
22155 i_sysstat='$i_sysstat'
22156 i_sysstatfs='$i_sysstatfs'
22157 i_sysstatvfs='$i_sysstatvfs'
22158 i_systime='$i_systime'
22159 i_systimek='$i_systimek'
22160 i_systimes='$i_systimes'
22161 i_systypes='$i_systypes'
22162 i_sysuio='$i_sysuio'
22164 i_sysutsname='$i_sysutsname'
22165 i_sysvfs='$i_sysvfs'
22166 i_syswait='$i_syswait'
22167 i_termio='$i_termio'
22168 i_termios='$i_termios'
22170 i_unistd='$i_unistd'
22173 i_values='$i_values'
22174 i_varargs='$i_varargs'
22175 i_varhdr='$i_varhdr'
22177 ignore_versioned_solibs='$ignore_versioned_solibs'
22178 inc_version_list='$inc_version_list'
22179 inc_version_list_init='$inc_version_list_init'
22182 initialinstalllocation='$initialinstalllocation'
22183 installarchlib='$installarchlib'
22184 installbin='$installbin'
22185 installhtml1dir='$installhtml1dir'
22186 installhtml3dir='$installhtml3dir'
22187 installman1dir='$installman1dir'
22188 installman3dir='$installman3dir'
22189 installprefix='$installprefix'
22190 installprefixexp='$installprefixexp'
22191 installprivlib='$installprivlib'
22192 installscript='$installscript'
22193 installsitearch='$installsitearch'
22194 installsitebin='$installsitebin'
22195 installsitehtml1dir='$installsitehtml1dir'
22196 installsitehtml3dir='$installsitehtml3dir'
22197 installsitelib='$installsitelib'
22198 installsiteman1dir='$installsiteman1dir'
22199 installsiteman3dir='$installsiteman3dir'
22200 installsitescript='$installsitescript'
22201 installstyle='$installstyle'
22202 installusrbinperl='$installusrbinperl'
22203 installvendorarch='$installvendorarch'
22204 installvendorbin='$installvendorbin'
22205 installvendorhtml1dir='$installvendorhtml1dir'
22206 installvendorhtml3dir='$installvendorhtml3dir'
22207 installvendorlib='$installvendorlib'
22208 installvendorman1dir='$installvendorman1dir'
22209 installvendorman3dir='$installvendorman3dir'
22210 installvendorscript='$installvendorscript'
22212 issymlink='$issymlink'
22213 ivdformat='$ivdformat'
22216 known_extensions='$known_extensions'
22219 lddlflags='$lddlflags'
22221 ldflags_uselargefiles='$ldflags_uselargefiles'
22222 ldlibpthname='$ldlibpthname'
22229 libsdirs='$libsdirs'
22230 libsfiles='$libsfiles'
22231 libsfound='$libsfound'
22232 libspath='$libspath'
22233 libswanted='$libswanted'
22234 libswanted_uselargefiles='$libswanted_uselargefiles'
22240 localtime_r_proto='$localtime_r_proto'
22241 locincpth='$locincpth'
22242 loclibpth='$loclibpth'
22243 longdblsize='$longdblsize'
22244 longlongsize='$longlongsize'
22245 longsize='$longsize'
22249 lseeksize='$lseeksize'
22250 lseektype='$lseektype'
22253 madlyobj='$madlyobj'
22254 madlysrc='$madlysrc'
22258 make_set_make='$make_set_make'
22259 mallocobj='$mallocobj'
22260 mallocsrc='$mallocsrc'
22261 malloctype='$malloctype'
22263 man1direxp='$man1direxp'
22266 man3direxp='$man3direxp'
22268 mips_type='$mips_type'
22269 mistrustnm='$mistrustnm'
22271 mmaptype='$mmaptype'
22272 modetype='$modetype'
22274 multiarch='$multiarch'
22276 myarchname='$myarchname'
22277 mydomain='$mydomain'
22278 myhostname='$myhostname'
22281 need_va_copy='$need_va_copy'
22282 netdb_hlen_type='$netdb_hlen_type'
22283 netdb_host_type='$netdb_host_type'
22284 netdb_name_type='$netdb_name_type'
22285 netdb_net_type='$netdb_net_type'
22288 nm_so_opt='$nm_so_opt'
22289 nonxs_ext='$nonxs_ext'
22291 nvEUformat='$nvEUformat'
22292 nvFUformat='$nvFUformat'
22293 nvGUformat='$nvGUformat'
22294 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22295 nveformat='$nveformat'
22296 nvfformat='$nvfformat'
22297 nvgformat='$nvgformat'
22300 o_nonblock='$o_nonblock'
22302 old_pthread_create_joinable='$old_pthread_create_joinable'
22303 optimize='$optimize'
22304 orderlib='$orderlib'
22307 otherlibdirs='$otherlibdirs'
22311 patchlevel='$patchlevel'
22312 path_sep='$path_sep'
22315 perl_patchlevel='$perl_patchlevel'
22316 perladmin='$perladmin'
22317 perllibs='$perllibs'
22318 perlpath='$perlpath'
22320 phostname='$phostname'
22326 prefixexp='$prefixexp'
22328 privlibexp='$privlibexp'
22329 procselfexe='$procselfexe'
22330 prototype='$prototype'
22332 quadkind='$quadkind'
22333 quadtype='$quadtype'
22334 randbits='$randbits'
22335 randfunc='$randfunc'
22336 random_r_proto='$random_r_proto'
22337 randseedtype='$randseedtype'
22339 rd_nodata='$rd_nodata'
22340 readdir64_r_proto='$readdir64_r_proto'
22341 readdir_r_proto='$readdir_r_proto'
22342 revision='$revision'
22348 sPRIEUldbl='$sPRIEUldbl'
22349 sPRIFUldbl='$sPRIFUldbl'
22350 sPRIGUldbl='$sPRIGUldbl'
22351 sPRIXU64='$sPRIXU64'
22353 sPRIeldbl='$sPRIeldbl'
22354 sPRIfldbl='$sPRIfldbl'
22355 sPRIgldbl='$sPRIgldbl'
22360 sSCNfldbl='$sSCNfldbl'
22361 sched_yield='$sched_yield'
22362 scriptdir='$scriptdir'
22363 scriptdirexp='$scriptdirexp'
22365 seedfunc='$seedfunc'
22366 selectminbits='$selectminbits'
22367 selecttype='$selecttype'
22368 sendmail='$sendmail'
22369 setgrent_r_proto='$setgrent_r_proto'
22370 sethostent_r_proto='$sethostent_r_proto'
22371 setlocale_r_proto='$setlocale_r_proto'
22372 setnetent_r_proto='$setnetent_r_proto'
22373 setprotoent_r_proto='$setprotoent_r_proto'
22374 setpwent_r_proto='$setpwent_r_proto'
22375 setservent_r_proto='$setservent_r_proto'
22378 sharpbang='$sharpbang'
22379 shmattype='$shmattype'
22380 shortsize='$shortsize'
22383 sig_count='$sig_count'
22384 sig_name='$sig_name'
22385 sig_name_init='$sig_name_init'
22387 sig_num_init='$sig_num_init'
22388 sig_size='$sig_size'
22389 signal_t='$signal_t'
22390 sitearch='$sitearch'
22391 sitearchexp='$sitearchexp'
22393 sitebinexp='$sitebinexp'
22394 sitehtml1dir='$sitehtml1dir'
22395 sitehtml1direxp='$sitehtml1direxp'
22396 sitehtml3dir='$sitehtml3dir'
22397 sitehtml3direxp='$sitehtml3direxp'
22399 sitelib_stem='$sitelib_stem'
22400 sitelibexp='$sitelibexp'
22401 siteman1dir='$siteman1dir'
22402 siteman1direxp='$siteman1direxp'
22403 siteman3dir='$siteman3dir'
22404 siteman3direxp='$siteman3direxp'
22405 siteprefix='$siteprefix'
22406 siteprefixexp='$siteprefixexp'
22407 sitescript='$sitescript'
22408 sitescriptexp='$sitescriptexp'
22409 sizesize='$sizesize'
22410 sizetype='$sizetype'
22414 sockethdr='$sockethdr'
22415 socketlib='$socketlib'
22416 socksizetype='$socksizetype'
22418 spackage='$spackage'
22419 spitshell='$spitshell'
22420 srand48_r_proto='$srand48_r_proto'
22421 srandom_r_proto='$srandom_r_proto'
22423 ssizetype='$ssizetype'
22424 startperl='$startperl'
22426 static_ext='$static_ext'
22428 stdio_base='$stdio_base'
22429 stdio_bufsiz='$stdio_bufsiz'
22430 stdio_cnt='$stdio_cnt'
22431 stdio_filbuf='$stdio_filbuf'
22432 stdio_ptr='$stdio_ptr'
22433 stdio_stream_array='$stdio_stream_array'
22434 strerror_r_proto='$strerror_r_proto'
22437 subversion='$subversion'
22441 targetarch='$targetarch'
22445 timeincl='$timeincl'
22446 timetype='$timetype'
22447 tmpnam_r_proto='$tmpnam_r_proto'
22453 ttyname_r_proto='$ttyname_r_proto'
22462 uidformat='$uidformat'
22468 uquadtype='$uquadtype'
22469 use5005threads='$use5005threads'
22470 use64bitall='$use64bitall'
22471 use64bitint='$use64bitint'
22472 usecrosscompile='$usecrosscompile'
22474 usefaststdio='$usefaststdio'
22475 useithreads='$useithreads'
22476 uselargefiles='$uselargefiles'
22477 uselongdouble='$uselongdouble'
22478 usemallocwrap='$usemallocwrap'
22479 usemorebits='$usemorebits'
22480 usemultiplicity='$usemultiplicity'
22481 usemymalloc='$usemymalloc'
22483 useopcode='$useopcode'
22484 useperlio='$useperlio'
22485 useposix='$useposix'
22486 usereentrant='$usereentrant'
22487 userelocatableinc='$userelocatableinc'
22489 useshrplib='$useshrplib'
22490 usesitecustomize='$usesitecustomize'
22491 usesocks='$usesocks'
22492 usethreads='$usethreads'
22493 usevendorprefix='$usevendorprefix'
22494 usevfork='$usevfork'
22497 uvXUformat='$uvXUformat'
22498 uvoformat='$uvoformat'
22501 uvuformat='$uvuformat'
22502 uvxformat='$uvxformat'
22503 vendorarch='$vendorarch'
22504 vendorarchexp='$vendorarchexp'
22505 vendorbin='$vendorbin'
22506 vendorbinexp='$vendorbinexp'
22507 vendorhtml1dir='$vendorhtml1dir'
22508 vendorhtml1direxp='$vendorhtml1direxp'
22509 vendorhtml3dir='$vendorhtml3dir'
22510 vendorhtml3direxp='$vendorhtml3direxp'
22511 vendorlib='$vendorlib'
22512 vendorlib_stem='$vendorlib_stem'
22513 vendorlibexp='$vendorlibexp'
22514 vendorman1dir='$vendorman1dir'
22515 vendorman1direxp='$vendorman1direxp'
22516 vendorman3dir='$vendorman3dir'
22517 vendorman3direxp='$vendorman3direxp'
22518 vendorprefix='$vendorprefix'
22519 vendorprefixexp='$vendorprefixexp'
22520 vendorscript='$vendorscript'
22521 vendorscriptexp='$vendorscriptexp'
22523 version_patchlevel_string='$version_patchlevel_string'
22524 versiononly='$versiononly'
22526 voidflags='$voidflags'
22529 yaccflags='$yaccflags'
22534 : Add in command line options if available
22535 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22537 : add special variables
22538 $test -f $src/patchlevel.h && \
22539 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22540 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22541 echo "PERL_CONFIG_SH=true" >>config.sh
22543 : propagate old symbols
22544 if $test -f UU/config.sh; then
22545 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22546 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
22547 $sort | $uniq -u >UU/oldsyms
22548 set X `cat UU/oldsyms`
22554 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22556 echo "# Variables propagated from previous config.sh file." >>config.sh
22557 for sym in `cat UU/oldsyms`; do
22558 echo " Propagating $hint variable "'$'"$sym..."
22559 eval 'tmp="$'"${sym}"'"'
22561 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22567 : Finish up by extracting the .SH files
22571 echo "Extraction done."
22581 If you'd like to make any changes to the config.sh file before I begin
22582 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22585 rp="Press return or use a shell escape to edit config.sh:"
22590 *) : in case they cannot read
22591 sh 1>&4 -c "$ans";;
22596 : if this fails, just run all the .SH files by hand
22605 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22612 Now you need to generate make dependencies by running "$make depend".
22613 You might prefer to run it in background: "$make depend > makedepend.out &"
22614 It can take a while, so you might not want to run it right now.
22619 rp="Run $make depend now?"
22623 $make depend && echo "Now you must run '$make'."
22626 echo "You must run '$make depend' then '$make'."
22629 elif test -f [Mm]akefile; then
22631 echo "Now you must run a $make."
22633 echo "Configure done."
22636 if $test -f Policy.sh; then
22639 If you compile $package on a different machine or from a different object
22640 directory, copy the Policy.sh file from this object directory to the
22641 new one before you run Configure -- this will help you with most of
22642 the policy defaults.
22646 if $test -f config.msg; then
22647 echo "Hmm. I also noted the following information while running:"
22649 $cat config.msg >&4
22652 $rm -f kit*isdone ark*isdone