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 Thu Jul 19 15:56:52 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=''
364 d_attribute_format=''
365 d_attribute_malloc=''
366 d_attribute_nonnull=''
367 d_attribute_noreturn=''
369 d_attribute_unused=''
370 d_attribute_warn_unused_result=''
371 d_printf_format_null=''
374 d_builtin_choose_expr=''
377 d_c99_variadic_macros=''
424 endhostent_r_proto=''
430 endprotoent_r_proto=''
436 endservent_r_proto=''
488 gethostbyaddr_r_proto=''
490 gethostbyname_r_proto=''
492 gethostent_r_proto=''
504 getnetbyaddr_r_proto=''
506 getnetbyname_r_proto=''
520 d_getprotobyname_r=''
521 getprotobyname_r_proto=''
522 d_getprotobynumber_r=''
523 getprotobynumber_r_proto=''
525 getprotoent_r_proto=''
537 getservbyname_r_proto=''
539 getservbyport_r_proto=''
541 getservent_r_proto=''
565 d_libm_lib_version=''
568 d_localtime_r_needs_tzset=''
579 d_malloc_good_size=''
621 d_old_pthread_create_joinable=''
622 old_pthread_create_joinable=''
624 d_pthread_attr_setscope=''
663 sethostent_r_proto=''
680 setprotoent_r_proto=''
692 setservent_r_proto=''
726 d_sprintf_returns_strlen=''
741 d_stdio_ptr_lval_nochange_cnt=''
742 d_stdio_ptr_lval_sets_cnt=''
946 d_inc_version_list=''
948 inc_version_list_init=''
967 ignore_versioned_solibs=''
1031 d_perl_otherlibdirs=''
1039 api_versionstring=''
1045 version_patchlevel_string=''
1049 d_nv_preserves_uv=''
1050 d_nv_zero_is_allbits_zero=''
1061 nv_preserves_uv_bits=''
1133 installsitehtml1dir=''
1136 installsitehtml3dir=''
1143 installsiteman1dir=''
1146 installsiteman3dir=''
1151 installsitescript=''
1166 d_stdio_stream_array=''
1167 stdio_stream_array=''
1178 ccflags_uselargefiles=''
1179 ldflags_uselargefiles=''
1180 libswanted_uselargefiles=''
1200 installvendorarch=''
1207 installvendorhtml1dir=''
1209 vendorhtml1direxp=''
1210 installvendorhtml3dir=''
1212 vendorhtml3direxp=''
1218 installvendorman1dir=''
1221 installvendorman3dir=''
1228 installvendorscript=''
1240 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1243 : We must find out about Eunice early
1245 if test -f /etc/unixtovms; then
1246 eunicefix=/etc/unixtovms
1248 if test -f /etc/unixtovms.exe; then
1249 eunicefix=/etc/unixtovms.exe
1252 : Set executable suffix now -- needed before hints available
1253 if test -f "/libs/version.library"; then
1256 elif test -f "/system/gnu_library/bin/ar.pm"; then
1259 elif test -n "$DJGPP"; then
1262 elif test -d c:/. -o -n "$is_os2" ; then
1268 : Trailing extension. Override this in a hint file, if needed.
1269 : Extra object files, if any, needed on this platform.
1274 : change the next line if compiling for Xenix/286 on Xenix/386
1275 xlibpth='/usr/lib/386 /lib/386'
1276 : Possible local library directories to search.
1277 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1278 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1280 : general looking path for locating libraries
1281 glibpth="/lib /usr/lib $xlibpth"
1282 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1283 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1284 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1285 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1287 : Private path used by Configure to find libraries. Its value
1288 : is prepended to libpth. This variable takes care of special
1289 : machines, like the mips. Usually, it should be empty.
1292 : default library list
1294 : some systems want to use only the non-versioned libso:s
1295 ignore_versioned_solibs=''
1299 : set usethreads on the Configure command line to enable threads.
1300 usereentrant='undef'
1301 : full support for void wanted by default
1304 : Possible local include directories to search.
1305 : Set locincpth to "" in a hint file to defeat local include searches.
1306 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1307 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1309 : no include file wanted by default
1312 : Enable -DEBUGGING and -DDEBUGGING from the command line
1319 : set useposix=false in your hint file to disable the POSIX extension.
1321 : set useopcode=false in your hint file to disable the Opcode extension.
1324 ccflags_uselargefiles=''
1325 ldflags_uselargefiles=''
1326 libswanted_uselargefiles=''
1327 : set usemultiplicity on the Configure command line to enable multiplicity.
1328 : set usesocks on the Configure command line to enable socks.
1329 : List of libraries we want.
1330 : If anyone needs extra -lxxx, put those in a hint file.
1331 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1332 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1333 : We probably want to search /usr/shlib before most other libraries.
1334 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1335 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1336 glibpth="/usr/shlib $glibpth"
1337 : Do not use vfork unless overridden by a hint file.
1340 : Find the basic shell for Bourne shell scripts
1344 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1347 if test -f "$xxx"; then
1350 : Build up a list and do a single loop so we can 'break' out.
1351 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1352 for xxx in sh bash ksh pdksh ash; do
1354 try="$try ${p}/${xxx}"
1358 if test -f "$xxx"; then
1361 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1364 elif test -f "$xxx.exe"; then
1375 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1377 Usually it's in /bin/sh. How did you even get this far?
1378 Please contact me (Perl Maintainers) at perlbug@perl.org and
1379 we'll try to straighten this all out.
1385 : see if sh knows # comments
1386 if `$sh -c '#' >/dev/null 2>&1`; then
1390 test -f $xcat$_exe || xcat=/usr/bin/cat
1391 if test ! -f $xcat$_exe; then
1392 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1393 if test -f $p/cat$_exe; then
1398 if test ! -f $xcat$_exe; then
1399 echo "Can't find cat anywhere!"
1403 echo "#!$xcat" >sharp
1407 if test -s today; then
1410 echo "#! $xcat" > sharp
1414 if test -s today; then
1422 echo "Your $sh doesn't grok # comments--I will strip them later on."
1425 echo "exec grep -v '^[ ]*#'" >spitshell
1427 $eunicefix spitshell
1428 spitshell=`pwd`/spitshell
1430 echo "I presume that if # doesn't work, #! won't work either!"
1435 : figure out how to guarantee sh startup
1437 '') startsh=${sharpbang}${sh} ;;
1449 : echo "Yup, it does."
1451 echo "Hmm... '$startsh' does not guarantee sh startup..."
1452 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1457 : Save command line options in file UU/cmdline.opt for later use in
1458 : generating config.sh.
1459 cat > cmdline.opt <<EOSH
1460 # Configure command line arguments.
1469 cat >>cmdline.opt <<EOSH
1470 config_arg$argn='$arg'
1472 # Extreme backslashitis: replace each ' by '"'"'
1473 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1476 arg_exp=`cat cmdl.opt`
1477 args_exp="$args_exp$args_sep'$arg_exp'"
1478 argn=`expr $argn + 1`
1481 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1482 # used by ./hints/os2.sh
1485 : produce awk script to parse command line options
1486 cat >options.awk <<'EOF'
1488 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1490 len = length(optstr);
1491 for (i = 1; i <= len; i++) {
1492 c = substr(optstr, i, 1);
1493 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1504 if (substr(str, 1, 1) != "-") {
1505 printf("'%s'\n", str);
1509 for (i = 2; i <= len; i++) {
1510 c = substr(str, i, 1);
1512 printf("-%s\n", substr(str, i));
1518 printf("'%s'\n", substr(str, i + 1));
1531 : process the command line options
1532 set X `for arg in "$@"; do echo "X$arg"; done |
1533 sed -e s/X// | awk -f options.awk`
1538 : set up default values
1548 rm -f optdef.sh posthint.sh
1549 cat >optdef.sh <<EOS
1555 while test $# -gt 0; do
1557 -d) shift; fastread=yes;;
1558 -e) shift; alldone=cont;;
1562 if test -r "$1"; then
1565 echo "$me: cannot read config file $1." >&2
1571 -h) shift; error=true;;
1572 -r) shift; reuseval=true;;
1573 -s) shift; silent=true; realsilent=true;;
1574 -E) shift; alldone=exit;;
1575 -K) shift; knowitall=true;;
1576 -O) shift; override=true;;
1577 -S) shift; silent=true; extractsh=true;;
1582 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1583 echo "$me: ignoring -D $1" >&2
1586 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1587 *) echo "$1='define'" >> optdef.sh;;
1594 *=) echo "$1" >> optdef.sh;;
1596 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1597 echo "$me: ignoring -U $1" >&2
1599 *) echo "$1='undef'" >> optdef.sh;;
1610 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1614 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1615 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1621 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1622 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1623 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1624 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1625 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1626 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1632 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1634 echo "$yyy=''" >> posthint.sh ;;
1639 echo "$yyy='$zzz'" >> posthint.sh ;;
1641 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1643 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1648 echo "$yyy=$zzz" >> posthint.sh ;;
1649 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1653 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1656 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1664 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1665 [-U symbol] [-U symbol=] [-A command:symbol...]
1666 -d : use defaults for all answers.
1667 -e : go on without questioning past the production of config.sh.
1668 -f : specify an alternate default configuration file.
1669 -h : print this help message and exit (with an error status).
1670 -r : reuse C symbols value if possible (skips costly nm extraction).
1671 -s : silent mode, only echoes questions and essential information.
1672 -D : define symbol to have some value:
1673 -D symbol symbol gets the value 'define'
1674 -D symbol=value symbol gets the value 'value'
1675 common used examples (see INSTALL for more info):
1676 -Duse64bitint use 64bit integers
1677 -Duse64bitall use 64bit integers and pointers
1678 -Dusethreads use thread support
1679 -Dinc_version_list=none do not include older perl trees in @INC
1680 -DEBUGGING=none DEBUGGING options
1681 -Dcc=gcc choose your compiler
1682 -Dprefix=/opt/perl5 choose your destination
1683 -E : stop at the end of questions, after having produced config.sh.
1684 -K : do not use unless you know what you are doing.
1685 -O : let -D and -U override definitions from loaded configuration file.
1686 -S : perform variable substitutions on all .SH files (can mix with -f)
1687 -U : undefine symbol:
1688 -U symbol symbol gets the value 'undef'
1689 -U symbol= symbol gets completely empty
1691 -A : manipulate symbol after the platform specific hints have been applied:
1692 -A append:symbol=value append value to symbol
1693 -A symbol=value like append:, but with a separating space
1694 -A define:symbol=value define symbol to have value
1695 -A clear:symbol define symbol to be ''
1696 -A define:symbol define symbol to be 'define'
1697 -A eval:symbol=value define symbol to be eval of value
1698 -A prepend:symbol=value prepend value to symbol
1699 -A undef:symbol define symbol to be 'undef'
1700 -A undef:symbol= define symbol to be ''
1701 e.g.: -A prepend:libswanted='cl pthread '
1702 -A ccflags=-DSOME_MACRO
1703 -V : print version number and exit (with a zero status).
1710 case "$fastread$alldone" in
1713 case "$extractsh" in
1716 if test ! -t 0; then
1717 echo "Say 'sh Configure', not 'sh <Configure'"
1727 true) exec 1>/dev/null;;
1730 : run the defines and the undefines, if any, but leave the file out there...
1733 : create the posthint manipulation script and leave the file out there...
1738 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1739 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1740 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1741 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1742 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1745 : Some greps do not return status, grrr.
1746 echo "grimblepritz" >grimble
1747 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1749 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1755 : the following should work in any shell
1759 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1760 cat >contains <<'EOSS'
1761 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1766 : Find the path to the source tree
1769 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1773 *) src=`cd ../$src && pwd` ;;
1786 if test -f $rsrc/Configure && \
1787 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1789 : found it, so we are ok.
1792 for src in . .. ../.. ../../.. ../../../..; do
1793 if test -f ../$src/Configure && \
1794 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1805 Sorry, I can't seem to locate the source dir for $package. Please start
1806 Configure with an explicit path -- i.e. /some/path/Configure.
1814 echo "Sources for $package found in \"$src\"." >&4
1818 : script used to extract .SH files with variable substitutions
1819 cat >extract <<'EOS'
1821 echo "Doing variable substitutions on .SH files..."
1822 if test -f MANIFEST; then
1823 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1825 echo "(Looking for .SH files under the source directory.)"
1826 set x `(cd "$src"; find . -name "*.SH" -print)`
1830 0) set x `(cd "$src"; echo *.SH)`; shift;;
1832 if test ! -f "$src/$1"; then
1838 while test $name; do
1839 if test ! -d "$name"; then
1840 create="$name $create";
1841 name=`echo $name | sed -e "s|^[^/]*$||"`;
1842 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1847 for file in $create; do
1856 dir=`expr X$file : 'X\(.*\)/'`
1857 file=`expr X$file : 'X.*/\(.*\)'`
1858 (cd "$dir" && . ./$file)
1868 dir=`expr X$file : 'X\(.*\)/'`
1869 file=`expr X$file : 'X.*/\(.*\)'`
1870 (set x $dir; shift; eval $mkdir_p)
1871 sh <"$src/$dir/$file"
1880 if test -f "$src/config_h.SH"; then
1881 if test ! -f config.h; then
1882 : oops, they left it out of MANIFEST, probably, so do it anyway.
1883 . "$src/config_h.SH"
1888 : extract files and exit if asked to do so
1889 case "$extractsh" in
1891 case "$realsilent" in
1895 case "$config_sh" in
1896 '') config_sh='config.sh';;
1899 echo "Fetching answers from $config_sh..."
1902 test "$override" && . ./optdef.sh
1906 echo "Extraction done."
1911 : Eunice requires " " instead of "", can you believe it
1914 echo "Beginning of configuration questions for $package."
1916 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1918 : first determine how to suppress newline on echo command
1920 echo "Checking echo to see how to suppress newlines..."
1921 (echo "hi there\c" ; echo " ") >.echotmp
1922 if $contains c .echotmp >/dev/null 2>&1 ; then
1933 echo $n "The star should be here-->$c"
1937 : Now test for existence of everything in MANIFEST
1939 if test -f "$rsrc/MANIFEST"; then
1940 echo "First let's make sure your kit is complete. Checking..." >&4
1941 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1944 for filelist in x??; do
1945 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1947 if test -s missing; then
1951 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1953 You have the option of continuing the configuration process, despite the
1954 distinct possibility that your kit is damaged, by typing 'y'es. If you
1955 do, don't blame me if something goes wrong. I advise you to type 'n'o
1956 and contact the author (perlbug@perl.org).
1959 echo $n "Continue? [n] $c" >&4
1963 echo "Continuing..." >&4
1967 echo "ABORTING..." >&4
1972 echo "Looks good..."
1975 echo "There is no MANIFEST file. I hope your kit is complete !"
1980 : Find the appropriate value for a newline for tr
1981 if test -n "$DJGPP"; then
1984 if test X"$trnl" = X; then
1985 case "`echo foo|tr '\n' x 2>/dev/null`" in
1989 if test X"$trnl" = X; then
1990 case "`echo foo|tr '\012' x 2>/dev/null`" in
1991 foox) trnl='\012' ;;
1994 if test X"$trnl" = X; then
1995 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1996 fooxy) trnl='\n\r' ;;
1999 if test X"$trnl" = X; then
2002 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2008 : compute the number of columns on the terminal for proper question formatting
2013 : set up the echo used in my read
2014 myecho="case \"\$xxxm\" in
2015 '') echo $n \"\$rp $c\" >&4;;
2017 '') echo $n \"[\$xxxm] $c\";;
2019 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2021 echo $n \"[\$xxxm] $c\" >&4
2023 echo $n \"\$rp [\$xxxm] $c\" >&4
2029 : now set up to do reads with possible shell escape and default assignment
2035 case "\$fastread" in
2036 yes) case "\$dflt" in
2039 case "\$silent-\$rp" in
2044 *) case "\$silent" in
2045 true) case "\$rp" in
2050 while expr "X\$ans" : "X!" >/dev/null; do
2054 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2062 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2071 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2076 echo "(OK, I'll run with -d after this question.)" >&4
2079 echo "*** Sorry, \$1 not supported yet." >&4
2089 echo "*** Substitution done -- please confirm."
2091 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2096 echo "*** Error -- try again."
2103 case "\$ans\$xxxm\$nostick" in
2115 : create .config dir to save info across Configure sessions
2116 test -d ../.config || mkdir ../.config
2117 cat >../.config/README <<EOF
2118 This directory created by Configure to save information that should
2119 persist across sessions for $package.
2121 You may safely delete it if you wish.
2124 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2126 $define|true|[yY]*) ;;
2127 *) case "$xversion" in
2130 *** WHOA THERE!!! ***
2132 This is an UNSTABLE DEVELOPMENT release.
2133 The version of this $package distribution is $xversion, that is, odd,
2134 (as opposed to even) and that signifies a development release.
2135 If you want a maintenance release, you want an even-numbered version.
2137 Do ***NOT*** install this into production use.
2138 Data corruption and crashes are possible.
2140 It is most seriously suggested that you do not continue any further
2141 unless you want to help in developing and debugging Perl.
2143 If you *still* want to build perl, you can answer 'y' now,
2144 or pass -Dusedevel to Configure.
2147 rp='Do you really want to continue?'
2151 [yY]) echo >&4 "Okay, continuing."
2152 usedevel="$define" ;;
2153 *) echo >&4 "Okay, bye."
2163 case "$versiononly" in
2164 '') versiononly="$define" ;;
2166 case "$installusrbinperl" in
2167 '') installusrbinperl="$undef" ;;
2172 : general instructions
2175 user=`(logname) 2>/dev/null`
2177 '') user=`whoami 2>&1`;;
2179 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2182 rp='Would you like to see the instructions?'
2193 This installation shell script will examine your system and ask you questions
2194 to determine how the perl5 package should be installed. If you get
2195 stuck on a question, you may use a ! shell escape to start a subshell or
2196 execute a command. Many of the questions will have default answers in square
2197 brackets; typing carriage return will give you the default.
2199 On some of the questions which ask for file or directory names you are allowed
2200 to use the ~name construct to specify the login directory belonging to "name",
2201 even if you don't have a shell which knows about that. Questions where this is
2202 allowed will be marked "(~name ok)".
2206 dflt='Type carriage return to continue'
2210 The prompter used in this script allows you to use shell variables and
2211 backticks in your answers. You may use $1, $2, etc... to refer to the words
2212 in the default answer, as if the default line was a set of arguments given to a
2213 script shell. This means you may also use $* to repeat the whole default line,
2214 so you do not have to re-type everything to add something to the default.
2216 Everytime there is a substitution, you will have to confirm. If there is an
2217 error (e.g. an unmatched backtick), the default answer will remain unchanged
2218 and you will be prompted again.
2220 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2221 the questions and use the computed defaults (or the previous answers if there
2222 was already a config.sh file). Type 'Configure -h' for a list of options.
2223 You may also start interactively and then answer '& -d' at any prompt to turn
2224 on the non-interactive behaviour for the remainder of the execution.
2230 Much effort has been expended to ensure that this shell script will run on any
2231 Unix system. If despite that it blows up on yours, your best bet is to edit
2232 Configure and run it again. If you can't run Configure for some reason,
2233 you'll have to generate a config.sh file by hand. Whatever problems you
2234 have, let me (perlbug@perl.org) know how I blew it.
2236 This installation script affects things in two ways:
2238 1) it may do direct variable substitutions on some of the files included
2240 2) it builds a config.h file for inclusion in C programs. You may edit
2241 any of these files as the need arises after running this script.
2243 If you make a mistake on a question, there is no easy way to back up to it
2244 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2245 files. Configure will offer to let you do this before it runs the SH files.
2248 dflt='Type carriage return to continue'
2250 case "$firsttime" in
2251 true) echo $user >>../.config/instruct;;
2255 : find out where common programs are
2257 echo "Locating common programs..." >&4
2270 if test -d \$dir/\$thing; then
2276 for thisthing in \$dir/\$thing; do
2277 : just loop through to pick last item
2279 if test -f \$thisthing; then
2282 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2285 elif test -f \$dir/\$thing.exe; then
2286 if test -n "$DJGPP"; then
2287 echo \$dir/\$thing.exe
2288 elif test "$eunicefix" != ":"; then
2289 : on Eunice apparently
2343 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2344 pth="$pth /lib /usr/lib"
2345 for file in $loclist; do
2349 if test -f "$xxx"; then
2352 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2353 xxx=`./loc $file $file $pth`
2356 '') xxx=`./loc $file $file $pth`;;
2357 *) xxx=`./loc $xxx $xxx $pth`;;
2359 eval $file=$xxx$_exe
2363 echo $file is in $xxx.
2366 echo $file is in $xxx.
2369 echo "I don't know where '$file' is, and my life depends on it." >&4
2370 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2376 echo "Don't worry if any of the following aren't found..."
2378 for file in $trylist; do
2382 if test -f "$xxx"; then
2385 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2386 xxx=`./loc $file $file $pth`
2389 '') xxx=`./loc $file $file $pth`;;
2390 *) xxx=`./loc $xxx $xxx $pth`;;
2392 eval $file=$xxx$_exe
2396 echo $file is in $xxx.
2399 echo $file is in $xxx.
2402 echo "I don't see $file out there, $say."
2409 echo "Substituting grep for egrep."
2416 echo "Substituting cp for ln."
2425 echo "I can't find make or gmake, and my life depends on it." >&4
2426 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2434 *) # We can't have osname yet.
2435 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2436 # Assume that gmake, if found, is definitely GNU make
2437 # and prefer it over the system make.
2438 echo "Substituting gmake for make."
2446 echo "Hopefully test is built into your sh."
2449 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2450 echo "Using the test built into your sh."
2458 echo "Hopefully echo is built into your sh."
2463 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2464 $echo $n "hi there$c" >foo1
2465 echo $n "hi there$c" >foo2
2466 if cmp foo1 foo2 >/dev/null 2>&1; then
2467 echo "They are compatible. In fact, they may be identical."
2474 They are not compatible! You are probably running ksh on a non-USG system.
2475 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2476 have echo built in and we may have to run some Bourne shell scripts. That
2477 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2480 $echo $n "The star should be here-->$c"
2490 cat <<'EOSC' >>trygcc
2495 int main(int argc, char *argv[]) {
2499 if $cc -o try $ccflags $ldflags try.c; then
2502 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2508 # Skip this test because it gives a false match on output like:
2509 # ./trygcc: line 23: cc: command not found
2510 # case "`$cc -v -c try.c 2>&1`" in
2511 # *gcc*) trygcc=no ;;
2513 if $test X"$trygcc" = Xyes; then
2514 if gcc -o try -c try.c; then
2516 echo "You seem to have a working gcc, though." >&4
2517 # Switching compilers may undo the work of hints files.
2518 # The most common problem is -D_REENTRANT for threads.
2519 # This heuristic catches that case, but gets false positives
2520 # if -Dusethreads was not actually specified. Better to
2521 # bail out here with a useful message than fail
2522 # mysteriously later. Should we perhaps just try to
2523 # re-invoke Configure -Dcc=gcc config_args ?
2524 if $test -f usethreads.cbu; then
2527 *** However, any setting of the C compiler flags (e.g. for thread support)
2528 *** will be lost. It may be necessary for you to restart Configure and
2529 *** add -Dcc=gcc to your Configure command line.
2532 rp="Would you like to go ahead and try gcc anyway?"
2535 rp="Would you like to use it?"
2538 if $test -f myread; then
2541 if $test -f UU/myread; then
2544 echo "Cannot find myread, sorry. Aborting." >&2
2549 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2562 cat <<'EOSC' >>checkcc
2567 int main(int argc, char *argv[]) {
2571 if $cc -o try $ccflags $ldflags try.c; then
2574 if $test X"$despair" = Xyes; then
2575 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2578 You need to find a working C compiler.
2579 Either (purchase and) install the C compiler supplied by your OS vendor,
2580 or for a free C compiler try http://gcc.gnu.org/
2581 I cannot continue any further, aborting.
2590 : determine whether symbolic links are supported
2593 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2594 echo "Symbolic links are supported." >&4
2597 echo "Symbolic links are NOT supported." >&4
2602 : determine whether symbolic links are supported
2606 echo "Checking how to test for symbolic links..." >&4
2608 if $test "X$issymlink" = X; then
2610 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2611 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2613 if test $? = 0; then
2616 echo "Your builtin 'test -h' may be broken." >&4
2619 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2622 if test -f "$p/$test"; then
2631 echo "Trying external '$test -h'." >&4
2632 issymlink="$test -h"
2633 if $test ! -h sym >/dev/null 2>&1; then
2634 echo "External '$test -h' is broken, too." >&4
2642 if $test "X$issymlink" = X; then
2643 if $test -L sym 2>/dev/null; then
2644 issymlink="$test -L"
2645 echo "The builtin '$test -L' worked." >&4
2648 if $test "X$issymlink" != X; then
2649 echo "You can test for symbolic links with '$issymlink'." >&4
2651 echo "I do not know how you can test for symbolic links." >&4
2655 *) echo "No symbolic links, so not testing for their testing..." >&4
2661 case "$mksymlinks" in
2664 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2667 *) case "$lns:$issymlink" in
2668 *"ln"*" -s:"*"test -"?)
2669 echo "Creating the symbolic links..." >&4
2670 echo "(First creating the subdirectories...)" >&4
2672 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2674 test -z "$directory" && break
2678 if test ! -d t/base; then
2679 echo "Failed to create the subdirectories. Aborting." >&4
2682 echo "(Then creating the symlinks...)" >&4
2683 awk '{print $1}' $src/MANIFEST | while true; do
2685 test -z "$filename" && break
2686 if test -f $filename; then
2687 if $issymlink $filename; then
2691 if test -f $filename; then
2692 echo "$filename already exists, not symlinking."
2694 ln -s $src/$filename $filename
2698 if test ! -f t/base/lex.t; then
2699 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2704 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2713 case "$usecrosscompile" in
2715 $echo "Cross-compiling..."
2718 *-*-gcc) # A cross-compiling gcc, probably.
2719 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2721 # leave out ld, choosing it is more complex
2723 ranlib=$targetarch-ranlib
2724 $echo 'extern int foo;' > try.c
2725 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2727 if $test $# -gt 0; then
2729 incpth="`$echo $incpth|$sed 's/^ //'`"
2730 echo "Guessing incpth '$incpth'." >&4
2732 j="`$echo $i|$sed 's,/include$,/lib,'`"
2733 if $test -d $j; then
2737 libpth="`$echo $libpth|$sed 's/^ //'`"
2738 echo "Guessing libpth '$libpth'." >&4
2743 case "$targetarch" in
2744 '') echo "Targetarch not defined." >&4; croak=y ;;
2745 *) echo "Using targetarch $targetarch." >&4 ;;
2748 '') echo "Incpth not defined." >&4; croak=y ;;
2749 *) echo "Using incpth '$incpth'." >&4 ;;
2752 '') echo "Libpth not defined." >&4; croak=y ;;
2753 *) echo "Using libpth '$libpth'." >&4 ;;
2756 '') for i in $incpth; do
2757 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2759 echo "Guessing usrinc $usrinc." >&4
2764 '') echo "Usrinc not defined." >&4; croak=y ;;
2767 *) echo "Using usrinc $usrinc." >&4 ;;
2769 case "$targethost" in
2770 '') echo "Targethost not defined." >&4; croak=y ;;
2771 *) echo "Using targethost $targethost." >&4
2776 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2779 /*) run=$src/Cross/run
2780 targetmkdir=$src/Cross/mkdir
2782 from=$src/Cross/from
2784 *) pwd=`$test -f ../Configure & cd ..; pwd`
2786 targetmkdir=$pwd/Cross/mkdir
2788 from=$pwd/Cross/from
2791 case "$targetrun" in
2792 '') targetrun=ssh ;;
2797 case "$targetfrom" in
2798 '') targetfrom=scp ;;
2802 from=$from-$targetfrom
2803 case "$targetdir" in
2805 echo "Guessing targetdir $targetdir." >&4
2808 case "$targetuser" in
2810 echo "Guessing targetuser $targetuser." >&4
2813 case "$targetfrom" in
2817 case "$targetrun" in
2829 '') cwd=$targetdir ;;
2833 if $test ! -f \$exe.xok; then
2837 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2840 *) echo "Unknown targetrun '$targetrun'" >&4
2844 case "$targetmkdir" in
2846 cat >$targetmkdir <<EOF
2848 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2850 $chmod a+rx $targetmkdir
2852 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2864 $targetmkdir \`dirname \$f\`
2865 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2868 $targetmkdir $targetdir/\`dirname \$f\`
2869 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2882 $mkdir -p $targetdir/\`dirname \$f\`
2883 $cp \$f $targetdir/\$f || exit 1
2886 $targetmkdir $targetdir/\`dirname \$f\`
2887 $cp \$f $targetdir/\$f || exit 1
2894 *) echo "Unknown targetto '$targetto'" >&4
2898 case "$targetfrom" in
2905 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2910 cp) cat >$from <<EOF
2915 cp $targetdir/\$f . || exit 1
2920 *) echo "Unknown targetfrom '$targetfrom'" >&4
2924 if $test ! -f $run; then
2925 echo "Target 'run' script '$run' not found." >&4
2929 if $test ! -f $to; then
2930 echo "Target 'to' script '$to' not found." >&4
2934 if $test ! -f $from; then
2935 echo "Target 'from' script '$from' not found." >&4
2939 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2943 Using '$run' for remote execution,
2944 and '$from' and '$to'
2945 for remote file transfer.
2951 usecrosscompile='undef'
2956 : see whether [:lower:] and [:upper:] are supported character classes
2958 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2960 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2964 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2965 # (0xd9 and 0xe2), therefore that is a nice testing point.
2966 if test "X$up" = X -o "X$low" = X; then
2967 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2973 if test "X$up" = X -o "X$low" = X; then
2974 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2980 if test "X$up" = X -o "X$low" = X; then
2981 case "`echo RS | od -x 2>/dev/null`" in
2983 echo "Hey, this might be EBCDIC." >&4
2984 if test "X$up" = X -o "X$low" = X; then
2985 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2986 rs) up='[A-IJ-RS-Z]'
2991 if test "X$up" = X -o "X$low" = X; then
2992 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3002 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3004 echo "Using $up and $low to convert case." >&4
3007 echo "I don't know how to translate letters from upper to lower case." >&4
3008 echo "Your tr is not acting any way I know of." >&4
3012 : set up the translation script tr, must be called with ./tr of course
3016 '[A-Z][a-z]') exec $tr '$up' '$low';;
3017 '[a-z][A-Z]') exec $tr '$low' '$up';;
3024 : Try to determine whether config.sh was made on this system
3025 case "$config_sh" in
3027 myuname=`$uname -a 2>/dev/null`
3028 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3029 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3030 # because the A-Z/a-z are not consecutive.
3031 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3032 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3033 newmyuname="$myuname"
3035 case "$knowitall" in
3037 if test -f ../config.sh; then
3038 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3039 eval "`grep myuname= ../config.sh`"
3041 if test "X$myuname" = "X$newmyuname"; then
3049 : Get old answers from old config file if Configure was run on the
3050 : same system, otherwise use the hints.
3053 if test -f config.sh; then
3055 rp="I see a config.sh file. Shall I use it to set the defaults?"
3058 n*|N*) echo "OK, I'll ignore it."
3059 mv config.sh config.sh.old
3060 myuname="$newmyuname"
3062 *) echo "Fetching default answers from your old config.sh file..." >&4
3070 : Older versions did not always set $sh. Catch re-use of such
3080 if test ! -f config.sh; then
3083 First time through, eh? I have some defaults handy for some systems
3084 that need some extra help getting the Configure answers right:
3087 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3089 : Half the following guesses are probably wrong... If you have better
3090 : tests or hints, please send them to perlbug@perl.org
3091 : The metaconfig authors would also appreciate a copy...
3092 $test -f /irix && osname=irix
3093 $test -f /xenix && osname=sco_xenix
3094 $test -f /dynix && osname=dynix
3095 $test -f /dnix && osname=dnix
3096 $test -f /lynx.os && osname=lynxos
3097 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3098 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3099 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3100 $test -f /bin/mips && /bin/mips && osname=mips
3101 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3102 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3103 $test -d /usr/apollo/bin && osname=apollo
3104 $test -f /etc/saf/_sactab && osname=svr4
3105 $test -d /usr/include/minix && osname=minix
3106 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3107 if $test -d /MachTen -o -d /MachTen_Folder; then
3109 if $test -x /sbin/version; then
3110 osvers=`/sbin/version | $awk '{print $2}' |
3111 $sed -e 's/[A-Za-z]$//'`
3112 elif $test -x /usr/etc/version; then
3113 osvers=`/usr/etc/version | $awk '{print $2}' |
3114 $sed -e 's/[A-Za-z]$//'`
3120 $test -f /sys/posix.dll &&
3121 $test -f /usr/bin/what &&
3122 set X `/usr/bin/what /sys/posix.dll` &&
3123 $test "$3" = UWIN &&
3127 if $test -f $uname; then
3135 umips) osname=umips ;;
3138 [23]100) osname=mips ;;
3139 next*) osname=next ;;
3141 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3142 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3145 elif $test -f /etc/kconfig; then
3147 if test "$lns" = "$ln -s"; then
3149 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3151 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3158 if test -n "$DJGPP"; then
3167 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3169 # oslevel can fail with:
3170 # oslevel: Unable to acquire lock.
3171 *not\ found) osvers="$4"."$3" ;;
3172 '<3240'|'<>3240') osvers=3.2.0 ;;
3173 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3174 '=3250'|'>3250') osvers=3.2.5 ;;
3178 bsd386) osname=bsd386
3181 cygwin*) osname=cygwin
3184 *dc.osx) osname=dcosx
3190 domainos) osname=apollo
3196 dragonfly) osname=dragonfly
3199 dynixptx*) osname=dynixptx
3200 osvers=`echo "$4"|sed 's/^v//'`
3202 freebsd) osname=freebsd
3204 genix) osname=genix ;;
3208 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3224 netbsd*) osname=netbsd
3227 news-os) osvers="$3"
3229 4*) osname=newsos4 ;;
3233 next*) osname=next ;;
3234 nonstop-ux) osname=nonstopux ;;
3235 openbsd) osname=openbsd
3241 POSIX-BC | posix-bc ) osname=posix-bc
3244 powerux | power_ux | powermax_os | powermaxos | \
3245 powerunix | power_unix) osname=powerux
3251 solaris) osname=solaris
3253 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3260 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3264 titanos) osname=titanos
3273 ultrix) osname=ultrix
3276 osf1|mls+) case "$5" in
3279 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3282 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3285 hp*) osname=hp_osf1 ;;
3286 mips) osname=mips_osf1 ;;
3289 # UnixWare 7.1.2 is known as Open UNIX 8
3290 openunix|unixware) osname=svr5
3298 $2) case "$osname" in
3302 : svr4.x or possibly later
3312 if test -f /stand/boot ; then
3313 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3314 if test -n "$INITPROG" -a -f "$INITPROG"; then
3315 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3316 if test -n "$isesix"; then
3324 *) if test -f /etc/systemid; then
3326 set `echo $3 | $sed 's/\./ /g'` $4
3327 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3329 elif $test -f $src/hints/sco_$1_$2.sh; then
3331 elif $test -f $src/hints/sco_$1.sh; then
3336 '') : Still unknown. Probably a generic Sys V.
3345 *) case "$osname" in
3346 '') : Still unknown. Probably a generic BSD.
3354 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3355 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3356 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3359 $rm -f UU/kernel.what
3360 elif test -d c:/. -o -n "$is_os2" ; then
3367 case "$targetarch" in
3370 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3375 : Now look for a hint file osname_osvers, unless one has been
3376 : specified already.
3379 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3380 : Also try without trailing minor version numbers.
3381 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3382 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3383 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3384 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3387 *) case "$osvers" in
3390 *) if $test -f $src/hints/$file.sh ; then
3392 elif $test -f $src/hints/$xfile.sh ; then
3394 elif $test -f $src/hints/$xxfile.sh ; then
3396 elif $test -f $src/hints/$xxxfile.sh ; then
3398 elif $test -f $src/hints/$xxxxfile.sh ; then
3400 elif $test -f "$src/hints/${osname}.sh" ; then
3409 if $test -f Policy.sh ; then
3412 none) dflt="Policy" ;;
3413 *) dflt="Policy $dflt" ;;
3418 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3422 if $test -f Policy.sh ; then
3425 There's also a Policy hint file available, which should make the
3426 site-specific (policy) questions easier to answer.
3433 You may give one or more space-separated answers, or "none" if appropriate.
3434 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3435 previous run of Configure, you may specify it as well as or instead of
3436 OS-specific hints. If hints are provided for your OS, you should use them:
3437 although Perl can probably be built without hints on many platforms, using
3438 hints often improve performance and may enable features that Configure can't
3439 set up on its own. If there are no hints that match your OS, specify "none";
3440 DO NOT give a wrong version or a wrong OS.
3444 rp="Which of these apply, if any?"
3447 for file in $tans; do
3448 if $test X$file = XPolicy -a -f Policy.sh; then
3450 $cat Policy.sh >> UU/config.sh
3451 elif $test -f $src/hints/$file.sh; then
3452 . $src/hints/$file.sh
3453 $cat $src/hints/$file.sh >> UU/config.sh
3454 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3457 : Give one chance to correct a possible typo.
3458 echo "$file.sh does not exist"
3460 rp="hint to use instead?"
3462 for file in $ans; do
3463 if $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$ans = X -o X$ans = Xnone ; then
3469 echo "$file.sh does not exist -- ignored."
3476 : Remember our hint file for later.
3477 if $test -f "$src/hints/$file.sh" ; then
3487 echo "Fetching default answers from $config_sh..." >&4
3491 cp $config_sh config.sh 2>/dev/null
3501 test "$override" && . ./optdef.sh
3503 : Restore computed paths
3504 for file in $loclist $trylist; do
3505 eval $file="\$_$file"
3510 Configure uses the operating system name and version to set some defaults.
3511 The default value is probably right if the name rings a bell. Otherwise,
3512 since spelling matters for me, either accept the default or answer "none"
3519 ''|' '|none) dflt=none ;;
3520 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3523 *) dflt="$osname" ;;
3525 rp="Operating system name?"
3529 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3535 ''|' '|none) dflt=none ;;
3536 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3537 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3539 ''|' ') dflt=none ;;
3544 *) dflt="$osvers" ;;
3546 rp="Operating system version?"
3556 : who configured the system
3557 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3560 cf_by=`(logname) 2>/dev/null`
3563 cf_by=`(whoami) 2>/dev/null`
3565 "") cf_by=unknown ;;
3570 : decide how portable to be. Allow command line overrides.
3571 case "$d_portable" in
3573 *) d_portable="$define" ;;
3576 : set up shell script to do ~ expansion
3582 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3585 if $test -f /bin/csh; then
3586 /bin/csh -f -c "glob \$1"
3591 name=\`$expr x\$1 : '..\([^/]*\)'\`
3592 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3593 if $test ! -d "\$dir"; then
3595 echo "\$me: can't locate home directory for: \$name" >&2
3600 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3616 : now set up to get a file name
3620 cat <<'EOSC' >>getfile
3636 : getfile will accept an answer from the comma-separated list
3637 : enclosed in parentheses even if it does not meet other criteria.
3638 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3639 fn=`echo $fn | sed 's/(.*)//'`
3645 loc_file=`expr $fn : '.*:\(.*\)'`
3646 fn=`expr $fn : '\(.*\):.*'`
3654 */*) fullpath=true;;
3663 *e*) exp_file=true;;
3666 *p*) nopath_ok=true;;
3671 *d*) type='Directory';;
3672 *l*) type='Locate';;
3677 Locate) what='File';;
3682 case "$d_portable" in
3690 while test "$type"; do
3695 true) rp="$rp (~name ok)";;
3698 if test -f UU/getfile.ok && \
3699 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3718 value=`UU/filexp $ans`
3721 if test "$ans" != "$value"; then
3722 echo "(That expands to $value on this system.)"
3736 /*) value="$ansexp" ;;
3737 [a-zA-Z]:/*) value="$ansexp" ;;
3742 echo "I shall only accept a full path name, as in /bin/ls." >&4
3743 echo "Use a ! shell escape if you wish to check pathnames." >&4
3746 echo "Please give a full path name, starting with slash." >&4
3749 echo "Note that using ~name is ok provided it expands well." >&4
3762 for fp in $gfpth; do
3763 if test "X$fp" = X.; then
3768 if test -f "$pf"; then
3770 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3772 echo "($value is not a plain file, but that's ok.)"
3775 if test X"$type" = X; then
3782 for fp in $gfpth; do
3783 if test "X$fp" = X.; then
3788 direxp="$fp/$ansexp"
3790 if test -d "$direxp"; then
3798 if test -d "$ansexp"; then
3799 echo "(Looking for $loc_file in directory $value.)"
3800 value="$value/$loc_file"
3801 ansexp="$ansexp/$loc_file"
3803 if test -f "$ansexp"; then
3806 case "$nopath_ok" in
3807 true) case "$value" in
3809 *) echo "Assuming $value will be in people's path."
3825 if test "$fastread" = yes; then
3830 rp="$what $value doesn't exist. Use that name anyway?"
3849 test "X$gfpthkeep" != Xy && gfpth=""
3852 : determine root of directory hierarchy where package will be installed.
3855 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3858 dflt=`echo "$prefix" | sed 's/.$//'`
3866 By default, $package will be installed in $dflt/bin, manual pages
3867 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3868 installation directories. Typically this is something like /usr/local.
3869 If you wish to have binaries under /usr/bin but other parts of the
3870 installation under /usr/local, that's ok: you will be prompted
3871 separately for each of the installation directories, the prefix being
3872 only used to set the defaults.
3876 rp='Installation prefix to use?'
3884 *) oldprefix="$prefix";;
3893 *) afsroot=$afsroot ;;
3899 $define|true) afs=true ;;
3900 $undef|false) afs=false ;;
3901 *) if test -d $afsroot; then
3909 echo "AFS may be running... I'll be extra cautious then..." >&4
3911 echo "AFS does not seem to be running..." >&4
3914 : determine installation prefix for where package is to be installed.
3918 Since you are running AFS, I need to distinguish the directory in which
3919 files will reside from the directory in which they are installed (and from
3920 which they are presumably copied to the former directory by occult means).
3923 case "$installprefix" in
3924 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3925 *) dflt="$installprefix";;
3930 In some special cases, particularly when building $package for distribution,
3931 it is convenient to distinguish the directory in which files should be
3932 installed from the directory ($prefix) in which they will
3933 eventually reside. For most users, these two directories are the same.
3936 case "$installprefix" in
3938 *) dflt=$installprefix;;
3942 rp='What installation prefix should I use for installing files?'
3944 installprefix="$ans"
3945 installprefixexp="$ansexp"
3947 : Perform the prefixexp/installprefixexp correction if necessary
3948 cat <<EOS >installprefix
3951 cat <<'EOSC' >>installprefix
3952 : Change installation prefix, if necessary.
3953 if $test X"$prefix" != X"$installprefix"; then
3954 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3956 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3959 chmod +x installprefix
3960 $eunicefix installprefix
3962 : Set variables such as privlib and privlibexp from the output of ./getfile
3963 : performing the prefixexp/installprefixexp correction if necessary.
3964 cat <<EOS >setprefixvar
3967 cat <<'EOSC' >>setprefixvar
3968 eval "${prefixvar}=\"\$ans\""
3969 eval "${prefixvar}exp=\"\$ansexp\""
3972 chmod +x setprefixvar
3973 $eunicefix setprefixvar
3975 : set up the script used to warn in case of inconsistency
3984 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
3986 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
3987 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
3992 echo "*** WHOA THERE!!! ***" >&4
3993 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3996 rp=" Keep the $hint value?"
3999 y) td=$was; tu=$was;;
4003 : function used to set $1 to $val
4004 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4006 $define$undef) . ./whoa; eval "$var=\$td";;
4007 $undef$define) . ./whoa; eval "$var=\$tu";;
4008 *) eval "$var=$val";;
4012 $define|true|[yY]*) dflt='y';;
4017 Perl can be built to use the SOCKS proxy protocol library. To do so,
4018 Configure must be run with -Dusesocks. If you use SOCKS you also need
4019 to use the PerlIO abstraction layer, this will be implicitly selected.
4021 If this doesn't make any sense to you, just accept the default '$dflt'.
4023 rp='Build Perl for SOCKS?'
4026 y|Y) val="$define" ;;
4033 $define|true|[yY]*) useperlio="$define";;
4036 case "$useperlio" in
4037 $define|true|[yY]*|'') dflt='y';;
4042 Previous version of $package used the standard IO mechanisms as
4043 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4044 alternate IO mechanisms via the PerlIO abstraction layer, but the
4045 stdio mechanism is still available if needed. The abstraction layer
4046 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4047 Using PerlIO with sfio may cause problems with some extension modules.
4049 If this doesn't make any sense to you, just accept the default '$dflt'.
4051 rp='Use the PerlIO abstraction layer?'
4058 echo "Ok, doing things the stdio way."
4067 case "$useperlio" in
4068 $define|true|[yY]*) ;;
4071 You are using the SOCKS proxy protocol library which means that you
4072 should also use the PerlIO layer. You may be headed for trouble.
4081 : get the patchlevel
4083 echo "Getting the current patchlevel..." >&4
4084 if $test -r $rsrc/patchlevel.h;then
4085 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4086 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4087 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4088 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4089 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4090 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4091 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4100 $echo "(You do not have patchlevel.h. Eek.)"
4102 if $test -r $rsrc/.patch ; then
4103 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
4104 perl_patchlevel=`cat $rsrc/.patch`
4107 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4108 version_patchlevel_string="version $patchlevel subversion $subversion"
4109 case "$perl_patchlevel" in
4111 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
4114 $echo "(You have $package $version_patchlevel_string.)"
4118 : XXX Should be a Configure test for double-dots in filenames.
4119 version=`echo $revision $patchlevel $subversion | \
4120 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4121 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4122 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4125 version=`echo $revision $patchlevel $subversion | \
4126 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4127 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4128 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4131 : Special case the 5.005_xx maintenance series, which used 5.005
4132 : without any subversion label as a subdirectory in $sitelib
4133 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4134 api_versionstring='5.005'
4137 case "$usethreads" in
4138 $define|true|[yY]*) dflt='y';;
4139 *) # Catch case where user specified ithreads or 5005threads but
4140 # forgot -Dusethreads (A.D. 4/2002)
4141 case "$useithreads$use5005threads" in
4143 case "$useperlio" in
4144 "$define") dflt='y' ;;
4154 Perl can be built to take advantage of threads on some systems.
4155 To do so, Configure can be run with -Dusethreads.
4157 Note that Perl built with threading support runs slightly slower
4158 and uses more memory than plain Perl. The current implementation
4159 is believed to be stable, but it is fairly new, and so should be
4160 treated with caution.
4162 If this doesn't make any sense to you, just accept the default '$dflt'.
4164 rp='Build a threading Perl?'
4167 y|Y) val="$define" ;;
4173 if $test $patchlevel -lt 9; then
4174 case "$usethreads" in
4178 Since release 5.6, Perl has had two different threading implementations,
4179 the newer interpreter-based version (ithreads) with one interpreter per
4180 thread, and the older 5.005 version (5005threads).
4181 The 5005threads version is effectively unmaintained and will probably be
4182 removed in Perl 5.10, so there should be no need to build a Perl using it
4183 unless needed for backwards compatibility with some existing 5.005threads
4187 : Default to ithreads unless overridden on command line or with
4190 case "$use5005threads" in
4191 $define|true|[yY]*) dflt='n';;
4193 case "$useithreads" in
4194 $undef|false|[nN]*) dflt='n';;
4196 rp='Use the newer interpreter-based ithreads?'
4199 y|Y) val="$define" ;;
4204 : Now set use5005threads to the opposite value.
4205 case "$useithreads" in
4206 $define) val="$undef" ;;
4213 useithreads="$undef"
4214 use5005threads="$undef"
4218 case "$useithreads$use5005threads" in
4222 You cannot have both the ithreads and the 5.005 threads enabled
4223 at the same time. Disabling the 5.005 threads since they are
4224 much less stable than the ithreads.
4227 use5005threads="$undef"
4232 : perl-5.9.x and later
4234 if test X"$usethreads" = "X$define"; then
4235 case "$use5005threads" in
4239 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4246 use5005threads="$undef"
4247 useithreads="$usethreads"
4250 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4253 *** To build with ithreads you must also use the PerlIO layer.
4254 *** Cannot continue, aborting.
4260 case "$d_oldpthreads" in
4261 '') : Configure tests would be welcome here. For now, assume undef.
4263 *) val="$d_oldpthreads" ;;
4269 : Look for a hint-file generated 'call-back-unit'. If the
4270 : user has specified that a threading perl is to be built,
4271 : we may need to set or change some other defaults.
4272 if $test -f usethreads.cbu; then
4273 echo "Your platform has some specific hints regarding threaded builds, using them..."
4276 case "$usethreads" in
4277 "$define"|true|[yY]*)
4279 (Your platform does not have any specific hints for threaded builds.
4280 Assuming POSIX threads, then.)
4288 Perl can be built so that multiple Perl interpreters can coexist
4289 within the same Perl executable.
4292 case "$useithreads" in
4295 This multiple interpreter support is required for interpreter-based threads.
4299 *) case "$usemultiplicity" in
4300 $define|true|[yY]*) dflt='y';;
4304 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4305 rp='Build Perl for multiplicity?'
4308 y|Y) val="$define" ;;
4317 case "$usemorebits" in
4318 "$define"|true|[yY]*)
4319 use64bitint="$define"
4320 uselongdouble="$define"
4321 usemorebits="$define"
4323 *) usemorebits="$undef"
4327 : make some quick guesses about what we are up against
4329 $echo $n "Hmm... $c"
4339 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4340 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4342 echo "Looks kind of like an OSF/1 system, but we'll see..."
4344 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4345 xxx=`./loc addbib blurfl $pth`
4346 if $test -f $xxx; then
4347 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4351 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4352 echo "Looks kind of like an extended USG system, but we'll see..."
4354 echo "Looks kind of like a USG system, but we'll see..."
4358 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4359 echo "Looks kind of like a BSD system, but we'll see..."
4363 echo "Looks kind of like a Version 7 system, but we'll see..."
4366 case "$eunicefix" in
4369 There is, however, a strange, musty smell in the air that reminds me of
4370 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4374 : it so happens the Eunice I know will not run shell scripts in Unix format
4378 echo "Congratulations. You aren't running Eunice."
4382 : Detect OS2. The p_ variable is set above in the Head.U unit.
4383 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4384 : semicolon as a patch separator
4389 I have the feeling something is not exactly right, however...don't tell me...
4390 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4391 (Or you may be running DOS with DJGPP.)
4396 if test -f /xenix; then
4397 echo "Actually, this looks more like a XENIX system..."
4402 echo "It's not Xenix..."
4407 if test -f /venix; then
4408 echo "Actually, this looks more like a VENIX system..."
4415 echo "Nor is it Venix..."
4418 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4419 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4426 rp="Use which C compiler?"
4430 : See if they have not cc but they do have gcc
4432 : Look for a hint-file generated 'call-back-unit'. Now that the
4433 : user has specified the compiler, we may need to set or change some
4435 if $test -f cc.cbu; then
4441 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4445 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4447 printf("%s\n", __VERSION__);
4449 printf("%s\n", "1");
4455 if $cc -o try $ccflags $ldflags try.c; then
4456 gccversion=`$run ./try`
4457 case "$gccversion" in
4458 '') echo "You are not using GNU cc." ;;
4459 *) echo "You are using GNU cc $gccversion."
4465 echo "*** WHOA THERE!!! ***" >&4
4466 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4467 case "$knowitall" in
4469 echo " You'd better start hunting for one and let me know about it." >&4
4475 case "$gccversion" in
4476 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4478 case "$gccversion" in
4479 '') gccosandvers='' ;;
4480 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4481 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4483 case "$gccosandvers" in
4484 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4485 $osname$osvers) ;; # looking good
4486 $osname*) cat <<EOM >&4
4488 *** WHOA THERE!!! ***
4490 Your gcc has not been compiled for the exact release of
4491 your operating system ($gccosandvers versus $osname$osvers).
4493 In general it is a good idea to keep gcc synchronized with
4494 the operating system because otherwise serious problems
4495 may ensue when trying to compile software, like Perl.
4497 I'm trying to be optimistic here, though, and will continue.
4498 If later during the configuration and build icky compilation
4499 problems appear (headerfile conflicts being the most common
4500 manifestation), I suggest reinstalling the gcc to match
4501 your operating system release.
4505 *) gccosandvers='' ;; # failed to parse, better be silent
4513 # gcc 3.* complain about adding -Idirectories that they already know about,
4514 # so we will take those off from locincpth.
4515 case "$gccversion" in
4517 echo "main(){}">try.c
4518 for incdir in $locincpth; do
4519 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4520 grep '^c[cp]p*[01]: warning: changing search order '`
4521 if test "X$warn" != X; then
4522 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4528 : What should the include directory be ?
4530 $echo $n "Hmm... $c"
4534 if $test -f /bin/mips && /bin/mips; then
4535 echo "Looks like a MIPS system..."
4536 $cat >usr.c <<'EOCP'
4537 #ifdef SYSTYPE_BSD43
4541 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4542 dflt='/bsd43/usr/include'
4546 mips_type='System V'
4548 $rm -f usr.c usr.out
4549 echo "and you're compiling with the $mips_type compiler and libraries."
4553 echo "Doesn't look like a MIPS system."
4563 case "$xxx_prompt" in
4566 rp='Where are the include files you want to use?'
4574 : see how we invoke the C preprocessor
4576 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4577 cat <<'EOT' >testcpp.c
4583 if test ! -f cppstdin; then
4584 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4585 # AIX cc -E doesn't show the absolute headerfile
4586 # locations but we'll cheat by using the -M flag.
4587 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
4589 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4592 echo "Keeping your $hint cppstdin wrapper."
4595 wrapper=`pwd`/cppstdin
4599 if $test "X$cppstdin" != "X" && \
4600 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4601 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4603 echo "You used to use $cppstdin $cppminus so we'll use that again."
4605 '') echo "But let's see if we can live without a wrapper..." ;;
4607 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4608 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4610 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4613 echo "(However, $cpprun $cpplast does not work, let's see...)"
4621 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4628 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4629 $cc -E <testcpp.c >testcpp.out 2>&1; \
4630 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4631 echo "Yup, it does."
4634 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4635 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4636 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4637 echo "Yup, it does."
4640 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4641 $cc -P <testcpp.c >testcpp.out 2>&1; \
4642 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4643 echo "Yipee, that works!"
4646 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4647 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4648 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4649 echo "At long last!"
4652 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4653 $cpp <testcpp.c >testcpp.out 2>&1; \
4654 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4658 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4659 $cpp - <testcpp.c >testcpp.out 2>&1; \
4660 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4661 echo "Hooray, it works! I was beginning to wonder."
4664 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4665 $wrapper <testcpp.c >testcpp.out 2>&1; \
4666 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4672 rp="No dice. I can't find a C preprocessor. Name one:"
4676 $x_cpp <testcpp.c >testcpp.out 2>&1
4677 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4678 echo "OK, that will do." >&4
4680 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4695 echo "Perhaps can we force $cc -E using a wrapper..."
4696 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4697 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4703 echo "Nope, we'll have to live without it..."
4717 "$wrapper"|'cppstdin') ;;
4718 *) $rm -f $wrapper;;
4720 $rm -f testcpp.c testcpp.out
4722 : Set private lib path
4725 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4730 '') dlist="$loclibpth $plibpth $glibpth";;
4731 *) dlist="$libpth";;
4734 : Now check and see which directories actually exist, avoiding duplicates
4738 if $test -d $xxx; then
4741 *) libpth="$libpth $xxx";;
4747 Some systems have incompatible or broken versions of libraries. Among
4748 the directories listed in the question below, please remove any you
4749 know not to be holding relevant libraries, and add any that are needed.
4750 Say "none" for none.
4761 rp="Directories to use for library searches?"
4768 : compute shared library extension
4771 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4781 On some systems, shared libraries may be available. Answer 'none' if
4782 you want to suppress searching of shared libraries for the remainder
4783 of this configuration.
4786 rp='What is the file extension used for shared libraries?'
4790 : Define several unixisms.
4791 : Hints files or command line option can be used to override them.
4792 : The convoluted testing is in case hints files set either the old
4795 '') case "$exe_ext" in
4797 *) _exe="$exe_ext" ;;
4802 '') case "$lib_ext" in
4809 '') case "$obj_ext" in
4816 '') case "$path_sep" in
4827 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4829 : Which makefile gets called first. This is used by make depend.
4830 case "$firstmakefile" in
4831 '') firstmakefile='makefile';;
4835 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4838 case "$uselongdouble" in
4839 $define|true|[yY]*) dflt='y';;
4844 Perl can be built to take advantage of long doubles which
4845 (if available) may give more accuracy and range for floating point numbers.
4847 If this doesn't make any sense to you, just accept the default '$dflt'.
4849 rp='Try to use long doubles if available?'
4852 y|Y) val="$define" ;;
4858 case "$uselongdouble" in
4859 true|[yY]*) uselongdouble="$define" ;;
4862 : Look for a hint-file generated 'call-back-unit'. If the
4863 : user has specified that long doubles should be used,
4864 : we may need to set or change some other defaults.
4865 if $test -f uselongdouble.cbu; then
4866 echo "Your platform has some specific hints regarding long doubles, using them..."
4867 . ./uselongdouble.cbu
4869 case "$uselongdouble" in
4872 (Your platform does not have any specific hints for long doubles.)
4878 : Looking for optional libraries
4880 echo "Checking for optional libraries..." >&4
4885 case "$libswanted" in
4886 '') libswanted='c_s';;
4889 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4895 for thisdir in $libpth $xlibpth; do
4896 test -d $thisdir && libspath="$libspath $thisdir"
4898 for thislib in $libswanted; do
4899 for thisdir in $libspath; do
4901 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4902 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4903 $test -f "$xxx" && eval $libscheck
4904 $test -f "$xxx" && libstyle=shared
4906 if test ! -f "$xxx"; then
4907 xxx=$thisdir/lib$thislib.$so
4908 $test -f "$xxx" && eval $libscheck
4909 $test -f "$xxx" && libstyle=shared
4911 if test ! -f "$xxx"; then
4912 xxx=$thisdir/lib$thislib$_a
4913 $test -f "$xxx" && eval $libscheck
4914 $test -f "$xxx" && libstyle=static
4916 if test ! -f "$xxx"; then
4917 xxx=$thisdir/$thislib$_a
4918 $test -f "$xxx" && eval $libscheck
4919 $test -f "$xxx" && libstyle=static
4921 if test ! -f "$xxx"; then
4922 xxx=$thisdir/lib${thislib}_s$_a
4923 $test -f "$xxx" && eval $libscheck
4924 $test -f "$xxx" && libstyle=static
4925 $test -f "$xxx" && thislib=${thislib}_s
4927 if test ! -f "$xxx"; then
4928 xxx=$thisdir/Slib$thislib$_a
4929 $test -f "$xxx" && eval $libscheck
4930 $test -f "$xxx" && libstyle=static
4932 if $test -f "$xxx"; then
4934 shared) echo "Found -l$thislib (shared)." ;;
4935 static) echo "Found -l$thislib." ;;
4936 *) echo "Found -l$thislib ($libstyle)." ;;
4940 *) dflt="$dflt -l$thislib"
4941 libsfound="$libsfound $xxx"
4943 libsfiles="$libsfiles $yyy"
4944 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4945 case " $libsdirs " in
4947 *) libsdirs="$libsdirs $yyy" ;;
4954 if $test ! -f "$xxx"; then
4955 echo "No -l$thislib."
4966 ' '|'') dflt='none';;
4971 In order to compile $package on your machine, a number of libraries
4972 are usually needed. Include any other special libraries here as well.
4973 Say "none" for none. The default list is almost always right.
4977 rp="What libraries to use?"
4984 : determine optimization, if desired, or use for debug flag also
4986 ' '|$undef) dflt='none';;
4988 *) dflt="$optimize";;
4992 By default, $package compiles with the -O flag to use the optimizer.
4993 Alternately, you might want to use the symbolic debugger, which uses
4994 the -g flag (on traditional Unix systems). Either flag can be
4995 specified here. To use neither flag, specify the word "none".
4998 rp="What optimizer/debugger flag should be used?"
5002 'none') optimize=" ";;
5005 : Check what DEBUGGING is required from the command line
5006 : -DEBUGGING or -DDEBUGGING or
5007 : -DEBUGGING=both = -g + -DDEBUGGING
5008 : -DEBUGGING=-g or -Doptimize=-g = -g
5009 : -DEBUGGING=none or -UDEBUGGING =
5010 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5013 *) DEBUGGING=$EBUGGING ;;
5016 case "$DEBUGGING" in
5020 *) optimize="$optimize -g" ;;
5024 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5032 case "$DEBUGGING" in
5033 both|$define) dflt='-DDEBUGGING'
5036 : We will not override a previous value, but we might want to
5037 : augment a hint file
5039 default|recommended)
5040 case "$gccversion" in
5041 1*) dflt="$dflt -fpcc-struct-return" ;;
5043 case "$optimize:$DEBUGGING" in
5044 *-g*:old) dflt="$dflt -DDEBUGGING";;
5046 case "$gccversion" in
5047 2*) if test -d /etc/conf/kconfig.d &&
5048 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5050 # Interactive Systems (ISC) POSIX mode.
5055 case "$gccversion" in
5059 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
5060 echo 'int main(void) { return 0; }' > gcctest.c
5061 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
5062 echo "Yes, it does." 2>&1
5065 echo "Leaving current flags $ccflags alone." 2>&1
5067 *) dflt="$dflt -fno-strict-aliasing" ;;
5070 echo "Nope, it doesn't, but that's ok." 2>&1
5074 # For gcc, adding -pipe speeds up compilations for some, but apparently
5075 # some assemblers can't read from stdin. (It also slows down compilations
5076 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5077 case "$gccversion" in
5079 echo "Checking if your compiler accepts -pipe" 2>&1
5080 echo 'int main(void) { return 0; }' > gcctest.c
5081 if $cc -pipe -o gcctest gcctest.c; then
5082 echo "Yes, it does." 2>&1
5085 echo "Leaving current flags $ccflags alone." 2>&1
5087 *) dflt="$dflt -pipe" ;;
5090 echo "Nope, it doesn't, but that's ok." 2>&1
5097 case "$mips_type" in
5098 *BSD*|'') inclwanted="$locincpth $usrinc";;
5099 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5101 for thisincl in $inclwanted; do
5102 if $test -d $thisincl; then
5103 if $test x$thisincl != x$usrinc; then
5105 *" -I$thisincl "*);;
5106 *) dflt="$dflt -I$thisincl ";;
5112 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5114 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5122 *) dflt="$dflt -D$2";;
5126 set signal.h LANGUAGE_C; eval $inctest
5130 ccflags="$ccflags -DSOCKS"
5135 default|recommended) dflt="$ccflags $dflt" ;;
5136 *) dflt="$ccflags";;
5145 Your C compiler may want other flags. For this question you should include
5146 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5147 but you should NOT include libraries or ld flags like -lwhatever. If you
5148 want $package to honor its debug switch, you should include -DDEBUGGING here.
5149 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5151 To use no flags, specify the word "none".
5157 rp="Any additional cc flags?"
5164 : the following weeds options from ccflags that are of no interest to cpp
5166 '') cppflags="$ccflags" ;;
5167 *) cppflags="$cppflags $ccflags" ;;
5169 case "$gccversion" in
5170 1*) cppflags="$cppflags -D__GNUC__"
5172 case "$mips_type" in
5174 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5180 echo "Let me guess what the preprocessor flags are..." >&4
5194 *) ftry="$previous $flag";;
5196 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5197 >cpp1.out 2>/dev/null && \
5198 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5199 >cpp2.out 2>/dev/null && \
5200 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5201 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5203 cppflags="$cppflags $ftry"
5213 *-*) echo "They appear to be: $cppflags";;
5215 $rm -f cpp.c cpp?.out
5219 : flags used in final linking phase
5221 '') if ./venix; then
5227 *-posix*) dflt="$dflt -posix" ;;
5230 *) dflt="$ldflags";;
5233 : Try to guess additional flags to pick up local libraries.
5234 for thislibdir in $libpth; do
5235 case " $loclibpth " in
5238 *"-L$thislibdir "*) ;;
5239 *) dflt="$dflt -L$thislibdir" ;;
5251 Your C linker may need flags. For this question you should
5252 include -L/whatever and any other flags used by the C linker, but you
5253 should NOT include libraries like -lwhatever.
5255 Make sure you include the appropriate -L/path flags if your C linker
5256 does not normally search all of the directories you specified above,
5259 To use no flags, specify the word "none".
5263 rp="Any additional ld flags (NOT including libraries)?"
5269 rmlist="$rmlist pdp11"
5273 echo "Checking your choice of C compiler and flags for coherency..." >&4
5274 $cat > try.c <<'EOF'
5276 int main() { printf("Ok\n"); return(0); }
5278 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5280 $cat >try.msg <<'EOM'
5281 I've tried to compile and run the following simple program:
5284 $cat try.c >> try.msg
5286 $cat >> try.msg <<EOM
5293 and I got the following output:
5297 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5298 if $sh -c "$run ./try" >>try.msg 2>&1; then
5302 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5305 cat >> try.msg <<'EOQS'
5306 If $libs contains -lsfio, and sfio is mis-configured, then it
5307 sometimes (apparently) runs and exits with a 0 status, but with no
5308 output! It may have to do with sfio's use of _exit vs. exit.
5311 rp="You have a big problem. Shall I abort Configure"
5318 echo "The program compiled OK, but exited with status $?." >>try.msg
5319 rp="You have a problem. Shall I abort Configure"
5323 echo "I can't compile the test program." >>try.msg
5324 rp="You have a BIG problem. Shall I abort Configure"
5330 case "$knowitall" in
5332 echo "(The supplied flags or libraries might be incorrect.)"
5340 *) echo "Ok. Stopping Configure." >&4
5345 n) echo "OK, that should do.";;
5349 : define a shorthand compile call
5353 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5354 : define a shorthand compile call for compilations that should be ok.
5358 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5360 : determine filename position in cpp output
5362 echo "Computing filename position in cpp output for #include directives..." >&4
5364 vos) testaccess=-e ;;
5367 echo '#include <stdio.h>' > foo.c
5370 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5371 $grep '^[ ]*#.*stdio\.h' | \
5372 while read cline; do
5375 while $test \$# -gt 0; do
5376 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5381 pos=\`expr \$pos + 1\`
5393 *) pos="${fieldn}th";;
5395 echo "Your cpp writes the filename in the $pos field of the line."
5398 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5399 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5402 : locate header file
5407 for usrincdir in $usrinc
5409 if test -f \$usrincdir/\$wanted; then
5410 echo "\$usrincdir/\$wanted"
5414 awkprg='{ print \$$fieldn }'
5415 echo "#include <\$wanted>" > foo\$\$.c
5416 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5417 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5418 while read cline; do
5419 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5421 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5422 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5427 # status = 0: grep returned 0 lines, case statement not executed
5428 # status = 1: headerfile found
5429 # status = 2: while loop executed, no headerfile found
5433 if test \$status -eq 1; then
5440 : define an alternate in-header-list? function
5441 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5442 cont=true; xxf="echo \"<\$1> found.\" >&4";
5443 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5444 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5446 case $# in 4) instead=instead;; *) instead="at last";; esac;
5447 while $test "$cont"; do
5449 var=$2; eval "was=\$$2";
5450 if $test "$xxx" && $test -r "$xxx";
5452 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5455 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5456 set $yyy; shift; shift; yyy=$@;
5457 case $# in 0) cont="";;
5458 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5459 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5460 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5461 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5465 do set $yyy; var=$2; eval "was=\$$2";
5466 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5467 set $yyy; shift; shift; yyy=$@;
5470 : see if stdlib is available
5471 set stdlib.h i_stdlib
5474 : check for lengths of integral types
5478 echo "Checking to see how big your integers are..." >&4
5487 printf("intsize=%d;\n", (int)sizeof(int));
5488 printf("longsize=%d;\n", (int)sizeof(long));
5489 printf("shortsize=%d;\n", (int)sizeof(short));
5494 if eval $compile_ok && $run ./try > /dev/null; then
5496 echo "Your integers are $intsize bytes long."
5497 echo "Your long integers are $longsize bytes long."
5498 echo "Your short integers are $shortsize bytes long."
5502 Help! I can't compile and run the intsize test program: please enlighten me!
5503 (This is probably a misconfiguration in your system or libraries, and
5504 you really ought to fix it. Still, I'll try anyway.)
5508 rp="What is the size of an integer (in bytes)?"
5512 rp="What is the size of a long integer (in bytes)?"
5516 rp="What is the size of a short integer (in bytes)?"
5524 : check for long long
5526 echo "Checking to see if you have long long..." >&4
5527 echo 'int main() { long long x = 7; return 0; }' > try.c
5529 if eval $compile; then
5531 echo "You have long long."
5534 echo "You do not have long long."
5540 : check for length of long long
5541 case "${d_longlong}${longlongsize}" in
5544 echo "Checking to see how big your long longs are..." >&4
5545 $cat >try.c <<'EOCP'
5549 printf("%d\n", (int)sizeof(long long));
5554 if eval $compile_ok; then
5555 longlongsize=`$run ./try`
5556 echo "Your long longs are $longlongsize bytes long."
5560 echo "(I can't seem to compile the test program. Guessing...)"
5561 rp="What is the size of a long long (in bytes)?"
5565 if $test "X$longsize" = "X$longlongsize"; then
5566 echo "(That isn't any different from an ordinary long.)"
5572 : see if inttypes.h is available
5573 : we want a real compile instead of Inhdr because some systems
5574 : have an inttypes.h which includes non-existent headers
5577 #include <inttypes.h>
5579 static int32_t foo32 = 0x12345678;
5583 if eval $compile; then
5584 echo "<inttypes.h> found." >&4
5587 echo "<inttypes.h> NOT found." >&4
5596 echo "Checking to see if you have int64_t..." >&4
5598 #include <sys/types.h>
5599 #$i_inttypes I_INTTYPES
5601 #include <inttypes.h>
5603 int main() { int64_t x = 7; }
5606 if eval $compile; then
5608 echo "You have int64_t."
5611 echo "You do not have int64_t."
5619 echo "Checking which 64-bit integer type we could use..." >&4
5625 val='"unsigned int"'
5630 *) case "$longsize" in
5634 val='"unsigned long"'
5639 *) case "$d_longlong:$longlongsize" in
5644 val='"unsigned long long"'
5649 *) case "$d_int64_t" in
5668 '') echo "Alas, no 64-bit integer types in sight." >&4
5671 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5677 case "$uselonglong" in
5678 "$define"|true|[yY]*)
5681 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5683 use64bitint="$define"
5686 case "$use64bits" in
5687 "$define"|true|[yY]*)
5690 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5692 use64bitint="$define"
5695 case "$use64bitints" in
5696 "$define"|true|[yY]*)
5699 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5701 use64bitint="$define"
5704 case "$use64bitsint" in
5705 "$define"|true|[yY]*)
5708 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5710 use64bitint="$define"
5713 case "$uselonglongs" in
5714 "$define"|true|[yY]*)
5717 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5719 use64bitint="$define"
5722 case "$use64bitsall" in
5723 "$define"|true|[yY]*)
5726 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5728 use64bitall="$define"
5733 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5735 case "$use64bitall" in
5736 "$define"|true|[yY]*) use64bitint="$define" ;;
5742 You have natively 64-bit long integers.
5746 *) case "$use64bitint" in
5747 "$define"|true|[yY]*) dflt='y';;
5756 Perl can be built to take advantage of 64-bit integer types
5757 on some systems. To do so, Configure can be run with -Duse64bitint.
5758 Choosing this option will most probably introduce binary incompatibilities.
5760 If this doesn't make any sense to you, just accept the default '$dflt'.
5761 (The default has been chosen based on your configuration.)
5763 rp='Try to use 64-bit integers, if available?'
5766 [yY]*) val="$define" ;;
5774 case "$use64bitall" in
5775 "$define"|true|[yY]*) dflt='y' ;;
5776 *) case "$longsize" in
5784 You may also choose to try maximal 64-bitness. It means using as much
5785 64-bitness as possible on the platform. This in turn means even more
5786 binary incompatibilities. On the other hand, your platform may not
5787 have any more 64-bitness available than what you already have chosen.
5789 If this doesn't make any sense to you, just accept the default '$dflt'.
5790 (The default has been chosen based on your configuration.)
5792 rp='Try to use maximal 64-bit support, if available?'
5795 [yY]*) val="$define" ;;
5800 case "$use64bitall" in
5802 case "$use64bitint" in
5806 Since you have chosen a maximally 64-bit build, I'm also turning on
5807 the use of 64-bit integers.
5809 use64bitint="$define" ;;
5814 : Look for a hint-file generated 'call-back-unit'. If the
5815 : user has specified that a 64-bit perl is to be built,
5816 : we may need to set or change some other defaults.
5817 if $test -f use64bitint.cbu; then
5818 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5821 case "$use64bitint" in
5822 "$define"|true|[yY]*)
5824 4) case "$archname64" in
5825 '') archname64=64int ;;
5832 : Look for a hint-file generated 'call-back-unit'. If the
5833 : user has specified that a maximally 64-bit perl is to be built,
5834 : we may need to set or change some other defaults.
5835 if $test -f use64bitall.cbu; then
5836 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5839 case "$use64bitall" in
5840 "$define"|true|[yY]*)
5842 4) case "$archname64" in
5843 ''|64int) archname64=64all ;;
5850 case "$d_quad:$use64bitint" in
5854 *** You have chosen to use 64-bit integers,
5855 *** but none can be found.
5856 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5857 *** Cannot continue, aborting.
5864 : check for length of double
5866 case "$doublesize" in
5868 echo "Checking to see how big your double precision numbers are..." >&4
5877 printf("%d\n", (int)sizeof(double));
5882 if eval $compile_ok; then
5883 doublesize=`$run ./try`
5884 echo "Your double is $doublesize bytes long."
5887 echo "(I can't seem to compile the test program. Guessing...)"
5888 rp="What is the size of a double precision number (in bytes)?"
5896 : check for long doubles
5898 echo "Checking to see if you have long double..." >&4
5899 echo 'int main() { long double x = 7.0; }' > try.c
5901 if eval $compile; then
5903 echo "You have long double."
5906 echo "You do not have long double."
5912 : check for length of long double
5913 case "${d_longdbl}${longdblsize}" in
5916 echo "Checking to see how big your long doubles are..." >&4
5917 $cat >try.c <<'EOCP'
5921 printf("%d\n", sizeof(long double));
5926 if eval $compile; then
5927 longdblsize=`$run ./try`
5928 echo "Your long doubles are $longdblsize bytes long."
5932 echo "(I can't seem to compile the test program. Guessing...)" >&4
5933 rp="What is the size of a long double (in bytes)?"
5937 if $test "X$doublesize" = "X$longdblsize"; then
5938 echo "That isn't any different from an ordinary double."
5939 echo "I'll keep your setting anyway, but you may see some"
5940 echo "harmless compilation warnings."
5946 : determine the architecture name
5948 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5949 tarch=`arch`"-$osname"
5950 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5951 if uname -m > tmparch 2>&1 ; then
5952 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5953 -e 's/$/'"-$osname/" tmparch`
5961 case "$myarchname" in
5964 echo "(Your architecture name used to be $myarchname.)"
5968 case "$targetarch" in
5970 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5975 *) dflt="$archname";;
5977 rp='What is your architecture name'
5980 case "$usethreads" in
5982 echo "Threads selected." >&4
5984 *-thread*) echo "...and architecture name already has -thread." >&4
5986 *) archname="$archname-thread"
5987 echo "...setting architecture name to $archname." >&4
5992 case "$usemultiplicity" in
5994 echo "Multiplicity selected." >&4
5996 *-multi*) echo "...and architecture name already has -multi." >&4
5998 *) archname="$archname-multi"
5999 echo "...setting architecture name to $archname." >&4
6004 case "$use64bitint$use64bitall" in
6006 case "$archname64" in
6008 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6011 case "$use64bitint" in
6012 "$define") echo "64 bit integers selected." >&4 ;;
6014 case "$use64bitall" in
6015 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6018 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6020 *) archname="$archname-$archname64"
6021 echo "...setting architecture name to $archname." >&4
6027 case "$uselongdouble" in
6029 echo "Long doubles selected." >&4
6030 case "$longdblsize" in
6032 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6036 *-ld*) echo "...and architecture name already has -ld." >&4
6038 *) archname="$archname-ld"
6039 echo "...setting architecture name to $archname." >&4
6046 case "$useperlio" in
6048 echo "Perlio selected." >&4
6051 echo "Perlio not selected, using stdio." >&4
6053 *-stdio*) echo "...and architecture name already has -stdio." >&4
6055 *) archname="$archname-stdio"
6056 echo "...setting architecture name to $archname." >&4
6061 if $test -f archname.cbu; then
6062 echo "Your platform has some specific hints for architecture name, using them..."
6066 : set the prefixit variable, to compute a suitable default value
6067 prefixit='case "$3" in
6069 case "$oldprefix" in
6070 "") eval "$1=\"\$$2\"";;
6077 ""|" ") eval "$1=\"\$$2\"";;
6083 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6085 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6086 /*-$oldprefix/*|\~*-$oldprefix/*)
6087 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6088 *) eval "$1=\"\$$2\"";;
6092 : determine installation style
6093 : For now, try to deduce it from prefix unless it is already set.
6094 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6095 case "$installstyle" in
6096 '') case "$prefix" in
6097 *perl*) dflt='lib';;
6098 *) dflt='lib/perl5' ;;
6101 *) dflt="$installstyle" ;;
6103 : Probably not worth prompting for this since we prompt for all
6104 : the directories individually, and the prompt would be too long and
6108 : determine where public executables go
6113 rp='Pathname where the public executables will reside?'
6115 if $test "X$ansexp" != "X$binexp"; then
6119 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6120 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6121 : this via initialinstalllocation
6124 case "$userelocatableinc" in
6125 $define|true|[yY]*) dflt='y' ;;
6130 Would you like to build Perl so that the installation is relocatable, so that
6131 library paths in @INC are determined relative to the path of the perl binary?
6132 This is not advised for system Perl installs, or if you need to run setid
6133 scripts or scripts under taint mode.
6135 If this doesn't make any sense to you, just accept the default '$dflt'.
6137 rp='Use relocatable @INC?'
6140 y|Y) val="$define" ;;
6143 set userelocatableinc
6146 initialinstalllocation="$binexp"
6147 : Default prefix is now "up one level from where the binaries are"
6148 case "$userelocatableinc" in
6154 installprefixexp=".../.."
6158 : determine where private library files go
6159 : Usual default is /usr/local/lib/perl5/$version.
6160 : Also allow things like /opt/perl/lib/$version, since
6161 : /opt/perl/lib/perl5... would be redundant.
6162 : The default "style" setting is made in installstyle.U
6163 case "$installstyle" in
6164 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6165 *) set dflt privlib lib/$version ;;
6170 There are some auxiliary files for $package that need to be put into a
6171 private library directory that is accessible by everyone.
6176 rp='Pathname where the private library files will reside?'
6181 : set the prefixup variable, to restore leading tilda escape
6182 prefixup='case "$prefixexp" in
6184 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6187 : determine where public architecture dependent libraries go
6190 : privlib default is /usr/local/lib/$package/$version
6191 : archlib default is /usr/local/lib/$package/$version/$archname
6192 : privlib may have an optional trailing /share.
6193 tdflt=`echo $privlib | $sed 's,/share$,,'`
6194 tdflt=$tdflt/$archname
6203 $spackage contains architecture-dependent library files. If you are
6204 sharing libraries in a heterogeneous environment, you might store
6205 these files in a separate location. Otherwise, you can just include
6206 them with the rest of the public library files.
6211 rp='Where do you want to put the public architecture-dependent libraries?'
6215 if $test X"$archlib" = X"$privlib"; then
6221 : see if setuid scripts can be secure
6224 Some kernels have a bug that prevents setuid #! scripts from being
6225 secure. Some sites have disabled setuid #! scripts because of this.
6227 First let's decide if your kernel supports secure setuid #! scripts.
6228 (If setuid #! scripts would be secure but have been disabled anyway,
6229 don't say that they are secure if asked.)
6234 if $test -d /dev/fd; then
6235 echo "#!$ls" >reflect
6236 chmod +x,u+s reflect
6237 ./reflect >flect 2>&1
6238 if $contains "/dev/fd" flect >/dev/null; then
6239 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6243 If you are not sure if they are secure, I can check but I'll need a
6244 username and password different from the one you are using right now.
6245 If you don't have such a username or don't want me to test, simply
6249 rp='Other username to test security of setuid scripts with?'
6254 case "$d_suidsafe" in
6255 '') echo "I'll assume setuid scripts are *not* secure." >&4
6258 echo "Well, the $hint value is *not* secure." >&4
6260 *) echo "Well, the $hint value *is* secure." >&4
6265 $rm -f reflect flect
6266 echo "#!$ls" >reflect
6267 chmod +x,u+s reflect
6270 echo '"su" will (probably) prompt you for '"$ans's password."
6271 su $ans -c './reflect >flect'
6272 if $contains "/dev/fd" flect >/dev/null; then
6273 echo "Okay, it looks like setuid scripts are secure." >&4
6276 echo "I don't think setuid scripts are secure." >&4
6281 rp='Does your kernel have *secure* setuid scripts?'
6284 [yY]*) val="$define";;
6289 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6290 echo "(That's for file descriptors, not floppy disks.)"
6296 $rm -f reflect flect
6298 : now see if they want to do setuid emulation
6301 case "$d_suidsafe" in
6304 echo "No need to emulate SUID scripts since they are secure here." >&4
6308 Some systems have disabled setuid scripts, especially systems where
6309 setuid scripts cannot be secure. On systems where setuid scripts have
6310 been disabled, the setuid/setgid bits on scripts are currently
6311 useless. It is possible for $package to detect those bits and emulate
6312 setuid/setgid in a secure fashion. This emulation will only work if
6313 setuid scripts have been disabled in your kernel.
6317 "$define") dflt=y ;;
6320 rp="Do you want to do setuid/setgid emulation?"
6323 [yY]*) val="$define";;
6331 : Find perl5.005 or later.
6332 echo "Looking for a previously installed perl5.005 or later... "
6334 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6335 : Check if this perl is recent and can load a simple module
6336 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6339 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6349 '') echo "None found. That's ok.";;
6350 *) echo "Using $perl5." ;;
6355 After $package is installed, you may wish to install various
6356 add-on modules and utilities. Typically, these add-ons will
6357 be installed under $prefix with the rest
6358 of this package. However, you may wish to install such add-ons
6359 elsewhere under a different prefix.
6361 If you do not wish to put everything under a single prefix, that's
6362 ok. You will be prompted for the individual locations; this siteprefix
6363 is only used to suggest the defaults.
6365 The default should be fine for most people.
6369 rp='Installation prefix to use for add-on modules and utilities?'
6370 : XXX Here might be another good place for an installstyle setting.
6371 case "$siteprefix" in
6373 *) dflt=$siteprefix ;;
6376 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6378 case "$siteprefix" in
6382 *) oldsiteprefix="$prefix";;
6387 siteprefixexp="$ansexp"
6389 : determine where site specific libraries go.
6390 : Usual default is /usr/local/lib/perl5/site_perl/$version
6391 : The default "style" setting is made in installstyle.U
6392 : XXX No longer works with Prefixit stuff.
6393 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6395 '') case "$installstyle" in
6396 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6397 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6405 The installation process will create a directory for
6406 site-specific extensions and modules. Most users find it convenient
6407 to place all site-specific files in this directory rather than in the
6408 main distribution directory.
6412 rp='Pathname for the site-specific library files?'
6416 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6418 : Determine list of previous versions to include in @INC
6419 $cat > getverlist <<EOPL
6422 \$api_versionstring = "$api_versionstring";
6423 \$version = "$version";
6424 \$stem = "$sitelib_stem";
6425 \$archname = "$archname";
6427 $cat >> getverlist <<'EOPL'
6428 # The list found is store twice for each entry: the original name, and
6429 # the binary broken down version as pack "sss", so sorting is easy and
6430 # unambiguous. This will work for all versions that have a maximum of
6431 # three digit groups, separate by '.'s or '_'s. Names are extended with
6432 # ".0.0" to ensure at least three elements for the pack.
6433 # -- H.Merijn Brand (m)'06 23-10-2006
6435 # Can't have leading @ because metaconfig interprets it as a command!
6436 ;@inc_version_list=();
6437 # XXX Redo to do opendir/readdir?
6440 ;@candidates = map {
6441 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6447 ($pversion, $aversion, $vsn5005) = map {
6448 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6449 foreach $d (@candidates) {
6450 if ($d->[1] lt $pversion) {
6451 if ($d->[1] ge $aversion) {
6452 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6454 elsif ($d->[1] ge $vsn5005) {
6455 unshift(@inc_version_list, grep { -d } $d->[0]);
6459 # Skip newer version. I.e. don't look in
6460 # 5.7.0 if we're installing 5.6.1.
6464 if (@inc_version_list) {
6465 print join(' ', @inc_version_list);
6468 # Blank space to preserve value for next Configure run.
6473 case "$inc_version_list" in
6474 '') if test -x "$perl5$exe_ext"; then
6475 dflt=`$perl5 getverlist`
6480 $undef) dflt='none' ;;
6481 *) eval dflt=\"$inc_version_list\" ;;
6484 ''|' ') dflt=none ;;
6491 In order to ease the process of upgrading, this version of perl
6492 can be configured to use modules built and installed with earlier
6493 versions of perl that were installed under $prefix. Specify here
6494 the list of earlier versions that this version of perl should check.
6495 If Configure detected no earlier versions of perl installed under
6496 $prefix, then the list will be empty. Answer 'none' to tell perl
6497 to not search earlier versions.
6499 The default should almost always be sensible, so if you're not sure,
6500 just accept the default.
6503 rp='List of earlier versions to include in @INC?'
6506 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6507 *) inc_version_list="$ans" ;;
6509 case "$inc_version_list" in
6511 inc_version_list_init='0'
6512 d_inc_version_list="$undef"
6514 *) inc_version_list_init=`echo $inc_version_list |
6515 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6516 d_inc_version_list="$define"
6521 : see if this is a malloc.h system
6522 : we want a real compile instead of Inhdr because some systems have a
6523 : malloc.h that just gives a compile error saying to use stdlib.h instead
6528 int main () { return 0; }
6531 if eval $compile; then
6532 echo "<malloc.h> found." >&4
6535 echo "<malloc.h> NOT found." >&4
6542 : check for void type
6544 echo "Checking to see how well your C compiler groks the void type..." >&4
6545 case "$voidflags" in
6557 extern void moo(); /* function returning void */
6558 void (*goo)(); /* ptr to func returning void */
6560 void *hue; /* generic ptr */
6573 int main() { sub(); }
6575 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6576 voidflags=$defvoidused
6577 echo "Good. It appears to support void to the level $package wants.">&4
6578 if $contains warning .out >/dev/null 2>&1; then
6579 echo "However, you might get some warnings that look like this:"
6583 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6584 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6585 echo "It supports 1..."
6586 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6587 echo "It also supports 2..."
6588 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6590 echo "And it supports 4 but not 8 definitely."
6592 echo "It doesn't support 4..."
6593 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6595 echo "But it supports 8."
6598 echo "Neither does it support 8."
6602 echo "It does not support 2..."
6603 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6605 echo "But it supports 4 and 8."
6607 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6609 echo "And it supports 4 but has not heard about 8."
6611 echo "However it supports 8 but not 4."
6616 echo "There is no support at all for void."
6621 case "$voidflags" in
6624 Support flag bits are:
6625 1: basic void declarations.
6626 2: arrays of pointers to functions returning void.
6627 4: operations between pointers to and addresses of void functions.
6628 8: generic void pointers.
6631 rp="Your void support flags add up to what?"
6638 : check for length of pointer
6642 echo "Checking to see how big your pointers are..." >&4
6643 if test "$voidflags" -gt 7; then
6644 echo '#define VOID_PTR char *' > try.c
6646 echo '#define VOID_PTR void *' > try.c
6656 printf("%d\n", (int)sizeof(VOID_PTR));
6661 if eval $compile_ok; then
6662 ptrsize=`$run ./try`
6663 echo "Your pointers are $ptrsize bytes long."
6666 echo "(I can't seem to compile the test program. Guessing...)" >&4
6667 rp="What is the size of a pointer (in bytes)?"
6674 case "$use64bitall" in
6675 "$define"|true|[yY]*)
6679 *** You have chosen a maximally 64-bit build,
6680 *** but your pointers are only 4 bytes wide.
6681 *** Please rerun Configure without -Duse64bitall.
6686 *** Since you have quads, you could possibly try with -Duse64bitint.
6691 *** Cannot continue, aborting.
6702 : determine whether to use malloc wrapping
6704 case "$usemallocwrap" in
6705 [yY]*|true|$define) dflt='y' ;;
6706 [nN]*|false|$undef) dflt='n' ;;
6707 *) case "$usedevel" in
6708 [yY]*|true|$define) dflt='y' ;;
6713 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6715 usemallocwrap="$ans"
6718 usemallocwrap="$define" ;;
6720 usemallocwrap="$undef" ;;
6723 : determine which malloc to compile in
6725 case "$usemymalloc" in
6726 [yY]*|true|$define) dflt='y' ;;
6727 [nN]*|false|$undef) dflt='n' ;;
6728 *) case "$ptrsize" in
6734 rp="Do you wish to attempt to use the malloc that comes with $package?"
6740 mallocsrc='malloc.c'
6741 mallocobj="malloc$_o"
6742 d_mymalloc="$define"
6745 : Remove malloc from list of libraries to use
6746 echo "Removing unneeded -lmalloc from library list" >&4
6747 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6750 echo "libs = $libs" >&4
6762 : compute the return types of malloc and free
6764 $cat >malloc.c <<END
6768 #include <sys/types.h>
6782 case "$malloctype" in
6784 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6791 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6795 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6802 echo "Your system uses $freetype free(), it would seem." >&4
6804 : determine where site specific architecture-dependent libraries go.
6805 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6806 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6807 : sitelib may have an optional trailing /share.
6809 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6810 dflt="$dflt/$archname"
6815 set sitearch sitearch none
6819 The installation process will also create a directory for
6820 architecture-dependent site-specific extensions and modules.
6824 rp='Pathname for the site-specific architecture-dependent library files?'
6828 if $test X"$sitearch" = X"$sitelib"; then
6831 d_sitearch="$define"
6836 The installation process will also create a directory for
6837 vendor-supplied add-ons. Vendors who supply perl with their system
6838 may find it convenient to place all vendor-supplied files in this
6839 directory rather than in the main distribution directory. This will
6840 ease upgrades between binary-compatible maintenance versions of perl.
6842 Of course you may also use these directories in whatever way you see
6843 fit. For example, you might use them to access modules shared over a
6844 company-wide network.
6846 The default answer should be fine for most people.
6847 This causes further questions about vendor add-ons to be skipped
6848 and no vendor-specific directories will be configured for perl.
6851 rp='Do you want to configure vendor-specific add-on directories?'
6852 case "$usevendorprefix" in
6853 define|true|[yY]*) dflt=y ;;
6854 *) : User may have set vendorprefix directly on Configure command line.
6855 case "$vendorprefix" in
6864 rp='Installation prefix to use for vendor-supplied add-ons?'
6865 case "$vendorprefix" in
6867 *) dflt=$vendorprefix ;;
6870 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6872 case "$vendorprefix" in
6876 *) oldvendorprefix="$prefix";;
6880 usevendorprefix="$define"
6882 vendorprefixexp="$ansexp"
6884 *) usevendorprefix="$undef"
6890 case "$vendorprefix" in
6891 '') d_vendorlib="$undef"
6895 *) d_vendorlib="$define"
6896 : determine where vendor-supplied modules go.
6897 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6898 case "$vendorlib" in
6900 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6901 case "$installstyle" in
6902 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6903 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6906 *) dflt="$vendorlib"
6910 rp='Pathname for the vendor-supplied library files?'
6913 vendorlibexp="$ansexp"
6916 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6920 case "$vendorprefix" in
6921 '') d_vendorarch="$undef"
6925 *) d_vendorarch="$define"
6926 : determine where vendor-supplied architecture-dependent libraries go.
6927 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6928 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6929 : vendorlib may have an optional trailing /share.
6930 case "$vendorarch" in
6931 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6932 dflt="$dflt/$archname"
6934 *) dflt="$vendorarch" ;;
6937 rp='Pathname for vendor-supplied architecture-dependent files?'
6940 vendorarchexp="$ansexp"
6943 prefixvar=vendorarch
6946 : Final catch-all directories to search
6949 Lastly, you can have perl look in other directories for extensions and
6950 modules in addition to those already specified.
6951 These directories will be searched after
6955 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6956 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6958 case "$otherlibdirs" in
6959 ''|' ') dflt='none' ;;
6960 *) dflt="$otherlibdirs" ;;
6963 Enter a colon-separated set of extra paths to include in perl's @INC
6964 search path, or enter 'none' for no extra paths.
6968 rp='Colon-separated list of additional directories for perl to search?'
6971 ' '|''|none) otherlibdirs=' ' ;;
6972 *) otherlibdirs="$ans" ;;
6974 case "$otherlibdirs" in
6978 set d_perl_otherlibdirs
6981 : Cruising for prototypes
6983 echo "Checking out function prototypes..." >&4
6984 $cat >prototype.c <<EOCP
6989 int main(int argc, char *argv[]) {
6992 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6993 echo "Your C compiler appears to support function prototypes."
6996 echo "Your C compiler doesn't seem to understand function prototypes."
7003 case "$prototype" in
7005 *) ansi2knr='ansi2knr'
7010 This version of $package can only be compiled by a compiler that
7011 understands function prototypes. Unfortunately, your C compiler
7013 doesn't seem to understand them. Sorry about that.
7015 If GNU cc is available for your system, perhaps you could try that instead.
7017 Eventually, we hope to support building Perl with pre-ANSI compilers.
7018 If you would like to help in that effort, please contact <perlbug@perl.org>.
7020 Aborting Configure now.
7032 Perl can be built with extra modules or bundles of modules which
7033 will be fetched from the CPAN and installed alongside Perl.
7035 Notice that you will need access to the CPAN; either via the Internet,
7036 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7037 be asked later to configure the CPAN.pm module which will in turn do
7038 the installation of the rest of the extra modules or bundles.)
7040 Notice also that if the modules require any external software such as
7041 libraries and headers (the libz library and the zlib.h header for the
7042 Compress::Zlib module, for example) you MUST have any such software
7043 already installed, this configuration process will NOT install such
7046 If this doesn't make any sense to you, just accept the default '$dflt'.
7048 rp='Install any extra modules (y or n)?'
7054 Please list any extra modules or bundles to be installed from CPAN,
7055 with spaces between the names. The names can be in any format the
7056 'install' command of CPAN.pm will understand. (Answer 'none',
7057 without the quotes, to install no extra modules or bundles.)
7067 $rm -f ../extras.lst
7069 *) echo "(Saving the list of extras for later...)"
7070 echo "$extras" > ../extras.lst
7078 : determine where html pages for programs go
7079 set html1dir html1dir none
7083 If you wish to install html files for programs in $spackage, indicate
7084 the appropriate directory here. To skip installing html files,
7088 ''|none|$undef|' ') dflt=none ;;
7089 *) dflt=$html1dir ;;
7092 rp="Directory for the main $spackage html pages?"
7096 : Use ' ' for none so value is preserved next time through Configure
7097 $test X"$html1dir" = "X" && html1dir=' '
7099 : determine where html pages for libraries and modules go
7100 set html3dir html3dir none
7104 If you wish to install html files for modules associated with $spackage,
7105 indicate the appropriate directory here. To skip installing html files,
7108 : There is no obvious default. If they have specified html1dir, then
7109 : try to key off that, possibly changing .../html1 into .../html3.
7111 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7112 *) dflt=$html3dir ;;
7115 rp="Directory for the $spackage module html pages?"
7119 : Use ' ' for none so value is preserved next time through Configure
7120 $test X"$html3dir" = "X" && html3dir=' '
7122 : determine whether to install perl also as /usr/bin/perl
7125 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7127 Many scripts expect perl to be installed as /usr/bin/perl.
7129 If you want to, I can install the perl you are about to compile
7130 as /usr/bin/perl (in addition to $bin/perl).
7132 if test -f /usr/bin/perl; then
7135 However, please note that because you already have a /usr/bin/perl,
7136 overwriting that with a new Perl would very probably cause problems.
7137 Therefore I'm assuming you don't want to do that (unless you insist).
7140 case "$installusrbinperl" in
7141 "$define"|[yY]*) dflt='y';;
7147 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7150 case "$installusrbinperl" in
7151 "$undef"|[nN]*) dflt='n';;
7155 rp="Do you want to install perl as /usr/bin/perl?"
7158 [yY]*) val="$define";;
7164 set installusrbinperl
7168 echo "Checking for GNU C Library..." >&4
7170 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7171 alone are insufficient to distinguish different versions, such as
7172 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7173 libc version 2.1.0. A. Dougherty, June 3, 2002.
7179 # ifdef __GLIBC_MINOR__
7180 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7181 # include <gnu/libc-version.h>
7182 printf("%s\n", gnu_get_libc_version());
7184 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7187 printf("%d\n", __GLIBC__);
7196 if eval $compile_ok && $run ./try > glibc.ver; then
7198 gnulibc_version=`$cat glibc.ver`
7199 echo "You are using the GNU C Library version $gnulibc_version"
7203 echo "You are not using the GNU C Library"
7209 : see if nm is to be used to determine whether a symbol is defined or not
7213 case "$d_gnulibc" in
7216 echo "nm probably won't work on the GNU C Library." >&4
7222 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7224 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7225 echo "'nm' won't be sufficient on this sytem." >&4
7231 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7232 if $test $dflt -gt 20; then
7242 true|$define) dflt=y;;
7249 I can use $nm to extract the symbols from your C libraries. This
7250 is a time consuming task which may generate huge output on the disk (up
7251 to 3 megabytes) but that should make the symbols extraction faster. The
7252 alternative is to skip the 'nm' extraction part and to compile a small
7253 test program instead to determine whether each symbol is present. If
7254 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7255 this may be the best solution.
7257 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7260 rp="Shall I use $nm to extract C symbols from the libraries?"
7263 [Nn]*) usenm=false;;
7272 : nm options which may be necessary
7274 '') if $test -f /mach_boot; then
7276 elif $test -d /usr/ccs/lib; then
7277 nm_opt='-p' # Solaris (and SunOS?)
7278 elif $test -f /dgux; then
7280 elif $test -f /lib64/rld; then
7281 nm_opt='-p' # 64-bit Irix
7287 : nm options which may be necessary for shared libraries but illegal
7288 : for archive libraries. Thank you, Linux.
7289 case "$nm_so_opt" in
7290 '') case "$myuname" in
7292 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7293 nm_so_opt='--dynamic'
7302 : get list of predefined functions in a handy place
7307 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7313 *) for thislib in $libs; do
7316 : Handle C library specially below.
7319 thislib=`echo $thislib | $sed -e 's/^-l//'`
7320 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7322 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7324 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7326 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7328 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7330 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7332 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7337 libnames="$libnames $try"
7339 *) libnames="$libnames $thislib" ;;
7348 for xxx in $libpth; do
7349 $test -r $1 || set $xxx/libc.$so
7350 : The messy sed command sorts on library version numbers.
7352 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7353 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7355 s/[0-9][0-9]*/0000&/g
7356 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7359 $sort | $sed -e 's/^.* //'`
7362 $test -r $1 || set /usr/ccs/lib/libc.$so
7363 $test -r $1 || set /lib/libsys_s$_a
7369 if $test -r "$1"; then
7370 echo "Your (shared) C library seems to be in $1."
7372 elif $test -r /lib/libc && $test -r /lib/clib; then
7373 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7375 libc='/lib/clib /lib/libc'
7376 if $test -r /lib/syslib; then
7377 echo "(Your math library is in /lib/syslib.)"
7378 libc="$libc /lib/syslib"
7380 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7381 echo "Your C library seems to be in $libc, as you said before."
7382 elif $test -r $incpath/usr/lib/libc$_a; then
7383 libc=$incpath/usr/lib/libc$_a;
7384 echo "Your C library seems to be in $libc. That's fine."
7385 elif $test -r /lib/libc$_a; then
7387 echo "Your C library seems to be in $libc. You're normal."
7389 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7391 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7392 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7393 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7395 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7397 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7400 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7402 if $test -r "$tans"; then
7403 echo "Your C library seems to be in $tans, of all places."
7409 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7413 If the guess above is wrong (which it might be if you're using a strange
7414 compiler, or your machine supports multiple models), you can override it here.
7419 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7421 I can't seem to find your C library. I've looked in the following places:
7424 $sed 's/^/ /' libpath
7427 None of these seems to contain your C library. I need to get its name...
7432 rp='Where is your C library?'
7437 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7438 set X `cat libnames`
7441 case $# in 1) xxx=file; esac
7442 echo "Extracting names from the following $xxx for later perusal:" >&4
7444 $sed 's/^/ /' libnames >&4
7446 $echo $n "This may take a while...$c" >&4
7450 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7451 *) $nm $nm_opt $file 2>/dev/null;;
7456 $grep fprintf libc.tmp > libc.ptf
7457 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7458 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7460 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7462 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7464 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7466 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7468 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7470 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7472 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //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.*text.*/\1/p'";\
7478 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7480 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7482 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7484 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7485 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7487 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7489 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7491 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7493 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7495 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7497 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7499 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7501 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7503 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7505 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7507 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7509 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7511 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7513 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7515 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7518 $nm -p $* 2>/dev/null >libc.tmp
7519 $grep fprintf libc.tmp > libc.ptf
7520 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7521 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7527 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7529 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7530 for thisname in $libnames $libc; do
7531 $ar t $thisname >>libc.tmp
7533 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7535 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7536 # Repeat libc to extract forwarders to DLL entries too
7537 for thisname in $libnames $libc; do
7538 $ar tv $thisname >>libc.tmp
7539 # Revision 50 of EMX has bug in $ar.
7540 # it will not extract forwarders to DLL entries
7541 # Use emximp which will extract exactly them.
7542 emximp -o tmp.imp $thisname \
7544 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7545 < tmp.imp >>libc.tmp
7548 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7551 echo "$ar didn't seem to work right." >&4
7552 echo "Maybe this is a Cray...trying bld instead..." >&4
7553 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7555 for thisname in $libnames; do
7557 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7558 $ar t $thisname >>libc.tmp
7562 echo "That didn't work either. Giving up." >&4
7572 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7573 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7575 *) if $test -f /lib/syscalls.exp; then
7577 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7578 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7584 $rm -f libnames libpath
7586 : see if dld is available
7592 echo "Checking for C++..." >&4
7593 $cat >try.c <<'EOCP'
7605 if eval $compile_ok && $run ./try; then
7607 echo "You are using a C++ compiler."
7610 echo "You are not using a C++ compiler."
7616 : is a C symbol defined?
7619 -v) tf=libc.tmp; tdc="";;
7620 -a) tf=libc.tmp; tdc="[]";;
7621 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7624 case "$reuseval-$4" in
7626 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7631 case "$d_cplusplus" in
7632 $define) extern_C=\"C\";;
7634 if $test "$runnm" = true; then
7635 if $contains $tlook $tf >/dev/null 2>&1; then
7637 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7638 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7639 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7640 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7644 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7645 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7651 $define) tval=true;;
7658 : define an is-in-libc? function
7659 inlibc='echo " "; td=$define; tu=$undef;
7660 sym=$1; var=$2; eval "was=\$$2";
7662 case "$reuseval$was" in
7672 echo "$sym() found." >&4;
7673 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7675 echo "$sym() NOT found." >&4;
7676 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7680 $define) echo "$sym() found." >&4;;
7681 *) echo "$sym() NOT found." >&4;;
7685 : see if dlopen exists
7687 xxx_ccflags="$ccflags"
7689 : with g++ one needs -shared to get is-in-libc to work for dlopen
7690 case "$gccversion" in
7692 *) case "$d_cplusplus" in
7693 "$define") ccflags="$ccflags -shared" ;;
7700 ccflags="$xxx_ccflags"
7702 : see if this is a unistd.h system
7703 set unistd.h i_unistd
7706 : determine which dynamic loading, if any, to compile in
7708 dldir="ext/DynaLoader"
7721 $define) dflt='y' ;;
7724 $define) dflt='y' ;;
7726 : Does a dl_xxx.xs file exist for this operating system
7727 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7730 rp="Do you wish to use dynamic loading?"
7737 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7738 dflt="$dldir/dl_${osname}.xs"
7739 elif $test "$d_dlopen" = "$define" ; then
7740 dflt="$dldir/dl_dlopen.xs"
7741 elif $test "$i_dld" = "$define" ; then
7742 dflt="$dldir/dl_dld.xs"
7747 *) dflt="$dldir/$dlsrc"
7750 echo "The following dynamic loading files are available:"
7751 : Can not go over to $dldir because getfile has path hard-coded in.
7752 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7753 rp="Source file to use for dynamic loading"
7759 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7763 Some systems may require passing special flags to $cc -c to
7764 compile modules that will be used to create a shared library.
7765 To use no flags, say "none".
7768 case "$cccdlflags" in
7769 '') case "$gccversion" in
7770 '') case "$osname" in
7772 next) dflt='none' ;;
7773 irix*) dflt='-KPIC' ;;
7774 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7775 sunos) dflt='-pic' ;;
7779 *) case "$osname" in
7780 darwin) dflt='none' ;;
7781 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7786 *) dflt="$cccdlflags" ;;
7788 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7791 none) cccdlflags=' ' ;;
7792 *) cccdlflags="$ans" ;;
7797 Some systems use ld to create libraries that can be dynamically loaded,
7798 while other systems (such as those using ELF) use $cc.
7802 '') $cat >try.c <<EOM
7803 /* Test for whether ELF binaries are produced */
7815 int i = open("a.out",O_RDONLY);
7818 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7819 exit(0); /* succeed (yes, it's ELF) */
7824 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7826 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7830 echo "I'll use ld to build dynamic libraries."
7839 rp="What command should be used to create dynamic libraries?"
7845 Some systems may require passing special flags to $ld to create a
7846 library that can be dynamically loaded. If your ld flags include
7847 -L/other/path options to locate libraries outside your loader's normal
7848 search path, you may need to specify those -L options here as well. To
7849 use no flags, say "none".
7852 case "$lddlflags" in
7853 '') case "$osname" in
7854 beos) dflt='-nostart' ;;
7856 case "$gccversion" in
7857 '') dflt="$dflt +vnocompatwarnings" ;;
7860 linux|irix*|gnu*) dflt="-shared $optimize" ;;
7861 next) dflt='none' ;;
7862 solaris) dflt='-G' ;;
7863 sunos) dflt='-assert nodefinitions' ;;
7864 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7868 *) dflt="$lddlflags" ;;
7871 : Try to guess additional flags to pick up local libraries.
7872 : Be careful not to append to a plain 'none'
7876 for thisflag in $ldflags; do
7881 *) dflt="$dflt $thisflag" ;;
7888 ''|' ') dflt='none' ;;
7891 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7894 none) lddlflags=' ' ;;
7895 *) lddlflags="$ans" ;;
7900 Some systems may require passing special flags to $cc to indicate that
7901 the resulting executable will use dynamic linking. To use no flags,
7905 case "$ccdlflags" in
7906 '') case "$osname" in
7907 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7908 next|sunos) dflt='none' ;;
7912 *) dflt="$ccdlflags" ;;
7914 rp="Any special flags to pass to $cc to use dynamic linking?"
7917 none) ccdlflags=' ' ;;
7918 *) ccdlflags="$ans" ;;
7932 # No dynamic loading being used, so don't bother even to prompt.
7935 *) case "$useshrplib" in
7936 '') case "$osname" in
7937 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7939 also='Building a shared libperl is required for dynamic loading to work on your system.'
7944 also='Building a shared libperl is needed for MAB support.'
7962 The perl executable is normally obtained by linking perlmain.c with
7963 libperl${_a}, any static extensions (usually just DynaLoader), and
7964 any other libraries needed on this system (such as -lm, etc.). Since
7965 your system supports dynamic loading, it is probably possible to build
7966 a shared libperl.$so. If you will have more than one executable linked
7967 to libperl.$so, this will significantly reduce the size of each
7968 executable, but it may have a noticeable effect on performance. The
7969 default is probably sensible for your system.
7973 rp="Build a shared libperl.$so (y/n)"
7977 useshrplib='true' ;;
7978 *) useshrplib='false' ;;
7983 case "$useshrplib" in
7987 # Figure out a good name for libperl.so. Since it gets stored in
7988 # a version-specific architecture-dependent library, the version
7989 # number isn't really that important, except for making cc/ld happy.
7991 # A name such as libperl.so.3.1
7992 majmin="libperl.$so.$patchlevel.$subversion"
7993 # A name such as libperl.so.301
7994 majonly=`echo $patchlevel $subversion |
7995 $awk '{printf "%d%02d", $1, $2}'`
7996 majonly=libperl.$so.$majonly
7997 # I'd prefer to keep the os-specific stuff here to a minimum, and
7998 # rely on figuring it out from the naming of libc.
7999 case "${osname}${osvers}" in
8002 # XXX How handle the --version stuff for MAB?
8004 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8007 cygwin*) # ld links against an importlib
8008 dflt=libperl$lib_ext
8010 *) # Try to guess based on whether libc has major.minor.
8012 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8013 *libc.$so.[0-9]*) dflt=$majonly ;;
8014 *) dflt=libperl.$so ;;
8024 I need to select a good name for the shared libperl. If your system uses
8025 library names with major and minor numbers, then you might want something
8026 like $majmin. Alternatively, if your system uses a single version
8027 number for shared libraries, then you might want to use $majonly.
8028 Or, your system might be quite happy with a simple libperl.$so.
8030 Since the shared libperl will get installed into a version-specific
8031 architecture-dependent directory, the version number of the shared perl
8032 library probably isn't important, so the default should be o.k.
8035 rp='What name do you want to give to the shared libperl?'
8038 echo "Ok, I'll use $libperl"
8041 libperl="libperl${_a}"
8045 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8049 WARNING: Use of the shrpdir variable for the installation location of
8050 the shared $libperl is not supported. It was never documented and
8051 will not work in this version. Let me (perlbug@perl.org)
8052 know of any problems this may cause.
8058 But your current setting of $shrpdir is
8059 the default anyway, so it's harmless.
8064 Further, your current attempted setting of $shrpdir
8065 conflicts with the value of $archlibexp/CORE
8066 that installperl will use.
8073 # How will the perl executable find the installed shared $libperl?
8074 # Add $xxx to ccdlflags.
8075 # If we can't figure out a command-line option, use $shrpenv to
8076 # set env LD_RUN_PATH. The main perl makefile uses this.
8077 shrpdir=$archlibexp/CORE
8080 if "$useshrplib"; then
8083 # We'll set it in Makefile.SH...
8088 freebsd|netbsd|openbsd|interix|dragonfly)
8089 xxx="-Wl,-R$shrpdir"
8091 bsdos|linux|irix*|dec_osf|gnu*)
8092 xxx="-Wl,-rpath,$shrpdir"
8095 # next doesn't like the default...
8098 # beos doesn't like the default, either.
8101 # hpux doesn't like the default, either.
8102 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8105 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8111 # Only add $xxx if it isn't already in ccdlflags.
8112 case " $ccdlflags " in
8114 *) ccdlflags="$ccdlflags $xxx"
8117 Adding $xxx to the flags
8118 passed to $ld so that the perl executable will find the
8119 installed shared $libperl.
8127 # Fix ccdlflags in AIX for building external extensions.
8128 # (For building Perl itself bare -bE:perl.exp is needed,
8129 # Makefile.SH takes care of this.)
8131 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8133 # Respect a hint or command-line value.
8135 '') shrpenv="$tmp_shrpenv" ;;
8137 case "$ldlibpthname" in
8138 '') ldlibpthname=LD_LIBRARY_PATH ;;
8139 none) ldlibpthname='' ;;
8142 : determine where manual pages are on this system
8146 syspath='/usr/share/man/man1 /usr/man/man1'
8147 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8148 syspath="$syspath /usr/man/u_man/man1"
8149 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8150 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8151 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8152 sysman=`./loc . /usr/man/man1 $syspath`
8155 if $test -d "$sysman"; then
8156 echo "System manual is in $sysman." >&4
8158 echo "Could not find manual pages in source form." >&4
8161 : determine where manual pages go
8162 set man1dir man1dir none
8166 $spackage has manual pages available in source form.
8170 echo "However, you don't have nroff, so they're probably useless to you."
8172 '') man1dir="none";;
8175 echo "If you don't want the manual sources installed, answer 'none'."
8180 lookpath="$prefixexp/share/man/man1"
8181 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8182 lookpath="$lookpath $prefixexp/man/p_man/man1"
8183 lookpath="$lookpath $prefixexp/man/u_man/man1"
8184 lookpath="$lookpath $prefixexp/man/man.1"
8186 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8187 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8197 rp="Where do the main $spackage manual pages (source) go?"
8199 if $test "X$man1direxp" != "X$ansexp"; then
8210 : What suffix to use on installed man pages
8217 rp="What suffix should be used for the main $spackage man pages?"
8219 '') case "$man1dir" in
8233 *) dflt="$man1ext";;
8240 : see if we can have long filenames
8242 first=123456789abcdef
8244 if (echo hi >$first) 2>/dev/null; then
8245 if $test -f 123456789abcde; then
8246 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8249 echo 'You can have filenames longer than 14 characters.'>&4
8254 You can't have filenames longer than 14 chars.
8255 You can't even think about them!
8261 $rm -rf 123456789abcde*
8263 : determine where library module manual pages go
8264 set man3dir man3dir none
8268 $spackage has manual pages for many of the library modules.
8274 However, you don't have nroff, so they're probably useless to you.
8277 '') man3dir="none";;
8281 case "$d_flexfnam" in
8284 However, your system can't handle the long file names like File::Basename.3.
8287 '') man3dir="none";;
8291 echo "If you don't want the manual sources installed, answer 'none'."
8292 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8294 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8295 if $test -d "$privlib/man/man3"; then
8298 WARNING: Previous versions of perl installed man3 pages into
8299 $privlib/man/man3. This version will suggest a
8300 new default of $dflt.
8304 rp='Do you wish to preserve the old behavior?(y/n)'
8307 y*) dflt="$privlib/man/man3" ;;
8312 *) dflt="$man3dir" ;;
8319 rp="Where do the $package library man pages (source) go?"
8329 : What suffix to use on installed man pages
8335 rp="What suffix should be used for the $package library man pages?"
8337 '') case "$man3dir" in
8351 *) dflt="$man3ext";;
8358 : see if we have to deal with yellow pages, now NIS.
8359 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8360 if $test -f /usr/etc/nibindd; then
8362 echo "I'm fairly confident you're on a NeXT."
8364 rp='Do you get the hosts file via NetInfo?'
8373 y*) hostcat='nidump hosts .';;
8374 *) case "$hostcat" in
8375 nidump*) hostcat='';;
8385 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8393 rp='Are you getting the hosts file via yellow pages?'
8396 y*) hostcat='ypcat hosts';;
8397 *) hostcat='cat /etc/hosts';;
8403 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8406 '') test -f /etc/group && groupcat='cat /etc/group';;
8409 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8412 : now get the host name
8414 echo "Figuring out host name..." >&4
8415 case "$myhostname" in
8417 echo 'Maybe "hostname" will work...'
8418 if tans=`sh -c hostname 2>&1` ; then
8426 if $test "$cont"; then
8428 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8429 if tans=`cat /etc/systemid 2>&1` ; then
8431 phostname='cat /etc/systemid'
8432 echo "Whadyaknow. Xenix always was a bit strange..."
8435 elif $test -r /etc/systemid; then
8436 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8439 if $test "$cont"; then
8440 echo 'No, maybe "uuname -l" will work...'
8441 if tans=`sh -c 'uuname -l' 2>&1` ; then
8443 phostname='uuname -l'
8445 echo 'Strange. Maybe "uname -n" will work...'
8446 if tans=`sh -c 'uname -n' 2>&1` ; then
8448 phostname='uname -n'
8450 echo 'Oh well, maybe I can mine it out of whoami.h...'
8451 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8452 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8453 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8455 case "$myhostname" in
8456 '') echo "Does this machine have an identity crisis or something?"
8459 echo "Well, you said $myhostname before..."
8460 phostname='echo $myhostname';;
8466 case "$myhostname" in
8467 '') myhostname=noname ;;
8469 : you do not want to know about this
8474 if $test "$myhostname" ; then
8476 rp='Your host name appears to be "'$myhostname'".'" Right?"
8484 : bad guess or no guess
8485 while $test "X$myhostname" = X ; do
8487 rp="Please type the (one word) name of your host:"
8492 : translate upper to lower if necessary
8493 case "$myhostname" in
8495 echo "(Normalizing case in your host name)"
8496 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8500 case "$myhostname" in
8502 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8503 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8504 echo "(Trimming domain name from host name--host name is now $myhostname)"
8506 *) case "$mydomain" in
8509 test "X$hostcat" = "Xypcat hosts" &&
8510 ypmatch "$myhostname" hosts 2>/dev/null |\
8511 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8514 test "X$hostcat" != "X" &&
8515 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8516 /[ ]$myhostname[ . ]/p" > hosts
8519 if $test -f hosts; then
8520 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8521 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8522 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8523 hosts | $sort | $uniq | \
8524 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8525 case `$echo X$dflt` in
8526 X*\ *) echo "(Several hosts in the database matched hostname)"
8529 X.) echo "(You do not have fully-qualified names in the hosts database)"
8533 echo "(I cannot locate a hosts database anywhere)"
8538 tans=`./loc resolv.conf X /etc /usr/etc`
8539 if $test -f "$tans"; then
8540 echo "(Attempting domain name extraction from $tans)"
8541 dflt=.`$sed -n -e 's/ / /g' \
8542 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8543 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8545 .) dflt=.`$sed -n -e 's/ / /g' \
8546 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8547 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8554 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8555 dflt=.`sh -c domainname 2>/dev/null`
8558 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8562 case "$dflt$osname" in
8563 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8564 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8568 .) echo "(Lost all hope -- silly guess then)"
8574 *) dflt="$mydomain";;
8578 rp="What is your domain name?"
8588 : translate upper to lower if necessary
8591 echo "(Normalizing case in your domain name)"
8592 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8596 : a little sanity check here
8597 case "$phostname" in
8600 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8601 $myhostname$mydomain|$myhostname) ;;
8603 case "$phostname" in
8605 echo "(That doesn't agree with your whoami.h file, by the way.)"
8608 echo "(That doesn't agree with your $phostname command, by the way.)"
8618 I need to get your e-mail address in Internet format if possible, i.e.
8619 something like user@host.domain. Please answer accurately since I have
8620 no easy means to double check it. The default value provided below
8621 is most probably close to reality but may not be valid from outside
8622 your organization...
8626 while test "$cont"; do
8628 '') dflt="$cf_by@$myhostname$mydomain";;
8629 *) dflt="$cf_email";;
8631 rp='What is your e-mail address?'
8637 rp='Address does not look like an Internet one. Use it anyway?'
8653 If you or somebody else will be maintaining perl at your site, please
8654 fill in the correct e-mail address here so that they may be contacted
8655 if necessary. Currently, the "perlbug" program included with perl
8656 will send mail to this address in addition to perlbug@perl.org. You may
8657 enter "none" for no administrator.
8660 case "$perladmin" in
8661 '') dflt="$cf_email";;
8662 *) dflt="$perladmin";;
8664 rp='Perl administrator e-mail address'
8668 : determine whether to only install version-specific parts.
8671 Do you want to install only the version-specific parts of the perl
8672 distribution? Usually you do *not* want to do this.
8674 case "$versiononly" in
8675 "$define"|[Yy]*|true) dflt='y' ;;
8678 rp="Do you want to install only the version-specific parts of perl?"
8681 [yY]*) val="$define";;
8687 case "$versiononly" in
8688 "$define") inc_version_list=''
8689 inc_version_list_init=0
8693 : figure out how to guarantee perl startup
8694 : XXX Note that this currently takes advantage of the bug that binexp ignores
8695 : the Configure -Dinstallprefix setting, which in turn means that under
8696 : relocatable @INC, initialinstalllocation is what binexp started as.
8697 case "$startperl" in
8699 case "$sharpbang" in
8703 I can use the #! construct to start perl on your system. This will
8704 make startup of perl scripts faster, but may cause problems if you
8705 want to share those scripts and perl is not in a standard place
8706 ($initialinstalllocation/perl) on all your platforms. The alternative
8707 is to force a shell by starting the script with a single ':' character.
8710 case "$versiononly" in
8711 "$define") dflt="$initialinstalllocation/perl$version";;
8712 *) dflt="$initialinstalllocation/perl";;
8714 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8717 none) startperl=": # use perl";;
8718 *) startperl="#!$ans"
8719 if $test 30 -lt `echo "$ans" | wc -c`; then
8722 WARNING: Some systems limit the #! command to 32 characters.
8723 If you experience difficulty running Perl scripts with #!, try
8724 installing Perl in a directory with a shorter pathname.
8730 *) startperl=": # use perl"
8735 echo "I'll use $startperl to start perl scripts."
8737 : figure best path for perl in scripts
8740 case "$versiononly" in
8741 "$define") perlpath="$initialinstalllocation/perl$version";;
8742 *) perlpath="$initialinstalllocation/perl";;
8744 case "$startperl" in
8749 I will use the "eval 'exec'" idiom to start Perl on your system.
8750 I can use the full path of your Perl binary for this purpose, but
8751 doing so may cause problems if you want to share those scripts and
8752 Perl is not always in a standard place ($initialinstalllocation/perl).
8755 dflt="$initialinstalllocation/perl"
8756 rp="What path shall I use in \"eval 'exec'\"?"
8763 case "$startperl" in
8765 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8768 : determine where public executable scripts go
8769 set scriptdir scriptdir
8771 case "$scriptdir" in
8774 : guess some guesses
8775 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8776 $test -d /usr/share/bin && dflt=/usr/share/bin
8777 $test -d /usr/local/script && dflt=/usr/local/script
8778 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8779 $test -d $prefixexp/script && dflt=$prefixexp/script
8783 *) dflt="$scriptdir"
8788 Some installations have a separate directory just for executable scripts so
8789 that they can mount it across multiple architectures but keep the scripts in
8790 one spot. You might, for example, have a subdirectory of /usr/share for this.
8791 Or you might just lump your scripts in with all your other executables.
8795 rp='Where do you keep publicly executable scripts?'
8797 if $test "X$ansexp" != "X$scriptdirexp"; then
8803 : A little fix up for an irregularly named variable.
8804 installscript="$installscriptdir"
8806 : determine where add-on public executables go
8808 '') dflt=$siteprefix/bin ;;
8812 rp='Pathname where the add-on public executables should be installed?'
8817 : determine where add-on html pages go
8818 : There is no standard location, so try to copy the previously-selected
8819 : directory structure for the core html pages.
8820 case "$sitehtml1dir" in
8821 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8822 *) dflt=$sitehtml1dir ;;
8825 ''|' ') dflt=none ;;
8828 rp='Pathname where the site-specific html pages should be installed?'
8830 prefixvar=sitehtml1dir
8833 : determine where add-on library html pages go
8834 : There is no standard location, so try to copy the previously-selected
8835 : directory structure for the core html pages.
8836 case "$sitehtml3dir" in
8837 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8838 *) dflt=$sitehtml3dir ;;
8841 ''|' ') dflt=none ;;
8844 rp='Pathname where the site-specific library html pages should be installed?'
8846 prefixvar=sitehtml3dir
8849 : determine where add-on manual pages go
8850 case "$siteman1dir" in
8851 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8852 *) dflt=$siteman1dir ;;
8855 ''|' ') dflt=none ;;
8858 rp='Pathname where the site-specific manual pages should be installed?'
8860 prefixvar=siteman1dir
8863 : determine where add-on library man pages go
8864 case "$siteman3dir" in
8865 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8866 *) dflt=$siteman3dir ;;
8869 ''|' ') dflt=none ;;
8872 rp='Pathname where the site-specific library manual pages should be installed?'
8874 prefixvar=siteman3dir
8877 : determine where add-on public executable scripts go
8878 case "$sitescript" in
8879 '') dflt=$siteprefix/script
8880 $test -d $dflt || dflt=$sitebin ;;
8881 *) dflt="$sitescript" ;;
8884 rp='Pathname where add-on public executable scripts should be installed?'
8886 prefixvar=sitescript
8889 case "$usefaststdio" in
8890 $define|true|[yY]*|'')
8891 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8901 Perl can be built to use 'fast stdio', which means using the stdio
8902 library but also directly manipulating the stdio buffers to enable
8903 faster I/O. Using stdio is better for backward compatibility (especially
8904 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8905 interface has been preferred instead of stdio.
8907 If this doesn't make any sense to you, just accept the default '$dflt'.
8909 rp='Use the "fast stdio" if available?'
8912 y|Y) val="$define" ;;
8919 : define an is-a-typedef? function
8920 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8922 "") inclist="sys/types.h";;
8924 eval "varval=\$$var";
8928 for inc in $inclist; do
8929 echo "#include <$inc>" >>temp.c;
8931 echo "#ifdef $type" >> temp.c;
8932 echo "printf(\"We have $type\");" >> temp.c;
8933 echo "#endif" >> temp.c;
8934 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8935 if $contains $type temp.E >/dev/null 2>&1; then
8941 *) eval "$var=\$varval";;
8944 : define an is-a-typedef? function that prompts if the type is not available.
8945 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8947 "") inclist="sys/types.h";;
8949 eval "varval=\$$var";
8953 for inc in $inclist; do
8954 echo "#include <$inc>" >>temp.c;
8956 echo "#ifdef $type" >> temp.c;
8957 echo "printf(\"We have $type\");" >> temp.c;
8958 echo "#endif" >> temp.c;
8959 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8961 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8962 if $contains $type temp.E >/dev/null 2>&1; then
8963 echo "$type found." >&4;
8966 echo "$type NOT found." >&4;
8972 *) eval "$var=\$varval";;
8975 : see what type lseek is declared as in the kernel
8976 rp="What is the type used for lseek's offset on this system?"
8977 set off_t lseektype long stdio.h sys/types.h
8981 echo "Checking to see how big your file offsets are..." >&4
8983 #include <sys/types.h>
8987 printf("%d\n", (int)sizeof($lseektype));
8992 if eval $compile_ok; then
8993 lseeksize=`$run ./try`
8994 echo "Your file offsets are $lseeksize bytes long."
8998 echo "(I can't seem to compile the test program. Guessing...)"
8999 rp="What is the size of your file offsets (in bytes)?"
9005 : see what type file positions are declared as in the library
9006 rp="What is the type for file position used by fsetpos()?"
9007 set fpos_t fpostype long stdio.h sys/types.h
9012 *_t) zzz="$fpostype" ;;
9015 echo "Checking the size of $zzz..." >&4
9017 #include <sys/types.h>
9024 printf("%d\n", (int)sizeof($fpostype));
9029 if eval $compile_ok; then
9033 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9036 echo "Your $zzz is $fpossize bytes long."
9042 echo "(I can't compile the test program. Guessing...)" >&4
9043 rp="What is the size of your file positions (in bytes)?"
9048 # Backward compatibility (uselfs is deprecated).
9050 "$define"|true|[yY]*)
9053 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9055 uselargefiles="$define"
9059 case "$lseeksize:$fpossize" in
9062 You can have files larger than 2 gigabytes.
9065 *) case "$uselargefiles" in
9066 "$undef"|false|[nN]*) dflt='n' ;;
9071 Perl can be built to understand large files (files larger than 2 gigabytes)
9072 on some systems. To do so, Configure can be run with -Duselargefiles.
9074 If this doesn't make any sense to you, just accept the default '$dflt'.
9076 rp='Try to understand large files, if available?'
9079 y|Y) val="$define" ;;
9086 : Look for a hint-file generated 'call-back-unit'. If the
9087 : user has specified that a large files perl is to be built,
9088 : we may need to set or change some other defaults.
9089 if $test -f uselargefiles.cbu; then
9090 echo "Your platform has some specific hints regarding large file builds, using them..."
9091 . ./uselargefiles.cbu
9093 case "$uselargefiles" in
9095 if $test -f uselargefiles.cbu; then
9097 echo "Rechecking to see how big your file offsets are..." >&4
9099 #include <sys/types.h>
9103 printf("%d\n", (int)sizeof($lseektype));
9108 if eval $compile_ok; then
9109 lseeksize=`$run ./try`
9110 $echo "Your file offsets are now $lseeksize bytes long."
9114 echo "(I can't seem to compile the test program. Guessing...)"
9115 rp="What is the size of your file offsets (in bytes)?"
9120 *_t) zzz="$fpostype" ;;
9123 $echo $n "Rechecking the size of $zzz...$c" >&4
9125 #include <sys/types.h>
9132 printf("%d\n", (int)sizeof($fpostype));
9137 if eval $compile_ok; then
9142 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9145 echo " $fpossize bytes." >&4
9151 echo "(I can't compile the test program. Guessing...)" >&4
9152 rp="What is the size of your file positions (in bytes)?"
9161 case "$vendorprefix" in
9162 '') d_vendorbin="$undef"
9166 *) d_vendorbin="$define"
9167 : determine where vendor-supplied executables go.
9168 case "$vendorbin" in
9169 '') dflt=$vendorprefix/bin ;;
9170 *) dflt="$vendorbin" ;;
9173 rp='Pathname for the vendor-supplied executables directory?'
9176 vendorbinexp="$ansexp"
9182 case "$vendorprefix" in
9183 '') vendorhtml1dir=''
9184 vendorhtml1direxp=''
9186 *) : determine where vendor-supplied html pages go.
9187 : There is no standard location, so try to copy the previously-selected
9188 : directory structure for the core html pages.
9189 : XXX Better default suggestions would be welcome.
9190 case "$vendorhtml1dir" in
9191 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9192 *) dflt=$vendorhtml1dir ;;
9195 ''|' ') dflt=none ;;
9198 rp='Pathname for the vendor-supplied html pages?'
9200 vendorhtml1dir="$ans"
9201 vendorhtml1direxp="$ansexp"
9204 : Use ' ' for none so value is preserved next time through Configure
9205 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9206 prefixvar=vendorhtml1dir
9209 case "$vendorprefix" in
9210 '') vendorhtml3dir=''
9211 vendorhtml3direxp=''
9213 *) : determine where vendor-supplied module html pages go.
9214 : There is no standard location, so try to copy the previously-selected
9215 : directory structure for the core html pages.
9216 : XXX Better default suggestions would be welcome.
9217 case "$vendorhtml3dir" in
9218 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9219 *) dflt=$vendorhtml3dir ;;
9222 ''|' ') dflt=none ;;
9225 rp='Pathname for the vendor-supplied html pages?'
9227 vendorhtml3dir="$ans"
9228 vendorhtml3direxp="$ansexp"
9231 : Use ' ' for none so value is preserved next time through Configure
9232 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9233 prefixvar=vendorhtml3dir
9236 case "$vendorprefix" in
9237 '') vendorman1dir=''
9240 *) : determine where vendor-supplied manual pages go.
9241 case "$vendorman1dir" in
9242 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9243 *) dflt=$vendorman1dir ;;
9246 ''|' ') dflt=none ;;
9249 rp='Pathname for the vendor-supplied manual section 1 pages?'
9251 vendorman1dir="$ans"
9252 vendorman1direxp="$ansexp"
9255 : Use ' ' for none so value is preserved next time through Configure
9256 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9257 prefixvar=vendorman1dir
9260 case "$vendorprefix" in
9261 '') vendorman3dir=''
9264 *) : determine where vendor-supplied module manual pages go.
9265 case "$vendorman3dir" in
9266 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9267 *) dflt=$vendorman3dir ;;
9270 ''|' ') dflt=none ;;
9273 rp='Pathname for the vendor-supplied manual section 3 pages?'
9275 vendorman3dir="$ans"
9276 vendorman3direxp="$ansexp"
9279 : Use ' ' for none so value is preserved next time through Configure
9280 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9281 prefixvar=vendorman3dir
9284 case "$vendorprefix" in
9285 '') d_vendorscript="$undef"
9289 *) d_vendorscript="$define"
9290 : determine where vendor-supplied scripts go.
9291 case "$vendorscript" in
9292 '') dflt=$vendorprefix/script
9293 $test -d $dflt || dflt=$vendorbin ;;
9294 *) dflt="$vendorscript" ;;
9298 The installation process will create a directory for
9299 vendor-supplied scripts.
9303 rp='Pathname for the vendor-supplied scripts directory?'
9306 vendorscriptexp="$ansexp"
9309 prefixvar=vendorscript
9312 : see if qgcvt exists
9318 if $test X"$d_longdbl" = X"$define"; then
9320 echo "Checking how to print long doubles..." >&4
9322 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9323 $cat >try.c <<'EOCP'
9324 #include <sys/types.h>
9328 printf("%.3f\n", d);
9332 if eval $compile; then
9336 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9337 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9338 echo "We will use %f."
9344 if $test X"$sPRIfldbl" = X; then
9345 $cat >try.c <<'EOCP'
9346 #include <sys/types.h>
9349 long double d = 123.456;
9350 printf("%.3Lf\n", d);
9354 if eval $compile; then
9358 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9359 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9360 echo "We will use %Lf."
9366 if $test X"$sPRIfldbl" = X; then
9367 $cat >try.c <<'EOCP'
9368 #include <sys/types.h>
9371 long double d = 123.456;
9372 printf("%.3llf\n", d);
9376 if eval $compile; then
9380 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9381 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9382 echo "We will use %llf."
9388 if $test X"$sPRIfldbl" = X; then
9389 $cat >try.c <<'EOCP'
9390 #include <sys/types.h>
9393 long double d = 123.456;
9394 printf("%.3lf\n", d);
9398 if eval $compile; then
9402 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9403 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9404 echo "We will use %lf."
9410 if $test X"$sPRIfldbl" = X; then
9411 echo "Cannot figure out how to print long doubles." >&4
9413 sSCNfldbl=$sPRIfldbl # expect consistency
9420 case "$sPRIfldbl" in
9421 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9422 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9423 d_SCNfldbl="$undef";
9425 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9426 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9427 d_SCNfldbl="$define";
9431 : Check how to convert floats to strings.
9433 if test "X$d_Gconvert" = X; then
9436 echo "Checking for an efficient way to convert floats to strings."
9438 case "$uselongdouble" in
9439 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9441 case "$d_longdbl" in
9442 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9444 case "$d_PRIgldbl" in
9445 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9449 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9450 char *myname = "gconvert";
9453 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9454 char *myname = "gcvt";
9457 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9458 char *myname = "qgcvt";
9459 #define DOUBLETYPE long double
9462 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9464 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9466 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9469 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9471 char *myname = "sprintf";
9475 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9476 #define DOUBLETYPE long double
9478 #define DOUBLETYPE double
9484 #define I_STDLIB $i_stdlib
9490 checkit(expect, got)
9494 if (strcmp(expect, got)) {
9495 printf("%s oddity: Expected %s, got %s\n",
9496 myname, expect, got);
9506 /* This must be 1st test on (which?) platform */
9507 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9508 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9509 checkit("0.1", buf);
9511 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9512 checkit("0.01", buf);
9514 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9515 checkit("0.001", buf);
9517 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9518 checkit("0.0001", buf);
9520 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9521 if (strlen(buf) > 5)
9522 checkit("9e-005", buf); /* for Microsoft ?? */
9524 checkit("9e-05", buf);
9526 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9529 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9530 checkit("1.1", buf);
9532 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9533 checkit("1.01", buf);
9535 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9536 checkit("1.001", buf);
9538 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9539 checkit("1.0001", buf);
9541 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9542 checkit("1.00001", buf);
9544 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9545 checkit("1.000001", buf);
9547 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9550 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9553 /* Some Linux gcvt's give 1.e+5 here. */
9554 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9555 checkit("100000", buf);
9557 /* Some Linux gcvt's give -1.e+5 here. */
9558 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9559 checkit("-100000", buf);
9561 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9562 checkit("123.456", buf);
9564 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9565 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9566 /* 34 should be enough to scare even long double
9567 * places into using the e notation. */
9568 if (strlen(buf) > 5)
9569 checkit("1e+034", buf); /* for Microsoft */
9571 checkit("1e+34", buf);
9573 /* For Perl, if you add additional tests here, also add them to
9574 * t/base/num.t for benefit of platforms not using Configure or
9575 * overriding d_Gconvert */
9580 : first add preferred functions to our list
9582 for xxx_convert in $gconvert_preference; do
9583 case $xxx_convert in
9584 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9585 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9588 : then add any others
9589 for xxx_convert in gconvert gcvt sprintf; do
9592 *) xxx_list="$xxx_list $xxx_convert" ;;
9596 case "$d_longdbl$uselongdouble" in
9598 : again, add prefered functions to our list first
9600 for xxx_convert in $gconvert_ld_preference; do
9601 case $xxx_convert in
9602 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9603 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9606 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9607 for xxx_convert in qgcvt sprintf $xxx_list; do
9608 case "$xxx_ld_list" in
9609 $xxx_convert*|*" $xxx_convert"*) ;;
9610 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9613 : if sprintf cannot do long doubles, move it to the end
9614 if test "$d_PRIgldbl" != "$define"; then
9615 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9617 : if no qgcvt, remove it
9618 if test "$d_qgcvt" != "$define"; then
9619 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9622 xxx_list="$xxx_ld_list"
9626 for xxx_convert in $xxx_list; do
9627 echo "Trying $xxx_convert..."
9628 $rm -f try try$_o core
9629 set try -DTRY_$xxx_convert
9630 if eval $compile; then
9631 echo "$xxx_convert() found." >&4
9633 echo "I'll use $xxx_convert to convert floats into a string." >&4
9636 echo "...But $xxx_convert didn't work as I expected."
9640 echo "$xxx_convert NOT found." >&4
9644 if test X$xxx_convert = X; then
9645 echo "*** WHOA THERE!!! ***" >&4
9646 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9650 case "$xxx_convert" in
9651 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9652 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9653 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9654 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9655 "$define$define$define")
9656 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9657 "$define$define$undef")
9658 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9659 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9667 : see if _fwalk exists
9671 : Initialize h_fcntl
9674 : Initialize h_sysfile
9677 : access call always available on UNIX
9681 : locate the flags for 'access()'
9685 $cat >access.c <<EOCP
9686 #include <sys/types.h>
9691 #include <sys/file.h>
9704 : check sys/file.h first, no particular reason here
9705 if $test `./findhdr sys/file.h` && \
9706 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9708 echo "<sys/file.h> defines the *_OK access constants." >&4
9709 elif $test `./findhdr fcntl.h` && \
9710 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9712 echo "<fcntl.h> defines the *_OK access constants." >&4
9713 elif $test `./findhdr unistd.h` && \
9714 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9715 echo "<unistd.h> defines the *_OK access constants." >&4
9717 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9723 : see if accessx exists
9724 set accessx d_accessx
9727 : see if aintl exists
9731 : see if alarm exists
9735 : see if POSIX threads are available
9736 set pthread.h i_pthread
9739 : define a fucntion to check prototypes
9740 $cat > protochk <<EOSH
9743 optimize="$optimize"
9745 prototype="$prototype"
9748 usethreads=$usethreads
9749 i_pthread=$i_pthread
9750 pthread_h_first=$pthread_h_first
9753 $cat >> protochk <<'EOSH'
9758 while test $# -ge 2; do
9760 $define) echo "#include <$2>" >> try.c ;;
9761 literal) echo "$2" >> try.c ;;
9763 # Extra magic for the benefit of systems that need pthread.h
9764 # to be included early to correctly detect threadsafe functions.
9765 # Such functions must guarantee themselves, though, that the usethreads
9766 # and i_pthread have been defined, before calling protochk.
9767 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9768 echo "#include <pthread.h>" >> try.c
9773 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9774 cat >> try.c <<'EOCP'
9775 #ifdef CAN_PROTOTYPE
9776 #define _(args) args
9781 echo "$foo" >> try.c
9782 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9783 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9791 hasproto='varname=$1; func=$2; shift; shift;
9792 while $test $# -ge 2; do
9794 $define) echo "#include <$2>";;
9798 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9799 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9800 echo "$func() prototype found.";
9803 echo "$func() prototype NOT found.";
9810 : see if sys/types.h has to be included
9811 set sys/types.h i_systypes
9814 : see if sys/select.h has to be included
9815 set sys/select.h i_sysselct
9818 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9819 while $test $# -ge 2; do
9821 $define) echo "#include <$2>";;
9825 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9827 if eval $compile; then
9836 : see if we should include time.h, sys/time.h, or both
9838 if test "X$timeincl" = X; then
9839 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9840 $echo $n "I'm now running the test program...$c"
9842 #include <sys/types.h>
9847 #ifdef SYSTIMEKERNEL
9850 #include <sys/time.h>
9853 #include <sys/select.h>
9866 struct timezone tzp;
9868 if (foo.tm_sec == foo.tm_sec)
9871 if (bar.tv_sec == bar.tv_sec)
9878 for s_timezone in '-DS_TIMEZONE' ''; do
9880 for s_timeval in '-DS_TIMEVAL' ''; do
9881 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9882 for i_time in '' '-DI_TIME'; do
9883 for i_systime in '-DI_SYSTIME' ''; do
9886 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9887 if eval $compile; then
9888 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9892 $echo $n "Succeeded with $flags$c"
9904 *SYSTIMEKERNEL*) i_systimek="$define"
9905 timeincl=`./findhdr sys/time.h`
9906 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9907 *) i_systimek="$undef";;
9910 *I_TIME*) i_time="$define"
9911 timeincl=`./findhdr time.h`" $timeincl"
9912 echo "We'll include <time.h>." >&4;;
9913 *) i_time="$undef";;
9916 *I_SYSTIME*) i_systime="$define"
9917 timeincl=`./findhdr sys/time.h`" $timeincl"
9918 echo "We'll include <sys/time.h>." >&4;;
9919 *) i_systime="$undef";;
9923 : see if struct tm knows about tm_zone
9924 case "$i_systime$i_time" in
9927 echo "Checking to see if your struct tm has tm_zone field..." >&4
9928 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9936 case "$d_tm_tm_zone" in
9937 "$define") echo "Yes, it does." ;;
9938 *) echo "No, it doesn't." ;;
9940 : see if struct tm knows about tm_gmtoff
9941 case "$i_systime$i_time" in
9944 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9945 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9953 case "$d_tm_tm_gmtoff" in
9954 "$define") echo "Yes, it does." ;;
9955 *) echo "No, it doesn't." ;;
9958 : see if asctime_r exists
9959 set asctime_r d_asctime_r
9961 case "$d_asctime_r" in
9963 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9964 case "$d_asctime_r_proto:$usethreads" in
9965 ":define") d_asctime_r_proto=define
9966 set d_asctime_r_proto asctime_r $hdrs
9970 case "$d_asctime_r_proto" in
9972 case "$asctime_r_proto" in
9973 ''|0) try='char* asctime_r(const struct tm*, char*);'
9974 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9976 case "$asctime_r_proto" in
9977 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9978 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9980 case "$asctime_r_proto" in
9981 ''|0) try='int asctime_r(const struct tm*, char*);'
9982 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9984 case "$asctime_r_proto" in
9985 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9986 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9988 case "$asctime_r_proto" in
9989 ''|0) d_asctime_r=undef
9991 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9992 * ) case "$asctime_r_proto" in
9993 REENTRANT_PROTO*) ;;
9994 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9996 echo "Prototype: $try" ;;
9999 *) case "$usethreads" in
10000 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10007 *) asctime_r_proto=0
10011 : see if atolf exists
10015 : see if atoll exists
10019 : Look for GCC-style attribute format
10020 case "$d_attribute_format" in
10023 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10024 $cat >attrib.c <<'EOCP'
10026 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10028 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10029 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10030 echo "Your C compiler doesn't support __attribute__((format))."
10033 echo "Your C compiler supports __attribute__((format))."
10037 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10041 *) val="$d_attribute_format" ;;
10043 set d_attribute_format
10047 : Look for GCC-style attribute format with null format allowed
10048 case "$d_printf_format_null" in
10049 '') case "$d_attribute_format" in
10052 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10053 $cat >attrib.c <<EOCP
10055 #$i_stdlib I_STDLIB
10057 #include <stdlib.h>
10059 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10060 int null_printf (char* pat,...) { return (int)pat; }
10061 int main () { exit(null_printf(NULL)); }
10063 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10064 : run the executable in case it produces a run-time warning
10065 if $run ./attrib >>attrib.out 2>&1; then
10066 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10067 echo "Your C compiler doesn't allow __printf__ format to be null."
10070 echo "Your C compiler allows __printf__ format to be null."
10074 echo "Your C compiler executable failed with __printf__ format null."
10078 echo "Your C compiler fails with __printf__ format null."
10085 *) val="$d_printf_format_null" ;;
10087 set d_printf_format_null
10091 : Look for GCC-style attribute malloc
10092 case "$d_attribute_malloc" in
10095 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10096 $cat >attrib.c <<'EOCP'
10098 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10100 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10101 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10102 echo "Your C compiler doesn't support __attribute__((malloc))."
10105 echo "Your C compiler supports __attribute__((malloc))."
10109 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10113 *) val="$d_attribute_malloc" ;;
10115 set d_attribute_malloc
10119 : Look for GCC-style attribute nonnull
10120 case "$d_attribute_nonnull" in
10123 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10124 $cat >attrib.c <<'EOCP'
10126 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10128 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10129 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10130 echo "Your C compiler doesn't support __attribute__((nonnull))."
10133 echo "Your C compiler supports __attribute__((nonnull))."
10137 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10141 *) val="$d_attribute_nonnull" ;;
10143 set d_attribute_nonnull
10147 : Look for GCC-style attribute noreturn
10148 case "$d_attribute_noreturn" in
10151 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10152 $cat >attrib.c <<'EOCP'
10154 void fall_over_dead( void ) __attribute__((noreturn));
10156 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10157 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10158 echo "Your C compiler doesn't support __attribute__((noreturn))."
10161 echo "Your C compiler supports __attribute__((noreturn))."
10165 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10169 *) val="$d_attribute_noreturn" ;;
10171 set d_attribute_noreturn
10175 : Look for GCC-style attribute pure
10176 case "$d_attribute_pure" in
10179 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10180 $cat >attrib.c <<'EOCP'
10182 int square( int n ) __attribute__((pure));
10184 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10185 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10186 echo "Your C compiler doesn't support __attribute__((pure))."
10189 echo "Your C compiler supports __attribute__((pure))."
10193 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10197 *) val="$d_attribute_pure" ;;
10199 set d_attribute_pure
10203 : Look for GCC-style attribute unused
10204 case "$d_attribute_unused" in
10207 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10208 $cat >attrib.c <<'EOCP'
10210 int do_something( int dummy __attribute__((unused)), int n );
10212 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10213 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10214 echo "Your C compiler doesn't support __attribute__((unused))."
10217 echo "Your C compiler supports __attribute__((unused))."
10221 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10225 *) val="$d_attribute_unused" ;;
10227 set d_attribute_unused
10231 : Look for GCC-style attribute warn_unused_result
10232 case "$d_attribute_warn_unused_result" in
10235 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10236 $cat >attrib.c <<'EOCP'
10238 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10240 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10241 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10242 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10245 echo "Your C compiler supports __attribute__((warn_unused_result))."
10249 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10253 *) val="$d_attribute_warn_unused_result" ;;
10255 set d_attribute_warn_unused_result
10259 : see if bcmp exists
10263 : see if bcopy exists
10267 : see if getpgrp exists
10268 set getpgrp d_getpgrp
10271 case "$d_getpgrp" in
10274 echo "Checking to see which flavor of getpgrp is in use..."
10276 #$i_unistd I_UNISTD
10277 #include <sys/types.h>
10279 # include <unistd.h>
10281 #$i_stdlib I_STDLIB
10283 #include <stdlib.h>
10287 if (getuid() == 0) {
10288 printf("(I see you are running Configure as super-user...)\n");
10291 #ifdef TRY_BSD_PGRP
10292 if (getpgrp(1) == 0)
10301 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10302 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10304 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10305 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10308 echo "I can't seem to compile and run the test program."
10310 xxx="a USG one, i.e. you use getpgrp()."
10312 # SVR4 systems can appear rather BSD-ish.
10313 case "$i_unistd" in
10315 xxx="a BSD one, i.e. you use getpgrp(pid)."
10319 xxx="probably a USG one, i.e. you use getpgrp()."
10324 echo "Assuming your getpgrp is $xxx" >&4
10333 : see if setpgrp exists
10334 set setpgrp d_setpgrp
10337 case "$d_setpgrp" in
10340 echo "Checking to see which flavor of setpgrp is in use..."
10342 #$i_unistd I_UNISTD
10343 #include <sys/types.h>
10345 # include <unistd.h>
10347 #$i_stdlib I_STDLIB
10349 #include <stdlib.h>
10353 if (getuid() == 0) {
10354 printf("(I see you are running Configure as super-user...)\n");
10357 #ifdef TRY_BSD_PGRP
10358 if (-1 == setpgrp(1, 1))
10361 if (setpgrp() != -1)
10367 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10368 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10370 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10371 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10374 echo "(I can't seem to compile and run the test program.)"
10376 xxx="a USG one, i.e. you use setpgrp()."
10378 # SVR4 systems can appear rather BSD-ish.
10379 case "$i_unistd" in
10381 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10385 xxx="probably a USG one, i.e. you use setpgrp()."
10390 echo "Assuming your setpgrp is $xxx" >&4
10399 : Look for GCC-style __builtin_choose_expr
10400 case "$d_builtin_choose_expr" in
10403 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10404 $cat >try.c <<'EOCP'
10405 #include <assert.h>
10406 #include <stdlib.h>
10409 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10412 assert( SYRINX(1) == 2112 );
10413 assert( SYRINX(1) != 5150 );
10414 assert( SYRINX(0) == 5150 );
10415 assert( SYRINX(0) != 2112 );
10416 puts( "All good!" );
10422 if eval $compile; then
10423 echo "Your C compiler supports __builtin_choose_expr."
10426 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10430 *) val="$d_builtin_choose_expr" ;;
10433 set d_builtin_choose_expr
10437 : Look for GCC-style __builtin_expect
10438 case "$d_builtin_expect" in
10441 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10442 $cat >builtin.c <<'EOCP'
10445 if ( __builtin_expect(n, 0) ) n = 1;
10449 if eval $compile; then
10450 echo "Your C compiler supports __builtin_choose_expr."
10453 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10457 *) val="$d_builtin_expect" ;;
10460 set d_builtin_expect
10464 : see if bzero exists
10468 : see if stdarg is available
10470 if $test `./findhdr stdarg.h`; then
10471 echo "<stdarg.h> found." >&4
10474 echo "<stdarg.h> NOT found." >&4
10478 : see if varags is available
10480 if $test `./findhdr varargs.h`; then
10481 echo "<varargs.h> found." >&4
10483 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10486 : set up the varargs testing programs
10487 $cat > varargs.c <<EOP
10489 #include <stdarg.h>
10492 #include <varargs.h>
10496 int f(char *p, ...)
10510 p = va_arg(ap, char *);
10516 $cat > varargs <<EOP
10518 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10527 : now check which varargs header should be included
10532 if `./varargs I_STDARG`; then
10534 elif `./varargs I_VARARGS`; then
10539 if `./varargs I_VARARGS`; then
10546 echo "I could not find the definition for va_dcl... You have problems..." >&4
10547 val="$undef"; set i_stdarg; eval $setvar
10548 val="$undef"; set i_varargs; eval $setvar
10553 case "$i_varhdr" in
10555 val="$define"; set i_stdarg; eval $setvar
10556 val="$undef"; set i_varargs; eval $setvar
10559 val="$undef"; set i_stdarg; eval $setvar
10560 val="$define"; set i_varargs; eval $setvar
10563 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10567 : see if the Compiler supports C99 variadic macros
10568 case "$i_stdarg$i_stdlib" in
10570 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10573 #include <stdarg.h>
10575 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10579 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10585 if eval $compile && $run ./try 2>&1 >/dev/null; then
10586 case "`$run ./try`" in
10588 echo "You have C99 variadic macros." >&4
10589 d_c99_variadic_macros="$define"
10592 echo "You don't have functional C99 variadic macros." >&4
10593 d_c99_variadic_macros="$undef"
10597 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10598 d_c99_variadic_macros="$undef"
10603 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10604 d_c99_variadic_macros="$undef"
10608 : see if signal is declared as pointer to function returning int or void
10610 xxx=`./findhdr signal.h`
10611 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10612 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10613 echo "You have int (*signal())() instead of void." >&4
10615 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10616 echo "You have void (*signal())()." >&4
10618 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10619 echo "You have int (*signal())() instead of void." >&4
10621 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10622 echo "You have void (*signal())()." >&4
10625 case "$d_voidsig" in
10627 echo "I can't determine whether signal handler returns void or int..." >&4
10629 rp="What type does your signal handler return?"
10632 v*) val="$define";;
10636 echo "As you already told me, signal handler returns void." >&4
10639 *) echo "As you already told me, signal handler returns int." >&4
10646 case "$d_voidsig" in
10647 "$define") signal_t="void";;
10648 *) signal_t="int";;
10652 : check for ability to cast large floats to 32-bit ints.
10654 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10655 if $test "$intsize" -ge 4; then
10662 #$i_stdlib I_STDLIB
10664 #include <stdlib.h>
10666 #include <sys/types.h>
10667 #include <signal.h>
10668 $signal_t blech(int s) { exit(3); }
10675 signal(SIGFPE, blech);
10677 /* Don't let compiler optimize the test away. Store the number
10678 in a writable string for gcc to pass to sscanf under HP/UX.
10680 sprintf(str, "2147483647");
10681 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10685 /* x86 processors will probably give 0x8000 0000, which is a
10686 sign change. We don't want that. We want to mimic SPARC
10687 behavior here, which is to preserve the sign and give
10690 if (i32 != ($xxx) f)
10696 if eval $compile_ok; then
10700 echo "(I can't seem to compile the test program--assuming it can't)"
10705 echo "Yup, it can."
10708 echo "Nope, it can't."
10715 : check for ability to cast negative floats to unsigned
10717 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10720 #$i_stdlib I_STDLIB
10722 #include <stdlib.h>
10724 #include <sys/types.h>
10725 #include <signal.h>
10726 $signal_t blech(int s) { exit(7); }
10727 $signal_t blech_in_list(int s) { exit(4); }
10728 unsigned long dummy_long(unsigned long p) { return p; }
10729 unsigned int dummy_int(unsigned int p) { return p; }
10730 unsigned short dummy_short(unsigned short p) { return p; }
10734 unsigned long along;
10736 unsigned short ashort;
10740 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10741 a direct f = -123. assignment. gcc-2.8.0 reportedly
10742 optimized the whole file away
10744 /* Store the number in a writable string for gcc to pass to
10745 sscanf under HP/UX.
10747 sprintf(str, "-123");
10748 sscanf(str, "%lf", &f); /* f = -123.; */
10750 signal(SIGFPE, blech);
10751 along = (unsigned long)f;
10752 aint = (unsigned int)f;
10753 ashort = (unsigned short)f;
10754 if (along != (unsigned long)-123)
10756 if (aint != (unsigned int)-123)
10758 if (ashort != (unsigned short)-123)
10760 sprintf(str, "1073741824.");
10761 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10764 along = (unsigned long)f;
10765 if (along != 0x80000000)
10769 along = (unsigned long)f;
10770 if (along != 0x7fffffff)
10774 along = (unsigned long)f;
10775 if (along != 0x80000001)
10779 signal(SIGFPE, blech_in_list);
10780 sprintf(str, "123.");
10781 sscanf(str, "%lf", &f); /* f = 123.; */
10782 along = dummy_long((unsigned long)f);
10783 aint = dummy_int((unsigned int)f);
10784 ashort = dummy_short((unsigned short)f);
10785 if (along != (unsigned long)123)
10787 if (aint != (unsigned int)123)
10789 if (ashort != (unsigned short)123)
10796 if eval $compile_ok; then
10800 echo "(I can't seem to compile the test program--assuming it can't)"
10803 case "$castflags" in
10805 echo "Yup, it can."
10808 echo "Nope, it can't."
10815 : see if vprintf exists
10817 if set vprintf val -f d_vprintf; eval $csym; $val; then
10818 echo 'vprintf() found.' >&4
10821 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
10822 #$i_varargs I_VARARGS
10824 #$i_stdlib I_STDLIB
10825 #$i_unistd I_UNISTD
10828 # include <stdarg.h>
10829 #else /* I_VARARGS */
10830 # include <varargs.h>
10834 # include <unistd.h>
10838 # include <stdlib.h>
10841 #include <stdio.h> /* vsprintf prototype */
10844 void xxx(int n, ...)
10849 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10851 int main() { xxx(1, "foo"); }
10853 #else /* I_VARARGS */
10861 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10863 int main() { xxx("foo"); }
10869 if eval $compile_ok; then
10870 if $run ./try; then
10871 echo "Your vsprintf() returns (int)." >&4
10874 echo "Your vsprintf() returns (char*)." >&4
10878 echo 'I am unable to compile the vsprintf() test program.' >&4
10879 # We shouldn't get here. If we do, assume the standard signature,
10880 # not the old BSD one.
10881 echo 'Guessing that vsprintf() returns (int).' >&4
10885 echo 'vprintf() NOT found.' >&4
10896 : see if chown exists
10900 : see if chroot exists
10901 set chroot d_chroot
10904 : see if chsize exists
10905 set chsize d_chsize
10908 : see if class exists
10912 : see if clearenv exists
10913 set clearenv d_clearenv
10916 hasstruct='varname=$1; struct=$2; shift; shift;
10917 while $test $# -ge 2; do
10919 $define) echo "#include <$2>";;
10923 echo "int main () { struct $struct foo; }" >> try.c;
10925 if eval $compile; then
10936 : see whether socket exists
10938 $echo $n "Hmm... $c" >&4
10939 if set socket val -f d_socket; eval $csym; $val; then
10940 echo "Looks like you have Berkeley networking support." >&4
10942 if set setsockopt val -f; eval $csym; $val; then
10945 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10946 d_oldsock="$define"
10949 if $contains socklib libc.list >/dev/null 2>&1; then
10950 echo "Looks like you have Berkeley networking support." >&4
10952 : we will have to assume that it supports the 4.2 BSD interface
10955 echo "You don't have Berkeley networking in libc$_a..." >&4
10956 if test "X$d_socket" = "X$define"; then
10957 echo "...but you seem to believe that you have sockets." >&4
10959 for net in net socket
10961 if test -f /usr/lib/lib$net$_a; then
10962 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10963 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10964 if $contains socket libc.list >/dev/null 2>&1; then
10969 echo "...but the Wollongong group seems to have hacked it in." >&4
10970 sockethdr="-I/usr/netinclude"
10973 echo "Found Berkeley sockets interface in lib$net." >&4
10974 if $contains setsockopt libc.list >/dev/null 2>&1; then
10977 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10978 d_oldsock="$define"
10984 if test "X$d_socket" != "X$define"; then
10985 echo "or anywhere else I see." >&4
10993 : see if socketpair exists
10994 set socketpair d_sockpair
10999 echo "Checking the availability of certain socket constants..." >&4
11000 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11001 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11003 #include <sys/types.h>
11004 #include <sys/socket.h>
11010 set try; if eval $compile; then
11013 set d_${enum}; eval $setvar
11017 : see if this is a sys/uio.h system
11018 set sys/uio.h i_sysuio
11023 echo "Checking to see if your system supports struct cmsghdr..." >&4
11024 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11026 case "$d_cmsghdr_s" in
11027 "$define") echo "Yes, it does." ;;
11028 *) echo "No, it doesn't." ;;
11032 : check for const keyword
11034 echo 'Checking to see if your C compiler knows about "const"...' >&4
11035 $cat >const.c <<'EOCP'
11036 typedef struct spug { int drokk; } spug;
11040 const spug y = { 0 };
11043 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11045 echo "Yup, it does."
11048 echo "Nope, it doesn't."
11053 : see if copysignl exists
11054 set copysignl d_copysignl
11057 : see if crypt exists
11062 $define) cryptlib='' ;;
11063 *) if set crypt val -f d_crypt; eval $csym; $val; then
11064 echo 'crypt() found.' >&4
11068 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11069 if $test -z "$cryptlib"; then
11070 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11074 if $test -z "$cryptlib"; then
11075 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11079 if $test -z "$cryptlib"; then
11080 cryptlib=`./loc libcrypt$_a "" $libpth`
11084 if $test -z "$cryptlib"; then
11085 echo 'crypt() NOT found.' >&4
11096 : see if this is a crypt.h system
11097 set crypt.h i_crypt
11100 : see if crypt_r exists
11101 set crypt_r d_crypt_r
11103 case "$d_crypt_r" in
11105 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11106 case "$d_crypt_r_proto:$usethreads" in
11107 ":define") d_crypt_r_proto=define
11108 set d_crypt_r_proto crypt_r $hdrs
11112 case "$d_crypt_r_proto" in
11114 case "$crypt_r_proto" in
11115 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11116 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
11118 case "$crypt_r_proto" in
11119 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11120 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
11122 case "$crypt_r_proto" in
11123 ''|0) d_crypt_r=undef
11125 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11126 * ) case "$crypt_r_proto" in
11127 REENTRANT_PROTO*) ;;
11128 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11130 echo "Prototype: $try" ;;
11133 *) case "$usethreads" in
11134 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11145 : get csh whereabouts
11147 'csh') val="$undef" ;;
11148 *) val="$define" ;;
11152 : Respect a hint or command line value for full_csh.
11153 case "$full_csh" in
11154 '') full_csh=$csh ;;
11157 : see if ctermid exists
11158 set ctermid d_ctermid
11161 : see if ctermid_r exists
11162 set ctermid_r d_ctermid_r
11164 case "$d_ctermid_r" in
11166 hdrs="$i_systypes sys/types.h define stdio.h "
11167 case "$d_ctermid_r_proto:$usethreads" in
11168 ":define") d_ctermid_r_proto=define
11169 set d_ctermid_r_proto ctermid_r $hdrs
11173 case "$d_ctermid_r_proto" in
11175 case "$ctermid_r_proto" in
11176 ''|0) try='char* ctermid_r(char*);'
11177 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
11179 case "$ctermid_r_proto" in
11180 ''|0) d_ctermid_r=undef
11182 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11183 * ) case "$ctermid_r_proto" in
11184 REENTRANT_PROTO*) ;;
11185 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11187 echo "Prototype: $try" ;;
11190 *) case "$usethreads" in
11191 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11198 *) ctermid_r_proto=0
11202 : see if ctime_r exists
11203 set ctime_r d_ctime_r
11205 case "$d_ctime_r" in
11207 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11208 case "$d_ctime_r_proto:$usethreads" in
11209 ":define") d_ctime_r_proto=define
11210 set d_ctime_r_proto ctime_r $hdrs
11214 case "$d_ctime_r_proto" in
11216 case "$ctime_r_proto" in
11217 ''|0) try='char* ctime_r(const time_t*, char*);'
11218 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
11220 case "$ctime_r_proto" in
11221 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11222 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
11224 case "$ctime_r_proto" in
11225 ''|0) try='int ctime_r(const time_t*, char*);'
11226 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
11228 case "$ctime_r_proto" in
11229 ''|0) try='int ctime_r(const time_t*, char*, int);'
11230 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
11232 case "$ctime_r_proto" in
11233 ''|0) d_ctime_r=undef
11235 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11236 * ) case "$ctime_r_proto" in
11237 REENTRANT_PROTO*) ;;
11238 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11240 echo "Prototype: $try" ;;
11243 *) case "$usethreads" in
11244 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11255 : see if cuserid exists
11256 set cuserid d_cuserid
11259 : see if this is a limits.h system
11260 set limits.h i_limits
11263 : see if this is a float.h system
11264 set float.h i_float
11267 : See if number of significant digits in a double precision number is known
11269 $cat >dbl_dig.c <<EOM
11270 #$i_limits I_LIMITS
11273 #include <limits.h>
11279 printf("Contains DBL_DIG");
11282 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11283 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11284 echo "DBL_DIG found." >&4
11287 echo "DBL_DIG NOT found." >&4
11294 : see if dbm.h is available
11295 : see if dbmclose exists
11296 set dbmclose d_dbmclose
11299 case "$d_dbmclose" in
11309 *) set rpcsvc/dbm.h i_rpcsvcdbm
11314 *) echo "We won't be including <dbm.h>"
11324 : see if prototype for dbminit is available
11326 set d_dbminitproto dbminit $i_dbm dbm.h
11329 : see if difftime exists
11330 set difftime d_difftime
11333 : see if this is a dirent system
11335 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11337 echo "<dirent.h> found." >&4
11340 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11341 echo "<sys/dir.h> found." >&4
11344 xinc=`./findhdr sys/ndir.h`
11346 echo "<dirent.h> NOT found." >&4
11351 : Look for type of directory structure.
11353 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11355 case "$direntrytype" in
11357 case "$i_dirent" in
11358 $define) guess1='struct dirent' ;;
11359 *) guess1='struct direct' ;;
11362 *) guess1="$direntrytype"
11367 'struct dirent') guess2='struct direct' ;;
11368 *) guess2='struct dirent' ;;
11371 if $contains "$guess1" try.c >/dev/null 2>&1; then
11372 direntrytype="$guess1"
11373 echo "Your directory entries are $direntrytype." >&4
11374 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11375 direntrytype="$guess2"
11376 echo "Your directory entries seem to be $direntrytype." >&4
11378 echo "I don't recognize your system's directory entries." >&4
11379 rp="What type is used for directory entries on this system?"
11382 direntrytype="$ans"
11386 : see if the directory entry stores field length
11388 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11389 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11390 echo "Good, your directory entry keeps length information in d_namlen." >&4
11393 echo "Your directory entry does not know about the d_namlen field." >&4
11400 : Look for DIR.dd_fd
11401 case "$i_dirent" in
11403 echo "Checking to see if DIR has a dd_fd member variable" >&4
11405 #$i_stdlib I_STDLIB
11407 #include <stdlib.h>
11409 #include <dirent.h>
11419 if eval $compile; then
11420 echo "Yes, it does."
11423 echo "No, it does not."
11428 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11436 : see if this is an sysdir system
11437 set sys/dir.h i_sysdir
11440 : see if this is an sysndir system
11441 set sys/ndir.h i_sysndir
11446 $cat >dirfd.c <<EOM
11448 #$i_stdlib I_STDLIB
11450 #include <stdlib.h>
11452 #$i_dirent I_DIRENT /**/
11453 #$i_sysdir I_SYS_DIR /**/
11454 #$i_sysndir I_SYS_NDIR /**/
11455 #$i_systypes I_SYS_TYPES /**/
11456 #if defined(I_SYS_TYPES)
11457 #include <sys/types.h>
11459 #if defined(I_DIRENT)
11460 #include <dirent.h>
11461 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11462 #include <sys/dir.h>
11466 #include <sys/ndir.h>
11470 #include <ndir.h> /* may be wrong in the future */
11472 #include <sys/dir.h>
11478 DIR *dirp = opendir(".");
11479 if (dirfd(dirp) >= 0)
11487 if eval $compile; then
11491 $define) echo "dirfd() found." >&4 ;;
11492 *) echo "dirfd() NOT found." >&4 ;;
11498 : see if dlerror exists
11501 set dlerror d_dlerror
11505 : see if dlfcn is available
11506 set dlfcn.h i_dlfcn
11513 On a few systems, the dynamically loaded modules that perl generates and uses
11514 will need a different extension than shared libs. The default will probably
11520 *) dflt="$dlext" ;;
11522 rp='What is the extension of dynamically loaded modules'
11531 : Check if dlsym need a leading underscore
11537 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11538 $cat >dyna.c <<'EOM'
11545 #$i_stdlib I_STDLIB
11547 #include <stdlib.h>
11551 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11553 #include <sys/types.h>
11558 extern int fred() ;
11567 int mode = RTLD_LAZY ;
11569 handle = dlopen("./dyna.$dlext", mode) ;
11570 if (handle == NULL) {
11575 symbol = dlsym(handle, "fred") ;
11576 if (symbol == NULL) {
11577 /* try putting a leading underscore */
11578 symbol = dlsym(handle, "_fred") ;
11579 if (symbol == NULL) {
11592 : Call the object file tmp-dyna.o in case dlext=o.
11593 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11594 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11595 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11596 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11599 1) echo "Test program failed using dlopen." >&4
11600 echo "Perhaps you should not use dynamic loading." >&4;;
11601 2) echo "Test program failed using dlsym." >&4
11602 echo "Perhaps you should not use dynamic loading." >&4;;
11603 3) echo "dlsym needs a leading underscore" >&4
11605 4) echo "dlsym doesn't need a leading underscore." >&4;;
11608 echo "I can't compile and run the test program." >&4
11609 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11614 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11619 : see if drand48_r exists
11620 set drand48_r d_drand48_r
11622 case "$d_drand48_r" in
11624 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11625 case "$d_drand48_r_proto:$usethreads" in
11626 ":define") d_drand48_r_proto=define
11627 set d_drand48_r_proto drand48_r $hdrs
11631 case "$d_drand48_r_proto" in
11633 case "$drand48_r_proto" in
11634 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11635 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11637 case "$drand48_r_proto" in
11638 ''|0) d_drand48_r=undef
11640 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11641 * ) case "$drand48_r_proto" in
11642 REENTRANT_PROTO*) ;;
11643 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11645 echo "Prototype: $try" ;;
11648 *) case "$usethreads" in
11649 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11656 *) drand48_r_proto=0
11660 : see if prototype for drand48 is available
11662 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11665 : see if dup2 exists
11669 : see if eaccess exists
11670 set eaccess d_eaccess
11673 : see if endgrent exists
11674 set endgrent d_endgrent
11677 : see if this is an grp system
11683 xxx=`./findhdr grp.h`
11684 $cppstdin $cppflags $cppminus < $xxx >$$.h
11686 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11698 set d_grpasswd; eval $setvar
11702 : see if endgrent_r exists
11703 set endgrent_r d_endgrent_r
11705 case "$d_endgrent_r" in
11707 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11708 case "$d_endgrent_r_proto:$usethreads" in
11709 ":define") d_endgrent_r_proto=define
11710 set d_endgrent_r_proto endgrent_r $hdrs
11714 case "$d_endgrent_r_proto" in
11716 case "$endgrent_r_proto" in
11717 ''|0) try='int endgrent_r(FILE**);'
11718 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11720 case "$endgrent_r_proto" in
11721 ''|0) try='void endgrent_r(FILE**);'
11722 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11724 case "$endgrent_r_proto" in
11725 ''|0) d_endgrent_r=undef
11727 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11728 * ) case "$endgrent_r_proto" in
11729 REENTRANT_PROTO*) ;;
11730 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11732 echo "Prototype: $try" ;;
11735 *) case "$usethreads" in
11736 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11743 *) endgrent_r_proto=0
11747 : see if endhostent exists
11748 set endhostent d_endhent
11751 : see if this is a netdb.h system
11752 set netdb.h i_netdb
11755 : see if endhostent_r exists
11756 set endhostent_r d_endhostent_r
11758 case "$d_endhostent_r" in
11760 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11761 case "$d_endhostent_r_proto:$usethreads" in
11762 ":define") d_endhostent_r_proto=define
11763 set d_endhostent_r_proto endhostent_r $hdrs
11767 case "$d_endhostent_r_proto" in
11769 case "$endhostent_r_proto" in
11770 ''|0) try='int endhostent_r(struct hostent_data*);'
11771 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11773 case "$endhostent_r_proto" in
11774 ''|0) try='void endhostent_r(struct hostent_data*);'
11775 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11777 case "$endhostent_r_proto" in
11778 ''|0) d_endhostent_r=undef
11779 endhostent_r_proto=0
11780 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11781 * ) case "$endhostent_r_proto" in
11782 REENTRANT_PROTO*) ;;
11783 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11785 echo "Prototype: $try" ;;
11788 *) case "$usethreads" in
11789 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11791 d_endhostent_r=undef
11792 endhostent_r_proto=0
11796 *) endhostent_r_proto=0
11800 : see if endnetent exists
11801 set endnetent d_endnent
11804 : see if endnetent_r exists
11805 set endnetent_r d_endnetent_r
11807 case "$d_endnetent_r" in
11809 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11810 case "$d_endnetent_r_proto:$usethreads" in
11811 ":define") d_endnetent_r_proto=define
11812 set d_endnetent_r_proto endnetent_r $hdrs
11816 case "$d_endnetent_r_proto" in
11818 case "$endnetent_r_proto" in
11819 ''|0) try='int endnetent_r(struct netent_data*);'
11820 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11822 case "$endnetent_r_proto" in
11823 ''|0) try='void endnetent_r(struct netent_data*);'
11824 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11826 case "$endnetent_r_proto" in
11827 ''|0) d_endnetent_r=undef
11828 endnetent_r_proto=0
11829 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11830 * ) case "$endnetent_r_proto" in
11831 REENTRANT_PROTO*) ;;
11832 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11834 echo "Prototype: $try" ;;
11837 *) case "$usethreads" in
11838 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11840 d_endnetent_r=undef
11841 endnetent_r_proto=0
11845 *) endnetent_r_proto=0
11849 : see if endprotoent exists
11850 set endprotoent d_endpent
11853 : see if endprotoent_r exists
11854 set endprotoent_r d_endprotoent_r
11856 case "$d_endprotoent_r" in
11858 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11859 case "$d_endprotoent_r_proto:$usethreads" in
11860 ":define") d_endprotoent_r_proto=define
11861 set d_endprotoent_r_proto endprotoent_r $hdrs
11865 case "$d_endprotoent_r_proto" in
11867 case "$endprotoent_r_proto" in
11868 ''|0) try='int endprotoent_r(struct protoent_data*);'
11869 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11871 case "$endprotoent_r_proto" in
11872 ''|0) try='void endprotoent_r(struct protoent_data*);'
11873 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11875 case "$endprotoent_r_proto" in
11876 ''|0) d_endprotoent_r=undef
11877 endprotoent_r_proto=0
11878 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11879 * ) case "$endprotoent_r_proto" in
11880 REENTRANT_PROTO*) ;;
11881 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11883 echo "Prototype: $try" ;;
11886 *) case "$usethreads" in
11887 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11889 d_endprotoent_r=undef
11890 endprotoent_r_proto=0
11894 *) endprotoent_r_proto=0
11898 : see if endpwent exists
11899 set endpwent d_endpwent
11902 : see if this is a pwd.h system
11908 xxx=`./findhdr pwd.h`
11909 $cppstdin $cppflags $cppminus < $xxx >$$.h
11911 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11919 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11927 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11935 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11943 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11951 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11959 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11967 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11979 set d_pwquota; eval $setvar
11980 set d_pwage; eval $setvar
11981 set d_pwchange; eval $setvar
11982 set d_pwclass; eval $setvar
11983 set d_pwexpire; eval $setvar
11984 set d_pwcomment; eval $setvar
11985 set d_pwgecos; eval $setvar
11986 set d_pwpasswd; eval $setvar
11990 : see if endpwent_r exists
11991 set endpwent_r d_endpwent_r
11993 case "$d_endpwent_r" in
11995 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11996 case "$d_endpwent_r_proto:$usethreads" in
11997 ":define") d_endpwent_r_proto=define
11998 set d_endpwent_r_proto endpwent_r $hdrs
12002 case "$d_endpwent_r_proto" in
12004 case "$endpwent_r_proto" in
12005 ''|0) try='int endpwent_r(FILE**);'
12006 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
12008 case "$endpwent_r_proto" in
12009 ''|0) try='void endpwent_r(FILE**);'
12010 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
12012 case "$endpwent_r_proto" in
12013 ''|0) d_endpwent_r=undef
12015 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12016 * ) case "$endpwent_r_proto" in
12017 REENTRANT_PROTO*) ;;
12018 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12020 echo "Prototype: $try" ;;
12023 *) case "$usethreads" in
12024 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12031 *) endpwent_r_proto=0
12035 : see if endservent exists
12036 set endservent d_endsent
12039 : see if endservent_r exists
12040 set endservent_r d_endservent_r
12042 case "$d_endservent_r" in
12044 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12045 case "$d_endservent_r_proto:$usethreads" in
12046 ":define") d_endservent_r_proto=define
12047 set d_endservent_r_proto endservent_r $hdrs
12051 case "$d_endservent_r_proto" in
12053 case "$endservent_r_proto" in
12054 ''|0) try='int endservent_r(struct servent_data*);'
12055 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
12057 case "$endservent_r_proto" in
12058 ''|0) try='void endservent_r(struct servent_data*);'
12059 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
12061 case "$endservent_r_proto" in
12062 ''|0) d_endservent_r=undef
12063 endservent_r_proto=0
12064 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12065 * ) case "$endservent_r_proto" in
12066 REENTRANT_PROTO*) ;;
12067 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12069 echo "Prototype: $try" ;;
12072 *) case "$usethreads" in
12073 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12075 d_endservent_r=undef
12076 endservent_r_proto=0
12080 *) endservent_r_proto=0
12084 : Locate the flags for 'open()'
12087 #include <sys/types.h>
12092 #include <sys/file.h>
12094 #$i_stdlib I_STDLIB
12096 #include <stdlib.h>
12107 : check sys/file.h first to get FREAD on Sun
12108 if $test `./findhdr sys/file.h` && \
12109 set try -DI_SYS_FILE && eval $compile; then
12111 echo "<sys/file.h> defines the O_* constants..." >&4
12112 if $run ./try; then
12113 echo "and you have the 3 argument form of open()." >&4
12116 echo "but not the 3 argument form of open(). Oh, well." >&4
12119 elif $test `./findhdr fcntl.h` && \
12120 set try -DI_FCNTL && eval $compile; then
12122 echo "<fcntl.h> defines the O_* constants..." >&4
12123 if $run ./try; then
12124 echo "and you have the 3 argument form of open()." >&4
12127 echo "but not the 3 argument form of open(). Oh, well." >&4
12132 echo "I can't find the O_* constant definitions! You got problems." >&4
12138 : see which of string.h or strings.h is needed
12140 strings=`./findhdr string.h`
12141 if $test "$strings" && $test -r "$strings"; then
12142 echo "Using <string.h> instead of <strings.h>." >&4
12146 strings=`./findhdr strings.h`
12147 if $test "$strings" && $test -r "$strings"; then
12148 echo "Using <strings.h> instead of <string.h>." >&4
12150 echo "No string header found -- You'll surely have problems." >&4
12155 case "$i_string" in
12156 "$undef") strings=`./findhdr strings.h`;;
12157 *) strings=`./findhdr string.h`;;
12160 : see if this is a sys/file.h system
12165 : do we need to include sys/file.h ?
12169 if $h_sysfile; then
12171 echo "We'll be including <sys/file.h>." >&4
12174 echo "We won't be including <sys/file.h>." >&4
12184 : see if fcntl.h is there
12189 : see if we can include fcntl.h
12195 echo "We'll be including <fcntl.h>." >&4
12198 if $h_sysfile; then
12199 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12201 echo "We won't be including <fcntl.h>." >&4
12213 : see if fork exists
12217 : see if pipe exists
12221 : check for non-blocking I/O stuff
12222 case "$h_sysfile" in
12223 true) echo "#include <sys/file.h>" > head.c;;
12226 true) echo "#include <fcntl.h>" > head.c;;
12227 *) echo "#include <sys/fcntl.h>" > head.c;;
12232 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12233 case "$o_nonblock" in
12235 $cat head.c > try.c
12236 $cat >>try.c <<EOCP
12238 #$i_stdlib I_STDLIB
12240 #include <stdlib.h>
12248 printf("O_NONBLOCK\n");
12252 printf("O_NDELAY\n");
12256 printf("FNDELAY\n");
12263 if eval $compile_ok; then
12264 o_nonblock=`$run ./try`
12265 case "$o_nonblock" in
12266 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12267 *) echo "Seems like we can use $o_nonblock.";;
12270 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12273 *) echo "Using $hint value $o_nonblock.";;
12278 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12281 case "$d_fork:$d_pipe" in
12283 $cat head.c > try.c
12284 $cat >>try.c <<EOCP
12286 #include <sys/types.h>
12287 #include <signal.h>
12289 #$i_stdlib I_STDLIB
12291 #include <stdlib.h>
12297 #define MY_O_NONBLOCK $o_nonblock
12298 #ifndef errno /* XXX need better Configure test */
12301 #$i_unistd I_UNISTD
12303 #include <unistd.h>
12305 #$i_string I_STRING
12307 #include <string.h>
12309 #include <strings.h>
12311 $signal_t blech(int x) { exit(3); }
12313 $cat >> try.c <<'EOCP'
12321 pipe(pd); /* Down: child -> parent */
12322 pipe(pu); /* Up: parent -> child */
12325 close(pd[1]); /* Parent reads from pd[0] */
12326 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12328 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12333 signal(SIGALRM, blech);
12335 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12337 sprintf(string, "%d\n", ret);
12338 write(2, string, strlen(string));
12341 if (errno == EAGAIN) {
12342 printf("EAGAIN\n");
12347 if (errno == EWOULDBLOCK)
12348 printf("EWOULDBLOCK\n");
12351 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12352 sleep(2); /* Give it time to close our pipe */
12354 ret = read(pd[0], buf, 1); /* Should read EOF */
12356 sprintf(string, "%d\n", ret);
12357 write(4, string, strlen(string));
12361 close(pd[0]); /* We write to pd[1] */
12362 close(pu[1]); /* We read from pu[0] */
12363 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12364 close(pd[1]); /* Pipe pd is now fully closed! */
12365 exit(0); /* Bye bye, thank you for playing! */
12369 if eval $compile_ok; then
12370 echo "$startsh" >mtry
12371 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12373 ./mtry >/dev/null 2>&1
12375 0) eagain=`$cat try.out`;;
12376 1) echo "Could not perform non-blocking setting!";;
12377 2) echo "I did a successful read() for something that was not there!";;
12378 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12379 4) echo "Could not find F_SETFL!";;
12380 *) echo "Something terribly wrong happened during testing.";;
12382 rd_nodata=`$cat try.ret`
12383 echo "A read() system call with no data present returns $rd_nodata."
12384 case "$rd_nodata" in
12387 echo "(That's peculiar, fixing that to be -1.)"
12393 echo "Forcing errno EAGAIN on read() with no data available."
12397 echo "Your read() sets errno to $eagain when no data is available."
12400 status=`$cat try.err`
12402 0) echo "And it correctly returns 0 to signal EOF.";;
12403 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12404 *) echo "However, your read() returns '$status' on EOF??";;
12407 if test "$status" = "$rd_nodata"; then
12408 echo "WARNING: you can't distinguish between EOF and no data!"
12412 echo "I can't compile the test program--assuming errno EAGAIN will do."
12416 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12425 echo "Using $hint value $eagain."
12426 echo "Your read() returns $rd_nodata when no data is present."
12427 case "$d_eofnblk" in
12428 "$define") echo "And you can see EOF because read() returns 0.";;
12429 "$undef") echo "But you can't see EOF status from read() returned value.";;
12431 echo "(Assuming you can't see EOF status from read anyway.)"
12437 $rm_try head.c mtry
12439 : see if _ptr and _cnt from stdio act std
12442 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12443 echo "(Looks like you have stdio.h from BSD.)"
12444 case "$stdio_ptr" in
12445 '') stdio_ptr='((fp)->_p)'
12448 *) ptr_lval=$d_stdio_ptr_lval;;
12450 case "$stdio_cnt" in
12451 '') stdio_cnt='((fp)->_r)'
12454 *) cnt_lval=$d_stdio_cnt_lval;;
12456 case "$stdio_base" in
12457 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12459 case "$stdio_bufsiz" in
12460 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12462 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12463 echo "(Looks like you have stdio.h from Linux.)"
12464 case "$stdio_ptr" in
12465 '') stdio_ptr='((fp)->_IO_read_ptr)'
12468 *) ptr_lval=$d_stdio_ptr_lval;;
12470 case "$stdio_cnt" in
12471 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12474 *) cnt_lval=$d_stdio_cnt_lval;;
12476 case "$stdio_base" in
12477 '') stdio_base='((fp)->_IO_read_base)';;
12479 case "$stdio_bufsiz" in
12480 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12483 case "$stdio_ptr" in
12484 '') stdio_ptr='((fp)->_ptr)'
12487 *) ptr_lval=$d_stdio_ptr_lval;;
12489 case "$stdio_cnt" in
12490 '') stdio_cnt='((fp)->_cnt)'
12493 *) cnt_lval=$d_stdio_cnt_lval;;
12495 case "$stdio_base" in
12496 '') stdio_base='((fp)->_base)';;
12498 case "$stdio_bufsiz" in
12499 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12503 : test whether _ptr and _cnt really work
12504 echo "Checking how std your stdio is..." >&4
12507 #$i_stdlib I_STDLIB
12509 #include <stdlib.h>
12511 #define FILE_ptr(fp) $stdio_ptr
12512 #define FILE_cnt(fp) $stdio_cnt
12514 FILE *fp = fopen("try.c", "r");
12517 18 <= FILE_cnt(fp) &&
12518 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12526 if eval $compile && $to try.c; then
12527 if $run ./try; then
12528 echo "Your stdio acts pretty std."
12531 echo "Your stdio isn't very std."
12534 echo "Your stdio doesn't appear very std."
12538 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12539 # direct buffer manipulation no longer works. The Configure tests
12540 # should be changed to correctly detect this, but until then,
12541 # the following check should at least let perl compile and run.
12542 # (This quick fix should be updated before 5.8.1.)
12543 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12544 # A. Dougherty, June 3, 2002.
12545 case "$d_gnulibc" in
12547 case "$gnulibc_version" in
12551 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12560 : Can _ptr be used as an lvalue?
12561 case "$d_stdstdio$ptr_lval" in
12562 $define$define) val=$define ;;
12565 set d_stdio_ptr_lval
12568 : Can _cnt be used as an lvalue?
12569 case "$d_stdstdio$cnt_lval" in
12570 $define$define) val=$define ;;
12573 set d_stdio_cnt_lval
12577 : test whether setting _ptr sets _cnt as a side effect
12578 d_stdio_ptr_lval_sets_cnt="$undef"
12579 d_stdio_ptr_lval_nochange_cnt="$undef"
12580 case "$d_stdio_ptr_lval$d_stdstdio" in
12582 echo "Checking to see what happens if we set the stdio ptr..." >&4
12585 /* Can we scream? */
12586 /* Eat dust sed :-) */
12587 /* In the buffer space, no one can hear you scream. */
12588 #$i_stdlib I_STDLIB
12590 #include <stdlib.h>
12592 #define FILE_ptr(fp) $stdio_ptr
12593 #define FILE_cnt(fp) $stdio_cnt
12594 #include <sys/types.h>
12596 FILE *fp = fopen("try.c", "r");
12601 puts("Fail even to read");
12604 c = getc(fp); /* Read away the first # */
12606 puts("Fail even to read");
12610 18 <= FILE_cnt(fp) &&
12611 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12613 puts("Fail even to read");
12616 ptr = (char*) FILE_ptr(fp);
12617 cnt = (size_t)FILE_cnt(fp);
12619 FILE_ptr(fp) += 42;
12621 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12622 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12625 if (FILE_cnt(fp) <= 20) {
12626 printf ("Fail (<20 chars to test)");
12629 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12630 puts("Fail compare");
12633 if (cnt == FILE_cnt(fp)) {
12634 puts("Pass_unchanged");
12637 if (FILE_cnt(fp) == (cnt - 42)) {
12638 puts("Pass_changed");
12641 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12647 if eval $compile && $to try.c; then
12648 case `$run ./try` in
12650 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12651 d_stdio_ptr_lval_sets_cnt="$define" ;;
12653 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12654 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12656 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12658 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12661 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12667 : see if _base is also standard
12669 case "$d_stdstdio" in
12673 #$i_stdlib I_STDLIB
12675 #include <stdlib.h>
12677 #define FILE_base(fp) $stdio_base
12678 #define FILE_bufsiz(fp) $stdio_bufsiz
12680 FILE *fp = fopen("try.c", "r");
12683 19 <= FILE_bufsiz(fp) &&
12684 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12691 if eval $compile && $to try.c; then
12692 if $run ./try; then
12693 echo "And its _base field acts std."
12696 echo "But its _base field isn't std."
12699 echo "However, it seems to be lacking the _base field."
12707 : see if fast_stdio exists
12709 case "$d_stdstdio:$d_stdio_ptr_lval" in
12711 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12713 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12724 : see if fchdir exists
12725 set fchdir d_fchdir
12728 : see if fchmod exists
12729 set fchmod d_fchmod
12732 : see if fchown exists
12733 set fchown d_fchown
12736 : see if this is an fcntl system
12741 : See if fcntl-based locking works.
12743 #$i_stdlib I_STDLIB
12745 #include <stdlib.h>
12747 #include <unistd.h>
12749 #include <signal.h>
12750 $signal_t blech(int x) { exit(3); }
12752 #if defined(F_SETLK) && defined(F_SETLKW)
12753 struct flock flock;
12755 fd = open("try.c", O_RDONLY);
12756 flock.l_type = F_RDLCK;
12757 flock.l_whence = SEEK_SET;
12758 flock.l_start = flock.l_len = 0;
12759 signal(SIGALRM, blech);
12761 retval = fcntl(fd, F_SETLK, &flock);
12763 (retval < 0 ? exit(2) : exit(0));
12769 echo "Checking if fcntl-based file locking works... "
12773 if eval $compile_ok; then
12774 if $run ./try; then
12775 echo "Yes, it seems to work."
12778 echo "Nope, it didn't work."
12783 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12784 *** This is (almost) impossible.
12785 *** If your NFS lock daemons are not feeling well, something like
12786 *** this may happen, please investigate. Cannot continue, aborting.
12794 echo "I'm unable to compile the test program, so I'll assume not."
12799 echo "Nope, since you don't even have fcntl()."
12802 set d_fcntl_can_lock
12806 : check for fd_set items
12809 Checking to see how well your C compiler handles fd_set and friends ...
12812 #$i_stdlib I_STDLIB
12814 #include <stdlib.h>
12816 #$i_systime I_SYS_TIME
12817 #$i_sysselct I_SYS_SELECT
12818 #$d_socket HAS_SOCKET
12819 #include <sys/types.h>
12821 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12824 #include <sys/time.h>
12826 #ifdef I_SYS_SELECT
12827 #include <sys/select.h>
12836 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12844 if eval $compile; then
12845 d_fds_bits="$define"
12847 echo "Well, your system knows about the normal fd_set typedef..." >&4
12848 if $run ./try; then
12849 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12850 d_fd_macros="$define"
12853 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12855 d_fd_macros="$undef"
12859 Hmm, your compiler has some difficulty with fd_set. Checking further...
12862 if eval $compile; then
12863 d_fds_bits="$undef"
12865 echo "Well, your system has some sort of fd_set available..." >&4
12866 if $run ./try; then
12867 echo "and you have the normal fd_set macros." >&4
12868 d_fd_macros="$define"
12871 but not the normal fd_set macros! Gross! More work for me...
12873 d_fd_macros="$undef"
12876 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12878 d_fds_bits="$undef"
12879 d_fd_macros="$undef"
12884 : see if fgetpos exists
12885 set fgetpos d_fgetpos
12888 : see if finite exists
12889 set finite d_finite
12892 : see if finitel exists
12893 set finitel d_finitel
12896 : see if flock exists
12900 : see if prototype for flock is available
12902 set d_flockproto flock $i_sysfile sys/file.h
12905 : see if fp_class exists
12906 set fp_class d_fp_class
12909 : see if pathconf exists
12910 set pathconf d_pathconf
12913 : see if fpathconf exists
12914 set fpathconf d_fpathconf
12917 : see if fpclass exists
12918 set fpclass d_fpclass
12921 : see if fpclassify exists
12922 set fpclassify d_fpclassify
12925 : see if fpclassl exists
12926 set fpclassl d_fpclassl
12930 : check for fpos64_t
12932 echo "Checking to see if you have fpos64_t..." >&4
12935 int main() { fpos64_t x = 7; }
12938 if eval $compile; then
12940 echo "You have fpos64_t."
12943 echo "You do not have fpos64_t."
12944 case "$fpossize" in
12945 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12952 : see if frexpl exists
12953 set frexpl d_frexpl
12956 : see if this is a sys/param system
12957 set sys/param.h i_sysparam
12960 : see if this is a sys/mount.h system
12961 set sys/mount.h i_sysmount
12966 echo "Checking to see if your system supports struct fs_data..." >&4
12967 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12969 case "$d_fs_data_s" in
12970 "$define") echo "Yes, it does." ;;
12971 *) echo "No, it doesn't." ;;
12974 : see if fseeko exists
12975 set fseeko d_fseeko
12977 case "$longsize" in
12978 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12981 : see if fsetpos exists
12982 set fsetpos d_fsetpos
12986 : see if fstatfs exists
12987 set fstatfs d_fstatfs
12991 : see if statvfs exists
12992 set statvfs d_statvfs
12995 : see if fstatvfs exists
12996 set fstatvfs d_fstatvfs
13000 : see if fsync exists
13004 : see if ftello exists
13005 set ftello d_ftello
13007 case "$longsize" in
13008 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13012 : check for a working futimes
13014 echo "Checking if you have a working futimes()" >&4
13017 #include <sys/time.h>
13024 fd = open ("try.c", O_RDWR);
13025 if (-1 == fd) exit (1);
13026 rv = futimes (fd, NULL);
13027 exit (rv == -1 ? errno : 0);
13031 if eval $compile; then
13035 0) echo "Yes, you have" >&4
13036 d_futimes="$define"
13038 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13042 echo "No, it does not (probably harmless)" >&4
13046 : see if getcwd exists
13047 set getcwd d_getcwd
13050 : see if getespwnam exists
13051 set getespwnam d_getespwnam
13055 : see if getfsstat exists
13056 set getfsstat d_getfsstat
13059 : see if getgrent exists
13060 set getgrent d_getgrent
13063 : see if getgrent_r exists
13064 set getgrent_r d_getgrent_r
13066 case "$d_getgrent_r" in
13068 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13069 case "$d_getgrent_r_proto:$usethreads" in
13070 ":define") d_getgrent_r_proto=define
13071 set d_getgrent_r_proto getgrent_r $hdrs
13075 case "$d_getgrent_r_proto" in
13077 case "$getgrent_r_proto" in
13078 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13079 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13081 case "$getgrent_r_proto" in
13082 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13083 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13085 case "$getgrent_r_proto" in
13086 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13087 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
13089 case "$getgrent_r_proto" in
13090 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13091 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
13093 case "$getgrent_r_proto" in
13094 ''|0) try='int getgrent_r(struct group*, char*, int);'
13095 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
13097 case "$getgrent_r_proto" in
13098 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13099 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13101 case "$getgrent_r_proto" in
13102 ''|0) d_getgrent_r=undef
13104 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13105 * ) case "$getgrent_r_proto" in
13106 REENTRANT_PROTO*) ;;
13107 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13109 echo "Prototype: $try" ;;
13112 *) case "$usethreads" in
13113 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13120 *) getgrent_r_proto=0
13124 : see if getgrgid_r exists
13125 set getgrgid_r d_getgrgid_r
13127 case "$d_getgrgid_r" in
13129 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13130 case "$d_getgrgid_r_proto:$usethreads" in
13131 ":define") d_getgrgid_r_proto=define
13132 set d_getgrgid_r_proto getgrgid_r $hdrs
13136 case "$d_getgrgid_r_proto" in
13138 case "$getgrgid_r_proto" in
13139 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13140 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13142 case "$getgrgid_r_proto" in
13143 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13144 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13146 case "$getgrgid_r_proto" in
13147 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13148 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13150 case "$getgrgid_r_proto" in
13151 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13152 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13154 case "$getgrgid_r_proto" in
13155 ''|0) d_getgrgid_r=undef
13157 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13158 * ) case "$getgrgid_r_proto" in
13159 REENTRANT_PROTO*) ;;
13160 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13162 echo "Prototype: $try" ;;
13165 *) case "$usethreads" in
13166 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13173 *) getgrgid_r_proto=0
13177 : see if getgrnam_r exists
13178 set getgrnam_r d_getgrnam_r
13180 case "$d_getgrnam_r" in
13182 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13183 case "$d_getgrnam_r_proto:$usethreads" in
13184 ":define") d_getgrnam_r_proto=define
13185 set d_getgrnam_r_proto getgrnam_r $hdrs
13189 case "$d_getgrnam_r_proto" in
13191 case "$getgrnam_r_proto" in
13192 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13193 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13195 case "$getgrnam_r_proto" in
13196 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13197 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13199 case "$getgrnam_r_proto" in
13200 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13201 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13203 case "$getgrnam_r_proto" in
13204 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13205 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13207 case "$getgrnam_r_proto" in
13208 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13209 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13211 case "$getgrnam_r_proto" in
13212 ''|0) d_getgrnam_r=undef
13214 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13215 * ) case "$getgrnam_r_proto" in
13216 REENTRANT_PROTO*) ;;
13217 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13219 echo "Prototype: $try" ;;
13222 *) case "$usethreads" in
13223 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13230 *) getgrnam_r_proto=0
13234 : see if gethostbyaddr exists
13235 set gethostbyaddr d_gethbyaddr
13238 : see if gethostbyname exists
13239 set gethostbyname d_gethbyname
13242 : see if gethostent exists
13243 set gethostent d_gethent
13246 : see how we will look up host name
13249 if set gethostname val -f d_gethname; eval $csym; $val; then
13250 echo 'gethostname() found.' >&4
13251 d_gethname="$define"
13254 if set uname val -f d_uname; eval $csym; $val; then
13257 uname() was found, but you're running xenix, and older versions of xenix
13258 have a broken uname(). If you don't really know whether your xenix is old
13259 enough to have a broken system call, use the default answer.
13264 "$define") dflt=n;;
13266 rp='Is your uname() broken?'
13269 n*) d_uname="$define"; call=uname;;
13272 echo 'uname() found.' >&4
13279 case "$d_gethname" in
13280 '') d_gethname="$undef";;
13283 '') d_uname="$undef";;
13285 case "$d_uname$d_gethname" in
13290 Every now and then someone has a $call() that lies about the hostname
13291 but can't be fixed for political or economic reasons. If you wish, I can
13292 pretend $call() isn't there and maybe compute hostname at run-time
13293 thanks to the '$phostname' command.
13296 rp="Shall I ignore $call() from now on?"
13299 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13302 case "$phostname" in
13303 '') aphostname='';;
13304 *) case "$aphostname" in
13306 *) set X $phostname
13310 file=`./loc $file $file $pth`
13311 aphostname=`echo $file $*`
13316 case "$d_uname$d_gethname" in
13319 case "$phostname" in
13321 echo "There will be no way for $package to get your hostname." >&4;;
13323 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13327 case "$d_phostname" in
13328 '') d_phostname="$undef";;
13331 : see if gethostbyaddr_r exists
13332 set gethostbyaddr_r d_gethostbyaddr_r
13334 case "$d_gethostbyaddr_r" in
13336 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13337 case "$d_gethostbyaddr_r_proto:$usethreads" in
13338 ":define") d_gethostbyaddr_r_proto=define
13339 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13343 case "$d_gethostbyaddr_r_proto" in
13345 case "$gethostbyaddr_r_proto" in
13346 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13347 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13349 case "$gethostbyaddr_r_proto" in
13350 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13351 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13353 case "$gethostbyaddr_r_proto" in
13354 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13355 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13357 case "$gethostbyaddr_r_proto" in
13358 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13359 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13361 case "$gethostbyaddr_r_proto" in
13362 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13363 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13365 case "$gethostbyaddr_r_proto" in
13366 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13367 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13369 case "$gethostbyaddr_r_proto" in
13370 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13371 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13373 case "$gethostbyaddr_r_proto" in
13374 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13375 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13377 case "$gethostbyaddr_r_proto" in
13378 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13379 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13381 case "$gethostbyaddr_r_proto" in
13382 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13383 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13385 case "$gethostbyaddr_r_proto" in
13386 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13387 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13389 case "$gethostbyaddr_r_proto" in
13390 ''|0) d_gethostbyaddr_r=undef
13391 gethostbyaddr_r_proto=0
13392 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13393 * ) case "$gethostbyaddr_r_proto" in
13394 REENTRANT_PROTO*) ;;
13395 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13397 echo "Prototype: $try" ;;
13400 *) case "$usethreads" in
13401 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13403 d_gethostbyaddr_r=undef
13404 gethostbyaddr_r_proto=0
13408 *) gethostbyaddr_r_proto=0
13412 : see if gethostbyname_r exists
13413 set gethostbyname_r d_gethostbyname_r
13415 case "$d_gethostbyname_r" in
13417 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13418 case "$d_gethostbyname_r_proto:$usethreads" in
13419 ":define") d_gethostbyname_r_proto=define
13420 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13424 case "$d_gethostbyname_r_proto" in
13426 case "$gethostbyname_r_proto" in
13427 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13428 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13430 case "$gethostbyname_r_proto" in
13431 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13432 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13434 case "$gethostbyname_r_proto" in
13435 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13436 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13438 case "$gethostbyname_r_proto" in
13439 ''|0) d_gethostbyname_r=undef
13440 gethostbyname_r_proto=0
13441 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13442 * ) case "$gethostbyname_r_proto" in
13443 REENTRANT_PROTO*) ;;
13444 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13446 echo "Prototype: $try" ;;
13449 *) case "$usethreads" in
13450 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13452 d_gethostbyname_r=undef
13453 gethostbyname_r_proto=0
13457 *) gethostbyname_r_proto=0
13461 : see if gethostent_r exists
13462 set gethostent_r d_gethostent_r
13464 case "$d_gethostent_r" in
13466 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13467 case "$d_gethostent_r_proto:$usethreads" in
13468 ":define") d_gethostent_r_proto=define
13469 set d_gethostent_r_proto gethostent_r $hdrs
13473 case "$d_gethostent_r_proto" in
13475 case "$gethostent_r_proto" in
13476 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13477 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13479 case "$gethostent_r_proto" in
13480 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13481 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13483 case "$gethostent_r_proto" in
13484 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13485 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13487 case "$gethostent_r_proto" in
13488 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13489 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13491 case "$gethostent_r_proto" in
13492 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13493 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13495 case "$gethostent_r_proto" in
13496 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13497 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13499 case "$gethostent_r_proto" in
13500 ''|0) d_gethostent_r=undef
13501 gethostent_r_proto=0
13502 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13503 * ) case "$gethostent_r_proto" in
13504 REENTRANT_PROTO*) ;;
13505 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13507 echo "Prototype: $try" ;;
13510 *) case "$usethreads" in
13511 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13513 d_gethostent_r=undef
13514 gethostent_r_proto=0
13518 *) gethostent_r_proto=0
13522 : see if prototypes for various gethostxxx netdb.h functions are available
13524 set d_gethostprotos gethostent $i_netdb netdb.h
13527 : see if getitimer exists
13528 set getitimer d_getitimer
13531 : see if getlogin exists
13532 set getlogin d_getlogin
13535 : see if getlogin_r exists
13536 set getlogin_r d_getlogin_r
13538 case "$d_getlogin_r" in
13540 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13541 case "$d_getlogin_r_proto:$usethreads" in
13542 ":define") d_getlogin_r_proto=define
13543 set d_getlogin_r_proto getlogin_r $hdrs
13547 case "$d_getlogin_r_proto" in
13549 case "$getlogin_r_proto" in
13550 ''|0) try='int getlogin_r(char*, size_t);'
13551 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13553 case "$getlogin_r_proto" in
13554 ''|0) try='int getlogin_r(char*, int);'
13555 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13557 case "$getlogin_r_proto" in
13558 ''|0) try='char* getlogin_r(char*, size_t);'
13559 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13561 case "$getlogin_r_proto" in
13562 ''|0) try='char* getlogin_r(char*, int);'
13563 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13565 case "$getlogin_r_proto" in
13566 ''|0) d_getlogin_r=undef
13568 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13569 * ) case "$getlogin_r_proto" in
13570 REENTRANT_PROTO*) ;;
13571 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13573 echo "Prototype: $try" ;;
13576 *) case "$usethreads" in
13577 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13584 *) getlogin_r_proto=0
13588 : see if getmnt exists
13589 set getmnt d_getmnt
13592 : see if getmntent exists
13593 set getmntent d_getmntent
13596 : see if getnetbyaddr exists
13597 set getnetbyaddr d_getnbyaddr
13600 : see if getnetbyname exists
13601 set getnetbyname d_getnbyname
13604 : see if getnetent exists
13605 set getnetent d_getnent
13608 : see if getnetbyaddr_r exists
13609 set getnetbyaddr_r d_getnetbyaddr_r
13611 case "$d_getnetbyaddr_r" in
13613 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13614 case "$d_getnetbyaddr_r_proto:$usethreads" in
13615 ":define") d_getnetbyaddr_r_proto=define
13616 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13620 case "$d_getnetbyaddr_r_proto" in
13622 case "$getnetbyaddr_r_proto" in
13623 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13624 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13626 case "$getnetbyaddr_r_proto" in
13627 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13628 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13630 case "$getnetbyaddr_r_proto" in
13631 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13632 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13634 case "$getnetbyaddr_r_proto" in
13635 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13636 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13638 case "$getnetbyaddr_r_proto" in
13639 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13640 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13642 case "$getnetbyaddr_r_proto" in
13643 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13644 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13646 case "$getnetbyaddr_r_proto" in
13647 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13648 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13650 case "$getnetbyaddr_r_proto" in
13651 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13652 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13654 case "$getnetbyaddr_r_proto" in
13655 ''|0) d_getnetbyaddr_r=undef
13656 getnetbyaddr_r_proto=0
13657 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13658 * ) case "$getnetbyaddr_r_proto" in
13659 REENTRANT_PROTO*) ;;
13660 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13662 echo "Prototype: $try" ;;
13665 *) case "$usethreads" in
13666 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13668 d_getnetbyaddr_r=undef
13669 getnetbyaddr_r_proto=0
13673 *) getnetbyaddr_r_proto=0
13677 : see if getnetbyname_r exists
13678 set getnetbyname_r d_getnetbyname_r
13680 case "$d_getnetbyname_r" in
13682 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13683 case "$d_getnetbyname_r_proto:$usethreads" in
13684 ":define") d_getnetbyname_r_proto=define
13685 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13689 case "$d_getnetbyname_r_proto" in
13691 case "$getnetbyname_r_proto" in
13692 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13693 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13695 case "$getnetbyname_r_proto" in
13696 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13697 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13699 case "$getnetbyname_r_proto" in
13700 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13701 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13703 case "$getnetbyname_r_proto" in
13704 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13705 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13707 case "$getnetbyname_r_proto" in
13708 ''|0) d_getnetbyname_r=undef
13709 getnetbyname_r_proto=0
13710 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13711 * ) case "$getnetbyname_r_proto" in
13712 REENTRANT_PROTO*) ;;
13713 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13715 echo "Prototype: $try" ;;
13718 *) case "$usethreads" in
13719 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13721 d_getnetbyname_r=undef
13722 getnetbyname_r_proto=0
13726 *) getnetbyname_r_proto=0
13730 : see if getnetent_r exists
13731 set getnetent_r d_getnetent_r
13733 case "$d_getnetent_r" in
13735 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13736 case "$d_getnetent_r_proto:$usethreads" in
13737 ":define") d_getnetent_r_proto=define
13738 set d_getnetent_r_proto getnetent_r $hdrs
13742 case "$d_getnetent_r_proto" in
13744 case "$getnetent_r_proto" in
13745 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13746 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13748 case "$getnetent_r_proto" in
13749 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13750 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13752 case "$getnetent_r_proto" in
13753 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13754 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13756 case "$getnetent_r_proto" in
13757 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13758 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13760 case "$getnetent_r_proto" in
13761 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13762 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13764 case "$getnetent_r_proto" in
13765 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13766 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13768 case "$getnetent_r_proto" in
13769 ''|0) d_getnetent_r=undef
13770 getnetent_r_proto=0
13771 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13772 * ) case "$getnetent_r_proto" in
13773 REENTRANT_PROTO*) ;;
13774 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13776 echo "Prototype: $try" ;;
13779 *) case "$usethreads" in
13780 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13782 d_getnetent_r=undef
13783 getnetent_r_proto=0
13787 *) getnetent_r_proto=0
13791 : see if prototypes for various getnetxxx netdb.h functions are available
13793 set d_getnetprotos getnetent $i_netdb netdb.h
13796 : see if getpagesize exists
13797 set getpagesize d_getpagsz
13801 : see if getprotobyname exists
13802 set getprotobyname d_getpbyname
13805 : see if getprotobynumber exists
13806 set getprotobynumber d_getpbynumber
13809 : see if getprotoent exists
13810 set getprotoent d_getpent
13813 : see if getpgid exists
13814 set getpgid d_getpgid
13817 : see if getpgrp2 exists
13818 set getpgrp2 d_getpgrp2
13821 : see if getppid exists
13822 set getppid d_getppid
13825 : see if getpriority exists
13826 set getpriority d_getprior
13829 : see if getprotobyname_r exists
13830 set getprotobyname_r d_getprotobyname_r
13832 case "$d_getprotobyname_r" in
13834 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13835 case "$d_getprotobyname_r_proto:$usethreads" in
13836 ":define") d_getprotobyname_r_proto=define
13837 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13841 case "$d_getprotobyname_r_proto" in
13843 case "$getprotobyname_r_proto" in
13844 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13845 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13847 case "$getprotobyname_r_proto" in
13848 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13849 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13851 case "$getprotobyname_r_proto" in
13852 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13853 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13855 case "$getprotobyname_r_proto" in
13856 ''|0) d_getprotobyname_r=undef
13857 getprotobyname_r_proto=0
13858 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13859 * ) case "$getprotobyname_r_proto" in
13860 REENTRANT_PROTO*) ;;
13861 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13863 echo "Prototype: $try" ;;
13866 *) case "$usethreads" in
13867 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13869 d_getprotobyname_r=undef
13870 getprotobyname_r_proto=0
13874 *) getprotobyname_r_proto=0
13878 : see if getprotobynumber_r exists
13879 set getprotobynumber_r d_getprotobynumber_r
13881 case "$d_getprotobynumber_r" in
13883 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13884 case "$d_getprotobynumber_r_proto:$usethreads" in
13885 ":define") d_getprotobynumber_r_proto=define
13886 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13890 case "$d_getprotobynumber_r_proto" in
13892 case "$getprotobynumber_r_proto" in
13893 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13894 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13896 case "$getprotobynumber_r_proto" in
13897 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13898 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13900 case "$getprotobynumber_r_proto" in
13901 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13902 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13904 case "$getprotobynumber_r_proto" in
13905 ''|0) d_getprotobynumber_r=undef
13906 getprotobynumber_r_proto=0
13907 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13908 * ) case "$getprotobynumber_r_proto" in
13909 REENTRANT_PROTO*) ;;
13910 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13912 echo "Prototype: $try" ;;
13915 *) case "$usethreads" in
13916 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13918 d_getprotobynumber_r=undef
13919 getprotobynumber_r_proto=0
13923 *) getprotobynumber_r_proto=0
13927 : see if getprotoent_r exists
13928 set getprotoent_r d_getprotoent_r
13930 case "$d_getprotoent_r" in
13932 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13933 case "$d_getprotoent_r_proto:$usethreads" in
13934 ":define") d_getprotoent_r_proto=define
13935 set d_getprotoent_r_proto getprotoent_r $hdrs
13939 case "$d_getprotoent_r_proto" in
13941 case "$getprotoent_r_proto" in
13942 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13943 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13945 case "$getprotoent_r_proto" in
13946 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13947 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13949 case "$getprotoent_r_proto" in
13950 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13951 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13953 case "$getprotoent_r_proto" in
13954 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13955 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13957 case "$getprotoent_r_proto" in
13958 ''|0) d_getprotoent_r=undef
13959 getprotoent_r_proto=0
13960 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13961 * ) case "$getprotoent_r_proto" in
13962 REENTRANT_PROTO*) ;;
13963 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13965 echo "Prototype: $try" ;;
13968 *) case "$usethreads" in
13969 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13971 d_getprotoent_r=undef
13972 getprotoent_r_proto=0
13976 *) getprotoent_r_proto=0
13980 : see if prototypes for various getprotoxxx netdb.h functions are available
13982 set d_getprotoprotos getprotoent $i_netdb netdb.h
13985 : see if getprpwnam exists
13986 set getprpwnam d_getprpwnam
13989 : see if getpwent exists
13990 set getpwent d_getpwent
13993 : see if getpwent_r exists
13994 set getpwent_r d_getpwent_r
13996 case "$d_getpwent_r" in
13998 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13999 case "$d_getpwent_r_proto:$usethreads" in
14000 ":define") d_getpwent_r_proto=define
14001 set d_getpwent_r_proto getpwent_r $hdrs
14005 case "$d_getpwent_r_proto" in
14007 case "$getpwent_r_proto" in
14008 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14009 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14011 case "$getpwent_r_proto" in
14012 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14013 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14015 case "$getpwent_r_proto" in
14016 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14017 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
14019 case "$getpwent_r_proto" in
14020 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14021 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
14023 case "$getpwent_r_proto" in
14024 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14025 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
14027 case "$getpwent_r_proto" in
14028 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14029 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14031 case "$getpwent_r_proto" in
14032 ''|0) d_getpwent_r=undef
14034 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14035 * ) case "$getpwent_r_proto" in
14036 REENTRANT_PROTO*) ;;
14037 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14039 echo "Prototype: $try" ;;
14042 *) case "$usethreads" in
14043 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14050 *) getpwent_r_proto=0
14054 : see if getpwnam_r exists
14055 set getpwnam_r d_getpwnam_r
14057 case "$d_getpwnam_r" in
14059 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14060 case "$d_getpwnam_r_proto:$usethreads" in
14061 ":define") d_getpwnam_r_proto=define
14062 set d_getpwnam_r_proto getpwnam_r $hdrs
14066 case "$d_getpwnam_r_proto" in
14068 case "$getpwnam_r_proto" in
14069 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14070 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14072 case "$getpwnam_r_proto" in
14073 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14074 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14076 case "$getpwnam_r_proto" in
14077 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14078 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14080 case "$getpwnam_r_proto" in
14081 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14082 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14084 case "$getpwnam_r_proto" in
14085 ''|0) d_getpwnam_r=undef
14087 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14088 * ) case "$getpwnam_r_proto" in
14089 REENTRANT_PROTO*) ;;
14090 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14092 echo "Prototype: $try" ;;
14095 *) case "$usethreads" in
14096 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14103 *) getpwnam_r_proto=0
14107 : see if getpwuid_r exists
14108 set getpwuid_r d_getpwuid_r
14110 case "$d_getpwuid_r" in
14112 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14113 case "$d_getpwuid_r_proto:$usethreads" in
14114 ":define") d_getpwuid_r_proto=define
14115 set d_getpwuid_r_proto getpwuid_r $hdrs
14119 case "$d_getpwuid_r_proto" in
14121 case "$getpwuid_r_proto" in
14122 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14123 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14125 case "$getpwuid_r_proto" in
14126 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14127 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14129 case "$getpwuid_r_proto" in
14130 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14131 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14133 case "$getpwuid_r_proto" in
14134 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14135 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14137 case "$getpwuid_r_proto" in
14138 ''|0) d_getpwuid_r=undef
14140 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14141 * ) case "$getpwuid_r_proto" in
14142 REENTRANT_PROTO*) ;;
14143 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14145 echo "Prototype: $try" ;;
14148 *) case "$usethreads" in
14149 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14156 *) getpwuid_r_proto=0
14161 : see if getservbyname exists
14162 set getservbyname d_getsbyname
14165 : see if getservbyport exists
14166 set getservbyport d_getsbyport
14169 : see if getservent exists
14170 set getservent d_getsent
14173 : see if getservbyname_r exists
14174 set getservbyname_r d_getservbyname_r
14176 case "$d_getservbyname_r" in
14178 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14179 case "$d_getservbyname_r_proto:$usethreads" in
14180 ":define") d_getservbyname_r_proto=define
14181 set d_getservbyname_r_proto getservbyname_r $hdrs
14185 case "$d_getservbyname_r_proto" in
14187 case "$getservbyname_r_proto" in
14188 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14189 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14191 case "$getservbyname_r_proto" in
14192 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14193 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14195 case "$getservbyname_r_proto" in
14196 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14197 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14199 case "$getservbyname_r_proto" in
14200 ''|0) d_getservbyname_r=undef
14201 getservbyname_r_proto=0
14202 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14203 * ) case "$getservbyname_r_proto" in
14204 REENTRANT_PROTO*) ;;
14205 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14207 echo "Prototype: $try" ;;
14210 *) case "$usethreads" in
14211 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14213 d_getservbyname_r=undef
14214 getservbyname_r_proto=0
14218 *) getservbyname_r_proto=0
14222 : see if getservbyport_r exists
14223 set getservbyport_r d_getservbyport_r
14225 case "$d_getservbyport_r" in
14227 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14228 case "$d_getservbyport_r_proto:$usethreads" in
14229 ":define") d_getservbyport_r_proto=define
14230 set d_getservbyport_r_proto getservbyport_r $hdrs
14234 case "$d_getservbyport_r_proto" in
14236 case "$getservbyport_r_proto" in
14237 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14238 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14240 case "$getservbyport_r_proto" in
14241 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14242 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14244 case "$getservbyport_r_proto" in
14245 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14246 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14248 case "$getservbyport_r_proto" in
14249 ''|0) d_getservbyport_r=undef
14250 getservbyport_r_proto=0
14251 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14252 * ) case "$getservbyport_r_proto" in
14253 REENTRANT_PROTO*) ;;
14254 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14256 echo "Prototype: $try" ;;
14259 *) case "$usethreads" in
14260 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14262 d_getservbyport_r=undef
14263 getservbyport_r_proto=0
14267 *) getservbyport_r_proto=0
14271 : see if getservent_r exists
14272 set getservent_r d_getservent_r
14274 case "$d_getservent_r" in
14276 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14277 case "$d_getservent_r_proto:$usethreads" in
14278 ":define") d_getservent_r_proto=define
14279 set d_getservent_r_proto getservent_r $hdrs
14283 case "$d_getservent_r_proto" in
14285 case "$getservent_r_proto" in
14286 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14287 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
14289 case "$getservent_r_proto" in
14290 ''|0) try='int getservent_r(struct servent*, char*, int);'
14291 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
14293 case "$getservent_r_proto" in
14294 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14295 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
14297 case "$getservent_r_proto" in
14298 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14299 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
14301 case "$getservent_r_proto" in
14302 ''|0) d_getservent_r=undef
14303 getservent_r_proto=0
14304 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14305 * ) case "$getservent_r_proto" in
14306 REENTRANT_PROTO*) ;;
14307 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14309 echo "Prototype: $try" ;;
14312 *) case "$usethreads" in
14313 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14315 d_getservent_r=undef
14316 getservent_r_proto=0
14320 *) getservent_r_proto=0
14324 : see if prototypes for various getservxxx netdb.h functions are available
14326 set d_getservprotos getservent $i_netdb netdb.h
14329 : see if getspnam exists
14330 set getspnam d_getspnam
14333 : see if this is a shadow.h system
14334 set shadow.h i_shadow
14337 : see if getspnam_r exists
14338 set getspnam_r d_getspnam_r
14340 case "$d_getspnam_r" in
14342 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14343 case "$d_getspnam_r_proto:$usethreads" in
14344 ":define") d_getspnam_r_proto=define
14345 set d_getspnam_r_proto getspnam_r $hdrs
14349 case "$d_getspnam_r_proto" in
14351 case "$getspnam_r_proto" in
14352 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14353 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14355 case "$getspnam_r_proto" in
14356 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14357 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14359 case "$getspnam_r_proto" in
14360 ''|0) d_getspnam_r=undef
14362 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14363 * ) case "$getspnam_r_proto" in
14364 REENTRANT_PROTO*) ;;
14365 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14367 echo "Prototype: $try" ;;
14370 *) case "$usethreads" in
14371 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14378 *) getspnam_r_proto=0
14382 : see if gettimeofday or ftime exists
14383 set gettimeofday d_gettimeod
14385 case "$d_gettimeod" in
14391 val="$undef"; set d_ftime; eval $setvar
14394 case "$d_gettimeod$d_ftime" in
14397 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14401 : see if gmtime_r exists
14402 set gmtime_r d_gmtime_r
14404 case "$d_gmtime_r" in
14406 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14407 case "$d_gmtime_r_proto:$usethreads" in
14408 ":define") d_gmtime_r_proto=define
14409 set d_gmtime_r_proto gmtime_r $hdrs
14413 case "$d_gmtime_r_proto" in
14415 case "$gmtime_r_proto" in
14416 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14417 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14419 case "$gmtime_r_proto" in
14420 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14421 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14423 case "$gmtime_r_proto" in
14424 ''|0) d_gmtime_r=undef
14426 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14427 * ) case "$gmtime_r_proto" in
14428 REENTRANT_PROTO*) ;;
14429 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14431 echo "Prototype: $try" ;;
14434 *) case "$usethreads" in
14435 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14442 *) gmtime_r_proto=0
14446 : see if hasmntopt exists
14447 set hasmntopt d_hasmntopt
14450 : see if this is a netinet/in.h or sys/in.h system
14451 set netinet/in.h i_niin sys/in.h i_sysin
14454 : see if arpa/inet.h has to be included
14455 set arpa/inet.h i_arpainet
14458 : see if htonl --and friends-- exists
14463 : Maybe they are macros.
14466 $cat >htonl.c <<EOM
14468 #include <sys/types.h>
14469 #$i_niin I_NETINET_IN
14471 #$i_arpainet I_ARPA_INET
14472 #ifdef I_NETINET_IN
14473 #include <netinet/in.h>
14476 #include <sys/in.h>
14479 #include <arpa/inet.h>
14482 printf("Defined as a macro.");
14485 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14486 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14488 echo "But it seems to be defined as a macro." >&4
14496 : see if ilogbl exists
14497 set ilogbl d_ilogbl
14502 if set index val -f; eval $csym; $val; then
14503 if set strchr val -f d_strchr; eval $csym; $val; then
14504 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14507 echo "strchr() found." >&4
14511 echo "index() found." >&4
14516 echo "index() found." >&4
14519 if set strchr val -f d_strchr; eval $csym; $val; then
14522 echo "strchr() found." >&4
14524 echo "No index() or strchr() found!" >&4
14529 set d_strchr; eval $setvar
14531 set d_index; eval $setvar
14533 : check whether inet_aton exists
14534 set inet_aton d_inetaton
14539 $cat >isascii.c <<EOCP
14542 #$i_stdlib I_STDLIB
14544 #include <stdlib.h>
14555 if eval $compile; then
14556 echo "isascii() found." >&4
14559 echo "isascii() NOT found." >&4
14566 : see if isfinite exists
14567 set isfinite d_isfinite
14570 : see if isinf exists
14574 : see if isnan exists
14578 : see if isnanl exists
14579 set isnanl d_isnanl
14582 : see if killpg exists
14583 set killpg d_killpg
14586 : see if lchown exists
14588 $cat > try.c <<'EOCP'
14589 /* System header to define __stub macros and hopefully few prototypes,
14590 which can conflict with char lchown(); below. */
14591 #include <assert.h>
14592 /* Override any gcc2 internal prototype to avoid an error. */
14593 /* We use char because int might match the return type of a gcc2
14594 builtin and then its argument prototype would still apply. */
14597 /* The GNU C library defines this for functions which it implements
14598 to always fail with ENOSYS. Some functions are actually named
14599 something starting with __ and the normal name is an alias. */
14600 #if defined (__stub_lchown) || defined (__stub___lchown)
14608 if eval $compile; then
14609 $echo "lchown() found." >&4
14612 $echo "lchown() NOT found." >&4
14618 : See if number of significant digits in a double precision number is known
14620 $cat >ldbl_dig.c <<EOM
14621 #$i_limits I_LIMITS
14624 #include <limits.h>
14630 printf("Contains LDBL_DIG");
14633 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14634 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14635 echo "LDBL_DIG found." >&4
14638 echo "LDBL_DIG NOT found." >&4
14645 : see if this is a math.h system
14649 d_libm_lib_version="$undef"
14652 : check to see if math.h defines _LIB_VERSION
14654 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14656 #include <unistd.h>
14658 int main (int argc, char *argv[])
14660 printf ("%d\n", _LIB_VERSION);
14665 if eval $compile; then
14667 echo "Yes, it does ($foo)" >&4
14668 d_libm_lib_version="$define"
14670 echo "No, it does not (probably harmless)" >&4
14677 : see if link exists
14681 : see if localtime_r exists
14682 set localtime_r d_localtime_r
14684 case "$d_localtime_r" in
14686 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14687 case "$d_localtime_r_proto:$usethreads" in
14688 ":define") d_localtime_r_proto=define
14689 set d_localtime_r_proto localtime_r $hdrs
14693 case "$d_localtime_r_proto" in
14695 case "$localtime_r_proto" in
14696 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14697 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14699 case "$localtime_r_proto" in
14700 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14701 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14703 case "$localtime_r_proto" in
14704 ''|0) d_localtime_r=undef
14705 localtime_r_proto=0
14706 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14707 * ) case "$localtime_r_proto" in
14708 REENTRANT_PROTO*) ;;
14709 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14711 echo "Prototype: $try" ;;
14714 *) case "$usethreads" in
14715 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14717 d_localtime_r=undef
14718 localtime_r_proto=0
14722 *) localtime_r_proto=0
14726 : see if localtime_r calls tzset
14727 case "$localtime_r_proto" in
14730 /* Does our libc's localtime_r call tzset ?
14731 * return 0 if so, 1 otherwise.
14733 #include <sys/types.h>
14734 #include <unistd.h>
14736 #include <string.h>
14737 #include <malloc.h>
14740 time_t t = time(0L);
14741 char w_tz[]="TZ" "=GMT+5",
14742 e_tz[]="TZ" "=GMT-5",
14743 *tz_e = (char*)malloc(16),
14744 *tz_w = (char*)malloc(16);
14745 struct tm tm_e, tm_w;
14746 memset(&tm_e,'\0',sizeof(struct tm));
14747 memset(&tm_w,'\0',sizeof(struct tm));
14752 localtime_r(&t, &tm_e);
14755 localtime_r(&t, &tm_w);
14757 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
14763 if eval $compile; then
14764 if $run ./try; then
14765 d_localtime_r_needs_tzset=undef;
14767 d_localtime_r_needs_tzset=define;
14770 d_localtime_r_needs_tzset=undef;
14774 d_localtime_r_needs_tzset=undef;
14779 : see if localeconv exists
14780 set localeconv d_locconv
14783 : see if lockf exists
14787 : see if prototype for lseek is available
14789 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14792 : see if lstat exists
14796 : see if madvise exists
14797 set madvise d_madvise
14800 : see if malloc_size exists
14801 set malloc_size d_malloc_size
14804 : see if malloc_size_good exists
14805 set malloc_good_size d_malloc_good_size
14808 : see if mblen exists
14812 : see if mbstowcs exists
14813 set mbstowcs d_mbstowcs
14816 : see if mbtowc exists
14817 set mbtowc d_mbtowc
14820 : see if memchr exists
14821 set memchr d_memchr
14824 : see if memcmp exists
14825 set memcmp d_memcmp
14828 : see if memcpy exists
14829 set memcpy d_memcpy
14832 : see if memmove exists
14833 set memmove d_memmove
14836 : see if memset exists
14837 set memset d_memset
14840 : see if mkdir exists
14844 : see if mkdtemp exists
14845 set mkdtemp d_mkdtemp
14848 : see if mkfifo exists
14849 set mkfifo d_mkfifo
14852 : see if mkstemp exists
14853 set mkstemp d_mkstemp
14856 : see if mkstemps exists
14857 set mkstemps d_mkstemps
14860 : see if mktime exists
14861 set mktime d_mktime
14864 : see if this is a sys/mman.h system
14865 set sys/mman.h i_sysmman
14868 : see if mmap exists
14871 : see what shmat returns
14872 : default to something harmless
14874 case "$i_sysmman$d_mmap" in
14876 $cat >mmap.c <<'END'
14877 #include <sys/mman.h>
14880 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14885 echo "and it returns ($mmaptype)." >&4
14891 : see if sqrtl exists
14895 : see if scalbnl exists
14896 set scalbnl d_scalbnl
14899 : see if modfl exists
14903 : see if prototype for modfl is available
14905 set d_modflproto modfl $i_math math.h
14908 d_modfl_pow32_bug="$undef"
14910 case "$d_longdbl$d_modfl" in
14913 Checking to see whether your modfl() is okay for large values...
14919 if $test "X$d_modflproto" != "X$define"; then
14920 $cat >>try.c <<EOCP
14921 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14922 long double modfl (long double, long double *);
14925 $cat >>try.c <<EOCP
14927 long double nv = 4294967303.15;
14933 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14937 case "$osname:$gccversion" in
14938 aix:) saveccflags="$ccflags"
14939 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14942 if eval $compile; then
14945 *" 4294967303.150000 1.150000 4294967302.000000")
14946 echo >&4 "Your modfl() is broken for large values."
14947 d_modfl_pow32_bug="$define"
14949 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14953 *" 4294967303.150000 0.150000 4294967303.000000")
14954 echo >&4 "Your modfl() seems okay for large values."
14956 *) echo >&4 "I don't understand your modfl() at all."
14962 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14965 case "$osname:$gccversion" in
14966 aix:) ccflags="$saveccflags" ;; # restore
14971 if $test "$uselongdouble" = "$define"; then
14973 if $test "$d_sqrtl" != "$define"; then
14974 message="$message sqrtl"
14976 if $test "$d_modfl" != "$define"; then
14977 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14978 echo "You have both aintl and copysignl, so I can emulate modfl."
14980 message="$message modfl"
14983 if $test "$d_frexpl" != "$define"; then
14984 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14985 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14987 message="$message frexpl"
14991 if $test "$message" != ""; then
14994 *** You requested the use of long doubles but you do not seem to have
14995 *** the following mathematical functions needed for long double support:
14997 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
14998 *** Cannot continue, aborting.
15006 : see if mprotect exists
15007 set mprotect d_mprotect
15010 : see if msgctl exists
15011 set msgctl d_msgctl
15014 : see if msgget exists
15015 set msgget d_msgget
15018 : see if msgsnd exists
15019 set msgsnd d_msgsnd
15022 : see if msgrcv exists
15023 set msgrcv d_msgrcv
15026 : see how much of the 'msg*(2)' library is present.
15029 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15030 *"$undef"*) h_msg=false;;
15034 case "`ipcs 2>&1`" in
15035 "SVID messages"*"not configured"*)
15036 echo "Your $osname does not have the msg*(2) configured." >&4
15039 set msgctl d_msgctl
15041 set msgget d_msgget
15043 set msgsnd d_msgsnd
15045 set msgrcv d_msgrcv
15051 : we could also check for sys/ipc.h ...
15052 if $h_msg && $test `./findhdr sys/msg.h`; then
15053 echo "You have the full msg*(2) library." >&4
15056 echo "You don't have the full msg*(2) library." >&4
15064 echo "Checking to see if your system supports struct msghdr..." >&4
15065 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15067 case "$d_msghdr_s" in
15068 "$define") echo "Yes, it does." ;;
15069 *) echo "No, it doesn't." ;;
15073 : see if msync exists
15077 : see if munmap exists
15078 set munmap d_munmap
15081 : see if nice exists
15085 : see if this is a langinfo.h system
15086 set langinfo.h i_langinfo
15089 : see if nl_langinfo exists
15090 set nl_langinfo d_nl_langinfo
15093 : check for length of character
15095 case "$charsize" in
15097 echo "Checking to see how big your characters are (hey, you never know)..." >&4
15100 #$i_stdlib I_STDLIB
15102 #include <stdlib.h>
15106 printf("%d\n", (int)sizeof(char));
15111 if eval $compile_ok; then
15115 echo "(I can't seem to compile the test program. Guessing...)"
15122 rp="What is the size of a character (in bytes)?"
15127 : check for volatile keyword
15129 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15130 $cat >try.c <<'EOCP'
15133 typedef struct _goo_struct goo_struct;
15134 goo_struct * volatile goo = ((goo_struct *)0);
15135 struct _goo_struct {
15140 typedef unsigned short foo_t;
15141 char *volatile foo;
15143 volatile foo_t blech;
15147 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15149 echo "Yup, it does."
15152 echo "Nope, it doesn't."
15160 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15162 case "$use64bitint:$d_quad:$quadtype" in
15165 uvtype="$uquadtype"
15170 uvtype="unsigned long"
15176 case "$uselongdouble:$d_longdbl" in
15178 nvtype="long double"
15179 nvsize=$longdblsize
15186 $echo "(IV will be "$ivtype", $ivsize bytes)"
15187 $echo "(UV will be "$uvtype", $uvsize bytes)"
15188 $echo "(NV will be "$nvtype", $nvsize bytes)"
15191 #$i_inttypes I_INTTYPES
15193 #include <inttypes.h>
15198 int8_t i = INT8_MAX;
15199 uint8_t u = UINT8_MAX;
15200 printf("int8_t\n");
15203 int16_t i = INT16_MAX;
15204 uint16_t i = UINT16_MAX;
15205 printf("int16_t\n");
15208 int32_t i = INT32_MAX;
15209 uint32_t u = UINT32_MAX;
15210 printf("int32_t\n");
15216 '') case "$charsize" in
15218 u8type="unsigned char"
15227 if eval $compile; then
15228 case "`$run ./try`" in
15229 int8_t) i8type=int8_t
15239 '') if $test $charsize -ge 1; then
15241 u8type="unsigned char"
15249 '') case "$shortsize" in
15251 u16type="unsigned short"
15259 '') set try -DINT16
15260 if eval $compile; then
15261 case "`$run ./try`" in
15273 '') if $test $shortsize -ge 2; then
15275 u16type="unsigned short"
15283 '') case "$longsize" in
15285 u32type="unsigned long"
15289 *) case "$intsize" in
15291 u32type="unsigned int"
15301 '') set try -DINT32
15302 if eval $compile; then
15303 case "`$run ./try`" in
15315 '') if $test $intsize -ge 4; then
15317 u32type="unsigned int"
15325 '') case "$d_quad:$quadtype" in
15327 i64type="$quadtype"
15328 u64type="$uquadtype"
15336 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15337 : volatile so that the compiler has to store it out to memory.
15338 if test X"$d_volatile" = X"$define"; then
15343 #$i_stdlib I_STDLIB
15345 #include <stdlib.h>
15347 #include <sys/types.h>
15348 #include <signal.h>
15350 $volatile int bletched = 0;
15351 $signal_t blech(int s) { bletched = 1; }
15356 int n = 8 * $uvsize;
15359 signal(SIGFPE, blech);
15362 for (i = 0; i < n; i++) {
15363 u = u << 1 | ($uvtype)1;
15365 if (($uvtype)d != u)
15369 d = ($nvtype)(u - 1);
15370 if (($uvtype)d != (u - 1))
15377 printf("%d\n", ((i == n) ? -n : i));
15383 d_nv_preserves_uv="$undef"
15384 if eval $compile; then
15385 nv_preserves_uv_bits="`$run ./try`"
15387 case "$nv_preserves_uv_bits" in
15389 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15390 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15391 d_nv_preserves_uv="$define"
15393 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15394 d_nv_preserves_uv="$undef" ;;
15395 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15396 nv_preserves_uv_bits="0" ;;
15400 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15401 : volatile so that the compiler has to store it out to memory.
15402 if test X"$d_volatile" = X"$define"; then
15407 #$i_stdlib I_STDLIB
15409 #include <stdlib.h>
15411 #$i_string I_STRING
15413 # include <string.h>
15415 # include <strings.h>
15417 #include <sys/types.h>
15418 #include <signal.h>
15420 $volatile int bletched = 0;
15421 $signal_t blech(int s) { bletched = 1; }
15424 int checkit($nvtype d, char *where) {
15425 unsigned char *p = (char *)&d;
15426 unsigned char *end = p + sizeof(d);
15436 printf("No - %s: 0x", where);
15438 printf ("%02X", *p++);
15443 int main(int argc, char **argv) {
15446 fail += checkit(d, "0.0");
15448 /* The compiler shouldn't be assuming that bletched is 0 */
15451 fail += checkit(d, "bleched");
15454 signal(SIGFPE, blech);
15457 /* Paranoia - the compiler should have no way of knowing that ANSI says
15458 that argv[argc] will always be NULL. Actually, if it did assume this it
15459 would be buggy, as this is C and main() can be called from elsewhere in
15461 d = argv[argc] ? 1 : 0;
15464 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15467 fail += checkit(d, "ternary");
15469 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15472 printf("No - memset doesn't give 0.0\n");
15473 /* This might just blow up: */
15474 printf("(gives %g)\n", d);
15480 printf("No - something bleched\n");
15485 printf("No - %d fail(s)\n", fail);
15494 d_nv_zero_is_allbits_zero="$undef"
15495 if eval $compile; then
15501 0.0 is represented as all bits zero in memory
15503 d_nv_zero_is_allbits_zero="$define"
15506 0.0 is not represented as all bits zero in memory
15508 d_nv_zero_is_allbits_zero="$undef"
15513 0.0 is not represented as all bits zero in memory
15515 d_nv_zero_is_allbits_zero="$undef"
15521 : check for off64_t
15523 echo "Checking to see if you have off64_t..." >&4
15525 #include <sys/types.h>
15526 #include <unistd.h>
15527 int main() { off64_t x = 7; }
15530 if eval $compile; then
15532 echo "You have off64_t."
15535 echo "You do not have off64_t."
15536 case "$lseeksize" in
15537 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15544 : how to create joinable pthreads
15545 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15547 echo "Checking what constant to use for creating joinable pthreads..." >&4
15548 $cat >try.c <<'EOCP'
15549 #include <pthread.h>
15551 int detachstate = JOINABLE;
15554 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15555 if eval $compile; then
15556 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15557 val="$undef" # Yes, undef.
15558 set d_old_pthread_create_joinable
15561 set old_pthread_create_joinable
15564 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15565 if eval $compile; then
15566 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15568 set d_old_pthread_create_joinable
15570 val=PTHREAD_CREATE_UNDETACHED
15571 set old_pthread_create_joinable
15574 set try -DJOINABLE=__UNDETACHED
15575 if eval $compile; then
15576 echo "You seem to use __UNDETACHED." >&4
15578 set d_old_pthread_create_joinable
15581 set old_pthread_create_joinable
15584 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15586 set d_old_pthread_create_joinable
15589 set old_pthread_create_joinable
15596 d_old_pthread_create_joinable="$undef"
15597 old_pthread_create_joinable=""
15600 : see if pause exists
15604 : see if poll exists
15608 : see if readlink exists
15609 set readlink d_readlink
15615 case "$d_readlink" in
15617 if $issymlink /proc/self/exe ; then
15618 $ls -l /proc/self/exe > reflect
15619 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15620 echo "You have Linux-like /proc/self/exe."
15621 procselfexe='"/proc/self/exe"'
15625 if $issymlink /proc/curproc/file ; then
15626 $ls -l /proc/curproc/file > reflect
15627 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15628 echo "You have BSD-like /proc/curproc/file."
15629 procselfexe='"/proc/curproc/file"'
15639 : backward compatibility for d_hvfork
15640 if test X$d_hvfork != X; then
15641 d_vfork="$d_hvfork"
15644 : see if there is a vfork
15649 d_pseudofork=$undef
15651 : Ok, but do we want to use it. vfork is reportedly unreliable in
15652 : perl on Solaris 2.x, and probably elsewhere.
15656 case "$usevfork" in
15662 Perl can only use a vfork() that doesn't suffer from strict
15663 restrictions on calling functions or modifying global data in
15664 the child. For example, glibc-2.1 contains such a vfork()
15665 that is unsuitable. If your system provides a proper fork()
15666 call, chances are that you do NOT want perl to use vfork().
15669 rp="Do you still want to use vfork()?"
15674 echo "Ok, we won't use vfork()."
15683 $define) usevfork='true';;
15684 *) usevfork='false';;
15687 : see whether the pthread_atfork exists
15689 #include <pthread.h>
15692 #ifdef PTHREAD_ATFORK
15693 pthread_atfork(NULL,NULL,NULL);
15698 : see if pthread_atfork exists
15699 set try -DPTHREAD_ATFORK
15700 if eval $compile; then
15705 case "$usethreads" in
15708 $define) echo 'pthread_atfork found.' >&4 ;;
15709 *) echo 'pthread_atfork NOT found.' >&4 ;;
15712 set d_pthread_atfork
15715 : see if pthread_attr_setscope exists
15716 set pthread_attr_setscope d_pthread_attr_setscope
15720 : see whether the various POSIXish _yields exist
15722 #include <pthread.h>
15728 #ifdef PTHREAD_YIELD
15731 #ifdef PTHREAD_YIELD_NULL
15732 pthread_yield(NULL);
15738 : see if sched_yield exists
15739 set try -DSCHED_YIELD
15740 if eval $compile; then
15742 sched_yield='sched_yield()'
15746 case "$usethreads" in
15749 $define) echo 'sched_yield() found.' >&4 ;;
15750 *) echo 'sched_yield() NOT found.' >&4 ;;
15756 : see if pthread_yield exists
15757 set try -DPTHREAD_YIELD
15758 if eval $compile; then
15760 case "$sched_yield" in
15761 '') sched_yield='pthread_yield()' ;;
15764 set try -DPTHREAD_YIELD_NULL
15765 if eval $compile; then
15767 case "$sched_yield" in
15768 '') sched_yield='pthread_yield(NULL)' ;;
15774 case "$usethreads" in
15777 $define) echo 'pthread_yield() found.' >&4 ;;
15778 *) echo 'pthread_yield() NOT found.' >&4 ;;
15782 set d_pthread_yield
15784 case "$sched_yield" in
15785 '') sched_yield=undef ;;
15789 : see if random_r exists
15790 set random_r d_random_r
15792 case "$d_random_r" in
15794 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15795 case "$d_random_r_proto:$usethreads" in
15796 ":define") d_random_r_proto=define
15797 set d_random_r_proto random_r $hdrs
15801 case "$d_random_r_proto" in
15803 case "$random_r_proto" in
15804 ''|0) try='int random_r(int*, struct random_data*);'
15805 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15807 case "$random_r_proto" in
15808 ''|0) try='int random_r(long*, struct random_data*);'
15809 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15811 case "$random_r_proto" in
15812 ''|0) try='int random_r(struct random_data*, int32_t*);'
15813 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15815 case "$random_r_proto" in
15816 ''|0) d_random_r=undef
15818 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15819 * ) case "$random_r_proto" in
15820 REENTRANT_PROTO*) ;;
15821 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15823 echo "Prototype: $try" ;;
15826 *) case "$usethreads" in
15827 define) echo "random_r has no prototype, not using it." >&4 ;;
15834 *) random_r_proto=0
15838 : see if readdir and friends exist
15839 set readdir d_readdir
15841 set seekdir d_seekdir
15843 set telldir d_telldir
15845 set rewinddir d_rewinddir
15848 : see if readdir64_r exists
15849 set readdir64_r d_readdir64_r
15851 case "$d_readdir64_r" in
15853 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15854 case "$d_readdir64_r_proto:$usethreads" in
15855 ":define") d_readdir64_r_proto=define
15856 set d_readdir64_r_proto readdir64_r $hdrs
15860 case "$d_readdir64_r_proto" in
15862 case "$readdir64_r_proto" in
15863 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15864 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15866 case "$readdir64_r_proto" in
15867 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15868 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15870 case "$readdir64_r_proto" in
15871 ''|0) d_readdir64_r=undef
15872 readdir64_r_proto=0
15873 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15874 * ) case "$readdir64_r_proto" in
15875 REENTRANT_PROTO*) ;;
15876 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15878 echo "Prototype: $try" ;;
15881 *) case "$usethreads" in
15882 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15884 d_readdir64_r=undef
15885 readdir64_r_proto=0
15889 *) readdir64_r_proto=0
15893 : see if readdir_r exists
15894 set readdir_r d_readdir_r
15896 case "$d_readdir_r" in
15898 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15899 case "$d_readdir_r_proto:$usethreads" in
15900 ":define") d_readdir_r_proto=define
15901 set d_readdir_r_proto readdir_r $hdrs
15905 case "$d_readdir_r_proto" in
15907 case "$readdir_r_proto" in
15908 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15909 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15911 case "$readdir_r_proto" in
15912 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15913 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15915 case "$readdir_r_proto" in
15916 ''|0) d_readdir_r=undef
15918 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15919 * ) case "$readdir_r_proto" in
15920 REENTRANT_PROTO*) ;;
15921 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15923 echo "Prototype: $try" ;;
15926 *) case "$usethreads" in
15927 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15934 *) readdir_r_proto=0
15938 : see if readv exists
15942 : see if recvmsg exists
15943 set recvmsg d_recvmsg
15946 : see if rename exists
15947 set rename d_rename
15950 : see if rmdir exists
15954 : see if memory.h is available.
15959 : See if it conflicts with string.h
15965 $cppstdin $cppflags $cppminus < $strings > mem.h
15966 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15968 echo "We won't be including <memory.h>."
15978 : can bcopy handle overlapping blocks?
15981 case "$d_memmove" in
15982 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15983 *) case "$d_bcopy" in
15985 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15987 #$i_memory I_MEMORY
15988 #$i_stdlib I_STDLIB
15989 #$i_string I_STRING
15990 #$i_unistd I_UNISTD
15992 $cat >>try.c <<'EOCP'
15995 # include <memory.h>
15998 # include <stdlib.h>
16001 # include <string.h>
16003 # include <strings.h>
16006 # include <unistd.h> /* Needed for NetBSD */
16010 char buf[128], abc[128];
16016 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16017 try to store the string in read-only memory. */
16018 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16020 for (align = 7; align >= 0; align--) {
16021 for (len = 36; len; len--) {
16023 bcopy(abc, b, len);
16024 for (off = 1; off <= len; off++) {
16025 bcopy(b, b+off, len);
16026 bcopy(b+off, b, len);
16027 if (bcmp(b, abc, len))
16036 if eval $compile_ok; then
16037 if $run ./try 2>/dev/null; then
16038 echo "Yes, it can."
16041 echo "It can't, sorry."
16044 echo "(I can't compile the test program, so we'll assume not...)"
16054 : can memcpy handle overlapping blocks?
16057 case "$d_memmove" in
16058 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16059 *) case "$d_memcpy" in
16061 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16063 #$i_memory I_MEMORY
16064 #$i_stdlib I_STDLIB
16065 #$i_string I_STRING
16066 #$i_unistd I_UNISTD
16068 $cat >>try.c <<'EOCP'
16071 # include <memory.h>
16074 # include <stdlib.h>
16077 # include <string.h>
16079 # include <strings.h>
16082 # include <unistd.h> /* Needed for NetBSD */
16086 char buf[128], abc[128];
16092 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16093 try to store the string in read-only memory. */
16094 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16096 for (align = 7; align >= 0; align--) {
16097 for (len = 36; len; len--) {
16099 memcpy(b, abc, len);
16100 for (off = 1; off <= len; off++) {
16101 memcpy(b+off, b, len);
16102 memcpy(b, b+off, len);
16103 if (memcmp(b, abc, len))
16112 if eval $compile_ok; then
16113 if $run ./try 2>/dev/null; then
16114 echo "Yes, it can."
16117 echo "It can't, sorry."
16120 echo "(I can't compile the test program, so we'll assume not...)"
16130 : can memcmp be trusted to compare relative magnitude?
16132 case "$d_memcmp" in
16135 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16137 #$i_memory I_MEMORY
16138 #$i_stdlib I_STDLIB
16139 #$i_string I_STRING
16140 #$i_unistd I_UNISTD
16142 $cat >>try.c <<'EOCP'
16145 # include <memory.h>
16148 # include <stdlib.h>
16151 # include <string.h>
16153 # include <strings.h>
16156 # include <unistd.h> /* Needed for NetBSD */
16162 if ((a < b) && memcmp(&a, &b, 1) < 0)
16168 if eval $compile_ok; then
16169 if $run ./try 2>/dev/null; then
16170 echo "Yes, it can."
16173 echo "No, it can't (it uses signed chars)."
16176 echo "(I can't compile the test program, so we'll assume not...)"
16184 : see if prototype for sbrk is available
16186 set d_sbrkproto sbrk $i_unistd unistd.h
16189 : see if select exists
16190 set select d_select
16193 : see if semctl exists
16194 set semctl d_semctl
16197 : see if semget exists
16198 set semget d_semget
16201 : see if semop exists
16205 : see how much of the 'sem*(2)' library is present.
16208 case "$d_semctl$d_semget$d_semop" in
16209 *"$undef"*) h_sem=false;;
16213 case "`ipcs 2>&1`" in
16214 "SVID messages"*"not configured"*)
16215 echo "Your $osname does not have the sem*(2) configured." >&4
16218 set semctl d_semctl
16220 set semget d_semget
16228 : we could also check for sys/ipc.h ...
16229 if $h_sem && $test `./findhdr sys/sem.h`; then
16230 echo "You have the full sem*(2) library." >&4
16233 echo "You don't have the full sem*(2) library." >&4
16239 : see whether sys/sem.h defines union semun
16241 $cat > try.c <<'END'
16242 #include <sys/types.h>
16243 #include <sys/ipc.h>
16244 #include <sys/sem.h>
16245 int main () { union semun semun; semun.buf = 0; }
16248 if eval $compile; then
16249 echo "You have union semun in <sys/sem.h>." >&4
16252 echo "You do not have union semun in <sys/sem.h>." >&4
16259 : see how to do semctl IPC_STAT
16263 $cat > tryh.h <<END
16266 # define S_IRUSR S_IREAD
16267 # define S_IWUSR S_IWRITE
16268 # define S_IXUSR S_IEXEC
16270 # define S_IRUSR 0400
16271 # define S_IWUSR 0200
16272 # define S_IXUSR 0100
16274 # define S_IRGRP (S_IRUSR>>3)
16275 # define S_IWGRP (S_IWUSR>>3)
16276 # define S_IXGRP (S_IXUSR>>3)
16277 # define S_IROTH (S_IRUSR>>6)
16278 # define S_IWOTH (S_IWUSR>>6)
16279 # define S_IXOTH (S_IXUSR>>6)
16282 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16283 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16284 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16287 : see whether semctl IPC_STAT can use union semun
16288 case "$d_semctl_semun" in
16292 #include <sys/types.h>
16293 #include <sys/ipc.h>
16294 #include <sys/sem.h>
16295 #include <sys/stat.h>
16302 #$d_union_semun HAS_UNION_SEMUN
16305 #ifndef HAS_UNION_SEMUN
16308 struct semid_ds *buf;
16309 unsigned short *array;
16315 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16316 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16318 struct semid_ds argbuf;
16321 st = semctl(sem, 0, IPC_STAT, arg);
16325 # endif /* IPC_STAT */
16326 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16328 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16329 # endif /* IPC_RMID */
16330 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16332 #endif /* IPC_PRIVATE && ... */
16333 printf("semget failed: errno = %d\n", errno);
16338 if eval $compile; then
16341 semun) val="$define" ;;
16349 case "$d_semctl_semun" in
16351 echo "You can use union semun for semctl IPC_STAT." >&4
16354 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16359 : see whether semctl IPC_STAT can use struct semid_ds pointer
16360 case "$d_semctl_semid_ds" in
16363 $cat > try.c <<'END'
16364 #include <sys/types.h>
16365 #include <sys/ipc.h>
16366 #include <sys/sem.h>
16367 #include <sys/stat.h>
16375 struct semid_ds arg;
16378 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16379 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16382 st = semctl(sem, 0, IPC_STAT, &arg);
16384 printf("semid_ds\n");
16386 # endif /* IPC_STAT */
16387 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16389 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16390 # endif /* IPC_RMID */
16391 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16393 #endif /* IPC_PRIVATE && ... */
16394 printf("semget failed: errno = %d\n", errno);
16400 if eval $compile; then
16403 semid_ds) val="$define" ;;
16407 set d_semctl_semid_ds
16411 case "$d_semctl_semid_ds" in
16413 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16415 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16421 # We do not have the full sem*(2) library, so assume we can not
16427 set d_semctl_semid_ds
16433 : see if sendmsg exists
16434 set sendmsg d_sendmsg
16437 : see if setegid exists
16438 set setegid d_setegid
16441 : see if seteuid exists
16442 set seteuid d_seteuid
16445 : see if setgrent exists
16446 set setgrent d_setgrent
16449 : see if setgrent_r exists
16450 set setgrent_r d_setgrent_r
16452 case "$d_setgrent_r" in
16454 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16455 case "$d_setgrent_r_proto:$usethreads" in
16456 ":define") d_setgrent_r_proto=define
16457 set d_setgrent_r_proto setgrent_r $hdrs
16461 case "$d_setgrent_r_proto" in
16463 case "$setgrent_r_proto" in
16464 ''|0) try='int setgrent_r(FILE**);'
16465 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
16467 case "$setgrent_r_proto" in
16468 ''|0) try='void setgrent_r(FILE**);'
16469 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
16471 case "$setgrent_r_proto" in
16472 ''|0) d_setgrent_r=undef
16474 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16475 * ) case "$setgrent_r_proto" in
16476 REENTRANT_PROTO*) ;;
16477 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16479 echo "Prototype: $try" ;;
16482 *) case "$usethreads" in
16483 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16490 *) setgrent_r_proto=0
16494 : see if sethostent exists
16495 set sethostent d_sethent
16498 : see if sethostent_r exists
16499 set sethostent_r d_sethostent_r
16501 case "$d_sethostent_r" in
16503 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16504 case "$d_sethostent_r_proto:$usethreads" in
16505 ":define") d_sethostent_r_proto=define
16506 set d_sethostent_r_proto sethostent_r $hdrs
16510 case "$d_sethostent_r_proto" in
16512 case "$sethostent_r_proto" in
16513 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16514 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16516 case "$sethostent_r_proto" in
16517 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16518 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16520 case "$sethostent_r_proto" in
16521 ''|0) d_sethostent_r=undef
16522 sethostent_r_proto=0
16523 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16524 * ) case "$sethostent_r_proto" in
16525 REENTRANT_PROTO*) ;;
16526 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16528 echo "Prototype: $try" ;;
16531 *) case "$usethreads" in
16532 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16534 d_sethostent_r=undef
16535 sethostent_r_proto=0
16539 *) sethostent_r_proto=0
16543 : see if setitimer exists
16544 set setitimer d_setitimer
16547 : see if setlinebuf exists
16548 set setlinebuf d_setlinebuf
16551 : see if setlocale exists
16552 set setlocale d_setlocale
16555 : see if locale.h is available
16556 set locale.h i_locale
16559 : see if setlocale_r exists
16560 set setlocale_r d_setlocale_r
16562 case "$d_setlocale_r" in
16564 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16565 case "$d_setlocale_r_proto:$usethreads" in
16566 ":define") d_setlocale_r_proto=define
16567 set d_setlocale_r_proto setlocale_r $hdrs
16571 case "$d_setlocale_r_proto" in
16573 case "$setlocale_r_proto" in
16574 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16575 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16577 case "$setlocale_r_proto" in
16578 ''|0) d_setlocale_r=undef
16579 setlocale_r_proto=0
16580 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16581 * ) case "$setlocale_r_proto" in
16582 REENTRANT_PROTO*) ;;
16583 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16585 echo "Prototype: $try" ;;
16588 *) case "$usethreads" in
16589 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16591 d_setlocale_r=undef
16592 setlocale_r_proto=0
16596 *) setlocale_r_proto=0
16600 : see if setnetent exists
16601 set setnetent d_setnent
16604 : see if setnetent_r exists
16605 set setnetent_r d_setnetent_r
16607 case "$d_setnetent_r" in
16609 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16610 case "$d_setnetent_r_proto:$usethreads" in
16611 ":define") d_setnetent_r_proto=define
16612 set d_setnetent_r_proto setnetent_r $hdrs
16616 case "$d_setnetent_r_proto" in
16618 case "$setnetent_r_proto" in
16619 ''|0) try='int setnetent_r(int, struct netent_data*);'
16620 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16622 case "$setnetent_r_proto" in
16623 ''|0) try='void setnetent_r(int, struct netent_data*);'
16624 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16626 case "$setnetent_r_proto" in
16627 ''|0) d_setnetent_r=undef
16628 setnetent_r_proto=0
16629 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16630 * ) case "$setnetent_r_proto" in
16631 REENTRANT_PROTO*) ;;
16632 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16634 echo "Prototype: $try" ;;
16637 *) case "$usethreads" in
16638 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16640 d_setnetent_r=undef
16641 setnetent_r_proto=0
16645 *) setnetent_r_proto=0
16649 : see if setprotoent exists
16650 set setprotoent d_setpent
16653 : see if setpgid exists
16654 set setpgid d_setpgid
16657 : see if setpgrp2 exists
16658 set setpgrp2 d_setpgrp2
16661 : see if setpriority exists
16662 set setpriority d_setprior
16665 : see if setproctitle exists
16666 set setproctitle d_setproctitle
16669 : see if setprotoent_r exists
16670 set setprotoent_r d_setprotoent_r
16672 case "$d_setprotoent_r" in
16674 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16675 case "$d_setprotoent_r_proto:$usethreads" in
16676 ":define") d_setprotoent_r_proto=define
16677 set d_setprotoent_r_proto setprotoent_r $hdrs
16681 case "$d_setprotoent_r_proto" in
16683 case "$setprotoent_r_proto" in
16684 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16685 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16687 case "$setprotoent_r_proto" in
16688 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16689 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16691 case "$setprotoent_r_proto" in
16692 ''|0) d_setprotoent_r=undef
16693 setprotoent_r_proto=0
16694 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16695 * ) case "$setprotoent_r_proto" in
16696 REENTRANT_PROTO*) ;;
16697 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16699 echo "Prototype: $try" ;;
16702 *) case "$usethreads" in
16703 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16705 d_setprotoent_r=undef
16706 setprotoent_r_proto=0
16710 *) setprotoent_r_proto=0
16714 : see if setpwent exists
16715 set setpwent d_setpwent
16718 : see if setpwent_r exists
16719 set setpwent_r d_setpwent_r
16721 case "$d_setpwent_r" in
16723 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16724 case "$d_setpwent_r_proto:$usethreads" in
16725 ":define") d_setpwent_r_proto=define
16726 set d_setpwent_r_proto setpwent_r $hdrs
16730 case "$d_setpwent_r_proto" in
16732 case "$setpwent_r_proto" in
16733 ''|0) try='int setpwent_r(FILE**);'
16734 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16736 case "$setpwent_r_proto" in
16737 ''|0) try='void setpwent_r(FILE**);'
16738 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16740 case "$setpwent_r_proto" in
16741 ''|0) d_setpwent_r=undef
16743 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16744 * ) case "$setpwent_r_proto" in
16745 REENTRANT_PROTO*) ;;
16746 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16748 echo "Prototype: $try" ;;
16751 *) case "$usethreads" in
16752 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16759 *) setpwent_r_proto=0
16763 : see if setregid exists
16764 set setregid d_setregid
16766 set setresgid d_setresgid
16769 : see if setreuid exists
16770 set setreuid d_setreuid
16772 set setresuid d_setresuid
16775 : see if setrgid exists
16776 set setrgid d_setrgid
16779 : see if setruid exists
16780 set setruid d_setruid
16783 : see if setservent exists
16784 set setservent d_setsent
16787 : see if setservent_r exists
16788 set setservent_r d_setservent_r
16790 case "$d_setservent_r" in
16792 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16793 case "$d_setservent_r_proto:$usethreads" in
16794 ":define") d_setservent_r_proto=define
16795 set d_setservent_r_proto setservent_r $hdrs
16799 case "$d_setservent_r_proto" in
16801 case "$setservent_r_proto" in
16802 ''|0) try='int setservent_r(int, struct servent_data*);'
16803 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16805 case "$setservent_r_proto" in
16806 ''|0) try='void setservent_r(int, struct servent_data*);'
16807 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16809 case "$setservent_r_proto" in
16810 ''|0) d_setservent_r=undef
16811 setservent_r_proto=0
16812 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16813 * ) case "$setservent_r_proto" in
16814 REENTRANT_PROTO*) ;;
16815 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16817 echo "Prototype: $try" ;;
16820 *) case "$usethreads" in
16821 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16823 d_setservent_r=undef
16824 setservent_r_proto=0
16828 *) setservent_r_proto=0
16832 : see if setsid exists
16833 set setsid d_setsid
16836 : see if setvbuf exists
16837 set setvbuf d_setvbuf
16840 : see if sfio.h is available
16845 : see if sfio library is available
16856 : Ok, but do we want to use it.
16860 true|$define|[yY]*) dflt='y';;
16863 echo "$package can use the sfio library, but it is experimental."
16864 case "$useperlio" in
16866 echo "For sfio also the PerlIO abstraction layer is needed."
16867 echo "Earlier you said you wouldn't want that."
16870 rp="You seem to have sfio available, do you want to try using it?"
16873 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16874 useperlio="$define"
16877 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16882 *) case "$usesfio" in
16883 true|$define|[yY]*)
16884 echo "Sorry, cannot find sfio on this machine." >&4
16885 echo "Ignoring your setting of usesfio=$usesfio." >&4
16894 $define) usesfio='true';;
16895 *) usesfio='false';;
16899 *) : Remove sfio from list of libraries to use
16902 echo "Removing unneeded -lsfio from library list" >&4
16903 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16906 echo "libs = $libs" >&4
16913 : see if shmctl exists
16914 set shmctl d_shmctl
16917 : see if shmget exists
16918 set shmget d_shmget
16921 : see if shmat exists
16924 : see what shmat returns
16927 $cat >shmat.c <<'END'
16928 #include <sys/shm.h>
16931 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16936 echo "and it returns ($shmattype)." >&4
16937 : see if a prototype for shmat is available
16938 xxx=`./findhdr sys/shm.h`
16939 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16940 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16951 set d_shmatprototype
16954 : see if shmdt exists
16958 : see how much of the 'shm*(2)' library is present.
16961 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16962 *"$undef"*) h_shm=false;;
16966 case "`ipcs 2>&1`" in
16967 "SVID shared memory"*"not configured"*)
16968 echo "Your $osname does not have the shm*(2) configured." >&4
16971 set shmctl d_shmctl
16973 set shmget d_shmget
16983 : we could also check for sys/ipc.h ...
16984 if $h_shm && $test `./findhdr sys/shm.h`; then
16985 echo "You have the full shm*(2) library." >&4
16988 echo "You don't have the full shm*(2) library." >&4
16995 : see if we have sigaction
16996 if set sigaction val -f d_sigaction; eval $csym; $val; then
16997 echo 'sigaction() found.' >&4
17000 #include <sys/types.h>
17001 #include <signal.h>
17002 #$i_stdlib I_STDLIB
17004 #include <stdlib.h>
17008 struct sigaction act, oact;
17010 oact.sa_handler = 0;
17011 /* so that act and oact are used */
17012 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17016 if eval $compile_ok; then
17019 echo "But you don't seem to have a useable struct sigaction." >&4
17023 echo 'sigaction NOT found.' >&4
17026 set d_sigaction; eval $setvar
17029 : see if this is a sunmath.h system
17030 set sunmath.h i_sunmath
17033 : see if signbit exists
17034 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17037 #$i_sunmath I_SUNMATH
17041 #ifdef I_SUNMATH /* Solaris special math library */
17042 # include <sunmath.h>
17045 int main(int argc, char **argv)
17049 if ((signbit(x) == 0) && (signbit(y) != 0))
17057 if eval $compile; then
17058 if $run ./try; then
17062 $echo "Signbit seems to be available, but doesn't work as I expected."
17063 $echo "I won't use it." >&4
17074 : see if sigprocmask exists
17075 set sigprocmask d_sigprocmask
17078 : see if sigsetjmp exists
17080 case "$d_sigsetjmp" in
17083 #include <setjmp.h>
17084 #$i_stdlib I_STDLIB
17086 #include <stdlib.h>
17092 if (sigsetjmp(env,1))
17095 siglongjmp(env, 1);
17100 if eval $compile; then
17101 if $run ./try >/dev/null 2>&1; then
17102 echo "POSIX sigsetjmp found." >&4
17106 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17112 echo "sigsetjmp not found." >&4
17116 *) val="$d_sigsetjmp"
17117 case "$d_sigsetjmp" in
17118 $define) echo "POSIX sigsetjmp found." >&4;;
17119 $undef) echo "sigsetjmp not found." >&4;;
17127 : see if snprintf exists
17128 set snprintf d_snprintf
17131 : see if vsnprintf exists
17132 set vsnprintf d_vsnprintf
17135 case "$d_snprintf-$d_vsnprintf" in
17138 Checking whether your snprintf() and vsnprintf() work okay...
17140 $cat >try.c <<'EOCP'
17141 /* v?snprintf testing logic courtesy of Russ Allbery.
17142 * According to C99:
17143 * - if the buffer is too short it still must be \0-terminated
17144 * - if the buffer is too short the potentially required length
17145 * must be returned and not -1
17146 * - if the buffer is NULL the potentially required length
17147 * must be returned and not -1 or core dump
17150 #include <stdarg.h>
17154 int test (char *format, ...)
17159 va_start (args, format);
17160 count = vsnprintf (buf, sizeof buf, format, args);
17167 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17168 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17172 if eval $compile; then
17175 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17177 Your snprintf() and snprintf() don't seem to be working okay.
17179 d_snprintf="$undef"
17180 d_vsnprintf="$undef"
17184 echo "(I can't seem to compile the test program--assuming they don't)"
17185 d_snprintf="$undef"
17186 d_vsnprintf="$undef"
17192 : see if sockatmark exists
17193 set sockatmark d_sockatmark
17196 : see if prototype for sockatmark is available
17198 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17201 : see if socks5_init exists
17202 set socks5_init d_socks5_init
17205 : see if sprintf returns the length of the string in the buffer as per ANSI
17206 $echo "Checking whether sprintf returns the length of the string..." >&4
17209 #$i_stdlib I_STDLIB
17211 #include <stdlib.h>
17213 #$i_string I_STRING
17215 # include <string.h>
17217 # include <strings.h>
17226 int check (size_t expect, int test) {
17227 size_t got = strlen(buffer);
17231 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17236 int main(int argc, char **argv) {
17239 check(sprintf(buffer, ""), ++test);
17240 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17241 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17248 d_sprintf_returns_strlen="$undef"
17249 if eval $compile; then
17253 sprintf returns the length of the string (as ANSI says it should)
17255 d_sprintf_returns_strlen="$define"
17258 sprintf does not return the length of the string (how old is this system?)
17260 d_sprintf_returns_strlen="$undef"
17266 : see if srand48_r exists
17267 set srand48_r d_srand48_r
17269 case "$d_srand48_r" in
17271 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17272 case "$d_srand48_r_proto:$usethreads" in
17273 ":define") d_srand48_r_proto=define
17274 set d_srand48_r_proto srand48_r $hdrs
17278 case "$d_srand48_r_proto" in
17280 case "$srand48_r_proto" in
17281 ''|0) try='int srand48_r(long, struct drand48_data*);'
17282 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
17284 case "$srand48_r_proto" in
17285 ''|0) d_srand48_r=undef
17287 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17288 * ) case "$srand48_r_proto" in
17289 REENTRANT_PROTO*) ;;
17290 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17292 echo "Prototype: $try" ;;
17295 *) case "$usethreads" in
17296 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17303 *) srand48_r_proto=0
17307 : see if srandom_r exists
17308 set srandom_r d_srandom_r
17310 case "$d_srandom_r" in
17312 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17313 case "$d_srandom_r_proto:$usethreads" in
17314 ":define") d_srandom_r_proto=define
17315 set d_srandom_r_proto srandom_r $hdrs
17319 case "$d_srandom_r_proto" in
17321 case "$srandom_r_proto" in
17322 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17323 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
17325 case "$srandom_r_proto" in
17326 ''|0) d_srandom_r=undef
17328 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17329 * ) case "$srandom_r_proto" in
17330 REENTRANT_PROTO*) ;;
17331 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17333 echo "Prototype: $try" ;;
17336 *) case "$usethreads" in
17337 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17344 *) srandom_r_proto=0
17348 : see if prototype for setresgid is available
17350 set d_sresgproto setresgid $i_unistd unistd.h
17353 : see if prototype for setresuid is available
17355 set d_sresuproto setresuid $i_unistd unistd.h
17358 : see if sys/stat.h is available
17359 set sys/stat.h i_sysstat
17363 : see if stat knows about block sizes
17365 echo "Checking to see if your struct stat has st_blocks field..." >&4
17366 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17370 : see if this is a sys/vfs.h system
17371 set sys/vfs.h i_sysvfs
17375 : see if this is a sys/statfs.h system
17376 set sys/statfs.h i_sysstatfs
17381 echo "Checking to see if your system supports struct statfs..." >&4
17382 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
17384 case "$d_statfs_s" in
17385 "$define") echo "Yes, it does." ;;
17386 *) echo "No, it doesn't." ;;
17391 : see if struct statfs knows about f_flags
17392 case "$d_statfs_s" in
17395 echo "Checking to see if your struct statfs has f_flags field..." >&4
17396 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
17400 set d_statfs_f_flags
17404 case "$d_statfs_f_flags" in
17405 "$define") echo "Yes, it does." ;;
17406 *) echo "No, it doesn't." ;;
17410 Checking how to access stdio streams by file descriptor number...
17412 case "$stdio_stream_array" in
17413 '') $cat >try.c <<EOCP
17416 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17420 for s in _iob __iob __sF
17422 set try -DSTDIO_STREAM_ARRAY=$s
17423 if eval $compile; then
17424 case "`$run ./try`" in
17425 yes) stdio_stream_array=$s; break ;;
17431 case "$stdio_stream_array" in
17433 I can't figure out how to access stdio streams by file descriptor number.
17435 d_stdio_stream_array="$undef"
17438 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17440 d_stdio_stream_array="$define"
17444 : see if strcoll exists
17445 set strcoll d_strcoll
17448 : check for structure copying
17450 echo "Checking to see if your C compiler can copy structs..." >&4
17451 $cat >try.c <<'EOCP'
17461 if $cc -c try.c >/dev/null 2>&1 ; then
17463 echo "Yup, it can."
17466 echo "Nope, it can't."
17472 : see if strerror and/or sys_errlist[] exist
17474 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17475 if set strerror val -f d_strerror; eval $csym; $val; then
17476 echo 'strerror() found.' >&4
17477 d_strerror="$define"
17478 d_strerrm='strerror(e)'
17479 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17480 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17481 d_syserrlst="$define"
17483 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17484 d_syserrlst="$undef"
17486 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17487 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17488 echo 'strerror() found in string header.' >&4
17489 d_strerror="$define"
17490 d_strerrm='strerror(e)'
17491 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17492 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17493 d_syserrlst="$define"
17495 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17496 d_syserrlst="$undef"
17498 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17499 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17500 d_strerror="$undef"
17501 d_syserrlst="$define"
17502 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17504 echo 'strerror() and sys_errlist[] NOT found.' >&4
17505 d_strerror="$undef"
17506 d_syserrlst="$undef"
17507 d_strerrm='"unknown"'
17511 : see if strerror_r exists
17512 set strerror_r d_strerror_r
17514 case "$d_strerror_r" in
17516 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17517 case "$d_strerror_r_proto:$usethreads" in
17518 ":define") d_strerror_r_proto=define
17519 set d_strerror_r_proto strerror_r $hdrs
17523 case "$d_strerror_r_proto" in
17525 case "$strerror_r_proto" in
17526 ''|0) try='int strerror_r(int, char*, size_t);'
17527 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
17529 case "$strerror_r_proto" in
17530 ''|0) try='int strerror_r(int, char*, int);'
17531 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17533 case "$strerror_r_proto" in
17534 ''|0) try='char* strerror_r(int, char*, size_t);'
17535 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17537 case "$strerror_r_proto" in
17538 ''|0) d_strerror_r=undef
17540 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17541 * ) case "$strerror_r_proto" in
17542 REENTRANT_PROTO*) ;;
17543 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17545 echo "Prototype: $try" ;;
17548 *) case "$usethreads" in
17549 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17556 *) strerror_r_proto=0
17560 : see if strftime exists
17561 set strftime d_strftime
17564 : see if strlcat exists
17565 set strlcat d_strlcat
17568 : see if strlcpy exists
17569 set strlcpy d_strlcpy
17572 : see if strtod exists
17573 set strtod d_strtod
17576 : see if strtol exists
17577 set strtol d_strtol
17580 : see if strtold exists
17581 set strtold d_strtold
17584 : see if strtoll exists
17585 set strtoll d_strtoll
17588 case "$d_longlong-$d_strtoll" in
17591 Checking whether your strtoll() works okay...
17593 $cat >try.c <<'EOCP'
17596 #define strtoll __strtoll
17599 #define strtoll _strtoll
17602 extern long long int strtoll(char *s, char **, int);
17603 static int bad = 0;
17604 int check(char *s, long long ell, int een) {
17607 gll = strtoll(s, 0, 10);
17608 if (!((gll == ell) && (errno == een)))
17612 check(" 1", 1LL, 0);
17613 check(" 0", 0LL, 0);
17614 check("-1", -1LL, 0);
17615 check("-9223372036854775808", -9223372036854775808LL, 0);
17616 check("-9223372036854775808", -9223372036854775808LL, 0);
17617 check(" 9223372036854775807", 9223372036854775807LL, 0);
17618 check("-9223372036854775808", -9223372036854775808LL, 0);
17619 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17620 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17626 if eval $compile; then
17629 ok) echo "Your strtoll() seems to be working okay." ;;
17631 Your strtoll() doesn't seem to be working okay.
17637 echo "(I can't seem to compile the test program--assuming it doesn't)"
17643 : see if strtoq exists
17644 set strtoq d_strtoq
17647 : see if strtoul exists
17648 set strtoul d_strtoul
17651 case "$d_strtoul" in
17654 Checking whether your strtoul() works okay...
17656 $cat >try.c <<'EOCP'
17659 extern unsigned long int strtoul(char *s, char **, int);
17660 static int bad = 0;
17661 void check(char *s, unsigned long eul, int een) {
17664 gul = strtoul(s, 0, 10);
17665 if (!((gul == eul) && (errno == een)))
17669 check(" 1", 1L, 0);
17670 check(" 0", 0L, 0);
17672 case "$longsize" in
17674 $cat >>try.c <<'EOCP'
17675 check("18446744073709551615", 18446744073709551615UL, 0);
17676 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17677 #if 0 /* strtoul() for /^-/ strings is undefined. */
17678 check("-1", 18446744073709551615UL, 0);
17679 check("-18446744073709551614", 2, 0);
17680 check("-18446744073709551615", 1, 0);
17681 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17682 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17687 $cat >>try.c <<'EOCP'
17688 check("4294967295", 4294967295UL, 0);
17689 check("4294967296", 4294967295UL, ERANGE);
17690 #if 0 /* strtoul() for /^-/ strings is undefined. */
17691 check("-1", 4294967295UL, 0);
17692 check("-4294967294", 2, 0);
17693 check("-4294967295", 1, 0);
17694 check("-4294967296", 4294967295UL, ERANGE);
17695 check("-4294967297", 4294967295UL, ERANGE);
17700 : Should we write these tests to be more portable by sprintf-ing
17701 : ~0 and then manipulating that char string as input for strtol?
17704 $cat >>try.c <<'EOCP'
17711 if eval $compile; then
17712 case "`$run ./try`" in
17713 ok) echo "Your strtoul() seems to be working okay." ;;
17715 Your strtoul() doesn't seem to be working okay.
17721 echo "(I can't seem to compile the test program--assuming it doesn't)"
17727 : see if strtoull exists
17728 set strtoull d_strtoull
17731 case "$d_longlong-$d_strtoull" in
17734 Checking whether your strtoull() works okay...
17736 $cat >try.c <<'EOCP'
17739 #define strtoull __strtoull
17742 extern unsigned long long int strtoull(char *s, char **, int);
17743 static int bad = 0;
17744 int check(char *s, long long eull, int een) {
17747 gull = strtoull(s, 0, 10);
17748 if (!((gull == eull) && (errno == een)))
17752 check(" 1", 1LL, 0);
17753 check(" 0", 0LL, 0);
17754 check("18446744073709551615", 18446744073709551615ULL, 0);
17755 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17756 #if 0 /* strtoull() for /^-/ strings is undefined. */
17757 check("-1", 18446744073709551615ULL, 0);
17758 check("-18446744073709551614", 2LL, 0);
17759 check("-18446744073709551615", 1LL, 0);
17760 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17761 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17768 if eval $compile; then
17769 case "`$run ./try`" in
17770 ok) echo "Your strtoull() seems to be working okay." ;;
17772 Your strtoull() doesn't seem to be working okay.
17774 d_strtoull="$undef"
17778 echo "(I can't seem to compile the test program--assuming it doesn't)"
17779 d_strtoull="$undef"
17784 : see if strtouq exists
17785 set strtouq d_strtouq
17788 case "$d_strtouq" in
17791 Checking whether your strtouq() works okay...
17793 $cat >try.c <<'EOCP'
17796 extern unsigned long long int strtouq(char *s, char **, int);
17797 static int bad = 0;
17798 void check(char *s, unsigned long long eull, int een) {
17799 unsigned long long gull;
17801 gull = strtouq(s, 0, 10);
17802 if (!((gull == eull) && (errno == een)))
17806 check(" 1", 1LL, 0);
17807 check(" 0", 0LL, 0);
17808 check("18446744073709551615", 18446744073709551615ULL, 0);
17809 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17810 #if 0 /* strtouq() for /^-/ strings is undefined. */
17811 check("-1", 18446744073709551615ULL, 0);
17812 check("-18446744073709551614", 2LL, 0);
17813 check("-18446744073709551615", 1LL, 0);
17814 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17815 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17823 if eval $compile; then
17824 case "`$run ./try`" in
17825 ok) echo "Your strtouq() seems to be working okay." ;;
17827 Your strtouq() doesn't seem to be working okay.
17833 echo "(I can't seem to compile the test program--assuming it doesn't)"
17839 : see if strxfrm exists
17840 set strxfrm d_strxfrm
17843 : see if symlink exists
17844 set symlink d_symlink
17847 : see if syscall exists
17848 set syscall d_syscall
17851 : see if prototype for syscall is available
17853 set d_syscallproto syscall $i_unistd unistd.h
17856 : see if sysconf exists
17857 set sysconf d_sysconf
17860 : see if system exists
17861 set system d_system
17864 : see if tcgetpgrp exists
17865 set tcgetpgrp d_tcgetpgrp
17868 : see if tcsetpgrp exists
17869 set tcsetpgrp d_tcsetpgrp
17872 : see if prototype for telldir is available
17874 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17877 : see if time exists
17879 if test "X$d_time" = X -o X"$timetype" = X; then
17880 if set time val -f d_time; eval $csym; $val; then
17881 echo 'time() found.' >&4
17883 rp="What is the type returned by time() on this system?"
17884 set time_t timetype long stdio.h sys/types.h
17887 echo 'time() not found, hope that will do.' >&4
17895 : see if this is a sys/times.h system
17896 set sys/times.h i_systimes
17899 : see if times exists
17901 if set times val -f d_times; eval $csym; $val; then
17902 echo 'times() found.' >&4
17905 case "$i_systimes" in
17906 "$define") inc='sys/times.h';;
17908 rp="What is the type returned by times() on this system?"
17909 set clock_t clocktype long stdio.h sys/types.h $inc
17912 echo 'times() NOT found, hope that will do.' >&4
17917 : see if tmpnam_r exists
17918 set tmpnam_r d_tmpnam_r
17920 case "$d_tmpnam_r" in
17922 hdrs="$i_systypes sys/types.h define stdio.h "
17923 case "$d_tmpnam_r_proto:$usethreads" in
17924 ":define") d_tmpnam_r_proto=define
17925 set d_tmpnam_r_proto tmpnam_r $hdrs
17929 case "$d_tmpnam_r_proto" in
17931 case "$tmpnam_r_proto" in
17932 ''|0) try='char* tmpnam_r(char*);'
17933 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17935 case "$tmpnam_r_proto" in
17936 ''|0) d_tmpnam_r=undef
17938 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17939 * ) case "$tmpnam_r_proto" in
17940 REENTRANT_PROTO*) ;;
17941 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17943 echo "Prototype: $try" ;;
17946 *) case "$usethreads" in
17947 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
17954 *) tmpnam_r_proto=0
17958 : see if truncate exists
17959 set truncate d_truncate
17962 : see if ttyname_r exists
17963 set ttyname_r d_ttyname_r
17965 case "$d_ttyname_r" in
17967 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
17968 case "$d_ttyname_r_proto:$usethreads" in
17969 ":define") d_ttyname_r_proto=define
17970 set d_ttyname_r_proto ttyname_r $hdrs
17974 case "$d_ttyname_r_proto" in
17976 case "$ttyname_r_proto" in
17977 ''|0) try='int ttyname_r(int, char*, size_t);'
17978 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
17980 case "$ttyname_r_proto" in
17981 ''|0) try='int ttyname_r(int, char*, int);'
17982 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
17984 case "$ttyname_r_proto" in
17985 ''|0) try='char* ttyname_r(int, char*, int);'
17986 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
17988 case "$ttyname_r_proto" in
17989 ''|0) d_ttyname_r=undef
17991 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
17992 * ) case "$ttyname_r_proto" in
17993 REENTRANT_PROTO*) ;;
17994 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
17996 echo "Prototype: $try" ;;
17999 *) case "$usethreads" in
18000 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18007 *) ttyname_r_proto=0
18011 : see if tzname[] exists
18013 if set tzname val -a d_tzname; eval $csym; $val; then
18015 echo 'tzname[] found.' >&4
18018 echo 'tzname[] NOT found.' >&4
18024 next|rhapsody|darwin) multiarch="$define" ;;
18026 case "$multiarch" in
18027 ''|[nN]*) multiarch="$undef" ;;
18030 : check for ordering of bytes in a UV
18032 case "$usecrosscompile$multiarch" in
18035 You seem to be either cross-compiling or doing a multiarchitecture build,
18036 skipping the byteorder check.
18042 case "$byteorder" in
18045 In the following, larger digits indicate more significance. A big-endian
18046 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18047 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18048 machines may have weird orders like 3412. A Cray will report 87654321,
18049 an Alpha will report 12345678. If the test program works the default is
18051 I'm now running the test program...
18055 #$i_stdlib I_STDLIB
18057 #include <stdlib.h>
18059 #include <sys/types.h>
18060 typedef $uvtype UV;
18070 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18072 u.l = (UV)0x04030201;
18073 for (i = 0; i < $uvsize; i++)
18074 printf("%c", u.c[i]+'0');
18081 if eval $compile && $run ./try > /dev/null; then
18084 [1-4][1-4][1-4][1-4]|12345678|87654321)
18085 echo "(The test program ran ok.)"
18086 echo "byteorder=$dflt"
18089 ????|????????) echo "(The test program ran ok.)" ;;
18090 *) echo "(The test program didn't run right for some reason.)" ;;
18095 (I can't seem to compile the test program. Guessing big-endian...)
18098 case "$xxx_prompt" in
18100 rp="What is the order of bytes in $uvtype?"
18115 Checking to see whether you can access character data unalignedly...
18117 case "$d_u32align" in
18118 '') $cat >try.c <<EOCP
18120 #$i_stdlib I_STDLIB
18122 #include <stdlib.h>
18124 #define U32 $u32type
18125 #define BYTEORDER 0x$byteorder
18127 #include <signal.h>
18129 $signal_t bletch(int s) { exit(4); }
18132 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18137 if (sizeof(U32) != 4) {
18138 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18145 signal(SIGBUS, bletch);
18157 for (i = 0; i < 4; i++) {
18158 up = (U32*)(buf + i);
18159 if (! ((*up == 1 << (8*i)) || /* big-endian */
18160 (*up == 1 << (8*(3-i))) /* little-endian */
18164 printf("read failed (%x)\n", *up);
18170 for (i = 0; i < 4; i++) {
18171 up = (U32*)(buf + i);
18173 if (*up != 0xBeef) {
18174 printf("write failed (%x)\n", *up);
18188 if eval $compile_ok; then
18189 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18190 $run ./try 2>&1 >/dev/null
18193 You can access character data pretty unalignedly.
18195 d_u32align="$undef"
18198 It seems that you must access character data in an aligned manner.
18200 d_u32align="$define"
18204 rp='Can you access character data at unaligned addresses?'
18208 [yY]*) d_u32align="$undef" ;;
18209 *) d_u32align="$define" ;;
18216 : see if ualarm exists
18217 set ualarm d_ualarm
18220 : see if umask exists
18224 : see if unordered exists
18225 set unordered d_unordered
18228 : see if unsetenv exists
18229 set unsetenv d_unsetenv
18232 : see if usleep exists
18233 set usleep d_usleep
18236 : see if prototype for usleep is available
18238 set d_usleepproto usleep $i_unistd unistd.h
18241 : see if ustat exists
18245 : see if closedir exists
18246 set closedir d_closedir
18249 case "$d_closedir" in
18252 echo "Checking whether closedir() returns a status..." >&4
18254 #$i_dirent I_DIRENT /**/
18255 #$i_sysdir I_SYS_DIR /**/
18256 #$i_sysndir I_SYS_NDIR /**/
18257 #$i_systypes I_SYS_TYPES /**/
18259 #if defined(I_SYS_TYPES)
18260 #include <sys/types.h>
18262 #if defined(I_DIRENT)
18263 #include <dirent.h>
18264 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18265 #include <sys/dir.h>
18269 #include <sys/ndir.h>
18273 #include <ndir.h> /* may be wrong in the future */
18275 #include <sys/dir.h>
18280 int main() { return closedir(opendir(".")); }
18283 if eval $compile_ok; then
18284 if $run ./try > /dev/null 2>&1 ; then
18285 echo "Yes, it does."
18288 echo "No, it doesn't."
18292 echo "(I can't seem to compile the test program--assuming it doesn't)"
18300 set d_void_closedir
18304 : see if there is a wait4
18308 : see if waitpid exists
18309 set waitpid d_waitpid
18312 : see if wcstombs exists
18313 set wcstombs d_wcstombs
18316 : see if wctomb exists
18317 set wctomb d_wctomb
18320 : see if writev exists
18321 set writev d_writev
18324 : preserve RCS keywords in files with variable substitution, grrr
18329 Revision='$Revision'
18331 : check for alignment requirements
18333 case "$usecrosscompile$multiarch" in
18336 You seem to be either cross-compiling or doing a multiarchitecture build,
18337 skipping the memory alignment check.
18340 case "$alignbytes" in
18341 '') alignbytes=8 ;;
18345 case "$alignbytes" in
18346 '') echo "Checking alignment constraints..." >&4
18347 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18348 $cat >try.c <<'EOCP'
18349 typedef long double NV;
18352 $cat >try.c <<'EOCP'
18356 $cat >>try.c <<'EOCP'
18364 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18369 if eval $compile_ok; then
18373 echo "(I can't seem to compile the test program...)"
18376 *) dflt="$alignbytes"
18379 rp="Doubles must be aligned on a how-many-byte boundary?"
18387 : set the base revision
18390 : how do we concatenate cpp tokens here?
18392 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18393 $cat >cpp_stuff.c <<'EOCP'
18394 #define RCAT(a,b)a/**/b
18395 #define ACAT(a,b)a ## b
18399 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18400 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18401 echo "Oh! Smells like ANSI's been here." >&4
18402 echo "We can catify or stringify, separately or together!"
18404 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18405 echo "Ah, yes! The good old days!" >&4
18406 echo "However, in the good old days we don't know how to stringify and"
18407 echo "catify at the same time."
18411 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18412 You're going to have to edit the values of CAT[2-5] in config.h...
18414 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18418 : see if this is a db.h system
18424 : Check db version.
18426 echo "Checking Berkeley DB version ..." >&4
18432 #include <sys/types.h>
18434 #$i_stdlib I_STDLIB
18436 #include <stdlib.h>
18439 int main(int argc, char *argv[])
18441 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18442 int Major, Minor, Patch ;
18443 unsigned long Version ;
18444 (void)db_version(&Major, &Minor, &Patch) ;
18446 printf("%d %d %d %d %d %d\n",
18447 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18448 Major, Minor, Patch);
18451 printf("You have Berkeley DB Version 2 or greater.\n");
18453 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18454 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18455 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18456 Major, Minor, Patch) ;
18458 /* check that db.h & libdb are compatible */
18459 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18460 printf("db.h and libdb are incompatible.\n") ;
18464 printf("db.h and libdb are compatible.\n") ;
18466 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18467 + DB_VERSION_PATCH ;
18469 /* needs to be >= 2.3.4 */
18470 if (Version < 2003004) {
18471 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18472 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18478 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18483 printf("You have Berkeley DB Version 1.\n");
18484 exit(0); /* DB version < 2: the coast is clear. */
18486 exit(1); /* <db.h> not Berkeley DB? */
18492 if eval $compile_ok && $run ./try; then
18493 echo 'Looks OK.' >&4
18495 db_version_major=$1
18496 db_version_minor=$2
18497 db_version_patch=$3
18499 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18503 : Remove db from list of libraries to use
18504 echo "Removing unusable -ldb from library list" >&4
18505 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18508 echo "libs = $libs" >&4
18518 : Check the return type needed for hash
18520 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18526 #include <sys/types.h>
18529 #ifndef DB_VERSION_MAJOR
18530 u_int32_t hash_cb (ptr, size)
18538 info.hash = hash_cb;
18542 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18543 if $contains warning try.out >>/dev/null 2>&1 ; then
18546 db_hashtype='u_int32_t'
18549 : XXX Maybe we should just give up here.
18550 db_hashtype=u_int32_t
18552 echo "Help: I can't seem to compile the db test program." >&4
18553 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18556 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18558 *) db_hashtype=u_int32_t
18563 : Check the return type needed for prefix
18565 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18571 #include <sys/types.h>
18574 #ifndef DB_VERSION_MAJOR
18575 size_t prefix_cb (key1, key2)
18583 info.prefix = prefix_cb;
18587 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18588 if $contains warning try.out >>/dev/null 2>&1 ; then
18589 db_prefixtype='int'
18591 db_prefixtype='size_t'
18594 db_prefixtype='size_t'
18595 : XXX Maybe we should just give up here.
18597 echo "Help: I can't seem to compile the db test program." >&4
18598 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18601 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18603 *) db_prefixtype='size_t'
18607 : How can we generate normalized random numbers ?
18609 echo "Looking for a random number function..." >&4
18610 case "$randfunc" in
18612 if set drand48 val -f; eval $csym; $val; then
18614 echo "Good, found drand48()." >&4
18615 elif set random val -f; eval $csym; $val; then
18617 echo "OK, found random()." >&4
18620 echo "Yick, looks like I have to use rand()." >&4
18631 *-Dmy_rand=*|*-Dmy_srand=*)
18632 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18633 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18634 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18635 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18639 while $test "$cont"; do
18640 rp="Use which function to generate random numbers?"
18642 if $test "$ans" = "$dflt"; then
18648 if set $ans val -f; eval $csym; $val; then
18652 rp="I cannot find function $ans. Use that name anyway?"
18661 case "$randfunc" in
18663 drand01="drand48()"
18669 case "$randbits" in
18671 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18673 #$i_unistd I_UNISTD
18674 #$i_stdlib I_STDLIB
18677 # include <unistd.h>
18680 # include <stdlib.h>
18685 register unsigned long tmp;
18686 register unsigned long max = 0L;
18688 for (i = 1000; i; i--) {
18689 tmp = (unsigned long) $randfunc();
18690 if (tmp > max) max = tmp;
18692 for (i = 0; max; i++)
18698 if eval $compile_ok; then
18702 echo "(I can't seem to compile the test program...)"
18709 rp="How many bits does your $randfunc() function produce?"
18713 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18714 seedfunc="s$randfunc"
18715 randseedtype=unsigned
18719 rp="How many bits does your $randfunc() function produce?"
18722 seedfunc="s$randfunc"
18723 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18724 if set $seedfunc val -f; eval $csym; $val; then
18725 echo "(Using $seedfunc() to seed random generator)"
18727 echo "(Warning: no $seedfunc() to seed random generator)"
18730 randseedtype=unsigned
18738 echo "Determining whether or not we are on an EBCDIC system..." >&4
18739 $cat >try.c <<'EOM'
18742 if ('M'==0xd4) return 0;
18749 if eval $compile_ok; then
18750 if $run ./try; then
18751 echo "You seem to speak EBCDIC." >&4
18754 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18757 echo "I'm unable to compile the test program." >&4
18758 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18766 Checking how to flush all pending stdio output...
18768 # I only know how to find the first 32 possibly open files on SunOS.
18769 # See also hints/sunos_4_1.sh and util.c --AD
18771 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18773 $cat >>try.c <<EOCP
18775 #$i_stdlib I_STDLIB
18777 #include <stdlib.h>
18779 #$i_unistd I_UNISTD
18781 # include <unistd.h>
18783 #$d_sysconf HAS_SYSCONF
18784 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18785 #ifdef HAS_STDIO_STREAM_ARRAY
18786 # define STDIO_STREAM_ARRAY $stdio_stream_array
18791 p = fopen("try.out", "w");
18795 # ifdef TRY_FPRINTF
18799 #ifdef TRY_FFLUSH_NULL
18802 #ifdef TRY_FFLUSH_ALL
18804 long open_max = -1;
18805 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18806 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18808 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18809 open_max = sysconf(_SC_OPEN_MAX);
18812 open_max = FOPEN_MAX;
18815 open_max = OPEN_MAX;
18824 # ifdef HAS_STDIO_STREAM_ARRAY
18825 if (open_max > 0) {
18827 for (i = 0; i < open_max; i++)
18828 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18829 STDIO_STREAM_ARRAY[i]._file < open_max &&
18830 STDIO_STREAM_ARRAY[i]._flag)
18831 fflush(&STDIO_STREAM_ARRAY[i]);
18839 : first we have to find out how _not_ to flush
18841 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18843 set try -DTRY_FPUTC
18844 if eval $compile; then
18845 $run ./try 2>/dev/null
18848 if $test ! -s try.out -a "X$code" = X42; then
18854 set try -DTRY_FPRINTF
18855 if eval $compile; then
18856 $run ./try 2>/dev/null
18859 if $test ! -s try.out -a "X$code" = X42; then
18860 output=-DTRY_FPRINTF
18866 : check for fflush NULL behaviour
18867 case "$fflushNULL" in
18868 '') set try -DTRY_FFLUSH_NULL $output
18869 if eval $compile; then
18870 $run ./try 2>/dev/null
18873 if $test -s try.out -a "X$code" = X42; then
18874 fflushNULL="`$cat try.out`"
18876 if $test "X$code" != X42; then
18878 (If this test failed, don't worry, we'll try another method shortly.)
18884 case "$fflushNULL" in
18886 Your fflush(NULL) works okay for output streams.
18887 Let's see if it clobbers input pipes...
18889 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18890 # bug that improperly flushes the input end of pipes. So we avoid the
18891 # autoflush on fork/system/exec support for now. :-(
18892 $cat >tryp.c <<EOCP
18895 main(int argc, char **argv)
18901 while ((i = getc(stdin)) != -1
18902 && (*bp++ = i) != '\n'
18903 && bp < &buf[1024])
18906 fprintf(stdout, "%s", buf);
18914 fflushNULL="$define"
18916 if eval $compile; then
18918 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18919 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18921 fflush(NULL) seems to behave okay with input streams.
18923 fflushNULL="$define"
18926 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18928 fflushNULL="$undef"
18931 $rm -f core tryp.c tryp.core core.tryp.*
18934 Your fflush(NULL) isn't working (contrary to ANSI C).
18936 fflushNULL="$undef"
18939 Cannot figure out whether your fflush(NULL) works or not.
18940 I'm assuming it doesn't (contrary to ANSI C).
18942 fflushNULL="$undef"
18946 $define|true|[yY]*)
18947 fflushNULL="$define"
18950 fflushNULL="$undef"
18953 : check explicit looping only if NULL did not work, and if the pipe
18954 : bug does not show up on an explicit flush too
18955 case "$fflushNULL" in
18957 $cat >tryp.c <<EOCP
18960 main(int argc, char **argv)
18966 while ((i = getc(stdin)) != -1
18967 && (*bp++ = i) != '\n'
18968 && bp < &buf[1024])
18971 fprintf(stdout, "%s", buf);
18980 if eval $compile; then
18982 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18983 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18985 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
18987 : now check for fflushall behaviour
18988 case "$fflushall" in
18989 '') set try -DTRY_FFLUSH_ALL $output
18990 if eval $compile; then
18992 (Now testing the other method--but note that this also may fail.)
18994 $run ./try 2>/dev/null
18997 if $test -s try.out -a "X$code" = X42; then
18998 fflushall="`$cat try.out`"
19002 case "$fflushall" in
19004 Whew. Flushing explicitly all the stdio streams works.
19006 fflushall="$define"
19009 Sigh. Flushing explicitly all the stdio streams doesn't work.
19014 Cannot figure out whether flushing stdio streams explicitly works or not.
19015 I'm assuming it doesn't.
19021 "$define"|true|[yY]*)
19022 fflushall="$define"
19030 All is futile. Even fflush(stdin) clobbers input pipes!
19037 $rm -f core tryp.c tryp.core core.tryp.*
19039 *) fflushall="$undef"
19043 case "$fflushNULL$fflushall" in
19046 OK, I give up. I cannot figure out how to flush pending stdio output.
19047 We won't be flushing handles at all before fork/exec/popen.
19053 : Store the full pathname to the ar program for use in the C program
19054 : Respect a hint or command line value for full_ar.
19059 : Store the full pathname to the sed program for use in the C program
19062 : see what type gids are declared as in the kernel
19064 echo "Looking for the type for group ids returned by getgid()."
19065 set gid_t gidtype xxx stdio.h sys/types.h
19069 xxx=`./findhdr sys/user.h`
19070 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19072 unsigned) dflt="$1 $2" ;;
19076 *) dflt="$gidtype";;
19079 gid_t) echo "gid_t found." ;;
19080 *) rp="What is the type for group ids returned by getgid()?"
19088 *_t) zzz="$gidtype" ;;
19091 echo "Checking the size of $zzz..." >&4
19093 #include <sys/types.h>
19095 #$i_stdlib I_STDLIB
19097 #include <stdlib.h>
19100 printf("%d\n", (int)sizeof($gidtype));
19105 if eval $compile_ok; then
19109 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19112 echo "Your $zzz is $gidsize bytes long."
19117 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19123 *_t) zzz="$gidtype" ;;
19126 echo "Checking the sign of $zzz..." >&4
19128 #include <sys/types.h>
19139 if eval $compile; then
19143 echo "(I can't execute the test program--guessing unsigned.)" >&4
19147 1) echo "Your $zzz is unsigned." ;;
19148 -1) echo "Your $zzz is signed." ;;
19154 echo "(I can't compile the test program--guessing unsigned.)" >&4
19160 if $test X"$quadtype" != X; then
19162 echo "Checking how to print 64-bit integers..." >&4
19164 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19165 $cat >try.c <<'EOCP'
19166 #include <sys/types.h>
19169 int q = 12345678901;
19170 printf("%ld\n", q);
19174 if eval $compile; then
19178 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19179 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19180 echo "We will use %d."
19186 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19187 $cat >try.c <<'EOCP'
19188 #include <sys/types.h>
19191 long q = 12345678901;
19192 printf("%ld\n", q);
19196 if eval $compile; then
19200 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19201 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19202 echo "We will use %ld."
19208 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19209 $cat >try.c <<'EOCP'
19210 #include <sys/types.h>
19211 #include <inttypes.h>
19214 int64_t q = 12345678901;
19215 printf("%" PRId64 "\n", q);
19219 if eval $compile; then
19223 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19224 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19225 echo "We will use the C9X style."
19231 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19233 #include <sys/types.h>
19236 $quadtype q = 12345678901;
19237 printf("%Ld\n", q);
19241 if eval $compile; then
19245 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19246 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19247 echo "We will use %Ld."
19253 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19254 $cat >try.c <<'EOCP'
19255 #include <sys/types.h>
19258 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19259 printf("%lld\n", q);
19263 if eval $compile; then
19267 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19268 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19269 echo "We will use the %lld style."
19275 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19277 #include <sys/types.h>
19280 $quadtype q = 12345678901;
19281 printf("%qd\n", q);
19285 if eval $compile; then
19289 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19290 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19291 echo "We will use %qd."
19297 if $test X"$sPRId64" = X; then
19298 echo "Cannot figure out how to print 64-bit integers." >&4
19305 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19306 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19308 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19309 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19315 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19317 if $test X"$ivsize" = X8; then
19318 ivdformat="$sPRId64"
19319 uvuformat="$sPRIu64"
19320 uvoformat="$sPRIo64"
19321 uvxformat="$sPRIx64"
19322 uvXUformat="$sPRIXU64"
19324 if $test X"$ivsize" = X"$longsize"; then
19331 if $test X"$ivsize" = X"$intsize"; then
19339 if $test X"$ivsize" = X"$shortsize"; then
19350 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19351 nveformat="$sPRIeldbl"
19352 nvfformat="$sPRIfldbl"
19353 nvgformat="$sPRIgldbl"
19354 nvEUformat="$sPRIEUldbl"
19355 nvFUformat="$sPRIFUldbl"
19356 nvGUformat="$sPRIGUldbl"
19366 case "$ivdformat" in
19367 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19374 $echo "Checking the format string to be used for gids..." >&4
19377 -1) if $test X"$gidsize" = X"$ivsize"; then
19378 gidformat="$ivdformat"
19380 if $test X"$gidsize" = X"$longsize"; then
19383 if $test X"$gidsize" = X"$intsize"; then
19386 if $test X"$gidsize" = X"$shortsize"; then
19393 *) if $test X"$gidsize" = X"$uvsize"; then
19394 gidformat="$uvuformat"
19396 if $test X"$gidsize" = X"$longsize"; then
19399 if $test X"$gidsize" = X"$intsize"; then
19402 if $test X"$gidsize" = X"$shortsize"; then
19411 : see if getgroups exists
19412 set getgroups d_getgrps
19415 : see if setgroups exists
19416 set setgroups d_setgrps
19420 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19422 case "$d_getgrps$d_setgrps" in
19424 case "$groupstype" in
19425 '') dflt="$gidtype" ;;
19426 *) dflt="$groupstype" ;;
19429 What type of pointer is the second argument to getgroups() and setgroups()?
19430 Usually this is the same as group ids, $gidtype, but not always.
19433 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19437 *) groupstype="$gidtype";;
19441 if $test $patchlevel -lt 9; then
19442 : MAD is not available in 5.8.x or earlier.
19446 $define|true|[yY]*) dflt='y' ;;
19451 Would you like to build with Misc Attribute Decoration? This is development
19452 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19453 overhead on the interpreter.
19455 If this doesn't make any sense to you, just accept the default '$dflt'.
19457 rp='Build Perl with MAD?'
19462 madlyh='madly.h madly.act madly.tab'
19464 madlyobj="madly$_o" ;;
19474 echo "Checking if your $make program sets \$(MAKE)..." >&4
19475 case "$make_set_make" in
19477 $sed 's/^X //' > testmake.mak << 'EOF'
19479 X @echo 'maketemp="$(MAKE)"'
19481 case "`$make -f testmake.mak 2>/dev/null`" in
19482 *maketemp=*) make_set_make='#' ;;
19483 *) make_set_make="MAKE=$make" ;;
19485 $rm -f testmake.mak
19488 case "$make_set_make" in
19489 '#') echo "Yup, it does.";;
19490 *) echo "Nope, it doesn't.";;
19493 : see what type is used for mode_t
19494 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19495 set mode_t modetype int stdio.h sys/types.h
19498 : see if we need va_copy
19500 case "$i_stdarg" in
19503 #include <stdarg.h>
19505 #$i_stdlib I_STDLIB
19507 #include <stdlib.h>
19509 #include <signal.h>
19512 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19514 return vfprintf(f, fmt, *valp);
19518 myvfprintf(FILE *f, const char *fmt, va_list val)
19520 return ivfprintf(f, fmt, &val);
19524 myprintf(char *fmt, ...)
19527 va_start(val, fmt);
19528 return myvfprintf(stdout, fmt, val);
19532 main(int ac, char **av)
19534 signal(SIGSEGV, exit);
19536 myprintf("%s%cs all right, then\n", "that", '\'');
19541 if eval $compile && $run ./try 2>&1 >/dev/null; then
19542 case "`$run ./try`" in
19543 "that's all right, then")
19549 yes) echo "It seems that you don't need va_copy()." >&4
19550 need_va_copy="$undef"
19552 *) echo "It seems that va_copy() or similar will be needed." >&4
19553 need_va_copy="$define"
19558 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19562 : see what type is used for size_t
19563 rp="What is the type used for the length parameter for string functions?"
19564 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19567 : check for type of arguments to gethostbyaddr.
19568 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19569 case "$d_gethbyaddr" in
19573 Checking to see what type of arguments are accepted by gethostbyaddr().
19575 hdrs="$define sys/types.h
19576 $d_socket sys/socket.h
19577 $i_niin netinet/in.h
19579 $i_unistd unistd.h"
19580 : The first arg can 'char *' or 'void *'
19581 : The second arg is some of integral type
19582 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19583 for yyy in size_t long int; do
19584 case "$netdb_host_type" in
19585 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19586 if ./protochk "$try" $hdrs; then
19587 echo "Your system accepts $xxx for the first arg."
19588 echo "...and $yyy for the second arg."
19589 netdb_host_type="$xxx"
19590 netdb_hlen_type="$yyy"
19596 : In case none of those worked, prompt the user.
19597 case "$netdb_host_type" in
19598 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19601 netdb_host_type=$ans
19602 rp='What is the type for the 2nd argument to gethostbyaddr?'
19605 netdb_hlen_type=$ans
19609 *) : no gethostbyaddr, so pick harmless defaults
19610 netdb_host_type='char *'
19611 netdb_hlen_type="$sizetype"
19614 # Remove the "const" if needed. -- but then we'll have a
19616 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19619 : check for type of argument to gethostbyname.
19620 if test "X$netdb_name_type" = X ; then
19621 case "$d_gethbyname" in
19625 Checking to see what type of argument is accepted by gethostbyname().
19627 hdrs="$define sys/types.h
19628 $d_socket sys/socket.h
19629 $i_niin netinet/in.h
19631 $i_unistd unistd.h"
19632 for xxx in "const char *" "char *"; do
19633 case "$netdb_name_type" in
19634 '') try="extern struct hostent *gethostbyname($xxx);"
19635 if ./protochk "$try" $hdrs; then
19636 echo "Your system accepts $xxx."
19637 netdb_name_type="$xxx"
19642 : In case none of those worked, prompt the user.
19643 case "$netdb_name_type" in
19644 '') rp='What is the type for the 1st argument to gethostbyname?'
19647 netdb_name_type=$ans
19651 *) : no gethostbyname, so pick harmless default
19652 netdb_name_type='char *'
19657 : check for type of 1st argument to getnetbyaddr.
19658 if test "X$netdb_net_type" = X ; then
19659 case "$d_getnbyaddr" in
19663 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19665 hdrs="$define sys/types.h
19666 $d_socket sys/socket.h
19667 $i_niin netinet/in.h
19669 $i_unistd unistd.h"
19670 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19671 case "$netdb_net_type" in
19672 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19673 if ./protochk "$try" $hdrs; then
19674 echo "Your system accepts $xxx."
19675 netdb_net_type="$xxx"
19680 : In case none of those worked, prompt the user.
19681 case "$netdb_net_type" in
19682 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19685 netdb_net_type=$ans
19689 *) : no getnetbyaddr, so pick harmless default
19690 netdb_net_type='long'
19694 : locate the preferred pager for this system
19701 [a-zA-Z]:/*) dflt=$pg;;
19705 [a-zA-Z]:/*) dflt=$more;;
19709 [a-zA-Z]:/*) dflt=$less;;
19712 '') dflt=/usr/ucb/more;;
19716 : Instruct ./getfile to trust the hinted or previous pager value,
19717 : even if it does not begin with a slash. For example, on os2,
19718 : pager might be cmd /c more. See comments in UU/getfile.
19723 rp='What pager is used on your system?'
19727 : see what type pids are declared as in the kernel
19728 rp="What is the type of process ids on this system?"
19729 set pid_t pidtype int stdio.h sys/types.h
19732 : see if ar generates random libraries by itself
19734 echo "Checking how to generate random libraries on your machine..." >&4
19735 echo 'int bar1() { return bar2(); }' > bar1.c
19736 echo 'int bar2() { return 2; }' > bar2.c
19738 #$i_stdlib I_STDLIB
19740 #include <stdlib.h>
19742 int main() { printf("%d\n", bar1()); exit(0); }
19744 $cc $ccflags -c bar1.c >/dev/null 2>&1
19745 $cc $ccflags -c bar2.c >/dev/null 2>&1
19746 $cc $ccflags -c foo.c >/dev/null 2>&1
19747 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19748 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19749 $run ./foobar >/dev/null 2>&1; then
19750 echo "$ar appears to generate random libraries itself."
19752 if [ "X$ranlib" = "X" ]; then
19755 elif $ar s bar$_a >/dev/null 2>&1 &&
19756 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19757 $run ./foobar >/dev/null 2>&1; then
19758 echo "a table of contents needs to be added with '$ar s'."
19761 elif $ar ts bar$_a >/dev/null 2>&1 &&
19762 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19763 $run ./foobar >/dev/null 2>&1; then
19764 echo "a table of contents needs to be added with '$ar ts'."
19771 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19772 $test -f $ranlib || ranlib=''
19775 if $test -n "$ranlib"; then
19776 echo "your system has '$ranlib'; we'll use that."
19779 echo "your system doesn't seem to support random libraries"
19780 echo "so we'll use lorder and tsort to order the libraries."
19787 : check for type of arguments to select.
19788 case "$selecttype" in
19789 '') case "$d_select" in
19793 Checking to see what type of arguments are accepted by select().
19795 hdrs="$define sys/types.h
19796 $i_systime sys/time.h
19797 $i_sysselct sys/select.h
19798 $d_socket sys/socket.h"
19799 : The first arg can be int, unsigned, or size_t
19800 : The last arg may or may not be 'const'
19802 : void pointer has been seen but using that
19803 : breaks the selectminbits test
19804 for xxx in 'fd_set *' 'int *'; do
19805 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19806 for tmo in 'struct timeval *' 'const struct timeval *'; do
19808 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19809 if ./protochk "$try" $hdrs; then
19810 echo "Your system accepts $xxx."
19819 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19820 case "$d_fd_set" in
19821 $define) dflt="fd_set *" ;;
19830 *) : no select, so pick a harmless default
19837 : check for the select 'width'
19838 case "$selectminbits" in
19839 '') safebits=`expr $ptrsize \* 8`
19840 case "$d_select" in
19844 Checking to see on how many bits at a time your select() operates...
19847 #include <sys/types.h>
19849 #$i_systime I_SYS_TIME
19850 #$i_systimek I_SYS_TIME_KERNEL
19855 # ifdef I_SYS_TIME_KERNEL
19858 # include <sys/time.h>
19859 # ifdef I_SYS_TIME_KERNEL
19863 #$i_sysselct I_SYS_SELECT
19864 #ifdef I_SYS_SELECT
19865 #include <sys/select.h>
19867 #$d_socket HAS_SOCKET
19869 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19872 #$i_stdlib I_STDLIB
19874 #include <stdlib.h>
19877 #define S sizeof(*(b))
19879 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19880 #define NBITS (NBYTES * 8)
19882 char *s = (char *)malloc(NBYTES);
19891 fp = fopen("try.c", "r");
19897 b = ($selecttype)s;
19898 for (i = 0; i < NBITS; i++)
19902 select(fd + 1, b, 0, 0, &t);
19903 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19905 printf("%d\n", i + 1);
19910 if eval $compile_ok; then
19911 selectminbits=`$run ./try`
19912 case "$selectminbits" in
19914 Cannot figure out on how many bits at a time your select() operates.
19915 I'll play safe and guess it is $safebits bits.
19917 selectminbits=$safebits
19918 bits="$safebits bits"
19921 *) bits="$selectminbits bits" ;;
19923 echo "Your select() operates on $bits at a time." >&4
19925 rp='What is the minimum number of bits your select() operates on?'
19926 case "$byteorder" in
19927 12345678) dflt=64 ;;
19933 selectminbits="$val"
19937 *) : no select, so pick a harmless default
19938 selectminbits=$safebits
19944 : Trace out the files included by signal.h, then look for SIGxxx names.
19945 : Remove SIGARRAYSIZE used by HPUX.
19946 : Remove SIGSTKSIZE used by Linux.
19947 : Remove SIGSTKSZ used by Posix.
19948 : Remove SIGTYP void lines used by OS2.
19949 : Some cpps, like os390, dont give the file name anywhere
19950 if [ "X$fieldn" = X ]; then
19951 : Just make some guesses. We check them later.
19952 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
19954 xxx=`echo '#include <signal.h>' |
19955 $cppstdin $cppminus $cppflags 2>/dev/null |
19956 $grep '^[ ]*#.*include' |
19957 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
19959 : Check this list of files to be sure we have parsed the cpp output ok.
19960 : This will also avoid potentially non-existent files, such
19963 for xx in $xxx /dev/null ; do
19964 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
19966 : If we have found no files, at least try signal.h
19967 case "$xxxfiles" in
19968 '') xxxfiles=`./findhdr signal.h` ;;
19971 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
19972 print substr($2, 4, 20)
19974 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
19975 print substr($3, 4, 20)
19977 : Append some common names just in case the awk scan failed.
19978 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
19979 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
19980 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19981 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19982 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19984 : generate a few handy files for later
19985 $cat > signal.c <<EOCP
19986 #include <sys/types.h>
19987 #include <signal.h>
19988 #$i_stdlib I_STDLIB
19990 #include <stdlib.h>
19995 /* Strange style to avoid deeply-nested #if/#else/#endif */
19998 # define NSIG (_NSIG)
20004 # define NSIG (SIGMAX+1)
20010 # define NSIG (SIG_MAX+1)
20016 # define NSIG (_SIG_MAX+1)
20022 # define NSIG (MAXSIG+1)
20028 # define NSIG (MAX_SIG+1)
20033 # ifdef SIGARRAYSIZE
20034 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20040 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20044 /* Default to some arbitrary number that's big enough to get most
20045 of the common signals.
20051 printf("NSIG %d\n", NSIG);
20057 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20059 printf "#ifdef SIG"; printf $1; printf "\n"
20060 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20061 printf $1; printf ");\n"
20065 printf "#endif /* JUST_NSIG */\n";
20066 printf "exit(0);\n}\n";
20069 $cat >signal.awk <<'EOP'
20070 BEGIN { ndups = 0 }
20071 $1 ~ /^NSIG$/ { nsig = $2 }
20072 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20073 if ($2 > maxsig) { maxsig = $2 }
20074 if (sig_name[$2]) {
20075 dup_name[ndups] = $1
20076 dup_num[ndups] = $2
20088 printf("NSIG %d\n", nsig);
20089 for (n = 1; n < nsig; n++) {
20091 printf("%s %d\n", sig_name[n], sig_num[n])
20094 printf("NUM%d %d\n", n, n)
20097 for (n = 0; n < ndups; n++) {
20098 printf("%s %d\n", dup_name[n], dup_num[n])
20102 $cat >signal_cmd <<EOS
20104 if $test -s signal.lst; then
20105 echo "Using your existing signal.lst file"
20110 $cat >>signal_cmd <<'EOS'
20113 if eval $compile_ok; then
20114 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
20116 echo "(I can't seem be able to compile the whole test program)" >&4
20117 echo "(I'll try it in little pieces.)" >&4
20118 set signal -DJUST_NSIG
20119 if eval $compile_ok; then
20120 $run ./signal$_exe > signal.nsg
20123 echo "I can't seem to figure out how many signals you have." >&4
20124 echo "Guessing 50." >&4
20125 echo 'NSIG 50' > signal.nsg
20127 : Now look at all the signal names, one at a time.
20128 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20129 $cat > signal.c <<EOCP
20130 #include <sys/types.h>
20131 #include <signal.h>
20134 printf("$xx %d\n", SIG${xx});
20139 if eval $compile; then
20140 echo "SIG${xx} found."
20141 $run ./signal$_exe >> signal.ls1
20143 echo "SIG${xx} NOT found."
20146 if $test -s signal.ls1; then
20147 $cat signal.nsg signal.ls1 |
20148 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20152 if $test -s signal.lst; then
20155 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20156 echo 'kill -l' >signal
20157 set X `csh -f <signal`
20161 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20163 echo $@ | $tr ' ' $trnl | \
20164 $awk '{ printf "%s %d\n", $1, ++s; }
20165 END { printf "NSIG %d\n", ++s }' >signal.lst
20167 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20169 chmod a+x signal_cmd
20170 $eunicefix signal_cmd
20172 : generate list of signal names
20174 case "$sig_name_init" in
20176 *) case "$sig_num_init" in
20177 ''|*,*) doinit=yes ;;
20182 echo "Generating a list of signal names and numbers..." >&4
20184 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20185 sig_name=`$awk 'BEGIN { printf "ZERO " }
20186 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20187 sig_num=`$awk 'BEGIN { printf "0 " }
20188 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20189 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20190 !/^NSIG/ { printf "\"%s\", ", $1 }
20191 END { printf "0\n" }' signal.lst`
20192 sig_num_init=`$awk 'BEGIN { printf "0, " }
20193 !/^NSIG/ { printf "%d, ", $2}
20194 END { printf "0\n"}' signal.lst`
20197 echo "The following $sig_count signals are available:"
20199 echo $sig_name | $awk \
20200 'BEGIN { linelen = 0 }
20202 for (i = 1; i <= NF; i++) {
20203 name = "SIG" $i " "
20204 linelen = linelen + length(name)
20205 if (linelen > 70) {
20207 linelen = length(name)
20213 sig_size=`echo $sig_name | awk '{print NF}'`
20214 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20217 case "$sizetype" in
20218 *_t) zzz="$sizetype" ;;
20219 *) zzz="filesize" ;;
20221 echo "Checking the size of $zzz..." >&4
20223 #include <sys/types.h>
20225 #$i_stdlib I_STDLIB
20227 #include <stdlib.h>
20230 printf("%d\n", (int)sizeof($sizetype));
20235 if eval $compile_ok; then
20239 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20242 echo "Your $zzz size is $sizesize bytes."
20247 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20251 : check for socklen_t
20253 echo "Checking to see if you have socklen_t..." >&4
20255 #include <sys/types.h>
20256 #$d_socket HAS_SOCKET
20258 #include <sys/socket.h>
20260 int main() { socklen_t x = 16; }
20263 if eval $compile; then
20265 echo "You have socklen_t."
20268 echo "You do not have socklen_t."
20269 case "$sizetype" in
20270 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20277 : see if this is a socks.h system
20278 set socks.h i_socks
20281 : check for type of the size argument to socket calls
20282 case "$d_socket" in
20286 Checking to see what type is the last argument of accept().
20289 case "$d_socklen_t" in
20290 "$define") yyy="$yyy socklen_t"
20292 yyy="$yyy $sizetype int long unsigned"
20293 for xxx in $yyy; do
20294 case "$socksizetype" in
20295 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
20296 case "$usesocks" in
20298 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20299 echo "Your system accepts '$xxx *' for the last argument of accept()."
20300 socksizetype="$xxx"
20303 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20304 echo "Your system accepts '$xxx *' for the last argument of accept()."
20305 socksizetype="$xxx"
20312 : In case none of those worked, prompt the user.
20313 case "$socksizetype" in
20314 '') rp='What is the type for socket address structure sizes?'
20321 *) : no sockets, so pick relatively harmless default
20326 : see what type is used for signed size_t
20327 set ssize_t ssizetype int stdio.h sys/types.h
20332 #$i_stdlib I_STDLIB
20334 #include <stdlib.h>
20336 #include <sys/types.h>
20337 #define Size_t $sizetype
20338 #define SSize_t $dflt
20341 if (sizeof(Size_t) == sizeof(SSize_t))
20343 else if (sizeof(Size_t) == sizeof(int))
20352 if eval $compile_ok && $run ./try > /dev/null; then
20353 ssizetype=`$run ./try`
20354 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20357 Help! I can't compile and run the ssize_t test program: please enlighten me!
20358 (This is probably a misconfiguration in your system or libraries, and
20359 you really ought to fix it. Still, I'll try anyway.)
20361 I need a type that is the same size as $sizetype, but is guaranteed to
20362 be signed. Common values are ssize_t, int and long.
20365 rp="What signed type is the same size as $sizetype?"
20371 : see what type of char stdio uses.
20373 echo '#include <stdio.h>' > stdio.c
20374 $cppstdin $cppminus < stdio.c > stdioh
20375 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20376 echo "Your stdio uses unsigned chars." >&4
20377 stdchar="unsigned char"
20379 echo "Your stdio uses signed chars." >&4
20382 $rm -f stdio.* stdioh
20384 : see what type uids are declared as in the kernel
20386 echo "Looking for the type for user ids returned by getuid()."
20387 set uid_t uidtype xxx stdio.h sys/types.h
20391 xxx=`./findhdr sys/user.h`
20392 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20394 unsigned) dflt="$1 $2" ;;
20398 *) dflt="$uidtype";;
20401 uid_t) echo "uid_t found." ;;
20402 *) rp="What is the type for user ids returned by getuid()?"
20410 *_t) zzz="$uidtype" ;;
20413 echo "Checking the size of $zzz..." >&4
20415 #include <sys/types.h>
20417 #$i_stdlib I_STDLIB
20419 #include <stdlib.h>
20422 printf("%d\n", (int)sizeof($uidtype));
20427 if eval $compile_ok; then
20431 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20434 echo "Your $zzz is $uidsize bytes long."
20439 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20444 *_t) zzz="$uidtype" ;;
20447 echo "Checking the sign of $zzz..." >&4
20449 #include <sys/types.h>
20460 if eval $compile; then
20464 echo "(I can't execute the test program--guessing unsigned.)" >&4
20468 1) echo "Your $zzz is unsigned." ;;
20469 -1) echo "Your $zzz is signed." ;;
20475 echo "(I can't compile the test program--guessing unsigned.)" >&4
20481 $echo "Checking the format string to be used for uids..." >&4
20484 -1) if $test X"$uidsize" = X"$ivsize"; then
20485 uidformat="$ivdformat"
20487 if $test X"$uidsize" = X"$longsize"; then
20490 if $test X"$uidsize" = X"$intsize"; then
20493 if $test X"$uidsize" = X"$shortsize"; then
20500 *) if $test X"$uidsize" = X"$uvsize"; then
20501 uidformat="$uvuformat"
20503 if $test X"$uidsize" = X"$longsize"; then
20506 if $test X"$uidsize" = X"$intsize"; then
20509 if $test X"$uidsize" = X"$shortsize"; then
20519 case "$usesitecustomize" in
20520 $define|true|[Yy]*)
20521 usesitecustomize="$define"
20524 usesitecustomize="$undef"
20528 : determine compiler compiler
20537 if $test -f "$byacc$_exe"; then
20539 comp="byacc or $comp"
20541 if $test -f "$bison$_exe"; then
20542 comp="$comp or bison -y"
20544 rp="Which compiler compiler ($comp) shall I use?"
20553 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20559 : see if this is a fp.h system
20563 : see if this is a fp_class.h system
20564 set fp_class.h i_fp_class
20567 : see if gdbm.h is available
20572 : see if gdbm_open exists
20573 set gdbm_open d_gdbm_open
20575 case "$d_gdbm_open" in
20578 echo "We won't be including <gdbm.h>"
20587 : see if this is a ieeefp.h system
20588 case "$i_ieeefp" in
20589 '' ) set ieeefp.h i_ieeefp
20594 : see if this is a libutil.h system
20595 set libutil.h i_libutil
20598 : see if mach cthreads are available
20599 if test "X$usethreads" = "X$define"; then
20600 set mach/cthreads.h i_machcthr
20603 i_machcthr="$undef"
20608 : see if this is a mntent.h system
20609 set mntent.h i_mntent
20612 : see if ndbm.h is available
20618 # Some Linux distributions such as RedHat 7.1 put the
20619 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20620 if $test -f /usr/include/gdbm/ndbm.h; then
20621 echo '<gdbm/ndbm.h> found.'
20622 ccflags="$ccflags -I/usr/include/gdbm"
20623 cppflags="$cppflags -I/usr/include/gdbm"
20631 : see if dbm_open exists
20632 set dbm_open d_dbm_open
20634 case "$d_dbm_open" in
20637 echo "We won't be including <ndbm.h>"
20646 : see if net/errno.h is available
20648 set net/errno.h val
20651 : Unfortunately, it causes problems on some systems. Arrgh.
20654 cat > try.c <<'EOM'
20657 #include <net/errno.h>
20663 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20664 echo "We'll be including <net/errno.h>." >&4
20666 echo "We won't be including <net/errno.h>." >&4
20675 : see if netinet/tcp.h is available
20676 set netinet/tcp.h i_netinettcp
20679 : see if this is a poll.h system
20683 : see if this is a prot.h system
20688 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20689 $cat <<'EOSH' > Cppsym.know
20690 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20691 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20692 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20693 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20694 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20695 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20696 bull c cadmus clipper CMU COFF COMPILER_VERSION
20697 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20698 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20699 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20700 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20702 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20703 H3050R H3050RX hbullx20 hcx host_mips
20704 hp200 hp300 hp700 HP700 hp800 hp9000
20705 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20706 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20707 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20708 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20709 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20710 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20711 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20712 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20713 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20714 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20715 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20716 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20717 MATH_HAS_NO_SIDE_EFFECTS
20718 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20719 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20720 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20721 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20722 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20723 NetBSD news1500 news1700 news1800 news1900 news3700
20724 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20725 ns32016 ns32332 ns32k nsc32000
20726 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20727 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20728 pc532 pdp11 PGC PIC plexus PORTAR posix
20729 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20730 POSIX_C_SOURCE POSIX_SOURCE POWER
20731 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
20732 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20733 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20734 sony sony_news sonyrisc sparc sparclite spectrum
20735 stardent stdc STDC_EXT stratos sun sun3 sun386
20736 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20737 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20738 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20739 sysV68 sysV88 Tek4132 Tek4300 titan
20740 TM3200 TM5400 TM5600
20741 tower tower32 tower32_200 tower32_600 tower32_700
20742 tower32_800 tower32_850 tss
20743 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20744 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20745 unix UNIX95 UNIX99 unixpc unos
20746 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20747 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20748 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20750 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20751 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20752 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20755 # Maybe put other stuff here too.
20756 cat <<EOSH >>Cppsym.know
20759 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20760 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20761 $cat Cppsym.know > Cppsym.c
20762 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20763 $rm -f Cppsym.a Cppsym.b Cppsym.c
20764 cat <<EOSH > Cppsym
20766 if $test \$# -gt 0; then
20767 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20768 if $test -s Cppsym.got; then
20775 $tr " " "$trnl" | ./Cppsym.try
20781 cat <<EOSH > Cppsym.try
20783 cat <<'EOCP' > try.c
20786 #define STRINGIFY(a) "a"
20788 #if cpp_stuff == 42
20789 #define StGiFy(a) #a
20790 #define STRINGIFY(a) StGiFy(a)
20792 #if $cpp_stuff != 1 && $cpp_stuff != 42
20793 # include "Bletch: How does this C preprocessor stringify macros?"
20799 cat <<'EOSH' >> Cppsym.try
20801 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20802 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20803 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20804 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
20806 echo 'return 0;}' >> try.c
20808 cat <<EOSH >> Cppsym.try
20810 case "$osname-$gccversion" in
20811 irix-) ccflags="\$ccflags -woff 1178" ;;
20812 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20814 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
20816 chmod +x Cppsym.try
20817 $eunicefix Cppsym.try
20818 ./Cppsym < Cppsym.know > Cppsym.true
20819 : Add in any linux cpp "predefined macros":
20820 case "$osname::$gccversion" in
20823 rm -f $tHdrH'.h' $tHdrH
20825 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
20826 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
20827 if [ -s $tHdrH'_cppsym.real' ]; then
20828 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
20831 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
20834 : now check the C compiler for additional symbols
20835 postprocess_cc_v=''
20837 aix) postprocess_cc_v="|$tr , ' '" ;;
20844 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20847 -D*) echo "\$i" | $sed 's/^-D//';;
20848 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20853 postprocess_cc_v=''
20856 ./ccsym > ccsym1.raw
20857 if $test -s ccsym1.raw; then
20858 $sort ccsym1.raw | $uniq >ccsym.raw
20860 mv ccsym1.raw ccsym.raw
20863 $awk '/\=/ { print $0; next }
20864 { print $0"=1" }' ccsym.raw >ccsym.list
20865 $comm -13 Cppsym.true ccsym.list >ccsym.own
20866 $comm -12 Cppsym.true ccsym.list >ccsym.com
20867 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
20869 if $test -z ccsym.raw; then
20870 echo "Your C compiler doesn't seem to define any symbols!" >&4
20872 echo "However, your C preprocessor defines the following symbols:"
20875 cppsymbols=`$cat Cppsym.true`
20876 cppsymbols=`echo $cppsymbols`
20877 cppccsymbols="$cppsymbols"
20879 if $test -s ccsym.com; then
20880 echo "Your C compiler and pre-processor define these symbols:"
20881 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20884 cppccsymbols=`$cat ccsym.com`
20885 cppccsymbols=`echo $cppccsymbols`
20886 $test "$silent" || sleep 1
20888 if $test -s ccsym.cpp; then
20889 $test "$also" && echo " "
20890 echo "Your C pre-processor ${also}defines the following symbols:"
20891 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20893 cppsymbols=`$cat ccsym.cpp`
20894 cppsymbols=`echo $cppsymbols`
20895 $test "$silent" || sleep 1
20897 if $test -s ccsym.own; then
20898 $test "$also" && echo " "
20899 echo "Your C compiler ${also}defines the following cpp symbols:"
20900 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20901 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20902 ccsymbols=`$cat ccsym.own`
20903 ccsymbols=`echo $ccsymbols`
20904 $test "$silent" || sleep 1
20908 : see if this is a termio system
20912 if $test `./findhdr termios.h`; then
20913 set tcsetattr i_termios
20919 "$define") echo "You have POSIX termios.h... good!" >&4;;
20920 *) if ./Cppsym pyr; then
20921 case "`/bin/universe`" in
20922 ucb) if $test `./findhdr sgtty.h`; then
20924 echo "<sgtty.h> found." >&4
20926 echo "System is pyramid with BSD universe."
20927 echo "<sgtty.h> not found--you could have problems." >&4
20929 *) if $test `./findhdr termio.h`; then
20931 echo "<termio.h> found." >&4
20933 echo "System is pyramid with USG universe."
20934 echo "<termio.h> not found--you could have problems." >&4
20938 if $test `./findhdr termio.h`; then
20939 echo "<termio.h> found." >&4
20941 elif $test `./findhdr sgtty.h`; then
20942 echo "<sgtty.h> found." >&4
20945 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
20948 if $test `./findhdr sgtty.h`; then
20949 echo "<sgtty.h> found." >&4
20951 elif $test `./findhdr termio.h`; then
20952 echo "<termio.h> found." >&4
20955 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
20959 set i_termio; eval $setvar
20960 val=$val2; set i_sgtty; eval $setvar
20961 val=$val3; set i_termios; eval $setvar
20963 : see if stddef is available
20964 set stddef.h i_stddef
20967 : see if sys/access.h is available
20968 set sys/access.h i_sysaccess
20971 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
20972 set sys/filio.h i_sysfilio
20975 if $test `./findhdr sys/ioctl.h`; then
20977 echo '<sys/ioctl.h> found.' >&4
20980 if $test $i_sysfilio = "$define"; then
20981 echo '<sys/ioctl.h> NOT found.' >&4
20983 $test $i_sgtty = "$define" && xxx="sgtty.h"
20984 $test $i_termio = "$define" && xxx="termio.h"
20985 $test $i_termios = "$define" && xxx="termios.h"
20986 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
20992 : see if socket ioctl defs are in sys/sockio.h
20994 xxx=`./findhdr sys/sockio.h`
20995 if $test "$xxx"; then
20996 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
20998 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
21001 echo "No socket ioctls found in <sys/sockio.h>." >&4
21006 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
21013 : see if this is a syslog.h system
21014 set syslog.h i_syslog
21018 : see if this is a sys/mode.h system
21019 set sys/mode.h i_sysmode
21022 : see if sys/resource.h has to be included
21023 set sys/resource.h i_sysresrc
21026 : see if sys/security.h is available
21027 set sys/security.h i_syssecrt
21030 : see if this is a sys/statvfs.h system
21031 set sys/statvfs.h i_sysstatvfs
21034 : see if this is a sys/un.h system
21035 set sys/un.h i_sysun
21039 : see if this is a sys/utsname.h system
21040 set sys/utsname.h i_sysutsname
21043 : see if this is a syswait system
21044 set sys/wait.h i_syswait
21047 : see if this is a ustat.h system
21048 set ustat.h i_ustat
21051 : see if this is an utime system
21052 set utime.h i_utime
21055 : see if this is a values.h system
21056 set values.h i_values
21059 : see if this is a vfork system
21062 set vfork.h i_vfork
21071 echo "Looking for extensions..." >&4
21072 : If we are using the old config.sh, known_extensions may contain
21073 : old or inaccurate or duplicate values.
21074 known_extensions=''
21075 nonxs_extensions=''
21076 : We do not use find because it might not be available.
21077 : We do not just use MANIFEST because the user may have dropped
21078 : some additional extensions into the source tree and expect them
21081 : Function to recursively find available extensions, ignoring DynaLoader
21082 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21086 DynaLoader|dynaload) ;;
21088 if $test -f $xxx/$xxx.xs -o -f $xxx/$xxx.c; then
21089 known_extensions="$known_extensions $1$xxx";
21090 elif $test -f $xxx/Makefile.PL; then
21091 nonxs_extensions="$nonxs_extensions $1$xxx";
21093 if $test -d $xxx -a $# -lt 10; then
21096 eval $find_extensions;
21108 eval $find_extensions
21109 # Special case: Add in threads/shared since it is not picked up by the
21110 # recursive find above (and adding in general recursive finding breaks
21111 # SDBM_File/sdbm). A.D. 10/25/2001.
21112 known_extensions="$known_extensions threads/shared"
21113 set X $known_extensions
21115 known_extensions="$*"
21116 set X $nonxs_extensions
21118 nonxs_extensions="$*"
21121 : Now see which are supported on this system.
21123 for xxx in $known_extensions ; do
21127 $define) avail_ext="$avail_ext $xxx" ;;
21130 GDBM_File|gdbm_fil)
21132 $define) avail_ext="$avail_ext $xxx" ;;
21135 I18N/Langinfo|i18n_lan)
21136 case "$i_langinfo$d_nl_langinfo" in
21137 $define$define) avail_ext="$avail_ext $xxx" ;;
21141 : XXX Do we need a useipcsysv variable here
21142 case "${d_msg}${d_sem}${d_shm}" in
21143 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21146 NDBM_File|ndbm_fil)
21149 case "$osname-$use64bitint" in
21152 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21155 *) avail_ext="$avail_ext $xxx" ;;
21160 ODBM_File|odbm_fil)
21161 case "${i_dbm}${i_rpcsvcdbm}" in
21163 case "$d_cplusplus" in
21164 define) ;; # delete as a function name will not work
21165 *) case "$osname-$use64bitint" in
21168 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21171 *) avail_ext="$avail_ext $xxx" ;;
21179 case "$useopcode" in
21180 true|define|y) avail_ext="$avail_ext $xxx" ;;
21184 case "$useposix" in
21185 true|define|y) avail_ext="$avail_ext $xxx" ;;
21189 case "$d_socket" in
21192 beos) ;; # not unless BONE
21193 *) avail_ext="$avail_ext $xxx" ;;
21198 Sys/Syslog|sys/syslog)
21199 : XXX syslog requires socket
21200 case "$d_socket" in
21201 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21205 case "$usethreads" in
21207 case "$use5005threads" in
21208 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
21212 threads|threads/shared)
21213 # threads and threads::shared are special cases.
21214 # To stop people from asking "Perl 5.8.0 was supposed
21215 # to have this new fancy threads implementation but my
21216 # perl doesn't have it" and from people trying to
21217 # (re)install the threads module using CPAN.pm and
21218 # CPAN.pm then offering to reinstall Perl 5.8.0,
21219 # the threads.pm and threads/shared.pm will always be
21220 # there, croaking informatively ("you need to rebuild
21221 # all of Perl with threads, sorry") when threads haven't
21222 # been compiled in.
21224 avail_ext="$avail_ext $xxx"
21228 cygwin) avail_ext="$avail_ext $xxx" ;;
21231 XS/APItest|xs/apitest)
21232 # This is just for testing. Skip it unless we have dynamic loading.
21235 $define) avail_ext="$avail_ext $xxx" ;;
21238 XS/Typemap|xs/typemap)
21239 # This is just for testing. Skip it unless we have dynamic loading.
21241 $define) avail_ext="$avail_ext $xxx" ;;
21244 *) avail_ext="$avail_ext $xxx"
21253 case "$onlyextensions" in
21255 *) keepextensions=''
21256 echo "You have requested that only certains extensions be included..." >&4
21257 for i in $onlyextensions; do
21258 case " $avail_ext " in
21260 echo "Keeping extension $i."
21261 keepextensions="$keepextensions $i"
21263 *) echo "Ignoring extension $i." ;;
21266 avail_ext="$keepextensions"
21270 case "$noextensions" in
21272 *) keepextensions=''
21273 echo "You have requested that certain extensions be ignored..." >&4
21274 for i in $avail_ext; do
21275 case " $noextensions " in
21276 *" $i "*) echo "Ignoring extension $i." ;;
21277 *) echo "Keeping extension $i.";
21278 keepextensions="$keepextensions $i"
21282 avail_ext="$keepextensions"
21286 : Now see which nonxs extensions are supported on this system.
21287 : For now assume all are.
21289 for xxx in $nonxs_extensions ; do
21291 *) nonxs_ext="$nonxs_ext $xxx"
21303 A number of extensions are supplied with $package. You may choose to
21304 compile these extensions for dynamic loading (the default), compile
21305 them into the $package executable (static loading), or not include
21306 them at all. Answer "none" to include no extensions.
21307 Note that DynaLoader is always built and need not be mentioned here.
21310 case "$dynamic_ext" in
21312 : Exclude those listed in static_ext
21314 for xxx in $avail_ext; do
21315 case " $static_ext " in
21317 *) dflt="$dflt $xxx" ;;
21324 *) dflt="$dynamic_ext"
21325 # Perhaps we are reusing an old out-of-date config.sh.
21328 if test X"$dynamic_ext" != X"$avail_ext"; then
21330 NOTICE: Your previous config.sh list may be incorrect.
21331 The extensions now available to you are
21333 but the default list from your previous config.sh is
21345 rp="What extensions do you wish to load dynamically?"
21348 none) dynamic_ext=' ' ;;
21349 *) dynamic_ext="$ans" ;;
21352 case "$static_ext" in
21354 : Exclude those already listed in dynamic linking
21356 for xxx in $avail_ext; do
21357 case " $dynamic_ext " in
21359 *) dflt="$dflt $xxx" ;;
21366 *) dflt="$static_ext"
21373 rp="What extensions do you wish to load statically?"
21376 none) static_ext=' ' ;;
21377 *) static_ext="$ans" ;;
21382 A number of extensions are supplied with $package. Answer "none"
21383 to include no extensions.
21384 Note that DynaLoader is always built and need not be mentioned here.
21387 case "$static_ext" in
21388 '') dflt="$avail_ext" ;;
21389 *) dflt="$static_ext"
21390 # Perhaps we are reusing an old out-of-date config.sh.
21393 if test X"$static_ext" != X"$avail_ext"; then
21395 NOTICE: Your previous config.sh list may be incorrect.
21396 The extensions now available to you are
21398 but the default list from your previous config.sh is
21407 : Exclude those that are not xs extensions
21411 rp="What extensions do you wish to include?"
21414 none) static_ext=' ' ;;
21415 *) static_ext="$ans" ;;
21420 # Encode is a special case. If we are building Encode as a static
21421 # extension, we need to explicitly list its subextensions as well.
21422 # For other nested extensions, this is handled automatically by
21423 # the appropriate Makefile.PL.
21424 case " $static_ext " in
21425 *" Encode "*) # Add the subextensions of Encode
21427 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21428 static_ext="$static_ext Encode/$xxx"
21434 set X $dynamic_ext $static_ext $nonxs_ext
21438 # Sanity check: We require an extension suitable for use with
21439 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21440 # should show up as failures in the test suite, but it's helpful to
21441 # catch them now.) The 'extensions' list is normally sorted
21442 # alphabetically, so we need to accept either
21443 # DB_File ... Fcntl ... IO ....
21444 # or something like
21445 # Fcntl ... NDBM_File ... IO ....
21446 case " $extensions" in
21447 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21448 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21449 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21450 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21451 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21455 : Remove libraries needed only for extensions
21456 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21457 : The exception is SunOS 4.x, which needs them.
21458 case "${osname}X${osvers}" in
21462 *) case "$usedl" in
21463 $define|true|[yY]*)
21464 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21468 *) perllibs="$libs"
21474 : Remove build directory name from cppstdin so it can be used from
21475 : either the present location or the final installed location.
21477 : Get out of the UU directory to get correct path name.
21479 case "$cppstdin" in
21481 echo "Stripping down cppstdin path name"
21487 : end of configuration questions
21489 echo "End of configuration questions."
21492 : back to where it started
21493 if test -d ../UU; then
21497 : configuration may be patched via a 'config.arch' file
21498 if $test -f config.arch; then
21499 echo "I see a config.arch file, loading it."
21503 : configuration may be patched via a 'config.over' file
21504 if $test -f config.over; then
21507 rp='I see a config.over file. Do you wish to load it?'
21510 n*) echo "OK, I'll ignore it.";;
21512 echo "Configuration override changes have been loaded."
21517 : in case they want portability, strip down executable paths
21518 case "$d_portable" in
21521 echo "Stripping down executable paths..." >&4
21522 for file in $loclist $trylist; do
21524 eval $file=`basename $temp`
21529 : create config.sh file
21531 echo "Creating config.sh..." >&4
21532 $spitshell <<EOT >config.sh
21535 # This file was produced by running the Configure script. It holds all the
21536 # definitions figured out by Configure. Should you modify one of these values,
21537 # do not forget to propagate your changes by running "Configure -der". You may
21538 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21541 # Package name : $package
21542 # Source directory : $src
21543 # Configuration time: $cf_time
21544 # Configured by : $cf_by
21545 # Target system : $myuname
21555 Revision='$Revision'
21563 alignbytes='$alignbytes'
21564 ansi2knr='$ansi2knr'
21565 aphostname='$aphostname'
21566 api_revision='$api_revision'
21567 api_subversion='$api_subversion'
21568 api_version='$api_version'
21569 api_versionstring='$api_versionstring'
21572 archlibexp='$archlibexp'
21573 archname64='$archname64'
21574 archname='$archname'
21575 archobjs='$archobjs'
21576 asctime_r_proto='$asctime_r_proto'
21584 byteorder='$byteorder'
21586 castflags='$castflags'
21589 cccdlflags='$cccdlflags'
21590 ccdlflags='$ccdlflags'
21592 ccflags_uselargefiles='$ccflags_uselargefiles'
21594 ccsymbols='$ccsymbols'
21595 ccversion='$ccversion'
21597 cf_email='$cf_email'
21599 charsize='$charsize'
21603 clocktype='$clocktype'
21605 compress='$compress'
21606 contains='$contains'
21610 cpp_stuff='$cpp_stuff'
21611 cppccsymbols='$cppccsymbols'
21612 cppflags='$cppflags'
21614 cppminus='$cppminus'
21616 cppstdin='$cppstdin'
21617 cppsymbols='$cppsymbols'
21618 crypt_r_proto='$crypt_r_proto'
21619 cryptlib='$cryptlib'
21621 ctermid_r_proto='$ctermid_r_proto'
21622 ctime_r_proto='$ctime_r_proto'
21623 d_Gconvert='$d_Gconvert'
21624 d_PRIEUldbl='$d_PRIEUldbl'
21625 d_PRIFUldbl='$d_PRIFUldbl'
21626 d_PRIGUldbl='$d_PRIGUldbl'
21627 d_PRIXU64='$d_PRIXU64'
21628 d_PRId64='$d_PRId64'
21629 d_PRIeldbl='$d_PRIeldbl'
21630 d_PRIfldbl='$d_PRIfldbl'
21631 d_PRIgldbl='$d_PRIgldbl'
21632 d_PRIi64='$d_PRIi64'
21633 d_PRIo64='$d_PRIo64'
21634 d_PRIu64='$d_PRIu64'
21635 d_PRIx64='$d_PRIx64'
21636 d_SCNfldbl='$d_SCNfldbl'
21637 d__fwalk='$d__fwalk'
21638 d_access='$d_access'
21639 d_accessx='$d_accessx'
21642 d_archlib='$d_archlib'
21643 d_asctime_r='$d_asctime_r'
21646 d_attribute_format='$d_attribute_format'
21647 d_attribute_malloc='$d_attribute_malloc'
21648 d_attribute_nonnull='$d_attribute_nonnull'
21649 d_attribute_noreturn='$d_attribute_noreturn'
21650 d_attribute_pure='$d_attribute_pure'
21651 d_attribute_unused='$d_attribute_unused'
21652 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21656 d_bsdgetpgrp='$d_bsdgetpgrp'
21657 d_bsdsetpgrp='$d_bsdsetpgrp'
21658 d_builtin_choose_expr='$d_builtin_choose_expr'
21659 d_builtin_expect='$d_builtin_expect'
21661 d_c99_variadic_macros='$d_c99_variadic_macros'
21662 d_casti32='$d_casti32'
21663 d_castneg='$d_castneg'
21664 d_charvspr='$d_charvspr'
21666 d_chroot='$d_chroot'
21667 d_chsize='$d_chsize'
21669 d_clearenv='$d_clearenv'
21670 d_closedir='$d_closedir'
21671 d_cmsghdr_s='$d_cmsghdr_s'
21673 d_copysignl='$d_copysignl'
21674 d_cplusplus='$d_cplusplus'
21676 d_crypt_r='$d_crypt_r'
21678 d_ctermid='$d_ctermid'
21679 d_ctermid_r='$d_ctermid_r'
21680 d_ctime_r='$d_ctime_r'
21681 d_cuserid='$d_cuserid'
21682 d_dbl_dig='$d_dbl_dig'
21683 d_dbminitproto='$d_dbminitproto'
21684 d_difftime='$d_difftime'
21685 d_dir_dd_fd='$d_dir_dd_fd'
21687 d_dirnamlen='$d_dirnamlen'
21688 d_dlerror='$d_dlerror'
21689 d_dlopen='$d_dlopen'
21690 d_dlsymun='$d_dlsymun'
21691 d_dosuid='$d_dosuid'
21692 d_drand48_r='$d_drand48_r'
21693 d_drand48proto='$d_drand48proto'
21695 d_eaccess='$d_eaccess'
21696 d_endgrent='$d_endgrent'
21697 d_endgrent_r='$d_endgrent_r'
21698 d_endhent='$d_endhent'
21699 d_endhostent_r='$d_endhostent_r'
21700 d_endnent='$d_endnent'
21701 d_endnetent_r='$d_endnetent_r'
21702 d_endpent='$d_endpent'
21703 d_endprotoent_r='$d_endprotoent_r'
21704 d_endpwent='$d_endpwent'
21705 d_endpwent_r='$d_endpwent_r'
21706 d_endsent='$d_endsent'
21707 d_endservent_r='$d_endservent_r'
21708 d_eofnblk='$d_eofnblk'
21709 d_eunice='$d_eunice'
21710 d_faststdio='$d_faststdio'
21711 d_fchdir='$d_fchdir'
21712 d_fchmod='$d_fchmod'
21713 d_fchown='$d_fchown'
21715 d_fcntl_can_lock='$d_fcntl_can_lock'
21716 d_fd_macros='$d_fd_macros'
21717 d_fd_set='$d_fd_set'
21718 d_fds_bits='$d_fds_bits'
21719 d_fgetpos='$d_fgetpos'
21720 d_finite='$d_finite'
21721 d_finitel='$d_finitel'
21722 d_flexfnam='$d_flexfnam'
21724 d_flockproto='$d_flockproto'
21726 d_fp_class='$d_fp_class'
21727 d_fpathconf='$d_fpathconf'
21728 d_fpclass='$d_fpclass'
21729 d_fpclassify='$d_fpclassify'
21730 d_fpclassl='$d_fpclassl'
21731 d_fpos64_t='$d_fpos64_t'
21732 d_frexpl='$d_frexpl'
21733 d_fs_data_s='$d_fs_data_s'
21734 d_fseeko='$d_fseeko'
21735 d_fsetpos='$d_fsetpos'
21736 d_fstatfs='$d_fstatfs'
21737 d_fstatvfs='$d_fstatvfs'
21739 d_ftello='$d_ftello'
21741 d_futimes='$d_futimes'
21742 d_getcwd='$d_getcwd'
21743 d_getespwnam='$d_getespwnam'
21744 d_getfsstat='$d_getfsstat'
21745 d_getgrent='$d_getgrent'
21746 d_getgrent_r='$d_getgrent_r'
21747 d_getgrgid_r='$d_getgrgid_r'
21748 d_getgrnam_r='$d_getgrnam_r'
21749 d_getgrps='$d_getgrps'
21750 d_gethbyaddr='$d_gethbyaddr'
21751 d_gethbyname='$d_gethbyname'
21752 d_gethent='$d_gethent'
21753 d_gethname='$d_gethname'
21754 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21755 d_gethostbyname_r='$d_gethostbyname_r'
21756 d_gethostent_r='$d_gethostent_r'
21757 d_gethostprotos='$d_gethostprotos'
21758 d_getitimer='$d_getitimer'
21759 d_getlogin='$d_getlogin'
21760 d_getlogin_r='$d_getlogin_r'
21761 d_getmnt='$d_getmnt'
21762 d_getmntent='$d_getmntent'
21763 d_getnbyaddr='$d_getnbyaddr'
21764 d_getnbyname='$d_getnbyname'
21765 d_getnent='$d_getnent'
21766 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21767 d_getnetbyname_r='$d_getnetbyname_r'
21768 d_getnetent_r='$d_getnetent_r'
21769 d_getnetprotos='$d_getnetprotos'
21770 d_getpagsz='$d_getpagsz'
21771 d_getpbyname='$d_getpbyname'
21772 d_getpbynumber='$d_getpbynumber'
21773 d_getpent='$d_getpent'
21774 d_getpgid='$d_getpgid'
21775 d_getpgrp2='$d_getpgrp2'
21776 d_getpgrp='$d_getpgrp'
21777 d_getppid='$d_getppid'
21778 d_getprior='$d_getprior'
21779 d_getprotobyname_r='$d_getprotobyname_r'
21780 d_getprotobynumber_r='$d_getprotobynumber_r'
21781 d_getprotoent_r='$d_getprotoent_r'
21782 d_getprotoprotos='$d_getprotoprotos'
21783 d_getprpwnam='$d_getprpwnam'
21784 d_getpwent='$d_getpwent'
21785 d_getpwent_r='$d_getpwent_r'
21786 d_getpwnam_r='$d_getpwnam_r'
21787 d_getpwuid_r='$d_getpwuid_r'
21788 d_getsbyname='$d_getsbyname'
21789 d_getsbyport='$d_getsbyport'
21790 d_getsent='$d_getsent'
21791 d_getservbyname_r='$d_getservbyname_r'
21792 d_getservbyport_r='$d_getservbyport_r'
21793 d_getservent_r='$d_getservent_r'
21794 d_getservprotos='$d_getservprotos'
21795 d_getspnam='$d_getspnam'
21796 d_getspnam_r='$d_getspnam_r'
21797 d_gettimeod='$d_gettimeod'
21798 d_gmtime_r='$d_gmtime_r'
21799 d_gnulibc='$d_gnulibc'
21800 d_grpasswd='$d_grpasswd'
21801 d_hasmntopt='$d_hasmntopt'
21803 d_ilogbl='$d_ilogbl'
21804 d_inc_version_list='$d_inc_version_list'
21806 d_inetaton='$d_inetaton'
21807 d_int64_t='$d_int64_t'
21808 d_isascii='$d_isascii'
21809 d_isfinite='$d_isfinite'
21812 d_isnanl='$d_isnanl'
21813 d_killpg='$d_killpg'
21814 d_lchown='$d_lchown'
21815 d_ldbl_dig='$d_ldbl_dig'
21816 d_libm_lib_version='$d_libm_lib_version'
21818 d_localtime_r='$d_localtime_r'
21819 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
21820 d_locconv='$d_locconv'
21822 d_longdbl='$d_longdbl'
21823 d_longlong='$d_longlong'
21824 d_lseekproto='$d_lseekproto'
21826 d_madvise='$d_madvise'
21827 d_malloc_good_size='$d_malloc_good_size'
21828 d_malloc_size='$d_malloc_size'
21830 d_mbstowcs='$d_mbstowcs'
21831 d_mbtowc='$d_mbtowc'
21832 d_memchr='$d_memchr'
21833 d_memcmp='$d_memcmp'
21834 d_memcpy='$d_memcpy'
21835 d_memmove='$d_memmove'
21836 d_memset='$d_memset'
21838 d_mkdtemp='$d_mkdtemp'
21839 d_mkfifo='$d_mkfifo'
21840 d_mkstemp='$d_mkstemp'
21841 d_mkstemps='$d_mkstemps'
21842 d_mktime='$d_mktime'
21845 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21846 d_modflproto='$d_modflproto'
21847 d_mprotect='$d_mprotect'
21849 d_msg_ctrunc='$d_msg_ctrunc'
21850 d_msg_dontroute='$d_msg_dontroute'
21851 d_msg_oob='$d_msg_oob'
21852 d_msg_peek='$d_msg_peek'
21853 d_msg_proxy='$d_msg_proxy'
21854 d_msgctl='$d_msgctl'
21855 d_msgget='$d_msgget'
21856 d_msghdr_s='$d_msghdr_s'
21857 d_msgrcv='$d_msgrcv'
21858 d_msgsnd='$d_msgsnd'
21860 d_munmap='$d_munmap'
21861 d_mymalloc='$d_mymalloc'
21863 d_nl_langinfo='$d_nl_langinfo'
21864 d_nv_preserves_uv='$d_nv_preserves_uv'
21865 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21866 d_off64_t='$d_off64_t'
21867 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21868 d_oldpthreads='$d_oldpthreads'
21869 d_oldsock='$d_oldsock'
21871 d_pathconf='$d_pathconf'
21873 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21874 d_phostname='$d_phostname'
21877 d_portable='$d_portable'
21878 d_printf_format_null='$d_printf_format_null'
21879 d_procselfexe='$d_procselfexe'
21880 d_pseudofork='$d_pseudofork'
21881 d_pthread_atfork='$d_pthread_atfork'
21882 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21883 d_pthread_yield='$d_pthread_yield'
21885 d_pwchange='$d_pwchange'
21886 d_pwclass='$d_pwclass'
21887 d_pwcomment='$d_pwcomment'
21888 d_pwexpire='$d_pwexpire'
21889 d_pwgecos='$d_pwgecos'
21890 d_pwpasswd='$d_pwpasswd'
21891 d_pwquota='$d_pwquota'
21894 d_random_r='$d_random_r'
21895 d_readdir64_r='$d_readdir64_r'
21896 d_readdir='$d_readdir'
21897 d_readdir_r='$d_readdir_r'
21898 d_readlink='$d_readlink'
21900 d_recvmsg='$d_recvmsg'
21901 d_rename='$d_rename'
21902 d_rewinddir='$d_rewinddir'
21904 d_safebcpy='$d_safebcpy'
21905 d_safemcpy='$d_safemcpy'
21906 d_sanemcmp='$d_sanemcmp'
21907 d_sbrkproto='$d_sbrkproto'
21908 d_scalbnl='$d_scalbnl'
21909 d_sched_yield='$d_sched_yield'
21910 d_scm_rights='$d_scm_rights'
21911 d_seekdir='$d_seekdir'
21912 d_select='$d_select'
21914 d_semctl='$d_semctl'
21915 d_semctl_semid_ds='$d_semctl_semid_ds'
21916 d_semctl_semun='$d_semctl_semun'
21917 d_semget='$d_semget'
21919 d_sendmsg='$d_sendmsg'
21920 d_setegid='$d_setegid'
21921 d_seteuid='$d_seteuid'
21922 d_setgrent='$d_setgrent'
21923 d_setgrent_r='$d_setgrent_r'
21924 d_setgrps='$d_setgrps'
21925 d_sethent='$d_sethent'
21926 d_sethostent_r='$d_sethostent_r'
21927 d_setitimer='$d_setitimer'
21928 d_setlinebuf='$d_setlinebuf'
21929 d_setlocale='$d_setlocale'
21930 d_setlocale_r='$d_setlocale_r'
21931 d_setnent='$d_setnent'
21932 d_setnetent_r='$d_setnetent_r'
21933 d_setpent='$d_setpent'
21934 d_setpgid='$d_setpgid'
21935 d_setpgrp2='$d_setpgrp2'
21936 d_setpgrp='$d_setpgrp'
21937 d_setprior='$d_setprior'
21938 d_setproctitle='$d_setproctitle'
21939 d_setprotoent_r='$d_setprotoent_r'
21940 d_setpwent='$d_setpwent'
21941 d_setpwent_r='$d_setpwent_r'
21942 d_setregid='$d_setregid'
21943 d_setresgid='$d_setresgid'
21944 d_setresuid='$d_setresuid'
21945 d_setreuid='$d_setreuid'
21946 d_setrgid='$d_setrgid'
21947 d_setruid='$d_setruid'
21948 d_setsent='$d_setsent'
21949 d_setservent_r='$d_setservent_r'
21950 d_setsid='$d_setsid'
21951 d_setvbuf='$d_setvbuf'
21955 d_shmatprototype='$d_shmatprototype'
21956 d_shmctl='$d_shmctl'
21958 d_shmget='$d_shmget'
21959 d_sigaction='$d_sigaction'
21960 d_signbit='$d_signbit'
21961 d_sigprocmask='$d_sigprocmask'
21962 d_sigsetjmp='$d_sigsetjmp'
21963 d_sitearch='$d_sitearch'
21964 d_snprintf='$d_snprintf'
21965 d_sockatmark='$d_sockatmark'
21966 d_sockatmarkproto='$d_sockatmarkproto'
21967 d_socket='$d_socket'
21968 d_socklen_t='$d_socklen_t'
21969 d_sockpair='$d_sockpair'
21970 d_socks5_init='$d_socks5_init'
21971 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
21973 d_srand48_r='$d_srand48_r'
21974 d_srandom_r='$d_srandom_r'
21975 d_sresgproto='$d_sresgproto'
21976 d_sresuproto='$d_sresuproto'
21977 d_statblks='$d_statblks'
21978 d_statfs_f_flags='$d_statfs_f_flags'
21979 d_statfs_s='$d_statfs_s'
21980 d_statvfs='$d_statvfs'
21981 d_stdio_cnt_lval='$d_stdio_cnt_lval'
21982 d_stdio_ptr_lval='$d_stdio_ptr_lval'
21983 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
21984 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
21985 d_stdio_stream_array='$d_stdio_stream_array'
21986 d_stdiobase='$d_stdiobase'
21987 d_stdstdio='$d_stdstdio'
21988 d_strchr='$d_strchr'
21989 d_strcoll='$d_strcoll'
21990 d_strctcpy='$d_strctcpy'
21991 d_strerrm='$d_strerrm'
21992 d_strerror='$d_strerror'
21993 d_strerror_r='$d_strerror_r'
21994 d_strftime='$d_strftime'
21995 d_strlcat='$d_strlcat'
21996 d_strlcpy='$d_strlcpy'
21997 d_strtod='$d_strtod'
21998 d_strtol='$d_strtol'
21999 d_strtold='$d_strtold'
22000 d_strtoll='$d_strtoll'
22001 d_strtoq='$d_strtoq'
22002 d_strtoul='$d_strtoul'
22003 d_strtoull='$d_strtoull'
22004 d_strtouq='$d_strtouq'
22005 d_strxfrm='$d_strxfrm'
22006 d_suidsafe='$d_suidsafe'
22007 d_symlink='$d_symlink'
22008 d_syscall='$d_syscall'
22009 d_syscallproto='$d_syscallproto'
22010 d_sysconf='$d_sysconf'
22011 d_sysernlst='$d_sysernlst'
22012 d_syserrlst='$d_syserrlst'
22013 d_system='$d_system'
22014 d_tcgetpgrp='$d_tcgetpgrp'
22015 d_tcsetpgrp='$d_tcsetpgrp'
22016 d_telldir='$d_telldir'
22017 d_telldirproto='$d_telldirproto'
22020 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
22021 d_tm_tm_zone='$d_tm_tm_zone'
22022 d_tmpnam_r='$d_tmpnam_r'
22023 d_truncate='$d_truncate'
22024 d_ttyname_r='$d_ttyname_r'
22025 d_tzname='$d_tzname'
22026 d_u32align='$d_u32align'
22027 d_ualarm='$d_ualarm'
22030 d_union_semun='$d_union_semun'
22031 d_unordered='$d_unordered'
22032 d_unsetenv='$d_unsetenv'
22033 d_usleep='$d_usleep'
22034 d_usleepproto='$d_usleepproto'
22036 d_vendorarch='$d_vendorarch'
22037 d_vendorbin='$d_vendorbin'
22038 d_vendorlib='$d_vendorlib'
22039 d_vendorscript='$d_vendorscript'
22041 d_void_closedir='$d_void_closedir'
22042 d_voidsig='$d_voidsig'
22043 d_voidtty='$d_voidtty'
22044 d_volatile='$d_volatile'
22045 d_vprintf='$d_vprintf'
22046 d_vsnprintf='$d_vsnprintf'
22048 d_waitpid='$d_waitpid'
22049 d_wcstombs='$d_wcstombs'
22050 d_wctomb='$d_wctomb'
22051 d_writev='$d_writev'
22054 db_hashtype='$db_hashtype'
22055 db_prefixtype='$db_prefixtype'
22056 db_version_major='$db_version_major'
22057 db_version_minor='$db_version_minor'
22058 db_version_patch='$db_version_patch'
22059 defvoidused='$defvoidused'
22060 direntrytype='$direntrytype'
22063 doublesize='$doublesize'
22065 drand48_r_proto='$drand48_r_proto'
22066 dynamic_ext='$dynamic_ext'
22072 endgrent_r_proto='$endgrent_r_proto'
22073 endhostent_r_proto='$endhostent_r_proto'
22074 endnetent_r_proto='$endnetent_r_proto'
22075 endprotoent_r_proto='$endprotoent_r_proto'
22076 endpwent_r_proto='$endpwent_r_proto'
22077 endservent_r_proto='$endservent_r_proto'
22078 eunicefix='$eunicefix'
22081 extensions='$extensions'
22083 fflushNULL='$fflushNULL'
22084 fflushall='$fflushall'
22086 firstmakefile='$firstmakefile'
22088 fpossize='$fpossize'
22089 fpostype='$fpostype'
22090 freetype='$freetype'
22093 full_csh='$full_csh'
22094 full_sed='$full_sed'
22095 gccansipedantic='$gccansipedantic'
22096 gccosandvers='$gccosandvers'
22097 gccversion='$gccversion'
22098 getgrent_r_proto='$getgrent_r_proto'
22099 getgrgid_r_proto='$getgrgid_r_proto'
22100 getgrnam_r_proto='$getgrnam_r_proto'
22101 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22102 gethostbyname_r_proto='$gethostbyname_r_proto'
22103 gethostent_r_proto='$gethostent_r_proto'
22104 getlogin_r_proto='$getlogin_r_proto'
22105 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22106 getnetbyname_r_proto='$getnetbyname_r_proto'
22107 getnetent_r_proto='$getnetent_r_proto'
22108 getprotobyname_r_proto='$getprotobyname_r_proto'
22109 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22110 getprotoent_r_proto='$getprotoent_r_proto'
22111 getpwent_r_proto='$getpwent_r_proto'
22112 getpwnam_r_proto='$getpwnam_r_proto'
22113 getpwuid_r_proto='$getpwuid_r_proto'
22114 getservbyname_r_proto='$getservbyname_r_proto'
22115 getservbyport_r_proto='$getservbyport_r_proto'
22116 getservent_r_proto='$getservent_r_proto'
22117 getspnam_r_proto='$getspnam_r_proto'
22118 gidformat='$gidformat'
22124 gmtime_r_proto='$gmtime_r_proto'
22125 gnulibc_version='$gnulibc_version'
22127 groupcat='$groupcat'
22128 groupstype='$groupstype'
22131 h_sysfile='$h_sysfile'
22134 html1dir='$html1dir'
22135 html1direxp='$html1direxp'
22136 html3dir='$html3dir'
22137 html3direxp='$html3direxp'
22146 i_arpainet='$i_arpainet'
22147 i_bsdioctl='$i_bsdioctl'
22151 i_dirent='$i_dirent'
22157 i_fp_class='$i_fp_class'
22160 i_ieeefp='$i_ieeefp'
22161 i_inttypes='$i_inttypes'
22162 i_langinfo='$i_langinfo'
22163 i_libutil='$i_libutil'
22164 i_limits='$i_limits'
22165 i_locale='$i_locale'
22166 i_machcthr='$i_machcthr'
22167 i_malloc='$i_malloc'
22169 i_memory='$i_memory'
22170 i_mntent='$i_mntent'
22173 i_neterrno='$i_neterrno'
22174 i_netinettcp='$i_netinettcp'
22178 i_pthread='$i_pthread'
22180 i_rpcsvcdbm='$i_rpcsvcdbm'
22183 i_shadow='$i_shadow'
22185 i_stdarg='$i_stdarg'
22186 i_stddef='$i_stddef'
22187 i_stdlib='$i_stdlib'
22188 i_string='$i_string'
22189 i_sunmath='$i_sunmath'
22190 i_sysaccess='$i_sysaccess'
22191 i_sysdir='$i_sysdir'
22192 i_sysfile='$i_sysfile'
22193 i_sysfilio='$i_sysfilio'
22195 i_sysioctl='$i_sysioctl'
22196 i_syslog='$i_syslog'
22197 i_sysmman='$i_sysmman'
22198 i_sysmode='$i_sysmode'
22199 i_sysmount='$i_sysmount'
22200 i_sysndir='$i_sysndir'
22201 i_sysparam='$i_sysparam'
22202 i_sysresrc='$i_sysresrc'
22203 i_syssecrt='$i_syssecrt'
22204 i_sysselct='$i_sysselct'
22205 i_syssockio='$i_syssockio'
22206 i_sysstat='$i_sysstat'
22207 i_sysstatfs='$i_sysstatfs'
22208 i_sysstatvfs='$i_sysstatvfs'
22209 i_systime='$i_systime'
22210 i_systimek='$i_systimek'
22211 i_systimes='$i_systimes'
22212 i_systypes='$i_systypes'
22213 i_sysuio='$i_sysuio'
22215 i_sysutsname='$i_sysutsname'
22216 i_sysvfs='$i_sysvfs'
22217 i_syswait='$i_syswait'
22218 i_termio='$i_termio'
22219 i_termios='$i_termios'
22221 i_unistd='$i_unistd'
22224 i_values='$i_values'
22225 i_varargs='$i_varargs'
22226 i_varhdr='$i_varhdr'
22228 ignore_versioned_solibs='$ignore_versioned_solibs'
22229 inc_version_list='$inc_version_list'
22230 inc_version_list_init='$inc_version_list_init'
22233 initialinstalllocation='$initialinstalllocation'
22234 installarchlib='$installarchlib'
22235 installbin='$installbin'
22236 installhtml1dir='$installhtml1dir'
22237 installhtml3dir='$installhtml3dir'
22238 installman1dir='$installman1dir'
22239 installman3dir='$installman3dir'
22240 installprefix='$installprefix'
22241 installprefixexp='$installprefixexp'
22242 installprivlib='$installprivlib'
22243 installscript='$installscript'
22244 installsitearch='$installsitearch'
22245 installsitebin='$installsitebin'
22246 installsitehtml1dir='$installsitehtml1dir'
22247 installsitehtml3dir='$installsitehtml3dir'
22248 installsitelib='$installsitelib'
22249 installsiteman1dir='$installsiteman1dir'
22250 installsiteman3dir='$installsiteman3dir'
22251 installsitescript='$installsitescript'
22252 installstyle='$installstyle'
22253 installusrbinperl='$installusrbinperl'
22254 installvendorarch='$installvendorarch'
22255 installvendorbin='$installvendorbin'
22256 installvendorhtml1dir='$installvendorhtml1dir'
22257 installvendorhtml3dir='$installvendorhtml3dir'
22258 installvendorlib='$installvendorlib'
22259 installvendorman1dir='$installvendorman1dir'
22260 installvendorman3dir='$installvendorman3dir'
22261 installvendorscript='$installvendorscript'
22263 issymlink='$issymlink'
22264 ivdformat='$ivdformat'
22267 known_extensions='$known_extensions'
22270 lddlflags='$lddlflags'
22272 ldflags_uselargefiles='$ldflags_uselargefiles'
22273 ldlibpthname='$ldlibpthname'
22280 libsdirs='$libsdirs'
22281 libsfiles='$libsfiles'
22282 libsfound='$libsfound'
22283 libspath='$libspath'
22284 libswanted='$libswanted'
22285 libswanted_uselargefiles='$libswanted_uselargefiles'
22291 localtime_r_proto='$localtime_r_proto'
22292 locincpth='$locincpth'
22293 loclibpth='$loclibpth'
22294 longdblsize='$longdblsize'
22295 longlongsize='$longlongsize'
22296 longsize='$longsize'
22300 lseeksize='$lseeksize'
22301 lseektype='$lseektype'
22304 madlyobj='$madlyobj'
22305 madlysrc='$madlysrc'
22309 make_set_make='$make_set_make'
22310 mallocobj='$mallocobj'
22311 mallocsrc='$mallocsrc'
22312 malloctype='$malloctype'
22314 man1direxp='$man1direxp'
22317 man3direxp='$man3direxp'
22319 mips_type='$mips_type'
22320 mistrustnm='$mistrustnm'
22322 mmaptype='$mmaptype'
22323 modetype='$modetype'
22325 multiarch='$multiarch'
22327 myarchname='$myarchname'
22328 mydomain='$mydomain'
22329 myhostname='$myhostname'
22332 need_va_copy='$need_va_copy'
22333 netdb_hlen_type='$netdb_hlen_type'
22334 netdb_host_type='$netdb_host_type'
22335 netdb_name_type='$netdb_name_type'
22336 netdb_net_type='$netdb_net_type'
22339 nm_so_opt='$nm_so_opt'
22340 nonxs_ext='$nonxs_ext'
22342 nvEUformat='$nvEUformat'
22343 nvFUformat='$nvFUformat'
22344 nvGUformat='$nvGUformat'
22345 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22346 nveformat='$nveformat'
22347 nvfformat='$nvfformat'
22348 nvgformat='$nvgformat'
22351 o_nonblock='$o_nonblock'
22353 old_pthread_create_joinable='$old_pthread_create_joinable'
22354 optimize='$optimize'
22355 orderlib='$orderlib'
22358 otherlibdirs='$otherlibdirs'
22362 patchlevel='$patchlevel'
22363 path_sep='$path_sep'
22366 perl_patchlevel='$perl_patchlevel'
22367 perladmin='$perladmin'
22368 perllibs='$perllibs'
22369 perlpath='$perlpath'
22371 phostname='$phostname'
22377 prefixexp='$prefixexp'
22379 privlibexp='$privlibexp'
22380 procselfexe='$procselfexe'
22381 prototype='$prototype'
22383 quadkind='$quadkind'
22384 quadtype='$quadtype'
22385 randbits='$randbits'
22386 randfunc='$randfunc'
22387 random_r_proto='$random_r_proto'
22388 randseedtype='$randseedtype'
22390 rd_nodata='$rd_nodata'
22391 readdir64_r_proto='$readdir64_r_proto'
22392 readdir_r_proto='$readdir_r_proto'
22393 revision='$revision'
22399 sPRIEUldbl='$sPRIEUldbl'
22400 sPRIFUldbl='$sPRIFUldbl'
22401 sPRIGUldbl='$sPRIGUldbl'
22402 sPRIXU64='$sPRIXU64'
22404 sPRIeldbl='$sPRIeldbl'
22405 sPRIfldbl='$sPRIfldbl'
22406 sPRIgldbl='$sPRIgldbl'
22411 sSCNfldbl='$sSCNfldbl'
22412 sched_yield='$sched_yield'
22413 scriptdir='$scriptdir'
22414 scriptdirexp='$scriptdirexp'
22416 seedfunc='$seedfunc'
22417 selectminbits='$selectminbits'
22418 selecttype='$selecttype'
22419 sendmail='$sendmail'
22420 setgrent_r_proto='$setgrent_r_proto'
22421 sethostent_r_proto='$sethostent_r_proto'
22422 setlocale_r_proto='$setlocale_r_proto'
22423 setnetent_r_proto='$setnetent_r_proto'
22424 setprotoent_r_proto='$setprotoent_r_proto'
22425 setpwent_r_proto='$setpwent_r_proto'
22426 setservent_r_proto='$setservent_r_proto'
22429 sharpbang='$sharpbang'
22430 shmattype='$shmattype'
22431 shortsize='$shortsize'
22434 sig_count='$sig_count'
22435 sig_name='$sig_name'
22436 sig_name_init='$sig_name_init'
22438 sig_num_init='$sig_num_init'
22439 sig_size='$sig_size'
22440 signal_t='$signal_t'
22441 sitearch='$sitearch'
22442 sitearchexp='$sitearchexp'
22444 sitebinexp='$sitebinexp'
22445 sitehtml1dir='$sitehtml1dir'
22446 sitehtml1direxp='$sitehtml1direxp'
22447 sitehtml3dir='$sitehtml3dir'
22448 sitehtml3direxp='$sitehtml3direxp'
22450 sitelib_stem='$sitelib_stem'
22451 sitelibexp='$sitelibexp'
22452 siteman1dir='$siteman1dir'
22453 siteman1direxp='$siteman1direxp'
22454 siteman3dir='$siteman3dir'
22455 siteman3direxp='$siteman3direxp'
22456 siteprefix='$siteprefix'
22457 siteprefixexp='$siteprefixexp'
22458 sitescript='$sitescript'
22459 sitescriptexp='$sitescriptexp'
22460 sizesize='$sizesize'
22461 sizetype='$sizetype'
22465 sockethdr='$sockethdr'
22466 socketlib='$socketlib'
22467 socksizetype='$socksizetype'
22469 spackage='$spackage'
22470 spitshell='$spitshell'
22471 srand48_r_proto='$srand48_r_proto'
22472 srandom_r_proto='$srandom_r_proto'
22474 ssizetype='$ssizetype'
22475 startperl='$startperl'
22477 static_ext='$static_ext'
22479 stdio_base='$stdio_base'
22480 stdio_bufsiz='$stdio_bufsiz'
22481 stdio_cnt='$stdio_cnt'
22482 stdio_filbuf='$stdio_filbuf'
22483 stdio_ptr='$stdio_ptr'
22484 stdio_stream_array='$stdio_stream_array'
22485 strerror_r_proto='$strerror_r_proto'
22488 subversion='$subversion'
22492 targetarch='$targetarch'
22496 timeincl='$timeincl'
22497 timetype='$timetype'
22498 tmpnam_r_proto='$tmpnam_r_proto'
22504 ttyname_r_proto='$ttyname_r_proto'
22513 uidformat='$uidformat'
22519 uquadtype='$uquadtype'
22520 use5005threads='$use5005threads'
22521 use64bitall='$use64bitall'
22522 use64bitint='$use64bitint'
22523 usecrosscompile='$usecrosscompile'
22525 usefaststdio='$usefaststdio'
22526 useithreads='$useithreads'
22527 uselargefiles='$uselargefiles'
22528 uselongdouble='$uselongdouble'
22529 usemallocwrap='$usemallocwrap'
22530 usemorebits='$usemorebits'
22531 usemultiplicity='$usemultiplicity'
22532 usemymalloc='$usemymalloc'
22534 useopcode='$useopcode'
22535 useperlio='$useperlio'
22536 useposix='$useposix'
22537 usereentrant='$usereentrant'
22538 userelocatableinc='$userelocatableinc'
22540 useshrplib='$useshrplib'
22541 usesitecustomize='$usesitecustomize'
22542 usesocks='$usesocks'
22543 usethreads='$usethreads'
22544 usevendorprefix='$usevendorprefix'
22545 usevfork='$usevfork'
22548 uvXUformat='$uvXUformat'
22549 uvoformat='$uvoformat'
22552 uvuformat='$uvuformat'
22553 uvxformat='$uvxformat'
22554 vendorarch='$vendorarch'
22555 vendorarchexp='$vendorarchexp'
22556 vendorbin='$vendorbin'
22557 vendorbinexp='$vendorbinexp'
22558 vendorhtml1dir='$vendorhtml1dir'
22559 vendorhtml1direxp='$vendorhtml1direxp'
22560 vendorhtml3dir='$vendorhtml3dir'
22561 vendorhtml3direxp='$vendorhtml3direxp'
22562 vendorlib='$vendorlib'
22563 vendorlib_stem='$vendorlib_stem'
22564 vendorlibexp='$vendorlibexp'
22565 vendorman1dir='$vendorman1dir'
22566 vendorman1direxp='$vendorman1direxp'
22567 vendorman3dir='$vendorman3dir'
22568 vendorman3direxp='$vendorman3direxp'
22569 vendorprefix='$vendorprefix'
22570 vendorprefixexp='$vendorprefixexp'
22571 vendorscript='$vendorscript'
22572 vendorscriptexp='$vendorscriptexp'
22574 version_patchlevel_string='$version_patchlevel_string'
22575 versiononly='$versiononly'
22577 voidflags='$voidflags'
22580 yaccflags='$yaccflags'
22585 : Add in command line options if available
22586 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22588 : add special variables
22589 $test -f $src/patchlevel.h && \
22590 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22591 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22592 echo "PERL_CONFIG_SH=true" >>config.sh
22594 : propagate old symbols
22595 if $test -f UU/config.sh; then
22596 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22597 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
22598 $sort | $uniq -u >UU/oldsyms
22599 set X `cat UU/oldsyms`
22605 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22607 echo "# Variables propagated from previous config.sh file." >>config.sh
22608 for sym in `cat UU/oldsyms`; do
22609 echo " Propagating $hint variable "'$'"$sym..."
22610 eval 'tmp="$'"${sym}"'"'
22612 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22618 : Finish up by extracting the .SH files
22622 echo "Extraction done."
22632 If you'd like to make any changes to the config.sh file before I begin
22633 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22636 rp="Press return or use a shell escape to edit config.sh:"
22641 *) : in case they cannot read
22642 sh 1>&4 -c "$ans";;
22647 : if this fails, just run all the .SH files by hand
22656 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22663 Now you need to generate make dependencies by running "$make depend".
22664 You might prefer to run it in background: "$make depend > makedepend.out &"
22665 It can take a while, so you might not want to run it right now.
22670 rp="Run $make depend now?"
22674 $make depend && echo "Now you must run '$make'."
22677 echo "You must run '$make depend' then '$make'."
22680 elif test -f [Mm]akefile; then
22682 echo "Now you must run a $make."
22684 echo "Configure done."
22687 if $test -f Policy.sh; then
22690 If you compile $package on a different machine or from a different object
22691 directory, copy the Policy.sh file from this object directory to the
22692 new one before you run Configure -- this will help you with most of
22693 the policy defaults.
22697 if $test -f config.msg; then
22698 echo "Hmm. I also noted the following information while running:"
22700 $cat config.msg >&4
22703 $rm -f kit*isdone ark*isdone