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 Wed Aug 2 13:20:07 CEST 2006 [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 : compute my invocation name
72 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
77 : Proper separator for the PATH environment variable
79 : On OS/2 this directory should exist if this is not floppy only system :-]
80 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
81 if test -n "$OS2_SHELL"; then
83 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
84 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
86 elif test -n "$DJGPP"; then
87 case "X${MACHTYPE:-nonesuchmach}" in
95 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
96 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
97 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
98 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
99 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
100 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
101 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
102 paths="$paths /sbin /usr/sbin /usr/libexec"
103 paths="$paths /system/gnu_library/bin"
107 case "$p_$PATH$p_" in
109 *) test -d $p && PATH=$PATH$p_$p ;;
116 : shall we be using ksh?
122 if (PATH=.; alias -x) >/dev/null 2>&1; then
125 if test -f /hp-ux -a -f /bin/ksh; then
126 needksh='to avoid sh bug in "here document" expansion'
128 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
129 if test X`/usr/bin/uname -v` = X4; then
130 avoidksh="to avoid AIX 4's /bin/sh"
134 if test -f /osf_boot -a -f /usr/sbin/setld; then
135 if test X`/usr/bin/uname -s` = XOSF1; then
136 avoidksh="to avoid Digital UNIX' ksh"
138 unset BIN_SH # if this is 'xpg4' sh will start up ksh
141 case "$inksh/$needksh" in
148 case "$inksh/$avoidksh" in
154 case "$inksh/$needksh-$avoidksh-" in
157 (I see you are using the Korn shell. Some ksh's blow up on $me,
158 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
165 echo "(Feeding myself to $newsh $reason.)"
167 Configure|*/Configure) exec $newsh $0 "$@";;
168 *) exec $newsh Configure "$@";;
173 : if needed set CDPATH to a harmless value that is not chatty
174 : avoid bash 2.02 problems with empty CDPATH.
178 *bash*) CDPATH='.' ;;
183 : Configure runs within the UU subdirectory
184 test -d UU || mkdir UU
322 initialinstalllocation=''
350 d_attribute_format=''
351 d_attribute_malloc=''
352 d_attribute_nonnull=''
353 d_attribute_noreturn=''
355 d_attribute_unused=''
356 d_attribute_warn_unused_result=''
359 d_builtin_choose_expr=''
362 d_c99_variadic_macros=''
407 endhostent_r_proto=''
413 endprotoent_r_proto=''
419 endservent_r_proto=''
471 gethostbyaddr_r_proto=''
473 gethostbyname_r_proto=''
475 gethostent_r_proto=''
487 getnetbyaddr_r_proto=''
489 getnetbyname_r_proto=''
503 d_getprotobyname_r=''
504 getprotobyname_r_proto=''
505 d_getprotobynumber_r=''
506 getprotobynumber_r_proto=''
508 getprotoent_r_proto=''
520 getservbyname_r_proto=''
522 getservbyport_r_proto=''
524 getservent_r_proto=''
548 d_libm_lib_version=''
561 d_malloc_good_size=''
603 d_old_pthread_create_joinable=''
604 old_pthread_create_joinable=''
606 d_pthread_attr_setscope=''
645 sethostent_r_proto=''
662 setprotoent_r_proto=''
674 setservent_r_proto=''
707 d_sprintf_returns_strlen=''
722 d_stdio_ptr_lval_nochange_cnt=''
723 d_stdio_ptr_lval_sets_cnt=''
926 d_inc_version_list=''
928 inc_version_list_init=''
947 ignore_versioned_solibs=''
1011 d_perl_otherlibdirs=''
1019 api_versionstring=''
1025 version_patchlevel_string=''
1029 d_nv_preserves_uv=''
1030 d_nv_zero_is_allbits_zero=''
1041 nv_preserves_uv_bits=''
1113 installsitehtml1dir=''
1116 installsitehtml3dir=''
1123 installsiteman1dir=''
1126 installsiteman3dir=''
1131 installsitescript=''
1146 d_stdio_stream_array=''
1147 stdio_stream_array=''
1158 ccflags_uselargefiles=''
1159 ldflags_uselargefiles=''
1160 libswanted_uselargefiles=''
1180 installvendorarch=''
1187 installvendorhtml1dir=''
1189 vendorhtml1direxp=''
1190 installvendorhtml3dir=''
1192 vendorhtml3direxp=''
1198 installvendorman1dir=''
1201 installvendorman3dir=''
1208 installvendorscript=''
1220 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1223 : We must find out about Eunice early
1225 if test -f /etc/unixtovms; then
1226 eunicefix=/etc/unixtovms
1228 if test -f /etc/unixtovms.exe; then
1229 eunicefix=/etc/unixtovms.exe
1232 : Set executable suffix now -- needed before hints available
1233 if test -f "/libs/version.library"; then
1236 elif test -f "/system/gnu_library/bin/ar.pm"; then
1239 elif test -n "$DJGPP"; then
1242 elif test -d c:/. -o -n "$is_os2" ; then
1251 : set useposix=false in your hint file to disable the POSIX extension.
1253 : set useopcode=false in your hint file to disable the Opcode extension.
1255 : Trailing extension. Override this in a hint file, if needed.
1256 : Extra object files, if any, needed on this platform.
1259 : Possible local include directories to search.
1260 : Set locincpth to "" in a hint file to defeat local include searches.
1261 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1262 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1264 : no include file wanted by default
1267 : Enable -DEBUGGING and -DDEBUGGING from the command line
1273 : change the next line if compiling for Xenix/286 on Xenix/386
1274 xlibpth='/usr/lib/386 /lib/386'
1275 : Possible local library directories to search.
1276 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1277 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1279 : general looking path for locating libraries
1280 glibpth="/lib /usr/lib $xlibpth"
1281 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1282 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1283 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1285 : Private path used by Configure to find libraries. Its value
1286 : is prepended to libpth. This variable takes care of special
1287 : machines, like the mips. Usually, it should be empty.
1290 : default library list
1292 : some systems want to use only the non-versioned libso:s
1293 ignore_versioned_solibs=''
1298 ccflags_uselargefiles=''
1299 ldflags_uselargefiles=''
1300 libswanted_uselargefiles=''
1301 : set usemultiplicity on the Configure command line to enable multiplicity.
1302 : set usesocks on the Configure command line to enable socks.
1303 : set usethreads on the Configure command line to enable threads.
1304 usereentrant='undef'
1305 : full support for void wanted by default
1308 : List of libraries we want.
1309 : If anyone needs extra -lxxx, put those in a hint file.
1310 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1311 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1312 : We probably want to search /usr/shlib before most other libraries.
1313 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1314 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1315 glibpth="/usr/shlib $glibpth"
1316 : Do not use vfork unless overridden by a hint file.
1319 : Find the basic shell for Bourne shell scripts
1323 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1326 if test -f "$xxx"; then
1329 : Build up a list and do a single loop so we can 'break' out.
1330 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1331 for xxx in sh bash ksh pdksh ash; do
1333 try="$try ${p}/${xxx}"
1337 if test -f "$xxx"; then
1340 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1343 elif test -f "$xxx.exe"; then
1354 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1356 Usually it's in /bin/sh. How did you even get this far?
1357 Please contact me (Perl Maintainers) at perlbug@perl.org and
1358 we'll try to straighten this all out.
1364 : see if sh knows # comments
1365 if `$sh -c '#' >/dev/null 2>&1`; then
1369 test -f $xcat$_exe || xcat=/usr/bin/cat
1370 if test ! -f $xcat$_exe; then
1371 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1372 if test -f $p/cat$_exe; then
1377 if test ! -f $xcat$_exe; then
1378 echo "Can't find cat anywhere!"
1382 echo "#!$xcat" >sharp
1386 if test -s today; then
1389 echo "#! $xcat" > sharp
1393 if test -s today; then
1401 echo "Your $sh doesn't grok # comments--I will strip them later on."
1404 echo "exec grep -v '^[ ]*#'" >spitshell
1406 $eunicefix spitshell
1407 spitshell=`pwd`/spitshell
1409 echo "I presume that if # doesn't work, #! won't work either!"
1414 : figure out how to guarantee sh startup
1416 '') startsh=${sharpbang}${sh} ;;
1428 : echo "Yup, it does."
1430 echo "Hmm... '$startsh' does not guarantee sh startup..."
1431 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1436 : Save command line options in file UU/cmdline.opt for later use in
1437 : generating config.sh.
1438 cat > cmdline.opt <<EOSH
1439 # Configure command line arguments.
1448 cat >>cmdline.opt <<EOSH
1449 config_arg$argn='$arg'
1451 # Extreme backslashitis: replace each ' by '"'"'
1452 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1455 arg_exp=`cat cmdl.opt`
1456 args_exp="$args_exp$args_sep'$arg_exp'"
1457 argn=`expr $argn + 1`
1460 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1461 # used by ./hints/os2.sh
1464 : produce awk script to parse command line options
1465 cat >options.awk <<'EOF'
1467 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1469 len = length(optstr);
1470 for (i = 1; i <= len; i++) {
1471 c = substr(optstr, i, 1);
1472 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1483 if (substr(str, 1, 1) != "-") {
1484 printf("'%s'\n", str);
1488 for (i = 2; i <= len; i++) {
1489 c = substr(str, i, 1);
1491 printf("-%s\n", substr(str, i));
1497 printf("'%s'\n", substr(str, i + 1));
1510 : process the command line options
1511 set X `for arg in "$@"; do echo "X$arg"; done |
1512 sed -e s/X// | awk -f options.awk`
1517 : set up default values
1527 rm -f optdef.sh posthint.sh
1528 cat >optdef.sh <<EOS
1534 while test $# -gt 0; do
1536 -d) shift; fastread=yes;;
1537 -e) shift; alldone=cont;;
1541 if test -r "$1"; then
1544 echo "$me: cannot read config file $1." >&2
1549 -h) shift; error=true;;
1550 -r) shift; reuseval=true;;
1551 -s) shift; silent=true; realsilent=true;;
1552 -E) shift; alldone=exit;;
1553 -K) shift; knowitall=true;;
1554 -O) shift; override=true;;
1555 -S) shift; silent=true; extractsh=true;;
1560 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1561 echo "$me: ignoring -D $1" >&2
1564 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1565 *) echo "$1='define'" >> optdef.sh;;
1572 *=) echo "$1" >> optdef.sh;;
1574 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1575 echo "$me: ignoring -U $1" >&2
1577 *) echo "$1='undef'" >> optdef.sh;;
1588 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1592 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1593 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1599 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1600 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1601 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1602 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1603 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1604 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1610 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1612 echo "$yyy=''" >> posthint.sh ;;
1617 echo "$yyy='$zzz'" >> posthint.sh ;;
1619 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1621 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1626 echo "$yyy=$zzz" >> posthint.sh ;;
1627 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1631 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1634 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1642 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1643 [-U symbol] [-U symbol=] [-A command:symbol...]
1644 -d : use defaults for all answers.
1645 -e : go on without questioning past the production of config.sh.
1646 -f : specify an alternate default configuration file.
1647 -h : print this help message and exit (with an error status).
1648 -r : reuse C symbols value if possible (skips costly nm extraction).
1649 -s : silent mode, only echoes questions and essential information.
1650 -D : define symbol to have some value:
1651 -D symbol symbol gets the value 'define'
1652 -D symbol=value symbol gets the value 'value'
1653 -E : stop at the end of questions, after having produced config.sh.
1654 -K : do not use unless you know what you are doing.
1655 -O : let -D and -U override definitions from loaded configuration file.
1656 -S : perform variable substitutions on all .SH files (can mix with -f)
1657 -U : undefine symbol:
1658 -U symbol symbol gets the value 'undef'
1659 -U symbol= symbol gets completely empty
1660 -A : manipulate symbol after the platform specific hints have been applied:
1661 -A symbol=value append " "value to symbol
1662 -A append:symbol=value append value to symbol
1663 -A define:symbol=value define symbol to have value
1664 -A clear:symbol define symbol to be ''
1665 -A define:symbol define symbol to be 'define'
1666 -A eval:symbol=value define symbol to be eval of value
1667 -A prepend:symbol=value prepend value to symbol
1668 -A undef:symbol define symbol to be 'undef'
1669 -A undef:symbol= define symbol to be ''
1670 -V : print version number and exit (with a zero status).
1677 case "$fastread$alldone" in
1680 case "$extractsh" in
1683 if test ! -t 0; then
1684 echo "Say 'sh Configure', not 'sh <Configure'"
1694 true) exec 1>/dev/null;;
1697 : run the defines and the undefines, if any, but leave the file out there...
1700 : create the posthint manipulation script and leave the file out there...
1705 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1706 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1707 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1708 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1709 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1712 : Some greps do not return status, grrr.
1713 echo "grimblepritz" >grimble
1714 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1716 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1722 : the following should work in any shell
1726 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1727 cat >contains <<'EOSS'
1728 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1733 : Find the path to the source tree
1736 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1740 *) src=`cd ../$src && pwd` ;;
1753 if test -f $rsrc/Configure && \
1754 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1756 : found it, so we are ok.
1759 for src in . .. ../.. ../../.. ../../../..; do
1760 if test -f ../$src/Configure && \
1761 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1772 Sorry, I can't seem to locate the source dir for $package. Please start
1773 Configure with an explicit path -- i.e. /some/path/Configure.
1781 echo "Sources for $package found in \"$src\"." >&4
1785 : script used to extract .SH files with variable substitutions
1786 cat >extract <<'EOS'
1788 echo "Doing variable substitutions on .SH files..."
1789 if test -f MANIFEST; then
1790 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1792 echo "(Looking for .SH files under the source directory.)"
1793 set x `(cd "$src"; find . -name "*.SH" -print)`
1797 0) set x `(cd "$src"; echo *.SH)`; shift;;
1799 if test ! -f "$src/$1"; then
1805 while test $name; do
1806 if test ! -d "$name"; then
1807 create="$name $create";
1808 name=`echo $name | sed -e "s|^[^/]*$||"`;
1809 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1814 for file in $create; do
1823 dir=`expr X$file : 'X\(.*\)/'`
1824 file=`expr X$file : 'X.*/\(.*\)'`
1825 (cd "$dir" && . ./$file)
1835 dir=`expr X$file : 'X\(.*\)/'`
1836 file=`expr X$file : 'X.*/\(.*\)'`
1837 (set x $dir; shift; eval $mkdir_p)
1838 sh <"$src/$dir/$file"
1847 if test -f "$src/config_h.SH"; then
1848 if test ! -f config.h; then
1849 : oops, they left it out of MANIFEST, probably, so do it anyway.
1850 . "$src/config_h.SH"
1855 : extract files and exit if asked to do so
1856 case "$extractsh" in
1858 case "$realsilent" in
1862 case "$config_sh" in
1863 '') config_sh='config.sh';;
1866 echo "Fetching answers from $config_sh..."
1869 test "$override" && . ./optdef.sh
1873 echo "Extraction done."
1878 : Eunice requires " " instead of "", can you believe it
1881 echo "Beginning of configuration questions for $package."
1883 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1885 : first determine how to suppress newline on echo command
1887 echo "Checking echo to see how to suppress newlines..."
1888 (echo "hi there\c" ; echo " ") >.echotmp
1889 if $contains c .echotmp >/dev/null 2>&1 ; then
1900 echo $n "The star should be here-->$c"
1904 : Now test for existence of everything in MANIFEST
1906 if test -f "$rsrc/MANIFEST"; then
1907 echo "First let's make sure your kit is complete. Checking..." >&4
1908 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1911 for filelist in x??; do
1912 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1914 if test -s missing; then
1918 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1920 You have the option of continuing the configuration process, despite the
1921 distinct possibility that your kit is damaged, by typing 'y'es. If you
1922 do, don't blame me if something goes wrong. I advise you to type 'n'o
1923 and contact the author (perlbug@perl.org).
1926 echo $n "Continue? [n] $c" >&4
1930 echo "Continuing..." >&4
1934 echo "ABORTING..." >&4
1939 echo "Looks good..."
1942 echo "There is no MANIFEST file. I hope your kit is complete !"
1947 : Find the appropriate value for a newline for tr
1948 if test -n "$DJGPP"; then
1951 if test X"$trnl" = X; then
1952 case "`echo foo|tr '\n' x 2>/dev/null`" in
1956 if test X"$trnl" = X; then
1957 case "`echo foo|tr '\012' x 2>/dev/null`" in
1958 foox) trnl='\012' ;;
1961 if test X"$trnl" = X; then
1962 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1963 fooxy) trnl='\n\r' ;;
1966 if test X"$trnl" = X; then
1969 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1975 : compute the number of columns on the terminal for proper question formatting
1980 : set up the echo used in my read
1981 myecho="case \"\$xxxm\" in
1982 '') echo $n \"\$rp $c\" >&4;;
1984 '') echo $n \"[\$xxxm] $c\";;
1986 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1988 echo $n \"[\$xxxm] $c\" >&4
1990 echo $n \"\$rp [\$xxxm] $c\" >&4
1996 : now set up to do reads with possible shell escape and default assignment
2002 case "\$fastread" in
2003 yes) case "\$dflt" in
2006 case "\$silent-\$rp" in
2011 *) case "\$silent" in
2012 true) case "\$rp" in
2017 while expr "X\$ans" : "X!" >/dev/null; do
2021 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2029 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2038 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2043 echo "(OK, I'll run with -d after this question.)" >&4
2046 echo "*** Sorry, \$1 not supported yet." >&4
2056 echo "*** Substitution done -- please confirm."
2058 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2063 echo "*** Error -- try again."
2070 case "\$ans\$xxxm\$nostick" in
2082 : create .config dir to save info across Configure sessions
2083 test -d ../.config || mkdir ../.config
2084 cat >../.config/README <<EOF
2085 This directory created by Configure to save information that should
2086 persist across sessions for $package.
2088 You may safely delete it if you wish.
2091 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2093 $define|true|[yY]*) ;;
2094 *) case "$xversion" in
2097 *** WHOA THERE!!! ***
2099 This is an UNSTABLE DEVELOPMENT release.
2100 The version of this $package distribution is $xversion, that is, odd,
2101 (as opposed to even) and that signifies a development release.
2102 If you want a maintenance release, you want an even-numbered version.
2104 Do ***NOT*** install this into production use.
2105 Data corruption and crashes are possible.
2107 It is most seriously suggested that you do not continue any further
2108 unless you want to help in developing and debugging Perl.
2110 If you *still* want to build perl, you can answer 'y' now,
2111 or pass -Dusedevel to Configure.
2114 rp='Do you really want to continue?'
2118 [yY]) echo >&4 "Okay, continuing."
2119 usedevel="$define" ;;
2120 *) echo >&4 "Okay, bye."
2130 case "$versiononly" in
2131 '') versiononly="$define" ;;
2133 case "$installusrbinperl" in
2134 '') installusrbinperl="$undef" ;;
2139 : general instructions
2142 user=`(logname) 2>/dev/null`
2144 '') user=`whoami 2>&1`;;
2146 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2149 rp='Would you like to see the instructions?'
2160 This installation shell script will examine your system and ask you questions
2161 to determine how the perl5 package should be installed. If you get
2162 stuck on a question, you may use a ! shell escape to start a subshell or
2163 execute a command. Many of the questions will have default answers in square
2164 brackets; typing carriage return will give you the default.
2166 On some of the questions which ask for file or directory names you are allowed
2167 to use the ~name construct to specify the login directory belonging to "name",
2168 even if you don't have a shell which knows about that. Questions where this is
2169 allowed will be marked "(~name ok)".
2173 dflt='Type carriage return to continue'
2177 The prompter used in this script allows you to use shell variables and
2178 backticks in your answers. You may use $1, $2, etc... to refer to the words
2179 in the default answer, as if the default line was a set of arguments given to a
2180 script shell. This means you may also use $* to repeat the whole default line,
2181 so you do not have to re-type everything to add something to the default.
2183 Everytime there is a substitution, you will have to confirm. If there is an
2184 error (e.g. an unmatched backtick), the default answer will remain unchanged
2185 and you will be prompted again.
2187 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2188 the questions and use the computed defaults (or the previous answers if there
2189 was already a config.sh file). Type 'Configure -h' for a list of options.
2190 You may also start interactively and then answer '& -d' at any prompt to turn
2191 on the non-interactive behaviour for the remainder of the execution.
2197 Much effort has been expended to ensure that this shell script will run on any
2198 Unix system. If despite that it blows up on yours, your best bet is to edit
2199 Configure and run it again. If you can't run Configure for some reason,
2200 you'll have to generate a config.sh file by hand. Whatever problems you
2201 have, let me (perlbug@perl.org) know how I blew it.
2203 This installation script affects things in two ways:
2205 1) it may do direct variable substitutions on some of the files included
2207 2) it builds a config.h file for inclusion in C programs. You may edit
2208 any of these files as the need arises after running this script.
2210 If you make a mistake on a question, there is no easy way to back up to it
2211 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2212 files. Configure will offer to let you do this before it runs the SH files.
2215 dflt='Type carriage return to continue'
2217 case "$firsttime" in
2218 true) echo $user >>../.config/instruct;;
2222 : find out where common programs are
2224 echo "Locating common programs..." >&4
2237 if test -d \$dir/\$thing; then
2243 for thisthing in \$dir/\$thing; do
2244 : just loop through to pick last item
2246 if test -f \$thisthing; then
2249 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2252 elif test -f \$dir/\$thing.exe; then
2253 if test -n "$DJGPP"; then
2254 echo \$dir/\$thing.exe
2255 elif test "$eunicefix" != ":"; then
2256 : on Eunice apparently
2310 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2311 pth="$pth /lib /usr/lib"
2312 for file in $loclist; do
2316 if test -f "$xxx"; then
2319 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2320 xxx=`./loc $file $file $pth`
2323 '') xxx=`./loc $file $file $pth`;;
2324 *) xxx=`./loc $xxx $xxx $pth`;;
2326 eval $file=$xxx$_exe
2330 echo $file is in $xxx.
2333 echo $file is in $xxx.
2336 echo "I don't know where '$file' is, and my life depends on it." >&4
2337 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2343 echo "Don't worry if any of the following aren't found..."
2345 for file in $trylist; 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 see $file out there, $say."
2376 echo "Substituting grep for egrep."
2383 echo "Substituting cp for ln."
2392 echo "I can't find make or gmake, and my life depends on it." >&4
2393 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2401 *) # We can't have osname yet.
2402 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2403 # Assume that gmake, if found, is definitely GNU make
2404 # and prefer it over the system make.
2405 echo "Substituting gmake for make."
2413 echo "Hopefully test is built into your sh."
2416 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2417 echo "Using the test built into your sh."
2425 echo "Hopefully echo is built into your sh."
2430 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2431 $echo $n "hi there$c" >foo1
2432 echo $n "hi there$c" >foo2
2433 if cmp foo1 foo2 >/dev/null 2>&1; then
2434 echo "They are compatible. In fact, they may be identical."
2441 They are not compatible! You are probably running ksh on a non-USG system.
2442 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2443 have echo built in and we may have to run some Bourne shell scripts. That
2444 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2447 $echo $n "The star should be here-->$c"
2457 cat <<'EOSC' >>trygcc
2462 int main(int argc, char *argv[]) {
2466 if $cc -o try $ccflags $ldflags try.c; then
2469 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2475 case "`$cc -v -c try.c 2>&1`" in
2478 if $test X"$trygcc" = Xyes; then
2479 if gcc -o try -c try.c; then
2481 echo "You seem to have a working gcc, though." >&4
2482 rp="Would you like to use it?"
2484 if $test -f myread; then
2487 if $test -f UU/myread; then
2490 echo "Cannot find myread, sorry. Aborting." >&2
2495 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2496 if $test -f usethreads.cbu; then
2499 *** However, any setting of the C compiler flags (e.g. for thread support)
2500 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2501 *** (together with e.g. -Dusethreads).
2517 cat <<'EOSC' >>checkcc
2522 int main(int argc, char *argv[]) {
2526 if $cc -o try $ccflags $ldflags try.c; then
2529 if $test X"$despair" = Xyes; then
2530 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2533 You need to find a working C compiler.
2534 Either (purchase and) install the C compiler supplied by your OS vendor,
2535 or for a free C compiler try http://gcc.gnu.org/
2536 I cannot continue any further, aborting.
2545 : determine whether symbolic links are supported
2548 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2549 echo "Symbolic links are supported." >&4
2552 echo "Symbolic links are NOT supported." >&4
2557 : determine whether symbolic links are supported
2561 echo "Checking how to test for symbolic links..." >&4
2563 if $test "X$issymlink" = X; then
2565 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2566 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2568 if test $? = 0; then
2571 echo "Your builtin 'test -h' may be broken." >&4
2574 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2577 if test -f "$p/$test"; then
2586 echo "Trying external '$test -h'." >&4
2587 issymlink="$test -h"
2588 if $test ! -h sym >/dev/null 2>&1; then
2589 echo "External '$test -h' is broken, too." >&4
2597 if $test "X$issymlink" = X; then
2598 if $test -L sym 2>/dev/null; then
2599 issymlink="$test -L"
2600 echo "The builtin '$test -L' worked." >&4
2603 if $test "X$issymlink" != X; then
2604 echo "You can test for symbolic links with '$issymlink'." >&4
2606 echo "I do not know how you can test for symbolic links." >&4
2610 *) echo "No symbolic links, so not testing for their testing..." >&4
2616 case "$mksymlinks" in
2619 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2622 *) case "$lns:$issymlink" in
2623 *"ln"*" -s:"*"test -"?)
2624 echo "Creating the symbolic links..." >&4
2625 echo "(First creating the subdirectories...)" >&4
2627 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2629 test -z "$directory" && break
2633 if test ! -d t/base; then
2634 echo "Failed to create the subdirectories. Aborting." >&4
2637 echo "(Then creating the symlinks...)" >&4
2638 awk '{print $1}' $src/MANIFEST | while true; do
2640 test -z "$filename" && break
2641 if test -f $filename; then
2642 if $issymlink $filename; then
2646 if test -f $filename; then
2647 echo "$filename already exists, not symlinking."
2649 ln -s $src/$filename $filename
2653 if test ! -f t/base/lex.t; then
2654 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2659 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2668 case "$usecrosscompile" in
2670 $echo "Cross-compiling..."
2673 *-*-gcc) # A cross-compiling gcc, probably.
2674 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2676 # leave out ld, choosing it is more complex
2678 ranlib=$targetarch-ranlib
2679 $echo 'extern int foo;' > try.c
2680 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2682 if $test $# -gt 0; then
2684 incpth="`$echo $incpth|$sed 's/^ //'`"
2685 echo "Guessing incpth '$incpth'." >&4
2687 j="`$echo $i|$sed 's,/include$,/lib,'`"
2688 if $test -d $j; then
2692 libpth="`$echo $libpth|$sed 's/^ //'`"
2693 echo "Guessing libpth '$libpth'." >&4
2698 case "$targetarch" in
2699 '') echo "Targetarch not defined." >&4; croak=y ;;
2700 *) echo "Using targetarch $targetarch." >&4 ;;
2703 '') echo "Incpth not defined." >&4; croak=y ;;
2704 *) echo "Using incpth '$incpth'." >&4 ;;
2707 '') echo "Libpth not defined." >&4; croak=y ;;
2708 *) echo "Using libpth '$libpth'." >&4 ;;
2711 '') for i in $incpth; do
2712 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2714 echo "Guessing usrinc $usrinc." >&4
2719 '') echo "Usrinc not defined." >&4; croak=y ;;
2722 *) echo "Using usrinc $usrinc." >&4 ;;
2724 case "$targethost" in
2725 '') echo "Targethost not defined." >&4; croak=y ;;
2726 *) echo "Using targethost $targethost." >&4
2731 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2734 /*) run=$src/Cross/run
2735 targetmkdir=$src/Cross/mkdir
2737 from=$src/Cross/from
2739 *) pwd=`$test -f ../Configure & cd ..; pwd`
2741 targetmkdir=$pwd/Cross/mkdir
2743 from=$pwd/Cross/from
2746 case "$targetrun" in
2747 '') targetrun=ssh ;;
2752 case "$targetfrom" in
2753 '') targetfrom=scp ;;
2757 from=$from-$targetfrom
2758 case "$targetdir" in
2760 echo "Guessing targetdir $targetdir." >&4
2763 case "$targetuser" in
2765 echo "Guessing targetuser $targetuser." >&4
2768 case "$targetfrom" in
2772 case "$targetrun" in
2784 '') cwd=$targetdir ;;
2788 if $test ! -f \$exe.xok; then
2792 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2795 *) echo "Unknown targetrun '$targetrun'" >&4
2799 case "$targetmkdir" in
2801 cat >$targetmkdir <<EOF
2803 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2805 $chmod a+rx $targetmkdir
2807 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2819 $targetmkdir \`dirname \$f\`
2820 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2823 $targetmkdir $targetdir/\`dirname \$f\`
2824 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2837 $mkdir -p $targetdir/\`dirname \$f\`
2838 $cp \$f $targetdir/\$f || exit 1
2841 $targetmkdir $targetdir/\`dirname \$f\`
2842 $cp \$f $targetdir/\$f || exit 1
2849 *) echo "Unknown targetto '$targetto'" >&4
2853 case "$targetfrom" in
2860 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2865 cp) cat >$from <<EOF
2870 cp $targetdir/\$f . || exit 1
2875 *) echo "Unknown targetfrom '$targetfrom'" >&4
2879 if $test ! -f $run; then
2880 echo "Target 'run' script '$run' not found." >&4
2884 if $test ! -f $to; then
2885 echo "Target 'to' script '$to' not found." >&4
2889 if $test ! -f $from; then
2890 echo "Target 'from' script '$from' not found." >&4
2894 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2898 Using '$run' for remote execution,
2899 and '$from' and '$to'
2900 for remote file transfer.
2906 usecrosscompile='undef'
2911 : see whether [:lower:] and [:upper:] are supported character classes
2913 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2915 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2919 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2920 # (0xd9 and 0xe2), therefore that is a nice testing point.
2921 if test "X$up" = X -o "X$low" = X; then
2922 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2928 if test "X$up" = X -o "X$low" = X; then
2929 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2935 if test "X$up" = X -o "X$low" = X; then
2936 case "`echo RS | od -x 2>/dev/null`" in
2938 echo "Hey, this might be EBCDIC." >&4
2939 if test "X$up" = X -o "X$low" = X; then
2940 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2941 rs) up='[A-IJ-RS-Z]'
2946 if test "X$up" = X -o "X$low" = X; then
2947 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2957 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2959 echo "Using $up and $low to convert case." >&4
2962 echo "I don't know how to translate letters from upper to lower case." >&4
2963 echo "Your tr is not acting any way I know of." >&4
2967 : set up the translation script tr, must be called with ./tr of course
2971 '[A-Z][a-z]') exec $tr '$up' '$low';;
2972 '[a-z][A-Z]') exec $tr '$low' '$up';;
2979 : Try to determine whether config.sh was made on this system
2980 case "$config_sh" in
2982 myuname=`$uname -a 2>/dev/null`
2983 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2984 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2985 # because the A-Z/a-z are not consecutive.
2986 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2987 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2988 newmyuname="$myuname"
2990 case "$knowitall" in
2992 if test -f ../config.sh; then
2993 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2994 eval "`grep myuname= ../config.sh`"
2996 if test "X$myuname" = "X$newmyuname"; then
3004 : Get old answers from old config file if Configure was run on the
3005 : same system, otherwise use the hints.
3008 if test -f config.sh; then
3010 rp="I see a config.sh file. Shall I use it to set the defaults?"
3013 n*|N*) echo "OK, I'll ignore it."
3014 mv config.sh config.sh.old
3015 myuname="$newmyuname"
3017 *) echo "Fetching default answers from your old config.sh file..." >&4
3025 : Older versions did not always set $sh. Catch re-use of such
3035 if test ! -f config.sh; then
3038 First time through, eh? I have some defaults handy for some systems
3039 that need some extra help getting the Configure answers right:
3042 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3044 : Half the following guesses are probably wrong... If you have better
3045 : tests or hints, please send them to perlbug@perl.org
3046 : The metaconfig authors would also appreciate a copy...
3047 $test -f /irix && osname=irix
3048 $test -f /xenix && osname=sco_xenix
3049 $test -f /dynix && osname=dynix
3050 $test -f /dnix && osname=dnix
3051 $test -f /lynx.os && osname=lynxos
3052 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3053 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3054 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3055 $test -f /bin/mips && /bin/mips && osname=mips
3056 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3057 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3058 $test -d /usr/apollo/bin && osname=apollo
3059 $test -f /etc/saf/_sactab && osname=svr4
3060 $test -d /usr/include/minix && osname=minix
3061 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3062 if $test -d /MachTen -o -d /MachTen_Folder; then
3064 if $test -x /sbin/version; then
3065 osvers=`/sbin/version | $awk '{print $2}' |
3066 $sed -e 's/[A-Za-z]$//'`
3067 elif $test -x /usr/etc/version; then
3068 osvers=`/usr/etc/version | $awk '{print $2}' |
3069 $sed -e 's/[A-Za-z]$//'`
3075 $test -f /sys/posix.dll &&
3076 $test -f /usr/bin/what &&
3077 set X `/usr/bin/what /sys/posix.dll` &&
3078 $test "$3" = UWIN &&
3082 if $test -f $uname; then
3090 umips) osname=umips ;;
3093 [23]100) osname=mips ;;
3094 next*) osname=next ;;
3096 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3097 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3100 elif $test -f /etc/kconfig; then
3102 if test "$lns" = "$ln -s"; then
3104 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3106 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3113 if test -n "$DJGPP"; then
3122 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3124 # oslevel can fail with:
3125 # oslevel: Unable to acquire lock.
3126 *not\ found) osvers="$4"."$3" ;;
3127 '<3240'|'<>3240') osvers=3.2.0 ;;
3128 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3129 '=3250'|'>3250') osvers=3.2.5 ;;
3133 bsd386) osname=bsd386
3136 cygwin*) osname=cygwin
3139 *dc.osx) osname=dcosx
3145 domainos) osname=apollo
3151 dragonfly) osname=dragonfly
3154 dynixptx*) osname=dynixptx
3155 osvers=`echo "$4"|sed 's/^v//'`
3157 freebsd) osname=freebsd
3159 genix) osname=genix ;;
3163 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3179 netbsd*) osname=netbsd
3182 news-os) osvers="$3"
3184 4*) osname=newsos4 ;;
3188 next*) osname=next ;;
3189 nonstop-ux) osname=nonstopux ;;
3190 openbsd) osname=openbsd
3196 POSIX-BC | posix-bc ) osname=posix-bc
3199 powerux | power_ux | powermax_os | powermaxos | \
3200 powerunix | power_unix) osname=powerux
3206 solaris) osname=solaris
3208 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3215 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3219 titanos) osname=titanos
3228 ultrix) osname=ultrix
3231 osf1|mls+) case "$5" in
3234 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3237 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3240 hp*) osname=hp_osf1 ;;
3241 mips) osname=mips_osf1 ;;
3244 # UnixWare 7.1.2 is known as Open UNIX 8
3245 openunix|unixware) osname=svr5
3253 $2) case "$osname" in
3257 : svr4.x or possibly later
3267 if test -f /stand/boot ; then
3268 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3269 if test -n "$INITPROG" -a -f "$INITPROG"; then
3270 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3271 if test -n "$isesix"; then
3279 *) if test -f /etc/systemid; then
3281 set `echo $3 | $sed 's/\./ /g'` $4
3282 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3284 elif $test -f $src/hints/sco_$1_$2.sh; then
3286 elif $test -f $src/hints/sco_$1.sh; then
3291 '') : Still unknown. Probably a generic Sys V.
3300 *) case "$osname" in
3301 '') : Still unknown. Probably a generic BSD.
3309 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3310 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3311 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3314 $rm -f UU/kernel.what
3315 elif test -d c:/. -o -n "$is_os2" ; then
3322 case "$targetarch" in
3325 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3330 : Now look for a hint file osname_osvers, unless one has been
3331 : specified already.
3334 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3335 : Also try without trailing minor version numbers.
3336 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3337 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3338 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3339 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3342 *) case "$osvers" in
3345 *) if $test -f $src/hints/$file.sh ; then
3347 elif $test -f $src/hints/$xfile.sh ; then
3349 elif $test -f $src/hints/$xxfile.sh ; then
3351 elif $test -f $src/hints/$xxxfile.sh ; then
3353 elif $test -f $src/hints/$xxxxfile.sh ; then
3355 elif $test -f "$src/hints/${osname}.sh" ; then
3364 if $test -f Policy.sh ; then
3367 none) dflt="Policy" ;;
3368 *) dflt="Policy $dflt" ;;
3373 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3377 if $test -f Policy.sh ; then
3380 There's also a Policy hint file available, which should make the
3381 site-specific (policy) questions easier to answer.
3388 You may give one or more space-separated answers, or "none" if appropriate.
3389 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3390 previous run of Configure, you may specify it as well as or instead of
3391 OS-specific hints. If hints are provided for your OS, you should use them:
3392 although Perl can probably be built without hints on many platforms, using
3393 hints often improve performance and may enable features that Configure can't
3394 set up on its own. If there are no hints that match your OS, specify "none";
3395 DO NOT give a wrong version or a wrong OS.
3399 rp="Which of these apply, if any?"
3402 for file in $tans; do
3403 if $test X$file = XPolicy -a -f Policy.sh; then
3405 $cat Policy.sh >> UU/config.sh
3406 elif $test -f $src/hints/$file.sh; then
3407 . $src/hints/$file.sh
3408 $cat $src/hints/$file.sh >> UU/config.sh
3409 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3412 : Give one chance to correct a possible typo.
3413 echo "$file.sh does not exist"
3415 rp="hint to use instead?"
3417 for file in $ans; do
3418 if $test -f "$src/hints/$file.sh"; then
3419 . $src/hints/$file.sh
3420 $cat $src/hints/$file.sh >> UU/config.sh
3421 elif $test X$ans = X -o X$ans = Xnone ; then
3424 echo "$file.sh does not exist -- ignored."
3431 : Remember our hint file for later.
3432 if $test -f "$src/hints/$file.sh" ; then
3442 echo "Fetching default answers from $config_sh..." >&4
3446 cp $config_sh config.sh 2>/dev/null
3456 test "$override" && . ./optdef.sh
3458 : Restore computed paths
3459 for file in $loclist $trylist; do
3460 eval $file="\$_$file"
3465 Configure uses the operating system name and version to set some defaults.
3466 The default value is probably right if the name rings a bell. Otherwise,
3467 since spelling matters for me, either accept the default or answer "none"
3474 ''|' '|none) dflt=none ;;
3475 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3478 *) dflt="$osname" ;;
3480 rp="Operating system name?"
3484 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3490 ''|' '|none) dflt=none ;;
3491 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3492 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3494 ''|' ') dflt=none ;;
3499 *) dflt="$osvers" ;;
3501 rp="Operating system version?"
3511 : who configured the system
3512 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3515 cf_by=`(logname) 2>/dev/null`
3518 cf_by=`(whoami) 2>/dev/null`
3520 "") cf_by=unknown ;;
3525 : decide how portable to be. Allow command line overrides.
3526 case "$d_portable" in
3528 *) d_portable="$define" ;;
3531 : set up shell script to do ~ expansion
3537 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3540 if $test -f /bin/csh; then
3541 /bin/csh -f -c "glob \$1"
3546 name=\`$expr x\$1 : '..\([^/]*\)'\`
3547 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3548 if $test ! -d "\$dir"; then
3550 echo "\$me: can't locate home directory for: \$name" >&2
3555 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3571 : now set up to get a file name
3575 cat <<'EOSC' >>getfile
3591 : getfile will accept an answer from the comma-separated list
3592 : enclosed in parentheses even if it does not meet other criteria.
3593 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3594 fn=`echo $fn | sed 's/(.*)//'`
3600 loc_file=`expr $fn : '.*:\(.*\)'`
3601 fn=`expr $fn : '\(.*\):.*'`
3609 */*) fullpath=true;;
3618 *e*) exp_file=true;;
3621 *p*) nopath_ok=true;;
3626 *d*) type='Directory';;
3627 *l*) type='Locate';;
3632 Locate) what='File';;
3637 case "$d_portable" in
3645 while test "$type"; do
3650 true) rp="$rp (~name ok)";;
3653 if test -f UU/getfile.ok && \
3654 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3673 value=`UU/filexp $ans`
3676 if test "$ans" != "$value"; then
3677 echo "(That expands to $value on this system.)"
3691 /*) value="$ansexp" ;;
3692 [a-zA-Z]:/*) value="$ansexp" ;;
3697 echo "I shall only accept a full path name, as in /bin/ls." >&4
3698 echo "Use a ! shell escape if you wish to check pathnames." >&4
3701 echo "Please give a full path name, starting with slash." >&4
3704 echo "Note that using ~name is ok provided it expands well." >&4
3717 for fp in $gfpth; do
3718 if test "X$fp" = X.; then
3723 if test -f "$pf"; then
3725 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3727 echo "($value is not a plain file, but that's ok.)"
3730 if test X"$type" = X; then
3737 for fp in $gfpth; do
3738 if test "X$fp" = X.; then
3743 direxp="$fp/$ansexp"
3745 if test -d "$direxp"; then
3753 if test -d "$ansexp"; then
3754 echo "(Looking for $loc_file in directory $value.)"
3755 value="$value/$loc_file"
3756 ansexp="$ansexp/$loc_file"
3758 if test -f "$ansexp"; then
3761 case "$nopath_ok" in
3762 true) case "$value" in
3764 *) echo "Assuming $value will be in people's path."
3780 if test "$fastread" = yes; then
3785 rp="$what $value doesn't exist. Use that name anyway?"
3804 test "X$gfpthkeep" != Xy && gfpth=""
3807 : determine root of directory hierarchy where package will be installed.
3810 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3813 dflt=`echo "$prefix" | sed 's/.$//'`
3821 By default, $package will be installed in $dflt/bin, manual pages
3822 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3823 installation directories. Typically this is something like /usr/local.
3824 If you wish to have binaries under /usr/bin but other parts of the
3825 installation under /usr/local, that's ok: you will be prompted
3826 separately for each of the installation directories, the prefix being
3827 only used to set the defaults.
3831 rp='Installation prefix to use?'
3839 *) oldprefix="$prefix";;
3848 *) afsroot=$afsroot ;;
3854 $define|true) afs=true ;;
3855 $undef|false) afs=false ;;
3856 *) if test -d $afsroot; then
3864 echo "AFS may be running... I'll be extra cautious then..." >&4
3866 echo "AFS does not seem to be running..." >&4
3869 : determine installation prefix for where package is to be installed.
3873 Since you are running AFS, I need to distinguish the directory in which
3874 files will reside from the directory in which they are installed (and from
3875 which they are presumably copied to the former directory by occult means).
3878 case "$installprefix" in
3879 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3880 *) dflt="$installprefix";;
3885 In some special cases, particularly when building $package for distribution,
3886 it is convenient to distinguish the directory in which files should be
3887 installed from the directory ($prefix) in which they will
3888 eventually reside. For most users, these two directories are the same.
3891 case "$installprefix" in
3893 *) dflt=$installprefix;;
3897 rp='What installation prefix should I use for installing files?'
3899 installprefix="$ans"
3900 installprefixexp="$ansexp"
3902 : Perform the prefixexp/installprefixexp correction if necessary
3903 cat <<EOS >installprefix
3906 cat <<'EOSC' >>installprefix
3907 : Change installation prefix, if necessary.
3908 if $test X"$prefix" != X"$installprefix"; then
3909 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3911 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3914 chmod +x installprefix
3915 $eunicefix installprefix
3917 : Set variables such as privlib and privlibexp from the output of ./getfile
3918 : performing the prefixexp/installprefixexp correction if necessary.
3919 cat <<EOS >setprefixvar
3922 cat <<'EOSC' >>setprefixvar
3923 eval "${prefixvar}=\"\$ans\""
3924 eval "${prefixvar}exp=\"\$ansexp\""
3927 chmod +x setprefixvar
3928 $eunicefix setprefixvar
3930 : set up the script used to warn in case of inconsistency
3937 echo "*** WHOA THERE!!! ***" >&4
3938 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3939 rp=" Keep the $hint value?"
3942 y) td=$was; tu=$was;;
3946 : function used to set $1 to $val
3947 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3949 $define$undef) . ./whoa; eval "$var=\$td";;
3950 $undef$define) . ./whoa; eval "$var=\$tu";;
3951 *) eval "$var=$val";;
3955 $define|true|[yY]*) dflt='y';;
3960 Perl can be built to use the SOCKS proxy protocol library. To do so,
3961 Configure must be run with -Dusesocks. If you use SOCKS you also need
3962 to use the PerlIO abstraction layer, this will be implicitly selected.
3964 If this doesn't make any sense to you, just accept the default '$dflt'.
3966 rp='Build Perl for SOCKS?'
3969 y|Y) val="$define" ;;
3976 $define|true|[yY]*) useperlio="$define";;
3979 case "$useperlio" in
3980 $define|true|[yY]*|'') dflt='y';;
3985 Previous version of $package used the standard IO mechanisms as
3986 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3987 alternate IO mechanisms via the PerlIO abstraction layer, but the
3988 stdio mechanism is still available if needed. The abstraction layer
3989 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3990 Using PerlIO with sfio may cause problems with some extension modules.
3992 If this doesn't make any sense to you, just accept the default '$dflt'.
3994 rp='Use the PerlIO abstraction layer?'
4001 echo "Ok, doing things the stdio way."
4010 case "$useperlio" in
4011 $define|true|[yY]*) ;;
4014 You are using the SOCKS proxy protocol library which means that you
4015 should also use the PerlIO layer. You may be headed for trouble.
4024 case "$usethreads" in
4025 $define|true|[yY]*) dflt='y';;
4026 *) # Catch case where user specified ithreads or 5005threads but
4027 # forgot -Dusethreads (A.D. 4/2002)
4028 case "$useithreads$use5005threads" in
4030 case "$useperlio" in
4031 "$define") dflt='y' ;;
4041 Perl can be built to take advantage of threads on some systems.
4042 To do so, Configure can be run with -Dusethreads.
4044 Note that Perl built with threading support runs slightly slower
4045 and uses more memory than plain Perl. The current implementation
4046 is believed to be stable, but it is fairly new, and so should be
4047 treated with caution.
4049 If this doesn't make any sense to you, just accept the default '$dflt'.
4051 rp='Build a threading Perl?'
4054 y|Y) val="$define" ;;
4060 case "$usethreads" in
4064 Since release 5.6, Perl has had two different threading implementations,
4065 the newer interpreter-based version (ithreads) with one interpreter per
4066 thread, and the older 5.005 version (5005threads).
4067 The 5005threads version is effectively unmaintained and will probably be
4068 removed in Perl 5.10, so there should be no need to build a Perl using it
4069 unless needed for backwards compatibility with some existing 5.005threads
4073 : Default to ithreads unless overridden on command line or with
4076 case "$use5005threads" in
4077 $define|true|[yY]*) dflt='n';;
4079 case "$useithreads" in
4080 $undef|false|[nN]*) dflt='n';;
4082 rp='Use the newer interpreter-based ithreads?'
4085 y|Y) val="$define" ;;
4090 : Now set use5005threads to the opposite value.
4091 case "$useithreads" in
4092 $define) val="$undef" ;;
4099 useithreads="$undef"
4100 use5005threads="$undef"
4104 case "$useithreads$use5005threads" in
4108 You cannot have both the ithreads and the 5.005 threads enabled
4109 at the same time. Disabling the 5.005 threads since they are
4110 much less stable than the ithreads.
4113 use5005threads="$undef"
4117 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4120 *** To build with ithreads you must also use the PerlIO layer.
4121 *** Cannot continue, aborting.
4127 case "$d_oldpthreads" in
4128 '') : Configure tests would be welcome here. For now, assume undef.
4130 *) val="$d_oldpthreads" ;;
4136 : Look for a hint-file generated 'call-back-unit'. If the
4137 : user has specified that a threading perl is to be built,
4138 : we may need to set or change some other defaults.
4139 if $test -f usethreads.cbu; then
4140 echo "Your platform has some specific hints regarding threaded builds, using them..."
4143 case "$usethreads" in
4144 "$define"|true|[yY]*)
4146 (Your platform does not have any specific hints for threaded builds.
4147 Assuming POSIX threads, then.)
4155 Perl can be built so that multiple Perl interpreters can coexist
4156 within the same Perl executable.
4159 case "$useithreads" in
4162 This multiple interpreter support is required for interpreter-based threads.
4166 *) case "$usemultiplicity" in
4167 $define|true|[yY]*) dflt='y';;
4171 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4172 rp='Build Perl for multiplicity?'
4175 y|Y) val="$define" ;;
4184 case "$usemorebits" in
4185 "$define"|true|[yY]*)
4186 use64bitint="$define"
4187 uselongdouble="$define"
4188 usemorebits="$define"
4190 *) usemorebits="$undef"
4194 : make some quick guesses about what we are up against
4196 $echo $n "Hmm... $c"
4206 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4207 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4209 echo "Looks kind of like an OSF/1 system, but we'll see..."
4211 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4212 xxx=`./loc addbib blurfl $pth`
4213 if $test -f $xxx; then
4214 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4218 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4219 echo "Looks kind of like an extended USG system, but we'll see..."
4221 echo "Looks kind of like a USG system, but we'll see..."
4225 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4226 echo "Looks kind of like a BSD system, but we'll see..."
4230 echo "Looks kind of like a Version 7 system, but we'll see..."
4233 case "$eunicefix" in
4236 There is, however, a strange, musty smell in the air that reminds me of
4237 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4241 : it so happens the Eunice I know will not run shell scripts in Unix format
4245 echo "Congratulations. You aren't running Eunice."
4249 : Detect OS2. The p_ variable is set above in the Head.U unit.
4250 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4251 : semicolon as a patch separator
4256 I have the feeling something is not exactly right, however...don't tell me...
4257 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4258 (Or you may be running DOS with DJGPP.)
4263 if test -f /xenix; then
4264 echo "Actually, this looks more like a XENIX system..."
4269 echo "It's not Xenix..."
4274 if test -f /venix; then
4275 echo "Actually, this looks more like a VENIX system..."
4282 echo "Nor is it Venix..."
4285 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4286 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4293 rp="Use which C compiler?"
4297 : See if they have not cc but they do have gcc
4299 : Look for a hint-file generated 'call-back-unit'. Now that the
4300 : user has specified the compiler, we may need to set or change some
4302 if $test -f cc.cbu; then
4308 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4312 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4314 printf("%s\n", __VERSION__);
4316 printf("%s\n", "1");
4322 if $cc -o try $ccflags $ldflags try.c; then
4323 gccversion=`$run ./try`
4324 case "$gccversion" in
4325 '') echo "You are not using GNU cc." ;;
4326 *) echo "You are using GNU cc $gccversion."
4332 echo "*** WHOA THERE!!! ***" >&4
4333 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4334 case "$knowitall" in
4336 echo " You'd better start hunting for one and let me know about it." >&4
4342 case "$gccversion" in
4343 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4345 case "$gccversion" in
4346 '') gccosandvers='' ;;
4347 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4348 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4350 case "$gccosandvers" in
4351 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4352 $osname$osvers) ;; # looking good
4353 $osname*) cat <<EOM >&4
4355 *** WHOA THERE!!! ***
4357 Your gcc has not been compiled for the exact release of
4358 your operating system ($gccosandvers versus $osname$osvers).
4360 In general it is a good idea to keep gcc synchronized with
4361 the operating system because otherwise serious problems
4362 may ensue when trying to compile software, like Perl.
4364 I'm trying to be optimistic here, though, and will continue.
4365 If later during the configuration and build icky compilation
4366 problems appear (headerfile conflicts being the most common
4367 manifestation), I suggest reinstalling the gcc to match
4368 your operating system release.
4372 *) gccosandvers='' ;; # failed to parse, better be silent
4380 # gcc 3.* complain about adding -Idirectories that they already know about,
4381 # so we will take those off from locincpth.
4382 case "$gccversion" in
4384 echo "main(){}">try.c
4385 for incdir in $locincpth; do
4386 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4387 grep '^c[cp]p*[01]: warning: changing search order '`
4388 if test "X$warn" != X; then
4389 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4395 : What should the include directory be ?
4397 $echo $n "Hmm... $c"
4401 if $test -f /bin/mips && /bin/mips; then
4402 echo "Looks like a MIPS system..."
4403 $cat >usr.c <<'EOCP'
4404 #ifdef SYSTYPE_BSD43
4408 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4409 dflt='/bsd43/usr/include'
4413 mips_type='System V'
4415 $rm -f usr.c usr.out
4416 echo "and you're compiling with the $mips_type compiler and libraries."
4420 echo "Doesn't look like a MIPS system."
4430 case "$xxx_prompt" in
4433 rp='Where are the include files you want to use?'
4441 : see how we invoke the C preprocessor
4443 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4444 cat <<'EOT' >testcpp.c
4450 if test ! -f cppstdin; then
4451 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4452 # AIX cc -E doesn't show the absolute headerfile
4453 # locations but we'll cheat by using the -M flag.
4454 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
4456 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4459 echo "Keeping your $hint cppstdin wrapper."
4462 wrapper=`pwd`/cppstdin
4466 if $test "X$cppstdin" != "X" && \
4467 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4468 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4470 echo "You used to use $cppstdin $cppminus so we'll use that again."
4472 '') echo "But let's see if we can live without a wrapper..." ;;
4474 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4475 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4477 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4480 echo "(However, $cpprun $cpplast does not work, let's see...)"
4488 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4495 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4496 $cc -E <testcpp.c >testcpp.out 2>&1; \
4497 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4498 echo "Yup, it does."
4501 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4502 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4503 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4504 echo "Yup, it does."
4507 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4508 $cc -P <testcpp.c >testcpp.out 2>&1; \
4509 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4510 echo "Yipee, that works!"
4513 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4514 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4515 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4516 echo "At long last!"
4519 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4520 $cpp <testcpp.c >testcpp.out 2>&1; \
4521 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4525 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4526 $cpp - <testcpp.c >testcpp.out 2>&1; \
4527 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4528 echo "Hooray, it works! I was beginning to wonder."
4531 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4532 $wrapper <testcpp.c >testcpp.out 2>&1; \
4533 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4539 rp="No dice. I can't find a C preprocessor. Name one:"
4543 $x_cpp <testcpp.c >testcpp.out 2>&1
4544 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4545 echo "OK, that will do." >&4
4547 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4562 echo "Perhaps can we force $cc -E using a wrapper..."
4563 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4564 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4570 echo "Nope, we'll have to live without it..."
4584 "$wrapper"|'cppstdin') ;;
4585 *) $rm -f $wrapper;;
4587 $rm -f testcpp.c testcpp.out
4589 : Set private lib path
4592 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4597 '') dlist="$loclibpth $plibpth $glibpth";;
4598 *) dlist="$libpth";;
4601 : Now check and see which directories actually exist, avoiding duplicates
4605 if $test -d $xxx; then
4608 *) libpth="$libpth $xxx";;
4614 Some systems have incompatible or broken versions of libraries. Among
4615 the directories listed in the question below, please remove any you
4616 know not to be holding relevant libraries, and add any that are needed.
4617 Say "none" for none.
4628 rp="Directories to use for library searches?"
4635 : compute shared library extension
4638 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4648 On some systems, shared libraries may be available. Answer 'none' if
4649 you want to suppress searching of shared libraries for the remainder
4650 of this configuration.
4653 rp='What is the file extension used for shared libraries?'
4657 : Define several unixisms.
4658 : Hints files or command line option can be used to override them.
4659 : The convoluted testing is in case hints files set either the old
4662 '') case "$exe_ext" in
4664 *) _exe="$exe_ext" ;;
4669 '') case "$lib_ext" in
4676 '') case "$obj_ext" in
4683 '') case "$path_sep" in
4694 : Which makefile gets called first. This is used by make depend.
4695 case "$firstmakefile" in
4696 '') firstmakefile='makefile';;
4700 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4703 case "$uselongdouble" in
4704 $define|true|[yY]*) dflt='y';;
4709 Perl can be built to take advantage of long doubles which
4710 (if available) may give more accuracy and range for floating point numbers.
4712 If this doesn't make any sense to you, just accept the default '$dflt'.
4714 rp='Try to use long doubles if available?'
4717 y|Y) val="$define" ;;
4723 case "$uselongdouble" in
4724 true|[yY]*) uselongdouble="$define" ;;
4727 : Look for a hint-file generated 'call-back-unit'. If the
4728 : user has specified that long doubles should be used,
4729 : we may need to set or change some other defaults.
4730 if $test -f uselongdouble.cbu; then
4731 echo "Your platform has some specific hints regarding long doubles, using them..."
4732 . ./uselongdouble.cbu
4734 case "$uselongdouble" in
4737 (Your platform does not have any specific hints for long doubles.)
4743 : Looking for optional libraries
4745 echo "Checking for optional libraries..." >&4
4750 case "$libswanted" in
4751 '') libswanted='c_s';;
4754 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4760 for thisdir in $libpth $xlibpth; do
4761 test -d $thisdir && libspath="$libspath $thisdir"
4763 for thislib in $libswanted; do
4764 for thisdir in $libspath; do
4766 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4767 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4768 $test -f "$xxx" && eval $libscheck
4769 $test -f "$xxx" && libstyle=shared
4771 if test ! -f "$xxx"; then
4772 xxx=$thisdir/lib$thislib.$so
4773 $test -f "$xxx" && eval $libscheck
4774 $test -f "$xxx" && libstyle=shared
4776 if test ! -f "$xxx"; then
4777 xxx=$thisdir/lib$thislib$_a
4778 $test -f "$xxx" && eval $libscheck
4779 $test -f "$xxx" && libstyle=static
4781 if test ! -f "$xxx"; then
4782 xxx=$thisdir/$thislib$_a
4783 $test -f "$xxx" && eval $libscheck
4784 $test -f "$xxx" && libstyle=static
4786 if test ! -f "$xxx"; then
4787 xxx=$thisdir/lib${thislib}_s$_a
4788 $test -f "$xxx" && eval $libscheck
4789 $test -f "$xxx" && libstyle=static
4790 $test -f "$xxx" && thislib=${thislib}_s
4792 if test ! -f "$xxx"; then
4793 xxx=$thisdir/Slib$thislib$_a
4794 $test -f "$xxx" && eval $libscheck
4795 $test -f "$xxx" && libstyle=static
4797 if $test -f "$xxx"; then
4799 shared) echo "Found -l$thislib (shared)." ;;
4800 static) echo "Found -l$thislib." ;;
4801 *) echo "Found -l$thislib ($libstyle)." ;;
4805 *) dflt="$dflt -l$thislib"
4806 libsfound="$libsfound $xxx"
4808 libsfiles="$libsfiles $yyy"
4809 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4810 case " $libsdirs " in
4812 *) libsdirs="$libsdirs $yyy" ;;
4819 if $test ! -f "$xxx"; then
4820 echo "No -l$thislib."
4831 ' '|'') dflt='none';;
4836 In order to compile $package on your machine, a number of libraries
4837 are usually needed. Include any other special libraries here as well.
4838 Say "none" for none. The default list is almost always right.
4842 rp="What libraries to use?"
4849 : determine optimization, if desired, or use for debug flag also
4851 ' '|$undef) dflt='none';;
4853 *) dflt="$optimize";;
4857 By default, $package compiles with the -O flag to use the optimizer.
4858 Alternately, you might want to use the symbolic debugger, which uses
4859 the -g flag (on traditional Unix systems). Either flag can be
4860 specified here. To use neither flag, specify the word "none".
4863 rp="What optimizer/debugger flag should be used?"
4867 'none') optimize=" ";;
4870 : Check what DEBUGGING is required from the command line
4871 : -DEBUGGING or -DDEBUGGING or
4872 : -DEBUGGING=both = -g + -DDEBUGGING
4873 : -DEBUGGING=-g or -Doptimize=-g = -g
4874 : -DEBUGGING=none or -UDEBUGGING =
4875 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
4878 *) DEBUGGING=$EBUGGING ;;
4881 case "$DEBUGGING" in
4885 *) optimize="$optimize -g" ;;
4889 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
4897 case "$DEBUGGING" in
4898 both|$define) dflt='-DDEBUGGING'
4901 : We will not override a previous value, but we might want to
4902 : augment a hint file
4904 default|recommended)
4905 case "$gccversion" in
4906 1*) dflt="$dflt -fpcc-struct-return" ;;
4908 case "$optimize:$DEBUGGING" in
4909 *-g*:old) dflt="$dflt -DDEBUGGING";;
4911 case "$gccversion" in
4912 2*) if test -d /etc/conf/kconfig.d &&
4913 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4915 # Interactive Systems (ISC) POSIX mode.
4920 case "$gccversion" in
4924 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4925 echo 'int main(void) { return 0; }' > gcctest.c
4926 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4927 echo "Yes, it does." 2>&1
4930 echo "Leaving current flags $ccflags alone." 2>&1
4932 *) dflt="$dflt -fno-strict-aliasing" ;;
4935 echo "Nope, it doesn't, but that's ok." 2>&1
4939 # For gcc, adding -pipe speeds up compilations for some, but apparently
4940 # some assemblers can't read from stdin. (It also slows down compilations
4941 # in other cases, but those are apparently rarer these days.) AD 5/2004.
4942 case "$gccversion" in
4944 echo "Checking if your compiler accepts -pipe" 2>&1
4945 echo 'int main(void) { return 0; }' > gcctest.c
4946 if $cc -pipe -o gcctest gcctest.c; then
4947 echo "Yes, it does." 2>&1
4950 echo "Leaving current flags $ccflags alone." 2>&1
4952 *) dflt="$dflt -pipe" ;;
4955 echo "Nope, it doesn't, but that's ok." 2>&1
4958 echo "Checking if your compiler accepts -Wdeclaration-after-statement" 2>&1
4959 echo 'int main(void) { return 0; }' > gcctest.c
4960 if $cc -Wdeclaration-after-statement -o gcctest gcctest.c; then
4961 echo "Yes, it does." 2>&1
4963 *-Wdeclaration-after-statement*)
4964 echo "Leaving current flags $ccflags alone." 2>&1
4966 *) dflt="$dflt -Wdeclaration-after-statement" ;;
4969 echo "Nope, it doesn't, but that's ok." 2>&1
4976 case "$mips_type" in
4977 *BSD*|'') inclwanted="$locincpth $usrinc";;
4978 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4980 for thisincl in $inclwanted; do
4981 if $test -d $thisincl; then
4982 if $test x$thisincl != x$usrinc; then
4984 *" -I$thisincl "*);;
4985 *) dflt="$dflt -I$thisincl ";;
4991 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4993 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5001 *) dflt="$dflt -D$2";;
5005 set signal.h LANGUAGE_C; eval $inctest
5009 ccflags="$ccflags -DSOCKS"
5014 default|recommended) dflt="$ccflags $dflt" ;;
5015 *) dflt="$ccflags";;
5024 Your C compiler may want other flags. For this question you should include
5025 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5026 but you should NOT include libraries or ld flags like -lwhatever. If you
5027 want $package to honor its debug switch, you should include -DDEBUGGING here.
5028 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5030 To use no flags, specify the word "none".
5036 rp="Any additional cc flags?"
5043 : the following weeds options from ccflags that are of no interest to cpp
5045 '') cppflags="$ccflags" ;;
5046 *) cppflags="$cppflags $ccflags" ;;
5048 case "$gccversion" in
5049 1*) cppflags="$cppflags -D__GNUC__"
5051 case "$mips_type" in
5053 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5059 echo "Let me guess what the preprocessor flags are..." >&4
5073 *) ftry="$previous $flag";;
5075 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5076 >cpp1.out 2>/dev/null && \
5077 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5078 >cpp2.out 2>/dev/null && \
5079 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5080 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5082 cppflags="$cppflags $ftry"
5092 *-*) echo "They appear to be: $cppflags";;
5094 $rm -f cpp.c cpp?.out
5098 : flags used in final linking phase
5100 '') if ./venix; then
5106 *-posix*) dflt="$dflt -posix" ;;
5109 *) dflt="$ldflags";;
5112 : Try to guess additional flags to pick up local libraries.
5113 for thislibdir in $libpth; do
5114 case " $loclibpth " in
5117 *"-L$thislibdir "*) ;;
5118 *) dflt="$dflt -L$thislibdir" ;;
5130 Your C linker may need flags. For this question you should
5131 include -L/whatever and any other flags used by the C linker, but you
5132 should NOT include libraries like -lwhatever.
5134 Make sure you include the appropriate -L/path flags if your C linker
5135 does not normally search all of the directories you specified above,
5138 To use no flags, specify the word "none".
5142 rp="Any additional ld flags (NOT including libraries)?"
5148 rmlist="$rmlist pdp11"
5152 echo "Checking your choice of C compiler and flags for coherency..." >&4
5153 $cat > try.c <<'EOF'
5155 int main() { printf("Ok\n"); return(0); }
5157 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5159 $cat >try.msg <<'EOM'
5160 I've tried to compile and run the following simple program:
5163 $cat try.c >> try.msg
5165 $cat >> try.msg <<EOM
5172 and I got the following output:
5176 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5177 if $sh -c "$run ./try" >>try.msg 2>&1; then
5181 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5184 cat >> try.msg <<'EOQS'
5185 If $libs contains -lsfio, and sfio is mis-configured, then it
5186 sometimes (apparently) runs and exits with a 0 status, but with no
5187 output! It may have to do with sfio's use of _exit vs. exit.
5190 rp="You have a big problem. Shall I abort Configure"
5197 echo "The program compiled OK, but exited with status $?." >>try.msg
5198 rp="You have a problem. Shall I abort Configure"
5202 echo "I can't compile the test program." >>try.msg
5203 rp="You have a BIG problem. Shall I abort Configure"
5209 case "$knowitall" in
5211 echo "(The supplied flags or libraries might be incorrect.)"
5219 *) echo "Ok. Stopping Configure." >&4
5224 n) echo "OK, that should do.";;
5226 $rm -f try try.* core
5228 : define a shorthand compile call
5232 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5233 : define a shorthand compile call for compilations that should be ok.
5237 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5239 : determine filename position in cpp output
5241 echo "Computing filename position in cpp output for #include directives..." >&4
5243 vos) testaccess=-e ;;
5246 echo '#include <stdio.h>' > foo.c
5249 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5250 $grep '^[ ]*#.*stdio\.h' | \
5251 while read cline; do
5254 while $test \$# -gt 0; do
5255 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5260 pos=\`expr \$pos + 1\`
5272 *) pos="${fieldn}th";;
5274 echo "Your cpp writes the filename in the $pos field of the line."
5277 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5278 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5281 : locate header file
5286 for usrincdir in $usrinc
5288 if test -f \$usrincdir/\$wanted; then
5289 echo "\$usrincdir/\$wanted"
5293 awkprg='{ print \$$fieldn }'
5294 echo "#include <\$wanted>" > foo\$\$.c
5295 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5296 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5297 while read cline; do
5298 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5300 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5301 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5306 # status = 0: grep returned 0 lines, case statement not executed
5307 # status = 1: headerfile found
5308 # status = 2: while loop executed, no headerfile found
5312 if test \$status -eq 1; then
5319 : define an alternate in-header-list? function
5320 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5321 cont=true; xxf="echo \"<\$1> found.\" >&4";
5322 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5323 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5325 case $# in 4) instead=instead;; *) instead="at last";; esac;
5326 while $test "$cont"; do
5328 var=$2; eval "was=\$$2";
5329 if $test "$xxx" && $test -r "$xxx";
5331 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5334 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5335 set $yyy; shift; shift; yyy=$@;
5336 case $# in 0) cont="";;
5337 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5338 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5339 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5340 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5344 do set $yyy; var=$2; eval "was=\$$2";
5345 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5346 set $yyy; shift; shift; yyy=$@;
5349 : see if stdlib is available
5350 set stdlib.h i_stdlib
5353 : check for lengths of integral types
5357 echo "Checking to see how big your integers are..." >&4
5366 printf("intsize=%d;\n", (int)sizeof(int));
5367 printf("longsize=%d;\n", (int)sizeof(long));
5368 printf("shortsize=%d;\n", (int)sizeof(short));
5373 if eval $compile_ok && $run ./try > /dev/null; then
5375 echo "Your integers are $intsize bytes long."
5376 echo "Your long integers are $longsize bytes long."
5377 echo "Your short integers are $shortsize bytes long."
5381 Help! I can't compile and run the intsize test program: please enlighten me!
5382 (This is probably a misconfiguration in your system or libraries, and
5383 you really ought to fix it. Still, I'll try anyway.)
5387 rp="What is the size of an integer (in bytes)?"
5391 rp="What is the size of a long integer (in bytes)?"
5395 rp="What is the size of a short integer (in bytes)?"
5403 : check for long long
5405 echo "Checking to see if you have long long..." >&4
5406 echo 'int main() { long long x = 7; return 0; }' > try.c
5408 if eval $compile; then
5410 echo "You have long long."
5413 echo "You do not have long long."
5419 : check for length of long long
5420 case "${d_longlong}${longlongsize}" in
5423 echo "Checking to see how big your long longs are..." >&4
5424 $cat >try.c <<'EOCP'
5428 printf("%d\n", (int)sizeof(long long));
5433 if eval $compile_ok; then
5434 longlongsize=`$run ./try`
5435 echo "Your long longs are $longlongsize bytes long."
5439 echo "(I can't seem to compile the test program. Guessing...)"
5440 rp="What is the size of a long long (in bytes)?"
5444 if $test "X$longsize" = "X$longlongsize"; then
5445 echo "(That isn't any different from an ordinary long.)"
5451 : see if inttypes.h is available
5452 : we want a real compile instead of Inhdr because some systems
5453 : have an inttypes.h which includes non-existent headers
5456 #include <inttypes.h>
5458 static int32_t foo32 = 0x12345678;
5462 if eval $compile; then
5463 echo "<inttypes.h> found." >&4
5466 echo "<inttypes.h> NOT found." >&4
5475 echo "Checking to see if you have int64_t..." >&4
5477 #include <sys/types.h>
5478 #$i_inttypes I_INTTYPES
5480 #include <inttypes.h>
5482 int main() { int64_t x = 7; }
5485 if eval $compile; then
5487 echo "You have int64_t."
5490 echo "You do not have int64_t."
5498 echo "Checking which 64-bit integer type we could use..." >&4
5504 val='"unsigned int"'
5509 *) case "$longsize" in
5513 val='"unsigned long"'
5518 *) case "$d_longlong:$longlongsize" in
5523 val='"unsigned long long"'
5528 *) case "$d_int64_t" in
5547 '') echo "Alas, no 64-bit integer types in sight." >&4
5550 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5556 case "$uselonglong" in
5557 "$define"|true|[yY]*)
5560 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5562 use64bitint="$define"
5565 case "$use64bits" in
5566 "$define"|true|[yY]*)
5569 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5571 use64bitint="$define"
5574 case "$use64bitints" in
5575 "$define"|true|[yY]*)
5578 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5580 use64bitint="$define"
5583 case "$use64bitsint" in
5584 "$define"|true|[yY]*)
5587 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5589 use64bitint="$define"
5592 case "$uselonglongs" in
5593 "$define"|true|[yY]*)
5596 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5598 use64bitint="$define"
5601 case "$use64bitsall" in
5602 "$define"|true|[yY]*)
5605 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5607 use64bitall="$define"
5612 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5614 case "$use64bitall" in
5615 "$define"|true|[yY]*) use64bitint="$define" ;;
5621 You have natively 64-bit long integers.
5625 *) case "$use64bitint" in
5626 "$define"|true|[yY]*) dflt='y';;
5635 Perl can be built to take advantage of 64-bit integer types
5636 on some systems. To do so, Configure can be run with -Duse64bitint.
5637 Choosing this option will most probably introduce binary incompatibilities.
5639 If this doesn't make any sense to you, just accept the default '$dflt'.
5640 (The default has been chosen based on your configuration.)
5642 rp='Try to use 64-bit integers, if available?'
5645 [yY]*) val="$define" ;;
5653 case "$use64bitall" in
5654 "$define"|true|[yY]*) dflt='y' ;;
5655 *) case "$longsize" in
5663 You may also choose to try maximal 64-bitness. It means using as much
5664 64-bitness as possible on the platform. This in turn means even more
5665 binary incompatibilities. On the other hand, your platform may not
5666 have any more 64-bitness available than what you already have chosen.
5668 If this doesn't make any sense to you, just accept the default '$dflt'.
5669 (The default has been chosen based on your configuration.)
5671 rp='Try to use maximal 64-bit support, if available?'
5674 [yY]*) val="$define" ;;
5679 case "$use64bitall" in
5681 case "$use64bitint" in
5685 Since you have chosen a maximally 64-bit build, I'm also turning on
5686 the use of 64-bit integers.
5688 use64bitint="$define" ;;
5693 : Look for a hint-file generated 'call-back-unit'. If the
5694 : user has specified that a 64-bit perl is to be built,
5695 : we may need to set or change some other defaults.
5696 if $test -f use64bitint.cbu; then
5697 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5700 case "$use64bitint" in
5701 "$define"|true|[yY]*)
5703 4) case "$archname64" in
5704 '') archname64=64int ;;
5711 : Look for a hint-file generated 'call-back-unit'. If the
5712 : user has specified that a maximally 64-bit perl is to be built,
5713 : we may need to set or change some other defaults.
5714 if $test -f use64bitall.cbu; then
5715 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5718 case "$use64bitall" in
5719 "$define"|true|[yY]*)
5721 4) case "$archname64" in
5722 ''|64int) archname64=64all ;;
5729 case "$d_quad:$use64bitint" in
5733 *** You have chosen to use 64-bit integers,
5734 *** but none can be found.
5735 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5736 *** Cannot continue, aborting.
5743 : check for length of double
5745 case "$doublesize" in
5747 echo "Checking to see how big your double precision numbers are..." >&4
5756 printf("%d\n", (int)sizeof(double));
5761 if eval $compile_ok; then
5762 doublesize=`$run ./try`
5763 echo "Your double is $doublesize bytes long."
5766 echo "(I can't seem to compile the test program. Guessing...)"
5767 rp="What is the size of a double precision number (in bytes)?"
5775 : check for long doubles
5777 echo "Checking to see if you have long double..." >&4
5778 echo 'int main() { long double x = 7.0; }' > try.c
5780 if eval $compile; then
5782 echo "You have long double."
5785 echo "You do not have long double."
5791 : check for length of long double
5792 case "${d_longdbl}${longdblsize}" in
5795 echo "Checking to see how big your long doubles are..." >&4
5796 $cat >try.c <<'EOCP'
5800 printf("%d\n", sizeof(long double));
5805 if eval $compile; then
5806 longdblsize=`$run ./try`
5807 echo "Your long doubles are $longdblsize bytes long."
5811 echo "(I can't seem to compile the test program. Guessing...)" >&4
5812 rp="What is the size of a long double (in bytes)?"
5816 if $test "X$doublesize" = "X$longdblsize"; then
5817 echo "That isn't any different from an ordinary double."
5818 echo "I'll keep your setting anyway, but you may see some"
5819 echo "harmless compilation warnings."
5825 : determine the architecture name
5827 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5828 tarch=`arch`"-$osname"
5829 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5830 if uname -m > tmparch 2>&1 ; then
5831 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5832 -e 's/$/'"-$osname/" tmparch`
5840 case "$myarchname" in
5843 echo "(Your architecture name used to be $myarchname.)"
5847 case "$targetarch" in
5849 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5854 *) dflt="$archname";;
5856 rp='What is your architecture name'
5859 case "$usethreads" in
5861 echo "Threads selected." >&4
5863 *-thread*) echo "...and architecture name already has -thread." >&4
5865 *) archname="$archname-thread"
5866 echo "...setting architecture name to $archname." >&4
5871 case "$usemultiplicity" in
5873 echo "Multiplicity selected." >&4
5875 *-multi*) echo "...and architecture name already has -multi." >&4
5877 *) archname="$archname-multi"
5878 echo "...setting architecture name to $archname." >&4
5883 case "$use64bitint$use64bitall" in
5885 case "$archname64" in
5887 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5890 case "$use64bitint" in
5891 "$define") echo "64 bit integers selected." >&4 ;;
5893 case "$use64bitall" in
5894 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5897 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5899 *) archname="$archname-$archname64"
5900 echo "...setting architecture name to $archname." >&4
5906 case "$uselongdouble" in
5908 echo "Long doubles selected." >&4
5909 case "$longdblsize" in
5911 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
5915 *-ld*) echo "...and architecture name already has -ld." >&4
5917 *) archname="$archname-ld"
5918 echo "...setting architecture name to $archname." >&4
5925 case "$useperlio" in
5927 echo "Perlio selected." >&4
5930 echo "Perlio not selected, using stdio." >&4
5932 *-stdio*) echo "...and architecture name already has -stdio." >&4
5934 *) archname="$archname-stdio"
5935 echo "...setting architecture name to $archname." >&4
5940 if $test -f archname.cbu; then
5941 echo "Your platform has some specific hints for architecture name, using them..."
5945 : set the prefixit variable, to compute a suitable default value
5946 prefixit='case "$3" in
5948 case "$oldprefix" in
5949 "") eval "$1=\"\$$2\"";;
5956 ""|" ") eval "$1=\"\$$2\"";;
5962 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5964 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5965 /*-$oldprefix/*|\~*-$oldprefix/*)
5966 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5967 *) eval "$1=\"\$$2\"";;
5971 : get the patchlevel
5973 echo "Getting the current patchlevel..." >&4
5974 if $test -r $rsrc/patchlevel.h;then
5975 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5976 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5977 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5978 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5979 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5980 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5981 perl_patchlevel=`egrep 'define PERL_PATCHNUM [0-9][0-9]|,"MAINT[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
5990 $echo "(You do not have patchlevel.h. Eek.)"
5992 if $test -r $rsrc/.patch ; then
5993 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
5994 perl_patchlevel=`cat $rsrc/.patch`
5997 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
5998 version_patchlevel_string="version $patchlevel subversion $subversion"
5999 case "$perl_patchlevel" in
6001 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
6004 $echo "(You have $package $version_patchlevel_string.)"
6008 : XXX Should be a Configure test for double-dots in filenames.
6009 version=`echo $revision $patchlevel $subversion | \
6010 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6011 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6012 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6015 version=`echo $revision $patchlevel $subversion | \
6016 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6017 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6018 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6021 : Special case the 5.005_xx maintenance series, which used 5.005
6022 : without any subversion label as a subdirectory in $sitelib
6023 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
6024 api_versionstring='5.005'
6027 : determine installation style
6028 : For now, try to deduce it from prefix unless it is already set.
6029 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6030 case "$installstyle" in
6031 '') case "$prefix" in
6032 *perl*) dflt='lib';;
6033 *) dflt='lib/perl5' ;;
6036 *) dflt="$installstyle" ;;
6038 : Probably not worth prompting for this since we prompt for all
6039 : the directories individually, and the prompt would be too long and
6043 : determine where public executables go
6048 rp='Pathname where the public executables will reside?'
6050 if $test "X$ansexp" != "X$binexp"; then
6054 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6055 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6056 : this via initialinstalllocation
6059 case "$userelocatableinc" in
6060 $define|true|[yY]*) dflt='y' ;;
6065 Would you like to build Perl so that the installation is relocatable, so that
6066 library paths in @INC are determined relative to the path of the perl binary?
6067 This is not advised for system Perl installs, or if you need to run setid
6068 scripts or scripts under taint mode.
6070 If this doesn't make any sense to you, just accept the default '$dflt'.
6072 rp='Use relocatable @INC?'
6075 y|Y) val="$define" ;;
6078 set userelocatableinc
6081 initialinstalllocation="$binexp"
6082 : Default prefix is now "up one level from where the binaries are"
6083 case "$userelocatableinc" in
6089 installprefixexp=".../.."
6093 : determine where private library files go
6094 : Usual default is /usr/local/lib/perl5/$version.
6095 : Also allow things like /opt/perl/lib/$version, since
6096 : /opt/perl/lib/perl5... would be redundant.
6097 : The default "style" setting is made in installstyle.U
6098 case "$installstyle" in
6099 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6100 *) set dflt privlib lib/$version ;;
6105 There are some auxiliary files for $package that need to be put into a
6106 private library directory that is accessible by everyone.
6111 rp='Pathname where the private library files will reside?'
6116 : set the prefixup variable, to restore leading tilda escape
6117 prefixup='case "$prefixexp" in
6119 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6122 : determine where public architecture dependent libraries go
6125 : privlib default is /usr/local/lib/$package/$version
6126 : archlib default is /usr/local/lib/$package/$version/$archname
6127 : privlib may have an optional trailing /share.
6128 tdflt=`echo $privlib | $sed 's,/share$,,'`
6129 tdflt=$tdflt/$archname
6138 $spackage contains architecture-dependent library files. If you are
6139 sharing libraries in a heterogeneous environment, you might store
6140 these files in a separate location. Otherwise, you can just include
6141 them with the rest of the public library files.
6146 rp='Where do you want to put the public architecture-dependent libraries?'
6150 if $test X"$archlib" = X"$privlib"; then
6156 : see if setuid scripts can be secure
6159 Some kernels have a bug that prevents setuid #! scripts from being
6160 secure. Some sites have disabled setuid #! scripts because of this.
6162 First let's decide if your kernel supports secure setuid #! scripts.
6163 (If setuid #! scripts would be secure but have been disabled anyway,
6164 don't say that they are secure if asked.)
6169 if $test -d /dev/fd; then
6170 echo "#!$ls" >reflect
6171 chmod +x,u+s reflect
6172 ./reflect >flect 2>&1
6173 if $contains "/dev/fd" flect >/dev/null; then
6174 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6178 If you are not sure if they are secure, I can check but I'll need a
6179 username and password different from the one you are using right now.
6180 If you don't have such a username or don't want me to test, simply
6184 rp='Other username to test security of setuid scripts with?'
6189 case "$d_suidsafe" in
6190 '') echo "I'll assume setuid scripts are *not* secure." >&4
6193 echo "Well, the $hint value is *not* secure." >&4
6195 *) echo "Well, the $hint value *is* secure." >&4
6200 $rm -f reflect flect
6201 echo "#!$ls" >reflect
6202 chmod +x,u+s reflect
6205 echo '"su" will (probably) prompt you for '"$ans's password."
6206 su $ans -c './reflect >flect'
6207 if $contains "/dev/fd" flect >/dev/null; then
6208 echo "Okay, it looks like setuid scripts are secure." >&4
6211 echo "I don't think setuid scripts are secure." >&4
6216 rp='Does your kernel have *secure* setuid scripts?'
6219 [yY]*) val="$define";;
6224 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6225 echo "(That's for file descriptors, not floppy disks.)"
6231 $rm -f reflect flect
6233 : now see if they want to do setuid emulation
6236 case "$d_suidsafe" in
6239 echo "No need to emulate SUID scripts since they are secure here." >&4
6243 Some systems have disabled setuid scripts, especially systems where
6244 setuid scripts cannot be secure. On systems where setuid scripts have
6245 been disabled, the setuid/setgid bits on scripts are currently
6246 useless. It is possible for $package to detect those bits and emulate
6247 setuid/setgid in a secure fashion. This emulation will only work if
6248 setuid scripts have been disabled in your kernel.
6252 "$define") dflt=y ;;
6255 rp="Do you want to do setuid/setgid emulation?"
6258 [yY]*) val="$define";;
6266 : Find perl5.005 or later.
6267 echo "Looking for a previously installed perl5.005 or later... "
6269 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6270 : Check if this perl is recent and can load a simple module
6271 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6274 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6284 '') echo "None found. That's ok.";;
6285 *) echo "Using $perl5." ;;
6290 After $package is installed, you may wish to install various
6291 add-on modules and utilities. Typically, these add-ons will
6292 be installed under $prefix with the rest
6293 of this package. However, you may wish to install such add-ons
6294 elsewhere under a different prefix.
6296 If you do not wish to put everything under a single prefix, that's
6297 ok. You will be prompted for the individual locations; this siteprefix
6298 is only used to suggest the defaults.
6300 The default should be fine for most people.
6304 rp='Installation prefix to use for add-on modules and utilities?'
6305 : XXX Here might be another good place for an installstyle setting.
6306 case "$siteprefix" in
6308 *) dflt=$siteprefix ;;
6311 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6313 case "$siteprefix" in
6317 *) oldsiteprefix="$prefix";;
6322 siteprefixexp="$ansexp"
6324 : determine where site specific libraries go.
6325 : Usual default is /usr/local/lib/perl5/site_perl/$version
6326 : The default "style" setting is made in installstyle.U
6327 : XXX No longer works with Prefixit stuff.
6328 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6330 '') case "$installstyle" in
6331 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6332 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6340 The installation process will create a directory for
6341 site-specific extensions and modules. Most users find it convenient
6342 to place all site-specific files in this directory rather than in the
6343 main distribution directory.
6347 rp='Pathname for the site-specific library files?'
6351 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6353 : Determine list of previous versions to include in @INC
6354 $cat > getverlist <<EOPL
6357 \$api_versionstring = "$api_versionstring";
6358 \$version = "$version";
6359 \$stem = "$sitelib_stem";
6360 \$archname = "$archname";
6362 $cat >> getverlist <<'EOPL'
6363 # Can't have leading @ because metaconfig interprets it as a command!
6364 ;@inc_version_list=();
6365 # XXX Redo to do opendir/readdir?
6368 ;@candidates = glob("5.*");
6374 # XXX ToDo: These comparisons must be reworked when two-digit
6375 # subversions come along, so that 5.7.10 compares as greater than
6376 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6377 # widespread that we can use the built-in version vectors rather
6378 # than reinventing them here. For 5.6.0, however, we must
6379 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6380 foreach $d (@candidates) {
6381 if ($d lt $version) {
6382 if ($d ge $api_versionstring) {
6383 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6385 elsif ($d ge "5.005") {
6386 unshift(@inc_version_list, grep { -d } $d);
6390 # Skip newer version. I.e. don't look in
6391 # 5.7.0 if we're installing 5.6.1.
6395 if (@inc_version_list) {
6396 print join(' ', @inc_version_list);
6399 # Blank space to preserve value for next Configure run.
6404 case "$inc_version_list" in
6405 '') if test -x "$perl5$exe_ext"; then
6406 dflt=`$perl5 getverlist`
6411 $undef) dflt='none' ;;
6412 *) eval dflt=\"$inc_version_list\" ;;
6415 ''|' ') dflt=none ;;
6422 In order to ease the process of upgrading, this version of perl
6423 can be configured to use modules built and installed with earlier
6424 versions of perl that were installed under $prefix. Specify here
6425 the list of earlier versions that this version of perl should check.
6426 If Configure detected no earlier versions of perl installed under
6427 $prefix, then the list will be empty. Answer 'none' to tell perl
6428 to not search earlier versions.
6430 The default should almost always be sensible, so if you're not sure,
6431 just accept the default.
6434 rp='List of earlier versions to include in @INC?'
6437 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6438 *) inc_version_list="$ans" ;;
6440 case "$inc_version_list" in
6442 inc_version_list_init='0'
6443 d_inc_version_list="$undef"
6445 *) inc_version_list_init=`echo $inc_version_list |
6446 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6447 d_inc_version_list="$define"
6452 : see if this is a malloc.h system
6453 : we want a real compile instead of Inhdr because some systems have a
6454 : malloc.h that just gives a compile error saying to use stdlib.h instead
6459 int main () { return 0; }
6462 if eval $compile; then
6463 echo "<malloc.h> found." >&4
6466 echo "<malloc.h> NOT found." >&4
6473 : check for void type
6475 echo "Checking to see how well your C compiler groks the void type..." >&4
6476 case "$voidflags" in
6488 extern void moo(); /* function returning void */
6489 void (*goo)(); /* ptr to func returning void */
6491 void *hue; /* generic ptr */
6504 int main() { sub(); }
6506 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6507 voidflags=$defvoidused
6508 echo "Good. It appears to support void to the level $package wants.">&4
6509 if $contains warning .out >/dev/null 2>&1; then
6510 echo "However, you might get some warnings that look like this:"
6514 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6515 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6516 echo "It supports 1..."
6517 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6518 echo "It also supports 2..."
6519 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6521 echo "And it supports 4 but not 8 definitely."
6523 echo "It doesn't support 4..."
6524 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6526 echo "But it supports 8."
6529 echo "Neither does it support 8."
6533 echo "It does not support 2..."
6534 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6536 echo "But it supports 4 and 8."
6538 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6540 echo "And it supports 4 but has not heard about 8."
6542 echo "However it supports 8 but not 4."
6547 echo "There is no support at all for void."
6552 case "$voidflags" in
6555 Support flag bits are:
6556 1: basic void declarations.
6557 2: arrays of pointers to functions returning void.
6558 4: operations between pointers to and addresses of void functions.
6559 8: generic void pointers.
6562 rp="Your void support flags add up to what?"
6569 : check for length of pointer
6573 echo "Checking to see how big your pointers are..." >&4
6574 if test "$voidflags" -gt 7; then
6575 echo '#define VOID_PTR char *' > try.c
6577 echo '#define VOID_PTR void *' > try.c
6587 printf("%d\n", (int)sizeof(VOID_PTR));
6592 if eval $compile_ok; then
6593 ptrsize=`$run ./try`
6594 echo "Your pointers are $ptrsize bytes long."
6597 echo "(I can't seem to compile the test program. Guessing...)" >&4
6598 rp="What is the size of a pointer (in bytes)?"
6605 case "$use64bitall" in
6606 "$define"|true|[yY]*)
6610 *** You have chosen a maximally 64-bit build,
6611 *** but your pointers are only 4 bytes wide.
6612 *** Please rerun Configure without -Duse64bitall.
6617 *** Since you have quads, you could possibly try with -Duse64bitint.
6622 *** Cannot continue, aborting.
6633 : determine whether to use malloc wrapping
6635 case "$usemallocwrap" in
6636 [yY]*|true|$define) dflt='y' ;;
6637 [nN]*|false|$undef) dflt='n' ;;
6638 *) case "$usedevel" in
6639 [yY]*|true|$define) dflt='y' ;;
6644 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6646 usemallocwrap="$ans"
6649 usemallocwrap="$define" ;;
6651 usemallocwrap="$undef" ;;
6654 : determine which malloc to compile in
6656 case "$usemymalloc" in
6657 [yY]*|true|$define) dflt='y' ;;
6658 [nN]*|false|$undef) dflt='n' ;;
6659 *) case "$ptrsize" in
6665 rp="Do you wish to attempt to use the malloc that comes with $package?"
6671 mallocsrc='malloc.c'
6672 mallocobj="malloc$_o"
6673 d_mymalloc="$define"
6676 : Remove malloc from list of libraries to use
6677 echo "Removing unneeded -lmalloc from library list" >&4
6678 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6681 echo "libs = $libs" >&4
6693 : compute the return types of malloc and free
6695 $cat >malloc.c <<END
6699 #include <sys/types.h>
6713 case "$malloctype" in
6715 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6722 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6726 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6733 echo "Your system uses $freetype free(), it would seem." >&4
6735 : determine where site specific architecture-dependent libraries go.
6736 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6737 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6738 : sitelib may have an optional trailing /share.
6740 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6741 dflt="$dflt/$archname"
6746 set sitearch sitearch none
6750 The installation process will also create a directory for
6751 architecture-dependent site-specific extensions and modules.
6755 rp='Pathname for the site-specific architecture-dependent library files?'
6759 if $test X"$sitearch" = X"$sitelib"; then
6762 d_sitearch="$define"
6767 The installation process will also create a directory for
6768 vendor-supplied add-ons. Vendors who supply perl with their system
6769 may find it convenient to place all vendor-supplied files in this
6770 directory rather than in the main distribution directory. This will
6771 ease upgrades between binary-compatible maintenance versions of perl.
6773 Of course you may also use these directories in whatever way you see
6774 fit. For example, you might use them to access modules shared over a
6775 company-wide network.
6777 The default answer should be fine for most people.
6778 This causes further questions about vendor add-ons to be skipped
6779 and no vendor-specific directories will be configured for perl.
6782 rp='Do you want to configure vendor-specific add-on directories?'
6783 case "$usevendorprefix" in
6784 define|true|[yY]*) dflt=y ;;
6785 *) : User may have set vendorprefix directly on Configure command line.
6786 case "$vendorprefix" in
6795 rp='Installation prefix to use for vendor-supplied add-ons?'
6796 case "$vendorprefix" in
6798 *) dflt=$vendorprefix ;;
6801 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6803 case "$vendorprefix" in
6807 *) oldvendorprefix="$prefix";;
6811 usevendorprefix="$define"
6813 vendorprefixexp="$ansexp"
6815 *) usevendorprefix="$undef"
6821 case "$vendorprefix" in
6822 '') d_vendorlib="$undef"
6826 *) d_vendorlib="$define"
6827 : determine where vendor-supplied modules go.
6828 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6829 case "$vendorlib" in
6831 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6832 case "$installstyle" in
6833 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6834 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6837 *) dflt="$vendorlib"
6841 rp='Pathname for the vendor-supplied library files?'
6844 vendorlibexp="$ansexp"
6847 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6851 case "$vendorprefix" in
6852 '') d_vendorarch="$undef"
6856 *) d_vendorarch="$define"
6857 : determine where vendor-supplied architecture-dependent libraries go.
6858 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6859 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6860 : vendorlib may have an optional trailing /share.
6861 case "$vendorarch" in
6862 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6863 dflt="$dflt/$archname"
6865 *) dflt="$vendorarch" ;;
6868 rp='Pathname for vendor-supplied architecture-dependent files?'
6871 vendorarchexp="$ansexp"
6874 prefixvar=vendorarch
6877 : Final catch-all directories to search
6880 Lastly, you can have perl look in other directories for extensions and
6881 modules in addition to those already specified.
6882 These directories will be searched after
6886 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6887 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6889 case "$otherlibdirs" in
6890 ''|' ') dflt='none' ;;
6891 *) dflt="$otherlibdirs" ;;
6894 Enter a colon-separated set of extra paths to include in perl's @INC
6895 search path, or enter 'none' for no extra paths.
6899 rp='Colon-separated list of additional directories for perl to search?'
6902 ' '|''|none) otherlibdirs=' ' ;;
6903 *) otherlibdirs="$ans" ;;
6905 case "$otherlibdirs" in
6909 set d_perl_otherlibdirs
6912 : Cruising for prototypes
6914 echo "Checking out function prototypes..." >&4
6915 $cat >prototype.c <<EOCP
6920 int main(int argc, char *argv[]) {
6923 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6924 echo "Your C compiler appears to support function prototypes."
6927 echo "Your C compiler doesn't seem to understand function prototypes."
6934 case "$prototype" in
6936 *) ansi2knr='ansi2knr'
6941 This version of $package can only be compiled by a compiler that
6942 understands function prototypes. Unfortunately, your C compiler
6944 doesn't seem to understand them. Sorry about that.
6946 If GNU cc is available for your system, perhaps you could try that instead.
6948 Eventually, we hope to support building Perl with pre-ANSI compilers.
6949 If you would like to help in that effort, please contact <perlbug@perl.org>.
6951 Aborting Configure now.
6963 Perl can be built with extra modules or bundles of modules which
6964 will be fetched from the CPAN and installed alongside Perl.
6966 Notice that you will need access to the CPAN; either via the Internet,
6967 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
6968 be asked later to configure the CPAN.pm module which will in turn do
6969 the installation of the rest of the extra modules or bundles.)
6971 Notice also that if the modules require any external software such as
6972 libraries and headers (the libz library and the zlib.h header for the
6973 Compress::Zlib module, for example) you MUST have any such software
6974 already installed, this configuration process will NOT install such
6977 If this doesn't make any sense to you, just accept the default '$dflt'.
6979 rp='Install any extra modules (y or n)?'
6985 Please list any extra modules or bundles to be installed from CPAN,
6986 with spaces between the names. The names can be in any format the
6987 'install' command of CPAN.pm will understand. (Answer 'none',
6988 without the quotes, to install no extra modules or bundles.)
6998 $rm -f ../extras.lst
7000 *) echo "(Saving the list of extras for later...)"
7001 echo "$extras" > ../extras.lst
7009 : determine where html pages for programs go
7010 set html1dir html1dir none
7014 If you wish to install html files for programs in $spackage, indicate
7015 the appropriate directory here. To skip installing html files,
7019 ''|none|$undef|' ') dflt=none ;;
7020 *) dflt=$html1dir ;;
7023 rp="Directory for the main $spackage html pages?"
7027 : Use ' ' for none so value is preserved next time through Configure
7028 $test X"$html1dir" = "X" && html1dir=' '
7030 : determine where html pages for libraries and modules go
7031 set html3dir html3dir none
7035 If you wish to install html files for modules associated with $spackage,
7036 indicate the appropriate directory here. To skip installing html files,
7039 : There is no obvious default. If they have specified html1dir, then
7040 : try to key off that, possibly changing .../html1 into .../html3.
7042 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7043 *) dflt=$html3dir ;;
7046 rp="Directory for the $spackage module html pages?"
7050 : Use ' ' for none so value is preserved next time through Configure
7051 $test X"$html3dir" = "X" && html3dir=' '
7053 : determine whether to install perl also as /usr/bin/perl
7056 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7058 Many scripts expect perl to be installed as /usr/bin/perl.
7060 If you want to, I can install the perl you are about to compile
7061 as /usr/bin/perl (in addition to $bin/perl).
7063 if test -f /usr/bin/perl; then
7066 However, please note that because you already have a /usr/bin/perl,
7067 overwriting that with a new Perl would very probably cause problems.
7068 Therefore I'm assuming you don't want to do that (unless you insist).
7071 case "$installusrbinperl" in
7072 "$define"|[yY]*) dflt='y';;
7078 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7081 case "$installusrbinperl" in
7082 "$undef"|[nN]*) dflt='n';;
7086 rp="Do you want to install perl as /usr/bin/perl?"
7089 [yY]*) val="$define";;
7095 set installusrbinperl
7099 echo "Checking for GNU C Library..." >&4
7101 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7102 alone are insufficient to distinguish different versions, such as
7103 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7104 libc version 2.1.0. A. Dougherty, June 3, 2002.
7110 # ifdef __GLIBC_MINOR__
7111 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7112 # include <gnu/libc-version.h>
7113 printf("%s\n", gnu_get_libc_version());
7115 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7118 printf("%d\n", __GLIBC__);
7127 if eval $compile_ok && $run ./try > glibc.ver; then
7129 gnulibc_version=`$cat glibc.ver`
7130 echo "You are using the GNU C Library version $gnulibc_version"
7134 echo "You are not using the GNU C Library"
7136 $rm -f try try.* glibc.ver
7141 echo "Checking for C++..." >&4
7155 if eval $compile_ok && $run ./try > cplusplus; then
7156 val=`$cat cplusplus`
7157 echo "You are using a C++ compiler."
7160 echo "You are not using a C++ compiler."
7162 $rm -f try try.* cplusplus
7166 : see if nm is to be used to determine whether a symbol is defined or not
7170 case "$d_gnulibc" in
7173 echo "nm probably won't work on the GNU C Library." >&4
7179 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7181 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7182 echo "'nm' won't be sufficient on this sytem." >&4
7188 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7189 if $test $dflt -gt 20; then
7199 true|$define) dflt=y;;
7206 I can use $nm to extract the symbols from your C libraries. This
7207 is a time consuming task which may generate huge output on the disk (up
7208 to 3 megabytes) but that should make the symbols extraction faster. The
7209 alternative is to skip the 'nm' extraction part and to compile a small
7210 test program instead to determine whether each symbol is present. If
7211 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7212 this may be the best solution.
7214 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7217 rp="Shall I use $nm to extract C symbols from the libraries?"
7220 [Nn]*) usenm=false;;
7229 : nm options which may be necessary
7231 '') if $test -f /mach_boot; then
7233 elif $test -d /usr/ccs/lib; then
7234 nm_opt='-p' # Solaris (and SunOS?)
7235 elif $test -f /dgux; then
7237 elif $test -f /lib64/rld; then
7238 nm_opt='-p' # 64-bit Irix
7244 : nm options which may be necessary for shared libraries but illegal
7245 : for archive libraries. Thank you, Linux.
7246 case "$nm_so_opt" in
7247 '') case "$myuname" in
7249 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7250 nm_so_opt='--dynamic'
7259 : get list of predefined functions in a handy place
7264 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7270 *) for thislib in $libs; do
7273 : Handle C library specially below.
7276 thislib=`echo $thislib | $sed -e 's/^-l//'`
7277 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7279 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7281 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7283 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7285 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7287 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7289 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7294 libnames="$libnames $try"
7296 *) libnames="$libnames $thislib" ;;
7305 for xxx in $libpth; do
7306 $test -r $1 || set $xxx/libc.$so
7307 : The messy sed command sorts on library version numbers.
7309 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7310 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7312 s/[0-9][0-9]*/0000&/g
7313 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7316 $sort | $sed -e 's/^.* //'`
7319 $test -r $1 || set /usr/ccs/lib/libc.$so
7320 $test -r $1 || set /lib/libsys_s$_a
7326 if $test -r "$1"; then
7327 echo "Your (shared) C library seems to be in $1."
7329 elif $test -r /lib/libc && $test -r /lib/clib; then
7330 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7332 libc='/lib/clib /lib/libc'
7333 if $test -r /lib/syslib; then
7334 echo "(Your math library is in /lib/syslib.)"
7335 libc="$libc /lib/syslib"
7337 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7338 echo "Your C library seems to be in $libc, as you said before."
7339 elif $test -r $incpath/usr/lib/libc$_a; then
7340 libc=$incpath/usr/lib/libc$_a;
7341 echo "Your C library seems to be in $libc. That's fine."
7342 elif $test -r /lib/libc$_a; then
7344 echo "Your C library seems to be in $libc. You're normal."
7346 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7348 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7349 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7350 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7352 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7354 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7357 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7359 if $test -r "$tans"; then
7360 echo "Your C library seems to be in $tans, of all places."
7366 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7370 If the guess above is wrong (which it might be if you're using a strange
7371 compiler, or your machine supports multiple models), you can override it here.
7376 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7378 I can't seem to find your C library. I've looked in the following places:
7381 $sed 's/^/ /' libpath
7384 None of these seems to contain your C library. I need to get its name...
7389 rp='Where is your C library?'
7394 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7395 set X `cat libnames`
7398 case $# in 1) xxx=file; esac
7399 echo "Extracting names from the following $xxx for later perusal:" >&4
7401 $sed 's/^/ /' libnames >&4
7403 $echo $n "This may take a while...$c" >&4
7407 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7408 *) $nm $nm_opt $file 2>/dev/null;;
7413 $grep fprintf libc.tmp > libc.ptf
7414 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7415 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7417 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7419 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7421 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7423 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7425 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7427 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7429 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7431 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7433 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7435 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7437 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7439 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7441 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7442 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7444 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7446 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7448 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7450 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7452 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7454 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7456 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7458 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7460 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7462 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7464 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7466 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7468 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7470 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7472 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7475 $nm -p $* 2>/dev/null >libc.tmp
7476 $grep fprintf libc.tmp > libc.ptf
7477 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7478 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7484 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7486 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7487 for thisname in $libnames $libc; do
7488 $ar t $thisname >>libc.tmp
7490 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7492 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7493 # Repeat libc to extract forwarders to DLL entries too
7494 for thisname in $libnames $libc; do
7495 $ar tv $thisname >>libc.tmp
7496 # Revision 50 of EMX has bug in $ar.
7497 # it will not extract forwarders to DLL entries
7498 # Use emximp which will extract exactly them.
7499 emximp -o tmp.imp $thisname \
7501 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7502 < tmp.imp >>libc.tmp
7505 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7508 echo "$ar didn't seem to work right." >&4
7509 echo "Maybe this is a Cray...trying bld instead..." >&4
7510 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7512 for thisname in $libnames; do
7514 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7515 $ar t $thisname >>libc.tmp
7519 echo "That didn't work either. Giving up." >&4
7529 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7530 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7532 *) if $test -f /lib/syscalls.exp; then
7534 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7535 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7541 $rm -f libnames libpath
7543 : see if dld is available
7547 : is a C symbol defined?
7550 -v) tf=libc.tmp; tdc="";;
7551 -a) tf=libc.tmp; tdc="[]";;
7552 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7555 case "$reuseval-$4" in
7557 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7562 if $test "$runnm" = true; then
7563 if $contains $tlook $tf >/dev/null 2>&1; then
7565 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7566 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7567 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7568 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7569 $rm -f try$_exe try.c core core.* try.core;
7572 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7573 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7574 $rm -f try$_exe try.c;
7579 $define) tval=true;;
7586 : define an is-in-libc? function
7587 inlibc='echo " "; td=$define; tu=$undef;
7588 sym=$1; var=$2; eval "was=\$$2";
7590 case "$reuseval$was" in
7600 echo "$sym() found." >&4;
7601 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7603 echo "$sym() NOT found." >&4;
7604 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7608 $define) echo "$sym() found." >&4;;
7609 *) echo "$sym() NOT found." >&4;;
7613 : see if dlopen exists
7615 xxx_ccflags="$ccflags"
7617 : with g++ one needs -shared to get is-in-libc to work for dlopen
7618 case "$gccversion" in
7620 *) case "$d_cplusplus" in
7621 "$define") ccflags="$ccflags -shared" ;;
7628 ccflags="$xxx_ccflags"
7630 : see if this is a unistd.h system
7631 set unistd.h i_unistd
7634 : determine which dynamic loading, if any, to compile in
7636 dldir="ext/DynaLoader"
7649 $define) dflt='y' ;;
7652 $define) dflt='y' ;;
7654 : Does a dl_xxx.xs file exist for this operating system
7655 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7658 rp="Do you wish to use dynamic loading?"
7665 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7666 dflt="$dldir/dl_${osname}.xs"
7667 elif $test "$d_dlopen" = "$define" ; then
7668 dflt="$dldir/dl_dlopen.xs"
7669 elif $test "$i_dld" = "$define" ; then
7670 dflt="$dldir/dl_dld.xs"
7675 *) dflt="$dldir/$dlsrc"
7678 echo "The following dynamic loading files are available:"
7679 : Can not go over to $dldir because getfile has path hard-coded in.
7680 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7681 rp="Source file to use for dynamic loading"
7687 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7691 Some systems may require passing special flags to $cc -c to
7692 compile modules that will be used to create a shared library.
7693 To use no flags, say "none".
7696 case "$cccdlflags" in
7697 '') case "$gccversion" in
7698 '') case "$osname" in
7700 next) dflt='none' ;;
7701 irix*) dflt='-KPIC' ;;
7702 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7703 sunos) dflt='-pic' ;;
7707 *) case "$osname" in
7708 darwin) dflt='none' ;;
7709 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7714 *) dflt="$cccdlflags" ;;
7716 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7719 none) cccdlflags=' ' ;;
7720 *) cccdlflags="$ans" ;;
7725 Some systems use ld to create libraries that can be dynamically loaded,
7726 while other systems (such as those using ELF) use $cc.
7730 '') $cat >try.c <<EOM
7731 /* Test for whether ELF binaries are produced */
7743 int i = open("a.out",O_RDONLY);
7746 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7747 exit(0); /* succeed (yes, it's ELF) */
7752 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7754 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7758 echo "I'll use ld to build dynamic libraries."
7767 rp="What command should be used to create dynamic libraries?"
7773 Some systems may require passing special flags to $ld to create a
7774 library that can be dynamically loaded. If your ld flags include
7775 -L/other/path options to locate libraries outside your loader's normal
7776 search path, you may need to specify those -L options here as well. To
7777 use no flags, say "none".
7780 case "$lddlflags" in
7781 '') case "$osname" in
7782 beos) dflt='-nostart' ;;
7784 case "$gccversion" in
7785 '') dflt="$dflt +vnocompatwarnings" ;;
7788 linux|irix*|gnu*) dflt='-shared' ;;
7789 next) dflt='none' ;;
7790 solaris) dflt='-G' ;;
7791 sunos) dflt='-assert nodefinitions' ;;
7792 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7796 *) dflt="$lddlflags" ;;
7799 : Try to guess additional flags to pick up local libraries.
7800 : Be careful not to append to a plain 'none'
7804 for thisflag in $ldflags; do
7809 *) dflt="$dflt $thisflag" ;;
7816 ''|' ') dflt='none' ;;
7819 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7822 none) lddlflags=' ' ;;
7823 *) lddlflags="$ans" ;;
7828 Some systems may require passing special flags to $cc to indicate that
7829 the resulting executable will use dynamic linking. To use no flags,
7833 case "$ccdlflags" in
7834 '') case "$osname" in
7835 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7836 next|sunos) dflt='none' ;;
7840 *) dflt="$ccdlflags" ;;
7842 rp="Any special flags to pass to $cc to use dynamic linking?"
7845 none) ccdlflags=' ' ;;
7846 *) ccdlflags="$ans" ;;
7860 # No dynamic loading being used, so don't bother even to prompt.
7863 *) case "$useshrplib" in
7864 '') case "$osname" in
7865 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7867 also='Building a shared libperl is required for dynamic loading to work on your system.'
7872 also='Building a shared libperl is needed for MAB support.'
7890 The perl executable is normally obtained by linking perlmain.c with
7891 libperl${_a}, any static extensions (usually just DynaLoader), and
7892 any other libraries needed on this system (such as -lm, etc.). Since
7893 your system supports dynamic loading, it is probably possible to build
7894 a shared libperl.$so. If you will have more than one executable linked
7895 to libperl.$so, this will significantly reduce the size of each
7896 executable, but it may have a noticeable effect on performance. The
7897 default is probably sensible for your system.
7901 rp="Build a shared libperl.$so (y/n)"
7905 useshrplib='true' ;;
7906 *) useshrplib='false' ;;
7911 case "$useshrplib" in
7915 # Figure out a good name for libperl.so. Since it gets stored in
7916 # a version-specific architecture-dependent library, the version
7917 # number isn't really that important, except for making cc/ld happy.
7919 # A name such as libperl.so.3.1
7920 majmin="libperl.$so.$patchlevel.$subversion"
7921 # A name such as libperl.so.301
7922 majonly=`echo $patchlevel $subversion |
7923 $awk '{printf "%d%02d", $1, $2}'`
7924 majonly=libperl.$so.$majonly
7925 # I'd prefer to keep the os-specific stuff here to a minimum, and
7926 # rely on figuring it out from the naming of libc.
7927 case "${osname}${osvers}" in
7930 # XXX How handle the --version stuff for MAB?
7932 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
7935 cygwin*) # ld links against an importlib
7936 dflt=libperl$lib_ext
7938 *) # Try to guess based on whether libc has major.minor.
7940 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7941 *libc.$so.[0-9]*) dflt=$majonly ;;
7942 *) dflt=libperl.$so ;;
7952 I need to select a good name for the shared libperl. If your system uses
7953 library names with major and minor numbers, then you might want something
7954 like $majmin. Alternatively, if your system uses a single version
7955 number for shared libraries, then you might want to use $majonly.
7956 Or, your system might be quite happy with a simple libperl.$so.
7958 Since the shared libperl will get installed into a version-specific
7959 architecture-dependent directory, the version number of the shared perl
7960 library probably isn't important, so the default should be o.k.
7963 rp='What name do you want to give to the shared libperl?'
7966 echo "Ok, I'll use $libperl"
7969 libperl="libperl${_a}"
7973 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7977 WARNING: Use of the shrpdir variable for the installation location of
7978 the shared $libperl is not supported. It was never documented and
7979 will not work in this version. Let me (perlbug@perl.org)
7980 know of any problems this may cause.
7986 But your current setting of $shrpdir is
7987 the default anyway, so it's harmless.
7992 Further, your current attempted setting of $shrpdir
7993 conflicts with the value of $archlibexp/CORE
7994 that installperl will use.
8001 # How will the perl executable find the installed shared $libperl?
8002 # Add $xxx to ccdlflags.
8003 # If we can't figure out a command-line option, use $shrpenv to
8004 # set env LD_RUN_PATH. The main perl makefile uses this.
8005 shrpdir=$archlibexp/CORE
8008 if "$useshrplib"; then
8011 # We'll set it in Makefile.SH...
8016 freebsd|netbsd|openbsd|interix|dragonfly)
8017 xxx="-Wl,-R$shrpdir"
8019 bsdos|linux|irix*|dec_osf|gnu*)
8020 xxx="-Wl,-rpath,$shrpdir"
8023 # next doesn't like the default...
8026 # beos doesn't like the default, either.
8029 # hpux doesn't like the default, either.
8030 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8033 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8039 # Only add $xxx if it isn't already in ccdlflags.
8040 case " $ccdlflags " in
8042 *) ccdlflags="$ccdlflags $xxx"
8045 Adding $xxx to the flags
8046 passed to $ld so that the perl executable will find the
8047 installed shared $libperl.
8055 # Fix ccdlflags in AIX for building external extensions.
8056 # (For building Perl itself bare -bE:perl.exp is needed,
8057 # Makefile.SH takes care of this.)
8059 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8061 # Respect a hint or command-line value.
8063 '') shrpenv="$tmp_shrpenv" ;;
8065 case "$ldlibpthname" in
8066 '') ldlibpthname=LD_LIBRARY_PATH ;;
8067 none) ldlibpthname='' ;;
8070 : determine where manual pages are on this system
8074 syspath='/usr/share/man/man1 /usr/man/man1'
8075 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8076 syspath="$syspath /usr/man/u_man/man1"
8077 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8078 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8079 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8080 sysman=`./loc . /usr/man/man1 $syspath`
8083 if $test -d "$sysman"; then
8084 echo "System manual is in $sysman." >&4
8086 echo "Could not find manual pages in source form." >&4
8089 : determine where manual pages go
8090 set man1dir man1dir none
8094 $spackage has manual pages available in source form.
8098 echo "However, you don't have nroff, so they're probably useless to you."
8100 '') man1dir="none";;
8103 echo "If you don't want the manual sources installed, answer 'none'."
8108 lookpath="$prefixexp/share/man/man1"
8109 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8110 lookpath="$lookpath $prefixexp/man/p_man/man1"
8111 lookpath="$lookpath $prefixexp/man/u_man/man1"
8112 lookpath="$lookpath $prefixexp/man/man.1"
8114 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8115 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8125 rp="Where do the main $spackage manual pages (source) go?"
8127 if $test "X$man1direxp" != "X$ansexp"; then
8138 : What suffix to use on installed man pages
8145 rp="What suffix should be used for the main $spackage man pages?"
8147 '') case "$man1dir" in
8161 *) dflt="$man1ext";;
8168 : see if we can have long filenames
8170 first=123456789abcdef
8172 if (echo hi >$first) 2>/dev/null; then
8173 if $test -f 123456789abcde; then
8174 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8177 echo 'You can have filenames longer than 14 characters.'>&4
8182 You can't have filenames longer than 14 chars.
8183 You can't even think about them!
8189 $rm -rf 123456789abcde*
8191 : determine where library module manual pages go
8192 set man3dir man3dir none
8196 $spackage has manual pages for many of the library modules.
8202 However, you don't have nroff, so they're probably useless to you.
8205 '') man3dir="none";;
8209 case "$d_flexfnam" in
8212 However, your system can't handle the long file names like File::Basename.3.
8215 '') man3dir="none";;
8219 echo "If you don't want the manual sources installed, answer 'none'."
8220 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8222 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8223 if $test -d "$privlib/man/man3"; then
8226 WARNING: Previous versions of perl installed man3 pages into
8227 $privlib/man/man3. This version will suggest a
8228 new default of $dflt.
8232 rp='Do you wish to preserve the old behavior?(y/n)'
8235 y*) dflt="$privlib/man/man3" ;;
8240 *) dflt="$man3dir" ;;
8247 rp="Where do the $package library man pages (source) go?"
8257 : What suffix to use on installed man pages
8263 rp="What suffix should be used for the $package library man pages?"
8265 '') case "$man3dir" in
8279 *) dflt="$man3ext";;
8286 : see if we have to deal with yellow pages, now NIS.
8287 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8288 if $test -f /usr/etc/nibindd; then
8290 echo "I'm fairly confident you're on a NeXT."
8292 rp='Do you get the hosts file via NetInfo?'
8301 y*) hostcat='nidump hosts .';;
8302 *) case "$hostcat" in
8303 nidump*) hostcat='';;
8313 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8321 rp='Are you getting the hosts file via yellow pages?'
8324 y*) hostcat='ypcat hosts';;
8325 *) hostcat='cat /etc/hosts';;
8331 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8334 '') test -f /etc/group && groupcat='cat /etc/group';;
8337 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8340 : now get the host name
8342 echo "Figuring out host name..." >&4
8343 case "$myhostname" in
8345 echo 'Maybe "hostname" will work...'
8346 if tans=`sh -c hostname 2>&1` ; then
8354 if $test "$cont"; then
8356 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8357 if tans=`cat /etc/systemid 2>&1` ; then
8359 phostname='cat /etc/systemid'
8360 echo "Whadyaknow. Xenix always was a bit strange..."
8363 elif $test -r /etc/systemid; then
8364 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8367 if $test "$cont"; then
8368 echo 'No, maybe "uuname -l" will work...'
8369 if tans=`sh -c 'uuname -l' 2>&1` ; then
8371 phostname='uuname -l'
8373 echo 'Strange. Maybe "uname -n" will work...'
8374 if tans=`sh -c 'uname -n' 2>&1` ; then
8376 phostname='uname -n'
8378 echo 'Oh well, maybe I can mine it out of whoami.h...'
8379 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8380 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8381 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8383 case "$myhostname" in
8384 '') echo "Does this machine have an identity crisis or something?"
8387 echo "Well, you said $myhostname before..."
8388 phostname='echo $myhostname';;
8394 case "$myhostname" in
8395 '') myhostname=noname ;;
8397 : you do not want to know about this
8402 if $test "$myhostname" ; then
8404 rp='Your host name appears to be "'$myhostname'".'" Right?"
8412 : bad guess or no guess
8413 while $test "X$myhostname" = X ; do
8415 rp="Please type the (one word) name of your host:"
8420 : translate upper to lower if necessary
8421 case "$myhostname" in
8423 echo "(Normalizing case in your host name)"
8424 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8428 case "$myhostname" in
8430 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8431 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8432 echo "(Trimming domain name from host name--host name is now $myhostname)"
8434 *) case "$mydomain" in
8437 test "X$hostcat" = "Xypcat hosts" &&
8438 ypmatch "$myhostname" hosts 2>/dev/null |\
8439 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8442 test "X$hostcat" != "X" &&
8443 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8444 /[ ]$myhostname[ . ]/p" > hosts
8447 if $test -f hosts; then
8448 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8449 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8450 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8451 hosts | $sort | $uniq | \
8452 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8453 case `$echo X$dflt` in
8454 X*\ *) echo "(Several hosts in the database matched hostname)"
8457 X.) echo "(You do not have fully-qualified names in the hosts database)"
8461 echo "(I cannot locate a hosts database anywhere)"
8466 tans=`./loc resolv.conf X /etc /usr/etc`
8467 if $test -f "$tans"; then
8468 echo "(Attempting domain name extraction from $tans)"
8469 dflt=.`$sed -n -e 's/ / /g' \
8470 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8471 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8473 .) dflt=.`$sed -n -e 's/ / /g' \
8474 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8475 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8482 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8483 dflt=.`sh -c domainname 2>/dev/null`
8486 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8490 case "$dflt$osname" in
8491 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8492 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8496 .) echo "(Lost all hope -- silly guess then)"
8502 *) dflt="$mydomain";;
8506 rp="What is your domain name?"
8516 : translate upper to lower if necessary
8519 echo "(Normalizing case in your domain name)"
8520 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8524 : a little sanity check here
8525 case "$phostname" in
8528 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8529 $myhostname$mydomain|$myhostname) ;;
8531 case "$phostname" in
8533 echo "(That doesn't agree with your whoami.h file, by the way.)"
8536 echo "(That doesn't agree with your $phostname command, by the way.)"
8546 I need to get your e-mail address in Internet format if possible, i.e.
8547 something like user@host.domain. Please answer accurately since I have
8548 no easy means to double check it. The default value provided below
8549 is most probably close to reality but may not be valid from outside
8550 your organization...
8554 while test "$cont"; do
8556 '') dflt="$cf_by@$myhostname$mydomain";;
8557 *) dflt="$cf_email";;
8559 rp='What is your e-mail address?'
8565 rp='Address does not look like an Internet one. Use it anyway?'
8581 If you or somebody else will be maintaining perl at your site, please
8582 fill in the correct e-mail address here so that they may be contacted
8583 if necessary. Currently, the "perlbug" program included with perl
8584 will send mail to this address in addition to perlbug@perl.org. You may
8585 enter "none" for no administrator.
8588 case "$perladmin" in
8589 '') dflt="$cf_email";;
8590 *) dflt="$perladmin";;
8592 rp='Perl administrator e-mail address'
8596 : determine whether to only install version-specific parts.
8599 Do you want to install only the version-specific parts of the perl
8600 distribution? Usually you do *not* want to do this.
8602 case "$versiononly" in
8603 "$define"|[Yy]*|true) dflt='y' ;;
8606 rp="Do you want to install only the version-specific parts of perl?"
8609 [yY]*) val="$define";;
8615 case "$versiononly" in
8616 "$define") inc_version_list=''
8617 inc_version_list_init=0
8621 : figure out how to guarantee perl startup
8622 : XXX Note that this currently takes advantage of the bug that binexp ignores
8623 : the Configure -Dinstallprefix setting, which in turn means that under
8624 : relocatable @INC, initialinstalllocation is what binexp started as.
8625 case "$startperl" in
8627 case "$sharpbang" in
8631 I can use the #! construct to start perl on your system. This will
8632 make startup of perl scripts faster, but may cause problems if you
8633 want to share those scripts and perl is not in a standard place
8634 ($initialinstalllocation/perl) on all your platforms. The alternative
8635 is to force a shell by starting the script with a single ':' character.
8638 case "$versiononly" in
8639 "$define") dflt="$initialinstalllocation/perl$version";;
8640 *) dflt="$initialinstalllocation/perl";;
8642 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8645 none) startperl=": # use perl";;
8646 *) startperl="#!$ans"
8647 if $test 30 -lt `echo "$ans" | wc -c`; then
8650 WARNING: Some systems limit the #! command to 32 characters.
8651 If you experience difficulty running Perl scripts with #!, try
8652 installing Perl in a directory with a shorter pathname.
8658 *) startperl=": # use perl"
8663 echo "I'll use $startperl to start perl scripts."
8665 : figure best path for perl in scripts
8668 case "$versiononly" in
8669 "$define") perlpath="$initialinstalllocation/perl$version";;
8670 *) perlpath="$initialinstalllocation/perl";;
8672 case "$startperl" in
8677 I will use the "eval 'exec'" idiom to start Perl on your system.
8678 I can use the full path of your Perl binary for this purpose, but
8679 doing so may cause problems if you want to share those scripts and
8680 Perl is not always in a standard place ($initialinstalllocation/perl).
8683 dflt="$initialinstalllocation/perl"
8684 rp="What path shall I use in \"eval 'exec'\"?"
8691 case "$startperl" in
8693 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8696 : determine where public executable scripts go
8697 set scriptdir scriptdir
8699 case "$scriptdir" in
8702 : guess some guesses
8703 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8704 $test -d /usr/share/bin && dflt=/usr/share/bin
8705 $test -d /usr/local/script && dflt=/usr/local/script
8706 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8707 $test -d $prefixexp/script && dflt=$prefixexp/script
8711 *) dflt="$scriptdir"
8716 Some installations have a separate directory just for executable scripts so
8717 that they can mount it across multiple architectures but keep the scripts in
8718 one spot. You might, for example, have a subdirectory of /usr/share for this.
8719 Or you might just lump your scripts in with all your other executables.
8723 rp='Where do you keep publicly executable scripts?'
8725 if $test "X$ansexp" != "X$scriptdirexp"; then
8731 : A little fix up for an irregularly named variable.
8732 installscript="$installscriptdir"
8734 : determine where add-on public executables go
8736 '') dflt=$siteprefix/bin ;;
8740 rp='Pathname where the add-on public executables should be installed?'
8745 : determine where add-on html pages go
8746 : There is no standard location, so try to copy the previously-selected
8747 : directory structure for the core html pages.
8748 case "$sitehtml1dir" in
8749 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8750 *) dflt=$sitehtml1dir ;;
8753 ''|' ') dflt=none ;;
8756 rp='Pathname where the site-specific html pages should be installed?'
8758 prefixvar=sitehtml1dir
8761 : determine where add-on library html pages go
8762 : There is no standard location, so try to copy the previously-selected
8763 : directory structure for the core html pages.
8764 case "$sitehtml3dir" in
8765 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8766 *) dflt=$sitehtml3dir ;;
8769 ''|' ') dflt=none ;;
8772 rp='Pathname where the site-specific library html pages should be installed?'
8774 prefixvar=sitehtml3dir
8777 : determine where add-on manual pages go
8778 case "$siteman1dir" in
8779 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8780 *) dflt=$siteman1dir ;;
8783 ''|' ') dflt=none ;;
8786 rp='Pathname where the site-specific manual pages should be installed?'
8788 prefixvar=siteman1dir
8791 : determine where add-on library man pages go
8792 case "$siteman3dir" in
8793 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8794 *) dflt=$siteman3dir ;;
8797 ''|' ') dflt=none ;;
8800 rp='Pathname where the site-specific library manual pages should be installed?'
8802 prefixvar=siteman3dir
8805 : determine where add-on public executable scripts go
8806 case "$sitescript" in
8807 '') dflt=$siteprefix/script
8808 $test -d $dflt || dflt=$sitebin ;;
8809 *) dflt="$sitescript" ;;
8812 rp='Pathname where add-on public executable scripts should be installed?'
8814 prefixvar=sitescript
8817 case "$usefaststdio" in
8818 $define|true|[yY]*|'')
8819 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8829 Perl can be built to use 'fast stdio', which means using the stdio
8830 library but also directly manipulating the stdio buffers to enable
8831 faster I/O. Using stdio is better for backward compatibility (especially
8832 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8833 interface has been preferred instead of stdio.
8835 If this doesn't make any sense to you, just accept the default '$dflt'.
8837 rp='Use the "fast stdio" if available?'
8840 y|Y) val="$define" ;;
8847 : define an is-a-typedef? function
8848 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8850 "") inclist="sys/types.h";;
8852 eval "varval=\$$var";
8856 for inc in $inclist; do
8857 echo "#include <$inc>" >>temp.c;
8859 echo "#ifdef $type" >> temp.c;
8860 echo "printf(\"We have $type\");" >> temp.c;
8861 echo "#endif" >> temp.c;
8862 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8863 if $contains $type temp.E >/dev/null 2>&1; then
8869 *) eval "$var=\$varval";;
8872 : define an is-a-typedef? function that prompts if the type is not available.
8873 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8875 "") inclist="sys/types.h";;
8877 eval "varval=\$$var";
8881 for inc in $inclist; do
8882 echo "#include <$inc>" >>temp.c;
8884 echo "#ifdef $type" >> temp.c;
8885 echo "printf(\"We have $type\");" >> temp.c;
8886 echo "#endif" >> temp.c;
8887 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8889 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8890 if $contains $type temp.E >/dev/null 2>&1; then
8891 echo "$type found." >&4;
8894 echo "$type NOT found." >&4;
8900 *) eval "$var=\$varval";;
8903 : see what type lseek is declared as in the kernel
8904 rp="What is the type used for lseek's offset on this system?"
8905 set off_t lseektype long stdio.h sys/types.h
8909 echo "Checking to see how big your file offsets are..." >&4
8911 #include <sys/types.h>
8915 printf("%d\n", (int)sizeof($lseektype));
8920 if eval $compile_ok; then
8921 lseeksize=`$run ./try`
8922 echo "Your file offsets are $lseeksize bytes long."
8926 echo "(I can't seem to compile the test program. Guessing...)"
8927 rp="What is the size of your file offsets (in bytes)?"
8933 : see what type file positions are declared as in the library
8934 rp="What is the type for file position used by fsetpos()?"
8935 set fpos_t fpostype long stdio.h sys/types.h
8940 *_t) zzz="$fpostype" ;;
8943 echo "Checking the size of $zzz..." >&4
8945 #include <sys/types.h>
8952 printf("%d\n", (int)sizeof($fpostype));
8957 if eval $compile_ok; then
8961 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8964 echo "Your $zzz is $fpossize bytes long."
8970 echo "(I can't compile the test program. Guessing...)" >&4
8971 rp="What is the size of your file positions (in bytes)?"
8976 # Backward compatibility (uselfs is deprecated).
8978 "$define"|true|[yY]*)
8981 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8983 uselargefiles="$define"
8987 case "$lseeksize:$fpossize" in
8990 You can have files larger than 2 gigabytes.
8993 *) case "$uselargefiles" in
8994 "$undef"|false|[nN]*) dflt='n' ;;
8999 Perl can be built to understand large files (files larger than 2 gigabytes)
9000 on some systems. To do so, Configure can be run with -Duselargefiles.
9002 If this doesn't make any sense to you, just accept the default '$dflt'.
9004 rp='Try to understand large files, if available?'
9007 y|Y) val="$define" ;;
9014 : Look for a hint-file generated 'call-back-unit'. If the
9015 : user has specified that a large files perl is to be built,
9016 : we may need to set or change some other defaults.
9017 if $test -f uselargefiles.cbu; then
9018 echo "Your platform has some specific hints regarding large file builds, using them..."
9019 . ./uselargefiles.cbu
9021 case "$uselargefiles" in
9023 if $test -f uselargefiles.cbu; then
9025 echo "Rechecking to see how big your file offsets are..." >&4
9027 #include <sys/types.h>
9031 printf("%d\n", (int)sizeof($lseektype));
9036 if eval $compile_ok; then
9037 lseeksize=`$run ./try`
9038 $echo "Your file offsets are now $lseeksize bytes long."
9042 echo "(I can't seem to compile the test program. Guessing...)"
9043 rp="What is the size of your file offsets (in bytes)?"
9048 *_t) zzz="$fpostype" ;;
9051 $echo $n "Rechecking the size of $zzz...$c" >&4
9053 #include <sys/types.h>
9060 printf("%d\n", (int)sizeof($fpostype));
9065 if eval $compile_ok; then
9070 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9073 echo " $fpossize bytes." >&4
9079 echo "(I can't compile the test program. Guessing...)" >&4
9080 rp="What is the size of your file positions (in bytes)?"
9089 case "$vendorprefix" in
9090 '') d_vendorbin="$undef"
9094 *) d_vendorbin="$define"
9095 : determine where vendor-supplied executables go.
9096 case "$vendorbin" in
9097 '') dflt=$vendorprefix/bin ;;
9098 *) dflt="$vendorbin" ;;
9101 rp='Pathname for the vendor-supplied executables directory?'
9104 vendorbinexp="$ansexp"
9110 case "$vendorprefix" in
9111 '') vendorhtml1dir=''
9112 vendorhtml1direxp=''
9114 *) : determine where vendor-supplied html pages go.
9115 : There is no standard location, so try to copy the previously-selected
9116 : directory structure for the core html pages.
9117 : XXX Better default suggestions would be welcome.
9118 case "$vendorhtml1dir" in
9119 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9120 *) dflt=$vendorhtml1dir ;;
9123 ''|' ') dflt=none ;;
9126 rp='Pathname for the vendor-supplied html pages?'
9128 vendorhtml1dir="$ans"
9129 vendorhtml1direxp="$ansexp"
9132 : Use ' ' for none so value is preserved next time through Configure
9133 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9134 prefixvar=vendorhtml1dir
9137 case "$vendorprefix" in
9138 '') vendorhtml3dir=''
9139 vendorhtml3direxp=''
9141 *) : determine where vendor-supplied module html pages go.
9142 : There is no standard location, so try to copy the previously-selected
9143 : directory structure for the core html pages.
9144 : XXX Better default suggestions would be welcome.
9145 case "$vendorhtml3dir" in
9146 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9147 *) dflt=$vendorhtml3dir ;;
9150 ''|' ') dflt=none ;;
9153 rp='Pathname for the vendor-supplied html pages?'
9155 vendorhtml3dir="$ans"
9156 vendorhtml3direxp="$ansexp"
9159 : Use ' ' for none so value is preserved next time through Configure
9160 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9161 prefixvar=vendorhtml3dir
9164 case "$vendorprefix" in
9165 '') vendorman1dir=''
9168 *) : determine where vendor-supplied manual pages go.
9169 case "$vendorman1dir" in
9170 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9171 *) dflt=$vendorman1dir ;;
9174 ''|' ') dflt=none ;;
9177 rp='Pathname for the vendor-supplied manual section 1 pages?'
9179 vendorman1dir="$ans"
9180 vendorman1direxp="$ansexp"
9183 : Use ' ' for none so value is preserved next time through Configure
9184 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9185 prefixvar=vendorman1dir
9188 case "$vendorprefix" in
9189 '') vendorman3dir=''
9192 *) : determine where vendor-supplied module manual pages go.
9193 case "$vendorman3dir" in
9194 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9195 *) dflt=$vendorman3dir ;;
9198 ''|' ') dflt=none ;;
9201 rp='Pathname for the vendor-supplied manual section 3 pages?'
9203 vendorman3dir="$ans"
9204 vendorman3direxp="$ansexp"
9207 : Use ' ' for none so value is preserved next time through Configure
9208 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9209 prefixvar=vendorman3dir
9212 case "$vendorprefix" in
9213 '') d_vendorscript="$undef"
9217 *) d_vendorscript="$define"
9218 : determine where vendor-supplied scripts go.
9219 case "$vendorscript" in
9220 '') dflt=$vendorprefix/script
9221 $test -d $dflt || dflt=$vendorbin ;;
9222 *) dflt="$vendorscript" ;;
9226 The installation process will create a directory for
9227 vendor-supplied scripts.
9231 rp='Pathname for the vendor-supplied scripts directory?'
9234 vendorscriptexp="$ansexp"
9237 prefixvar=vendorscript
9240 : see if qgcvt exists
9246 if $test X"$d_longdbl" = X"$define"; then
9248 echo "Checking how to print long doubles..." >&4
9250 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9251 $cat >try.c <<'EOCP'
9252 #include <sys/types.h>
9256 printf("%.3f\n", d);
9260 if eval $compile; then
9264 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9265 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9266 echo "We will use %f."
9272 if $test X"$sPRIfldbl" = X; then
9273 $cat >try.c <<'EOCP'
9274 #include <sys/types.h>
9277 long double d = 123.456;
9278 printf("%.3Lf\n", d);
9282 if eval $compile; then
9286 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9287 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9288 echo "We will use %Lf."
9294 if $test X"$sPRIfldbl" = X; then
9295 $cat >try.c <<'EOCP'
9296 #include <sys/types.h>
9299 long double d = 123.456;
9300 printf("%.3llf\n", d);
9304 if eval $compile; then
9308 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9309 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9310 echo "We will use %llf."
9316 if $test X"$sPRIfldbl" = X; then
9317 $cat >try.c <<'EOCP'
9318 #include <sys/types.h>
9321 long double d = 123.456;
9322 printf("%.3lf\n", d);
9326 if eval $compile; then
9330 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9331 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9332 echo "We will use %lf."
9338 if $test X"$sPRIfldbl" = X; then
9339 echo "Cannot figure out how to print long doubles." >&4
9341 sSCNfldbl=$sPRIfldbl # expect consistency
9348 case "$sPRIfldbl" in
9349 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9350 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9351 d_SCNfldbl="$undef";
9353 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9354 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9355 d_SCNfldbl="$define";
9359 : Check how to convert floats to strings.
9361 if test "X$d_Gconvert" = X; then
9364 echo "Checking for an efficient way to convert floats to strings."
9366 case "$uselongdouble" in
9367 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9369 case "$d_longdbl" in
9370 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9372 case "$d_PRIgldbl" in
9373 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9377 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9378 char *myname = "gconvert";
9381 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9382 char *myname = "gcvt";
9385 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9386 char *myname = "qgcvt";
9387 #define DOUBLETYPE long double
9390 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9392 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9394 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9397 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9399 char *myname = "sprintf";
9403 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9404 #define DOUBLETYPE long double
9406 #define DOUBLETYPE double
9412 #define I_STDLIB $i_stdlib
9418 checkit(expect, got)
9422 if (strcmp(expect, got)) {
9423 printf("%s oddity: Expected %s, got %s\n",
9424 myname, expect, got);
9434 /* This must be 1st test on (which?) platform */
9435 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9436 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9437 checkit("0.1", buf);
9439 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9440 checkit("0.01", buf);
9442 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9443 checkit("0.001", buf);
9445 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9446 checkit("0.0001", buf);
9448 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9449 if (strlen(buf) > 5)
9450 checkit("9e-005", buf); /* for Microsoft ?? */
9452 checkit("9e-05", buf);
9454 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9457 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9458 checkit("1.1", buf);
9460 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9461 checkit("1.01", buf);
9463 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9464 checkit("1.001", buf);
9466 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9467 checkit("1.0001", buf);
9469 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9470 checkit("1.00001", buf);
9472 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9473 checkit("1.000001", buf);
9475 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9478 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9481 /* Some Linux gcvt's give 1.e+5 here. */
9482 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9483 checkit("100000", buf);
9485 /* Some Linux gcvt's give -1.e+5 here. */
9486 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9487 checkit("-100000", buf);
9489 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9490 checkit("123.456", buf);
9492 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9493 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9494 /* 34 should be enough to scare even long double
9495 * places into using the e notation. */
9496 if (strlen(buf) > 5)
9497 checkit("1e+034", buf); /* for Microsoft */
9499 checkit("1e+34", buf);
9501 /* For Perl, if you add additional tests here, also add them to
9502 * t/base/num.t for benefit of platforms not using Configure or
9503 * overriding d_Gconvert */
9508 : first add preferred functions to our list
9510 for xxx_convert in $gconvert_preference; do
9511 case $xxx_convert in
9512 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9513 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9516 : then add any others
9517 for xxx_convert in gconvert gcvt sprintf; do
9520 *) xxx_list="$xxx_list $xxx_convert" ;;
9524 case "$d_longdbl$uselongdouble" in
9526 : again, add prefered functions to our list first
9528 for xxx_convert in $gconvert_ld_preference; do
9529 case $xxx_convert in
9530 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9531 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9534 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9535 for xxx_convert in qgcvt sprintf $xxx_list; do
9536 case "$xxx_ld_list" in
9537 $xxx_convert*|*" $xxx_convert"*) ;;
9538 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9541 : if sprintf cannot do long doubles, move it to the end
9542 if test "$d_PRIgldbl" != "$define"; then
9543 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9545 : if no qgcvt, remove it
9546 if test "$d_qgcvt" != "$define"; then
9547 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9550 xxx_list="$xxx_ld_list"
9554 for xxx_convert in $xxx_list; do
9555 echo "Trying $xxx_convert..."
9557 set try -DTRY_$xxx_convert
9558 if eval $compile; then
9559 echo "$xxx_convert() found." >&4
9561 echo "I'll use $xxx_convert to convert floats into a string." >&4
9564 echo "...But $xxx_convert didn't work as I expected."
9568 echo "$xxx_convert NOT found." >&4
9572 if test X$xxx_convert = X; then
9573 echo "*** WHOA THERE!!! ***" >&4
9574 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9578 case "$xxx_convert" in
9579 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9580 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9581 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9582 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9583 "$define$define$define")
9584 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9585 "$define$define$undef")
9586 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9587 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9594 : see if _fwalk exists
9598 : Initialize h_fcntl
9601 : Initialize h_sysfile
9604 : access call always available on UNIX
9608 : locate the flags for 'access()'
9612 $cat >access.c <<EOCP
9613 #include <sys/types.h>
9618 #include <sys/file.h>
9631 : check sys/file.h first, no particular reason here
9632 if $test `./findhdr sys/file.h` && \
9633 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9635 echo "<sys/file.h> defines the *_OK access constants." >&4
9636 elif $test `./findhdr fcntl.h` && \
9637 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9639 echo "<fcntl.h> defines the *_OK access constants." >&4
9640 elif $test `./findhdr unistd.h` && \
9641 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9642 echo "<unistd.h> defines the *_OK access constants." >&4
9644 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9650 : see if accessx exists
9651 set accessx d_accessx
9654 : see if aintl exists
9658 : see if alarm exists
9662 : see if POSIX threads are available
9663 set pthread.h i_pthread
9666 : define a fucntion to check prototypes
9667 $cat > protochk <<EOSH
9670 optimize="$optimize"
9672 prototype="$prototype"
9675 usethreads=$usethreads
9676 i_pthread=$i_pthread
9677 pthread_h_first=$pthread_h_first
9680 $cat >> protochk <<'EOSH'
9685 while test $# -ge 2; do
9687 $define) echo "#include <$2>" >> try.c ;;
9688 literal) echo "$2" >> try.c ;;
9690 # Extra magic for the benefit of systems that need pthread.h
9691 # to be included early to correctly detect threadsafe functions.
9692 # Such functions must guarantee themselves, though, that the usethreads
9693 # and i_pthread have been defined, before calling protochk.
9694 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9695 echo "#include <pthread.h>" >> try.c
9700 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9701 cat >> try.c <<'EOCP'
9702 #ifdef CAN_PROTOTYPE
9703 #define _(args) args
9708 echo "$foo" >> try.c
9709 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9710 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9718 hasproto='varname=$1; func=$2; shift; shift;
9719 while $test $# -ge 2; do
9721 $define) echo "#include <$2>";;
9725 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9726 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9727 echo "$func() prototype found.";
9730 echo "$func() prototype NOT found.";
9735 $rm -f try.c tryout.c'
9737 : see if sys/types.h has to be included
9738 set sys/types.h i_systypes
9741 : see if sys/select.h has to be included
9742 set sys/select.h i_sysselct
9745 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9746 while $test $# -ge 2; do
9748 $define) echo "#include <$2>";;
9752 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9754 if eval $compile; then
9763 : see if we should include time.h, sys/time.h, or both
9765 if test "X$timeincl" = X; then
9766 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9767 $echo $n "I'm now running the test program...$c"
9769 #include <sys/types.h>
9774 #ifdef SYSTIMEKERNEL
9777 #include <sys/time.h>
9780 #include <sys/select.h>
9793 struct timezone tzp;
9795 if (foo.tm_sec == foo.tm_sec)
9798 if (bar.tv_sec == bar.tv_sec)
9805 for s_timezone in '-DS_TIMEZONE' ''; do
9807 for s_timeval in '-DS_TIMEVAL' ''; do
9808 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9809 for i_time in '' '-DI_TIME'; do
9810 for i_systime in '-DI_SYSTIME' ''; do
9813 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9814 if eval $compile; then
9815 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9819 $echo $n "Succeeded with $flags$c"
9831 *SYSTIMEKERNEL*) i_systimek="$define"
9832 timeincl=`./findhdr sys/time.h`
9833 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9834 *) i_systimek="$undef";;
9837 *I_TIME*) i_time="$define"
9838 timeincl=`./findhdr time.h`" $timeincl"
9839 echo "We'll include <time.h>." >&4;;
9840 *) i_time="$undef";;
9843 *I_SYSTIME*) i_systime="$define"
9844 timeincl=`./findhdr sys/time.h`" $timeincl"
9845 echo "We'll include <sys/time.h>." >&4;;
9846 *) i_systime="$undef";;
9850 : see if struct tm knows about tm_zone
9851 case "$i_systime$i_time" in
9854 echo "Checking to see if your struct tm has tm_zone field..." >&4
9855 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9863 case "$d_tm_tm_zone" in
9864 "$define") echo "Yes, it does." ;;
9865 *) echo "No, it doesn't." ;;
9867 : see if struct tm knows about tm_gmtoff
9868 case "$i_systime$i_time" in
9871 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9872 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9880 case "$d_tm_tm_gmtoff" in
9881 "$define") echo "Yes, it does." ;;
9882 *) echo "No, it doesn't." ;;
9885 : see if asctime_r exists
9886 set asctime_r d_asctime_r
9888 case "$d_asctime_r" in
9890 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9891 case "$d_asctime_r_proto:$usethreads" in
9892 ":define") d_asctime_r_proto=define
9893 set d_asctime_r_proto asctime_r $hdrs
9897 case "$d_asctime_r_proto" in
9899 case "$asctime_r_proto" in
9900 ''|0) try='char* asctime_r(const struct tm*, char*);'
9901 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9903 case "$asctime_r_proto" in
9904 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9905 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9907 case "$asctime_r_proto" in
9908 ''|0) try='int asctime_r(const struct tm*, char*);'
9909 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9911 case "$asctime_r_proto" in
9912 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9913 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9915 case "$asctime_r_proto" in
9916 ''|0) d_asctime_r=undef
9918 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9919 * ) case "$asctime_r_proto" in
9920 REENTRANT_PROTO*) ;;
9921 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9923 echo "Prototype: $try" ;;
9926 *) case "$usethreads" in
9927 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9934 *) asctime_r_proto=0
9938 : see if atolf exists
9942 : see if atoll exists
9946 : Look for GCC-style attribute format
9947 case "$d_attribute_format" in
9950 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
9951 $cat >attrib.c <<'EOCP'
9953 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
9955 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9956 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9957 echo "Your C compiler doesn't support __attribute__((format))."
9960 echo "Your C compiler supports __attribute__((format))."
9964 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9968 *) val="$d_attribute_format" ;;
9970 set d_attribute_format
9974 : Look for GCC-style attribute malloc
9975 case "$d_attribute_malloc" in
9978 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
9979 $cat >attrib.c <<'EOCP'
9981 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
9983 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9984 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9985 echo "Your C compiler doesn't support __attribute__((malloc))."
9988 echo "Your C compiler supports __attribute__((malloc))."
9992 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9996 *) val="$d_attribute_malloc" ;;
9998 set d_attribute_malloc
10002 : Look for GCC-style attribute nonnull
10003 case "$d_attribute_nonnull" in
10006 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10007 $cat >attrib.c <<'EOCP'
10009 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10011 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10012 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10013 echo "Your C compiler doesn't support __attribute__((nonnull))."
10016 echo "Your C compiler supports __attribute__((nonnull))."
10020 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10024 *) val="$d_attribute_nonnull" ;;
10026 set d_attribute_nonnull
10030 : Look for GCC-style attribute noreturn
10031 case "$d_attribute_noreturn" in
10034 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10035 $cat >attrib.c <<'EOCP'
10037 void fall_over_dead( void ) __attribute__((noreturn));
10039 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10040 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10041 echo "Your C compiler doesn't support __attribute__((noreturn))."
10044 echo "Your C compiler supports __attribute__((noreturn))."
10048 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10052 *) val="$d_attribute_noreturn" ;;
10054 set d_attribute_noreturn
10058 : Look for GCC-style attribute pure
10059 case "$d_attribute_pure" in
10062 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10063 $cat >attrib.c <<'EOCP'
10065 int square( int n ) __attribute__((pure));
10067 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10068 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10069 echo "Your C compiler doesn't support __attribute__((pure))."
10072 echo "Your C compiler supports __attribute__((pure))."
10076 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10080 *) val="$d_attribute_pure" ;;
10082 set d_attribute_pure
10086 : Look for GCC-style attribute unused
10087 case "$d_attribute_unused" in
10090 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10091 $cat >attrib.c <<'EOCP'
10093 int do_something( int dummy __attribute__((unused)), int n );
10095 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10096 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10097 echo "Your C compiler doesn't support __attribute__((unused))."
10100 echo "Your C compiler supports __attribute__((unused))."
10104 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10108 *) val="$d_attribute_unused" ;;
10110 set d_attribute_unused
10114 : Look for GCC-style attribute warn_unused_result
10115 case "$d_attribute_warn_unused_result" in
10118 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10119 $cat >attrib.c <<'EOCP'
10121 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10123 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10124 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10125 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10128 echo "Your C compiler supports __attribute__((warn_unused_result))."
10132 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10136 *) val="$d_attribute_warn_unused_result" ;;
10138 set d_attribute_warn_unused_result
10142 : see if bcmp exists
10146 : see if bcopy exists
10150 : see if getpgrp exists
10151 set getpgrp d_getpgrp
10154 case "$d_getpgrp" in
10157 echo "Checking to see which flavor of getpgrp is in use..."
10159 #$i_unistd I_UNISTD
10160 #include <sys/types.h>
10162 # include <unistd.h>
10164 #$i_stdlib I_STDLIB
10166 #include <stdlib.h>
10170 if (getuid() == 0) {
10171 printf("(I see you are running Configure as super-user...)\n");
10174 #ifdef TRY_BSD_PGRP
10175 if (getpgrp(1) == 0)
10184 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10185 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10187 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10188 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10191 echo "I can't seem to compile and run the test program."
10193 xxx="a USG one, i.e. you use getpgrp()."
10195 # SVR4 systems can appear rather BSD-ish.
10196 case "$i_unistd" in
10198 xxx="a BSD one, i.e. you use getpgrp(pid)."
10202 xxx="probably a USG one, i.e. you use getpgrp()."
10207 echo "Assuming your getpgrp is $xxx" >&4
10216 : see if setpgrp exists
10217 set setpgrp d_setpgrp
10220 case "$d_setpgrp" in
10223 echo "Checking to see which flavor of setpgrp is in use..."
10225 #$i_unistd I_UNISTD
10226 #include <sys/types.h>
10228 # include <unistd.h>
10230 #$i_stdlib I_STDLIB
10232 #include <stdlib.h>
10236 if (getuid() == 0) {
10237 printf("(I see you are running Configure as super-user...)\n");
10240 #ifdef TRY_BSD_PGRP
10241 if (-1 == setpgrp(1, 1))
10244 if (setpgrp() != -1)
10250 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10251 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10253 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10254 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10257 echo "(I can't seem to compile and run the test program.)"
10259 xxx="a USG one, i.e. you use setpgrp()."
10261 # SVR4 systems can appear rather BSD-ish.
10262 case "$i_unistd" in
10264 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10268 xxx="probably a USG one, i.e. you use setpgrp()."
10273 echo "Assuming your setpgrp is $xxx" >&4
10281 : Look for GCC-style __builtin_choose_expr
10282 case "$d_builtin_choose_expr" in
10285 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10286 $cat >try.c <<'EOCP'
10287 #include <assert.h>
10288 #include <stdlib.h>
10291 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10294 assert( SYRINX(1) == 2112 );
10295 assert( SYRINX(1) != 5150 );
10296 assert( SYRINX(0) == 5150 );
10297 assert( SYRINX(0) != 2112 );
10298 puts( "All good!" );
10304 if eval $compile; then
10305 echo "Your C compiler supports __builtin_choose_expr."
10308 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10312 *) val="$d_builtin_choose_expr" ;;
10315 set d_builtin_choose_expr
10317 $rm -f try.* try core core.try.*
10319 : Look for GCC-style __builtin_expect
10320 case "$d_builtin_expect" in
10323 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10324 $cat >builtin.c <<'EOCP'
10327 if ( __builtin_expect(n, 0) ) n = 1;
10331 if eval $compile; then
10332 echo "Your C compiler supports __builtin_choose_expr."
10335 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10339 *) val="$d_builtin_expect" ;;
10342 set d_builtin_expect
10344 $rm -f try.* try core core.try.*
10346 : see if bzero exists
10350 : see if stdarg is available
10352 if $test `./findhdr stdarg.h`; then
10353 echo "<stdarg.h> found." >&4
10356 echo "<stdarg.h> NOT found." >&4
10360 : see if varags is available
10362 if $test `./findhdr varargs.h`; then
10363 echo "<varargs.h> found." >&4
10365 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10368 : set up the varargs testing programs
10369 $cat > varargs.c <<EOP
10371 #include <stdarg.h>
10374 #include <varargs.h>
10378 int f(char *p, ...)
10392 p = va_arg(ap, char *);
10398 $cat > varargs <<EOP
10400 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10409 : now check which varargs header should be included
10414 if `./varargs I_STDARG`; then
10416 elif `./varargs I_VARARGS`; then
10421 if `./varargs I_VARARGS`; then
10428 echo "I could not find the definition for va_dcl... You have problems..." >&4
10429 val="$undef"; set i_stdarg; eval $setvar
10430 val="$undef"; set i_varargs; eval $setvar
10435 case "$i_varhdr" in
10437 val="$define"; set i_stdarg; eval $setvar
10438 val="$undef"; set i_varargs; eval $setvar
10441 val="$undef"; set i_stdarg; eval $setvar
10442 val="$define"; set i_varargs; eval $setvar
10445 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10449 : see if the Compiler supports C99 variadic macros
10450 case "$i_stdarg$i_stdlib" in
10452 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10455 #include <stdarg.h>
10457 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10461 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10467 if eval $compile && $run ./try 2>&1 >/dev/null; then
10468 case "`$run ./try`" in
10470 echo "You have C99 variadic macros." >&4
10471 d_c99_variadic_macros="$define"
10474 echo "You don't have functional C99 variadic macros." >&4
10475 d_c99_variadic_macros="$undef"
10479 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10480 d_c99_variadic_macros="$undef"
10482 $rm -f try.* try core core.try.*
10485 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10486 d_c99_variadic_macros="$undef"
10490 : see if signal is declared as pointer to function returning int or void
10492 xxx=`./findhdr signal.h`
10493 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10494 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10495 echo "You have int (*signal())() instead of void." >&4
10497 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10498 echo "You have void (*signal())()." >&4
10500 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10501 echo "You have int (*signal())() instead of void." >&4
10503 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10504 echo "You have void (*signal())()." >&4
10507 case "$d_voidsig" in
10509 echo "I can't determine whether signal handler returns void or int..." >&4
10511 rp="What type does your signal handler return?"
10514 v*) val="$define";;
10518 echo "As you already told me, signal handler returns void." >&4
10521 *) echo "As you already told me, signal handler returns int." >&4
10528 case "$d_voidsig" in
10529 "$define") signal_t="void";;
10530 *) signal_t="int";;
10534 : check for ability to cast large floats to 32-bit ints.
10536 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10537 if $test "$intsize" -ge 4; then
10544 #$i_stdlib I_STDLIB
10546 #include <stdlib.h>
10548 #include <sys/types.h>
10549 #include <signal.h>
10550 $signal_t blech(int s) { exit(3); }
10557 signal(SIGFPE, blech);
10559 /* Don't let compiler optimize the test away. Store the number
10560 in a writable string for gcc to pass to sscanf under HP/UX.
10562 sprintf(str, "2147483647");
10563 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10567 /* x86 processors will probably give 0x8000 0000, which is a
10568 sign change. We don't want that. We want to mimic SPARC
10569 behavior here, which is to preserve the sign and give
10572 if (i32 != ($xxx) f)
10578 if eval $compile_ok; then
10582 echo "(I can't seem to compile the test program--assuming it can't)"
10587 echo "Yup, it can."
10590 echo "Nope, it can't."
10597 : check for ability to cast negative floats to unsigned
10599 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10602 #$i_stdlib I_STDLIB
10604 #include <stdlib.h>
10606 #include <sys/types.h>
10607 #include <signal.h>
10608 $signal_t blech(int s) { exit(7); }
10609 $signal_t blech_in_list(int s) { exit(4); }
10610 unsigned long dummy_long(unsigned long p) { return p; }
10611 unsigned int dummy_int(unsigned int p) { return p; }
10612 unsigned short dummy_short(unsigned short p) { return p; }
10616 unsigned long along;
10618 unsigned short ashort;
10622 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10623 a direct f = -123. assignment. gcc-2.8.0 reportedly
10624 optimized the whole file away
10626 /* Store the number in a writable string for gcc to pass to
10627 sscanf under HP/UX.
10629 sprintf(str, "-123");
10630 sscanf(str, "%lf", &f); /* f = -123.; */
10632 signal(SIGFPE, blech);
10633 along = (unsigned long)f;
10634 aint = (unsigned int)f;
10635 ashort = (unsigned short)f;
10636 if (along != (unsigned long)-123)
10638 if (aint != (unsigned int)-123)
10640 if (ashort != (unsigned short)-123)
10642 sprintf(str, "1073741824.");
10643 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10646 along = (unsigned long)f;
10647 if (along != 0x80000000)
10651 along = (unsigned long)f;
10652 if (along != 0x7fffffff)
10656 along = (unsigned long)f;
10657 if (along != 0x80000001)
10661 signal(SIGFPE, blech_in_list);
10662 sprintf(str, "123.");
10663 sscanf(str, "%lf", &f); /* f = 123.; */
10664 along = dummy_long((unsigned long)f);
10665 aint = dummy_int((unsigned int)f);
10666 ashort = dummy_short((unsigned short)f);
10667 if (along != (unsigned long)123)
10669 if (aint != (unsigned int)123)
10671 if (ashort != (unsigned short)123)
10678 if eval $compile_ok; then
10682 echo "(I can't seem to compile the test program--assuming it can't)"
10685 case "$castflags" in
10687 echo "Yup, it can."
10690 echo "Nope, it can't."
10697 : see if vprintf exists
10699 if set vprintf val -f d_vprintf; eval $csym; $val; then
10700 echo 'vprintf() found.' >&4
10703 #include <varargs.h>
10704 #$i_stdlib I_STDLIB
10706 #include <stdlib.h>
10709 int main() { xxx("foo"); }
10718 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10722 if eval $compile && $run ./try; then
10723 echo "Your vsprintf() returns (int)." >&4
10726 echo "Your vsprintf() returns (char*)." >&4
10730 echo 'vprintf() NOT found.' >&4
10741 : see if chown exists
10745 : see if chroot exists
10746 set chroot d_chroot
10749 : see if chsize exists
10750 set chsize d_chsize
10753 : see if class exists
10757 : see if clearenv exists
10758 set clearenv d_clearenv
10761 hasstruct='varname=$1; struct=$2; shift; shift;
10762 while $test $# -ge 2; do
10764 $define) echo "#include <$2>";;
10768 echo "int main () { struct $struct foo; }" >> try.c;
10770 if eval $compile; then
10777 $rm -f try.c try.o'
10781 : see whether socket exists
10783 $echo $n "Hmm... $c" >&4
10784 if set socket val -f d_socket; eval $csym; $val; then
10785 echo "Looks like you have Berkeley networking support." >&4
10787 if set setsockopt val -f; eval $csym; $val; then
10790 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10791 d_oldsock="$define"
10794 if $contains socklib libc.list >/dev/null 2>&1; then
10795 echo "Looks like you have Berkeley networking support." >&4
10797 : we will have to assume that it supports the 4.2 BSD interface
10800 echo "You don't have Berkeley networking in libc$_a..." >&4
10801 if test "X$d_socket" = "X$define"; then
10802 echo "...but you seem to believe that you have sockets." >&4
10804 for net in net socket
10806 if test -f /usr/lib/lib$net$_a; then
10807 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10808 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10809 if $contains socket libc.list >/dev/null 2>&1; then
10814 echo "...but the Wollongong group seems to have hacked it in." >&4
10815 sockethdr="-I/usr/netinclude"
10818 echo "Found Berkeley sockets interface in lib$net." >&4
10819 if $contains setsockopt libc.list >/dev/null 2>&1; then
10822 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10823 d_oldsock="$define"
10829 if test "X$d_socket" != "X$define"; then
10830 echo "or anywhere else I see." >&4
10838 : see if socketpair exists
10839 set socketpair d_sockpair
10844 echo "Checking the availability of certain socket constants..." >&4
10845 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10846 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10848 #include <sys/types.h>
10849 #include <sys/socket.h>
10855 set try; if eval $compile; then
10858 set d_${enum}; eval $setvar
10862 : see if this is a sys/uio.h system
10863 set sys/uio.h i_sysuio
10868 echo "Checking to see if your system supports struct cmsghdr..." >&4
10869 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10871 case "$d_cmsghdr_s" in
10872 "$define") echo "Yes, it does." ;;
10873 *) echo "No, it doesn't." ;;
10877 : check for const keyword
10879 echo 'Checking to see if your C compiler knows about "const"...' >&4
10880 $cat >const.c <<'EOCP'
10881 typedef struct spug { int drokk; } spug;
10885 const spug y = { 0 };
10888 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10890 echo "Yup, it does."
10893 echo "Nope, it doesn't."
10898 : see if copysignl exists
10899 set copysignl d_copysignl
10902 : see if crypt exists
10907 $define) cryptlib='' ;;
10908 *) if set crypt val -f d_crypt; eval $csym; $val; then
10909 echo 'crypt() found.' >&4
10913 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
10914 if $test -z "$cryptlib"; then
10915 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
10919 if $test -z "$cryptlib"; then
10920 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
10924 if $test -z "$cryptlib"; then
10925 cryptlib=`./loc libcrypt$_a "" $libpth`
10929 if $test -z "$cryptlib"; then
10930 echo 'crypt() NOT found.' >&4
10941 : see if this is a crypt.h system
10942 set crypt.h i_crypt
10945 : see if crypt_r exists
10946 set crypt_r d_crypt_r
10948 case "$d_crypt_r" in
10950 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
10951 case "$d_crypt_r_proto:$usethreads" in
10952 ":define") d_crypt_r_proto=define
10953 set d_crypt_r_proto crypt_r $hdrs
10957 case "$d_crypt_r_proto" in
10959 case "$crypt_r_proto" in
10960 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
10961 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
10963 case "$crypt_r_proto" in
10964 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
10965 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
10967 case "$crypt_r_proto" in
10968 ''|0) d_crypt_r=undef
10970 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
10971 * ) case "$crypt_r_proto" in
10972 REENTRANT_PROTO*) ;;
10973 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
10975 echo "Prototype: $try" ;;
10978 *) case "$usethreads" in
10979 define) echo "crypt_r has no prototype, not using it." >&4 ;;
10990 : get csh whereabouts
10992 'csh') val="$undef" ;;
10993 *) val="$define" ;;
10997 : Respect a hint or command line value for full_csh.
10998 case "$full_csh" in
10999 '') full_csh=$csh ;;
11002 : see if ctermid_r exists
11003 set ctermid_r d_ctermid_r
11005 case "$d_ctermid_r" in
11007 hdrs="$i_systypes sys/types.h define stdio.h "
11008 case "$d_ctermid_r_proto:$usethreads" in
11009 ":define") d_ctermid_r_proto=define
11010 set d_ctermid_r_proto ctermid_r $hdrs
11014 case "$d_ctermid_r_proto" in
11016 case "$ctermid_r_proto" in
11017 ''|0) try='char* ctermid_r(char*);'
11018 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
11020 case "$ctermid_r_proto" in
11021 ''|0) d_ctermid_r=undef
11023 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11024 * ) case "$ctermid_r_proto" in
11025 REENTRANT_PROTO*) ;;
11026 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11028 echo "Prototype: $try" ;;
11031 *) case "$usethreads" in
11032 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11039 *) ctermid_r_proto=0
11043 : see if ctime_r exists
11044 set ctime_r d_ctime_r
11046 case "$d_ctime_r" in
11048 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11049 case "$d_ctime_r_proto:$usethreads" in
11050 ":define") d_ctime_r_proto=define
11051 set d_ctime_r_proto ctime_r $hdrs
11055 case "$d_ctime_r_proto" in
11057 case "$ctime_r_proto" in
11058 ''|0) try='char* ctime_r(const time_t*, char*);'
11059 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
11061 case "$ctime_r_proto" in
11062 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11063 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
11065 case "$ctime_r_proto" in
11066 ''|0) try='int ctime_r(const time_t*, char*);'
11067 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
11069 case "$ctime_r_proto" in
11070 ''|0) try='int ctime_r(const time_t*, char*, int);'
11071 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
11073 case "$ctime_r_proto" in
11074 ''|0) d_ctime_r=undef
11076 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11077 * ) case "$ctime_r_proto" in
11078 REENTRANT_PROTO*) ;;
11079 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11081 echo "Prototype: $try" ;;
11084 *) case "$usethreads" in
11085 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11096 : see if cuserid exists
11097 set cuserid d_cuserid
11100 : see if this is a limits.h system
11101 set limits.h i_limits
11104 : see if this is a float.h system
11105 set float.h i_float
11108 : See if number of significant digits in a double precision number is known
11110 $cat >dbl_dig.c <<EOM
11111 #$i_limits I_LIMITS
11114 #include <limits.h>
11120 printf("Contains DBL_DIG");
11123 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11124 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11125 echo "DBL_DIG found." >&4
11128 echo "DBL_DIG NOT found." >&4
11135 : see if dbm.h is available
11136 : see if dbmclose exists
11137 set dbmclose d_dbmclose
11140 case "$d_dbmclose" in
11150 *) set rpcsvc/dbm.h i_rpcsvcdbm
11155 *) echo "We won't be including <dbm.h>"
11165 : see if prototype for dbminit is available
11167 set d_dbminitproto dbminit $i_dbm dbm.h
11170 : see if difftime exists
11171 set difftime d_difftime
11174 : see if this is a dirent system
11176 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11178 echo "<dirent.h> found." >&4
11181 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11182 echo "<sys/dir.h> found." >&4
11185 xinc=`./findhdr sys/ndir.h`
11187 echo "<dirent.h> NOT found." >&4
11192 : Look for type of directory structure.
11194 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11196 case "$direntrytype" in
11198 case "$i_dirent" in
11199 $define) guess1='struct dirent' ;;
11200 *) guess1='struct direct' ;;
11203 *) guess1="$direntrytype"
11208 'struct dirent') guess2='struct direct' ;;
11209 *) guess2='struct dirent' ;;
11212 if $contains "$guess1" try.c >/dev/null 2>&1; then
11213 direntrytype="$guess1"
11214 echo "Your directory entries are $direntrytype." >&4
11215 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11216 direntrytype="$guess2"
11217 echo "Your directory entries seem to be $direntrytype." >&4
11219 echo "I don't recognize your system's directory entries." >&4
11220 rp="What type is used for directory entries on this system?"
11223 direntrytype="$ans"
11228 : see if the directory entry stores field length
11230 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11231 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11232 echo "Good, your directory entry keeps length information in d_namlen." >&4
11235 echo "Your directory entry does not know about the d_namlen field." >&4
11242 : see if this is an sysdir system
11243 set sys/dir.h i_sysdir
11246 : see if this is an sysndir system
11247 set sys/ndir.h i_sysndir
11252 $cat >dirfd.c <<EOM
11254 #$i_stdlib I_STDLIB
11256 #include <stdlib.h>
11258 #$i_dirent I_DIRENT /**/
11259 #$i_sysdir I_SYS_DIR /**/
11260 #$i_sysndir I_SYS_NDIR /**/
11261 #$i_systypes I_SYS_TYPES /**/
11262 #if defined(I_SYS_TYPES)
11263 #include <sys/types.h>
11265 #if defined(I_DIRENT)
11266 #include <dirent.h>
11267 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11268 #include <sys/dir.h>
11272 #include <sys/ndir.h>
11276 #include <ndir.h> /* may be wrong in the future */
11278 #include <sys/dir.h>
11284 DIR *dirp = opendir(".");
11285 if (dirfd(dirp) >= 0)
11293 if eval $compile; then
11297 $define) echo "dirfd() found." >&4 ;;
11298 *) echo "dirfd() NOT found." >&4 ;;
11304 : see if dlerror exists
11307 set dlerror d_dlerror
11311 : see if dlfcn is available
11312 set dlfcn.h i_dlfcn
11319 On a few systems, the dynamically loaded modules that perl generates and uses
11320 will need a different extension than shared libs. The default will probably
11326 *) dflt="$dlext" ;;
11328 rp='What is the extension of dynamically loaded modules'
11337 : Check if dlsym need a leading underscore
11343 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11344 $cat >dyna.c <<'EOM'
11351 #$i_stdlib I_STDLIB
11353 #include <stdlib.h>
11357 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11359 #include <sys/types.h>
11364 extern int fred() ;
11373 int mode = RTLD_LAZY ;
11375 handle = dlopen("./dyna.$dlext", mode) ;
11376 if (handle == NULL) {
11381 symbol = dlsym(handle, "fred") ;
11382 if (symbol == NULL) {
11383 /* try putting a leading underscore */
11384 symbol = dlsym(handle, "_fred") ;
11385 if (symbol == NULL) {
11398 : Call the object file tmp-dyna.o in case dlext=o.
11399 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11400 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11401 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11402 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11405 1) echo "Test program failed using dlopen." >&4
11406 echo "Perhaps you should not use dynamic loading." >&4;;
11407 2) echo "Test program failed using dlsym." >&4
11408 echo "Perhaps you should not use dynamic loading." >&4;;
11409 3) echo "dlsym needs a leading underscore" >&4
11411 4) echo "dlsym doesn't need a leading underscore." >&4;;
11414 echo "I can't compile and run the test program." >&4
11415 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11420 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11425 : see if drand48_r exists
11426 set drand48_r d_drand48_r
11428 case "$d_drand48_r" in
11430 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11431 case "$d_drand48_r_proto:$usethreads" in
11432 ":define") d_drand48_r_proto=define
11433 set d_drand48_r_proto drand48_r $hdrs
11437 case "$d_drand48_r_proto" in
11439 case "$drand48_r_proto" in
11440 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11441 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11443 case "$drand48_r_proto" in
11444 ''|0) d_drand48_r=undef
11446 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11447 * ) case "$drand48_r_proto" in
11448 REENTRANT_PROTO*) ;;
11449 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11451 echo "Prototype: $try" ;;
11454 *) case "$usethreads" in
11455 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11462 *) drand48_r_proto=0
11466 : see if prototype for drand48 is available
11468 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11471 : see if dup2 exists
11475 : see if eaccess exists
11476 set eaccess d_eaccess
11479 : see if endgrent exists
11480 set endgrent d_endgrent
11483 : see if this is an grp system
11489 xxx=`./findhdr grp.h`
11490 $cppstdin $cppflags $cppminus < $xxx >$$.h
11492 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11504 set d_grpasswd; eval $setvar
11508 : see if endgrent_r exists
11509 set endgrent_r d_endgrent_r
11511 case "$d_endgrent_r" in
11513 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11514 case "$d_endgrent_r_proto:$usethreads" in
11515 ":define") d_endgrent_r_proto=define
11516 set d_endgrent_r_proto endgrent_r $hdrs
11520 case "$d_endgrent_r_proto" in
11522 case "$endgrent_r_proto" in
11523 ''|0) try='int endgrent_r(FILE**);'
11524 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11526 case "$endgrent_r_proto" in
11527 ''|0) try='void endgrent_r(FILE**);'
11528 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11530 case "$endgrent_r_proto" in
11531 ''|0) d_endgrent_r=undef
11533 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11534 * ) case "$endgrent_r_proto" in
11535 REENTRANT_PROTO*) ;;
11536 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11538 echo "Prototype: $try" ;;
11541 *) case "$usethreads" in
11542 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11549 *) endgrent_r_proto=0
11553 : see if endhostent exists
11554 set endhostent d_endhent
11557 : see if this is a netdb.h system
11558 set netdb.h i_netdb
11561 : see if endhostent_r exists
11562 set endhostent_r d_endhostent_r
11564 case "$d_endhostent_r" in
11566 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11567 case "$d_endhostent_r_proto:$usethreads" in
11568 ":define") d_endhostent_r_proto=define
11569 set d_endhostent_r_proto endhostent_r $hdrs
11573 case "$d_endhostent_r_proto" in
11575 case "$endhostent_r_proto" in
11576 ''|0) try='int endhostent_r(struct hostent_data*);'
11577 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11579 case "$endhostent_r_proto" in
11580 ''|0) try='void endhostent_r(struct hostent_data*);'
11581 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11583 case "$endhostent_r_proto" in
11584 ''|0) d_endhostent_r=undef
11585 endhostent_r_proto=0
11586 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11587 * ) case "$endhostent_r_proto" in
11588 REENTRANT_PROTO*) ;;
11589 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11591 echo "Prototype: $try" ;;
11594 *) case "$usethreads" in
11595 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11597 d_endhostent_r=undef
11598 endhostent_r_proto=0
11602 *) endhostent_r_proto=0
11606 : see if endnetent exists
11607 set endnetent d_endnent
11610 : see if endnetent_r exists
11611 set endnetent_r d_endnetent_r
11613 case "$d_endnetent_r" in
11615 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11616 case "$d_endnetent_r_proto:$usethreads" in
11617 ":define") d_endnetent_r_proto=define
11618 set d_endnetent_r_proto endnetent_r $hdrs
11622 case "$d_endnetent_r_proto" in
11624 case "$endnetent_r_proto" in
11625 ''|0) try='int endnetent_r(struct netent_data*);'
11626 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11628 case "$endnetent_r_proto" in
11629 ''|0) try='void endnetent_r(struct netent_data*);'
11630 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11632 case "$endnetent_r_proto" in
11633 ''|0) d_endnetent_r=undef
11634 endnetent_r_proto=0
11635 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11636 * ) case "$endnetent_r_proto" in
11637 REENTRANT_PROTO*) ;;
11638 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11640 echo "Prototype: $try" ;;
11643 *) case "$usethreads" in
11644 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11646 d_endnetent_r=undef
11647 endnetent_r_proto=0
11651 *) endnetent_r_proto=0
11655 : see if endprotoent exists
11656 set endprotoent d_endpent
11659 : see if endprotoent_r exists
11660 set endprotoent_r d_endprotoent_r
11662 case "$d_endprotoent_r" in
11664 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11665 case "$d_endprotoent_r_proto:$usethreads" in
11666 ":define") d_endprotoent_r_proto=define
11667 set d_endprotoent_r_proto endprotoent_r $hdrs
11671 case "$d_endprotoent_r_proto" in
11673 case "$endprotoent_r_proto" in
11674 ''|0) try='int endprotoent_r(struct protoent_data*);'
11675 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11677 case "$endprotoent_r_proto" in
11678 ''|0) try='void endprotoent_r(struct protoent_data*);'
11679 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11681 case "$endprotoent_r_proto" in
11682 ''|0) d_endprotoent_r=undef
11683 endprotoent_r_proto=0
11684 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11685 * ) case "$endprotoent_r_proto" in
11686 REENTRANT_PROTO*) ;;
11687 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11689 echo "Prototype: $try" ;;
11692 *) case "$usethreads" in
11693 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11695 d_endprotoent_r=undef
11696 endprotoent_r_proto=0
11700 *) endprotoent_r_proto=0
11704 : see if endpwent exists
11705 set endpwent d_endpwent
11708 : see if this is a pwd.h system
11714 xxx=`./findhdr pwd.h`
11715 $cppstdin $cppflags $cppminus < $xxx >$$.h
11717 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11725 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11733 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11741 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11749 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11757 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11765 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11773 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11785 set d_pwquota; eval $setvar
11786 set d_pwage; eval $setvar
11787 set d_pwchange; eval $setvar
11788 set d_pwclass; eval $setvar
11789 set d_pwexpire; eval $setvar
11790 set d_pwcomment; eval $setvar
11791 set d_pwgecos; eval $setvar
11792 set d_pwpasswd; eval $setvar
11796 : see if endpwent_r exists
11797 set endpwent_r d_endpwent_r
11799 case "$d_endpwent_r" in
11801 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11802 case "$d_endpwent_r_proto:$usethreads" in
11803 ":define") d_endpwent_r_proto=define
11804 set d_endpwent_r_proto endpwent_r $hdrs
11808 case "$d_endpwent_r_proto" in
11810 case "$endpwent_r_proto" in
11811 ''|0) try='int endpwent_r(FILE**);'
11812 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11814 case "$endpwent_r_proto" in
11815 ''|0) try='void endpwent_r(FILE**);'
11816 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11818 case "$endpwent_r_proto" in
11819 ''|0) d_endpwent_r=undef
11821 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11822 * ) case "$endpwent_r_proto" in
11823 REENTRANT_PROTO*) ;;
11824 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11826 echo "Prototype: $try" ;;
11829 *) case "$usethreads" in
11830 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11837 *) endpwent_r_proto=0
11841 : see if endservent exists
11842 set endservent d_endsent
11845 : see if endservent_r exists
11846 set endservent_r d_endservent_r
11848 case "$d_endservent_r" in
11850 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11851 case "$d_endservent_r_proto:$usethreads" in
11852 ":define") d_endservent_r_proto=define
11853 set d_endservent_r_proto endservent_r $hdrs
11857 case "$d_endservent_r_proto" in
11859 case "$endservent_r_proto" in
11860 ''|0) try='int endservent_r(struct servent_data*);'
11861 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
11863 case "$endservent_r_proto" in
11864 ''|0) try='void endservent_r(struct servent_data*);'
11865 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
11867 case "$endservent_r_proto" in
11868 ''|0) d_endservent_r=undef
11869 endservent_r_proto=0
11870 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
11871 * ) case "$endservent_r_proto" in
11872 REENTRANT_PROTO*) ;;
11873 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
11875 echo "Prototype: $try" ;;
11878 *) case "$usethreads" in
11879 define) echo "endservent_r has no prototype, not using it." >&4 ;;
11881 d_endservent_r=undef
11882 endservent_r_proto=0
11886 *) endservent_r_proto=0
11890 : Locate the flags for 'open()'
11893 #include <sys/types.h>
11898 #include <sys/file.h>
11900 #$i_stdlib I_STDLIB
11902 #include <stdlib.h>
11913 : check sys/file.h first to get FREAD on Sun
11914 if $test `./findhdr sys/file.h` && \
11915 set try -DI_SYS_FILE && eval $compile; then
11917 echo "<sys/file.h> defines the O_* constants..." >&4
11918 if $run ./try; then
11919 echo "and you have the 3 argument form of open()." >&4
11922 echo "but not the 3 argument form of open(). Oh, well." >&4
11925 elif $test `./findhdr fcntl.h` && \
11926 set try -DI_FCNTL && eval $compile; then
11928 echo "<fcntl.h> defines the O_* constants..." >&4
11929 if $run ./try; then
11930 echo "and you have the 3 argument form of open()." >&4
11933 echo "but not the 3 argument form of open(). Oh, well." >&4
11938 echo "I can't find the O_* constant definitions! You got problems." >&4
11944 : see which of string.h or strings.h is needed
11946 strings=`./findhdr string.h`
11947 if $test "$strings" && $test -r "$strings"; then
11948 echo "Using <string.h> instead of <strings.h>." >&4
11952 strings=`./findhdr strings.h`
11953 if $test "$strings" && $test -r "$strings"; then
11954 echo "Using <strings.h> instead of <string.h>." >&4
11956 echo "No string header found -- You'll surely have problems." >&4
11961 case "$i_string" in
11962 "$undef") strings=`./findhdr strings.h`;;
11963 *) strings=`./findhdr string.h`;;
11966 : see if this is a sys/file.h system
11971 : do we need to include sys/file.h ?
11975 if $h_sysfile; then
11977 echo "We'll be including <sys/file.h>." >&4
11980 echo "We won't be including <sys/file.h>." >&4
11990 : see if fcntl.h is there
11995 : see if we can include fcntl.h
12001 echo "We'll be including <fcntl.h>." >&4
12004 if $h_sysfile; then
12005 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12007 echo "We won't be including <fcntl.h>." >&4
12019 : check for non-blocking I/O stuff
12020 case "$h_sysfile" in
12021 true) echo "#include <sys/file.h>" > head.c;;
12024 true) echo "#include <fcntl.h>" > head.c;;
12025 *) echo "#include <sys/fcntl.h>" > head.c;;
12030 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12031 case "$o_nonblock" in
12033 $cat head.c > try.c
12034 $cat >>try.c <<EOCP
12036 #$i_stdlib I_STDLIB
12038 #include <stdlib.h>
12046 printf("O_NONBLOCK\n");
12050 printf("O_NDELAY\n");
12054 printf("FNDELAY\n");
12061 if eval $compile_ok; then
12062 o_nonblock=`$run ./try`
12063 case "$o_nonblock" in
12064 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12065 *) echo "Seems like we can use $o_nonblock.";;
12068 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12071 *) echo "Using $hint value $o_nonblock.";;
12073 $rm -f try try.* .out core
12076 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12079 $cat head.c > try.c
12080 $cat >>try.c <<EOCP
12082 #include <sys/types.h>
12083 #include <signal.h>
12085 #$i_stdlib I_STDLIB
12087 #include <stdlib.h>
12093 #define MY_O_NONBLOCK $o_nonblock
12094 #ifndef errno /* XXX need better Configure test */
12097 #$i_unistd I_UNISTD
12099 #include <unistd.h>
12101 #$i_string I_STRING
12103 #include <string.h>
12105 #include <strings.h>
12107 $signal_t blech(int x) { exit(3); }
12109 $cat >> try.c <<'EOCP'
12117 pipe(pd); /* Down: child -> parent */
12118 pipe(pu); /* Up: parent -> child */
12121 close(pd[1]); /* Parent reads from pd[0] */
12122 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12124 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12129 signal(SIGALRM, blech);
12131 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12133 sprintf(string, "%d\n", ret);
12134 write(2, string, strlen(string));
12137 if (errno == EAGAIN) {
12138 printf("EAGAIN\n");
12143 if (errno == EWOULDBLOCK)
12144 printf("EWOULDBLOCK\n");
12147 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12148 sleep(2); /* Give it time to close our pipe */
12150 ret = read(pd[0], buf, 1); /* Should read EOF */
12152 sprintf(string, "%d\n", ret);
12153 write(4, string, strlen(string));
12157 close(pd[0]); /* We write to pd[1] */
12158 close(pu[1]); /* We read from pu[0] */
12159 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12160 close(pd[1]); /* Pipe pd is now fully closed! */
12161 exit(0); /* Bye bye, thank you for playing! */
12165 if eval $compile_ok; then
12166 echo "$startsh" >mtry
12167 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12169 ./mtry >/dev/null 2>&1
12171 0) eagain=`$cat try.out`;;
12172 1) echo "Could not perform non-blocking setting!";;
12173 2) echo "I did a successful read() for something that was not there!";;
12174 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12175 4) echo "Could not find F_SETFL!";;
12176 *) echo "Something terribly wrong happened during testing.";;
12178 rd_nodata=`$cat try.ret`
12179 echo "A read() system call with no data present returns $rd_nodata."
12180 case "$rd_nodata" in
12183 echo "(That's peculiar, fixing that to be -1.)"
12189 echo "Forcing errno EAGAIN on read() with no data available."
12193 echo "Your read() sets errno to $eagain when no data is available."
12196 status=`$cat try.err`
12198 0) echo "And it correctly returns 0 to signal EOF.";;
12199 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12200 *) echo "However, your read() returns '$status' on EOF??";;
12203 if test "$status" = "$rd_nodata"; then
12204 echo "WARNING: you can't distinguish between EOF and no data!"
12208 echo "I can't compile the test program--assuming errno EAGAIN will do."
12215 echo "Using $hint value $eagain."
12216 echo "Your read() returns $rd_nodata when no data is present."
12217 case "$d_eofnblk" in
12218 "$define") echo "And you can see EOF because read() returns 0.";;
12219 "$undef") echo "But you can't see EOF status from read() returned value.";;
12221 echo "(Assuming you can't see EOF status from read anyway.)"
12227 $rm -f try try.* .out core head.c mtry
12229 : see if _ptr and _cnt from stdio act std
12232 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12233 echo "(Looks like you have stdio.h from BSD.)"
12234 case "$stdio_ptr" in
12235 '') stdio_ptr='((fp)->_p)'
12238 *) ptr_lval=$d_stdio_ptr_lval;;
12240 case "$stdio_cnt" in
12241 '') stdio_cnt='((fp)->_r)'
12244 *) cnt_lval=$d_stdio_cnt_lval;;
12246 case "$stdio_base" in
12247 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12249 case "$stdio_bufsiz" in
12250 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12252 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12253 echo "(Looks like you have stdio.h from Linux.)"
12254 case "$stdio_ptr" in
12255 '') stdio_ptr='((fp)->_IO_read_ptr)'
12258 *) ptr_lval=$d_stdio_ptr_lval;;
12260 case "$stdio_cnt" in
12261 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12264 *) cnt_lval=$d_stdio_cnt_lval;;
12266 case "$stdio_base" in
12267 '') stdio_base='((fp)->_IO_read_base)';;
12269 case "$stdio_bufsiz" in
12270 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12273 case "$stdio_ptr" in
12274 '') stdio_ptr='((fp)->_ptr)'
12277 *) ptr_lval=$d_stdio_ptr_lval;;
12279 case "$stdio_cnt" in
12280 '') stdio_cnt='((fp)->_cnt)'
12283 *) cnt_lval=$d_stdio_cnt_lval;;
12285 case "$stdio_base" in
12286 '') stdio_base='((fp)->_base)';;
12288 case "$stdio_bufsiz" in
12289 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12293 : test whether _ptr and _cnt really work
12294 echo "Checking how std your stdio is..." >&4
12297 #$i_stdlib I_STDLIB
12299 #include <stdlib.h>
12301 #define FILE_ptr(fp) $stdio_ptr
12302 #define FILE_cnt(fp) $stdio_cnt
12304 FILE *fp = fopen("try.c", "r");
12307 18 <= FILE_cnt(fp) &&
12308 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12316 if eval $compile && $to try.c; then
12317 if $run ./try; then
12318 echo "Your stdio acts pretty std."
12321 echo "Your stdio isn't very std."
12324 echo "Your stdio doesn't appear very std."
12328 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12329 # direct buffer manipulation no longer works. The Configure tests
12330 # should be changed to correctly detect this, but until then,
12331 # the following check should at least let perl compile and run.
12332 # (This quick fix should be updated before 5.8.1.)
12333 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12334 # A. Dougherty, June 3, 2002.
12335 case "$d_gnulibc" in
12337 case "$gnulibc_version" in
12341 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12350 : Can _ptr be used as an lvalue?
12351 case "$d_stdstdio$ptr_lval" in
12352 $define$define) val=$define ;;
12355 set d_stdio_ptr_lval
12358 : Can _cnt be used as an lvalue?
12359 case "$d_stdstdio$cnt_lval" in
12360 $define$define) val=$define ;;
12363 set d_stdio_cnt_lval
12367 : test whether setting _ptr sets _cnt as a side effect
12368 d_stdio_ptr_lval_sets_cnt="$undef"
12369 d_stdio_ptr_lval_nochange_cnt="$undef"
12370 case "$d_stdio_ptr_lval$d_stdstdio" in
12372 echo "Checking to see what happens if we set the stdio ptr..." >&4
12375 /* Can we scream? */
12376 /* Eat dust sed :-) */
12377 /* In the buffer space, no one can hear you scream. */
12378 #$i_stdlib I_STDLIB
12380 #include <stdlib.h>
12382 #define FILE_ptr(fp) $stdio_ptr
12383 #define FILE_cnt(fp) $stdio_cnt
12384 #include <sys/types.h>
12386 FILE *fp = fopen("try.c", "r");
12391 puts("Fail even to read");
12394 c = getc(fp); /* Read away the first # */
12396 puts("Fail even to read");
12400 18 <= FILE_cnt(fp) &&
12401 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12403 puts("Fail even to read");
12406 ptr = (char*) FILE_ptr(fp);
12407 cnt = (size_t)FILE_cnt(fp);
12409 FILE_ptr(fp) += 42;
12411 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12412 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12415 if (FILE_cnt(fp) <= 20) {
12416 printf ("Fail (<20 chars to test)");
12419 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12420 puts("Fail compare");
12423 if (cnt == FILE_cnt(fp)) {
12424 puts("Pass_unchanged");
12427 if (FILE_cnt(fp) == (cnt - 42)) {
12428 puts("Pass_changed");
12431 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12437 if eval $compile && $to try.c; then
12438 case `$run ./try` in
12440 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12441 d_stdio_ptr_lval_sets_cnt="$define" ;;
12443 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12444 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12446 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12448 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12451 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12457 : see if _base is also standard
12459 case "$d_stdstdio" in
12463 #$i_stdlib I_STDLIB
12465 #include <stdlib.h>
12467 #define FILE_base(fp) $stdio_base
12468 #define FILE_bufsiz(fp) $stdio_bufsiz
12470 FILE *fp = fopen("try.c", "r");
12473 19 <= FILE_bufsiz(fp) &&
12474 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12481 if eval $compile && $to try.c; then
12482 if $run ./try; then
12483 echo "And its _base field acts std."
12486 echo "But its _base field isn't std."
12489 echo "However, it seems to be lacking the _base field."
12497 : see if fast_stdio exists
12499 case "$d_stdstdio:$d_stdio_ptr_lval" in
12501 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12503 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12514 : see if fchdir exists
12515 set fchdir d_fchdir
12518 : see if fchmod exists
12519 set fchmod d_fchmod
12522 : see if fchown exists
12523 set fchown d_fchown
12526 : see if this is an fcntl system
12531 : See if fcntl-based locking works.
12533 #$i_stdlib I_STDLIB
12535 #include <stdlib.h>
12537 #include <unistd.h>
12539 #include <signal.h>
12540 $signal_t blech(int x) { exit(3); }
12542 #if defined(F_SETLK) && defined(F_SETLKW)
12543 struct flock flock;
12545 fd = open("try.c", O_RDONLY);
12546 flock.l_type = F_RDLCK;
12547 flock.l_whence = SEEK_SET;
12548 flock.l_start = flock.l_len = 0;
12549 signal(SIGALRM, blech);
12551 retval = fcntl(fd, F_SETLK, &flock);
12553 (retval < 0 ? exit(2) : exit(0));
12559 echo "Checking if fcntl-based file locking works... "
12563 if eval $compile_ok; then
12564 if $run ./try; then
12565 echo "Yes, it seems to work."
12568 echo "Nope, it didn't work."
12573 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12574 *** This is (almost) impossible.
12575 *** If your NFS lock daemons are not feeling well, something like
12576 *** this may happen, please investigate. Cannot continue, aborting.
12584 echo "I'm unable to compile the test program, so I'll assume not."
12589 echo "Nope, since you don't even have fcntl()."
12592 set d_fcntl_can_lock
12597 : check for fd_set items
12600 Checking to see how well your C compiler handles fd_set and friends ...
12603 #$i_stdlib I_STDLIB
12605 #include <stdlib.h>
12607 #$i_systime I_SYS_TIME
12608 #$i_sysselct I_SYS_SELECT
12609 #$d_socket HAS_SOCKET
12610 #include <sys/types.h>
12612 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12615 #include <sys/time.h>
12617 #ifdef I_SYS_SELECT
12618 #include <sys/select.h>
12627 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12635 if eval $compile; then
12636 d_fds_bits="$define"
12638 echo "Well, your system knows about the normal fd_set typedef..." >&4
12639 if $run ./try; then
12640 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12641 d_fd_macros="$define"
12644 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12646 d_fd_macros="$undef"
12650 Hmm, your compiler has some difficulty with fd_set. Checking further...
12653 if eval $compile; then
12654 d_fds_bits="$undef"
12656 echo "Well, your system has some sort of fd_set available..." >&4
12657 if $run ./try; then
12658 echo "and you have the normal fd_set macros." >&4
12659 d_fd_macros="$define"
12662 but not the normal fd_set macros! Gross! More work for me...
12664 d_fd_macros="$undef"
12667 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12669 d_fds_bits="$undef"
12670 d_fd_macros="$undef"
12675 : see if fgetpos exists
12676 set fgetpos d_fgetpos
12679 : see if finite exists
12680 set finite d_finite
12683 : see if finitel exists
12684 set finitel d_finitel
12687 : see if flock exists
12691 : see if prototype for flock is available
12693 set d_flockproto flock $i_sysfile sys/file.h
12696 : see if fork exists
12700 : see if fp_class exists
12701 set fp_class d_fp_class
12704 : see if pathconf exists
12705 set pathconf d_pathconf
12708 : see if fpathconf exists
12709 set fpathconf d_fpathconf
12712 : see if fpclass exists
12713 set fpclass d_fpclass
12716 : see if fpclassify exists
12717 set fpclassify d_fpclassify
12720 : see if fpclassl exists
12721 set fpclassl d_fpclassl
12725 : check for fpos64_t
12727 echo "Checking to see if you have fpos64_t..." >&4
12730 int main() { fpos64_t x = 7; }
12733 if eval $compile; then
12735 echo "You have fpos64_t."
12738 echo "You do not have fpos64_t."
12739 case "$fpossize" in
12740 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12747 : see if frexpl exists
12748 set frexpl d_frexpl
12751 : see if this is a sys/param system
12752 set sys/param.h i_sysparam
12755 : see if this is a sys/mount.h system
12756 set sys/mount.h i_sysmount
12761 echo "Checking to see if your system supports struct fs_data..." >&4
12762 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12764 case "$d_fs_data_s" in
12765 "$define") echo "Yes, it does." ;;
12766 *) echo "No, it doesn't." ;;
12769 : see if fseeko exists
12770 set fseeko d_fseeko
12772 case "$longsize" in
12773 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12776 : see if fsetpos exists
12777 set fsetpos d_fsetpos
12781 : see if fstatfs exists
12782 set fstatfs d_fstatfs
12786 : see if statvfs exists
12787 set statvfs d_statvfs
12790 : see if fstatvfs exists
12791 set fstatvfs d_fstatvfs
12795 : see if fsync exists
12799 : see if ftello exists
12800 set ftello d_ftello
12802 case "$longsize" in
12803 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
12807 : check for a working futimes
12809 echo "Checking for a working futimes()" >&4
12812 #include <sys/time.h>
12819 fd = open ("try.c", O_RDWR);
12820 if (-1 == fd) exit (1);
12821 rv = futimes (fd, NULL);
12822 exit (rv == -1 ? errno : 0);
12826 if eval $compile; then
12830 0) echo "Yes, it does" >&4
12831 d_futimes="$define"
12833 *) echo "No, it has futimes, but it isn't working ($rc) (probably harmless)\n" >&4
12837 echo "No, it does not (probably harmless)\n" >&4
12839 $rm -f try.* try core core.try.*
12841 : see if getcwd exists
12842 set getcwd d_getcwd
12845 : see if getespwnam exists
12846 set getespwnam d_getespwnam
12850 : see if getfsstat exists
12851 set getfsstat d_getfsstat
12854 : see if getgrent exists
12855 set getgrent d_getgrent
12858 : see if getgrent_r exists
12859 set getgrent_r d_getgrent_r
12861 case "$d_getgrent_r" in
12863 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12864 case "$d_getgrent_r_proto:$usethreads" in
12865 ":define") d_getgrent_r_proto=define
12866 set d_getgrent_r_proto getgrent_r $hdrs
12870 case "$d_getgrent_r_proto" in
12872 case "$getgrent_r_proto" in
12873 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
12874 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
12876 case "$getgrent_r_proto" in
12877 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
12878 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
12880 case "$getgrent_r_proto" in
12881 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
12882 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
12884 case "$getgrent_r_proto" in
12885 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
12886 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
12888 case "$getgrent_r_proto" in
12889 ''|0) try='int getgrent_r(struct group*, char*, int);'
12890 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
12892 case "$getgrent_r_proto" in
12893 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
12894 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
12896 case "$getgrent_r_proto" in
12897 ''|0) d_getgrent_r=undef
12899 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
12900 * ) case "$getgrent_r_proto" in
12901 REENTRANT_PROTO*) ;;
12902 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
12904 echo "Prototype: $try" ;;
12907 *) case "$usethreads" in
12908 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
12915 *) getgrent_r_proto=0
12919 : see if getgrgid_r exists
12920 set getgrgid_r d_getgrgid_r
12922 case "$d_getgrgid_r" in
12924 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12925 case "$d_getgrgid_r_proto:$usethreads" in
12926 ":define") d_getgrgid_r_proto=define
12927 set d_getgrgid_r_proto getgrgid_r $hdrs
12931 case "$d_getgrgid_r_proto" in
12933 case "$getgrgid_r_proto" in
12934 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
12935 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
12937 case "$getgrgid_r_proto" in
12938 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
12939 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
12941 case "$getgrgid_r_proto" in
12942 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
12943 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
12945 case "$getgrgid_r_proto" in
12946 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
12947 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
12949 case "$getgrgid_r_proto" in
12950 ''|0) d_getgrgid_r=undef
12952 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
12953 * ) case "$getgrgid_r_proto" in
12954 REENTRANT_PROTO*) ;;
12955 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
12957 echo "Prototype: $try" ;;
12960 *) case "$usethreads" in
12961 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
12968 *) getgrgid_r_proto=0
12972 : see if getgrnam_r exists
12973 set getgrnam_r d_getgrnam_r
12975 case "$d_getgrnam_r" in
12977 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12978 case "$d_getgrnam_r_proto:$usethreads" in
12979 ":define") d_getgrnam_r_proto=define
12980 set d_getgrnam_r_proto getgrnam_r $hdrs
12984 case "$d_getgrnam_r_proto" in
12986 case "$getgrnam_r_proto" in
12987 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
12988 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
12990 case "$getgrnam_r_proto" in
12991 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
12992 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
12994 case "$getgrnam_r_proto" in
12995 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
12996 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
12998 case "$getgrnam_r_proto" in
12999 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13000 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13002 case "$getgrnam_r_proto" in
13003 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13004 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13006 case "$getgrnam_r_proto" in
13007 ''|0) d_getgrnam_r=undef
13009 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13010 * ) case "$getgrnam_r_proto" in
13011 REENTRANT_PROTO*) ;;
13012 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13014 echo "Prototype: $try" ;;
13017 *) case "$usethreads" in
13018 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13025 *) getgrnam_r_proto=0
13029 : see if gethostbyaddr exists
13030 set gethostbyaddr d_gethbyaddr
13033 : see if gethostbyname exists
13034 set gethostbyname d_gethbyname
13037 : see if gethostent exists
13038 set gethostent d_gethent
13041 : see how we will look up host name
13044 if set gethostname val -f d_gethname; eval $csym; $val; then
13045 echo 'gethostname() found.' >&4
13046 d_gethname="$define"
13049 if set uname val -f d_uname; eval $csym; $val; then
13052 uname() was found, but you're running xenix, and older versions of xenix
13053 have a broken uname(). If you don't really know whether your xenix is old
13054 enough to have a broken system call, use the default answer.
13059 "$define") dflt=n;;
13061 rp='Is your uname() broken?'
13064 n*) d_uname="$define"; call=uname;;
13067 echo 'uname() found.' >&4
13074 case "$d_gethname" in
13075 '') d_gethname="$undef";;
13078 '') d_uname="$undef";;
13080 case "$d_uname$d_gethname" in
13085 Every now and then someone has a $call() that lies about the hostname
13086 but can't be fixed for political or economic reasons. If you wish, I can
13087 pretend $call() isn't there and maybe compute hostname at run-time
13088 thanks to the '$phostname' command.
13091 rp="Shall I ignore $call() from now on?"
13094 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13097 case "$phostname" in
13098 '') aphostname='';;
13099 *) case "$aphostname" in
13101 *) set X $phostname
13105 file=`./loc $file $file $pth`
13106 aphostname=`echo $file $*`
13111 case "$d_uname$d_gethname" in
13114 case "$phostname" in
13116 echo "There will be no way for $package to get your hostname." >&4;;
13118 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13122 case "$d_phostname" in
13123 '') d_phostname="$undef";;
13126 : see if gethostbyaddr_r exists
13127 set gethostbyaddr_r d_gethostbyaddr_r
13129 case "$d_gethostbyaddr_r" in
13131 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13132 case "$d_gethostbyaddr_r_proto:$usethreads" in
13133 ":define") d_gethostbyaddr_r_proto=define
13134 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13138 case "$d_gethostbyaddr_r_proto" in
13140 case "$gethostbyaddr_r_proto" in
13141 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13142 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13144 case "$gethostbyaddr_r_proto" in
13145 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13146 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13148 case "$gethostbyaddr_r_proto" in
13149 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13150 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13152 case "$gethostbyaddr_r_proto" in
13153 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13154 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13156 case "$gethostbyaddr_r_proto" in
13157 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13158 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13160 case "$gethostbyaddr_r_proto" in
13161 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13162 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13164 case "$gethostbyaddr_r_proto" in
13165 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13166 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13168 case "$gethostbyaddr_r_proto" in
13169 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13170 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13172 case "$gethostbyaddr_r_proto" in
13173 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13174 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13176 case "$gethostbyaddr_r_proto" in
13177 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13178 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13180 case "$gethostbyaddr_r_proto" in
13181 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13182 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13184 case "$gethostbyaddr_r_proto" in
13185 ''|0) d_gethostbyaddr_r=undef
13186 gethostbyaddr_r_proto=0
13187 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13188 * ) case "$gethostbyaddr_r_proto" in
13189 REENTRANT_PROTO*) ;;
13190 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13192 echo "Prototype: $try" ;;
13195 *) case "$usethreads" in
13196 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13198 d_gethostbyaddr_r=undef
13199 gethostbyaddr_r_proto=0
13203 *) gethostbyaddr_r_proto=0
13207 : see if gethostbyname_r exists
13208 set gethostbyname_r d_gethostbyname_r
13210 case "$d_gethostbyname_r" in
13212 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13213 case "$d_gethostbyname_r_proto:$usethreads" in
13214 ":define") d_gethostbyname_r_proto=define
13215 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13219 case "$d_gethostbyname_r_proto" in
13221 case "$gethostbyname_r_proto" in
13222 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13223 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13225 case "$gethostbyname_r_proto" in
13226 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13227 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13229 case "$gethostbyname_r_proto" in
13230 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13231 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13233 case "$gethostbyname_r_proto" in
13234 ''|0) d_gethostbyname_r=undef
13235 gethostbyname_r_proto=0
13236 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13237 * ) case "$gethostbyname_r_proto" in
13238 REENTRANT_PROTO*) ;;
13239 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13241 echo "Prototype: $try" ;;
13244 *) case "$usethreads" in
13245 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13247 d_gethostbyname_r=undef
13248 gethostbyname_r_proto=0
13252 *) gethostbyname_r_proto=0
13256 : see if gethostent_r exists
13257 set gethostent_r d_gethostent_r
13259 case "$d_gethostent_r" in
13261 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13262 case "$d_gethostent_r_proto:$usethreads" in
13263 ":define") d_gethostent_r_proto=define
13264 set d_gethostent_r_proto gethostent_r $hdrs
13268 case "$d_gethostent_r_proto" in
13270 case "$gethostent_r_proto" in
13271 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13272 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13274 case "$gethostent_r_proto" in
13275 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13276 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13278 case "$gethostent_r_proto" in
13279 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13280 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13282 case "$gethostent_r_proto" in
13283 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13284 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13286 case "$gethostent_r_proto" in
13287 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13288 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13290 case "$gethostent_r_proto" in
13291 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13292 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13294 case "$gethostent_r_proto" in
13295 ''|0) d_gethostent_r=undef
13296 gethostent_r_proto=0
13297 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13298 * ) case "$gethostent_r_proto" in
13299 REENTRANT_PROTO*) ;;
13300 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13302 echo "Prototype: $try" ;;
13305 *) case "$usethreads" in
13306 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13308 d_gethostent_r=undef
13309 gethostent_r_proto=0
13313 *) gethostent_r_proto=0
13317 : see if prototypes for various gethostxxx netdb.h functions are available
13319 set d_gethostprotos gethostent $i_netdb netdb.h
13322 : see if getitimer exists
13323 set getitimer d_getitimer
13326 : see if getlogin exists
13327 set getlogin d_getlogin
13330 : see if getlogin_r exists
13331 set getlogin_r d_getlogin_r
13333 case "$d_getlogin_r" in
13335 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13336 case "$d_getlogin_r_proto:$usethreads" in
13337 ":define") d_getlogin_r_proto=define
13338 set d_getlogin_r_proto getlogin_r $hdrs
13342 case "$d_getlogin_r_proto" in
13344 case "$getlogin_r_proto" in
13345 ''|0) try='int getlogin_r(char*, size_t);'
13346 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13348 case "$getlogin_r_proto" in
13349 ''|0) try='int getlogin_r(char*, int);'
13350 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13352 case "$getlogin_r_proto" in
13353 ''|0) try='char* getlogin_r(char*, size_t);'
13354 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13356 case "$getlogin_r_proto" in
13357 ''|0) try='char* getlogin_r(char*, int);'
13358 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13360 case "$getlogin_r_proto" in
13361 ''|0) d_getlogin_r=undef
13363 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13364 * ) case "$getlogin_r_proto" in
13365 REENTRANT_PROTO*) ;;
13366 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13368 echo "Prototype: $try" ;;
13371 *) case "$usethreads" in
13372 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13379 *) getlogin_r_proto=0
13383 : see if getmnt exists
13384 set getmnt d_getmnt
13387 : see if getmntent exists
13388 set getmntent d_getmntent
13391 : see if getnetbyaddr exists
13392 set getnetbyaddr d_getnbyaddr
13395 : see if getnetbyname exists
13396 set getnetbyname d_getnbyname
13399 : see if getnetent exists
13400 set getnetent d_getnent
13403 : see if getnetbyaddr_r exists
13404 set getnetbyaddr_r d_getnetbyaddr_r
13406 case "$d_getnetbyaddr_r" in
13408 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13409 case "$d_getnetbyaddr_r_proto:$usethreads" in
13410 ":define") d_getnetbyaddr_r_proto=define
13411 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13415 case "$d_getnetbyaddr_r_proto" in
13417 case "$getnetbyaddr_r_proto" in
13418 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13419 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13421 case "$getnetbyaddr_r_proto" in
13422 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13423 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13425 case "$getnetbyaddr_r_proto" in
13426 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13427 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13429 case "$getnetbyaddr_r_proto" in
13430 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13431 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13433 case "$getnetbyaddr_r_proto" in
13434 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13435 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13437 case "$getnetbyaddr_r_proto" in
13438 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13439 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13441 case "$getnetbyaddr_r_proto" in
13442 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13443 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13445 case "$getnetbyaddr_r_proto" in
13446 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13447 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13449 case "$getnetbyaddr_r_proto" in
13450 ''|0) d_getnetbyaddr_r=undef
13451 getnetbyaddr_r_proto=0
13452 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13453 * ) case "$getnetbyaddr_r_proto" in
13454 REENTRANT_PROTO*) ;;
13455 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13457 echo "Prototype: $try" ;;
13460 *) case "$usethreads" in
13461 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13463 d_getnetbyaddr_r=undef
13464 getnetbyaddr_r_proto=0
13468 *) getnetbyaddr_r_proto=0
13472 : see if getnetbyname_r exists
13473 set getnetbyname_r d_getnetbyname_r
13475 case "$d_getnetbyname_r" in
13477 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13478 case "$d_getnetbyname_r_proto:$usethreads" in
13479 ":define") d_getnetbyname_r_proto=define
13480 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13484 case "$d_getnetbyname_r_proto" in
13486 case "$getnetbyname_r_proto" in
13487 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13488 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13490 case "$getnetbyname_r_proto" in
13491 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13492 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13494 case "$getnetbyname_r_proto" in
13495 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13496 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13498 case "$getnetbyname_r_proto" in
13499 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13500 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13502 case "$getnetbyname_r_proto" in
13503 ''|0) d_getnetbyname_r=undef
13504 getnetbyname_r_proto=0
13505 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13506 * ) case "$getnetbyname_r_proto" in
13507 REENTRANT_PROTO*) ;;
13508 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13510 echo "Prototype: $try" ;;
13513 *) case "$usethreads" in
13514 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13516 d_getnetbyname_r=undef
13517 getnetbyname_r_proto=0
13521 *) getnetbyname_r_proto=0
13525 : see if getnetent_r exists
13526 set getnetent_r d_getnetent_r
13528 case "$d_getnetent_r" in
13530 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13531 case "$d_getnetent_r_proto:$usethreads" in
13532 ":define") d_getnetent_r_proto=define
13533 set d_getnetent_r_proto getnetent_r $hdrs
13537 case "$d_getnetent_r_proto" in
13539 case "$getnetent_r_proto" in
13540 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13541 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13543 case "$getnetent_r_proto" in
13544 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13545 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13547 case "$getnetent_r_proto" in
13548 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13549 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13551 case "$getnetent_r_proto" in
13552 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13553 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13555 case "$getnetent_r_proto" in
13556 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13557 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13559 case "$getnetent_r_proto" in
13560 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13561 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13563 case "$getnetent_r_proto" in
13564 ''|0) d_getnetent_r=undef
13565 getnetent_r_proto=0
13566 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13567 * ) case "$getnetent_r_proto" in
13568 REENTRANT_PROTO*) ;;
13569 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13571 echo "Prototype: $try" ;;
13574 *) case "$usethreads" in
13575 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13577 d_getnetent_r=undef
13578 getnetent_r_proto=0
13582 *) getnetent_r_proto=0
13586 : see if prototypes for various getnetxxx netdb.h functions are available
13588 set d_getnetprotos getnetent $i_netdb netdb.h
13591 : see if getpagesize exists
13592 set getpagesize d_getpagsz
13596 : see if getprotobyname exists
13597 set getprotobyname d_getpbyname
13600 : see if getprotobynumber exists
13601 set getprotobynumber d_getpbynumber
13604 : see if getprotoent exists
13605 set getprotoent d_getpent
13608 : see if getpgid exists
13609 set getpgid d_getpgid
13612 : see if getpgrp2 exists
13613 set getpgrp2 d_getpgrp2
13616 : see if getppid exists
13617 set getppid d_getppid
13620 : see if getpriority exists
13621 set getpriority d_getprior
13624 : see if getprotobyname_r exists
13625 set getprotobyname_r d_getprotobyname_r
13627 case "$d_getprotobyname_r" in
13629 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13630 case "$d_getprotobyname_r_proto:$usethreads" in
13631 ":define") d_getprotobyname_r_proto=define
13632 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13636 case "$d_getprotobyname_r_proto" in
13638 case "$getprotobyname_r_proto" in
13639 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13640 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13642 case "$getprotobyname_r_proto" in
13643 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13644 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13646 case "$getprotobyname_r_proto" in
13647 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13648 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13650 case "$getprotobyname_r_proto" in
13651 ''|0) d_getprotobyname_r=undef
13652 getprotobyname_r_proto=0
13653 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13654 * ) case "$getprotobyname_r_proto" in
13655 REENTRANT_PROTO*) ;;
13656 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13658 echo "Prototype: $try" ;;
13661 *) case "$usethreads" in
13662 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13664 d_getprotobyname_r=undef
13665 getprotobyname_r_proto=0
13669 *) getprotobyname_r_proto=0
13673 : see if getprotobynumber_r exists
13674 set getprotobynumber_r d_getprotobynumber_r
13676 case "$d_getprotobynumber_r" in
13678 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13679 case "$d_getprotobynumber_r_proto:$usethreads" in
13680 ":define") d_getprotobynumber_r_proto=define
13681 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13685 case "$d_getprotobynumber_r_proto" in
13687 case "$getprotobynumber_r_proto" in
13688 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13689 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13691 case "$getprotobynumber_r_proto" in
13692 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13693 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13695 case "$getprotobynumber_r_proto" in
13696 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13697 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13699 case "$getprotobynumber_r_proto" in
13700 ''|0) d_getprotobynumber_r=undef
13701 getprotobynumber_r_proto=0
13702 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13703 * ) case "$getprotobynumber_r_proto" in
13704 REENTRANT_PROTO*) ;;
13705 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13707 echo "Prototype: $try" ;;
13710 *) case "$usethreads" in
13711 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13713 d_getprotobynumber_r=undef
13714 getprotobynumber_r_proto=0
13718 *) getprotobynumber_r_proto=0
13722 : see if getprotoent_r exists
13723 set getprotoent_r d_getprotoent_r
13725 case "$d_getprotoent_r" in
13727 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13728 case "$d_getprotoent_r_proto:$usethreads" in
13729 ":define") d_getprotoent_r_proto=define
13730 set d_getprotoent_r_proto getprotoent_r $hdrs
13734 case "$d_getprotoent_r_proto" in
13736 case "$getprotoent_r_proto" in
13737 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13738 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13740 case "$getprotoent_r_proto" in
13741 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13742 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13744 case "$getprotoent_r_proto" in
13745 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13746 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13748 case "$getprotoent_r_proto" in
13749 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13750 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13752 case "$getprotoent_r_proto" in
13753 ''|0) d_getprotoent_r=undef
13754 getprotoent_r_proto=0
13755 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13756 * ) case "$getprotoent_r_proto" in
13757 REENTRANT_PROTO*) ;;
13758 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13760 echo "Prototype: $try" ;;
13763 *) case "$usethreads" in
13764 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13766 d_getprotoent_r=undef
13767 getprotoent_r_proto=0
13771 *) getprotoent_r_proto=0
13775 : see if prototypes for various getprotoxxx netdb.h functions are available
13777 set d_getprotoprotos getprotoent $i_netdb netdb.h
13780 : see if getprpwnam exists
13781 set getprpwnam d_getprpwnam
13784 : see if getpwent exists
13785 set getpwent d_getpwent
13788 : see if getpwent_r exists
13789 set getpwent_r d_getpwent_r
13791 case "$d_getpwent_r" in
13793 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13794 case "$d_getpwent_r_proto:$usethreads" in
13795 ":define") d_getpwent_r_proto=define
13796 set d_getpwent_r_proto getpwent_r $hdrs
13800 case "$d_getpwent_r_proto" in
13802 case "$getpwent_r_proto" in
13803 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
13804 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
13806 case "$getpwent_r_proto" in
13807 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
13808 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
13810 case "$getpwent_r_proto" in
13811 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
13812 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
13814 case "$getpwent_r_proto" in
13815 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
13816 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
13818 case "$getpwent_r_proto" in
13819 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
13820 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
13822 case "$getpwent_r_proto" in
13823 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
13824 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
13826 case "$getpwent_r_proto" in
13827 ''|0) d_getpwent_r=undef
13829 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
13830 * ) case "$getpwent_r_proto" in
13831 REENTRANT_PROTO*) ;;
13832 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
13834 echo "Prototype: $try" ;;
13837 *) case "$usethreads" in
13838 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
13845 *) getpwent_r_proto=0
13849 : see if getpwnam_r exists
13850 set getpwnam_r d_getpwnam_r
13852 case "$d_getpwnam_r" in
13854 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13855 case "$d_getpwnam_r_proto:$usethreads" in
13856 ":define") d_getpwnam_r_proto=define
13857 set d_getpwnam_r_proto getpwnam_r $hdrs
13861 case "$d_getpwnam_r_proto" in
13863 case "$getpwnam_r_proto" in
13864 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
13865 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
13867 case "$getpwnam_r_proto" in
13868 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
13869 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
13871 case "$getpwnam_r_proto" in
13872 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
13873 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
13875 case "$getpwnam_r_proto" in
13876 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
13877 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
13879 case "$getpwnam_r_proto" in
13880 ''|0) d_getpwnam_r=undef
13882 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
13883 * ) case "$getpwnam_r_proto" in
13884 REENTRANT_PROTO*) ;;
13885 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
13887 echo "Prototype: $try" ;;
13890 *) case "$usethreads" in
13891 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
13898 *) getpwnam_r_proto=0
13902 : see if getpwuid_r exists
13903 set getpwuid_r d_getpwuid_r
13905 case "$d_getpwuid_r" in
13907 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13908 case "$d_getpwuid_r_proto:$usethreads" in
13909 ":define") d_getpwuid_r_proto=define
13910 set d_getpwuid_r_proto getpwuid_r $hdrs
13914 case "$d_getpwuid_r_proto" in
13916 case "$getpwuid_r_proto" in
13917 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
13918 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
13920 case "$getpwuid_r_proto" in
13921 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
13922 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
13924 case "$getpwuid_r_proto" in
13925 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
13926 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
13928 case "$getpwuid_r_proto" in
13929 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
13930 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
13932 case "$getpwuid_r_proto" in
13933 ''|0) d_getpwuid_r=undef
13935 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
13936 * ) case "$getpwuid_r_proto" in
13937 REENTRANT_PROTO*) ;;
13938 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
13940 echo "Prototype: $try" ;;
13943 *) case "$usethreads" in
13944 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
13951 *) getpwuid_r_proto=0
13956 : see if getservbyname exists
13957 set getservbyname d_getsbyname
13960 : see if getservbyport exists
13961 set getservbyport d_getsbyport
13964 : see if getservent exists
13965 set getservent d_getsent
13968 : see if getservbyname_r exists
13969 set getservbyname_r d_getservbyname_r
13971 case "$d_getservbyname_r" in
13973 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13974 case "$d_getservbyname_r_proto:$usethreads" in
13975 ":define") d_getservbyname_r_proto=define
13976 set d_getservbyname_r_proto getservbyname_r $hdrs
13980 case "$d_getservbyname_r_proto" in
13982 case "$getservbyname_r_proto" in
13983 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
13984 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
13986 case "$getservbyname_r_proto" in
13987 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
13988 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
13990 case "$getservbyname_r_proto" in
13991 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
13992 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
13994 case "$getservbyname_r_proto" in
13995 ''|0) d_getservbyname_r=undef
13996 getservbyname_r_proto=0
13997 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
13998 * ) case "$getservbyname_r_proto" in
13999 REENTRANT_PROTO*) ;;
14000 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14002 echo "Prototype: $try" ;;
14005 *) case "$usethreads" in
14006 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14008 d_getservbyname_r=undef
14009 getservbyname_r_proto=0
14013 *) getservbyname_r_proto=0
14017 : see if getservbyport_r exists
14018 set getservbyport_r d_getservbyport_r
14020 case "$d_getservbyport_r" in
14022 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14023 case "$d_getservbyport_r_proto:$usethreads" in
14024 ":define") d_getservbyport_r_proto=define
14025 set d_getservbyport_r_proto getservbyport_r $hdrs
14029 case "$d_getservbyport_r_proto" in
14031 case "$getservbyport_r_proto" in
14032 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14033 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14035 case "$getservbyport_r_proto" in
14036 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14037 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14039 case "$getservbyport_r_proto" in
14040 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14041 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14043 case "$getservbyport_r_proto" in
14044 ''|0) d_getservbyport_r=undef
14045 getservbyport_r_proto=0
14046 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14047 * ) case "$getservbyport_r_proto" in
14048 REENTRANT_PROTO*) ;;
14049 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14051 echo "Prototype: $try" ;;
14054 *) case "$usethreads" in
14055 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14057 d_getservbyport_r=undef
14058 getservbyport_r_proto=0
14062 *) getservbyport_r_proto=0
14066 : see if getservent_r exists
14067 set getservent_r d_getservent_r
14069 case "$d_getservent_r" in
14071 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14072 case "$d_getservent_r_proto:$usethreads" in
14073 ":define") d_getservent_r_proto=define
14074 set d_getservent_r_proto getservent_r $hdrs
14078 case "$d_getservent_r_proto" in
14080 case "$getservent_r_proto" in
14081 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14082 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
14084 case "$getservent_r_proto" in
14085 ''|0) try='int getservent_r(struct servent*, char*, int);'
14086 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
14088 case "$getservent_r_proto" in
14089 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14090 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
14092 case "$getservent_r_proto" in
14093 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14094 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
14096 case "$getservent_r_proto" in
14097 ''|0) d_getservent_r=undef
14098 getservent_r_proto=0
14099 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14100 * ) case "$getservent_r_proto" in
14101 REENTRANT_PROTO*) ;;
14102 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14104 echo "Prototype: $try" ;;
14107 *) case "$usethreads" in
14108 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14110 d_getservent_r=undef
14111 getservent_r_proto=0
14115 *) getservent_r_proto=0
14119 : see if prototypes for various getservxxx netdb.h functions are available
14121 set d_getservprotos getservent $i_netdb netdb.h
14124 : see if getspnam exists
14125 set getspnam d_getspnam
14128 : see if this is a shadow.h system
14129 set shadow.h i_shadow
14132 : see if getspnam_r exists
14133 set getspnam_r d_getspnam_r
14135 case "$d_getspnam_r" in
14137 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14138 case "$d_getspnam_r_proto:$usethreads" in
14139 ":define") d_getspnam_r_proto=define
14140 set d_getspnam_r_proto getspnam_r $hdrs
14144 case "$d_getspnam_r_proto" in
14146 case "$getspnam_r_proto" in
14147 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14148 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14150 case "$getspnam_r_proto" in
14151 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14152 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14154 case "$getspnam_r_proto" in
14155 ''|0) d_getspnam_r=undef
14157 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14158 * ) case "$getspnam_r_proto" in
14159 REENTRANT_PROTO*) ;;
14160 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14162 echo "Prototype: $try" ;;
14165 *) case "$usethreads" in
14166 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14173 *) getspnam_r_proto=0
14177 : see if gettimeofday or ftime exists
14178 set gettimeofday d_gettimeod
14180 case "$d_gettimeod" in
14186 val="$undef"; set d_ftime; eval $setvar
14189 case "$d_gettimeod$d_ftime" in
14192 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14196 : see if gmtime_r exists
14197 set gmtime_r d_gmtime_r
14199 case "$d_gmtime_r" in
14201 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14202 case "$d_gmtime_r_proto:$usethreads" in
14203 ":define") d_gmtime_r_proto=define
14204 set d_gmtime_r_proto gmtime_r $hdrs
14208 case "$d_gmtime_r_proto" in
14210 case "$gmtime_r_proto" in
14211 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14212 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14214 case "$gmtime_r_proto" in
14215 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14216 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14218 case "$gmtime_r_proto" in
14219 ''|0) d_gmtime_r=undef
14221 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14222 * ) case "$gmtime_r_proto" in
14223 REENTRANT_PROTO*) ;;
14224 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14226 echo "Prototype: $try" ;;
14229 *) case "$usethreads" in
14230 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14237 *) gmtime_r_proto=0
14241 : see if hasmntopt exists
14242 set hasmntopt d_hasmntopt
14245 : see if this is a netinet/in.h or sys/in.h system
14246 set netinet/in.h i_niin sys/in.h i_sysin
14249 : see if arpa/inet.h has to be included
14250 set arpa/inet.h i_arpainet
14253 : see if htonl --and friends-- exists
14258 : Maybe they are macros.
14261 $cat >htonl.c <<EOM
14263 #include <sys/types.h>
14264 #$i_niin I_NETINET_IN
14266 #$i_arpainet I_ARPA_INET
14267 #ifdef I_NETINET_IN
14268 #include <netinet/in.h>
14271 #include <sys/in.h>
14274 #include <arpa/inet.h>
14277 printf("Defined as a macro.");
14280 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14281 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14283 echo "But it seems to be defined as a macro." >&4
14291 : see if ilogbl exists
14292 set ilogbl d_ilogbl
14297 if set index val -f; eval $csym; $val; then
14298 if set strchr val -f d_strchr; eval $csym; $val; then
14299 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14302 echo "strchr() found." >&4
14306 echo "index() found." >&4
14311 echo "index() found." >&4
14314 if set strchr val -f d_strchr; eval $csym; $val; then
14317 echo "strchr() found." >&4
14319 echo "No index() or strchr() found!" >&4
14324 set d_strchr; eval $setvar
14326 set d_index; eval $setvar
14328 : check whether inet_aton exists
14329 set inet_aton d_inetaton
14334 $cat >isascii.c <<EOCP
14337 #$i_stdlib I_STDLIB
14339 #include <stdlib.h>
14350 if eval $compile; then
14351 echo "isascii() found." >&4
14354 echo "isascii() NOT found." >&4
14361 : see if isfinite exists
14362 set isfinite d_isfinite
14365 : see if isinf exists
14369 : see if isnan exists
14373 : see if isnanl exists
14374 set isnanl d_isnanl
14377 : see if killpg exists
14378 set killpg d_killpg
14381 : see if lchown exists
14383 $cat > try.c <<'EOCP'
14384 /* System header to define __stub macros and hopefully few prototypes,
14385 which can conflict with char lchown(); below. */
14386 #include <assert.h>
14387 /* Override any gcc2 internal prototype to avoid an error. */
14388 /* We use char because int might match the return type of a gcc2
14389 builtin and then its argument prototype would still apply. */
14392 /* The GNU C library defines this for functions which it implements
14393 to always fail with ENOSYS. Some functions are actually named
14394 something starting with __ and the normal name is an alias. */
14395 #if defined (__stub_lchown) || defined (__stub___lchown)
14403 if eval $compile; then
14404 $echo "lchown() found." >&4
14407 $echo "lchown() NOT found." >&4
14413 : See if number of significant digits in a double precision number is known
14415 $cat >ldbl_dig.c <<EOM
14416 #$i_limits I_LIMITS
14419 #include <limits.h>
14425 printf("Contains LDBL_DIG");
14428 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14429 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14430 echo "LDBL_DIG found." >&4
14433 echo "LDBL_DIG NOT found." >&4
14440 : see if this is a math.h system
14444 d_libm_lib_version="$undef"
14447 : check to see if math.h defines _LIB_VERSION
14449 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14451 #include <unistd.h>
14453 int main (int argc, char *argv[])
14455 printf ("%d\n", _LIB_VERSION);
14460 if eval $compile; then
14462 echo "Yes, it does ($foo)" >&4
14463 d_libm_lib_version="$define"
14465 echo "No, it does not (probably harmless)\n" >&4
14467 $rm -f try.* try core core.try.*
14472 : see if link exists
14476 : see if localtime_r exists
14477 set localtime_r d_localtime_r
14479 case "$d_localtime_r" in
14481 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14482 case "$d_localtime_r_proto:$usethreads" in
14483 ":define") d_localtime_r_proto=define
14484 set d_localtime_r_proto localtime_r $hdrs
14488 case "$d_localtime_r_proto" in
14490 case "$localtime_r_proto" in
14491 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14492 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14494 case "$localtime_r_proto" in
14495 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14496 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14498 case "$localtime_r_proto" in
14499 ''|0) d_localtime_r=undef
14500 localtime_r_proto=0
14501 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14502 * ) case "$localtime_r_proto" in
14503 REENTRANT_PROTO*) ;;
14504 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14506 echo "Prototype: $try" ;;
14509 *) case "$usethreads" in
14510 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14512 d_localtime_r=undef
14513 localtime_r_proto=0
14517 *) localtime_r_proto=0
14521 : see if localeconv exists
14522 set localeconv d_locconv
14525 : see if lockf exists
14529 : see if prototype for lseek is available
14531 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14534 : see if lstat exists
14538 : see if madvise exists
14539 set madvise d_madvise
14542 : see if malloc_size exists
14543 set malloc_size d_malloc_size
14546 : see if malloc_size_good exists
14547 set malloc_good_size d_malloc_good_size
14550 : see if mblen exists
14554 : see if mbstowcs exists
14555 set mbstowcs d_mbstowcs
14558 : see if mbtowc exists
14559 set mbtowc d_mbtowc
14562 : see if memchr exists
14563 set memchr d_memchr
14566 : see if memcmp exists
14567 set memcmp d_memcmp
14570 : see if memcpy exists
14571 set memcpy d_memcpy
14574 : see if memmove exists
14575 set memmove d_memmove
14578 : see if memset exists
14579 set memset d_memset
14582 : see if mkdir exists
14586 : see if mkdtemp exists
14587 set mkdtemp d_mkdtemp
14590 : see if mkfifo exists
14591 set mkfifo d_mkfifo
14594 : see if mkstemp exists
14595 set mkstemp d_mkstemp
14598 : see if mkstemps exists
14599 set mkstemps d_mkstemps
14602 : see if mktime exists
14603 set mktime d_mktime
14606 : see if this is a sys/mman.h system
14607 set sys/mman.h i_sysmman
14610 : see if mmap exists
14613 : see what shmat returns
14614 : default to something harmless
14616 case "$i_sysmman$d_mmap" in
14618 $cat >mmap.c <<'END'
14619 #include <sys/mman.h>
14622 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14627 echo "and it returns ($mmaptype)." >&4
14633 : see if sqrtl exists
14637 : see if scalbnl exists
14638 set scalbnl d_scalbnl
14641 : see if modfl exists
14645 : see if prototype for modfl is available
14647 set d_modflproto modfl $i_math math.h
14650 d_modfl_pow32_bug="$undef"
14652 case "$d_longdbl$d_modfl" in
14655 Checking to see whether your modfl() is okay for large values...
14661 if $test "X$d_modflproto" != "X$define"; then
14662 $cat >>try.c <<EOCP
14663 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14664 long double modfl (long double, long double *);
14667 $cat >>try.c <<EOCP
14669 long double nv = 4294967303.15;
14675 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14679 case "$osname:$gccversion" in
14680 aix:) saveccflags="$ccflags"
14681 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14684 if eval $compile; then
14687 *" 4294967303.150000 1.150000 4294967302.000000")
14688 echo >&4 "Your modfl() is broken for large values."
14689 d_modfl_pow32_bug="$define"
14691 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14695 *" 4294967303.150000 0.150000 4294967303.000000")
14696 echo >&4 "Your modfl() seems okay for large values."
14698 *) echo >&4 "I don't understand your modfl() at all."
14702 $rm -f try.* try core core.try.*
14704 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14707 case "$osname:$gccversion" in
14708 aix:) ccflags="$saveccflags" ;; # restore
14713 if $test "$uselongdouble" = "$define"; then
14715 if $test "$d_sqrtl" != "$define"; then
14716 message="$message sqrtl"
14718 if $test "$d_modfl" != "$define"; then
14719 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14720 echo "You have both aintl and copysignl, so I can emulate modfl."
14722 message="$message modfl"
14725 if $test "$d_frexpl" != "$define"; then
14726 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14727 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14729 message="$message frexpl"
14733 if $test "$message" != ""; then
14736 *** You requested the use of long doubles but you do not seem to have
14737 *** the following mathematical functions needed for long double support:
14739 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
14740 *** Cannot continue, aborting.
14748 : see if mprotect exists
14749 set mprotect d_mprotect
14752 : see if msgctl exists
14753 set msgctl d_msgctl
14756 : see if msgget exists
14757 set msgget d_msgget
14760 : see if msgsnd exists
14761 set msgsnd d_msgsnd
14764 : see if msgrcv exists
14765 set msgrcv d_msgrcv
14768 : see how much of the 'msg*(2)' library is present.
14771 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
14772 *"$undef"*) h_msg=false;;
14776 case "`ipcs 2>&1`" in
14777 "SVID messages"*"not configured"*)
14778 echo "Your $osname does not have the msg*(2) configured." >&4
14781 set msgctl d_msgctl
14783 set msgget d_msgget
14785 set msgsnd d_msgsnd
14787 set msgrcv d_msgrcv
14793 : we could also check for sys/ipc.h ...
14794 if $h_msg && $test `./findhdr sys/msg.h`; then
14795 echo "You have the full msg*(2) library." >&4
14798 echo "You don't have the full msg*(2) library." >&4
14806 echo "Checking to see if your system supports struct msghdr..." >&4
14807 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
14809 case "$d_msghdr_s" in
14810 "$define") echo "Yes, it does." ;;
14811 *) echo "No, it doesn't." ;;
14815 : see if msync exists
14819 : see if munmap exists
14820 set munmap d_munmap
14823 : see if nice exists
14827 : see if this is a langinfo.h system
14828 set langinfo.h i_langinfo
14831 : see if nl_langinfo exists
14832 set nl_langinfo d_nl_langinfo
14835 : check for length of character
14837 case "$charsize" in
14839 echo "Checking to see how big your characters are (hey, you never know)..." >&4
14842 #$i_stdlib I_STDLIB
14844 #include <stdlib.h>
14848 printf("%d\n", (int)sizeof(char));
14853 if eval $compile_ok; then
14857 echo "(I can't seem to compile the test program. Guessing...)"
14864 rp="What is the size of a character (in bytes)?"
14869 : check for volatile keyword
14871 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
14872 $cat >try.c <<'EOCP'
14875 typedef struct _goo_struct goo_struct;
14876 goo_struct * volatile goo = ((goo_struct *)0);
14877 struct _goo_struct {
14882 typedef unsigned short foo_t;
14883 char *volatile foo;
14885 volatile foo_t blech;
14889 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
14891 echo "Yup, it does."
14894 echo "Nope, it doesn't."
14902 $echo "Choosing the C types to be used for Perl's internal types..." >&4
14904 case "$use64bitint:$d_quad:$quadtype" in
14907 uvtype="$uquadtype"
14912 uvtype="unsigned long"
14918 case "$uselongdouble:$d_longdbl" in
14920 nvtype="long double"
14921 nvsize=$longdblsize
14928 $echo "(IV will be "$ivtype", $ivsize bytes)"
14929 $echo "(UV will be "$uvtype", $uvsize bytes)"
14930 $echo "(NV will be "$nvtype", $nvsize bytes)"
14933 #$i_inttypes I_INTTYPES
14935 #include <inttypes.h>
14940 int8_t i = INT8_MAX;
14941 uint8_t u = UINT8_MAX;
14942 printf("int8_t\n");
14945 int16_t i = INT16_MAX;
14946 uint16_t i = UINT16_MAX;
14947 printf("int16_t\n");
14950 int32_t i = INT32_MAX;
14951 uint32_t u = UINT32_MAX;
14952 printf("int32_t\n");
14958 '') case "$charsize" in
14960 u8type="unsigned char"
14969 if eval $compile; then
14970 case "`$run ./try`" in
14971 int8_t) i8type=int8_t
14981 '') if $test $charsize -ge 1; then
14983 u8type="unsigned char"
14991 '') case "$shortsize" in
14993 u16type="unsigned short"
15001 '') set try -DINT16
15002 if eval $compile; then
15003 case "`$run ./try`" in
15015 '') if $test $shortsize -ge 2; then
15017 u16type="unsigned short"
15025 '') case "$longsize" in
15027 u32type="unsigned long"
15031 *) case "$intsize" in
15033 u32type="unsigned int"
15043 '') set try -DINT32
15044 if eval $compile; then
15045 case "`$run ./try`" in
15057 '') if $test $intsize -ge 4; then
15059 u32type="unsigned int"
15067 '') case "$d_quad:$quadtype" in
15069 i64type="$quadtype"
15070 u64type="$uquadtype"
15078 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15079 : volatile so that the compiler has to store it out to memory.
15080 if test X"$d_volatile" = X"$define"; then
15085 #$i_stdlib I_STDLIB
15087 #include <stdlib.h>
15089 #include <sys/types.h>
15090 #include <signal.h>
15092 $volatile int bletched = 0;
15093 $signal_t blech(int s) { bletched = 1; }
15098 int n = 8 * $uvsize;
15101 signal(SIGFPE, blech);
15104 for (i = 0; i < n; i++) {
15105 u = u << 1 | ($uvtype)1;
15107 if (($uvtype)d != u)
15111 d = ($nvtype)(u - 1);
15112 if (($uvtype)d != (u - 1))
15120 printf("%d\n", ((i == n) ? -n : i));
15126 d_nv_preserves_uv="$undef"
15127 if eval $compile; then
15128 nv_preserves_uv_bits="`$run ./try`"
15130 case "$nv_preserves_uv_bits" in
15132 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15133 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15134 d_nv_preserves_uv="$define"
15136 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15137 d_nv_preserves_uv="$undef" ;;
15138 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15139 nv_preserves_uv_bits="$undef" ;;
15144 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15145 : volatile so that the compiler has to store it out to memory.
15146 if test X"$d_volatile" = X"$define"; then
15151 #$i_stdlib I_STDLIB
15153 #include <stdlib.h>
15155 #$i_string I_STRING
15157 # include <string.h>
15159 # include <strings.h>
15161 #include <sys/types.h>
15162 #include <signal.h>
15164 $volatile int bletched = 0;
15165 $signal_t blech(int s) { bletched = 1; }
15168 int checkit($nvtype d, char *where) {
15169 unsigned char *p = (char *)&d;
15170 unsigned char *end = p + sizeof(d);
15180 printf("No - %s: 0x", where);
15182 printf ("%02X", *p++);
15187 int main(int argc, char **argv) {
15190 fail += checkit(d, "0.0");
15192 /* The compiler shouldn't be assuming that bletched is 0 */
15195 fail += checkit(d, "bleched");
15198 signal(SIGFPE, blech);
15201 /* Paranoia - the compiler should have no way of knowing that ANSI says
15202 that argv[argc] will always be NULL. Actually, if it did assume this it
15203 would be buggy, as this is C and main() can be called from elsewhere in
15205 d = argv[argc] ? 1 : 0;
15208 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15211 fail += checkit(d, "ternary");
15213 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15216 printf("No - memset doesn't give 0.0\n");
15217 /* This might just blow up: */
15218 printf("(gives %g)\n", d);
15224 printf("No - something bleched\n");
15229 printf("No - %d fail(s)\n", fail);
15238 d_nv_zero_is_allbits_zero="$undef"
15239 if eval $compile; then
15245 0.0 is represented as all bits zero in memory
15247 d_nv_zero_is_allbits_zero="$define"
15250 0.0 is not represented as all bits zero in memory
15252 d_nv_zero_is_allbits_zero="$undef"
15257 0.0 is not represented as all bits zero in memory
15259 d_nv_zero_is_allbits_zero="$undef"
15267 : check for off64_t
15269 echo "Checking to see if you have off64_t..." >&4
15271 #include <sys/types.h>
15272 #include <unistd.h>
15273 int main() { off64_t x = 7; }
15276 if eval $compile; then
15278 echo "You have off64_t."
15281 echo "You do not have off64_t."
15282 case "$lseeksize" in
15283 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15290 : how to create joinable pthreads
15291 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15293 echo "Checking what constant to use for creating joinable pthreads..." >&4
15294 $cat >try.c <<'EOCP'
15295 #include <pthread.h>
15297 int detachstate = JOINABLE;
15300 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15301 if eval $compile; then
15302 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15303 val="$undef" # Yes, undef.
15304 set d_old_pthread_create_joinable
15307 set old_pthread_create_joinable
15310 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15311 if eval $compile; then
15312 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15314 set d_old_pthread_create_joinable
15316 val=PTHREAD_CREATE_UNDETACHED
15317 set old_pthread_create_joinable
15320 set try -DJOINABLE=__UNDETACHED
15321 if eval $compile; then
15322 echo "You seem to use __UNDETACHED." >&4
15324 set d_old_pthread_create_joinable
15327 set old_pthread_create_joinable
15330 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15332 set d_old_pthread_create_joinable
15335 set old_pthread_create_joinable
15342 d_old_pthread_create_joinable="$undef"
15343 old_pthread_create_joinable=""
15346 : see if pause exists
15350 : see if pipe exists
15354 : see if poll exists
15358 : see if readlink exists
15359 set readlink d_readlink
15365 case "$d_readlink" in
15367 if $issymlink /proc/self/exe ; then
15368 $ls -l /proc/self/exe > reflect
15369 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15370 echo "You have Linux-like /proc/self/exe."
15371 procselfexe='"/proc/self/exe"'
15375 if $issymlink /proc/curproc/file ; then
15376 $ls -l /proc/curproc/file > reflect
15377 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15378 echo "You have BSD-like /proc/curproc/file."
15379 procselfexe='"/proc/curproc/file"'
15389 : see whether the pthread_atfork exists
15391 #include <pthread.h>
15394 #ifdef PTHREAD_ATFORK
15395 pthread_atfork(NULL,NULL,NULL);
15400 : see if pthread_atfork exists
15401 set try -DPTHREAD_ATFORK
15402 if eval $compile; then
15407 case "$usethreads" in
15410 $define) echo 'pthread_atfork found.' >&4 ;;
15411 *) echo 'pthread_atfork NOT found.' >&4 ;;
15414 set d_pthread_atfork
15417 : see if pthread_attr_setscope exists
15418 set pthread_attr_setscope d_pthread_attr_setscope
15422 : see whether the various POSIXish _yields exist
15424 #include <pthread.h>
15430 #ifdef PTHREAD_YIELD
15433 #ifdef PTHREAD_YIELD_NULL
15434 pthread_yield(NULL);
15440 : see if sched_yield exists
15441 set try -DSCHED_YIELD
15442 if eval $compile; then
15444 sched_yield='sched_yield()'
15448 case "$usethreads" in
15451 $define) echo 'sched_yield() found.' >&4 ;;
15452 *) echo 'sched_yield() NOT found.' >&4 ;;
15458 : see if pthread_yield exists
15459 set try -DPTHREAD_YIELD
15460 if eval $compile; then
15462 case "$sched_yield" in
15463 '') sched_yield='pthread_yield()' ;;
15466 set try -DPTHREAD_YIELD_NULL
15467 if eval $compile; then
15469 case "$sched_yield" in
15470 '') sched_yield='pthread_yield(NULL)' ;;
15476 case "$usethreads" in
15479 $define) echo 'pthread_yield() found.' >&4 ;;
15480 *) echo 'pthread_yield() NOT found.' >&4 ;;
15484 set d_pthread_yield
15487 case "$sched_yield" in
15488 '') sched_yield=undef ;;
15493 : see if random_r exists
15494 set random_r d_random_r
15496 case "$d_random_r" in
15498 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15499 case "$d_random_r_proto:$usethreads" in
15500 ":define") d_random_r_proto=define
15501 set d_random_r_proto random_r $hdrs
15505 case "$d_random_r_proto" in
15507 case "$random_r_proto" in
15508 ''|0) try='int random_r(int*, struct random_data*);'
15509 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15511 case "$random_r_proto" in
15512 ''|0) try='int random_r(long*, struct random_data*);'
15513 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15515 case "$random_r_proto" in
15516 ''|0) try='int random_r(struct random_data*, int32_t*);'
15517 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15519 case "$random_r_proto" in
15520 ''|0) d_random_r=undef
15522 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15523 * ) case "$random_r_proto" in
15524 REENTRANT_PROTO*) ;;
15525 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15527 echo "Prototype: $try" ;;
15530 *) case "$usethreads" in
15531 define) echo "random_r has no prototype, not using it." >&4 ;;
15538 *) random_r_proto=0
15542 : see if readdir and friends exist
15543 set readdir d_readdir
15545 set seekdir d_seekdir
15547 set telldir d_telldir
15549 set rewinddir d_rewinddir
15552 : see if readdir64_r exists
15553 set readdir64_r d_readdir64_r
15555 case "$d_readdir64_r" in
15557 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15558 case "$d_readdir64_r_proto:$usethreads" in
15559 ":define") d_readdir64_r_proto=define
15560 set d_readdir64_r_proto readdir64_r $hdrs
15564 case "$d_readdir64_r_proto" in
15566 case "$readdir64_r_proto" in
15567 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15568 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15570 case "$readdir64_r_proto" in
15571 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15572 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15574 case "$readdir64_r_proto" in
15575 ''|0) d_readdir64_r=undef
15576 readdir64_r_proto=0
15577 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15578 * ) case "$readdir64_r_proto" in
15579 REENTRANT_PROTO*) ;;
15580 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15582 echo "Prototype: $try" ;;
15585 *) case "$usethreads" in
15586 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15588 d_readdir64_r=undef
15589 readdir64_r_proto=0
15593 *) readdir64_r_proto=0
15597 : see if readdir_r exists
15598 set readdir_r d_readdir_r
15600 case "$d_readdir_r" in
15602 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15603 case "$d_readdir_r_proto:$usethreads" in
15604 ":define") d_readdir_r_proto=define
15605 set d_readdir_r_proto readdir_r $hdrs
15609 case "$d_readdir_r_proto" in
15611 case "$readdir_r_proto" in
15612 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15613 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15615 case "$readdir_r_proto" in
15616 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15617 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15619 case "$readdir_r_proto" in
15620 ''|0) d_readdir_r=undef
15622 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15623 * ) case "$readdir_r_proto" in
15624 REENTRANT_PROTO*) ;;
15625 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15627 echo "Prototype: $try" ;;
15630 *) case "$usethreads" in
15631 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15638 *) readdir_r_proto=0
15642 : see if readv exists
15646 : see if recvmsg exists
15647 set recvmsg d_recvmsg
15650 : see if rename exists
15651 set rename d_rename
15654 : see if rmdir exists
15658 : see if memory.h is available.
15663 : See if it conflicts with string.h
15669 $cppstdin $cppflags $cppminus < $strings > mem.h
15670 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15672 echo "We won't be including <memory.h>."
15682 : can bcopy handle overlapping blocks?
15685 case "$d_memmove" in
15686 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15687 *) case "$d_bcopy" in
15689 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15691 #$i_memory I_MEMORY
15692 #$i_stdlib I_STDLIB
15693 #$i_string I_STRING
15694 #$i_unistd I_UNISTD
15696 $cat >>try.c <<'EOCP'
15699 # include <memory.h>
15702 # include <stdlib.h>
15705 # include <string.h>
15707 # include <strings.h>
15710 # include <unistd.h> /* Needed for NetBSD */
15714 char buf[128], abc[128];
15720 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15721 try to store the string in read-only memory. */
15722 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15724 for (align = 7; align >= 0; align--) {
15725 for (len = 36; len; len--) {
15727 bcopy(abc, b, len);
15728 for (off = 1; off <= len; off++) {
15729 bcopy(b, b+off, len);
15730 bcopy(b+off, b, len);
15731 if (bcmp(b, abc, len))
15740 if eval $compile_ok; then
15741 if ./try 2>/dev/null; then
15742 echo "Yes, it can."
15745 echo "It can't, sorry."
15748 echo "(I can't compile the test program, so we'll assume not...)"
15752 $rm -f try.* try core
15758 : can memcpy handle overlapping blocks?
15761 case "$d_memmove" in
15762 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
15763 *) case "$d_memcpy" in
15765 echo "Checking to see if memcpy() can do overlapping copies..." >&4
15767 #$i_memory I_MEMORY
15768 #$i_stdlib I_STDLIB
15769 #$i_string I_STRING
15770 #$i_unistd I_UNISTD
15772 $cat >>try.c <<'EOCP'
15775 # include <memory.h>
15778 # include <stdlib.h>
15781 # include <string.h>
15783 # include <strings.h>
15786 # include <unistd.h> /* Needed for NetBSD */
15790 char buf[128], abc[128];
15796 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15797 try to store the string in read-only memory. */
15798 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
15800 for (align = 7; align >= 0; align--) {
15801 for (len = 36; len; len--) {
15803 memcpy(b, abc, len);
15804 for (off = 1; off <= len; off++) {
15805 memcpy(b+off, b, len);
15806 memcpy(b, b+off, len);
15807 if (memcmp(b, abc, len))
15816 if eval $compile_ok; then
15817 if ./try 2>/dev/null; then
15818 echo "Yes, it can."
15821 echo "It can't, sorry."
15824 echo "(I can't compile the test program, so we'll assume not...)"
15828 $rm -f try.* try core
15834 : can memcmp be trusted to compare relative magnitude?
15836 case "$d_memcmp" in
15839 echo "Checking if your memcmp() can compare relative magnitude..." >&4
15841 #$i_memory I_MEMORY
15842 #$i_stdlib I_STDLIB
15843 #$i_string I_STRING
15844 #$i_unistd I_UNISTD
15846 $cat >>try.c <<'EOCP'
15849 # include <memory.h>
15852 # include <stdlib.h>
15855 # include <string.h>
15857 # include <strings.h>
15860 # include <unistd.h> /* Needed for NetBSD */
15866 if ((a < b) && memcmp(&a, &b, 1) < 0)
15872 if eval $compile_ok; then
15873 if $run ./try 2>/dev/null; then
15874 echo "Yes, it can."
15877 echo "No, it can't (it uses signed chars)."
15880 echo "(I can't compile the test program, so we'll assume not...)"
15884 $rm -f try.* try core
15888 : see if prototype for sbrk is available
15890 set d_sbrkproto sbrk $i_unistd unistd.h
15893 : see if select exists
15894 set select d_select
15897 : see if semctl exists
15898 set semctl d_semctl
15901 : see if semget exists
15902 set semget d_semget
15905 : see if semop exists
15909 : see how much of the 'sem*(2)' library is present.
15912 case "$d_semctl$d_semget$d_semop" in
15913 *"$undef"*) h_sem=false;;
15917 case "`ipcs 2>&1`" in
15918 "SVID messages"*"not configured"*)
15919 echo "Your $osname does not have the sem*(2) configured." >&4
15922 set semctl d_semctl
15924 set semget d_semget
15932 : we could also check for sys/ipc.h ...
15933 if $h_sem && $test `./findhdr sys/sem.h`; then
15934 echo "You have the full sem*(2) library." >&4
15937 echo "You don't have the full sem*(2) library." >&4
15943 : see whether sys/sem.h defines union semun
15945 $cat > try.c <<'END'
15946 #include <sys/types.h>
15947 #include <sys/ipc.h>
15948 #include <sys/sem.h>
15949 int main () { union semun semun; semun.buf = 0; }
15952 if eval $compile; then
15953 echo "You have union semun in <sys/sem.h>." >&4
15956 echo "You do not have union semun in <sys/sem.h>." >&4
15963 : see how to do semctl IPC_STAT
15970 # define S_IRUSR S_IREAD
15971 # define S_IWUSR S_IWRITE
15972 # define S_IXUSR S_IEXEC
15974 # define S_IRUSR 0400
15975 # define S_IWUSR 0200
15976 # define S_IXUSR 0100
15978 # define S_IRGRP (S_IRUSR>>3)
15979 # define S_IWGRP (S_IWUSR>>3)
15980 # define S_IXGRP (S_IXUSR>>3)
15981 # define S_IROTH (S_IRUSR>>6)
15982 # define S_IWOTH (S_IWUSR>>6)
15983 # define S_IXOTH (S_IXUSR>>6)
15986 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
15987 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
15988 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
15991 : see whether semctl IPC_STAT can use union semun
15992 case "$d_semctl_semun" in
15996 #include <sys/types.h>
15997 #include <sys/ipc.h>
15998 #include <sys/sem.h>
15999 #include <sys/stat.h>
16006 #$d_union_semun HAS_UNION_SEMUN
16009 #ifndef HAS_UNION_SEMUN
16012 struct semid_ds *buf;
16013 unsigned short *array;
16019 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16020 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16022 struct semid_ds argbuf;
16025 st = semctl(sem, 0, IPC_STAT, arg);
16029 # endif /* IPC_STAT */
16030 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16032 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16033 # endif /* IPC_RMID */
16034 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16036 #endif /* IPC_PRIVATE && ... */
16037 printf("semget failed: errno = %d\n", errno);
16042 if eval $compile; then
16045 semun) val="$define" ;;
16053 case "$d_semctl_semun" in
16055 echo "You can use union semun for semctl IPC_STAT." >&4
16058 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16063 : see whether semctl IPC_STAT can use struct semid_ds pointer
16064 case "$d_semctl_semid_ds" in
16067 $cat > try.c <<'END'
16068 #include <sys/types.h>
16069 #include <sys/ipc.h>
16070 #include <sys/sem.h>
16071 #include <sys/stat.h>
16079 struct semid_ds arg;
16082 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16083 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16086 st = semctl(sem, 0, IPC_STAT, &arg);
16088 printf("semid_ds\n");
16090 # endif /* IPC_STAT */
16091 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16093 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16094 # endif /* IPC_RMID */
16095 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16097 #endif /* IPC_PRIVATE && ... */
16098 printf("semget failed: errno = %d\n", errno);
16104 if eval $compile; then
16107 semid_ds) val="$define" ;;
16111 set d_semctl_semid_ds
16115 case "$d_semctl_semid_ds" in
16117 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16119 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16126 # We do not have the full sem*(2) library, so assume we can not
16132 set d_semctl_semid_ds
16137 : see if sendmsg exists
16138 set sendmsg d_sendmsg
16141 : see if setegid exists
16142 set setegid d_setegid
16145 : see if seteuid exists
16146 set seteuid d_seteuid
16149 : see if setgrent exists
16150 set setgrent d_setgrent
16153 : see if setgrent_r exists
16154 set setgrent_r d_setgrent_r
16156 case "$d_setgrent_r" in
16158 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16159 case "$d_setgrent_r_proto:$usethreads" in
16160 ":define") d_setgrent_r_proto=define
16161 set d_setgrent_r_proto setgrent_r $hdrs
16165 case "$d_setgrent_r_proto" in
16167 case "$setgrent_r_proto" in
16168 ''|0) try='int setgrent_r(FILE**);'
16169 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
16171 case "$setgrent_r_proto" in
16172 ''|0) try='void setgrent_r(FILE**);'
16173 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
16175 case "$setgrent_r_proto" in
16176 ''|0) d_setgrent_r=undef
16178 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16179 * ) case "$setgrent_r_proto" in
16180 REENTRANT_PROTO*) ;;
16181 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16183 echo "Prototype: $try" ;;
16186 *) case "$usethreads" in
16187 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16194 *) setgrent_r_proto=0
16198 : see if sethostent exists
16199 set sethostent d_sethent
16202 : see if sethostent_r exists
16203 set sethostent_r d_sethostent_r
16205 case "$d_sethostent_r" in
16207 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16208 case "$d_sethostent_r_proto:$usethreads" in
16209 ":define") d_sethostent_r_proto=define
16210 set d_sethostent_r_proto sethostent_r $hdrs
16214 case "$d_sethostent_r_proto" in
16216 case "$sethostent_r_proto" in
16217 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16218 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16220 case "$sethostent_r_proto" in
16221 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16222 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16224 case "$sethostent_r_proto" in
16225 ''|0) d_sethostent_r=undef
16226 sethostent_r_proto=0
16227 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16228 * ) case "$sethostent_r_proto" in
16229 REENTRANT_PROTO*) ;;
16230 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16232 echo "Prototype: $try" ;;
16235 *) case "$usethreads" in
16236 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16238 d_sethostent_r=undef
16239 sethostent_r_proto=0
16243 *) sethostent_r_proto=0
16247 : see if setitimer exists
16248 set setitimer d_setitimer
16251 : see if setlinebuf exists
16252 set setlinebuf d_setlinebuf
16255 : see if setlocale exists
16256 set setlocale d_setlocale
16259 : see if locale.h is available
16260 set locale.h i_locale
16263 : see if setlocale_r exists
16264 set setlocale_r d_setlocale_r
16266 case "$d_setlocale_r" in
16268 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16269 case "$d_setlocale_r_proto:$usethreads" in
16270 ":define") d_setlocale_r_proto=define
16271 set d_setlocale_r_proto setlocale_r $hdrs
16275 case "$d_setlocale_r_proto" in
16277 case "$setlocale_r_proto" in
16278 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16279 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16281 case "$setlocale_r_proto" in
16282 ''|0) d_setlocale_r=undef
16283 setlocale_r_proto=0
16284 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16285 * ) case "$setlocale_r_proto" in
16286 REENTRANT_PROTO*) ;;
16287 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16289 echo "Prototype: $try" ;;
16292 *) case "$usethreads" in
16293 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16295 d_setlocale_r=undef
16296 setlocale_r_proto=0
16300 *) setlocale_r_proto=0
16304 : see if setnetent exists
16305 set setnetent d_setnent
16308 : see if setnetent_r exists
16309 set setnetent_r d_setnetent_r
16311 case "$d_setnetent_r" in
16313 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16314 case "$d_setnetent_r_proto:$usethreads" in
16315 ":define") d_setnetent_r_proto=define
16316 set d_setnetent_r_proto setnetent_r $hdrs
16320 case "$d_setnetent_r_proto" in
16322 case "$setnetent_r_proto" in
16323 ''|0) try='int setnetent_r(int, struct netent_data*);'
16324 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16326 case "$setnetent_r_proto" in
16327 ''|0) try='void setnetent_r(int, struct netent_data*);'
16328 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16330 case "$setnetent_r_proto" in
16331 ''|0) d_setnetent_r=undef
16332 setnetent_r_proto=0
16333 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16334 * ) case "$setnetent_r_proto" in
16335 REENTRANT_PROTO*) ;;
16336 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16338 echo "Prototype: $try" ;;
16341 *) case "$usethreads" in
16342 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16344 d_setnetent_r=undef
16345 setnetent_r_proto=0
16349 *) setnetent_r_proto=0
16353 : see if setprotoent exists
16354 set setprotoent d_setpent
16357 : see if setpgid exists
16358 set setpgid d_setpgid
16361 : see if setpgrp2 exists
16362 set setpgrp2 d_setpgrp2
16365 : see if setpriority exists
16366 set setpriority d_setprior
16369 : see if setproctitle exists
16370 set setproctitle d_setproctitle
16373 : see if setprotoent_r exists
16374 set setprotoent_r d_setprotoent_r
16376 case "$d_setprotoent_r" in
16378 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16379 case "$d_setprotoent_r_proto:$usethreads" in
16380 ":define") d_setprotoent_r_proto=define
16381 set d_setprotoent_r_proto setprotoent_r $hdrs
16385 case "$d_setprotoent_r_proto" in
16387 case "$setprotoent_r_proto" in
16388 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16389 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16391 case "$setprotoent_r_proto" in
16392 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16393 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16395 case "$setprotoent_r_proto" in
16396 ''|0) d_setprotoent_r=undef
16397 setprotoent_r_proto=0
16398 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16399 * ) case "$setprotoent_r_proto" in
16400 REENTRANT_PROTO*) ;;
16401 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16403 echo "Prototype: $try" ;;
16406 *) case "$usethreads" in
16407 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16409 d_setprotoent_r=undef
16410 setprotoent_r_proto=0
16414 *) setprotoent_r_proto=0
16418 : see if setpwent exists
16419 set setpwent d_setpwent
16422 : see if setpwent_r exists
16423 set setpwent_r d_setpwent_r
16425 case "$d_setpwent_r" in
16427 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16428 case "$d_setpwent_r_proto:$usethreads" in
16429 ":define") d_setpwent_r_proto=define
16430 set d_setpwent_r_proto setpwent_r $hdrs
16434 case "$d_setpwent_r_proto" in
16436 case "$setpwent_r_proto" in
16437 ''|0) try='int setpwent_r(FILE**);'
16438 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16440 case "$setpwent_r_proto" in
16441 ''|0) try='void setpwent_r(FILE**);'
16442 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16444 case "$setpwent_r_proto" in
16445 ''|0) d_setpwent_r=undef
16447 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16448 * ) case "$setpwent_r_proto" in
16449 REENTRANT_PROTO*) ;;
16450 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16452 echo "Prototype: $try" ;;
16455 *) case "$usethreads" in
16456 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16463 *) setpwent_r_proto=0
16467 : see if setregid exists
16468 set setregid d_setregid
16470 set setresgid d_setresgid
16473 : see if setreuid exists
16474 set setreuid d_setreuid
16476 set setresuid d_setresuid
16479 : see if setrgid exists
16480 set setrgid d_setrgid
16483 : see if setruid exists
16484 set setruid d_setruid
16487 : see if setservent exists
16488 set setservent d_setsent
16491 : see if setservent_r exists
16492 set setservent_r d_setservent_r
16494 case "$d_setservent_r" in
16496 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16497 case "$d_setservent_r_proto:$usethreads" in
16498 ":define") d_setservent_r_proto=define
16499 set d_setservent_r_proto setservent_r $hdrs
16503 case "$d_setservent_r_proto" in
16505 case "$setservent_r_proto" in
16506 ''|0) try='int setservent_r(int, struct servent_data*);'
16507 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16509 case "$setservent_r_proto" in
16510 ''|0) try='void setservent_r(int, struct servent_data*);'
16511 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16513 case "$setservent_r_proto" in
16514 ''|0) d_setservent_r=undef
16515 setservent_r_proto=0
16516 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16517 * ) case "$setservent_r_proto" in
16518 REENTRANT_PROTO*) ;;
16519 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16521 echo "Prototype: $try" ;;
16524 *) case "$usethreads" in
16525 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16527 d_setservent_r=undef
16528 setservent_r_proto=0
16532 *) setservent_r_proto=0
16536 : see if setsid exists
16537 set setsid d_setsid
16540 : see if setvbuf exists
16541 set setvbuf d_setvbuf
16544 : see if sfio.h is available
16549 : see if sfio library is available
16560 : Ok, but do we want to use it.
16564 true|$define|[yY]*) dflt='y';;
16567 echo "$package can use the sfio library, but it is experimental."
16568 case "$useperlio" in
16570 echo "For sfio also the PerlIO abstraction layer is needed."
16571 echo "Earlier you said you wouldn't want that."
16574 rp="You seem to have sfio available, do you want to try using it?"
16577 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16578 useperlio="$define"
16581 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16586 *) case "$usesfio" in
16587 true|$define|[yY]*)
16588 echo "Sorry, cannot find sfio on this machine." >&4
16589 echo "Ignoring your setting of usesfio=$usesfio." >&4
16598 $define) usesfio='true';;
16599 *) usesfio='false';;
16603 *) : Remove sfio from list of libraries to use
16606 echo "Removing unneeded -lsfio from library list" >&4
16607 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16610 echo "libs = $libs" >&4
16617 : see if shmctl exists
16618 set shmctl d_shmctl
16621 : see if shmget exists
16622 set shmget d_shmget
16625 : see if shmat exists
16628 : see what shmat returns
16631 $cat >shmat.c <<'END'
16632 #include <sys/shm.h>
16635 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16640 echo "and it returns ($shmattype)." >&4
16641 : see if a prototype for shmat is available
16642 xxx=`./findhdr sys/shm.h`
16643 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16644 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16655 set d_shmatprototype
16658 : see if shmdt exists
16662 : see how much of the 'shm*(2)' library is present.
16665 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16666 *"$undef"*) h_shm=false;;
16670 case "`ipcs 2>&1`" in
16671 "SVID shared memory"*"not configured"*)
16672 echo "Your $osname does not have the shm*(2) configured." >&4
16675 set shmctl d_shmctl
16677 set shmget d_shmget
16687 : we could also check for sys/ipc.h ...
16688 if $h_shm && $test `./findhdr sys/shm.h`; then
16689 echo "You have the full shm*(2) library." >&4
16692 echo "You don't have the full shm*(2) library." >&4
16699 : see if we have sigaction
16700 if set sigaction val -f d_sigaction; eval $csym; $val; then
16701 echo 'sigaction() found.' >&4
16704 #include <sys/types.h>
16705 #include <signal.h>
16706 #$i_stdlib I_STDLIB
16708 #include <stdlib.h>
16712 struct sigaction act, oact;
16714 oact.sa_handler = 0;
16715 /* so that act and oact are used */
16716 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16720 if eval $compile_ok; then
16723 echo "But you don't seem to have a useable struct sigaction." >&4
16727 echo 'sigaction NOT found.' >&4
16730 set d_sigaction; eval $setvar
16731 $rm -f try try$_o try.c
16733 : see if sigprocmask exists
16734 set sigprocmask d_sigprocmask
16737 : see if sigsetjmp exists
16739 case "$d_sigsetjmp" in
16742 #include <setjmp.h>
16743 #$i_stdlib I_STDLIB
16745 #include <stdlib.h>
16751 if (sigsetjmp(env,1))
16754 siglongjmp(env, 1);
16759 if eval $compile; then
16760 if $run ./try >/dev/null 2>&1; then
16761 echo "POSIX sigsetjmp found." >&4
16765 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
16771 echo "sigsetjmp not found." >&4
16775 *) val="$d_sigsetjmp"
16776 case "$d_sigsetjmp" in
16777 $define) echo "POSIX sigsetjmp found." >&4;;
16778 $undef) echo "sigsetjmp not found." >&4;;
16786 : see if snprintf exists
16787 set snprintf d_snprintf
16790 : see if vsnprintf exists
16791 set vsnprintf d_vsnprintf
16794 case "$d_snprintf-$d_vsnprintf" in
16797 Checking whether your snprintf() and vsnprintf() work okay...
16799 $cat >try.c <<'EOCP'
16800 /* v?snprintf testing logic courtesy of Russ Allbery.
16801 * According to C99:
16802 * - if the buffer is too short it still must be \0-terminated
16803 * - if the buffer is too short the potentially required length
16804 * must be returned and not -1
16805 * - if the buffer is NULL the potentially required length
16806 * must be returned and not -1 or core dump
16809 #include <stdarg.h>
16813 int test (char *format, ...)
16818 va_start (args, format);
16819 count = vsnprintf (buf, sizeof buf, format, args);
16826 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
16827 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
16831 if eval $compile; then
16834 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
16836 Your snprintf() and snprintf() don't seem to be working okay.
16838 d_snprintf="$undef"
16839 d_vsnprintf="$undef"
16843 echo "(I can't seem to compile the test program--assuming they don't)"
16844 d_snprintf="$undef"
16845 d_vsnprintf="$undef"
16847 $rm -f try.* try core core.try.*
16851 : see if sockatmark exists
16852 set sockatmark d_sockatmark
16855 : see if prototype for sockatmark is available
16857 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
16860 : see if socks5_init exists
16861 set socks5_init d_socks5_init
16864 : see if sprintf returns the length of the string in the buffer as per ANSI
16865 $echo "Checking whether sprintf returns the length of the string..." >&4
16868 #$i_stdlib I_STDLIB
16870 #include <stdlib.h>
16872 #$i_string I_STRING
16874 # include <string.h>
16876 # include <strings.h>
16885 int check (size_t expect, int test) {
16886 size_t got = strlen(buffer);
16890 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
16895 int main(int argc, char **argv) {
16898 check(sprintf(buffer, ""), ++test);
16899 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
16900 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
16907 d_sprintf_returns_strlen="$undef"
16908 if eval $compile; then
16912 sprintf returns the length of the string (as ANSI says it should)
16914 d_sprintf_returns_strlen="$define"
16917 sprintf does not return the length of the string (how old is this system?)
16919 d_sprintf_returns_strlen="$undef"
16926 : see if srand48_r exists
16927 set srand48_r d_srand48_r
16929 case "$d_srand48_r" in
16931 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16932 case "$d_srand48_r_proto:$usethreads" in
16933 ":define") d_srand48_r_proto=define
16934 set d_srand48_r_proto srand48_r $hdrs
16938 case "$d_srand48_r_proto" in
16940 case "$srand48_r_proto" in
16941 ''|0) try='int srand48_r(long, struct drand48_data*);'
16942 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
16944 case "$srand48_r_proto" in
16945 ''|0) d_srand48_r=undef
16947 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
16948 * ) case "$srand48_r_proto" in
16949 REENTRANT_PROTO*) ;;
16950 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
16952 echo "Prototype: $try" ;;
16955 *) case "$usethreads" in
16956 define) echo "srand48_r has no prototype, not using it." >&4 ;;
16963 *) srand48_r_proto=0
16967 : see if srandom_r exists
16968 set srandom_r d_srandom_r
16970 case "$d_srandom_r" in
16972 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16973 case "$d_srandom_r_proto:$usethreads" in
16974 ":define") d_srandom_r_proto=define
16975 set d_srandom_r_proto srandom_r $hdrs
16979 case "$d_srandom_r_proto" in
16981 case "$srandom_r_proto" in
16982 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
16983 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
16985 case "$srandom_r_proto" in
16986 ''|0) d_srandom_r=undef
16988 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
16989 * ) case "$srandom_r_proto" in
16990 REENTRANT_PROTO*) ;;
16991 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
16993 echo "Prototype: $try" ;;
16996 *) case "$usethreads" in
16997 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17004 *) srandom_r_proto=0
17008 : see if prototype for setresgid is available
17010 set d_sresgproto setresgid $i_unistd unistd.h
17013 : see if prototype for setresuid is available
17015 set d_sresuproto setresuid $i_unistd unistd.h
17018 : see if sys/stat.h is available
17019 set sys/stat.h i_sysstat
17023 : see if stat knows about block sizes
17025 echo "Checking to see if your struct stat has st_blocks field..." >&4
17026 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17030 : see if this is a sys/vfs.h system
17031 set sys/vfs.h i_sysvfs
17035 : see if this is a sys/statfs.h system
17036 set sys/statfs.h i_sysstatfs
17041 echo "Checking to see if your system supports struct statfs..." >&4
17042 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
17044 case "$d_statfs_s" in
17045 "$define") echo "Yes, it does." ;;
17046 *) echo "No, it doesn't." ;;
17051 : see if struct statfs knows about f_flags
17052 case "$d_statfs_s" in
17055 echo "Checking to see if your struct statfs has f_flags field..." >&4
17056 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
17060 set d_statfs_f_flags
17064 case "$d_statfs_f_flags" in
17065 "$define") echo "Yes, it does." ;;
17066 *) echo "No, it doesn't." ;;
17070 Checking how to access stdio streams by file descriptor number...
17072 case "$stdio_stream_array" in
17073 '') $cat >try.c <<EOCP
17076 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17080 for s in _iob __iob __sF
17082 set try -DSTDIO_STREAM_ARRAY=$s
17083 if eval $compile; then
17084 case "`$run ./try`" in
17085 yes) stdio_stream_array=$s; break ;;
17089 $rm -f try.* try$exe_ext
17091 case "$stdio_stream_array" in
17093 I can't figure out how to access stdio streams by file descriptor number.
17095 d_stdio_stream_array="$undef"
17098 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17100 d_stdio_stream_array="$define"
17104 : see if strcoll exists
17105 set strcoll d_strcoll
17108 : check for structure copying
17110 echo "Checking to see if your C compiler can copy structs..." >&4
17111 $cat >try.c <<'EOCP'
17121 if $cc -c try.c >/dev/null 2>&1 ; then
17123 echo "Yup, it can."
17126 echo "Nope, it can't."
17132 : see if strerror and/or sys_errlist[] exist
17134 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17135 if set strerror val -f d_strerror; eval $csym; $val; then
17136 echo 'strerror() found.' >&4
17137 d_strerror="$define"
17138 d_strerrm='strerror(e)'
17139 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17140 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17141 d_syserrlst="$define"
17143 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17144 d_syserrlst="$undef"
17146 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17147 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17148 echo 'strerror() found in string header.' >&4
17149 d_strerror="$define"
17150 d_strerrm='strerror(e)'
17151 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17152 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17153 d_syserrlst="$define"
17155 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17156 d_syserrlst="$undef"
17158 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17159 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17160 d_strerror="$undef"
17161 d_syserrlst="$define"
17162 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17164 echo 'strerror() and sys_errlist[] NOT found.' >&4
17165 d_strerror="$undef"
17166 d_syserrlst="$undef"
17167 d_strerrm='"unknown"'
17171 : see if strerror_r exists
17172 set strerror_r d_strerror_r
17174 case "$d_strerror_r" in
17176 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17177 case "$d_strerror_r_proto:$usethreads" in
17178 ":define") d_strerror_r_proto=define
17179 set d_strerror_r_proto strerror_r $hdrs
17183 case "$d_strerror_r_proto" in
17185 case "$strerror_r_proto" in
17186 ''|0) try='int strerror_r(int, char*, size_t);'
17187 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
17189 case "$strerror_r_proto" in
17190 ''|0) try='int strerror_r(int, char*, int);'
17191 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17193 case "$strerror_r_proto" in
17194 ''|0) try='char* strerror_r(int, char*, size_t);'
17195 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17197 case "$strerror_r_proto" in
17198 ''|0) d_strerror_r=undef
17200 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17201 * ) case "$strerror_r_proto" in
17202 REENTRANT_PROTO*) ;;
17203 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17205 echo "Prototype: $try" ;;
17208 *) case "$usethreads" in
17209 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17216 *) strerror_r_proto=0
17220 : see if strftime exists
17221 set strftime d_strftime
17224 : see if strlcat exists
17225 set strlcat d_strlcat
17228 : see if strlcpy exists
17229 set strlcpy d_strlcpy
17232 : see if strtod exists
17233 set strtod d_strtod
17236 : see if strtol exists
17237 set strtol d_strtol
17240 : see if strtold exists
17241 set strtold d_strtold
17244 : see if strtoll exists
17245 set strtoll d_strtoll
17248 case "$d_longlong-$d_strtoll" in
17251 Checking whether your strtoll() works okay...
17253 $cat >try.c <<'EOCP'
17256 #define strtoll __strtoll
17259 #define strtoll _strtoll
17262 extern long long int strtoll(char *s, char **, int);
17263 static int bad = 0;
17264 int check(char *s, long long ell, int een) {
17267 gll = strtoll(s, 0, 10);
17268 if (!((gll == ell) && (errno == een)))
17272 check(" 1", 1LL, 0);
17273 check(" 0", 0LL, 0);
17274 check("-1", -1LL, 0);
17275 check("-9223372036854775808", -9223372036854775808LL, 0);
17276 check("-9223372036854775808", -9223372036854775808LL, 0);
17277 check(" 9223372036854775807", 9223372036854775807LL, 0);
17278 check("-9223372036854775808", -9223372036854775808LL, 0);
17279 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17280 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17286 if eval $compile; then
17289 ok) echo "Your strtoll() seems to be working okay." ;;
17291 Your strtoll() doesn't seem to be working okay.
17297 echo "(I can't seem to compile the test program--assuming it doesn't)"
17303 : see if strtoq exists
17304 set strtoq d_strtoq
17307 : see if strtoul exists
17308 set strtoul d_strtoul
17311 case "$d_strtoul" in
17314 Checking whether your strtoul() works okay...
17316 $cat >try.c <<'EOCP'
17319 extern unsigned long int strtoul(char *s, char **, int);
17320 static int bad = 0;
17321 void check(char *s, unsigned long eul, int een) {
17324 gul = strtoul(s, 0, 10);
17325 if (!((gul == eul) && (errno == een)))
17329 check(" 1", 1L, 0);
17330 check(" 0", 0L, 0);
17332 case "$longsize" in
17334 $cat >>try.c <<'EOCP'
17335 check("18446744073709551615", 18446744073709551615UL, 0);
17336 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17337 #if 0 /* strtoul() for /^-/ strings is undefined. */
17338 check("-1", 18446744073709551615UL, 0);
17339 check("-18446744073709551614", 2, 0);
17340 check("-18446744073709551615", 1, 0);
17341 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17342 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17347 $cat >>try.c <<'EOCP'
17348 check("4294967295", 4294967295UL, 0);
17349 check("4294967296", 4294967295UL, ERANGE);
17350 #if 0 /* strtoul() for /^-/ strings is undefined. */
17351 check("-1", 4294967295UL, 0);
17352 check("-4294967294", 2, 0);
17353 check("-4294967295", 1, 0);
17354 check("-4294967296", 4294967295UL, ERANGE);
17355 check("-4294967297", 4294967295UL, ERANGE);
17360 : Should we write these tests to be more portable by sprintf-ing
17361 : ~0 and then manipulating that char string as input for strtol?
17364 $cat >>try.c <<'EOCP'
17371 if eval $compile; then
17372 case "`$run ./try`" in
17373 ok) echo "Your strtoul() seems to be working okay." ;;
17375 Your strtoul() doesn't seem to be working okay.
17384 : see if strtoull exists
17385 set strtoull d_strtoull
17388 case "$d_longlong-$d_strtoull" in
17391 Checking whether your strtoull() works okay...
17393 $cat >try.c <<'EOCP'
17396 #define strtoull __strtoull
17399 extern unsigned long long int strtoull(char *s, char **, int);
17400 static int bad = 0;
17401 int check(char *s, long long eull, int een) {
17404 gull = strtoull(s, 0, 10);
17405 if (!((gull == eull) && (errno == een)))
17409 check(" 1", 1LL, 0);
17410 check(" 0", 0LL, 0);
17411 check("18446744073709551615", 18446744073709551615ULL, 0);
17412 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17413 #if 0 /* strtoull() for /^-/ strings is undefined. */
17414 check("-1", 18446744073709551615ULL, 0);
17415 check("-18446744073709551614", 2LL, 0);
17416 check("-18446744073709551615", 1LL, 0);
17417 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17418 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17425 if eval $compile; then
17426 case "`$run ./try`" in
17427 ok) echo "Your strtoull() seems to be working okay." ;;
17429 Your strtoull() doesn't seem to be working okay.
17431 d_strtoull="$undef"
17438 : see if strtouq exists
17439 set strtouq d_strtouq
17442 case "$d_strtouq" in
17445 Checking whether your strtouq() works okay...
17447 $cat >try.c <<'EOCP'
17450 extern unsigned long long int strtouq(char *s, char **, int);
17451 static int bad = 0;
17452 void check(char *s, unsigned long long eull, int een) {
17453 unsigned long long gull;
17455 gull = strtouq(s, 0, 10);
17456 if (!((gull == eull) && (errno == een)))
17460 check(" 1", 1LL, 0);
17461 check(" 0", 0LL, 0);
17462 check("18446744073709551615", 18446744073709551615ULL, 0);
17463 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17464 #if 0 /* strtouq() for /^-/ strings is undefined. */
17465 check("-1", 18446744073709551615ULL, 0);
17466 check("-18446744073709551614", 2LL, 0);
17467 check("-18446744073709551615", 1LL, 0);
17468 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17469 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17477 if eval $compile; then
17478 case "`$run ./try`" in
17479 ok) echo "Your strtouq() seems to be working okay." ;;
17481 Your strtouq() doesn't seem to be working okay.
17490 : see if strxfrm exists
17491 set strxfrm d_strxfrm
17494 : see if symlink exists
17495 set symlink d_symlink
17498 : see if syscall exists
17499 set syscall d_syscall
17502 : see if prototype for syscall is available
17504 set d_syscallproto syscall $i_unistd unistd.h
17507 : see if sysconf exists
17508 set sysconf d_sysconf
17511 : see if system exists
17512 set system d_system
17515 : see if tcgetpgrp exists
17516 set tcgetpgrp d_tcgetpgrp
17519 : see if tcsetpgrp exists
17520 set tcsetpgrp d_tcsetpgrp
17523 : see if prototype for telldir is available
17525 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17528 : see if time exists
17530 if test "X$d_time" = X -o X"$timetype" = X; then
17531 if set time val -f d_time; eval $csym; $val; then
17532 echo 'time() found.' >&4
17534 rp="What is the type returned by time() on this system?"
17535 set time_t timetype long stdio.h sys/types.h
17538 echo 'time() not found, hope that will do.' >&4
17546 : see if this is a sys/times.h system
17547 set sys/times.h i_systimes
17550 : see if times exists
17552 if set times val -f d_times; eval $csym; $val; then
17553 echo 'times() found.' >&4
17556 case "$i_systimes" in
17557 "$define") inc='sys/times.h';;
17559 rp="What is the type returned by times() on this system?"
17560 set clock_t clocktype long stdio.h sys/types.h $inc
17563 echo 'times() NOT found, hope that will do.' >&4
17568 : see if tmpnam_r exists
17569 set tmpnam_r d_tmpnam_r
17571 case "$d_tmpnam_r" in
17573 hdrs="$i_systypes sys/types.h define stdio.h "
17574 case "$d_tmpnam_r_proto:$usethreads" in
17575 ":define") d_tmpnam_r_proto=define
17576 set d_tmpnam_r_proto tmpnam_r $hdrs
17580 case "$d_tmpnam_r_proto" in
17582 case "$tmpnam_r_proto" in
17583 ''|0) try='char* tmpnam_r(char*);'
17584 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17586 case "$tmpnam_r_proto" in
17587 ''|0) d_tmpnam_r=undef
17589 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17590 * ) case "$tmpnam_r_proto" in
17591 REENTRANT_PROTO*) ;;
17592 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17594 echo "Prototype: $try" ;;
17597 *) case "$usethreads" in
17598 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
17605 *) tmpnam_r_proto=0
17609 : see if truncate exists
17610 set truncate d_truncate
17613 : see if ttyname_r exists
17614 set ttyname_r d_ttyname_r
17616 case "$d_ttyname_r" in
17618 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
17619 case "$d_ttyname_r_proto:$usethreads" in
17620 ":define") d_ttyname_r_proto=define
17621 set d_ttyname_r_proto ttyname_r $hdrs
17625 case "$d_ttyname_r_proto" in
17627 case "$ttyname_r_proto" in
17628 ''|0) try='int ttyname_r(int, char*, size_t);'
17629 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
17631 case "$ttyname_r_proto" in
17632 ''|0) try='int ttyname_r(int, char*, int);'
17633 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
17635 case "$ttyname_r_proto" in
17636 ''|0) try='char* ttyname_r(int, char*, int);'
17637 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
17639 case "$ttyname_r_proto" in
17640 ''|0) d_ttyname_r=undef
17642 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
17643 * ) case "$ttyname_r_proto" in
17644 REENTRANT_PROTO*) ;;
17645 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
17647 echo "Prototype: $try" ;;
17650 *) case "$usethreads" in
17651 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
17658 *) ttyname_r_proto=0
17662 : see if tzname[] exists
17664 if set tzname val -a d_tzname; eval $csym; $val; then
17666 echo 'tzname[] found.' >&4
17669 echo 'tzname[] NOT found.' >&4
17675 next|rhapsody|darwin) multiarch="$define" ;;
17677 case "$multiarch" in
17678 ''|[nN]*) multiarch="$undef" ;;
17681 : check for ordering of bytes in a UV
17683 case "$usecrosscompile$multiarch" in
17686 You seem to be either cross-compiling or doing a multiarchitecture build,
17687 skipping the byteorder check.
17693 case "$byteorder" in
17696 In the following, larger digits indicate more significance. A big-endian
17697 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
17698 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
17699 machines may have weird orders like 3412. A Cray will report 87654321,
17700 an Alpha will report 12345678. If the test program works the default is
17702 I'm now running the test program...
17706 #$i_stdlib I_STDLIB
17708 #include <stdlib.h>
17710 #include <sys/types.h>
17711 typedef $uvtype UV;
17721 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
17723 u.l = (UV)0x04030201;
17724 for (i = 0; i < $uvsize; i++)
17725 printf("%c", u.c[i]+'0');
17732 if eval $compile && ./try > /dev/null; then
17735 [1-4][1-4][1-4][1-4]|12345678|87654321)
17736 echo "(The test program ran ok.)"
17737 echo "byteorder=$dflt"
17740 ????|????????) echo "(The test program ran ok.)" ;;
17741 *) echo "(The test program didn't run right for some reason.)" ;;
17746 (I can't seem to compile the test program. Guessing big-endian...)
17749 case "$xxx_prompt" in
17751 rp="What is the order of bytes in $uvtype?"
17767 Checking to see whether you can access character data unalignedly...
17769 case "$d_u32align" in
17770 '') $cat >try.c <<EOCP
17772 #$i_stdlib I_STDLIB
17774 #include <stdlib.h>
17776 #define U32 $u32type
17777 #define BYTEORDER 0x$byteorder
17779 #include <signal.h>
17781 $signal_t bletch(int s) { exit(4); }
17784 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
17789 if (sizeof(U32) != 4) {
17790 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
17797 signal(SIGBUS, bletch);
17809 for (i = 0; i < 4; i++) {
17810 up = (U32*)(buf + i);
17811 if (! ((*up == 1 << (8*i)) || /* big-endian */
17812 (*up == 1 << (8*(3-i))) /* little-endian */
17816 printf("read failed (%x)\n", *up);
17822 for (i = 0; i < 4; i++) {
17823 up = (U32*)(buf + i);
17825 if (*up != 0xBeef) {
17826 printf("write failed (%x)\n", *up);
17840 if eval $compile_ok; then
17841 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
17842 $run ./try 2>&1 >/dev/null
17845 You can access character data pretty unalignedly.
17847 d_u32align="$undef"
17850 It seems that you must access character data in an aligned manner.
17852 d_u32align="$define"
17856 rp='Can you access character data at unaligned addresses?'
17860 [yY]*) d_u32align="$undef" ;;
17861 *) d_u32align="$define" ;;
17864 $rm -f core core.try.* try.core
17868 : see if ualarm exists
17869 set ualarm d_ualarm
17872 : see if umask exists
17876 : see if unordered exists
17877 set unordered d_unordered
17880 : see if unsetenv exists
17881 set unsetenv d_unsetenv
17884 : see if usleep exists
17885 set usleep d_usleep
17888 : see if prototype for usleep is available
17890 set d_usleepproto usleep $i_unistd unistd.h
17893 : see if ustat exists
17897 : backward compatibility for d_hvfork
17898 if test X$d_hvfork != X; then
17899 d_vfork="$d_hvfork"
17902 : see if there is a vfork
17907 : Ok, but do we want to use it. vfork is reportedly unreliable in
17908 : perl on Solaris 2.x, and probably elsewhere.
17912 case "$usevfork" in
17918 Perl can only use a vfork() that doesn't suffer from strict
17919 restrictions on calling functions or modifying global data in
17920 the child. For example, glibc-2.1 contains such a vfork()
17921 that is unsuitable. If your system provides a proper fork()
17922 call, chances are that you do NOT want perl to use vfork().
17925 rp="Do you still want to use vfork()?"
17930 echo "Ok, we won't use vfork()."
17939 $define) usevfork='true';;
17940 *) usevfork='false';;
17943 : see if closedir exists
17944 set closedir d_closedir
17947 case "$d_closedir" in
17950 echo "Checking whether closedir() returns a status..." >&4
17952 #$i_dirent I_DIRENT /**/
17953 #$i_sysdir I_SYS_DIR /**/
17954 #$i_sysndir I_SYS_NDIR /**/
17955 #$i_systypes I_SYS_TYPES /**/
17957 #if defined(I_SYS_TYPES)
17958 #include <sys/types.h>
17960 #if defined(I_DIRENT)
17961 #include <dirent.h>
17962 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
17963 #include <sys/dir.h>
17967 #include <sys/ndir.h>
17971 #include <ndir.h> /* may be wrong in the future */
17973 #include <sys/dir.h>
17978 int main() { return closedir(opendir(".")); }
17981 if eval $compile_ok; then
17982 if $run ./try > /dev/null 2>&1 ; then
17983 echo "Yes, it does."
17986 echo "No, it doesn't."
17990 echo "(I can't seem to compile the test program--assuming it doesn't)"
17998 set d_void_closedir
18001 : see if there is a wait4
18005 : see if waitpid exists
18006 set waitpid d_waitpid
18009 : see if wcstombs exists
18010 set wcstombs d_wcstombs
18013 : see if wctomb exists
18014 set wctomb d_wctomb
18017 : see if writev exists
18018 set writev d_writev
18021 : preserve RCS keywords in files with variable substitution, grrr
18026 Revision='$Revision'
18028 : check for alignment requirements
18030 case "$usecrosscompile$multiarch" in
18033 You seem to be either cross-compiling or doing a multiarchitecture build,
18034 skipping the memory alignment check.
18037 case "$alignbytes" in
18038 '') alignbytes=8 ;;
18042 case "$alignbytes" in
18043 '') echo "Checking alignment constraints..." >&4
18044 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18045 $cat >try.c <<'EOCP'
18046 typedef long double NV;
18049 $cat >try.c <<'EOCP'
18053 $cat >>try.c <<'EOCP'
18061 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18066 if eval $compile_ok; then
18070 echo "(I can't seem to compile the test program...)"
18073 *) dflt="$alignbytes"
18076 rp="Doubles must be aligned on a how-many-byte boundary?"
18084 : set the base revision
18087 : how do we concatenate cpp tokens here?
18089 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18090 $cat >cpp_stuff.c <<'EOCP'
18091 #define RCAT(a,b)a/**/b
18092 #define ACAT(a,b)a ## b
18096 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18097 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18098 echo "Oh! Smells like ANSI's been here." >&4
18099 echo "We can catify or stringify, separately or together!"
18101 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18102 echo "Ah, yes! The good old days!" >&4
18103 echo "However, in the good old days we don't know how to stringify and"
18104 echo "catify at the same time."
18108 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18109 You're going to have to edit the values of CAT[2-5] in config.h...
18111 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18115 : see if this is a db.h system
18121 : Check db version.
18123 echo "Checking Berkeley DB version ..." >&4
18129 #include <sys/types.h>
18131 #$i_stdlib I_STDLIB
18133 #include <stdlib.h>
18136 int main(int argc, char *argv[])
18138 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18139 int Major, Minor, Patch ;
18140 unsigned long Version ;
18141 (void)db_version(&Major, &Minor, &Patch) ;
18143 printf("%d %d %d %d %d %d\n",
18144 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18145 Major, Minor, Patch);
18148 printf("You have Berkeley DB Version 2 or greater.\n");
18150 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18151 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18152 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18153 Major, Minor, Patch) ;
18155 /* check that db.h & libdb are compatible */
18156 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18157 printf("db.h and libdb are incompatible.\n") ;
18161 printf("db.h and libdb are compatible.\n") ;
18163 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18164 + DB_VERSION_PATCH ;
18166 /* needs to be >= 2.3.4 */
18167 if (Version < 2003004) {
18168 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18169 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18175 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18180 printf("You have Berkeley DB Version 1.\n");
18181 exit(0); /* DB version < 2: the coast is clear. */
18183 exit(1); /* <db.h> not Berkeley DB? */
18189 if eval $compile_ok && $run ./try; then
18190 echo 'Looks OK.' >&4
18192 db_version_major=$1
18193 db_version_minor=$2
18194 db_version_patch=$3
18196 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18200 : Remove db from list of libraries to use
18201 echo "Removing unusable -ldb from library list" >&4
18202 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18205 echo "libs = $libs" >&4
18215 : Check the return type needed for hash
18217 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18223 #include <sys/types.h>
18226 #ifndef DB_VERSION_MAJOR
18227 u_int32_t hash_cb (ptr, size)
18235 info.hash = hash_cb;
18239 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18240 if $contains warning try.out >>/dev/null 2>&1 ; then
18243 db_hashtype='u_int32_t'
18246 : XXX Maybe we should just give up here.
18247 db_hashtype=u_int32_t
18249 echo "Help: I can't seem to compile the db test program." >&4
18250 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18253 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18255 *) db_hashtype=u_int32_t
18260 : Check the return type needed for prefix
18262 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18268 #include <sys/types.h>
18271 #ifndef DB_VERSION_MAJOR
18272 size_t prefix_cb (key1, key2)
18280 info.prefix = prefix_cb;
18284 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18285 if $contains warning try.out >>/dev/null 2>&1 ; then
18286 db_prefixtype='int'
18288 db_prefixtype='size_t'
18291 db_prefixtype='size_t'
18292 : XXX Maybe we should just give up here.
18294 echo "Help: I can't seem to compile the db test program." >&4
18295 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18298 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18300 *) db_prefixtype='size_t'
18305 : How can we generate normalized random numbers ?
18307 echo "Looking for a random number function..." >&4
18308 case "$randfunc" in
18310 if set drand48 val -f; eval $csym; $val; then
18312 echo "Good, found drand48()." >&4
18313 elif set random val -f; eval $csym; $val; then
18315 echo "OK, found random()." >&4
18318 echo "Yick, looks like I have to use rand()." >&4
18329 *-Dmy_rand=*|*-Dmy_srand=*)
18330 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18331 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18332 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18333 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18337 while $test "$cont"; do
18338 rp="Use which function to generate random numbers?"
18340 if $test "$ans" = "$dflt"; then
18346 if set $ans val -f; eval $csym; $val; then
18350 rp="I cannot find function $ans. Use that name anyway?"
18359 case "$randfunc" in
18361 drand01="drand48()"
18367 case "$randbits" in
18369 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18371 #$i_unistd I_UNISTD
18372 #$i_stdlib I_STDLIB
18375 # include <unistd.h>
18378 # include <stdlib.h>
18383 register unsigned long tmp;
18384 register unsigned long max = 0L;
18386 for (i = 1000; i; i--) {
18387 tmp = (unsigned long) $randfunc();
18388 if (tmp > max) max = tmp;
18390 for (i = 0; max; i++)
18396 if eval $compile_ok; then
18400 echo "(I can't seem to compile the test program...)"
18407 rp="How many bits does your $randfunc() function produce?"
18411 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18412 seedfunc="s$randfunc"
18413 randseedtype=unsigned
18417 rp="How many bits does your $randfunc() function produce?"
18420 seedfunc="s$randfunc"
18421 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18422 if set $seedfunc val -f; eval $csym; $val; then
18423 echo "(Using $seedfunc() to seed random generator)"
18425 echo "(Warning: no $seedfunc() to seed random generator)"
18428 randseedtype=unsigned
18436 echo "Determining whether or not we are on an EBCDIC system..." >&4
18437 $cat >try.c <<'EOM'
18440 if ('M'==0xd4) return 0;
18447 if eval $compile_ok; then
18448 if $run ./try; then
18449 echo "You seem to speak EBCDIC." >&4
18452 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18455 echo "I'm unable to compile the test program." >&4
18456 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18464 Checking how to flush all pending stdio output...
18466 # I only know how to find the first 32 possibly open files on SunOS.
18467 # See also hints/sunos_4_1.sh and util.c --AD
18469 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18471 $cat >>try.c <<EOCP
18473 #$i_stdlib I_STDLIB
18475 #include <stdlib.h>
18477 #$i_unistd I_UNISTD
18479 # include <unistd.h>
18481 #$d_sysconf HAS_SYSCONF
18482 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18483 #ifdef HAS_STDIO_STREAM_ARRAY
18484 # define STDIO_STREAM_ARRAY $stdio_stream_array
18489 p = fopen("try.out", "w");
18493 # ifdef TRY_FPRINTF
18497 #ifdef TRY_FFLUSH_NULL
18500 #ifdef TRY_FFLUSH_ALL
18502 long open_max = -1;
18503 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18504 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18506 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18507 open_max = sysconf(_SC_OPEN_MAX);
18510 open_max = FOPEN_MAX;
18513 open_max = OPEN_MAX;
18522 # ifdef HAS_STDIO_STREAM_ARRAY
18523 if (open_max > 0) {
18525 for (i = 0; i < open_max; i++)
18526 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18527 STDIO_STREAM_ARRAY[i]._file < open_max &&
18528 STDIO_STREAM_ARRAY[i]._flag)
18529 fflush(&STDIO_STREAM_ARRAY[i]);
18537 : first we have to find out how _not_ to flush
18539 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18541 set try -DTRY_FPUTC
18542 if eval $compile; then
18543 $run ./try 2>/dev/null
18546 if $test ! -s try.out -a "X$code" = X42; then
18552 set try -DTRY_FPRINTF
18553 if eval $compile; then
18554 $run ./try 2>/dev/null
18557 if $test ! -s try.out -a "X$code" = X42; then
18558 output=-DTRY_FPRINTF
18564 : check for fflush NULL behaviour
18565 case "$fflushNULL" in
18566 '') set try -DTRY_FFLUSH_NULL $output
18567 if eval $compile; then
18568 $run ./try 2>/dev/null
18571 if $test -s try.out -a "X$code" = X42; then
18572 fflushNULL="`$cat try.out`"
18574 if $test "X$code" != X42; then
18576 (If this test failed, don't worry, we'll try another method shortly.)
18581 $rm -f core try.core core.try.*
18582 case "$fflushNULL" in
18584 Your fflush(NULL) works okay for output streams.
18585 Let's see if it clobbers input pipes...
18587 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18588 # bug that improperly flushes the input end of pipes. So we avoid the
18589 # autoflush on fork/system/exec support for now. :-(
18590 $cat >tryp.c <<EOCP
18593 main(int argc, char **argv)
18599 while ((i = getc(stdin)) != -1
18600 && (*bp++ = i) != '\n'
18601 && bp < &buf[1024])
18604 fprintf(stdout, "%s", buf);
18612 fflushNULL="$define"
18614 if eval $compile; then
18616 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18617 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18619 fflush(NULL) seems to behave okay with input streams.
18621 fflushNULL="$define"
18624 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18626 fflushNULL="$undef"
18629 $rm -f core tryp.c tryp.core core.tryp.*
18632 Your fflush(NULL) isn't working (contrary to ANSI C).
18634 fflushNULL="$undef"
18637 Cannot figure out whether your fflush(NULL) works or not.
18638 I'm assuming it doesn't (contrary to ANSI C).
18640 fflushNULL="$undef"
18644 $define|true|[yY]*)
18645 fflushNULL="$define"
18648 fflushNULL="$undef"
18651 : check explicit looping only if NULL did not work, and if the pipe
18652 : bug does not show up on an explicit flush too
18653 case "$fflushNULL" in
18655 $cat >tryp.c <<EOCP
18658 main(int argc, char **argv)
18664 while ((i = getc(stdin)) != -1
18665 && (*bp++ = i) != '\n'
18666 && bp < &buf[1024])
18669 fprintf(stdout, "%s", buf);
18678 if eval $compile; then
18680 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18681 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18683 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
18685 : now check for fflushall behaviour
18686 case "$fflushall" in
18687 '') set try -DTRY_FFLUSH_ALL $output
18688 if eval $compile; then
18690 (Now testing the other method--but note that this also may fail.)
18692 $run ./try 2>/dev/null
18695 if $test -s try.out -a "X$code" = X42; then
18696 fflushall="`$cat try.out`"
18699 $rm -f core try.core core.try.*
18700 case "$fflushall" in
18702 Whew. Flushing explicitly all the stdio streams works.
18704 fflushall="$define"
18707 Sigh. Flushing explicitly all the stdio streams doesn't work.
18712 Cannot figure out whether flushing stdio streams explicitly works or not.
18713 I'm assuming it doesn't.
18719 "$define"|true|[yY]*)
18720 fflushall="$define"
18728 All is futile. Even fflush(stdin) clobbers input pipes!
18735 $rm -f core tryp.c tryp.core core.tryp.*
18737 *) fflushall="$undef"
18741 case "$fflushNULL$fflushall" in
18744 OK, I give up. I cannot figure out how to flush pending stdio output.
18745 We won't be flushing handles at all before fork/exec/popen.
18749 $rm -f try.* try$exe_ext
18751 : Store the full pathname to the ar program for use in the C program
18752 : Respect a hint or command line value for full_ar.
18757 : Store the full pathname to the sed program for use in the C program
18760 : see what type gids are declared as in the kernel
18762 echo "Looking for the type for group ids returned by getgid()."
18763 set gid_t gidtype xxx stdio.h sys/types.h
18767 xxx=`./findhdr sys/user.h`
18768 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
18770 unsigned) dflt="$1 $2" ;;
18774 *) dflt="$gidtype";;
18777 gid_t) echo "gid_t found." ;;
18778 *) rp="What is the type for group ids returned by getgid()?"
18786 *_t) zzz="$gidtype" ;;
18789 echo "Checking the size of $zzz..." >&4
18791 #include <sys/types.h>
18793 #$i_stdlib I_STDLIB
18795 #include <stdlib.h>
18798 printf("%d\n", (int)sizeof($gidtype));
18803 if eval $compile_ok; then
18807 echo "(I can't execute the test program--guessing $gidsize.)" >&4
18810 echo "Your $zzz is $gidsize bytes long."
18815 echo "(I can't compile the test program--guessing $gidsize.)" >&4
18821 *_t) zzz="$gidtype" ;;
18824 echo "Checking the sign of $zzz..." >&4
18826 #include <sys/types.h>
18837 if eval $compile; then
18841 echo "(I can't execute the test program--guessing unsigned.)" >&4
18845 1) echo "Your $zzz is unsigned." ;;
18846 -1) echo "Your $zzz is signed." ;;
18852 echo "(I can't compile the test program--guessing unsigned.)" >&4
18858 if $test X"$quadtype" != X; then
18860 echo "Checking how to print 64-bit integers..." >&4
18862 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
18863 $cat >try.c <<'EOCP'
18864 #include <sys/types.h>
18867 int q = 12345678901;
18868 printf("%ld\n", q);
18872 if eval $compile; then
18876 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
18877 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
18878 echo "We will use %d."
18884 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
18885 $cat >try.c <<'EOCP'
18886 #include <sys/types.h>
18889 long q = 12345678901;
18890 printf("%ld\n", q);
18894 if eval $compile; then
18898 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
18899 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
18900 echo "We will use %ld."
18906 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
18907 $cat >try.c <<'EOCP'
18908 #include <sys/types.h>
18909 #include <inttypes.h>
18912 int64_t q = 12345678901;
18913 printf("%" PRId64 "\n", q);
18917 if eval $compile; then
18921 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
18922 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
18923 echo "We will use the C9X style."
18929 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18931 #include <sys/types.h>
18934 $quadtype q = 12345678901;
18935 printf("%Ld\n", q);
18939 if eval $compile; then
18943 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
18944 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
18945 echo "We will use %Ld."
18951 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
18952 $cat >try.c <<'EOCP'
18953 #include <sys/types.h>
18956 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
18957 printf("%lld\n", q);
18961 if eval $compile; then
18965 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
18966 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
18967 echo "We will use the %lld style."
18973 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18975 #include <sys/types.h>
18978 $quadtype q = 12345678901;
18979 printf("%qd\n", q);
18983 if eval $compile; then
18987 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
18988 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
18989 echo "We will use %qd."
18995 if $test X"$sPRId64" = X; then
18996 echo "Cannot figure out how to print 64-bit integers." >&4
19004 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19005 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19007 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19008 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19014 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19016 if $test X"$ivsize" = X8; then
19017 ivdformat="$sPRId64"
19018 uvuformat="$sPRIu64"
19019 uvoformat="$sPRIo64"
19020 uvxformat="$sPRIx64"
19021 uvXUformat="$sPRIXU64"
19023 if $test X"$ivsize" = X"$longsize"; then
19030 if $test X"$ivsize" = X"$intsize"; then
19038 if $test X"$ivsize" = X"$shortsize"; then
19049 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19050 nveformat="$sPRIeldbl"
19051 nvfformat="$sPRIfldbl"
19052 nvgformat="$sPRIgldbl"
19053 nvEUformat="$sPRIEUldbl"
19054 nvFUformat="$sPRIFUldbl"
19055 nvGUformat="$sPRIGUldbl"
19065 case "$ivdformat" in
19066 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19073 $echo "Checking the format string to be used for gids..." >&4
19076 -1) if $test X"$gidsize" = X"$ivsize"; then
19077 gidformat="$ivdformat"
19079 if $test X"$gidsize" = X"$longsize"; then
19082 if $test X"$gidsize" = X"$intsize"; then
19085 if $test X"$gidsize" = X"$shortsize"; then
19092 *) if $test X"$gidsize" = X"$uvsize"; then
19093 gidformat="$uvuformat"
19095 if $test X"$gidsize" = X"$longsize"; then
19098 if $test X"$gidsize" = X"$intsize"; then
19101 if $test X"$gidsize" = X"$shortsize"; then
19110 : see if getgroups exists
19111 set getgroups d_getgrps
19114 : see if setgroups exists
19115 set setgroups d_setgrps
19119 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19121 case "$d_getgrps$d_setgrps" in
19123 case "$groupstype" in
19124 '') dflt="$gidtype" ;;
19125 *) dflt="$groupstype" ;;
19128 What type of pointer is the second argument to getgroups() and setgroups()?
19129 Usually this is the same as group ids, $gidtype, but not always.
19132 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19136 *) groupstype="$gidtype";;
19140 if $test $patchlevel -lt 9; then
19141 : MAD is not available in 5.8.x or earlier.
19145 $define|true|[yY]*) dflt='y' ;;
19150 Would you like to build with Misc Attribute Decoration? This is development
19151 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19152 overhead on the interpreter.
19154 If this doesn't make any sense to you, just accept the default '$dflt'.
19156 rp='Build Perl with MAD?'
19161 madlyh='madly.h madly.act madly.tab'
19163 madlyobj="madly$_o" ;;
19173 echo "Checking if your $make program sets \$(MAKE)..." >&4
19174 case "$make_set_make" in
19176 $sed 's/^X //' > testmake.mak << 'EOF'
19178 X @echo 'maketemp="$(MAKE)"'
19180 case "`$make -f testmake.mak 2>/dev/null`" in
19181 *maketemp=*) make_set_make='#' ;;
19182 *) make_set_make="MAKE=$make" ;;
19184 $rm -f testmake.mak
19187 case "$make_set_make" in
19188 '#') echo "Yup, it does.";;
19189 *) echo "Nope, it doesn't.";;
19192 : see what type is used for mode_t
19193 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19194 set mode_t modetype int stdio.h sys/types.h
19197 : see if we need va_copy
19199 case "$i_stdarg" in
19202 #include <stdarg.h>
19204 #$i_stdlib I_STDLIB
19206 #include <stdlib.h>
19208 #include <signal.h>
19211 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19213 return vfprintf(f, fmt, *valp);
19217 myvfprintf(FILE *f, const char *fmt, va_list val)
19219 return ivfprintf(f, fmt, &val);
19223 myprintf(char *fmt, ...)
19226 va_start(val, fmt);
19227 return myvfprintf(stdout, fmt, val);
19231 main(int ac, char **av)
19233 signal(SIGSEGV, exit);
19235 myprintf("%s%cs all right, then\n", "that", '\'');
19240 if eval $compile && $run ./try 2>&1 >/dev/null; then
19241 case "`$run ./try`" in
19242 "that's all right, then")
19248 yes) echo "It seems that you don't need va_copy()." >&4
19249 need_va_copy="$undef"
19251 *) echo "It seems that va_copy() or similar will be needed." >&4
19252 need_va_copy="$define"
19255 $rm -f try.* core core.* *.core *.core.*
19257 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19261 : see what type is used for size_t
19262 rp="What is the type used for the length parameter for string functions?"
19263 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19266 : check for type of arguments to gethostbyaddr.
19267 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19268 case "$d_gethbyaddr" in
19272 Checking to see what type of arguments are accepted by gethostbyaddr().
19274 hdrs="$define sys/types.h
19275 $d_socket sys/socket.h
19276 $i_niin netinet/in.h
19278 $i_unistd unistd.h"
19279 : The first arg can 'char *' or 'void *'
19280 : The second arg is some of integral type
19281 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19282 for yyy in size_t long int; do
19283 case "$netdb_host_type" in
19284 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19285 if ./protochk "$try" $hdrs; then
19286 echo "Your system accepts $xxx for the first arg."
19287 echo "...and $yyy for the second arg."
19288 netdb_host_type="$xxx"
19289 netdb_hlen_type="$yyy"
19295 : In case none of those worked, prompt the user.
19296 case "$netdb_host_type" in
19297 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19300 netdb_host_type=$ans
19301 rp='What is the type for the 2nd argument to gethostbyaddr?'
19304 netdb_hlen_type=$ans
19308 *) : no gethostbyaddr, so pick harmless defaults
19309 netdb_host_type='char *'
19310 netdb_hlen_type="$sizetype"
19313 # Remove the "const" if needed. -- but then we'll have a
19315 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19318 : check for type of argument to gethostbyname.
19319 if test "X$netdb_name_type" = X ; then
19320 case "$d_gethbyname" in
19324 Checking to see what type of argument is accepted by gethostbyname().
19326 hdrs="$define sys/types.h
19327 $d_socket sys/socket.h
19328 $i_niin netinet/in.h
19330 $i_unistd unistd.h"
19331 for xxx in "const char *" "char *"; do
19332 case "$netdb_name_type" in
19333 '') try="extern struct hostent *gethostbyname($xxx);"
19334 if ./protochk "$try" $hdrs; then
19335 echo "Your system accepts $xxx."
19336 netdb_name_type="$xxx"
19341 : In case none of those worked, prompt the user.
19342 case "$netdb_name_type" in
19343 '') rp='What is the type for the 1st argument to gethostbyname?'
19346 netdb_name_type=$ans
19350 *) : no gethostbyname, so pick harmless default
19351 netdb_name_type='char *'
19356 : check for type of 1st argument to getnetbyaddr.
19357 if test "X$netdb_net_type" = X ; then
19358 case "$d_getnbyaddr" in
19362 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19364 hdrs="$define sys/types.h
19365 $d_socket sys/socket.h
19366 $i_niin netinet/in.h
19368 $i_unistd unistd.h"
19369 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19370 case "$netdb_net_type" in
19371 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19372 if ./protochk "$try" $hdrs; then
19373 echo "Your system accepts $xxx."
19374 netdb_net_type="$xxx"
19379 : In case none of those worked, prompt the user.
19380 case "$netdb_net_type" in
19381 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19384 netdb_net_type=$ans
19388 *) : no getnetbyaddr, so pick harmless default
19389 netdb_net_type='long'
19393 : locate the preferred pager for this system
19400 [a-zA-Z]:/*) dflt=$pg;;
19404 [a-zA-Z]:/*) dflt=$more;;
19408 [a-zA-Z]:/*) dflt=$less;;
19411 '') dflt=/usr/ucb/more;;
19415 : Instruct ./getfile to trust the hinted or previous pager value,
19416 : even if it does not begin with a slash. For example, on os2,
19417 : pager might be cmd /c more. See comments in UU/getfile.
19422 rp='What pager is used on your system?'
19426 : see what type pids are declared as in the kernel
19427 rp="What is the type of process ids on this system?"
19428 set pid_t pidtype int stdio.h sys/types.h
19431 : see if ar generates random libraries by itself
19433 echo "Checking how to generate random libraries on your machine..." >&4
19434 echo 'int bar1() { return bar2(); }' > bar1.c
19435 echo 'int bar2() { return 2; }' > bar2.c
19437 #$i_stdlib I_STDLIB
19439 #include <stdlib.h>
19441 int main() { printf("%d\n", bar1()); exit(0); }
19443 $cc $ccflags -c bar1.c >/dev/null 2>&1
19444 $cc $ccflags -c bar2.c >/dev/null 2>&1
19445 $cc $ccflags -c foo.c >/dev/null 2>&1
19446 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19447 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19448 $run ./foobar >/dev/null 2>&1; then
19449 echo "$ar appears to generate random libraries itself."
19451 if [ "X$ranlib" = "X" ]; then
19454 elif $ar s bar$_a >/dev/null 2>&1 &&
19455 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19456 $run ./foobar >/dev/null 2>&1; then
19457 echo "a table of contents needs to be added with '$ar s'."
19460 elif $ar ts bar$_a >/dev/null 2>&1 &&
19461 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19462 $run ./foobar >/dev/null 2>&1; then
19463 echo "a table of contents needs to be added with '$ar ts'."
19470 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19471 $test -f $ranlib || ranlib=''
19474 if $test -n "$ranlib"; then
19475 echo "your system has '$ranlib'; we'll use that."
19478 echo "your system doesn't seem to support random libraries"
19479 echo "so we'll use lorder and tsort to order the libraries."
19486 : check for type of arguments to select.
19487 case "$selecttype" in
19488 '') case "$d_select" in
19492 Checking to see what type of arguments are accepted by select().
19494 hdrs="$define sys/types.h
19495 $i_systime sys/time.h
19496 $i_sysselct sys/select.h
19497 $d_socket sys/socket.h"
19498 : The first arg can be int, unsigned, or size_t
19499 : The last arg may or may not be 'const'
19501 : void pointer has been seen but using that
19502 : breaks the selectminbits test
19503 for xxx in 'fd_set *' 'int *'; do
19504 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19505 for tmo in 'struct timeval *' 'const struct timeval *'; do
19507 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19508 if ./protochk "$try" $hdrs; then
19509 echo "Your system accepts $xxx."
19518 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19519 case "$d_fd_set" in
19520 $define) dflt="fd_set *" ;;
19529 *) : no select, so pick a harmless default
19536 : check for the select 'width'
19537 case "$selectminbits" in
19538 '') safebits=`expr $ptrsize \* 8`
19539 case "$d_select" in
19543 Checking to see on how many bits at a time your select() operates...
19546 #include <sys/types.h>
19548 #$i_systime I_SYS_TIME
19549 #$i_systimek I_SYS_TIME_KERNEL
19554 # ifdef I_SYS_TIME_KERNEL
19557 # include <sys/time.h>
19558 # ifdef I_SYS_TIME_KERNEL
19562 #$i_sysselct I_SYS_SELECT
19563 #ifdef I_SYS_SELECT
19564 #include <sys/select.h>
19566 #$d_socket HAS_SOCKET
19568 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19571 #$i_stdlib I_STDLIB
19573 #include <stdlib.h>
19576 #define S sizeof(*(b))
19578 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19579 #define NBITS (NBYTES * 8)
19581 char *s = (char *)malloc(NBYTES);
19590 fp = fopen("try.c", "r");
19596 b = ($selecttype)s;
19597 for (i = 0; i < NBITS; i++)
19601 select(fd + 1, b, 0, 0, &t);
19602 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19604 printf("%d\n", i + 1);
19609 if eval $compile_ok; then
19610 selectminbits=`$run ./try`
19611 case "$selectminbits" in
19613 Cannot figure out on how many bits at a time your select() operates.
19614 I'll play safe and guess it is $safebits bits.
19616 selectminbits=$safebits
19617 bits="$safebits bits"
19620 *) bits="$selectminbits bits" ;;
19622 echo "Your select() operates on $bits at a time." >&4
19624 rp='What is the minimum number of bits your select() operates on?'
19625 case "$byteorder" in
19626 12345678) dflt=64 ;;
19632 selectminbits="$val"
19636 *) : no select, so pick a harmless default
19637 selectminbits=$safebits
19643 : Trace out the files included by signal.h, then look for SIGxxx names.
19644 : Remove SIGARRAYSIZE used by HPUX.
19645 : Remove SIGSTKSIZE used by Linux.
19646 : Remove SIGSTKSZ used by Posix.
19647 : Remove SIGTYP void lines used by OS2.
19648 : Some cpps, like os390, dont give the file name anywhere
19649 if [ "X$fieldn" = X ]; then
19650 : Just make some guesses. We check them later.
19651 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
19653 xxx=`echo '#include <signal.h>' |
19654 $cppstdin $cppminus $cppflags 2>/dev/null |
19655 $grep '^[ ]*#.*include' |
19656 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
19658 : Check this list of files to be sure we have parsed the cpp output ok.
19659 : This will also avoid potentially non-existent files, such
19662 for xx in $xxx /dev/null ; do
19663 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
19665 : If we have found no files, at least try signal.h
19666 case "$xxxfiles" in
19667 '') xxxfiles=`./findhdr signal.h` ;;
19670 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
19671 print substr($2, 4, 20)
19673 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
19674 print substr($3, 4, 20)
19676 : Append some common names just in case the awk scan failed.
19677 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
19678 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
19679 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19680 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19681 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19683 : generate a few handy files for later
19684 $cat > signal.c <<EOCP
19685 #include <sys/types.h>
19686 #include <signal.h>
19687 #$i_stdlib I_STDLIB
19689 #include <stdlib.h>
19694 /* Strange style to avoid deeply-nested #if/#else/#endif */
19697 # define NSIG (_NSIG)
19703 # define NSIG (SIGMAX+1)
19709 # define NSIG (SIG_MAX+1)
19715 # define NSIG (_SIG_MAX+1)
19721 # define NSIG (MAXSIG+1)
19727 # define NSIG (MAX_SIG+1)
19732 # ifdef SIGARRAYSIZE
19733 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
19739 # define NSIG (_sys_nsig) /* Solaris 2.5 */
19743 /* Default to some arbitrary number that's big enough to get most
19744 of the common signals.
19750 printf("NSIG %d\n", NSIG);
19756 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
19758 printf "#ifdef SIG"; printf $1; printf "\n"
19759 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
19760 printf $1; printf ");\n"
19764 printf "#endif /* JUST_NSIG */\n";
19765 printf "exit(0);\n}\n";
19768 $cat >signal.awk <<'EOP'
19769 BEGIN { ndups = 0 }
19770 $1 ~ /^NSIG$/ { nsig = $2 }
19771 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
19772 if ($2 > maxsig) { maxsig = $2 }
19773 if (sig_name[$2]) {
19774 dup_name[ndups] = $1
19775 dup_num[ndups] = $2
19787 printf("NSIG %d\n", nsig);
19788 for (n = 1; n < nsig; n++) {
19790 printf("%s %d\n", sig_name[n], sig_num[n])
19793 printf("NUM%d %d\n", n, n)
19796 for (n = 0; n < ndups; n++) {
19797 printf("%s %d\n", dup_name[n], dup_num[n])
19801 $cat >signal_cmd <<EOS
19803 if $test -s signal.lst; then
19804 echo "Using your existing signal.lst file"
19809 $cat >>signal_cmd <<'EOS'
19812 if eval $compile_ok; then
19813 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
19815 echo "(I can't seem be able to compile the whole test program)" >&4
19816 echo "(I'll try it in little pieces.)" >&4
19817 set signal -DJUST_NSIG
19818 if eval $compile_ok; then
19819 $run ./signal$_exe > signal.nsg
19822 echo "I can't seem to figure out how many signals you have." >&4
19823 echo "Guessing 50." >&4
19824 echo 'NSIG 50' > signal.nsg
19826 : Now look at all the signal names, one at a time.
19827 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
19828 $cat > signal.c <<EOCP
19829 #include <sys/types.h>
19830 #include <signal.h>
19833 printf("$xx %d\n", SIG${xx});
19838 if eval $compile; then
19839 echo "SIG${xx} found."
19840 $run ./signal$_exe >> signal.ls1
19842 echo "SIG${xx} NOT found."
19845 if $test -s signal.ls1; then
19846 $cat signal.nsg signal.ls1 |
19847 $sort -n | $uniq | $awk -f signal.awk >signal.lst
19851 if $test -s signal.lst; then
19854 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
19855 echo 'kill -l' >signal
19856 set X `csh -f <signal`
19860 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
19862 echo $@ | $tr ' ' $trnl | \
19863 $awk '{ printf "%s %d\n", $1, ++s; }
19864 END { printf "NSIG %d\n", ++s }' >signal.lst
19866 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
19868 chmod a+x signal_cmd
19869 $eunicefix signal_cmd
19871 : generate list of signal names
19873 case "$sig_name_init" in
19875 *) case "$sig_num_init" in
19876 ''|*,*) doinit=yes ;;
19881 echo "Generating a list of signal names and numbers..." >&4
19883 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
19884 sig_name=`$awk 'BEGIN { printf "ZERO " }
19885 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
19886 sig_num=`$awk 'BEGIN { printf "0 " }
19887 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
19888 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
19889 !/^NSIG/ { printf "\"%s\", ", $1 }
19890 END { printf "0\n" }' signal.lst`
19891 sig_num_init=`$awk 'BEGIN { printf "0, " }
19892 !/^NSIG/ { printf "%d, ", $2}
19893 END { printf "0\n"}' signal.lst`
19896 echo "The following $sig_count signals are available:"
19898 echo $sig_name | $awk \
19899 'BEGIN { linelen = 0 }
19901 for (i = 1; i <= NF; i++) {
19902 name = "SIG" $i " "
19903 linelen = linelen + length(name)
19904 if (linelen > 70) {
19906 linelen = length(name)
19912 sig_size=`echo $sig_name | awk '{print NF}'`
19913 $rm -f signal signal.c signal.awk signal.lst signal_cmd
19916 case "$sizetype" in
19917 *_t) zzz="$sizetype" ;;
19918 *) zzz="filesize" ;;
19920 echo "Checking the size of $zzz..." >&4
19922 #include <sys/types.h>
19924 #$i_stdlib I_STDLIB
19926 #include <stdlib.h>
19929 printf("%d\n", (int)sizeof($sizetype));
19934 if eval $compile_ok; then
19938 echo "(I can't execute the test program--guessing $sizesize.)" >&4
19941 echo "Your $zzz size is $sizesize bytes."
19946 echo "(I can't compile the test program--guessing $sizesize.)" >&4
19950 : check for socklen_t
19952 echo "Checking to see if you have socklen_t..." >&4
19954 #include <sys/types.h>
19955 #$d_socket HAS_SOCKET
19957 #include <sys/socket.h>
19959 int main() { socklen_t x = 16; }
19962 if eval $compile; then
19964 echo "You have socklen_t."
19967 echo "You do not have socklen_t."
19968 case "$sizetype" in
19969 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
19976 : see if this is a socks.h system
19977 set socks.h i_socks
19980 : check for type of the size argument to socket calls
19981 case "$d_socket" in
19985 Checking to see what type is the last argument of accept().
19988 case "$d_socklen_t" in
19989 "$define") yyy="$yyy socklen_t"
19991 yyy="$yyy $sizetype int long unsigned"
19992 for xxx in $yyy; do
19993 case "$socksizetype" in
19994 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
19995 case "$usesocks" in
19997 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
19998 echo "Your system accepts '$xxx *' for the last argument of accept()."
19999 socksizetype="$xxx"
20002 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20003 echo "Your system accepts '$xxx *' for the last argument of accept()."
20004 socksizetype="$xxx"
20011 : In case none of those worked, prompt the user.
20012 case "$socksizetype" in
20013 '') rp='What is the type for socket address structure sizes?'
20020 *) : no sockets, so pick relatively harmless default
20025 : see what type is used for signed size_t
20026 set ssize_t ssizetype int stdio.h sys/types.h
20031 #$i_stdlib I_STDLIB
20033 #include <stdlib.h>
20035 #include <sys/types.h>
20036 #define Size_t $sizetype
20037 #define SSize_t $dflt
20040 if (sizeof(Size_t) == sizeof(SSize_t))
20042 else if (sizeof(Size_t) == sizeof(int))
20051 if eval $compile_ok && $run ./try > /dev/null; then
20052 ssizetype=`$run ./try`
20053 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20056 Help! I can't compile and run the ssize_t test program: please enlighten me!
20057 (This is probably a misconfiguration in your system or libraries, and
20058 you really ought to fix it. Still, I'll try anyway.)
20060 I need a type that is the same size as $sizetype, but is guaranteed to
20061 be signed. Common values are ssize_t, int and long.
20064 rp="What signed type is the same size as $sizetype?"
20070 : see what type of char stdio uses.
20072 echo '#include <stdio.h>' > stdio.c
20073 $cppstdin $cppminus < stdio.c > stdioh
20074 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20075 echo "Your stdio uses unsigned chars." >&4
20076 stdchar="unsigned char"
20078 echo "Your stdio uses signed chars." >&4
20081 $rm -f stdio.* stdioh
20083 : see what type uids are declared as in the kernel
20085 echo "Looking for the type for user ids returned by getuid()."
20086 set uid_t uidtype xxx stdio.h sys/types.h
20090 xxx=`./findhdr sys/user.h`
20091 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20093 unsigned) dflt="$1 $2" ;;
20097 *) dflt="$uidtype";;
20100 uid_t) echo "uid_t found." ;;
20101 *) rp="What is the type for user ids returned by getuid()?"
20109 *_t) zzz="$uidtype" ;;
20112 echo "Checking the size of $zzz..." >&4
20114 #include <sys/types.h>
20116 #$i_stdlib I_STDLIB
20118 #include <stdlib.h>
20121 printf("%d\n", (int)sizeof($uidtype));
20126 if eval $compile_ok; then
20130 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20133 echo "Your $zzz is $uidsize bytes long."
20138 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20143 *_t) zzz="$uidtype" ;;
20146 echo "Checking the sign of $zzz..." >&4
20148 #include <sys/types.h>
20159 if eval $compile; then
20163 echo "(I can't execute the test program--guessing unsigned.)" >&4
20167 1) echo "Your $zzz is unsigned." ;;
20168 -1) echo "Your $zzz is signed." ;;
20174 echo "(I can't compile the test program--guessing unsigned.)" >&4
20180 $echo "Checking the format string to be used for uids..." >&4
20183 -1) if $test X"$uidsize" = X"$ivsize"; then
20184 uidformat="$ivdformat"
20186 if $test X"$uidsize" = X"$longsize"; then
20189 if $test X"$uidsize" = X"$intsize"; then
20192 if $test X"$uidsize" = X"$shortsize"; then
20199 *) if $test X"$uidsize" = X"$uvsize"; then
20200 uidformat="$uvuformat"
20202 if $test X"$uidsize" = X"$longsize"; then
20205 if $test X"$uidsize" = X"$intsize"; then
20208 if $test X"$uidsize" = X"$shortsize"; then
20218 case "$usesitecustomize" in
20219 $define|true|[Yy]*)
20220 usesitecustomize="$define"
20223 usesitecustomize="$undef"
20227 : determine compiler compiler
20236 if $test -f "$byacc$_exe"; then
20238 comp="byacc or $comp"
20240 if $test -f "$bison$_exe"; then
20241 comp="$comp or bison -y"
20243 rp="Which compiler compiler ($comp) shall I use?"
20252 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20258 : see if this is a fp.h system
20262 : see if this is a fp_class.h system
20263 set fp_class.h i_fp_class
20266 : see if this is a ieeefp.h system
20267 case "$i_ieeefp" in
20268 '' ) set ieeefp.h i_ieeefp
20273 : see if this is a libutil.h system
20274 set libutil.h i_libutil
20277 : see if mach cthreads are available
20278 if test "X$usethreads" = "X$define"; then
20279 set mach/cthreads.h i_machcthr
20282 i_machcthr="$undef"
20287 : see if this is a mntent.h system
20288 set mntent.h i_mntent
20291 : see if ndbm.h is available
20297 # Some Linux distributions such as RedHat 7.1 put the
20298 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20299 if $test -f /usr/include/gdbm/ndbm.h; then
20300 echo '<gdbm/ndbm.h> found.'
20301 ccflags="$ccflags -I/usr/include/gdbm"
20302 cppflags="$cppflags -I/usr/include/gdbm"
20310 : see if dbm_open exists
20311 set dbm_open d_dbm_open
20313 case "$d_dbm_open" in
20316 echo "We won't be including <ndbm.h>"
20325 : see if net/errno.h is available
20327 set net/errno.h val
20330 : Unfortunately, it causes problems on some systems. Arrgh.
20333 cat > try.c <<'EOM'
20336 #include <net/errno.h>
20342 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20343 echo "We'll be including <net/errno.h>." >&4
20345 echo "We won't be including <net/errno.h>." >&4
20354 : see if netinet/tcp.h is available
20355 set netinet/tcp.h i_netinettcp
20358 : see if this is a poll.h system
20362 : see if this is a prot.h system
20367 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20368 $cat <<'EOSH' > Cppsym.know
20369 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20370 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20371 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20372 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20373 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20374 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20375 bull c cadmus clipper CMU COFF COMPILER_VERSION
20376 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20377 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20378 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20379 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20381 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20382 H3050R H3050RX hbullx20 hcx host_mips
20383 hp200 hp300 hp700 HP700 hp800 hp9000
20384 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20385 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20386 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20387 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20388 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20389 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20390 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20391 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20392 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20393 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20394 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20395 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20396 MATH_HAS_NO_SIDE_EFFECTS
20397 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20398 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20399 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20400 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20401 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20402 NetBSD news1500 news1700 news1800 news1900 news3700
20403 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20404 ns32016 ns32332 ns32k nsc32000
20405 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20406 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20407 pc532 pdp11 PGC PIC plexus PORTAR posix
20408 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20409 POSIX_C_SOURCE POSIX_SOURCE POWER
20410 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
20411 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20412 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20413 sony sony_news sonyrisc sparc sparclite spectrum
20414 stardent stdc STDC_EXT stratos sun sun3 sun386
20415 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20416 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20417 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20418 sysV68 sysV88 Tek4132 Tek4300 titan
20419 TM3200 TM5400 TM5600
20420 tower tower32 tower32_200 tower32_600 tower32_700
20421 tower32_800 tower32_850 tss
20422 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20423 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20424 unix UNIX95 UNIX99 unixpc unos
20425 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20426 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20427 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20429 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20430 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20431 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20434 # Maybe put other stuff here too.
20435 cat <<EOSH >>Cppsym.know
20438 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20439 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20440 $cat Cppsym.know > Cppsym.c
20441 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20442 $rm -f Cppsym.a Cppsym.b Cppsym.c
20443 cat <<EOSH > Cppsym
20445 if $test \$# -gt 0; then
20446 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20447 if $test -s Cppsym.got; then
20454 $tr " " "$trnl" | ./Cppsym.try
20460 cat <<EOSH > Cppsym.try
20462 cat <<'EOCP' > try.c
20465 #define STRINGIFY(a) "a"
20467 #if cpp_stuff == 42
20468 #define StGiFy(a) #a
20469 #define STRINGIFY(a) StGiFy(a)
20471 #if $cpp_stuff != 1 && $cpp_stuff != 42
20472 # include "Bletch: How does this C preprocessor stringify macros?"
20478 cat <<'EOSH' >> Cppsym.try
20480 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20481 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20482 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20483 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
20485 echo 'return 0;}' >> try.c
20487 cat <<EOSH >> Cppsym.try
20489 case "$osname-$gccversion" in
20490 irix-) ccflags="\$ccflags -woff 1178" ;;
20491 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20493 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
20495 chmod +x Cppsym.try
20496 $eunicefix Cppsym.try
20497 ./Cppsym < Cppsym.know > Cppsym.true
20498 : Add in any linux cpp "predefined macros":
20499 case "$osname::$gccversion" in
20502 rm -f $tHdrH'.h' $tHdrH
20504 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
20505 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
20506 if [ -s $tHdrH'_cppsym.real' ]; then
20507 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
20510 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
20513 : now check the C compiler for additional symbols
20514 postprocess_cc_v=''
20516 aix) postprocess_cc_v="|$tr , ' '" ;;
20523 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20526 -D*) echo "\$i" | $sed 's/^-D//';;
20527 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20532 postprocess_cc_v=''
20535 ./ccsym > ccsym1.raw
20536 if $test -s ccsym1.raw; then
20537 $sort ccsym1.raw | $uniq >ccsym.raw
20539 mv ccsym1.raw ccsym.raw
20542 $awk '/\=/ { print $0; next }
20543 { print $0"=1" }' ccsym.raw >ccsym.list
20544 $comm -13 Cppsym.true ccsym.list >ccsym.own
20545 $comm -12 Cppsym.true ccsym.list >ccsym.com
20546 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
20548 if $test -z ccsym.raw; then
20549 echo "Your C compiler doesn't seem to define any symbols!" >&4
20551 echo "However, your C preprocessor defines the following symbols:"
20554 cppsymbols=`$cat Cppsym.true`
20555 cppsymbols=`echo $cppsymbols`
20556 cppccsymbols="$cppsymbols"
20558 if $test -s ccsym.com; then
20559 echo "Your C compiler and pre-processor define these symbols:"
20560 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20563 cppccsymbols=`$cat ccsym.com`
20564 cppccsymbols=`echo $cppccsymbols`
20565 $test "$silent" || sleep 1
20567 if $test -s ccsym.cpp; then
20568 $test "$also" && echo " "
20569 echo "Your C pre-processor ${also}defines the following symbols:"
20570 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20572 cppsymbols=`$cat ccsym.cpp`
20573 cppsymbols=`echo $cppsymbols`
20574 $test "$silent" || sleep 1
20576 if $test -s ccsym.own; then
20577 $test "$also" && echo " "
20578 echo "Your C compiler ${also}defines the following cpp symbols:"
20579 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20580 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20581 ccsymbols=`$cat ccsym.own`
20582 ccsymbols=`echo $ccsymbols`
20583 $test "$silent" || sleep 1
20587 : see if this is a termio system
20591 if $test `./findhdr termios.h`; then
20592 set tcsetattr i_termios
20598 "$define") echo "You have POSIX termios.h... good!" >&4;;
20599 *) if ./Cppsym pyr; then
20600 case "`/bin/universe`" in
20601 ucb) if $test `./findhdr sgtty.h`; then
20603 echo "<sgtty.h> found." >&4
20605 echo "System is pyramid with BSD universe."
20606 echo "<sgtty.h> not found--you could have problems." >&4
20608 *) if $test `./findhdr termio.h`; then
20610 echo "<termio.h> found." >&4
20612 echo "System is pyramid with USG universe."
20613 echo "<termio.h> not found--you could have problems." >&4
20617 if $test `./findhdr termio.h`; then
20618 echo "<termio.h> found." >&4
20620 elif $test `./findhdr sgtty.h`; then
20621 echo "<sgtty.h> found." >&4
20624 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
20627 if $test `./findhdr sgtty.h`; then
20628 echo "<sgtty.h> found." >&4
20630 elif $test `./findhdr termio.h`; then
20631 echo "<termio.h> found." >&4
20634 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
20638 set i_termio; eval $setvar
20639 val=$val2; set i_sgtty; eval $setvar
20640 val=$val3; set i_termios; eval $setvar
20642 : see if stddef is available
20643 set stddef.h i_stddef
20646 : see if this is a sunmath.h system
20647 set sunmath.h i_sunmath
20650 : see if sys/access.h is available
20651 set sys/access.h i_sysaccess
20654 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
20655 set sys/filio.h i_sysfilio
20658 if $test `./findhdr sys/ioctl.h`; then
20660 echo '<sys/ioctl.h> found.' >&4
20663 if $test $i_sysfilio = "$define"; then
20664 echo '<sys/ioctl.h> NOT found.' >&4
20666 $test $i_sgtty = "$define" && xxx="sgtty.h"
20667 $test $i_termio = "$define" && xxx="termio.h"
20668 $test $i_termios = "$define" && xxx="termios.h"
20669 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
20675 : see if socket ioctl defs are in sys/sockio.h
20677 xxx=`./findhdr sys/sockio.h`
20678 if $test "$xxx"; then
20679 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
20681 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
20684 echo "No socket ioctls found in <sys/sockio.h>." >&4
20689 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
20696 : see if this is a syslog.h system
20697 set syslog.h i_syslog
20701 : see if this is a sys/mode.h system
20702 set sys/mode.h i_sysmode
20705 : see if sys/resource.h has to be included
20706 set sys/resource.h i_sysresrc
20709 : see if sys/security.h is available
20710 set sys/security.h i_syssecrt
20713 : see if this is a sys/statvfs.h system
20714 set sys/statvfs.h i_sysstatvfs
20717 : see if this is a sys/un.h system
20718 set sys/un.h i_sysun
20722 : see if this is a sys/utsname.h system
20723 set sys/utsname.h i_sysutsname
20726 : see if this is a syswait system
20727 set sys/wait.h i_syswait
20730 : see if this is a ustat.h system
20731 set ustat.h i_ustat
20734 : see if this is an utime system
20735 set utime.h i_utime
20738 : see if this is a values.h system
20739 set values.h i_values
20742 : see if this is a vfork system
20745 set vfork.h i_vfork
20753 : see if gdbm.h is available
20758 : see if gdbm_open exists
20759 set gdbm_open d_gdbm_open
20761 case "$d_gdbm_open" in
20764 echo "We won't be including <gdbm.h>"
20774 echo "Looking for extensions..." >&4
20775 : If we are using the old config.sh, known_extensions may contain
20776 : old or inaccurate or duplicate values.
20777 known_extensions=''
20778 nonxs_extensions=''
20779 : We do not use find because it might not be available.
20780 : We do not just use MANIFEST because the user may have dropped
20781 : some additional extensions into the source tree and expect them
20784 : Function to recursively find available extensions, ignoring DynaLoader
20785 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
20789 DynaLoader|dynaload) ;;
20791 if $test -f $xxx/$xxx.xs; then
20792 known_extensions="$known_extensions $1$xxx";
20793 elif $test -f $xxx/Makefile.PL; then
20794 nonxs_extensions="$nonxs_extensions $1$xxx";
20796 if $test -d $xxx -a $# -lt 10; then
20799 eval $find_extensions;
20811 eval $find_extensions
20812 # Special case: Add in threads/shared since it is not picked up by the
20813 # recursive find above (and adding in general recursive finding breaks
20814 # SDBM_File/sdbm). A.D. 10/25/2001.
20815 known_extensions="$known_extensions threads/shared"
20816 set X $nonxs_extensions
20818 nonxs_extensions="$*"
20819 set X $known_extensions
20821 known_extensions="$*"
20824 : Now see which are supported on this system.
20826 for xxx in $known_extensions ; do
20830 $define) avail_ext="$avail_ext $xxx" ;;
20833 GDBM_File|gdbm_fil)
20835 $define) avail_ext="$avail_ext $xxx" ;;
20838 I18N/Langinfo|i18n_lan)
20839 case "$i_langinfo$d_nl_langinfo" in
20840 $define$define) avail_ext="$avail_ext $xxx" ;;
20843 NDBM_File|ndbm_fil)
20846 case "$osname-$use64bitint" in
20849 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
20852 *) avail_ext="$avail_ext $xxx" ;;
20857 ODBM_File|odbm_fil)
20858 case "${i_dbm}${i_rpcsvcdbm}" in
20860 case "$osname-$use64bitint" in
20863 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
20866 *) avail_ext="$avail_ext $xxx" ;;
20872 case "$useposix" in
20873 true|define|y) avail_ext="$avail_ext $xxx" ;;
20877 case "$useopcode" in
20878 true|define|y) avail_ext="$avail_ext $xxx" ;;
20882 case "$d_socket" in
20885 beos) ;; # not unless BONE
20886 *) avail_ext="$avail_ext $xxx" ;;
20891 Sys/Syslog|sys/syslog)
20892 : XXX syslog requires socket
20893 case "$d_socket" in
20894 true|$define|y) avail_ext="$avail_ext $xxx" ;;
20898 case "$usethreads" in
20900 case "$useithreads" in
20901 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
20905 XS/APItest|xs/apitest)
20906 # This is just for testing. Skip it unless we have dynamic loading.
20909 $define) avail_ext="$avail_ext $xxx" ;;
20912 XS/Typemap|xs/typemap)
20913 # This is just for testing. Skip it unless we have dynamic loading.
20915 $define) avail_ext="$avail_ext $xxx" ;;
20918 threads|threads/shared)
20919 # threads and threads::shared are special cases.
20920 # To stop people from asking "Perl 5.8.0 was supposed
20921 # to have this new fancy threads implementation but my
20922 # perl doesn't have it" and from people trying to
20923 # (re)install the threads module using CPAN.pm and
20924 # CPAN.pm then offering to reinstall Perl 5.8.0,
20925 # the threads.pm and threads/shared.pm will always be
20926 # there, croaking informatively ("you need to rebuild
20927 # all of Perl with threads, sorry") when threads haven't
20928 # been compiled in.
20930 avail_ext="$avail_ext $xxx"
20933 : XXX Do we need a useipcsysv variable here
20934 case "${d_msg}${d_sem}${d_shm}" in
20935 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
20938 *) avail_ext="$avail_ext $xxx"
20947 case "$onlyextensions" in
20949 *) keepextensions=''
20950 echo "You have requested that only certains extensions be included..." >&4
20951 for i in $onlyextensions; do
20952 case " $avail_ext " in
20954 echo "Keeping extension $i."
20955 keepextensions="$keepextensions $i"
20957 *) echo "Ignoring extension $i." ;;
20960 avail_ext="$keepextensions"
20964 case "$noextensions" in
20966 *) keepextensions=''
20967 echo "You have requested that certain extensions be ignored..." >&4
20968 for i in $avail_ext; do
20969 case " $noextensions " in
20970 *" $i "*) echo "Ignoring extension $i." ;;
20971 *) echo "Keeping extension $i.";
20972 keepextensions="$keepextensions $i"
20976 avail_ext="$keepextensions"
20980 : Now see which nonxs extensions are supported on this system.
20981 : For now assume all are.
20983 for xxx in $nonxs_extensions ; do
20985 *) nonxs_ext="$nonxs_ext $xxx"
20997 A number of extensions are supplied with $package. You may choose to
20998 compile these extensions for dynamic loading (the default), compile
20999 them into the $package executable (static loading), or not include
21000 them at all. Answer "none" to include no extensions.
21001 Note that DynaLoader is always built and need not be mentioned here.
21004 case "$dynamic_ext" in
21006 : Exclude those listed in static_ext
21008 for xxx in $avail_ext; do
21009 case " $static_ext " in
21011 *) dflt="$dflt $xxx" ;;
21018 *) dflt="$dynamic_ext"
21019 # Perhaps we are reusing an old out-of-date config.sh.
21022 if test X"$dynamic_ext" != X"$avail_ext"; then
21024 NOTICE: Your previous config.sh list may be incorrect.
21025 The extensions now available to you are
21027 but the default list from your previous config.sh is
21039 rp="What extensions do you wish to load dynamically?"
21042 none) dynamic_ext=' ' ;;
21043 *) dynamic_ext="$ans" ;;
21046 case "$static_ext" in
21048 : Exclude those already listed in dynamic linking
21050 for xxx in $avail_ext; do
21051 case " $dynamic_ext " in
21053 *) dflt="$dflt $xxx" ;;
21060 *) dflt="$static_ext"
21067 rp="What extensions do you wish to load statically?"
21070 none) static_ext=' ' ;;
21071 *) static_ext="$ans" ;;
21076 A number of extensions are supplied with $package. Answer "none"
21077 to include no extensions.
21078 Note that DynaLoader is always built and need not be mentioned here.
21081 case "$static_ext" in
21082 '') dflt="$avail_ext" ;;
21083 *) dflt="$static_ext"
21084 # Perhaps we are reusing an old out-of-date config.sh.
21087 if test X"$static_ext" != X"$avail_ext"; then
21089 NOTICE: Your previous config.sh list may be incorrect.
21090 The extensions now available to you are
21092 but the default list from your previous config.sh is
21101 : Exclude those that are not xs extensions
21105 rp="What extensions do you wish to include?"
21108 none) static_ext=' ' ;;
21109 *) static_ext="$ans" ;;
21114 # Encode is a special case. If we are building Encode as a static
21115 # extension, we need to explicitly list its subextensions as well.
21116 # For other nested extensions, this is handled automatically by
21117 # the appropriate Makefile.PL.
21118 case " $static_ext " in
21119 *" Encode "*) # Add the subextensions of Encode
21121 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21122 static_ext="$static_ext Encode/$xxx"
21128 set X $dynamic_ext $static_ext $nonxs_ext
21132 # Sanity check: We require an extension suitable for use with
21133 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21134 # should show up as failures in the test suite, but it's helpful to
21135 # catch them now.) The 'extensions' list is normally sorted
21136 # alphabetically, so we need to accept either
21137 # DB_File ... Fcntl ... IO ....
21138 # or something like
21139 # Fcntl ... NDBM_File ... IO ....
21140 case " $extensions" in
21141 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21142 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21143 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21144 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21145 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21149 : Remove libraries needed only for extensions
21150 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21151 : The exception is SunOS 4.x, which needs them.
21152 case "${osname}X${osvers}" in
21156 *) case "$usedl" in
21157 $define|true|[yY]*)
21158 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21162 *) perllibs="$libs"
21168 : Remove build directory name from cppstdin so it can be used from
21169 : either the present location or the final installed location.
21171 : Get out of the UU directory to get correct path name.
21173 case "$cppstdin" in
21175 echo "Stripping down cppstdin path name"
21181 : end of configuration questions
21183 echo "End of configuration questions."
21186 : back to where it started
21187 if test -d ../UU; then
21191 : configuration may be patched via a 'config.arch' file
21192 if $test -f config.arch; then
21193 echo "I see a config.arch file, loading it."
21197 : configuration may be patched via a 'config.over' file
21198 if $test -f config.over; then
21201 rp='I see a config.over file. Do you wish to load it?'
21204 n*) echo "OK, I'll ignore it.";;
21206 echo "Configuration override changes have been loaded."
21211 : in case they want portability, strip down executable paths
21212 case "$d_portable" in
21215 echo "Stripping down executable paths..." >&4
21216 for file in $loclist $trylist; do
21218 eval $file=`basename $temp`
21223 : create config.sh file
21225 echo "Creating config.sh..." >&4
21226 $spitshell <<EOT >config.sh
21229 # This file was produced by running the Configure script. It holds all the
21230 # definitions figured out by Configure. Should you modify one of these values,
21231 # do not forget to propagate your changes by running "Configure -der". You may
21232 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21235 # Package name : $package
21236 # Source directory : $src
21237 # Configuration time: $cf_time
21238 # Configured by : $cf_by
21239 # Target system : $myuname
21249 Revision='$Revision'
21257 alignbytes='$alignbytes'
21258 ansi2knr='$ansi2knr'
21259 aphostname='$aphostname'
21260 api_revision='$api_revision'
21261 api_subversion='$api_subversion'
21262 api_version='$api_version'
21263 api_versionstring='$api_versionstring'
21266 archlibexp='$archlibexp'
21267 archname64='$archname64'
21268 archname='$archname'
21269 archobjs='$archobjs'
21270 asctime_r_proto='$asctime_r_proto'
21278 byteorder='$byteorder'
21280 castflags='$castflags'
21283 cccdlflags='$cccdlflags'
21284 ccdlflags='$ccdlflags'
21286 ccflags_uselargefiles='$ccflags_uselargefiles'
21288 ccsymbols='$ccsymbols'
21289 ccversion='$ccversion'
21291 cf_email='$cf_email'
21293 charsize='$charsize'
21297 clocktype='$clocktype'
21299 compress='$compress'
21300 contains='$contains'
21304 cpp_stuff='$cpp_stuff'
21305 cppccsymbols='$cppccsymbols'
21306 cppflags='$cppflags'
21308 cppminus='$cppminus'
21310 cppstdin='$cppstdin'
21311 cppsymbols='$cppsymbols'
21312 crypt_r_proto='$crypt_r_proto'
21313 cryptlib='$cryptlib'
21315 ctermid_r_proto='$ctermid_r_proto'
21316 ctime_r_proto='$ctime_r_proto'
21317 d_Gconvert='$d_Gconvert'
21318 d_PRIEUldbl='$d_PRIEUldbl'
21319 d_PRIFUldbl='$d_PRIFUldbl'
21320 d_PRIGUldbl='$d_PRIGUldbl'
21321 d_PRIXU64='$d_PRIXU64'
21322 d_PRId64='$d_PRId64'
21323 d_PRIeldbl='$d_PRIeldbl'
21324 d_PRIfldbl='$d_PRIfldbl'
21325 d_PRIgldbl='$d_PRIgldbl'
21326 d_PRIi64='$d_PRIi64'
21327 d_PRIo64='$d_PRIo64'
21328 d_PRIu64='$d_PRIu64'
21329 d_PRIx64='$d_PRIx64'
21330 d_SCNfldbl='$d_SCNfldbl'
21331 d__fwalk='$d__fwalk'
21332 d_access='$d_access'
21333 d_accessx='$d_accessx'
21336 d_archlib='$d_archlib'
21337 d_asctime_r='$d_asctime_r'
21340 d_attribute_format='$d_attribute_format'
21341 d_attribute_malloc='$d_attribute_malloc'
21342 d_attribute_nonnull='$d_attribute_nonnull'
21343 d_attribute_noreturn='$d_attribute_noreturn'
21344 d_attribute_pure='$d_attribute_pure'
21345 d_attribute_unused='$d_attribute_unused'
21346 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21350 d_bsdgetpgrp='$d_bsdgetpgrp'
21351 d_bsdsetpgrp='$d_bsdsetpgrp'
21352 d_builtin_choose_expr='$d_builtin_choose_expr'
21353 d_builtin_expect='$d_builtin_expect'
21355 d_c99_variadic_macros='$d_c99_variadic_macros'
21356 d_casti32='$d_casti32'
21357 d_castneg='$d_castneg'
21358 d_charvspr='$d_charvspr'
21360 d_chroot='$d_chroot'
21361 d_chsize='$d_chsize'
21363 d_clearenv='$d_clearenv'
21364 d_closedir='$d_closedir'
21365 d_cmsghdr_s='$d_cmsghdr_s'
21367 d_copysignl='$d_copysignl'
21368 d_cplusplus='$d_cplusplus'
21370 d_crypt_r='$d_crypt_r'
21372 d_ctermid_r='$d_ctermid_r'
21373 d_ctime_r='$d_ctime_r'
21374 d_cuserid='$d_cuserid'
21375 d_dbl_dig='$d_dbl_dig'
21376 d_dbminitproto='$d_dbminitproto'
21377 d_difftime='$d_difftime'
21379 d_dirnamlen='$d_dirnamlen'
21380 d_dlerror='$d_dlerror'
21381 d_dlopen='$d_dlopen'
21382 d_dlsymun='$d_dlsymun'
21383 d_dosuid='$d_dosuid'
21384 d_drand48_r='$d_drand48_r'
21385 d_drand48proto='$d_drand48proto'
21387 d_eaccess='$d_eaccess'
21388 d_endgrent='$d_endgrent'
21389 d_endgrent_r='$d_endgrent_r'
21390 d_endhent='$d_endhent'
21391 d_endhostent_r='$d_endhostent_r'
21392 d_endnent='$d_endnent'
21393 d_endnetent_r='$d_endnetent_r'
21394 d_endpent='$d_endpent'
21395 d_endprotoent_r='$d_endprotoent_r'
21396 d_endpwent='$d_endpwent'
21397 d_endpwent_r='$d_endpwent_r'
21398 d_endsent='$d_endsent'
21399 d_endservent_r='$d_endservent_r'
21400 d_eofnblk='$d_eofnblk'
21401 d_eunice='$d_eunice'
21402 d_faststdio='$d_faststdio'
21403 d_fchdir='$d_fchdir'
21404 d_fchmod='$d_fchmod'
21405 d_fchown='$d_fchown'
21407 d_fcntl_can_lock='$d_fcntl_can_lock'
21408 d_fd_macros='$d_fd_macros'
21409 d_fd_set='$d_fd_set'
21410 d_fds_bits='$d_fds_bits'
21411 d_fgetpos='$d_fgetpos'
21412 d_finite='$d_finite'
21413 d_finitel='$d_finitel'
21414 d_flexfnam='$d_flexfnam'
21416 d_flockproto='$d_flockproto'
21418 d_fp_class='$d_fp_class'
21419 d_fpathconf='$d_fpathconf'
21420 d_fpclass='$d_fpclass'
21421 d_fpclassify='$d_fpclassify'
21422 d_fpclassl='$d_fpclassl'
21423 d_fpos64_t='$d_fpos64_t'
21424 d_frexpl='$d_frexpl'
21425 d_fs_data_s='$d_fs_data_s'
21426 d_fseeko='$d_fseeko'
21427 d_fsetpos='$d_fsetpos'
21428 d_fstatfs='$d_fstatfs'
21429 d_fstatvfs='$d_fstatvfs'
21431 d_ftello='$d_ftello'
21433 d_futimes='$d_futimes'
21434 d_getcwd='$d_getcwd'
21435 d_getespwnam='$d_getespwnam'
21436 d_getfsstat='$d_getfsstat'
21437 d_getgrent='$d_getgrent'
21438 d_getgrent_r='$d_getgrent_r'
21439 d_getgrgid_r='$d_getgrgid_r'
21440 d_getgrnam_r='$d_getgrnam_r'
21441 d_getgrps='$d_getgrps'
21442 d_gethbyaddr='$d_gethbyaddr'
21443 d_gethbyname='$d_gethbyname'
21444 d_gethent='$d_gethent'
21445 d_gethname='$d_gethname'
21446 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21447 d_gethostbyname_r='$d_gethostbyname_r'
21448 d_gethostent_r='$d_gethostent_r'
21449 d_gethostprotos='$d_gethostprotos'
21450 d_getitimer='$d_getitimer'
21451 d_getlogin='$d_getlogin'
21452 d_getlogin_r='$d_getlogin_r'
21453 d_getmnt='$d_getmnt'
21454 d_getmntent='$d_getmntent'
21455 d_getnbyaddr='$d_getnbyaddr'
21456 d_getnbyname='$d_getnbyname'
21457 d_getnent='$d_getnent'
21458 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21459 d_getnetbyname_r='$d_getnetbyname_r'
21460 d_getnetent_r='$d_getnetent_r'
21461 d_getnetprotos='$d_getnetprotos'
21462 d_getpagsz='$d_getpagsz'
21463 d_getpbyname='$d_getpbyname'
21464 d_getpbynumber='$d_getpbynumber'
21465 d_getpent='$d_getpent'
21466 d_getpgid='$d_getpgid'
21467 d_getpgrp2='$d_getpgrp2'
21468 d_getpgrp='$d_getpgrp'
21469 d_getppid='$d_getppid'
21470 d_getprior='$d_getprior'
21471 d_getprotobyname_r='$d_getprotobyname_r'
21472 d_getprotobynumber_r='$d_getprotobynumber_r'
21473 d_getprotoent_r='$d_getprotoent_r'
21474 d_getprotoprotos='$d_getprotoprotos'
21475 d_getprpwnam='$d_getprpwnam'
21476 d_getpwent='$d_getpwent'
21477 d_getpwent_r='$d_getpwent_r'
21478 d_getpwnam_r='$d_getpwnam_r'
21479 d_getpwuid_r='$d_getpwuid_r'
21480 d_getsbyname='$d_getsbyname'
21481 d_getsbyport='$d_getsbyport'
21482 d_getsent='$d_getsent'
21483 d_getservbyname_r='$d_getservbyname_r'
21484 d_getservbyport_r='$d_getservbyport_r'
21485 d_getservent_r='$d_getservent_r'
21486 d_getservprotos='$d_getservprotos'
21487 d_getspnam='$d_getspnam'
21488 d_getspnam_r='$d_getspnam_r'
21489 d_gettimeod='$d_gettimeod'
21490 d_gmtime_r='$d_gmtime_r'
21491 d_gnulibc='$d_gnulibc'
21492 d_grpasswd='$d_grpasswd'
21493 d_hasmntopt='$d_hasmntopt'
21495 d_ilogbl='$d_ilogbl'
21496 d_inc_version_list='$d_inc_version_list'
21498 d_inetaton='$d_inetaton'
21499 d_int64_t='$d_int64_t'
21500 d_isascii='$d_isascii'
21501 d_isfinite='$d_isfinite'
21504 d_isnanl='$d_isnanl'
21505 d_killpg='$d_killpg'
21506 d_lchown='$d_lchown'
21507 d_ldbl_dig='$d_ldbl_dig'
21508 d_libm_lib_version='$d_libm_lib_version'
21510 d_localtime_r='$d_localtime_r'
21511 d_locconv='$d_locconv'
21513 d_longdbl='$d_longdbl'
21514 d_longlong='$d_longlong'
21515 d_lseekproto='$d_lseekproto'
21517 d_madvise='$d_madvise'
21518 d_malloc_good_size='$d_malloc_good_size'
21519 d_malloc_size='$d_malloc_size'
21521 d_mbstowcs='$d_mbstowcs'
21522 d_mbtowc='$d_mbtowc'
21523 d_memchr='$d_memchr'
21524 d_memcmp='$d_memcmp'
21525 d_memcpy='$d_memcpy'
21526 d_memmove='$d_memmove'
21527 d_memset='$d_memset'
21529 d_mkdtemp='$d_mkdtemp'
21530 d_mkfifo='$d_mkfifo'
21531 d_mkstemp='$d_mkstemp'
21532 d_mkstemps='$d_mkstemps'
21533 d_mktime='$d_mktime'
21536 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21537 d_modflproto='$d_modflproto'
21538 d_mprotect='$d_mprotect'
21540 d_msg_ctrunc='$d_msg_ctrunc'
21541 d_msg_dontroute='$d_msg_dontroute'
21542 d_msg_oob='$d_msg_oob'
21543 d_msg_peek='$d_msg_peek'
21544 d_msg_proxy='$d_msg_proxy'
21545 d_msgctl='$d_msgctl'
21546 d_msgget='$d_msgget'
21547 d_msghdr_s='$d_msghdr_s'
21548 d_msgrcv='$d_msgrcv'
21549 d_msgsnd='$d_msgsnd'
21551 d_munmap='$d_munmap'
21552 d_mymalloc='$d_mymalloc'
21554 d_nl_langinfo='$d_nl_langinfo'
21555 d_nv_preserves_uv='$d_nv_preserves_uv'
21556 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21557 d_off64_t='$d_off64_t'
21558 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21559 d_oldpthreads='$d_oldpthreads'
21560 d_oldsock='$d_oldsock'
21562 d_pathconf='$d_pathconf'
21564 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21565 d_phostname='$d_phostname'
21568 d_portable='$d_portable'
21569 d_procselfexe='$d_procselfexe'
21570 d_pthread_atfork='$d_pthread_atfork'
21571 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21572 d_pthread_yield='$d_pthread_yield'
21574 d_pwchange='$d_pwchange'
21575 d_pwclass='$d_pwclass'
21576 d_pwcomment='$d_pwcomment'
21577 d_pwexpire='$d_pwexpire'
21578 d_pwgecos='$d_pwgecos'
21579 d_pwpasswd='$d_pwpasswd'
21580 d_pwquota='$d_pwquota'
21583 d_random_r='$d_random_r'
21584 d_readdir64_r='$d_readdir64_r'
21585 d_readdir='$d_readdir'
21586 d_readdir_r='$d_readdir_r'
21587 d_readlink='$d_readlink'
21589 d_recvmsg='$d_recvmsg'
21590 d_rename='$d_rename'
21591 d_rewinddir='$d_rewinddir'
21593 d_safebcpy='$d_safebcpy'
21594 d_safemcpy='$d_safemcpy'
21595 d_sanemcmp='$d_sanemcmp'
21596 d_sbrkproto='$d_sbrkproto'
21597 d_scalbnl='$d_scalbnl'
21598 d_sched_yield='$d_sched_yield'
21599 d_scm_rights='$d_scm_rights'
21600 d_seekdir='$d_seekdir'
21601 d_select='$d_select'
21603 d_semctl='$d_semctl'
21604 d_semctl_semid_ds='$d_semctl_semid_ds'
21605 d_semctl_semun='$d_semctl_semun'
21606 d_semget='$d_semget'
21608 d_sendmsg='$d_sendmsg'
21609 d_setegid='$d_setegid'
21610 d_seteuid='$d_seteuid'
21611 d_setgrent='$d_setgrent'
21612 d_setgrent_r='$d_setgrent_r'
21613 d_setgrps='$d_setgrps'
21614 d_sethent='$d_sethent'
21615 d_sethostent_r='$d_sethostent_r'
21616 d_setitimer='$d_setitimer'
21617 d_setlinebuf='$d_setlinebuf'
21618 d_setlocale='$d_setlocale'
21619 d_setlocale_r='$d_setlocale_r'
21620 d_setnent='$d_setnent'
21621 d_setnetent_r='$d_setnetent_r'
21622 d_setpent='$d_setpent'
21623 d_setpgid='$d_setpgid'
21624 d_setpgrp2='$d_setpgrp2'
21625 d_setpgrp='$d_setpgrp'
21626 d_setprior='$d_setprior'
21627 d_setproctitle='$d_setproctitle'
21628 d_setprotoent_r='$d_setprotoent_r'
21629 d_setpwent='$d_setpwent'
21630 d_setpwent_r='$d_setpwent_r'
21631 d_setregid='$d_setregid'
21632 d_setresgid='$d_setresgid'
21633 d_setresuid='$d_setresuid'
21634 d_setreuid='$d_setreuid'
21635 d_setrgid='$d_setrgid'
21636 d_setruid='$d_setruid'
21637 d_setsent='$d_setsent'
21638 d_setservent_r='$d_setservent_r'
21639 d_setsid='$d_setsid'
21640 d_setvbuf='$d_setvbuf'
21644 d_shmatprototype='$d_shmatprototype'
21645 d_shmctl='$d_shmctl'
21647 d_shmget='$d_shmget'
21648 d_sigaction='$d_sigaction'
21649 d_sigprocmask='$d_sigprocmask'
21650 d_sigsetjmp='$d_sigsetjmp'
21651 d_sitearch='$d_sitearch'
21652 d_snprintf='$d_snprintf'
21653 d_sockatmark='$d_sockatmark'
21654 d_sockatmarkproto='$d_sockatmarkproto'
21655 d_socket='$d_socket'
21656 d_socklen_t='$d_socklen_t'
21657 d_sockpair='$d_sockpair'
21658 d_socks5_init='$d_socks5_init'
21659 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
21661 d_srand48_r='$d_srand48_r'
21662 d_srandom_r='$d_srandom_r'
21663 d_sresgproto='$d_sresgproto'
21664 d_sresuproto='$d_sresuproto'
21665 d_statblks='$d_statblks'
21666 d_statfs_f_flags='$d_statfs_f_flags'
21667 d_statfs_s='$d_statfs_s'
21668 d_statvfs='$d_statvfs'
21669 d_stdio_cnt_lval='$d_stdio_cnt_lval'
21670 d_stdio_ptr_lval='$d_stdio_ptr_lval'
21671 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
21672 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
21673 d_stdio_stream_array='$d_stdio_stream_array'
21674 d_stdiobase='$d_stdiobase'
21675 d_stdstdio='$d_stdstdio'
21676 d_strchr='$d_strchr'
21677 d_strcoll='$d_strcoll'
21678 d_strctcpy='$d_strctcpy'
21679 d_strerrm='$d_strerrm'
21680 d_strerror='$d_strerror'
21681 d_strerror_r='$d_strerror_r'
21682 d_strftime='$d_strftime'
21683 d_strlcat='$d_strlcat'
21684 d_strlcpy='$d_strlcpy'
21685 d_strtod='$d_strtod'
21686 d_strtol='$d_strtol'
21687 d_strtold='$d_strtold'
21688 d_strtoll='$d_strtoll'
21689 d_strtoq='$d_strtoq'
21690 d_strtoul='$d_strtoul'
21691 d_strtoull='$d_strtoull'
21692 d_strtouq='$d_strtouq'
21693 d_strxfrm='$d_strxfrm'
21694 d_suidsafe='$d_suidsafe'
21695 d_symlink='$d_symlink'
21696 d_syscall='$d_syscall'
21697 d_syscallproto='$d_syscallproto'
21698 d_sysconf='$d_sysconf'
21699 d_sysernlst='$d_sysernlst'
21700 d_syserrlst='$d_syserrlst'
21701 d_system='$d_system'
21702 d_tcgetpgrp='$d_tcgetpgrp'
21703 d_tcsetpgrp='$d_tcsetpgrp'
21704 d_telldir='$d_telldir'
21705 d_telldirproto='$d_telldirproto'
21708 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
21709 d_tm_tm_zone='$d_tm_tm_zone'
21710 d_tmpnam_r='$d_tmpnam_r'
21711 d_truncate='$d_truncate'
21712 d_ttyname_r='$d_ttyname_r'
21713 d_tzname='$d_tzname'
21714 d_u32align='$d_u32align'
21715 d_ualarm='$d_ualarm'
21718 d_union_semun='$d_union_semun'
21719 d_unordered='$d_unordered'
21720 d_unsetenv='$d_unsetenv'
21721 d_usleep='$d_usleep'
21722 d_usleepproto='$d_usleepproto'
21724 d_vendorarch='$d_vendorarch'
21725 d_vendorbin='$d_vendorbin'
21726 d_vendorlib='$d_vendorlib'
21727 d_vendorscript='$d_vendorscript'
21729 d_void_closedir='$d_void_closedir'
21730 d_voidsig='$d_voidsig'
21731 d_voidtty='$d_voidtty'
21732 d_volatile='$d_volatile'
21733 d_vprintf='$d_vprintf'
21734 d_vsnprintf='$d_vsnprintf'
21736 d_waitpid='$d_waitpid'
21737 d_wcstombs='$d_wcstombs'
21738 d_wctomb='$d_wctomb'
21739 d_writev='$d_writev'
21742 db_hashtype='$db_hashtype'
21743 db_prefixtype='$db_prefixtype'
21744 db_version_major='$db_version_major'
21745 db_version_minor='$db_version_minor'
21746 db_version_patch='$db_version_patch'
21747 defvoidused='$defvoidused'
21748 direntrytype='$direntrytype'
21751 doublesize='$doublesize'
21753 drand48_r_proto='$drand48_r_proto'
21754 dynamic_ext='$dynamic_ext'
21760 endgrent_r_proto='$endgrent_r_proto'
21761 endhostent_r_proto='$endhostent_r_proto'
21762 endnetent_r_proto='$endnetent_r_proto'
21763 endprotoent_r_proto='$endprotoent_r_proto'
21764 endpwent_r_proto='$endpwent_r_proto'
21765 endservent_r_proto='$endservent_r_proto'
21766 eunicefix='$eunicefix'
21769 extensions='$extensions'
21771 fflushNULL='$fflushNULL'
21772 fflushall='$fflushall'
21774 firstmakefile='$firstmakefile'
21776 fpossize='$fpossize'
21777 fpostype='$fpostype'
21778 freetype='$freetype'
21781 full_csh='$full_csh'
21782 full_sed='$full_sed'
21783 gccansipedantic='$gccansipedantic'
21784 gccosandvers='$gccosandvers'
21785 gccversion='$gccversion'
21786 getgrent_r_proto='$getgrent_r_proto'
21787 getgrgid_r_proto='$getgrgid_r_proto'
21788 getgrnam_r_proto='$getgrnam_r_proto'
21789 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
21790 gethostbyname_r_proto='$gethostbyname_r_proto'
21791 gethostent_r_proto='$gethostent_r_proto'
21792 getlogin_r_proto='$getlogin_r_proto'
21793 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
21794 getnetbyname_r_proto='$getnetbyname_r_proto'
21795 getnetent_r_proto='$getnetent_r_proto'
21796 getprotobyname_r_proto='$getprotobyname_r_proto'
21797 getprotobynumber_r_proto='$getprotobynumber_r_proto'
21798 getprotoent_r_proto='$getprotoent_r_proto'
21799 getpwent_r_proto='$getpwent_r_proto'
21800 getpwnam_r_proto='$getpwnam_r_proto'
21801 getpwuid_r_proto='$getpwuid_r_proto'
21802 getservbyname_r_proto='$getservbyname_r_proto'
21803 getservbyport_r_proto='$getservbyport_r_proto'
21804 getservent_r_proto='$getservent_r_proto'
21805 getspnam_r_proto='$getspnam_r_proto'
21806 gidformat='$gidformat'
21812 gmtime_r_proto='$gmtime_r_proto'
21813 gnulibc_version='$gnulibc_version'
21815 groupcat='$groupcat'
21816 groupstype='$groupstype'
21819 h_sysfile='$h_sysfile'
21822 html1dir='$html1dir'
21823 html1direxp='$html1direxp'
21824 html3dir='$html3dir'
21825 html3direxp='$html3direxp'
21834 i_arpainet='$i_arpainet'
21835 i_bsdioctl='$i_bsdioctl'
21839 i_dirent='$i_dirent'
21845 i_fp_class='$i_fp_class'
21848 i_ieeefp='$i_ieeefp'
21849 i_inttypes='$i_inttypes'
21850 i_langinfo='$i_langinfo'
21851 i_libutil='$i_libutil'
21852 i_limits='$i_limits'
21853 i_locale='$i_locale'
21854 i_machcthr='$i_machcthr'
21855 i_malloc='$i_malloc'
21857 i_memory='$i_memory'
21858 i_mntent='$i_mntent'
21861 i_neterrno='$i_neterrno'
21862 i_netinettcp='$i_netinettcp'
21866 i_pthread='$i_pthread'
21868 i_rpcsvcdbm='$i_rpcsvcdbm'
21871 i_shadow='$i_shadow'
21873 i_stdarg='$i_stdarg'
21874 i_stddef='$i_stddef'
21875 i_stdlib='$i_stdlib'
21876 i_string='$i_string'
21877 i_sunmath='$i_sunmath'
21878 i_sysaccess='$i_sysaccess'
21879 i_sysdir='$i_sysdir'
21880 i_sysfile='$i_sysfile'
21881 i_sysfilio='$i_sysfilio'
21883 i_sysioctl='$i_sysioctl'
21884 i_syslog='$i_syslog'
21885 i_sysmman='$i_sysmman'
21886 i_sysmode='$i_sysmode'
21887 i_sysmount='$i_sysmount'
21888 i_sysndir='$i_sysndir'
21889 i_sysparam='$i_sysparam'
21890 i_sysresrc='$i_sysresrc'
21891 i_syssecrt='$i_syssecrt'
21892 i_sysselct='$i_sysselct'
21893 i_syssockio='$i_syssockio'
21894 i_sysstat='$i_sysstat'
21895 i_sysstatfs='$i_sysstatfs'
21896 i_sysstatvfs='$i_sysstatvfs'
21897 i_systime='$i_systime'
21898 i_systimek='$i_systimek'
21899 i_systimes='$i_systimes'
21900 i_systypes='$i_systypes'
21901 i_sysuio='$i_sysuio'
21903 i_sysutsname='$i_sysutsname'
21904 i_sysvfs='$i_sysvfs'
21905 i_syswait='$i_syswait'
21906 i_termio='$i_termio'
21907 i_termios='$i_termios'
21909 i_unistd='$i_unistd'
21912 i_values='$i_values'
21913 i_varargs='$i_varargs'
21914 i_varhdr='$i_varhdr'
21916 ignore_versioned_solibs='$ignore_versioned_solibs'
21917 inc_version_list='$inc_version_list'
21918 inc_version_list_init='$inc_version_list_init'
21921 initialinstalllocation='$initialinstalllocation'
21922 installarchlib='$installarchlib'
21923 installbin='$installbin'
21924 installhtml1dir='$installhtml1dir'
21925 installhtml3dir='$installhtml3dir'
21926 installman1dir='$installman1dir'
21927 installman3dir='$installman3dir'
21928 installprefix='$installprefix'
21929 installprefixexp='$installprefixexp'
21930 installprivlib='$installprivlib'
21931 installscript='$installscript'
21932 installsitearch='$installsitearch'
21933 installsitebin='$installsitebin'
21934 installsitehtml1dir='$installsitehtml1dir'
21935 installsitehtml3dir='$installsitehtml3dir'
21936 installsitelib='$installsitelib'
21937 installsiteman1dir='$installsiteman1dir'
21938 installsiteman3dir='$installsiteman3dir'
21939 installsitescript='$installsitescript'
21940 installstyle='$installstyle'
21941 installusrbinperl='$installusrbinperl'
21942 installvendorarch='$installvendorarch'
21943 installvendorbin='$installvendorbin'
21944 installvendorhtml1dir='$installvendorhtml1dir'
21945 installvendorhtml3dir='$installvendorhtml3dir'
21946 installvendorlib='$installvendorlib'
21947 installvendorman1dir='$installvendorman1dir'
21948 installvendorman3dir='$installvendorman3dir'
21949 installvendorscript='$installvendorscript'
21951 issymlink='$issymlink'
21952 ivdformat='$ivdformat'
21955 known_extensions='$known_extensions'
21958 lddlflags='$lddlflags'
21960 ldflags_uselargefiles='$ldflags_uselargefiles'
21961 ldlibpthname='$ldlibpthname'
21968 libsdirs='$libsdirs'
21969 libsfiles='$libsfiles'
21970 libsfound='$libsfound'
21971 libspath='$libspath'
21972 libswanted='$libswanted'
21973 libswanted_uselargefiles='$libswanted_uselargefiles'
21979 localtime_r_proto='$localtime_r_proto'
21980 locincpth='$locincpth'
21981 loclibpth='$loclibpth'
21982 longdblsize='$longdblsize'
21983 longlongsize='$longlongsize'
21984 longsize='$longsize'
21988 lseeksize='$lseeksize'
21989 lseektype='$lseektype'
21992 madlyobj='$madlyobj'
21993 madlysrc='$madlysrc'
21997 make_set_make='$make_set_make'
21998 mallocobj='$mallocobj'
21999 mallocsrc='$mallocsrc'
22000 malloctype='$malloctype'
22002 man1direxp='$man1direxp'
22005 man3direxp='$man3direxp'
22007 mips_type='$mips_type'
22008 mistrustnm='$mistrustnm'
22010 mmaptype='$mmaptype'
22011 modetype='$modetype'
22013 multiarch='$multiarch'
22015 myarchname='$myarchname'
22016 mydomain='$mydomain'
22017 myhostname='$myhostname'
22020 need_va_copy='$need_va_copy'
22021 netdb_hlen_type='$netdb_hlen_type'
22022 netdb_host_type='$netdb_host_type'
22023 netdb_name_type='$netdb_name_type'
22024 netdb_net_type='$netdb_net_type'
22027 nm_so_opt='$nm_so_opt'
22028 nonxs_ext='$nonxs_ext'
22030 nvEUformat='$nvEUformat'
22031 nvFUformat='$nvFUformat'
22032 nvGUformat='$nvGUformat'
22033 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22034 nveformat='$nveformat'
22035 nvfformat='$nvfformat'
22036 nvgformat='$nvgformat'
22039 o_nonblock='$o_nonblock'
22041 old_pthread_create_joinable='$old_pthread_create_joinable'
22042 optimize='$optimize'
22043 orderlib='$orderlib'
22046 otherlibdirs='$otherlibdirs'
22050 patchlevel='$patchlevel'
22051 path_sep='$path_sep'
22054 perl_patchlevel='$perl_patchlevel'
22055 perladmin='$perladmin'
22056 perllibs='$perllibs'
22057 perlpath='$perlpath'
22059 phostname='$phostname'
22065 prefixexp='$prefixexp'
22067 privlibexp='$privlibexp'
22068 procselfexe='$procselfexe'
22069 prototype='$prototype'
22071 quadkind='$quadkind'
22072 quadtype='$quadtype'
22073 randbits='$randbits'
22074 randfunc='$randfunc'
22075 random_r_proto='$random_r_proto'
22076 randseedtype='$randseedtype'
22078 rd_nodata='$rd_nodata'
22079 readdir64_r_proto='$readdir64_r_proto'
22080 readdir_r_proto='$readdir_r_proto'
22081 revision='$revision'
22086 sPRIEUldbl='$sPRIEUldbl'
22087 sPRIFUldbl='$sPRIFUldbl'
22088 sPRIGUldbl='$sPRIGUldbl'
22089 sPRIXU64='$sPRIXU64'
22091 sPRIeldbl='$sPRIeldbl'
22092 sPRIfldbl='$sPRIfldbl'
22093 sPRIgldbl='$sPRIgldbl'
22098 sSCNfldbl='$sSCNfldbl'
22099 sched_yield='$sched_yield'
22100 scriptdir='$scriptdir'
22101 scriptdirexp='$scriptdirexp'
22103 seedfunc='$seedfunc'
22104 selectminbits='$selectminbits'
22105 selecttype='$selecttype'
22106 sendmail='$sendmail'
22107 setgrent_r_proto='$setgrent_r_proto'
22108 sethostent_r_proto='$sethostent_r_proto'
22109 setlocale_r_proto='$setlocale_r_proto'
22110 setnetent_r_proto='$setnetent_r_proto'
22111 setprotoent_r_proto='$setprotoent_r_proto'
22112 setpwent_r_proto='$setpwent_r_proto'
22113 setservent_r_proto='$setservent_r_proto'
22116 sharpbang='$sharpbang'
22117 shmattype='$shmattype'
22118 shortsize='$shortsize'
22121 sig_count='$sig_count'
22122 sig_name='$sig_name'
22123 sig_name_init='$sig_name_init'
22125 sig_num_init='$sig_num_init'
22126 sig_size='$sig_size'
22127 signal_t='$signal_t'
22128 sitearch='$sitearch'
22129 sitearchexp='$sitearchexp'
22131 sitebinexp='$sitebinexp'
22132 sitehtml1dir='$sitehtml1dir'
22133 sitehtml1direxp='$sitehtml1direxp'
22134 sitehtml3dir='$sitehtml3dir'
22135 sitehtml3direxp='$sitehtml3direxp'
22137 sitelib_stem='$sitelib_stem'
22138 sitelibexp='$sitelibexp'
22139 siteman1dir='$siteman1dir'
22140 siteman1direxp='$siteman1direxp'
22141 siteman3dir='$siteman3dir'
22142 siteman3direxp='$siteman3direxp'
22143 siteprefix='$siteprefix'
22144 siteprefixexp='$siteprefixexp'
22145 sitescript='$sitescript'
22146 sitescriptexp='$sitescriptexp'
22147 sizesize='$sizesize'
22148 sizetype='$sizetype'
22152 sockethdr='$sockethdr'
22153 socketlib='$socketlib'
22154 socksizetype='$socksizetype'
22156 spackage='$spackage'
22157 spitshell='$spitshell'
22158 srand48_r_proto='$srand48_r_proto'
22159 srandom_r_proto='$srandom_r_proto'
22161 ssizetype='$ssizetype'
22162 startperl='$startperl'
22164 static_ext='$static_ext'
22166 stdio_base='$stdio_base'
22167 stdio_bufsiz='$stdio_bufsiz'
22168 stdio_cnt='$stdio_cnt'
22169 stdio_filbuf='$stdio_filbuf'
22170 stdio_ptr='$stdio_ptr'
22171 stdio_stream_array='$stdio_stream_array'
22172 strerror_r_proto='$strerror_r_proto'
22175 subversion='$subversion'
22179 targetarch='$targetarch'
22183 timeincl='$timeincl'
22184 timetype='$timetype'
22185 tmpnam_r_proto='$tmpnam_r_proto'
22191 ttyname_r_proto='$ttyname_r_proto'
22200 uidformat='$uidformat'
22206 uquadtype='$uquadtype'
22207 use5005threads='$use5005threads'
22208 use64bitall='$use64bitall'
22209 use64bitint='$use64bitint'
22210 usecrosscompile='$usecrosscompile'
22212 usefaststdio='$usefaststdio'
22213 useithreads='$useithreads'
22214 uselargefiles='$uselargefiles'
22215 uselongdouble='$uselongdouble'
22216 usemallocwrap='$usemallocwrap'
22217 usemorebits='$usemorebits'
22218 usemultiplicity='$usemultiplicity'
22219 usemymalloc='$usemymalloc'
22221 useopcode='$useopcode'
22222 useperlio='$useperlio'
22223 useposix='$useposix'
22224 usereentrant='$usereentrant'
22225 userelocatableinc='$userelocatableinc'
22227 useshrplib='$useshrplib'
22228 usesitecustomize='$usesitecustomize'
22229 usesocks='$usesocks'
22230 usethreads='$usethreads'
22231 usevendorprefix='$usevendorprefix'
22232 usevfork='$usevfork'
22235 uvXUformat='$uvXUformat'
22236 uvoformat='$uvoformat'
22239 uvuformat='$uvuformat'
22240 uvxformat='$uvxformat'
22241 vendorarch='$vendorarch'
22242 vendorarchexp='$vendorarchexp'
22243 vendorbin='$vendorbin'
22244 vendorbinexp='$vendorbinexp'
22245 vendorhtml1dir='$vendorhtml1dir'
22246 vendorhtml1direxp='$vendorhtml1direxp'
22247 vendorhtml3dir='$vendorhtml3dir'
22248 vendorhtml3direxp='$vendorhtml3direxp'
22249 vendorlib='$vendorlib'
22250 vendorlib_stem='$vendorlib_stem'
22251 vendorlibexp='$vendorlibexp'
22252 vendorman1dir='$vendorman1dir'
22253 vendorman1direxp='$vendorman1direxp'
22254 vendorman3dir='$vendorman3dir'
22255 vendorman3direxp='$vendorman3direxp'
22256 vendorprefix='$vendorprefix'
22257 vendorprefixexp='$vendorprefixexp'
22258 vendorscript='$vendorscript'
22259 vendorscriptexp='$vendorscriptexp'
22261 version_patchlevel_string='$version_patchlevel_string'
22262 versiononly='$versiononly'
22264 voidflags='$voidflags'
22267 yaccflags='$yaccflags'
22272 : Add in command line options if available
22273 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22275 : add special variables
22276 $test -f $src/patchlevel.h && \
22277 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22278 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22279 echo "PERL_CONFIG_SH=true" >>config.sh
22281 : propagate old symbols
22282 if $test -f UU/config.sh; then
22283 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22284 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
22285 $sort | $uniq -u >UU/oldsyms
22286 set X `cat UU/oldsyms`
22292 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22294 echo "# Variables propagated from previous config.sh file." >>config.sh
22295 for sym in `cat UU/oldsyms`; do
22296 echo " Propagating $hint variable "'$'"$sym..."
22297 eval 'tmp="$'"${sym}"'"'
22299 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22305 : Finish up by extracting the .SH files
22309 echo "Extraction done."
22319 If you'd like to make any changes to the config.sh file before I begin
22320 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22323 rp="Press return or use a shell escape to edit config.sh:"
22328 *) : in case they cannot read
22329 sh 1>&4 -c "$ans";;
22334 : if this fails, just run all the .SH files by hand
22343 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22350 Now you need to generate make dependencies by running "$make depend".
22351 You might prefer to run it in background: "$make depend > makedepend.out &"
22352 It can take a while, so you might not want to run it right now.
22357 rp="Run $make depend now?"
22361 $make depend && echo "Now you must run '$make'."
22364 echo "You must run '$make depend' then '$make'."
22367 elif test -f [Mm]akefile; then
22369 echo "Now you must run a $make."
22371 echo "Configure done."
22374 if $test -f Policy.sh; then
22377 If you compile $package on a different machine or from a different object
22378 directory, copy the Policy.sh file from this object directory to the
22379 new one before you run Configure -- this will help you with most of
22380 the policy defaults.
22384 if $test -f config.msg; then
22385 echo "Hmm. I also noted the following information while running:"
22387 $cat config.msg >&4
22390 $rm -f kit*isdone ark*isdone