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 Feb 15 09:59:58 CET 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
348 d_attribute_format=''
349 d_attribute_malloc=''
350 d_attribute_nonnull=''
351 d_attribute_noreturn=''
353 d_attribute_unused=''
354 d_attribute_warn_unused_result=''
401 endhostent_r_proto=''
407 endprotoent_r_proto=''
413 endservent_r_proto=''
465 gethostbyaddr_r_proto=''
467 gethostbyname_r_proto=''
469 gethostent_r_proto=''
481 getnetbyaddr_r_proto=''
483 getnetbyname_r_proto=''
497 d_getprotobyname_r=''
498 getprotobyname_r_proto=''
499 d_getprotobynumber_r=''
500 getprotobynumber_r_proto=''
502 getprotoent_r_proto=''
514 getservbyname_r_proto=''
516 getservbyport_r_proto=''
518 getservent_r_proto=''
542 d_libm_lib_version=''
555 d_malloc_good_size=''
597 d_old_pthread_create_joinable=''
598 old_pthread_create_joinable=''
600 d_pthread_attr_setscope=''
639 sethostent_r_proto=''
656 setprotoent_r_proto=''
668 setservent_r_proto=''
701 d_sprintf_returns_strlen=''
716 d_stdio_ptr_lval_nochange_cnt=''
717 d_stdio_ptr_lval_sets_cnt=''
921 inc_version_list_init=''
940 ignore_versioned_solibs=''
1000 d_perl_otherlibdirs=''
1008 api_versionstring=''
1014 version_patchlevel_string=''
1018 d_nv_preserves_uv=''
1019 d_nv_zero_is_allbits_zero=''
1030 nv_preserves_uv_bits=''
1101 installsitehtml1dir=''
1104 installsitehtml3dir=''
1111 installsiteman1dir=''
1114 installsiteman3dir=''
1119 installsitescript=''
1134 d_stdio_stream_array=''
1135 stdio_stream_array=''
1146 ccflags_uselargefiles=''
1147 ldflags_uselargefiles=''
1148 libswanted_uselargefiles=''
1158 userelocatableinc=''
1169 installvendorarch=''
1176 installvendorhtml1dir=''
1178 vendorhtml1direxp=''
1179 installvendorhtml3dir=''
1181 vendorhtml3direxp=''
1187 installvendorman1dir=''
1190 installvendorman3dir=''
1197 installvendorscript=''
1209 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1212 : We must find out about Eunice early
1214 if test -f /etc/unixtovms; then
1215 eunicefix=/etc/unixtovms
1217 if test -f /etc/unixtovms.exe; then
1218 eunicefix=/etc/unixtovms.exe
1221 : Set executable suffix now -- needed before hints available
1222 if test -f "/libs/version.library"; then
1225 elif test -f "/system/gnu_library/bin/ar.pm"; then
1228 elif test -n "$DJGPP"; then
1231 elif test -d c:/. -o -n "$is_os2" ; then
1240 : set useposix=false in your hint file to disable the POSIX extension.
1242 : set useopcode=false in your hint file to disable the Opcode extension.
1244 : Trailing extension. Override this in a hint file, if needed.
1245 : Extra object files, if any, needed on this platform.
1248 : Possible local include directories to search.
1249 : Set locincpth to "" in a hint file to defeat local include searches.
1250 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1251 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1253 : no include file wanted by default
1258 : change the next line if compiling for Xenix/286 on Xenix/386
1259 xlibpth='/usr/lib/386 /lib/386'
1260 : Possible local library directories to search.
1261 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1262 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1264 : general looking path for locating libraries
1265 glibpth="/lib /usr/lib $xlibpth"
1266 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1267 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1268 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1270 : Private path used by Configure to find libraries. Its value
1271 : is prepended to libpth. This variable takes care of special
1272 : machines, like the mips. Usually, it should be empty.
1275 : default library list
1277 : some systems want to use only the non-versioned libso:s
1278 ignore_versioned_solibs=''
1283 ccflags_uselargefiles=''
1284 ldflags_uselargefiles=''
1285 libswanted_uselargefiles=''
1286 : set usemultiplicity on the Configure command line to enable multiplicity.
1287 : set usesocks on the Configure command line to enable socks.
1288 : set usethreads on the Configure command line to enable threads.
1289 usereentrant='undef'
1290 : full support for void wanted by default
1293 : List of libraries we want.
1294 : If anyone needs extra -lxxx, put those in a hint file.
1295 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1296 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1297 : We probably want to search /usr/shlib before most other libraries.
1298 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1299 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1300 glibpth="/usr/shlib $glibpth"
1301 : Do not use vfork unless overridden by a hint file.
1304 : Find the basic shell for Bourne shell scripts
1308 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1311 if test -f "$xxx"; then
1314 : Build up a list and do a single loop so we can 'break' out.
1315 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1316 for xxx in sh bash ksh pdksh ash; do
1318 try="$try ${p}/${xxx}"
1322 if test -f "$xxx"; then
1325 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1328 elif test -f "$xxx.exe"; then
1339 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1341 Usually it's in /bin/sh. How did you even get this far?
1342 Please contact me (Perl Maintainers) at perlbug@perl.org and
1343 we'll try to straighten this all out.
1349 : see if sh knows # comments
1350 if `$sh -c '#' >/dev/null 2>&1`; then
1354 test -f $xcat$_exe || xcat=/usr/bin/cat
1355 if test ! -f $xcat$_exe; then
1356 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1357 if test -f $p/cat$_exe; then
1362 if test ! -f $xcat$_exe; then
1363 echo "Can't find cat anywhere!"
1367 echo "#!$xcat" >sharp
1371 if test -s today; then
1374 echo "#! $xcat" > sharp
1378 if test -s today; then
1386 echo "Your $sh doesn't grok # comments--I will strip them later on."
1389 echo "exec grep -v '^[ ]*#'" >spitshell
1391 $eunicefix spitshell
1392 spitshell=`pwd`/spitshell
1394 echo "I presume that if # doesn't work, #! won't work either!"
1399 : figure out how to guarantee sh startup
1401 '') startsh=${sharpbang}${sh} ;;
1413 : echo "Yup, it does."
1415 echo "Hmm... '$startsh' does not guarantee sh startup..."
1416 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1421 : Save command line options in file UU/cmdline.opt for later use in
1422 : generating config.sh.
1423 cat > cmdline.opt <<EOSH
1424 # Configure command line arguments.
1433 cat >>cmdline.opt <<EOSH
1434 config_arg$argn='$arg'
1436 # Extreme backslashitis: replace each ' by '"'"'
1437 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1440 arg_exp=`cat cmdl.opt`
1441 args_exp="$args_exp$args_sep'$arg_exp'"
1442 argn=`expr $argn + 1`
1445 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1446 # used by ./hints/os2.sh
1449 : produce awk script to parse command line options
1450 cat >options.awk <<'EOF'
1452 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1454 len = length(optstr);
1455 for (i = 1; i <= len; i++) {
1456 c = substr(optstr, i, 1);
1457 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1468 if (substr(str, 1, 1) != "-") {
1469 printf("'%s'\n", str);
1473 for (i = 2; i <= len; i++) {
1474 c = substr(str, i, 1);
1476 printf("-%s\n", substr(str, i));
1482 printf("'%s'\n", substr(str, i + 1));
1495 : process the command line options
1496 set X `for arg in "$@"; do echo "X$arg"; done |
1497 sed -e s/X// | awk -f options.awk`
1502 : set up default values
1512 rm -f optdef.sh posthint.sh
1513 cat >optdef.sh <<EOS
1519 while test $# -gt 0; do
1521 -d) shift; fastread=yes;;
1522 -e) shift; alldone=cont;;
1526 if test -r "$1"; then
1529 echo "$me: cannot read config file $1." >&2
1534 -h) shift; error=true;;
1535 -r) shift; reuseval=true;;
1536 -s) shift; silent=true; realsilent=true;;
1537 -E) shift; alldone=exit;;
1538 -K) shift; knowitall=true;;
1539 -O) shift; override=true;;
1540 -S) shift; silent=true; extractsh=true;;
1545 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1546 echo "$me: ignoring -D $1" >&2
1549 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1550 *) echo "$1='define'" >> optdef.sh;;
1557 *=) echo "$1" >> optdef.sh;;
1559 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1560 echo "$me: ignoring -U $1" >&2
1562 *) echo "$1='undef'" >> optdef.sh;;
1573 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1577 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1578 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1584 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1585 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1586 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1587 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1588 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1589 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1595 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1597 echo "$yyy=''" >> posthint.sh ;;
1602 echo "$yyy='$zzz'" >> posthint.sh ;;
1604 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1606 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1611 echo "$yyy=$zzz" >> posthint.sh ;;
1612 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1616 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1619 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1627 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1628 [-U symbol] [-U symbol=] [-A command:symbol...]
1629 -d : use defaults for all answers.
1630 -e : go on without questioning past the production of config.sh.
1631 -f : specify an alternate default configuration file.
1632 -h : print this help message and exit (with an error status).
1633 -r : reuse C symbols value if possible (skips costly nm extraction).
1634 -s : silent mode, only echoes questions and essential information.
1635 -D : define symbol to have some value:
1636 -D symbol symbol gets the value 'define'
1637 -D symbol=value symbol gets the value 'value'
1638 -E : stop at the end of questions, after having produced config.sh.
1639 -K : do not use unless you know what you are doing.
1640 -O : let -D and -U override definitions from loaded configuration file.
1641 -S : perform variable substitutions on all .SH files (can mix with -f)
1642 -U : undefine symbol:
1643 -U symbol symbol gets the value 'undef'
1644 -U symbol= symbol gets completely empty
1645 -A : manipulate symbol after the platform specific hints have been applied:
1646 -A symbol=value append " "value to symbol
1647 -A append:symbol=value append value to symbol
1648 -A define:symbol=value define symbol to have value
1649 -A clear:symbol define symbol to be ''
1650 -A define:symbol define symbol to be 'define'
1651 -A eval:symbol=value define symbol to be eval of value
1652 -A prepend:symbol=value prepend value to symbol
1653 -A undef:symbol define symbol to be 'undef'
1654 -A undef:symbol= define symbol to be ''
1655 -V : print version number and exit (with a zero status).
1662 case "$fastread$alldone" in
1665 case "$extractsh" in
1668 if test ! -t 0; then
1669 echo "Say 'sh Configure', not 'sh <Configure'"
1679 true) exec 1>/dev/null;;
1682 : run the defines and the undefines, if any, but leave the file out there...
1685 : create the posthint manipulation script and leave the file out there...
1690 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1691 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1692 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1693 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1694 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1697 : Some greps do not return status, grrr.
1698 echo "grimblepritz" >grimble
1699 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1701 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1707 : the following should work in any shell
1711 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1712 cat >contains <<'EOSS'
1713 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1718 : Find the path to the source tree
1721 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1725 *) src=`cd ../$src && pwd` ;;
1738 if test -f $rsrc/Configure && \
1739 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1741 : found it, so we are ok.
1744 for src in . .. ../.. ../../.. ../../../..; do
1745 if test -f ../$src/Configure && \
1746 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1757 Sorry, I can't seem to locate the source dir for $package. Please start
1758 Configure with an explicit path -- i.e. /some/path/Configure.
1766 echo "Sources for $package found in \"$src\"." >&4
1770 : script used to extract .SH files with variable substitutions
1771 cat >extract <<'EOS'
1773 echo "Doing variable substitutions on .SH files..."
1774 if test -f MANIFEST; then
1775 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1777 echo "(Looking for .SH files under the source directory.)"
1778 set x `(cd "$src"; find . -name "*.SH" -print)`
1782 0) set x `(cd "$src"; echo *.SH)`; shift;;
1784 if test ! -f "$src/$1"; then
1790 while test $name; do
1791 if test ! -d "$name"; then
1792 create="$name $create";
1793 name=`echo $name | sed -e "s|^[^/]*$||"`;
1794 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1799 for file in $create; do
1808 dir=`expr X$file : 'X\(.*\)/'`
1809 file=`expr X$file : 'X.*/\(.*\)'`
1810 (cd "$dir" && . ./$file)
1820 dir=`expr X$file : 'X\(.*\)/'`
1821 file=`expr X$file : 'X.*/\(.*\)'`
1822 (set x $dir; shift; eval $mkdir_p)
1823 sh <"$src/$dir/$file"
1832 if test -f "$src/config_h.SH"; then
1833 if test ! -f config.h; then
1834 : oops, they left it out of MANIFEST, probably, so do it anyway.
1835 . "$src/config_h.SH"
1840 : extract files and exit if asked to do so
1841 case "$extractsh" in
1843 case "$realsilent" in
1847 case "$config_sh" in
1848 '') config_sh='config.sh';;
1851 echo "Fetching answers from $config_sh..."
1854 test "$override" && . ./optdef.sh
1858 echo "Extraction done."
1863 : Eunice requires " " instead of "", can you believe it
1866 echo "Beginning of configuration questions for $package."
1868 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1870 : first determine how to suppress newline on echo command
1872 echo "Checking echo to see how to suppress newlines..."
1873 (echo "hi there\c" ; echo " ") >.echotmp
1874 if $contains c .echotmp >/dev/null 2>&1 ; then
1885 echo $n "The star should be here-->$c"
1889 : Now test for existence of everything in MANIFEST
1891 if test -f "$rsrc/MANIFEST"; then
1892 echo "First let's make sure your kit is complete. Checking..." >&4
1893 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1896 for filelist in x??; do
1897 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1899 if test -s missing; then
1903 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1905 You have the option of continuing the configuration process, despite the
1906 distinct possibility that your kit is damaged, by typing 'y'es. If you
1907 do, don't blame me if something goes wrong. I advise you to type 'n'o
1908 and contact the author (perlbug@perl.org).
1911 echo $n "Continue? [n] $c" >&4
1915 echo "Continuing..." >&4
1919 echo "ABORTING..." >&4
1924 echo "Looks good..."
1927 echo "There is no MANIFEST file. I hope your kit is complete !"
1932 : Find the appropriate value for a newline for tr
1933 if test -n "$DJGPP"; then
1936 if test X"$trnl" = X; then
1937 case "`echo foo|tr '\n' x 2>/dev/null`" in
1941 if test X"$trnl" = X; then
1942 case "`echo foo|tr '\012' x 2>/dev/null`" in
1943 foox) trnl='\012' ;;
1946 if test X"$trnl" = X; then
1947 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1948 fooxy) trnl='\n\r' ;;
1951 if test X"$trnl" = X; then
1954 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1960 : compute the number of columns on the terminal for proper question formatting
1965 : set up the echo used in my read
1966 myecho="case \"\$xxxm\" in
1967 '') echo $n \"\$rp $c\" >&4;;
1969 '') echo $n \"[\$xxxm] $c\";;
1971 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1973 echo $n \"[\$xxxm] $c\" >&4
1975 echo $n \"\$rp [\$xxxm] $c\" >&4
1981 : now set up to do reads with possible shell escape and default assignment
1987 case "\$fastread" in
1988 yes) case "\$dflt" in
1991 case "\$silent-\$rp" in
1996 *) case "\$silent" in
1997 true) case "\$rp" in
2002 while expr "X\$ans" : "X!" >/dev/null; do
2006 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2014 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2023 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2028 echo "(OK, I'll run with -d after this question.)" >&4
2031 echo "*** Sorry, \$1 not supported yet." >&4
2041 echo "*** Substitution done -- please confirm."
2043 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2048 echo "*** Error -- try again."
2055 case "\$ans\$xxxm\$nostick" in
2067 : create .config dir to save info across Configure sessions
2068 test -d ../.config || mkdir ../.config
2069 cat >../.config/README <<EOF
2070 This directory created by Configure to save information that should
2071 persist across sessions for $package.
2073 You may safely delete it if you wish.
2076 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2078 $define|true|[yY]*) ;;
2079 *) case "$xversion" in
2082 *** WHOA THERE!!! ***
2084 This is an UNSTABLE DEVELOPMENT release.
2085 The version of this $package distribution is $xversion, that is, odd,
2086 (as opposed to even) and that signifies a development release.
2087 If you want a maintenance release, you want an even-numbered version.
2089 Do ***NOT*** install this into production use.
2090 Data corruption and crashes are possible.
2092 It is most seriously suggested that you do not continue any further
2093 unless you want to help in developing and debugging Perl.
2095 If you *still* want to build perl, you can answer 'y' now,
2096 or pass -Dusedevel to Configure.
2099 rp='Do you really want to continue?'
2103 [yY]) echo >&4 "Okay, continuing."
2104 usedevel="$define" ;;
2105 *) echo >&4 "Okay, bye."
2115 case "$versiononly" in
2116 '') versiononly="$define" ;;
2118 case "$installusrbinperl" in
2119 '') installusrbinperl="$undef" ;;
2124 : general instructions
2127 user=`(logname) 2>/dev/null`
2129 '') user=`whoami 2>&1`;;
2131 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2134 rp='Would you like to see the instructions?'
2145 This installation shell script will examine your system and ask you questions
2146 to determine how the perl5 package should be installed. If you get
2147 stuck on a question, you may use a ! shell escape to start a subshell or
2148 execute a command. Many of the questions will have default answers in square
2149 brackets; typing carriage return will give you the default.
2151 On some of the questions which ask for file or directory names you are allowed
2152 to use the ~name construct to specify the login directory belonging to "name",
2153 even if you don't have a shell which knows about that. Questions where this is
2154 allowed will be marked "(~name ok)".
2158 dflt='Type carriage return to continue'
2162 The prompter used in this script allows you to use shell variables and
2163 backticks in your answers. You may use $1, $2, etc... to refer to the words
2164 in the default answer, as if the default line was a set of arguments given to a
2165 script shell. This means you may also use $* to repeat the whole default line,
2166 so you do not have to re-type everything to add something to the default.
2168 Everytime there is a substitution, you will have to confirm. If there is an
2169 error (e.g. an unmatched backtick), the default answer will remain unchanged
2170 and you will be prompted again.
2172 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2173 the questions and use the computed defaults (or the previous answers if there
2174 was already a config.sh file). Type 'Configure -h' for a list of options.
2175 You may also start interactively and then answer '& -d' at any prompt to turn
2176 on the non-interactive behaviour for the remainder of the execution.
2182 Much effort has been expended to ensure that this shell script will run on any
2183 Unix system. If despite that it blows up on yours, your best bet is to edit
2184 Configure and run it again. If you can't run Configure for some reason,
2185 you'll have to generate a config.sh file by hand. Whatever problems you
2186 have, let me (perlbug@perl.org) know how I blew it.
2188 This installation script affects things in two ways:
2190 1) it may do direct variable substitutions on some of the files included
2192 2) it builds a config.h file for inclusion in C programs. You may edit
2193 any of these files as the need arises after running this script.
2195 If you make a mistake on a question, there is no easy way to back up to it
2196 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2197 files. Configure will offer to let you do this before it runs the SH files.
2200 dflt='Type carriage return to continue'
2202 case "$firsttime" in
2203 true) echo $user >>../.config/instruct;;
2207 : find out where common programs are
2209 echo "Locating common programs..." >&4
2222 if test -d \$dir/\$thing; then
2228 for thisthing in \$dir/\$thing; do
2229 : just loop through to pick last item
2231 if test -f \$thisthing; then
2234 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2237 elif test -f \$dir/\$thing.exe; then
2238 if test -n "$DJGPP"; then
2239 echo \$dir/\$thing.exe
2240 elif test "$eunicefix" != ":"; then
2241 : on Eunice apparently
2295 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2296 pth="$pth /lib /usr/lib"
2297 for file in $loclist; do
2301 if test -f "$xxx"; then
2304 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2305 xxx=`./loc $file $file $pth`
2308 '') xxx=`./loc $file $file $pth`;;
2309 *) xxx=`./loc $xxx $xxx $pth`;;
2311 eval $file=$xxx$_exe
2315 echo $file is in $xxx.
2318 echo $file is in $xxx.
2321 echo "I don't know where '$file' is, and my life depends on it." >&4
2322 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2328 echo "Don't worry if any of the following aren't found..."
2330 for file in $trylist; do
2334 if test -f "$xxx"; then
2337 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2338 xxx=`./loc $file $file $pth`
2341 '') xxx=`./loc $file $file $pth`;;
2342 *) xxx=`./loc $xxx $xxx $pth`;;
2344 eval $file=$xxx$_exe
2348 echo $file is in $xxx.
2351 echo $file is in $xxx.
2354 echo "I don't see $file out there, $say."
2361 echo "Substituting grep for egrep."
2368 echo "Substituting cp for ln."
2377 echo "I can't find make or gmake, and my life depends on it." >&4
2378 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2386 *) # We can't have osname yet.
2387 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2388 # Assume that gmake, if found, is definitely GNU make
2389 # and prefer it over the system make.
2390 echo "Substituting gmake for make."
2398 echo "Hopefully test is built into your sh."
2401 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2402 echo "Using the test built into your sh."
2410 echo "Hopefully echo is built into your sh."
2415 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2416 $echo $n "hi there$c" >foo1
2417 echo $n "hi there$c" >foo2
2418 if cmp foo1 foo2 >/dev/null 2>&1; then
2419 echo "They are compatible. In fact, they may be identical."
2426 They are not compatible! You are probably running ksh on a non-USG system.
2427 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2428 have echo built in and we may have to run some Bourne shell scripts. That
2429 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2432 $echo $n "The star should be here-->$c"
2442 cat <<'EOSC' >>trygcc
2447 int main(int argc, char *argv[]) {
2451 if $cc -o try $ccflags $ldflags try.c; then
2454 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2460 case "`$cc -v -c try.c 2>&1`" in
2463 if $test X"$trygcc" = Xyes; then
2464 if gcc -o try -c try.c; then
2466 echo "You seem to have a working gcc, though." >&4
2467 rp="Would you like to use it?"
2469 if $test -f myread; then
2472 if $test -f UU/myread; then
2475 echo "Cannot find myread, sorry. Aborting." >&2
2480 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2481 if $test -f usethreads.cbu; then
2484 *** However, any setting of the C compiler flags (e.g. for thread support)
2485 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2486 *** (together with e.g. -Dusethreads).
2502 cat <<'EOSC' >>checkcc
2507 int main(int argc, char *argv[]) {
2511 if $cc -o try $ccflags $ldflags try.c; then
2514 if $test X"$despair" = Xyes; then
2515 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2518 You need to find a working C compiler.
2519 Either (purchase and) install the C compiler supplied by your OS vendor,
2520 or for a free C compiler try http://gcc.gnu.org/
2521 I cannot continue any further, aborting.
2530 : determine whether symbolic links are supported
2533 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2534 echo "Symbolic links are supported." >&4
2537 echo "Symbolic links are NOT supported." >&4
2542 : determine whether symbolic links are supported
2546 echo "Checking how to test for symbolic links..." >&4
2548 if $test "X$issymlink" = X; then
2550 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2551 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2553 if test $? = 0; then
2556 echo "Your builtin 'test -h' may be broken." >&4
2559 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2562 if test -f "$p/$test"; then
2571 echo "Trying external '$test -h'." >&4
2572 issymlink="$test -h"
2573 if $test ! -h sym >/dev/null 2>&1; then
2574 echo "External '$test -h' is broken, too." >&4
2582 if $test "X$issymlink" = X; then
2583 if $test -L sym 2>/dev/null; then
2584 issymlink="$test -L"
2585 echo "The builtin '$test -L' worked." >&4
2588 if $test "X$issymlink" != X; then
2589 echo "You can test for symbolic links with '$issymlink'." >&4
2591 echo "I do not know how you can test for symbolic links." >&4
2595 *) echo "No symbolic links, so not testing for their testing..." >&4
2601 case "$mksymlinks" in
2604 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2607 *) case "$lns:$issymlink" in
2608 *"ln"*" -s:"*"test -"?)
2609 echo "Creating the symbolic links..." >&4
2610 echo "(First creating the subdirectories...)" >&4
2612 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2614 test -z "$directory" && break
2618 if test ! -d t/base; then
2619 echo "Failed to create the subdirectories. Aborting." >&4
2622 echo "(Then creating the symlinks...)" >&4
2623 awk '{print $1}' $src/MANIFEST | while true; do
2625 test -z "$filename" && break
2626 if test -f $filename; then
2627 if $issymlink $filename; then
2631 if test -f $filename; then
2632 echo "$filename already exists, not symlinking."
2634 ln -s $src/$filename $filename
2638 if test ! -f t/base/lex.t; then
2639 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2644 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2653 case "$usecrosscompile" in
2655 $echo "Cross-compiling..."
2658 *-*-gcc) # A cross-compiling gcc, probably.
2659 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2661 # leave out ld, choosing it is more complex
2663 ranlib=$targetarch-ranlib
2664 $echo 'extern int foo;' > try.c
2665 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2667 if $test $# -gt 0; then
2669 incpth="`$echo $incpth|$sed 's/^ //'`"
2670 echo "Guessing incpth '$incpth'." >&4
2672 j="`$echo $i|$sed 's,/include$,/lib,'`"
2673 if $test -d $j; then
2677 libpth="`$echo $libpth|$sed 's/^ //'`"
2678 echo "Guessing libpth '$libpth'." >&4
2683 case "$targetarch" in
2684 '') echo "Targetarch not defined." >&4; croak=y ;;
2685 *) echo "Using targetarch $targetarch." >&4 ;;
2688 '') echo "Incpth not defined." >&4; croak=y ;;
2689 *) echo "Using incpth '$incpth'." >&4 ;;
2692 '') echo "Libpth not defined." >&4; croak=y ;;
2693 *) echo "Using libpth '$libpth'." >&4 ;;
2696 '') for i in $incpth; do
2697 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2699 echo "Guessing usrinc $usrinc." >&4
2704 '') echo "Usrinc not defined." >&4; croak=y ;;
2707 *) echo "Using usrinc $usrinc." >&4 ;;
2709 case "$targethost" in
2710 '') echo "Targethost not defined." >&4; croak=y ;;
2711 *) echo "Using targethost $targethost." >&4
2716 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2719 /*) run=$src/Cross/run
2720 targetmkdir=$src/Cross/mkdir
2722 from=$src/Cross/from
2724 *) pwd=`$test -f ../Configure & cd ..; pwd`
2726 targetmkdir=$pwd/Cross/mkdir
2728 from=$pwd/Cross/from
2731 case "$targetrun" in
2732 '') targetrun=ssh ;;
2737 case "$targetfrom" in
2738 '') targetfrom=scp ;;
2742 from=$from-$targetfrom
2743 case "$targetdir" in
2745 echo "Guessing targetdir $targetdir." >&4
2748 case "$targetuser" in
2750 echo "Guessing targetuser $targetuser." >&4
2753 case "$targetfrom" in
2757 case "$targetrun" in
2769 '') cwd=$targetdir ;;
2773 if $test ! -f \$exe.xok; then
2777 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2780 *) echo "Unknown targetrun '$targetrun'" >&4
2784 case "$targetmkdir" in
2786 cat >$targetmkdir <<EOF
2788 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2790 $chmod a+rx $targetmkdir
2792 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2804 $targetmkdir \`dirname \$f\`
2805 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2808 $targetmkdir $targetdir/\`dirname \$f\`
2809 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2822 $mkdir -p $targetdir/\`dirname \$f\`
2823 $cp \$f $targetdir/\$f || exit 1
2826 $targetmkdir $targetdir/\`dirname \$f\`
2827 $cp \$f $targetdir/\$f || exit 1
2834 *) echo "Unknown targetto '$targetto'" >&4
2838 case "$targetfrom" in
2845 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2850 cp) cat >$from <<EOF
2855 cp $targetdir/\$f . || exit 1
2860 *) echo "Unknown targetfrom '$targetfrom'" >&4
2864 if $test ! -f $run; then
2865 echo "Target 'run' script '$run' not found." >&4
2869 if $test ! -f $to; then
2870 echo "Target 'to' script '$to' not found." >&4
2874 if $test ! -f $from; then
2875 echo "Target 'from' script '$from' not found." >&4
2879 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2883 Using '$run' for remote execution,
2884 and '$from' and '$to'
2885 for remote file transfer.
2891 usecrosscompile='undef'
2896 : see whether [:lower:] and [:upper:] are supported character classes
2898 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2900 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2904 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2905 # (0xd9 and 0xe2), therefore that is a nice testing point.
2906 if test "X$up" = X -o "X$low" = X; then
2907 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2913 if test "X$up" = X -o "X$low" = X; then
2914 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2920 if test "X$up" = X -o "X$low" = X; then
2921 case "`echo RS | od -x 2>/dev/null`" in
2923 echo "Hey, this might be EBCDIC." >&4
2924 if test "X$up" = X -o "X$low" = X; then
2925 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2926 rs) up='[A-IJ-RS-Z]'
2931 if test "X$up" = X -o "X$low" = X; then
2932 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2942 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2944 echo "Using $up and $low to convert case." >&4
2947 echo "I don't know how to translate letters from upper to lower case." >&4
2948 echo "Your tr is not acting any way I know of." >&4
2952 : set up the translation script tr, must be called with ./tr of course
2956 '[A-Z][a-z]') exec $tr '$up' '$low';;
2957 '[a-z][A-Z]') exec $tr '$low' '$up';;
2964 : Try to determine whether config.sh was made on this system
2965 case "$config_sh" in
2967 myuname=`$uname -a 2>/dev/null`
2968 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2969 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2970 # because the A-Z/a-z are not consecutive.
2971 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2972 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2973 newmyuname="$myuname"
2975 case "$knowitall" in
2977 if test -f ../config.sh; then
2978 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2979 eval "`grep myuname= ../config.sh`"
2981 if test "X$myuname" = "X$newmyuname"; then
2989 : Get old answers from old config file if Configure was run on the
2990 : same system, otherwise use the hints.
2993 if test -f config.sh; then
2995 rp="I see a config.sh file. Shall I use it to set the defaults?"
2998 n*|N*) echo "OK, I'll ignore it."
2999 mv config.sh config.sh.old
3000 myuname="$newmyuname"
3002 *) echo "Fetching default answers from your old config.sh file..." >&4
3010 : Older versions did not always set $sh. Catch re-use of such
3020 if test ! -f config.sh; then
3023 First time through, eh? I have some defaults handy for some systems
3024 that need some extra help getting the Configure answers right:
3027 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3029 : Half the following guesses are probably wrong... If you have better
3030 : tests or hints, please send them to perlbug@perl.org
3031 : The metaconfig authors would also appreciate a copy...
3032 $test -f /irix && osname=irix
3033 $test -f /xenix && osname=sco_xenix
3034 $test -f /dynix && osname=dynix
3035 $test -f /dnix && osname=dnix
3036 $test -f /lynx.os && osname=lynxos
3037 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3038 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3039 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3040 $test -f /bin/mips && /bin/mips && osname=mips
3041 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3042 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3043 $test -d /usr/apollo/bin && osname=apollo
3044 $test -f /etc/saf/_sactab && osname=svr4
3045 $test -d /usr/include/minix && osname=minix
3046 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3047 if $test -d /MachTen -o -d /MachTen_Folder; then
3049 if $test -x /sbin/version; then
3050 osvers=`/sbin/version | $awk '{print $2}' |
3051 $sed -e 's/[A-Za-z]$//'`
3052 elif $test -x /usr/etc/version; then
3053 osvers=`/usr/etc/version | $awk '{print $2}' |
3054 $sed -e 's/[A-Za-z]$//'`
3060 $test -f /sys/posix.dll &&
3061 $test -f /usr/bin/what &&
3062 set X `/usr/bin/what /sys/posix.dll` &&
3063 $test "$3" = UWIN &&
3067 if $test -f $uname; then
3075 umips) osname=umips ;;
3078 [23]100) osname=mips ;;
3079 next*) osname=next ;;
3081 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3082 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3085 elif $test -f /etc/kconfig; then
3087 if test "$lns" = "$ln -s"; then
3089 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3091 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3098 if test -n "$DJGPP"; then
3107 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3109 # oslevel can fail with:
3110 # oslevel: Unable to acquire lock.
3111 *not\ found) osvers="$4"."$3" ;;
3112 '<3240'|'<>3240') osvers=3.2.0 ;;
3113 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3114 '=3250'|'>3250') osvers=3.2.5 ;;
3118 bsd386) osname=bsd386
3121 cygwin*) osname=cygwin
3124 *dc.osx) osname=dcosx
3130 domainos) osname=apollo
3136 dragonfly) osname=dragonfly
3139 dynixptx*) osname=dynixptx
3140 osvers=`echo "$4"|sed 's/^v//'`
3142 freebsd) osname=freebsd
3144 genix) osname=genix ;;
3148 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3164 netbsd*) osname=netbsd
3167 news-os) osvers="$3"
3169 4*) osname=newsos4 ;;
3173 next*) osname=next ;;
3174 nonstop-ux) osname=nonstopux ;;
3175 openbsd) osname=openbsd
3181 POSIX-BC | posix-bc ) osname=posix-bc
3184 powerux | power_ux | powermax_os | powermaxos | \
3185 powerunix | power_unix) osname=powerux
3191 solaris) osname=solaris
3193 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3200 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3204 titanos) osname=titanos
3213 ultrix) osname=ultrix
3216 osf1|mls+) case "$5" in
3219 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3222 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3225 hp*) osname=hp_osf1 ;;
3226 mips) osname=mips_osf1 ;;
3229 # UnixWare 7.1.2 is known as Open UNIX 8
3230 openunix|unixware) osname=svr5
3238 $2) case "$osname" in
3242 : svr4.x or possibly later
3252 if test -f /stand/boot ; then
3253 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3254 if test -n "$INITPROG" -a -f "$INITPROG"; then
3255 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3256 if test -n "$isesix"; then
3264 *) if test -f /etc/systemid; then
3266 set `echo $3 | $sed 's/\./ /g'` $4
3267 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3269 elif $test -f $src/hints/sco_$1_$2.sh; then
3271 elif $test -f $src/hints/sco_$1.sh; then
3276 '') : Still unknown. Probably a generic Sys V.
3285 *) case "$osname" in
3286 '') : Still unknown. Probably a generic BSD.
3294 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3295 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3296 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3299 $rm -f UU/kernel.what
3300 elif test -d c:/. -o -n "$is_os2" ; then
3307 case "$targetarch" in
3310 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3315 : Now look for a hint file osname_osvers, unless one has been
3316 : specified already.
3319 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3320 : Also try without trailing minor version numbers.
3321 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3322 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3323 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3324 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3327 *) case "$osvers" in
3330 *) if $test -f $src/hints/$file.sh ; then
3332 elif $test -f $src/hints/$xfile.sh ; then
3334 elif $test -f $src/hints/$xxfile.sh ; then
3336 elif $test -f $src/hints/$xxxfile.sh ; then
3338 elif $test -f $src/hints/$xxxxfile.sh ; then
3340 elif $test -f "$src/hints/${osname}.sh" ; then
3349 if $test -f Policy.sh ; then
3352 none) dflt="Policy" ;;
3353 *) dflt="Policy $dflt" ;;
3358 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3362 if $test -f Policy.sh ; then
3365 There's also a Policy hint file available, which should make the
3366 site-specific (policy) questions easier to answer.
3373 You may give one or more space-separated answers, or "none" if appropriate.
3374 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3375 is a good thing. DO NOT give a wrong version or a wrong OS.
3379 rp="Which of these apply, if any?"
3382 for file in $tans; do
3383 if $test X$file = XPolicy -a -f Policy.sh; then
3385 $cat Policy.sh >> UU/config.sh
3386 elif $test -f $src/hints/$file.sh; then
3387 . $src/hints/$file.sh
3388 $cat $src/hints/$file.sh >> UU/config.sh
3389 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3392 : Give one chance to correct a possible typo.
3393 echo "$file.sh does not exist"
3395 rp="hint to use instead?"
3397 for file in $ans; do
3398 if $test -f "$src/hints/$file.sh"; then
3399 . $src/hints/$file.sh
3400 $cat $src/hints/$file.sh >> UU/config.sh
3401 elif $test X$ans = X -o X$ans = Xnone ; then
3404 echo "$file.sh does not exist -- ignored."
3411 : Remember our hint file for later.
3412 if $test -f "$src/hints/$file.sh" ; then
3422 echo "Fetching default answers from $config_sh..." >&4
3426 cp $config_sh config.sh 2>/dev/null
3436 test "$override" && . ./optdef.sh
3438 : Restore computed paths
3439 for file in $loclist $trylist; do
3440 eval $file="\$_$file"
3445 Configure uses the operating system name and version to set some defaults.
3446 The default value is probably right if the name rings a bell. Otherwise,
3447 since spelling matters for me, either accept the default or answer "none"
3454 ''|' '|none) dflt=none ;;
3455 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3458 *) dflt="$osname" ;;
3460 rp="Operating system name?"
3464 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3470 ''|' '|none) dflt=none ;;
3471 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3472 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3474 ''|' ') dflt=none ;;
3479 *) dflt="$osvers" ;;
3481 rp="Operating system version?"
3491 : who configured the system
3492 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3495 cf_by=`(logname) 2>/dev/null`
3498 cf_by=`(whoami) 2>/dev/null`
3500 "") cf_by=unknown ;;
3505 : set up the script used to warn in case of inconsistency
3512 echo "*** WHOA THERE!!! ***" >&4
3513 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3514 rp=" Keep the $hint value?"
3517 y) td=$was; tu=$was;;
3521 : function used to set $1 to $val
3522 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3524 $define$undef) . ./whoa; eval "$var=\$td";;
3525 $undef$define) . ./whoa; eval "$var=\$tu";;
3526 *) eval "$var=$val";;
3530 $define|true|[yY]*) dflt='y';;
3535 Perl can be built to use the SOCKS proxy protocol library. To do so,
3536 Configure must be run with -Dusesocks. If you use SOCKS you also need
3537 to use the PerlIO abstraction layer, this will be implicitly selected.
3539 If this doesn't make any sense to you, just accept the default '$dflt'.
3541 rp='Build Perl for SOCKS?'
3544 y|Y) val="$define" ;;
3551 $define|true|[yY]*) useperlio="$define";;
3554 case "$useperlio" in
3555 $define|true|[yY]*|'') dflt='y';;
3560 Previous version of $package used the standard IO mechanisms as
3561 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3562 alternate IO mechanisms via the PerlIO abstraction layer, but the
3563 stdio mechanism is still available if needed. The abstraction layer
3564 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3565 Using PerlIO with sfio may cause problems with some extension modules.
3567 If this doesn't make any sense to you, just accept the default '$dflt'.
3569 rp='Use the PerlIO abstraction layer?'
3576 echo "Ok, doing things the stdio way."
3585 case "$useperlio" in
3586 $define|true|[yY]*) ;;
3589 You are using the SOCKS proxy protocol library which means that you
3590 should also use the PerlIO layer. You may be headed for trouble.
3599 case "$usethreads" in
3600 $define|true|[yY]*) dflt='y';;
3601 *) # Catch case where user specified ithreads or 5005threads but
3602 # forgot -Dusethreads (A.D. 4/2002)
3603 case "$useithreads$use5005threads" in
3605 case "$useperlio" in
3606 "$define") dflt='y' ;;
3616 Perl can be built to take advantage of threads on some systems.
3617 To do so, Configure can be run with -Dusethreads.
3619 Note that Perl built with threading support runs slightly slower
3620 and uses more memory than plain Perl. The current implementation
3621 is believed to be stable, but it is fairly new, and so should be
3622 treated with caution.
3624 If this doesn't make any sense to you, just accept the default '$dflt'.
3626 rp='Build a threading Perl?'
3629 y|Y) val="$define" ;;
3635 case "$usethreads" in
3639 Since release 5.6, Perl has had two different threading implementations,
3640 the newer interpreter-based version (ithreads) with one interpreter per
3641 thread, and the older 5.005 version (5005threads).
3642 The 5005threads version is effectively unmaintained and will probably be
3643 removed in Perl 5.10, so there should be no need to build a Perl using it
3644 unless needed for backwards compatibility with some existing 5.005threads
3648 : Default to ithreads unless overridden on command line or with
3651 case "$use5005threads" in
3652 $define|true|[yY]*) dflt='n';;
3654 case "$useithreads" in
3655 $undef|false|[nN]*) dflt='n';;
3657 rp='Use the newer interpreter-based ithreads?'
3660 y|Y) val="$define" ;;
3665 : Now set use5005threads to the opposite value.
3666 case "$useithreads" in
3667 $define) val="$undef" ;;
3674 useithreads="$undef"
3675 use5005threads="$undef"
3679 case "$useithreads$use5005threads" in
3683 You cannot have both the ithreads and the 5.005 threads enabled
3684 at the same time. Disabling the 5.005 threads since they are
3685 much less stable than the ithreads.
3688 use5005threads="$undef"
3692 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
3695 *** To build with ithreads you must also use the PerlIO layer.
3696 *** Cannot continue, aborting.
3702 case "$d_oldpthreads" in
3703 '') : Configure tests would be welcome here. For now, assume undef.
3705 *) val="$d_oldpthreads" ;;
3711 : Look for a hint-file generated 'call-back-unit'. If the
3712 : user has specified that a threading perl is to be built,
3713 : we may need to set or change some other defaults.
3714 if $test -f usethreads.cbu; then
3715 echo "Your platform has some specific hints regarding threaded builds, using them..."
3718 case "$usethreads" in
3719 "$define"|true|[yY]*)
3721 (Your platform does not have any specific hints for threaded builds.
3722 Assuming POSIX threads, then.)
3730 Perl can be built so that multiple Perl interpreters can coexist
3731 within the same Perl executable.
3734 case "$useithreads" in
3737 This multiple interpreter support is required for interpreter-based threads.
3741 *) case "$usemultiplicity" in
3742 $define|true|[yY]*) dflt='y';;
3746 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3747 rp='Build Perl for multiplicity?'
3750 y|Y) val="$define" ;;
3759 case "$usemorebits" in
3760 "$define"|true|[yY]*)
3761 use64bitint="$define"
3762 uselongdouble="$define"
3763 usemorebits="$define"
3765 *) usemorebits="$undef"
3769 : make some quick guesses about what we are up against
3771 $echo $n "Hmm... $c"
3781 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3782 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3784 echo "Looks kind of like an OSF/1 system, but we'll see..."
3786 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3787 xxx=`./loc addbib blurfl $pth`
3788 if $test -f $xxx; then
3789 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3793 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3794 echo "Looks kind of like an extended USG system, but we'll see..."
3796 echo "Looks kind of like a USG system, but we'll see..."
3800 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3801 echo "Looks kind of like a BSD system, but we'll see..."
3805 echo "Looks kind of like a Version 7 system, but we'll see..."
3808 case "$eunicefix" in
3811 There is, however, a strange, musty smell in the air that reminds me of
3812 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3816 : it so happens the Eunice I know will not run shell scripts in Unix format
3820 echo "Congratulations. You aren't running Eunice."
3824 : Detect OS2. The p_ variable is set above in the Head.U unit.
3825 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3826 : semicolon as a patch separator
3831 I have the feeling something is not exactly right, however...don't tell me...
3832 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3833 (Or you may be running DOS with DJGPP.)
3838 if test -f /xenix; then
3839 echo "Actually, this looks more like a XENIX system..."
3844 echo "It's not Xenix..."
3849 if test -f /venix; then
3850 echo "Actually, this looks more like a VENIX system..."
3857 echo "Nor is it Venix..."
3860 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3861 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3868 rp="Use which C compiler?"
3872 : See if they have not cc but they do have gcc
3874 : Look for a hint-file generated 'call-back-unit'. Now that the
3875 : user has specified the compiler, we may need to set or change some
3877 if $test -f cc.cbu; then
3883 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3889 printf("%s\n", __VERSION__);
3891 printf("%s\n", "1");
3897 if $cc -o try $ccflags $ldflags try.c; then
3898 gccversion=`$run ./try`
3899 case "$gccversion" in
3900 '') echo "You are not using GNU cc." ;;
3901 *) echo "You are using GNU cc $gccversion."
3907 echo "*** WHOA THERE!!! ***" >&4
3908 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3909 case "$knowitall" in
3911 echo " You'd better start hunting for one and let me know about it." >&4
3917 case "$gccversion" in
3918 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3920 case "$gccversion" in
3921 '') gccosandvers='' ;;
3922 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3923 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3925 case "$gccosandvers" in
3926 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3927 $osname$osvers) ;; # looking good
3928 $osname*) cat <<EOM >&4
3930 *** WHOA THERE!!! ***
3932 Your gcc has not been compiled for the exact release of
3933 your operating system ($gccosandvers versus $osname$osvers).
3935 In general it is a good idea to keep gcc synchronized with
3936 the operating system because otherwise serious problems
3937 may ensue when trying to compile software, like Perl.
3939 I'm trying to be optimistic here, though, and will continue.
3940 If later during the configuration and build icky compilation
3941 problems appear (headerfile conflicts being the most common
3942 manifestation), I suggest reinstalling the gcc to match
3943 your operating system release.
3947 *) gccosandvers='' ;; # failed to parse, better be silent
3955 # gcc 3.* complain about adding -Idirectories that they already know about,
3956 # so we will take those off from locincpth.
3957 case "$gccversion" in
3959 echo "main(){}">try.c
3960 for incdir in $locincpth; do
3961 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
3962 grep '^c[cp]p*[01]: warning: changing search order '`
3963 if test "X$warn" != X; then
3964 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
3970 : decide how portable to be. Allow command line overrides.
3971 case "$d_portable" in
3973 *) d_portable="$define" ;;
3976 : set up shell script to do ~ expansion
3982 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3985 if $test -f /bin/csh; then
3986 /bin/csh -f -c "glob \$1"
3991 name=\`$expr x\$1 : '..\([^/]*\)'\`
3992 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3993 if $test ! -d "\$dir"; then
3995 echo "\$me: can't locate home directory for: \$name" >&2
4000 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
4016 : now set up to get a file name
4020 cat <<'EOSC' >>getfile
4036 : getfile will accept an answer from the comma-separated list
4037 : enclosed in parentheses even if it does not meet other criteria.
4038 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
4039 fn=`echo $fn | sed 's/(.*)//'`
4045 loc_file=`expr $fn : '.*:\(.*\)'`
4046 fn=`expr $fn : '\(.*\):.*'`
4054 */*) fullpath=true;;
4063 *e*) exp_file=true;;
4066 *p*) nopath_ok=true;;
4071 *d*) type='Directory';;
4072 *l*) type='Locate';;
4077 Locate) what='File';;
4082 case "$d_portable" in
4090 while test "$type"; do
4095 true) rp="$rp (~name ok)";;
4098 if test -f UU/getfile.ok && \
4099 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4118 value=`UU/filexp $ans`
4121 if test "$ans" != "$value"; then
4122 echo "(That expands to $value on this system.)"
4136 /*) value="$ansexp" ;;
4137 [a-zA-Z]:/*) value="$ansexp" ;;
4142 echo "I shall only accept a full path name, as in /bin/ls." >&4
4143 echo "Use a ! shell escape if you wish to check pathnames." >&4
4146 echo "Please give a full path name, starting with slash." >&4
4149 echo "Note that using ~name is ok provided it expands well." >&4
4162 for fp in $gfpth; do
4163 if test "X$fp" = X.; then
4168 if test -f "$pf"; then
4170 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4172 echo "($value is not a plain file, but that's ok.)"
4175 if test X"$type" = X; then
4182 for fp in $gfpth; do
4183 if test "X$fp" = X.; then
4188 direxp="$fp/$ansexp"
4190 if test -d "$direxp"; then
4198 if test -d "$ansexp"; then
4199 echo "(Looking for $loc_file in directory $value.)"
4200 value="$value/$loc_file"
4201 ansexp="$ansexp/$loc_file"
4203 if test -f "$ansexp"; then
4206 case "$nopath_ok" in
4207 true) case "$value" in
4209 *) echo "Assuming $value will be in people's path."
4225 if test "$fastread" = yes; then
4230 rp="$what $value doesn't exist. Use that name anyway?"
4249 test "X$gfpthkeep" != Xy && gfpth=""
4252 : What should the include directory be ?
4254 $echo $n "Hmm... $c"
4258 if $test -f /bin/mips && /bin/mips; then
4259 echo "Looks like a MIPS system..."
4260 $cat >usr.c <<'EOCP'
4261 #ifdef SYSTYPE_BSD43
4265 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4266 dflt='/bsd43/usr/include'
4270 mips_type='System V'
4272 $rm -f usr.c usr.out
4273 echo "and you're compiling with the $mips_type compiler and libraries."
4277 echo "Doesn't look like a MIPS system."
4287 case "$xxx_prompt" in
4290 rp='Where are the include files you want to use?'
4298 : see how we invoke the C preprocessor
4300 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4301 cat <<'EOT' >testcpp.c
4307 if test ! -f cppstdin; then
4308 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4309 # AIX cc -E doesn't show the absolute headerfile
4310 # locations but we'll cheat by using the -M flag.
4311 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
4313 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4316 echo "Keeping your $hint cppstdin wrapper."
4319 wrapper=`pwd`/cppstdin
4323 if $test "X$cppstdin" != "X" && \
4324 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4325 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4327 echo "You used to use $cppstdin $cppminus so we'll use that again."
4329 '') echo "But let's see if we can live without a wrapper..." ;;
4331 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4332 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4334 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4337 echo "(However, $cpprun $cpplast does not work, let's see...)"
4345 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4352 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4353 $cc -E <testcpp.c >testcpp.out 2>&1; \
4354 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4355 echo "Yup, it does."
4358 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4359 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4360 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4361 echo "Yup, it does."
4364 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4365 $cc -P <testcpp.c >testcpp.out 2>&1; \
4366 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4367 echo "Yipee, that works!"
4370 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4371 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4372 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4373 echo "At long last!"
4376 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4377 $cpp <testcpp.c >testcpp.out 2>&1; \
4378 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4382 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4383 $cpp - <testcpp.c >testcpp.out 2>&1; \
4384 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4385 echo "Hooray, it works! I was beginning to wonder."
4388 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4389 $wrapper <testcpp.c >testcpp.out 2>&1; \
4390 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4396 rp="No dice. I can't find a C preprocessor. Name one:"
4400 $x_cpp <testcpp.c >testcpp.out 2>&1
4401 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4402 echo "OK, that will do." >&4
4404 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4419 echo "Perhaps can we force $cc -E using a wrapper..."
4420 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4421 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4427 echo "Nope, we'll have to live without it..."
4441 "$wrapper"|'cppstdin') ;;
4442 *) $rm -f $wrapper;;
4444 $rm -f testcpp.c testcpp.out
4446 : Set private lib path
4449 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4454 '') dlist="$loclibpth $plibpth $glibpth";;
4455 *) dlist="$libpth";;
4458 : Now check and see which directories actually exist, avoiding duplicates
4462 if $test -d $xxx; then
4465 *) libpth="$libpth $xxx";;
4471 Some systems have incompatible or broken versions of libraries. Among
4472 the directories listed in the question below, please remove any you
4473 know not to be holding relevant libraries, and add any that are needed.
4474 Say "none" for none.
4485 rp="Directories to use for library searches?"
4492 : compute shared library extension
4495 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4505 On some systems, shared libraries may be available. Answer 'none' if
4506 you want to suppress searching of shared libraries for the remainder
4507 of this configuration.
4510 rp='What is the file extension used for shared libraries?'
4514 : Define several unixisms.
4515 : Hints files or command line option can be used to override them.
4516 : The convoluted testing is in case hints files set either the old
4519 '') case "$exe_ext" in
4521 *) _exe="$exe_ext" ;;
4526 '') case "$lib_ext" in
4533 '') case "$obj_ext" in
4540 '') case "$path_sep" in
4551 : Which makefile gets called first. This is used by make depend.
4552 case "$firstmakefile" in
4553 '') firstmakefile='makefile';;
4557 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4560 case "$uselongdouble" in
4561 $define|true|[yY]*) dflt='y';;
4566 Perl can be built to take advantage of long doubles which
4567 (if available) may give more accuracy and range for floating point numbers.
4569 If this doesn't make any sense to you, just accept the default '$dflt'.
4571 rp='Try to use long doubles if available?'
4574 y|Y) val="$define" ;;
4580 case "$uselongdouble" in
4581 true|[yY]*) uselongdouble="$define" ;;
4584 : Look for a hint-file generated 'call-back-unit'. If the
4585 : user has specified that long doubles should be used,
4586 : we may need to set or change some other defaults.
4587 if $test -f uselongdouble.cbu; then
4588 echo "Your platform has some specific hints regarding long doubles, using them..."
4589 . ./uselongdouble.cbu
4591 case "$uselongdouble" in
4594 (Your platform does not have any specific hints for long doubles.)
4600 : Looking for optional libraries
4602 echo "Checking for optional libraries..." >&4
4607 case "$libswanted" in
4608 '') libswanted='c_s';;
4611 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4617 for thisdir in $libpth $xlibpth; do
4618 test -d $thisdir && libspath="$libspath $thisdir"
4620 for thislib in $libswanted; do
4621 for thisdir in $libspath; do
4623 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4624 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4625 $test -f "$xxx" && eval $libscheck
4626 $test -f "$xxx" && libstyle=shared
4628 if test ! -f "$xxx"; then
4629 xxx=$thisdir/lib$thislib.$so
4630 $test -f "$xxx" && eval $libscheck
4631 $test -f "$xxx" && libstyle=shared
4633 if test ! -f "$xxx"; then
4634 xxx=$thisdir/lib$thislib$_a
4635 $test -f "$xxx" && eval $libscheck
4636 $test -f "$xxx" && libstyle=static
4638 if test ! -f "$xxx"; then
4639 xxx=$thisdir/$thislib$_a
4640 $test -f "$xxx" && eval $libscheck
4641 $test -f "$xxx" && libstyle=static
4643 if test ! -f "$xxx"; then
4644 xxx=$thisdir/lib${thislib}_s$_a
4645 $test -f "$xxx" && eval $libscheck
4646 $test -f "$xxx" && libstyle=static
4647 $test -f "$xxx" && thislib=${thislib}_s
4649 if test ! -f "$xxx"; then
4650 xxx=$thisdir/Slib$thislib$_a
4651 $test -f "$xxx" && eval $libscheck
4652 $test -f "$xxx" && libstyle=static
4654 if $test -f "$xxx"; then
4656 shared) echo "Found -l$thislib (shared)." ;;
4657 static) echo "Found -l$thislib." ;;
4658 *) echo "Found -l$thislib ($libstyle)." ;;
4662 *) dflt="$dflt -l$thislib"
4663 libsfound="$libsfound $xxx"
4665 libsfiles="$libsfiles $yyy"
4666 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4667 case " $libsdirs " in
4669 *) libsdirs="$libsdirs $yyy" ;;
4676 if $test ! -f "$xxx"; then
4677 echo "No -l$thislib."
4688 ' '|'') dflt='none';;
4693 In order to compile $package on your machine, a number of libraries
4694 are usually needed. Include any other special libraries here as well.
4695 Say "none" for none. The default list is almost always right.
4699 rp="What libraries to use?"
4706 : determine optimization, if desired, or use for debug flag also
4708 ' '|$undef) dflt='none';;
4710 *) dflt="$optimize";;
4714 By default, $package compiles with the -O flag to use the optimizer.
4715 Alternately, you might want to use the symbolic debugger, which uses
4716 the -g flag (on traditional Unix systems). Either flag can be
4717 specified here. To use neither flag, specify the word "none".
4720 rp="What optimizer/debugger flag should be used?"
4724 'none') optimize=" ";;
4728 : We will not override a previous value, but we might want to
4729 : augment a hint file
4731 default|recommended)
4732 case "$gccversion" in
4733 1*) dflt='-fpcc-struct-return' ;;
4736 *-g*) dflt="$dflt -DDEBUGGING";;
4738 case "$gccversion" in
4739 2*) if test -d /etc/conf/kconfig.d &&
4740 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4742 # Interactive Systems (ISC) POSIX mode.
4747 case "$gccversion" in
4751 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4752 echo 'int main(void) { return 0; }' > gcctest.c
4753 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4754 echo "Yes, it does." 2>&1
4757 echo "Leaving current flags $ccflags alone." 2>&1
4759 *) dflt="$dflt -fno-strict-aliasing" ;;
4762 echo "Nope, it doesn't, but that's ok." 2>&1
4766 # For gcc, adding -pipe speeds up compilations for some, but apparently
4767 # some assemblers can't read from stdin. (It also slows down compilations
4768 # in other cases, but those are apparently rarer these days.) AD 5/2004.
4769 case "$gccversion" in
4771 echo "Checking if your compiler accepts -pipe" 2>&1
4772 echo 'int main(void) { return 0; }' > gcctest.c
4773 if $cc -pipe -o gcctest gcctest.c; then
4774 echo "Yes, it does." 2>&1
4777 echo "Leaving current flags $ccflags alone." 2>&1
4779 *) dflt="$dflt -pipe" ;;
4782 echo "Nope, it doesn't, but that's ok." 2>&1
4785 echo "Checking if your compiler accepts -Wdeclaration-after-statement" 2>&1
4786 echo 'int main(void) { return 0; }' > gcctest.c
4787 if $cc -Wdeclaration-after-statement -o gcctest gcctest.c; then
4788 echo "Yes, it does." 2>&1
4790 *-Wdeclaration-after-statement*)
4791 echo "Leaving current flags $ccflags alone." 2>&1
4793 *) dflt="$dflt -Wdeclaration-after-statement" ;;
4796 echo "Nope, it doesn't, but that's ok." 2>&1
4803 case "$mips_type" in
4804 *BSD*|'') inclwanted="$locincpth $usrinc";;
4805 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4807 for thisincl in $inclwanted; do
4808 if $test -d $thisincl; then
4809 if $test x$thisincl != x$usrinc; then
4811 *" -I$thisincl "*);;
4812 *) dflt="$dflt -I$thisincl ";;
4818 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4820 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4828 *) dflt="$dflt -D$2";;
4832 set signal.h LANGUAGE_C; eval $inctest
4836 ccflags="$ccflags -DSOCKS"
4841 default|recommended) dflt="$ccflags $dflt" ;;
4842 *) dflt="$ccflags";;
4851 Your C compiler may want other flags. For this question you should include
4852 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4853 but you should NOT include libraries or ld flags like -lwhatever. If you
4854 want $package to honor its debug switch, you should include -DDEBUGGING here.
4855 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4857 To use no flags, specify the word "none".
4863 rp="Any additional cc flags?"
4870 : the following weeds options from ccflags that are of no interest to cpp
4872 '') cppflags="$ccflags" ;;
4873 *) cppflags="$cppflags $ccflags" ;;
4875 case "$gccversion" in
4876 1*) cppflags="$cppflags -D__GNUC__"
4878 case "$mips_type" in
4880 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4886 echo "Let me guess what the preprocessor flags are..." >&4
4900 *) ftry="$previous $flag";;
4902 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4903 >cpp1.out 2>/dev/null && \
4904 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4905 >cpp2.out 2>/dev/null && \
4906 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4907 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4909 cppflags="$cppflags $ftry"
4919 *-*) echo "They appear to be: $cppflags";;
4921 $rm -f cpp.c cpp?.out
4925 : flags used in final linking phase
4927 '') if ./venix; then
4933 *-posix*) dflt="$dflt -posix" ;;
4936 *) dflt="$ldflags";;
4939 : Try to guess additional flags to pick up local libraries.
4940 for thislibdir in $libpth; do
4941 case " $loclibpth " in
4944 *"-L$thislibdir "*) ;;
4945 *) dflt="$dflt -L$thislibdir" ;;
4957 Your C linker may need flags. For this question you should
4958 include -L/whatever and any other flags used by the C linker, but you
4959 should NOT include libraries like -lwhatever.
4961 Make sure you include the appropriate -L/path flags if your C linker
4962 does not normally search all of the directories you specified above,
4965 To use no flags, specify the word "none".
4969 rp="Any additional ld flags (NOT including libraries)?"
4975 rmlist="$rmlist pdp11"
4979 echo "Checking your choice of C compiler and flags for coherency..." >&4
4980 $cat > try.c <<'EOF'
4982 int main() { printf("Ok\n"); return(0); }
4984 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4986 $cat >try.msg <<'EOM'
4987 I've tried to compile and run the following simple program:
4990 $cat try.c >> try.msg
4992 $cat >> try.msg <<EOM
4999 and I got the following output:
5003 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5004 if $sh -c "$run ./try" >>try.msg 2>&1; then
5008 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5011 cat >> try.msg <<'EOQS'
5012 If $libs contains -lsfio, and sfio is mis-configured, then it
5013 sometimes (apparently) runs and exits with a 0 status, but with no
5014 output! It may have to do with sfio's use of _exit vs. exit.
5017 rp="You have a big problem. Shall I abort Configure"
5024 echo "The program compiled OK, but exited with status $?." >>try.msg
5025 rp="You have a problem. Shall I abort Configure"
5029 echo "I can't compile the test program." >>try.msg
5030 rp="You have a BIG problem. Shall I abort Configure"
5036 case "$knowitall" in
5038 echo "(The supplied flags or libraries might be incorrect.)"
5046 *) echo "Ok. Stopping Configure." >&4
5051 n) echo "OK, that should do.";;
5053 $rm -f try try.* core
5055 : define a shorthand compile call
5059 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5060 : define a shorthand compile call for compilations that should be ok.
5064 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5066 : determine filename position in cpp output
5068 echo "Computing filename position in cpp output for #include directives..." >&4
5070 vos) testaccess=-e ;;
5073 echo '#include <stdio.h>' > foo.c
5076 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5077 $grep '^[ ]*#.*stdio\.h' | \
5078 while read cline; do
5081 while $test \$# -gt 0; do
5082 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5087 pos=\`expr \$pos + 1\`
5099 *) pos="${fieldn}th";;
5101 echo "Your cpp writes the filename in the $pos field of the line."
5104 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5105 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5108 : locate header file
5113 for usrincdir in $usrinc
5115 if test -f \$usrincdir/\$wanted; then
5116 echo "\$usrincdir/\$wanted"
5120 awkprg='{ print \$$fieldn }'
5121 echo "#include <\$wanted>" > foo\$\$.c
5122 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5123 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5124 while read cline; do
5125 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5127 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5128 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5133 # status = 0: grep returned 0 lines, case statement not executed
5134 # status = 1: headerfile found
5135 # status = 2: while loop executed, no headerfile found
5139 if test \$status -eq 1; then
5146 : define an alternate in-header-list? function
5147 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5148 cont=true; xxf="echo \"<\$1> found.\" >&4";
5149 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5150 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5152 case $# in 4) instead=instead;; *) instead="at last";; esac;
5153 while $test "$cont"; do
5155 var=$2; eval "was=\$$2";
5156 if $test "$xxx" && $test -r "$xxx";
5158 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5161 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5162 set $yyy; shift; shift; yyy=$@;
5163 case $# in 0) cont="";;
5164 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5165 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5166 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5167 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5171 do set $yyy; var=$2; eval "was=\$$2";
5172 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5173 set $yyy; shift; shift; yyy=$@;
5176 : see if stdlib is available
5177 set stdlib.h i_stdlib
5180 : check for lengths of integral types
5184 echo "Checking to see how big your integers are..." >&4
5193 printf("intsize=%d;\n", (int)sizeof(int));
5194 printf("longsize=%d;\n", (int)sizeof(long));
5195 printf("shortsize=%d;\n", (int)sizeof(short));
5200 if eval $compile_ok && $run ./try > /dev/null; then
5202 echo "Your integers are $intsize bytes long."
5203 echo "Your long integers are $longsize bytes long."
5204 echo "Your short integers are $shortsize bytes long."
5208 Help! I can't compile and run the intsize test program: please enlighten me!
5209 (This is probably a misconfiguration in your system or libraries, and
5210 you really ought to fix it. Still, I'll try anyway.)
5214 rp="What is the size of an integer (in bytes)?"
5218 rp="What is the size of a long integer (in bytes)?"
5222 rp="What is the size of a short integer (in bytes)?"
5230 : check for long long
5232 echo "Checking to see if you have long long..." >&4
5233 echo 'int main() { long long x = 7; return 0; }' > try.c
5235 if eval $compile; then
5237 echo "You have long long."
5240 echo "You do not have long long."
5246 : check for length of long long
5247 case "${d_longlong}${longlongsize}" in
5250 echo "Checking to see how big your long longs are..." >&4
5251 $cat >try.c <<'EOCP'
5255 printf("%d\n", (int)sizeof(long long));
5260 if eval $compile_ok; then
5261 longlongsize=`$run ./try`
5262 echo "Your long longs are $longlongsize bytes long."
5266 echo "(I can't seem to compile the test program. Guessing...)"
5267 rp="What is the size of a long long (in bytes)?"
5271 if $test "X$longsize" = "X$longlongsize"; then
5272 echo "(That isn't any different from an ordinary long.)"
5278 : see if inttypes.h is available
5279 : we want a real compile instead of Inhdr because some systems
5280 : have an inttypes.h which includes non-existent headers
5283 #include <inttypes.h>
5285 static int32_t foo32 = 0x12345678;
5289 if eval $compile; then
5290 echo "<inttypes.h> found." >&4
5293 echo "<inttypes.h> NOT found." >&4
5302 echo "Checking to see if you have int64_t..." >&4
5304 #include <sys/types.h>
5305 #$i_inttypes I_INTTYPES
5307 #include <inttypes.h>
5309 int main() { int64_t x = 7; }
5312 if eval $compile; then
5314 echo "You have int64_t."
5317 echo "You do not have int64_t."
5325 echo "Checking which 64-bit integer type we could use..." >&4
5331 val='"unsigned int"'
5336 *) case "$longsize" in
5340 val='"unsigned long"'
5345 *) case "$d_longlong:$longlongsize" in
5350 val='"unsigned long long"'
5355 *) case "$d_int64_t" in
5374 '') echo "Alas, no 64-bit integer types in sight." >&4
5377 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5383 case "$uselonglong" in
5384 "$define"|true|[yY]*)
5387 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5389 use64bitint="$define"
5392 case "$use64bits" in
5393 "$define"|true|[yY]*)
5396 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5398 use64bitint="$define"
5401 case "$use64bitints" in
5402 "$define"|true|[yY]*)
5405 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5407 use64bitint="$define"
5410 case "$use64bitsint" in
5411 "$define"|true|[yY]*)
5414 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5416 use64bitint="$define"
5419 case "$uselonglongs" in
5420 "$define"|true|[yY]*)
5423 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5425 use64bitint="$define"
5428 case "$use64bitsall" in
5429 "$define"|true|[yY]*)
5432 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5434 use64bitall="$define"
5439 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5441 case "$use64bitall" in
5442 "$define"|true|[yY]*) use64bitint="$define" ;;
5448 You have natively 64-bit long integers.
5452 *) case "$use64bitint" in
5453 "$define"|true|[yY]*) dflt='y';;
5462 Perl can be built to take advantage of 64-bit integer types
5463 on some systems. To do so, Configure can be run with -Duse64bitint.
5464 Choosing this option will most probably introduce binary incompatibilities.
5466 If this doesn't make any sense to you, just accept the default '$dflt'.
5467 (The default has been chosen based on your configuration.)
5469 rp='Try to use 64-bit integers, if available?'
5472 [yY]*) val="$define" ;;
5480 case "$use64bitall" in
5481 "$define"|true|[yY]*) dflt='y' ;;
5482 *) case "$longsize" in
5490 You may also choose to try maximal 64-bitness. It means using as much
5491 64-bitness as possible on the platform. This in turn means even more
5492 binary incompatibilities. On the other hand, your platform may not
5493 have any more 64-bitness available than what you already have chosen.
5495 If this doesn't make any sense to you, just accept the default '$dflt'.
5496 (The default has been chosen based on your configuration.)
5498 rp='Try to use maximal 64-bit support, if available?'
5501 [yY]*) val="$define" ;;
5506 case "$use64bitall" in
5508 case "$use64bitint" in
5512 Since you have chosen a maximally 64-bit build, I'm also turning on
5513 the use of 64-bit integers.
5515 use64bitint="$define" ;;
5520 : Look for a hint-file generated 'call-back-unit'. If the
5521 : user has specified that a 64-bit perl is to be built,
5522 : we may need to set or change some other defaults.
5523 if $test -f use64bitint.cbu; then
5524 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5527 case "$use64bitint" in
5528 "$define"|true|[yY]*)
5530 4) case "$archname64" in
5531 '') archname64=64int ;;
5538 : Look for a hint-file generated 'call-back-unit'. If the
5539 : user has specified that a maximally 64-bit perl is to be built,
5540 : we may need to set or change some other defaults.
5541 if $test -f use64bitall.cbu; then
5542 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5545 case "$use64bitall" in
5546 "$define"|true|[yY]*)
5548 4) case "$archname64" in
5549 ''|64int) archname64=64all ;;
5556 case "$d_quad:$use64bitint" in
5560 *** You have chosen to use 64-bit integers,
5561 *** but none can be found.
5562 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5563 *** Cannot continue, aborting.
5570 : check for length of double
5572 case "$doublesize" in
5574 echo "Checking to see how big your double precision numbers are..." >&4
5583 printf("%d\n", (int)sizeof(double));
5588 if eval $compile_ok; then
5589 doublesize=`$run ./try`
5590 echo "Your double is $doublesize bytes long."
5593 echo "(I can't seem to compile the test program. Guessing...)"
5594 rp="What is the size of a double precision number (in bytes)?"
5602 : check for long doubles
5604 echo "Checking to see if you have long double..." >&4
5605 echo 'int main() { long double x = 7.0; }' > try.c
5607 if eval $compile; then
5609 echo "You have long double."
5612 echo "You do not have long double."
5618 : check for length of long double
5619 case "${d_longdbl}${longdblsize}" in
5622 echo "Checking to see how big your long doubles are..." >&4
5623 $cat >try.c <<'EOCP'
5627 printf("%d\n", sizeof(long double));
5632 if eval $compile; then
5633 longdblsize=`$run ./try`
5634 echo "Your long doubles are $longdblsize bytes long."
5638 echo "(I can't seem to compile the test program. Guessing...)" >&4
5639 rp="What is the size of a long double (in bytes)?"
5643 if $test "X$doublesize" = "X$longdblsize"; then
5644 echo "That isn't any different from an ordinary double."
5645 echo "I'll keep your setting anyway, but you may see some"
5646 echo "harmless compilation warnings."
5652 : determine the architecture name
5654 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5655 tarch=`arch`"-$osname"
5656 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5657 if uname -m > tmparch 2>&1 ; then
5658 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5659 -e 's/$/'"-$osname/" tmparch`
5667 case "$myarchname" in
5670 echo "(Your architecture name used to be $myarchname.)"
5674 case "$targetarch" in
5676 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5681 *) dflt="$archname";;
5683 rp='What is your architecture name'
5686 case "$usethreads" in
5688 echo "Threads selected." >&4
5690 *-thread*) echo "...and architecture name already has -thread." >&4
5692 *) archname="$archname-thread"
5693 echo "...setting architecture name to $archname." >&4
5698 case "$usemultiplicity" in
5700 echo "Multiplicity selected." >&4
5702 *-multi*) echo "...and architecture name already has -multi." >&4
5704 *) archname="$archname-multi"
5705 echo "...setting architecture name to $archname." >&4
5710 case "$use64bitint$use64bitall" in
5712 case "$archname64" in
5714 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5717 case "$use64bitint" in
5718 "$define") echo "64 bit integers selected." >&4 ;;
5720 case "$use64bitall" in
5721 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5724 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5726 *) archname="$archname-$archname64"
5727 echo "...setting architecture name to $archname." >&4
5733 case "$uselongdouble" in
5735 echo "Long doubles selected." >&4
5736 case "$longdblsize" in
5738 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
5742 *-ld*) echo "...and architecture name already has -ld." >&4
5744 *) archname="$archname-ld"
5745 echo "...setting architecture name to $archname." >&4
5752 case "$useperlio" in
5754 echo "Perlio selected." >&4
5757 echo "Perlio not selected, using stdio." >&4
5759 *-stdio*) echo "...and architecture name already has -stdio." >&4
5761 *) archname="$archname-stdio"
5762 echo "...setting architecture name to $archname." >&4
5767 if $test -f archname.cbu; then
5768 echo "Your platform has some specific hints for architecture name, using them..."
5772 : determine root of directory hierarchy where package will be installed.
5775 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5778 dflt=`echo "$prefix" | sed 's/.$//'`
5786 By default, $package will be installed in $dflt/bin, manual pages
5787 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5788 installation directories. Typically this is something like /usr/local.
5789 If you wish to have binaries under /usr/bin but other parts of the
5790 installation under /usr/local, that's ok: you will be prompted
5791 separately for each of the installation directories, the prefix being
5792 only used to set the defaults.
5796 rp='Installation prefix to use?'
5804 *) oldprefix="$prefix";;
5813 *) afsroot=$afsroot ;;
5819 $define|true) afs=true ;;
5820 $undef|false) afs=false ;;
5821 *) if test -d $afsroot; then
5829 echo "AFS may be running... I'll be extra cautious then..." >&4
5831 echo "AFS does not seem to be running..." >&4
5834 : determine installation prefix for where package is to be installed.
5838 Since you are running AFS, I need to distinguish the directory in which
5839 files will reside from the directory in which they are installed (and from
5840 which they are presumably copied to the former directory by occult means).
5843 case "$installprefix" in
5844 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
5845 *) dflt="$installprefix";;
5850 In some special cases, particularly when building $package for distribution,
5851 it is convenient to distinguish the directory in which files should be
5852 installed from the directory ($prefix) in which they will
5853 eventually reside. For most users, these two directories are the same.
5856 case "$installprefix" in
5858 *) dflt=$installprefix;;
5862 rp='What installation prefix should I use for installing files?'
5864 installprefix="$ans"
5865 installprefixexp="$ansexp"
5867 : set the prefixit variable, to compute a suitable default value
5868 prefixit='case "$3" in
5870 case "$oldprefix" in
5871 "") eval "$1=\"\$$2\"";;
5878 ""|" ") eval "$1=\"\$$2\"";;
5884 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5886 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5887 /*-$oldprefix/*|\~*-$oldprefix/*)
5888 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5889 *) eval "$1=\"\$$2\"";;
5893 : get the patchlevel
5895 echo "Getting the current patchlevel..." >&4
5896 if $test -r $rsrc/patchlevel.h;then
5897 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5898 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5899 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5900 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5901 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5902 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5903 perl_patchlevel=`egrep 'define PERL_PATCHNUM [0-9][0-9]|,"MAINT[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
5912 $echo "(You do not have patchlevel.h. Eek.)"
5914 if $test -r $rsrc/.patch ; then
5915 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
5916 perl_patchlevel=`cat $rsrc/.patch`
5919 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
5920 version_patchlevel_string="version $patchlevel subversion $subversion"
5921 case "$perl_patchlevel" in
5923 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
5926 $echo "(You have $package $version_patchlevel_string.)"
5930 : XXX Should be a Configure test for double-dots in filenames.
5931 version=`echo $revision $patchlevel $subversion | \
5932 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5933 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5934 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5937 version=`echo $revision $patchlevel $subversion | \
5938 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5939 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5940 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5943 : Special case the 5.005_xx maintenance series, which used 5.005
5944 : without any subversion label as a subdirectory in $sitelib
5945 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
5946 api_versionstring='5.005'
5949 : determine installation style
5950 : For now, try to deduce it from prefix unless it is already set.
5951 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
5952 case "$installstyle" in
5953 '') case "$prefix" in
5954 *perl*) dflt='lib';;
5955 *) dflt='lib/perl5' ;;
5958 *) dflt="$installstyle" ;;
5960 : Probably not worth prompting for this since we prompt for all
5961 : the directories individually, and the prompt would be too long and
5965 : determine where private library files go
5966 : Usual default is /usr/local/lib/perl5/$version.
5967 : Also allow things like /opt/perl/lib/$version, since
5968 : /opt/perl/lib/perl5... would be redundant.
5969 : The default "style" setting is made in installstyle.U
5970 case "$installstyle" in
5971 *lib/perl5*) set dflt privlib lib/$package/$version ;;
5972 *) set dflt privlib lib/$version ;;
5977 There are some auxiliary files for $package that need to be put into a
5978 private library directory that is accessible by everyone.
5982 rp='Pathname where the private library files will reside?'
5985 privlibexp="$ansexp"
5986 : Change installation prefix, if necessary.
5987 if $test X"$prefix" != X"$installprefix"; then
5988 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
5990 installprivlib="$privlibexp"
5993 : set the prefixup variable, to restore leading tilda escape
5994 prefixup='case "$prefixexp" in
5996 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
5999 : determine where public architecture dependent libraries go
6002 : privlib default is /usr/local/lib/$package/$version
6003 : archlib default is /usr/local/lib/$package/$version/$archname
6004 : privlib may have an optional trailing /share.
6005 tdflt=`echo $privlib | $sed 's,/share$,,'`
6006 tdflt=$tdflt/$archname
6015 $spackage contains architecture-dependent library files. If you are
6016 sharing libraries in a heterogeneous environment, you might store
6017 these files in a separate location. Otherwise, you can just include
6018 them with the rest of the public library files.
6022 rp='Where do you want to put the public architecture-dependent libraries?'
6025 archlibexp="$ansexp"
6026 if $test X"$archlib" = X"$privlib"; then
6031 : Change installation prefix, if necessary.
6032 if $test X"$prefix" != X"$installprefix"; then
6033 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
6035 installarchlib="$archlibexp"
6038 : see if setuid scripts can be secure
6041 Some kernels have a bug that prevents setuid #! scripts from being
6042 secure. Some sites have disabled setuid #! scripts because of this.
6044 First let's decide if your kernel supports secure setuid #! scripts.
6045 (If setuid #! scripts would be secure but have been disabled anyway,
6046 don't say that they are secure if asked.)
6051 if $test -d /dev/fd; then
6052 echo "#!$ls" >reflect
6053 chmod +x,u+s reflect
6054 ./reflect >flect 2>&1
6055 if $contains "/dev/fd" flect >/dev/null; then
6056 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6060 If you are not sure if they are secure, I can check but I'll need a
6061 username and password different from the one you are using right now.
6062 If you don't have such a username or don't want me to test, simply
6066 rp='Other username to test security of setuid scripts with?'
6071 case "$d_suidsafe" in
6072 '') echo "I'll assume setuid scripts are *not* secure." >&4
6075 echo "Well, the $hint value is *not* secure." >&4
6077 *) echo "Well, the $hint value *is* secure." >&4
6082 $rm -f reflect flect
6083 echo "#!$ls" >reflect
6084 chmod +x,u+s reflect
6087 echo '"su" will (probably) prompt you for '"$ans's password."
6088 su $ans -c './reflect >flect'
6089 if $contains "/dev/fd" flect >/dev/null; then
6090 echo "Okay, it looks like setuid scripts are secure." >&4
6093 echo "I don't think setuid scripts are secure." >&4
6098 rp='Does your kernel have *secure* setuid scripts?'
6101 [yY]*) val="$define";;
6106 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6107 echo "(That's for file descriptors, not floppy disks.)"
6113 $rm -f reflect flect
6115 : now see if they want to do setuid emulation
6118 case "$d_suidsafe" in
6121 echo "No need to emulate SUID scripts since they are secure here." >&4
6125 Some systems have disabled setuid scripts, especially systems where
6126 setuid scripts cannot be secure. On systems where setuid scripts have
6127 been disabled, the setuid/setgid bits on scripts are currently
6128 useless. It is possible for $package to detect those bits and emulate
6129 setuid/setgid in a secure fashion. This emulation will only work if
6130 setuid scripts have been disabled in your kernel.
6134 "$define") dflt=y ;;
6137 rp="Do you want to do setuid/setgid emulation?"
6140 [yY]*) val="$define";;
6148 : see if this is a malloc.h system
6149 : we want a real compile instead of Inhdr because some systems have a
6150 : malloc.h that just gives a compile error saying to use stdlib.h instead
6155 int main () { return 0; }
6158 if eval $compile; then
6159 echo "<malloc.h> found." >&4
6162 echo "<malloc.h> NOT found." >&4
6169 : check for void type
6171 echo "Checking to see how well your C compiler groks the void type..." >&4
6172 case "$voidflags" in
6184 extern void moo(); /* function returning void */
6185 void (*goo)(); /* ptr to func returning void */
6187 void *hue; /* generic ptr */
6200 int main() { sub(); }
6202 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6203 voidflags=$defvoidused
6204 echo "Good. It appears to support void to the level $package wants.">&4
6205 if $contains warning .out >/dev/null 2>&1; then
6206 echo "However, you might get some warnings that look like this:"
6210 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6211 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6212 echo "It supports 1..."
6213 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6214 echo "It also supports 2..."
6215 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6217 echo "And it supports 4 but not 8 definitely."
6219 echo "It doesn't support 4..."
6220 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6222 echo "But it supports 8."
6225 echo "Neither does it support 8."
6229 echo "It does not support 2..."
6230 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6232 echo "But it supports 4 and 8."
6234 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6236 echo "And it supports 4 but has not heard about 8."
6238 echo "However it supports 8 but not 4."
6243 echo "There is no support at all for void."
6248 case "$voidflags" in
6251 Support flag bits are:
6252 1: basic void declarations.
6253 2: arrays of pointers to functions returning void.
6254 4: operations between pointers to and addresses of void functions.
6255 8: generic void pointers.
6258 rp="Your void support flags add up to what?"
6265 : check for length of pointer
6269 echo "Checking to see how big your pointers are..." >&4
6270 if test "$voidflags" -gt 7; then
6271 echo '#define VOID_PTR char *' > try.c
6273 echo '#define VOID_PTR void *' > try.c
6283 printf("%d\n", (int)sizeof(VOID_PTR));
6288 if eval $compile_ok; then
6289 ptrsize=`$run ./try`
6290 echo "Your pointers are $ptrsize bytes long."
6293 echo "(I can't seem to compile the test program. Guessing...)" >&4
6294 rp="What is the size of a pointer (in bytes)?"
6301 case "$use64bitall" in
6302 "$define"|true|[yY]*)
6306 *** You have chosen a maximally 64-bit build,
6307 *** but your pointers are only 4 bytes wide.
6308 *** Please rerun Configure without -Duse64bitall.
6313 *** Since you have quads, you could possibly try with -Duse64bitint.
6318 *** Cannot continue, aborting.
6329 : determine whether to use malloc wrapping
6331 case "$usemallocwrap" in
6332 [yY]*|true|$define) dflt='y' ;;
6333 [nN]*|false|$undef) dflt='n' ;;
6334 *) case "$usedevel" in
6335 [yY]*|true|$define) dflt='y' ;;
6340 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6342 usemallocwrap="$ans"
6345 usemallocwrap="$define" ;;
6347 usemallocwrap="$undef" ;;
6350 : determine which malloc to compile in
6352 case "$usemymalloc" in
6353 [yY]*|true|$define) dflt='y' ;;
6354 [nN]*|false|$undef) dflt='n' ;;
6355 *) case "$ptrsize" in
6361 rp="Do you wish to attempt to use the malloc that comes with $package?"
6367 mallocsrc='malloc.c'
6368 mallocobj="malloc$_o"
6369 d_mymalloc="$define"
6372 : Remove malloc from list of libraries to use
6373 echo "Removing unneeded -lmalloc from library list" >&4
6374 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6377 echo "libs = $libs" >&4
6389 : compute the return types of malloc and free
6391 $cat >malloc.c <<END
6395 #include <sys/types.h>
6409 case "$malloctype" in
6411 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6418 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6422 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6429 echo "Your system uses $freetype free(), it would seem." >&4
6433 After $package is installed, you may wish to install various
6434 add-on modules and utilities. Typically, these add-ons will
6435 be installed under $prefix with the rest
6436 of this package. However, you may wish to install such add-ons
6437 elsewhere under a different prefix.
6439 If you do not wish to put everything under a single prefix, that's
6440 ok. You will be prompted for the individual locations; this siteprefix
6441 is only used to suggest the defaults.
6443 The default should be fine for most people.
6447 rp='Installation prefix to use for add-on modules and utilities?'
6448 : XXX Here might be another good place for an installstyle setting.
6449 case "$siteprefix" in
6451 *) dflt=$siteprefix ;;
6454 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6456 case "$siteprefix" in
6460 *) oldsiteprefix="$prefix";;
6465 siteprefixexp="$ansexp"
6467 : determine where site specific libraries go.
6468 : Usual default is /usr/local/lib/perl5/site_perl/$version
6469 : The default "style" setting is made in installstyle.U
6470 : XXX No longer works with Prefixit stuff.
6471 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6473 '') case "$installstyle" in
6474 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6475 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6483 The installation process will create a directory for
6484 site-specific extensions and modules. Most users find it convenient
6485 to place all site-specific files in this directory rather than in the
6486 main distribution directory.
6490 rp='Pathname for the site-specific library files?'
6493 sitelibexp="$ansexp"
6494 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6495 : Change installation prefix, if necessary.
6496 if $test X"$prefix" != X"$installprefix"; then
6497 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6499 installsitelib="$sitelibexp"
6502 : determine where site specific architecture-dependent libraries go.
6503 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6504 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6505 : sitelib may have an optional trailing /share.
6507 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6508 dflt="$dflt/$archname"
6513 set sitearch sitearch none
6517 The installation process will also create a directory for
6518 architecture-dependent site-specific extensions and modules.
6522 rp='Pathname for the site-specific architecture-dependent library files?'
6525 sitearchexp="$ansexp"
6526 : Change installation prefix, if necessary.
6527 if $test X"$prefix" != X"$installprefix"; then
6528 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6530 installsitearch="$sitearchexp"
6535 The installation process will also create a directory for
6536 vendor-supplied add-ons. Vendors who supply perl with their system
6537 may find it convenient to place all vendor-supplied files in this
6538 directory rather than in the main distribution directory. This will
6539 ease upgrades between binary-compatible maintenance versions of perl.
6541 Of course you may also use these directories in whatever way you see
6542 fit. For example, you might use them to access modules shared over a
6543 company-wide network.
6545 The default answer should be fine for most people.
6546 This causes further questions about vendor add-ons to be skipped
6547 and no vendor-specific directories will be configured for perl.
6550 rp='Do you want to configure vendor-specific add-on directories?'
6551 case "$usevendorprefix" in
6552 define|true|[yY]*) dflt=y ;;
6553 *) : User may have set vendorprefix directly on Configure command line.
6554 case "$vendorprefix" in
6563 rp='Installation prefix to use for vendor-supplied add-ons?'
6564 case "$vendorprefix" in
6566 *) dflt=$vendorprefix ;;
6569 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6571 case "$vendorprefix" in
6575 *) oldvendorprefix="$prefix";;
6579 usevendorprefix="$define"
6581 vendorprefixexp="$ansexp"
6583 *) usevendorprefix="$undef"
6589 case "$vendorprefix" in
6590 '') d_vendorlib="$undef"
6594 *) d_vendorlib="$define"
6595 : determine where vendor-supplied modules go.
6596 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6597 case "$vendorlib" in
6599 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6600 case "$installstyle" in
6601 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6602 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6605 *) dflt="$vendorlib"
6609 rp='Pathname for the vendor-supplied library files?'
6612 vendorlibexp="$ansexp"
6615 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6616 : Change installation prefix, if necessary.
6617 if $test X"$prefix" != X"$installprefix"; then
6618 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6620 installvendorlib="$vendorlibexp"
6623 case "$vendorprefix" in
6624 '') d_vendorarch="$undef"
6628 *) d_vendorarch="$define"
6629 : determine where vendor-supplied architecture-dependent libraries go.
6630 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6631 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6632 : vendorlib may have an optional trailing /share.
6633 case "$vendorarch" in
6634 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6635 dflt="$dflt/$archname"
6637 *) dflt="$vendorarch" ;;
6640 rp='Pathname for vendor-supplied architecture-dependent files?'
6643 vendorarchexp="$ansexp"
6646 : Change installation prefix, if necessary.
6647 if $test X"$prefix" != X"$installprefix"; then
6648 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6650 installvendorarch="$vendorarchexp"
6653 : Final catch-all directories to search
6656 Lastly, you can have perl look in other directories for extensions and
6657 modules in addition to those already specified.
6658 These directories will be searched after
6662 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6663 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6665 case "$otherlibdirs" in
6666 ''|' ') dflt='none' ;;
6667 *) dflt="$otherlibdirs" ;;
6670 Enter a colon-separated set of extra paths to include in perl's @INC
6671 search path, or enter 'none' for no extra paths.
6675 rp='Colon-separated list of additional directories for perl to search?'
6678 ' '|''|none) otherlibdirs=' ' ;;
6679 *) otherlibdirs="$ans" ;;
6681 case "$otherlibdirs" in
6685 set d_perl_otherlibdirs
6688 : Cruising for prototypes
6690 echo "Checking out function prototypes..." >&4
6691 $cat >prototype.c <<EOCP
6696 int main(int argc, char *argv[]) {
6699 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6700 echo "Your C compiler appears to support function prototypes."
6703 echo "Your C compiler doesn't seem to understand function prototypes."
6710 case "$prototype" in
6712 *) ansi2knr='ansi2knr'
6717 This version of $package can only be compiled by a compiler that
6718 understands function prototypes. Unfortunately, your C compiler
6720 doesn't seem to understand them. Sorry about that.
6722 If GNU cc is available for your system, perhaps you could try that instead.
6724 Eventually, we hope to support building Perl with pre-ANSI compilers.
6725 If you would like to help in that effort, please contact <perlbug@perl.org>.
6727 Aborting Configure now.
6733 : determine where public executables go
6738 rp='Pathname where the public executables will reside?'
6740 if $test "X$ansexp" != "X$binexp"; then
6745 : Change installation prefix, if necessary.
6746 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6747 if $test X"$prefix" != X"$installprefix"; then
6748 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6750 installbin="$binexp"
6759 Perl can be built with extra modules or bundles of modules which
6760 will be fetched from the CPAN and installed alongside Perl.
6762 Notice that you will need access to the CPAN; either via the Internet,
6763 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
6764 be asked later to configure the CPAN.pm module which will in turn do
6765 the installation of the rest of the extra modules or bundles.)
6767 Notice also that if the modules require any external software such as
6768 libraries and headers (the libz library and the zlib.h header for the
6769 Compress::Zlib module, for example) you MUST have any such software
6770 already installed, this configuration process will NOT install such
6773 If this doesn't make any sense to you, just accept the default '$dflt'.
6775 rp='Install any extra modules (y or n)?'
6781 Please list any extra modules or bundles to be installed from CPAN,
6782 with spaces between the names. The names can be in any format the
6783 'install' command of CPAN.pm will understand. (Answer 'none',
6784 without the quotes, to install no extra modules or bundles.)
6794 $rm -f ../extras.lst
6796 *) echo "(Saving the list of extras for later...)"
6797 echo "$extras" > ../extras.lst
6805 : determine where html pages for programs go
6806 set html1dir html1dir none
6810 If you wish to install html files for programs in $spackage, indicate
6811 the appropriate directory here. To skip installing html files,
6815 ''|none|$undef|' ') dflt=none ;;
6816 *) dflt=$html1dir ;;
6819 rp="Directory for the main $spackage html pages?"
6822 html1direxp="$ansexp"
6823 : Use ' ' for none so value is preserved next time through Configure
6824 $test X"$html1dir" = "X" && html1dir=' '
6825 : Change installation prefix, if necessary.
6826 if $test X"$prefix" != X"$installprefix"; then
6827 installhtml1dir=`echo $html1direxp | sed "s#^$prefix#$installprefix#"`
6829 installhtml1dir="$html1direxp"
6832 : determine where html pages for libraries and modules go
6833 set html3dir html3dir none
6837 If you wish to install html files for modules associated with $spackage,
6838 indicate the appropriate directory here. To skip installing html files,
6841 : There is no obvious default. If they have specified html1dir, then
6842 : try to key off that, possibly changing .../html1 into .../html3.
6844 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
6845 *) dflt=$html3dir ;;
6848 rp="Directory for the $spackage module html pages?"
6851 html3direxp="$ansexp"
6852 : Use ' ' for none so value is preserved next time through Configure
6853 $test X"$html3dir" = "X" && html3dir=' '
6854 : Change installation prefix, if necessary.
6855 if $test X"$prefix" != X"$installprefix"; then
6856 installhtml3dir=`echo $html3direxp | sed "s#^$prefix#$installprefix#"`
6858 installhtml3dir="$html3direxp"
6861 : Find perl5.005 or later.
6862 echo "Looking for a previously installed perl5.005 or later... "
6864 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6865 : Check if this perl is recent and can load a simple module
6866 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6869 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6879 '') echo "None found. That's ok.";;
6880 *) echo "Using $perl5." ;;
6883 : Determine list of previous versions to include in @INC
6884 $cat > getverlist <<EOPL
6887 \$api_versionstring = "$api_versionstring";
6888 \$version = "$version";
6889 \$stem = "$sitelib_stem";
6890 \$archname = "$archname";
6892 $cat >> getverlist <<'EOPL'
6893 # Can't have leading @ because metaconfig interprets it as a command!
6894 ;@inc_version_list=();
6895 # XXX Redo to do opendir/readdir?
6898 ;@candidates = glob("5.*");
6904 # XXX ToDo: These comparisons must be reworked when two-digit
6905 # subversions come along, so that 5.7.10 compares as greater than
6906 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6907 # widespread that we can use the built-in version vectors rather
6908 # than reinventing them here. For 5.6.0, however, we must
6909 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6910 foreach $d (@candidates) {
6911 if ($d lt $version) {
6912 if ($d ge $api_versionstring) {
6913 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6915 elsif ($d ge "5.005") {
6916 unshift(@inc_version_list, grep { -d } $d);
6920 # Skip newer version. I.e. don't look in
6921 # 5.7.0 if we're installing 5.6.1.
6925 if (@inc_version_list) {
6926 print join(' ', @inc_version_list);
6929 # Blank space to preserve value for next Configure run.
6934 case "$inc_version_list" in
6935 '') if test -x "$perl5$exe_ext"; then
6936 dflt=`$perl5 getverlist`
6941 $undef) dflt='none' ;;
6942 *) eval dflt=\"$inc_version_list\" ;;
6945 ''|' ') dflt=none ;;
6952 In order to ease the process of upgrading, this version of perl
6953 can be configured to use modules built and installed with earlier
6954 versions of perl that were installed under $prefix. Specify here
6955 the list of earlier versions that this version of perl should check.
6956 If Configure detected no earlier versions of perl installed under
6957 $prefix, then the list will be empty. Answer 'none' to tell perl
6958 to not search earlier versions.
6960 The default should almost always be sensible, so if you're not sure,
6961 just accept the default.
6964 rp='List of earlier versions to include in @INC?'
6967 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6968 *) inc_version_list="$ans" ;;
6970 case "$inc_version_list" in
6972 inc_version_list_init='0';;
6973 *) inc_version_list_init=`echo $inc_version_list |
6974 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6979 : determine whether to install perl also as /usr/bin/perl
6982 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6984 Many scripts expect perl to be installed as /usr/bin/perl.
6986 If you want to, I can install the perl you are about to compile
6987 as /usr/bin/perl (in addition to $bin/perl).
6989 if test -f /usr/bin/perl; then
6992 However, please note that because you already have a /usr/bin/perl,
6993 overwriting that with a new Perl would very probably cause problems.
6994 Therefore I'm assuming you don't want to do that (unless you insist).
6997 case "$installusrbinperl" in
6998 "$define"|[yY]*) dflt='y';;
7004 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7007 case "$installusrbinperl" in
7008 "$undef"|[nN]*) dflt='n';;
7012 rp="Do you want to install perl as /usr/bin/perl?"
7015 [yY]*) val="$define";;
7021 set installusrbinperl
7025 echo "Checking for GNU C Library..." >&4
7027 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7028 alone are insufficient to distinguish different versions, such as
7029 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7030 libc version 2.1.0. A. Dougherty, June 3, 2002.
7036 # ifdef __GLIBC_MINOR__
7037 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
7038 # include <gnu/libc-version.h>
7039 printf("%s\n", gnu_get_libc_version());
7041 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7044 printf("%d\n", __GLIBC__);
7053 if eval $compile_ok && $run ./try > glibc.ver; then
7055 gnulibc_version=`$cat glibc.ver`
7056 echo "You are using the GNU C Library version $gnulibc_version"
7060 echo "You are not using the GNU C Library"
7062 $rm -f try try.* glibc.ver
7066 : see if nm is to be used to determine whether a symbol is defined or not
7070 case "$d_gnulibc" in
7073 echo "nm probably won't work on the GNU C Library." >&4
7079 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7081 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7082 echo "'nm' won't be sufficient on this sytem." >&4
7088 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7089 if $test $dflt -gt 20; then
7099 true|$define) dflt=y;;
7106 I can use $nm to extract the symbols from your C libraries. This
7107 is a time consuming task which may generate huge output on the disk (up
7108 to 3 megabytes) but that should make the symbols extraction faster. The
7109 alternative is to skip the 'nm' extraction part and to compile a small
7110 test program instead to determine whether each symbol is present. If
7111 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7112 this may be the best solution.
7114 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7117 rp="Shall I use $nm to extract C symbols from the libraries?"
7120 [Nn]*) usenm=false;;
7129 : nm options which may be necessary
7131 '') if $test -f /mach_boot; then
7133 elif $test -d /usr/ccs/lib; then
7134 nm_opt='-p' # Solaris (and SunOS?)
7135 elif $test -f /dgux; then
7137 elif $test -f /lib64/rld; then
7138 nm_opt='-p' # 64-bit Irix
7144 : nm options which may be necessary for shared libraries but illegal
7145 : for archive libraries. Thank you, Linux.
7146 case "$nm_so_opt" in
7147 '') case "$myuname" in
7149 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7150 nm_so_opt='--dynamic'
7159 : get list of predefined functions in a handy place
7164 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7170 *) for thislib in $libs; do
7173 : Handle C library specially below.
7176 thislib=`echo $thislib | $sed -e 's/^-l//'`
7177 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7179 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7181 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7183 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7185 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7187 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7189 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7194 libnames="$libnames $try"
7196 *) libnames="$libnames $thislib" ;;
7205 for xxx in $libpth; do
7206 $test -r $1 || set $xxx/libc.$so
7207 : The messy sed command sorts on library version numbers.
7209 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7210 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7212 s/[0-9][0-9]*/0000&/g
7213 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7216 $sort | $sed -e 's/^.* //'`
7219 $test -r $1 || set /usr/ccs/lib/libc.$so
7220 $test -r $1 || set /lib/libsys_s$_a
7226 if $test -r "$1"; then
7227 echo "Your (shared) C library seems to be in $1."
7229 elif $test -r /lib/libc && $test -r /lib/clib; then
7230 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7232 libc='/lib/clib /lib/libc'
7233 if $test -r /lib/syslib; then
7234 echo "(Your math library is in /lib/syslib.)"
7235 libc="$libc /lib/syslib"
7237 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7238 echo "Your C library seems to be in $libc, as you said before."
7239 elif $test -r $incpath/usr/lib/libc$_a; then
7240 libc=$incpath/usr/lib/libc$_a;
7241 echo "Your C library seems to be in $libc. That's fine."
7242 elif $test -r /lib/libc$_a; then
7244 echo "Your C library seems to be in $libc. You're normal."
7246 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7248 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7249 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7250 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7252 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7254 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7257 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7259 if $test -r "$tans"; then
7260 echo "Your C library seems to be in $tans, of all places."
7266 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7270 If the guess above is wrong (which it might be if you're using a strange
7271 compiler, or your machine supports multiple models), you can override it here.
7276 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7278 I can't seem to find your C library. I've looked in the following places:
7281 $sed 's/^/ /' libpath
7284 None of these seems to contain your C library. I need to get its name...
7289 rp='Where is your C library?'
7294 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7295 set X `cat libnames`
7298 case $# in 1) xxx=file; esac
7299 echo "Extracting names from the following $xxx for later perusal:" >&4
7301 $sed 's/^/ /' libnames >&4
7303 $echo $n "This may take a while...$c" >&4
7307 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7308 *) $nm $nm_opt $file 2>/dev/null;;
7313 $grep fprintf libc.tmp > libc.ptf
7314 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7315 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7317 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7319 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7321 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7323 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7325 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7327 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7329 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7331 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7333 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7335 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7337 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7339 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7341 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7342 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7344 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7346 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7348 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7350 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7352 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7354 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7356 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7358 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7360 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7362 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7364 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7366 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7368 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7370 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7372 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7375 $nm -p $* 2>/dev/null >libc.tmp
7376 $grep fprintf libc.tmp > libc.ptf
7377 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7378 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7384 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7386 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7387 for thisname in $libnames $libc; do
7388 $ar t $thisname >>libc.tmp
7390 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7392 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7393 # Repeat libc to extract forwarders to DLL entries too
7394 for thisname in $libnames $libc; do
7395 $ar tv $thisname >>libc.tmp
7396 # Revision 50 of EMX has bug in $ar.
7397 # it will not extract forwarders to DLL entries
7398 # Use emximp which will extract exactly them.
7399 emximp -o tmp.imp $thisname \
7401 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7402 < tmp.imp >>libc.tmp
7405 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7408 echo "$ar didn't seem to work right." >&4
7409 echo "Maybe this is a Cray...trying bld instead..." >&4
7410 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7412 for thisname in $libnames; do
7414 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7415 $ar t $thisname >>libc.tmp
7419 echo "That didn't work either. Giving up." >&4
7429 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7430 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7432 *) if $test -f /lib/syscalls.exp; then
7434 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7435 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7441 $rm -f libnames libpath
7443 : see if dld is available
7447 : is a C symbol defined?
7450 -v) tf=libc.tmp; tdc="";;
7451 -a) tf=libc.tmp; tdc="[]";;
7452 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7455 case "$reuseval-$4" in
7457 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7462 if $test "$runnm" = true; then
7463 if $contains $tlook $tf >/dev/null 2>&1; then
7465 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7466 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7467 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7468 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7469 $rm -f try$_exe try.c core core.* try.core;
7472 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7473 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7474 $rm -f try$_exe try.c;
7479 $define) tval=true;;
7486 : define an is-in-libc? function
7487 inlibc='echo " "; td=$define; tu=$undef;
7488 sym=$1; var=$2; eval "was=\$$2";
7490 case "$reuseval$was" in
7500 echo "$sym() found." >&4;
7501 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7503 echo "$sym() NOT found." >&4;
7504 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7508 $define) echo "$sym() found." >&4;;
7509 *) echo "$sym() NOT found." >&4;;
7513 : see if dlopen exists
7520 : determine which dynamic loading, if any, to compile in
7522 dldir="ext/DynaLoader"
7535 $define) dflt='y' ;;
7538 $define) dflt='y' ;;
7540 : Does a dl_xxx.xs file exist for this operating system
7541 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7544 rp="Do you wish to use dynamic loading?"
7551 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7552 dflt="$dldir/dl_${osname}.xs"
7553 elif $test "$d_dlopen" = "$define" ; then
7554 dflt="$dldir/dl_dlopen.xs"
7555 elif $test "$i_dld" = "$define" ; then
7556 dflt="$dldir/dl_dld.xs"
7561 *) dflt="$dldir/$dlsrc"
7564 echo "The following dynamic loading files are available:"
7565 : Can not go over to $dldir because getfile has path hard-coded in.
7566 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7567 rp="Source file to use for dynamic loading"
7573 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7577 Some systems may require passing special flags to $cc -c to
7578 compile modules that will be used to create a shared library.
7579 To use no flags, say "none".
7582 case "$cccdlflags" in
7583 '') case "$gccversion" in
7584 '') case "$osname" in
7586 next) dflt='none' ;;
7587 irix*) dflt='-KPIC' ;;
7588 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7589 sunos) dflt='-pic' ;;
7593 *) case "$osname" in
7594 darwin) dflt='none' ;;
7595 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7600 *) dflt="$cccdlflags" ;;
7602 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7605 none) cccdlflags=' ' ;;
7606 *) cccdlflags="$ans" ;;
7611 Some systems use ld to create libraries that can be dynamically loaded,
7612 while other systems (such as those using ELF) use $cc.
7616 '') $cat >try.c <<EOM
7617 /* Test for whether ELF binaries are produced */
7625 int i = open("a.out",O_RDONLY);
7628 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7629 exit(0); /* succeed (yes, it's ELF) */
7634 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7636 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7640 echo "I'll use ld to build dynamic libraries."
7649 rp="What command should be used to create dynamic libraries?"
7655 Some systems may require passing special flags to $ld to create a
7656 library that can be dynamically loaded. If your ld flags include
7657 -L/other/path options to locate libraries outside your loader's normal
7658 search path, you may need to specify those -L options here as well. To
7659 use no flags, say "none".
7662 case "$lddlflags" in
7663 '') case "$osname" in
7664 beos) dflt='-nostart' ;;
7666 case "$gccversion" in
7667 '') dflt="$dflt +vnocompatwarnings" ;;
7670 linux|irix*|gnu*) dflt='-shared' ;;
7671 next) dflt='none' ;;
7672 solaris) dflt='-G' ;;
7673 sunos) dflt='-assert nodefinitions' ;;
7674 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7678 *) dflt="$lddlflags" ;;
7681 : Try to guess additional flags to pick up local libraries.
7682 : Be careful not to append to a plain 'none'
7686 for thisflag in $ldflags; do
7691 *) dflt="$dflt $thisflag" ;;
7698 ''|' ') dflt='none' ;;
7701 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7704 none) lddlflags=' ' ;;
7705 *) lddlflags="$ans" ;;
7710 Some systems may require passing special flags to $cc to indicate that
7711 the resulting executable will use dynamic linking. To use no flags,
7715 case "$ccdlflags" in
7716 '') case "$osname" in
7717 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7718 next|sunos) dflt='none' ;;
7722 *) dflt="$ccdlflags" ;;
7724 rp="Any special flags to pass to $cc to use dynamic linking?"
7727 none) ccdlflags=' ' ;;
7728 *) ccdlflags="$ans" ;;
7742 # No dynamic loading being used, so don't bother even to prompt.
7745 *) case "$useshrplib" in
7746 '') case "$osname" in
7747 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7749 also='Building a shared libperl is required for dynamic loading to work on your system.'
7754 also='Building a shared libperl is needed for MAB support.'
7772 The perl executable is normally obtained by linking perlmain.c with
7773 libperl${_a}, any static extensions (usually just DynaLoader), and
7774 any other libraries needed on this system (such as -lm, etc.). Since
7775 your system supports dynamic loading, it is probably possible to build
7776 a shared libperl.$so. If you will have more than one executable linked
7777 to libperl.$so, this will significantly reduce the size of each
7778 executable, but it may have a noticeable effect on performance. The
7779 default is probably sensible for your system.
7783 rp="Build a shared libperl.$so (y/n)"
7787 useshrplib='true' ;;
7788 *) useshrplib='false' ;;
7793 case "$useshrplib" in
7797 # Figure out a good name for libperl.so. Since it gets stored in
7798 # a version-specific architecture-dependent library, the version
7799 # number isn't really that important, except for making cc/ld happy.
7801 # A name such as libperl.so.3.1
7802 majmin="libperl.$so.$patchlevel.$subversion"
7803 # A name such as libperl.so.301
7804 majonly=`echo $patchlevel $subversion |
7805 $awk '{printf "%d%02d", $1, $2}'`
7806 majonly=libperl.$so.$majonly
7807 # I'd prefer to keep the os-specific stuff here to a minimum, and
7808 # rely on figuring it out from the naming of libc.
7809 case "${osname}${osvers}" in
7812 # XXX How handle the --version stuff for MAB?
7814 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
7817 cygwin*) # ld links against an importlib
7818 dflt=libperl$lib_ext
7820 *) # Try to guess based on whether libc has major.minor.
7822 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7823 *libc.$so.[0-9]*) dflt=$majonly ;;
7824 *) dflt=libperl.$so ;;
7834 I need to select a good name for the shared libperl. If your system uses
7835 library names with major and minor numbers, then you might want something
7836 like $majmin. Alternatively, if your system uses a single version
7837 number for shared libraries, then you might want to use $majonly.
7838 Or, your system might be quite happy with a simple libperl.$so.
7840 Since the shared libperl will get installed into a version-specific
7841 architecture-dependent directory, the version number of the shared perl
7842 library probably isn't important, so the default should be o.k.
7845 rp='What name do you want to give to the shared libperl?'
7848 echo "Ok, I'll use $libperl"
7851 libperl="libperl${_a}"
7855 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7859 WARNING: Use of the shrpdir variable for the installation location of
7860 the shared $libperl is not supported. It was never documented and
7861 will not work in this version. Let me (perlbug@perl.org)
7862 know of any problems this may cause.
7868 But your current setting of $shrpdir is
7869 the default anyway, so it's harmless.
7874 Further, your current attempted setting of $shrpdir
7875 conflicts with the value of $archlibexp/CORE
7876 that installperl will use.
7883 # How will the perl executable find the installed shared $libperl?
7884 # Add $xxx to ccdlflags.
7885 # If we can't figure out a command-line option, use $shrpenv to
7886 # set env LD_RUN_PATH. The main perl makefile uses this.
7887 shrpdir=$archlibexp/CORE
7890 if "$useshrplib"; then
7893 # We'll set it in Makefile.SH...
7898 freebsd|netbsd|openbsd|interix|dragonfly)
7899 xxx="-Wl,-R$shrpdir"
7901 bsdos|linux|irix*|dec_osf|gnu*)
7902 xxx="-Wl,-rpath,$shrpdir"
7905 # next doesn't like the default...
7908 # beos doesn't like the default, either.
7911 # hpux doesn't like the default, either.
7912 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7915 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7921 # Only add $xxx if it isn't already in ccdlflags.
7922 case " $ccdlflags " in
7924 *) ccdlflags="$ccdlflags $xxx"
7927 Adding $xxx to the flags
7928 passed to $ld so that the perl executable will find the
7929 installed shared $libperl.
7937 # Fix ccdlflags in AIX for building external extensions.
7938 # (For building Perl itself bare -bE:perl.exp is needed,
7939 # Makefile.SH takes care of this.)
7941 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7943 # Respect a hint or command-line value.
7945 '') shrpenv="$tmp_shrpenv" ;;
7947 case "$ldlibpthname" in
7948 '') ldlibpthname=LD_LIBRARY_PATH ;;
7949 none) ldlibpthname='' ;;
7952 : determine where manual pages are on this system
7956 syspath='/usr/share/man/man1 /usr/man/man1'
7957 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
7958 syspath="$syspath /usr/man/u_man/man1"
7959 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7960 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7961 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7962 sysman=`./loc . /usr/man/man1 $syspath`
7965 if $test -d "$sysman"; then
7966 echo "System manual is in $sysman." >&4
7968 echo "Could not find manual pages in source form." >&4
7971 : determine where manual pages go
7972 set man1dir man1dir none
7976 $spackage has manual pages available in source form.
7980 echo "However, you don't have nroff, so they're probably useless to you."
7982 '') man1dir="none";;
7985 echo "If you don't want the manual sources installed, answer 'none'."
7990 lookpath="$prefixexp/share/man/man1"
7991 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
7992 lookpath="$lookpath $prefixexp/man/p_man/man1"
7993 lookpath="$lookpath $prefixexp/man/u_man/man1"
7994 lookpath="$lookpath $prefixexp/man/man.1"
7996 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
7997 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8007 rp="Where do the main $spackage manual pages (source) go?"
8009 if $test "X$man1direxp" != "X$ansexp"; then
8013 man1direxp="$ansexp"
8019 : Change installation prefix, if necessary.
8020 if $test X"$prefix" != X"$installprefix"; then
8021 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
8023 installman1dir="$man1direxp"
8026 : What suffix to use on installed man pages
8033 rp="What suffix should be used for the main $spackage man pages?"
8035 '') case "$man1dir" in
8049 *) dflt="$man1ext";;
8056 : see if we can have long filenames
8058 first=123456789abcdef
8060 if (echo hi >$first) 2>/dev/null; then
8061 if $test -f 123456789abcde; then
8062 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8065 echo 'You can have filenames longer than 14 characters.'>&4
8070 You can't have filenames longer than 14 chars.
8071 You can't even think about them!
8077 $rm -rf 123456789abcde*
8079 : determine where library module manual pages go
8080 set man3dir man3dir none
8084 $spackage has manual pages for many of the library modules.
8090 However, you don't have nroff, so they're probably useless to you.
8093 '') man3dir="none";;
8097 case "$d_flexfnam" in
8100 However, your system can't handle the long file names like File::Basename.3.
8103 '') man3dir="none";;
8107 echo "If you don't want the manual sources installed, answer 'none'."
8108 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8110 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8111 if $test -d "$privlib/man/man3"; then
8114 WARNING: Previous versions of perl installed man3 pages into
8115 $privlib/man/man3. This version will suggest a
8116 new default of $dflt.
8120 rp='Do you wish to preserve the old behavior?(y/n)'
8123 y*) dflt="$privlib/man/man3" ;;
8128 *) dflt="$man3dir" ;;
8135 rp="Where do the $package library man pages (source) go?"
8138 man3direxp="$ansexp"
8144 : Change installation prefix, if necessary.
8145 if $test X"$prefix" != X"$installprefix"; then
8146 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
8148 installman3dir="$man3direxp"
8151 : What suffix to use on installed man pages
8157 rp="What suffix should be used for the $package library man pages?"
8159 '') case "$man3dir" in
8173 *) dflt="$man3ext";;
8180 : see if we have to deal with yellow pages, now NIS.
8181 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8182 if $test -f /usr/etc/nibindd; then
8184 echo "I'm fairly confident you're on a NeXT."
8186 rp='Do you get the hosts file via NetInfo?'
8195 y*) hostcat='nidump hosts .';;
8196 *) case "$hostcat" in
8197 nidump*) hostcat='';;
8207 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8215 rp='Are you getting the hosts file via yellow pages?'
8218 y*) hostcat='ypcat hosts';;
8219 *) hostcat='cat /etc/hosts';;
8225 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8228 '') test -f /etc/group && groupcat='cat /etc/group';;
8231 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8234 : now get the host name
8236 echo "Figuring out host name..." >&4
8237 case "$myhostname" in
8239 echo 'Maybe "hostname" will work...'
8240 if tans=`sh -c hostname 2>&1` ; then
8248 if $test "$cont"; then
8250 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8251 if tans=`cat /etc/systemid 2>&1` ; then
8253 phostname='cat /etc/systemid'
8254 echo "Whadyaknow. Xenix always was a bit strange..."
8257 elif $test -r /etc/systemid; then
8258 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8261 if $test "$cont"; then
8262 echo 'No, maybe "uuname -l" will work...'
8263 if tans=`sh -c 'uuname -l' 2>&1` ; then
8265 phostname='uuname -l'
8267 echo 'Strange. Maybe "uname -n" will work...'
8268 if tans=`sh -c 'uname -n' 2>&1` ; then
8270 phostname='uname -n'
8272 echo 'Oh well, maybe I can mine it out of whoami.h...'
8273 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8274 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8275 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8277 case "$myhostname" in
8278 '') echo "Does this machine have an identity crisis or something?"
8281 echo "Well, you said $myhostname before..."
8282 phostname='echo $myhostname';;
8288 case "$myhostname" in
8289 '') myhostname=noname ;;
8291 : you do not want to know about this
8296 if $test "$myhostname" ; then
8298 rp='Your host name appears to be "'$myhostname'".'" Right?"
8306 : bad guess or no guess
8307 while $test "X$myhostname" = X ; do
8309 rp="Please type the (one word) name of your host:"
8314 : translate upper to lower if necessary
8315 case "$myhostname" in
8317 echo "(Normalizing case in your host name)"
8318 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8322 case "$myhostname" in
8324 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8325 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8326 echo "(Trimming domain name from host name--host name is now $myhostname)"
8328 *) case "$mydomain" in
8331 test "X$hostcat" = "Xypcat hosts" &&
8332 ypmatch "$myhostname" hosts 2>/dev/null |\
8333 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8336 test "X$hostcat" != "X" &&
8337 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8338 /[ ]$myhostname[ . ]/p" > hosts
8341 if $test -f hosts; then
8342 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8343 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8344 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8345 hosts | $sort | $uniq | \
8346 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8347 case `$echo X$dflt` in
8348 X*\ *) echo "(Several hosts in the database matched hostname)"
8351 X.) echo "(You do not have fully-qualified names in the hosts database)"
8355 echo "(I cannot locate a hosts database anywhere)"
8360 tans=`./loc resolv.conf X /etc /usr/etc`
8361 if $test -f "$tans"; then
8362 echo "(Attempting domain name extraction from $tans)"
8363 dflt=.`$sed -n -e 's/ / /g' \
8364 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8365 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8367 .) dflt=.`$sed -n -e 's/ / /g' \
8368 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8369 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8376 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8377 dflt=.`sh -c domainname 2>/dev/null`
8380 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8384 case "$dflt$osname" in
8385 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8386 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8390 .) echo "(Lost all hope -- silly guess then)"
8396 *) dflt="$mydomain";;
8400 rp="What is your domain name?"
8410 : translate upper to lower if necessary
8413 echo "(Normalizing case in your domain name)"
8414 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8418 : a little sanity check here
8419 case "$phostname" in
8422 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8423 $myhostname$mydomain|$myhostname) ;;
8425 case "$phostname" in
8427 echo "(That doesn't agree with your whoami.h file, by the way.)"
8430 echo "(That doesn't agree with your $phostname command, by the way.)"
8440 I need to get your e-mail address in Internet format if possible, i.e.
8441 something like user@host.domain. Please answer accurately since I have
8442 no easy means to double check it. The default value provided below
8443 is most probably close to reality but may not be valid from outside
8444 your organization...
8448 while test "$cont"; do
8450 '') dflt="$cf_by@$myhostname$mydomain";;
8451 *) dflt="$cf_email";;
8453 rp='What is your e-mail address?'
8459 rp='Address does not look like an Internet one. Use it anyway?'
8475 If you or somebody else will be maintaining perl at your site, please
8476 fill in the correct e-mail address here so that they may be contacted
8477 if necessary. Currently, the "perlbug" program included with perl
8478 will send mail to this address in addition to perlbug@perl.org. You may
8479 enter "none" for no administrator.
8482 case "$perladmin" in
8483 '') dflt="$cf_email";;
8484 *) dflt="$perladmin";;
8486 rp='Perl administrator e-mail address'
8490 : determine whether to only install version-specific parts.
8493 Do you want to install only the version-specific parts of the perl
8494 distribution? Usually you do *not* want to do this.
8496 case "$versiononly" in
8497 "$define"|[Yy]*|true) dflt='y' ;;
8500 rp="Do you want to install only the version-specific parts of perl?"
8503 [yY]*) val="$define";;
8509 case "$versiononly" in
8510 "$define") inc_version_list=''
8511 inc_version_list_init=0
8515 : figure out how to guarantee perl startup
8516 case "$startperl" in
8518 case "$sharpbang" in
8522 I can use the #! construct to start perl on your system. This will
8523 make startup of perl scripts faster, but may cause problems if you
8524 want to share those scripts and perl is not in a standard place
8525 ($binexp/perl) on all your platforms. The alternative is to force
8526 a shell by starting the script with a single ':' character.
8529 case "$versiononly" in
8530 "$define") dflt="$binexp/perl$version";;
8531 *) dflt="$binexp/perl";;
8533 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8536 none) startperl=": # use perl";;
8537 *) startperl="#!$ans"
8538 if $test 30 -lt `echo "$ans" | wc -c`; then
8541 WARNING: Some systems limit the #! command to 32 characters.
8542 If you experience difficulty running Perl scripts with #!, try
8543 installing Perl in a directory with a shorter pathname.
8549 *) startperl=": # use perl"
8554 echo "I'll use $startperl to start perl scripts."
8556 : figure best path for perl in scripts
8559 case "$versiononly" in
8560 "$define") perlpath="$binexp/perl$version";;
8561 *) perlpath="$binexp/perl";;
8563 case "$startperl" in
8568 I will use the "eval 'exec'" idiom to start Perl on your system.
8569 I can use the full path of your Perl binary for this purpose, but
8570 doing so may cause problems if you want to share those scripts and
8571 Perl is not always in a standard place ($binexp/perl).
8575 rp="What path shall I use in \"eval 'exec'\"?"
8582 case "$startperl" in
8584 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8587 : determine where public executable scripts go
8588 set scriptdir scriptdir
8590 case "$scriptdir" in
8593 : guess some guesses
8594 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8595 $test -d /usr/share/bin && dflt=/usr/share/bin
8596 $test -d /usr/local/script && dflt=/usr/local/script
8597 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8598 $test -d $prefixexp/script && dflt=$prefixexp/script
8602 *) dflt="$scriptdir"
8607 Some installations have a separate directory just for executable scripts so
8608 that they can mount it across multiple architectures but keep the scripts in
8609 one spot. You might, for example, have a subdirectory of /usr/share for this.
8610 Or you might just lump your scripts in with all your other executables.
8614 rp='Where do you keep publicly executable scripts?'
8616 if $test "X$ansexp" != "X$scriptdirexp"; then
8620 scriptdirexp="$ansexp"
8621 : Change installation prefix, if necessary.
8622 if $test X"$prefix" != X"$installprefix"; then
8623 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
8625 installscript="$scriptdirexp"
8628 : determine where add-on public executables go
8630 '') dflt=$siteprefix/bin ;;
8634 rp='Pathname where the add-on public executables should be installed?'
8637 sitebinexp="$ansexp"
8638 : Change installation prefix, if necessary.
8639 if $test X"$prefix" != X"$installprefix"; then
8640 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
8642 installsitebin="$sitebinexp"
8645 : determine where add-on html pages go
8646 : There is no standard location, so try to copy the previously-selected
8647 : directory structure for the core html pages.
8648 case "$sitehtml1dir" in
8649 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8650 *) dflt=$sitehtml1dir ;;
8653 ''|' ') dflt=none ;;
8656 rp='Pathname where the site-specific html pages should be installed?'
8659 sitehtml1direxp="$ansexp"
8660 : Change installation prefix, if necessary.
8661 if $test X"$prefix" != X"$installprefix"; then
8662 installsitehtml1dir=`echo $sitehtml1direxp | $sed "s#^$prefix#$installprefix#"`
8664 installsitehtml1dir="$sitehtml1direxp"
8667 : determine where add-on library html pages go
8668 : There is no standard location, so try to copy the previously-selected
8669 : directory structure for the core html pages.
8670 case "$sitehtml3dir" in
8671 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8672 *) dflt=$sitehtml3dir ;;
8675 ''|' ') dflt=none ;;
8678 rp='Pathname where the site-specific library html pages should be installed?'
8681 sitehtml3direxp="$ansexp"
8682 : Change installation prefix, if necessary.
8683 if $test X"$prefix" != X"$installprefix"; then
8684 installsitehtml3dir=`echo $sitehtml3direxp | $sed "s#^$prefix#$installprefix#"`
8686 installsitehtml3dir="$sitehtml3direxp"
8689 : determine where add-on manual pages go
8690 case "$siteman1dir" in
8691 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8692 *) dflt=$siteman1dir ;;
8695 ''|' ') dflt=none ;;
8698 rp='Pathname where the site-specific manual pages should be installed?'
8701 siteman1direxp="$ansexp"
8702 : Change installation prefix, if necessary.
8703 if $test X"$prefix" != X"$installprefix"; then
8704 installsiteman1dir=`echo $siteman1direxp | $sed "s#^$prefix#$installprefix#"`
8706 installsiteman1dir="$siteman1direxp"
8709 : determine where add-on library man pages go
8710 case "$siteman3dir" in
8711 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8712 *) dflt=$siteman3dir ;;
8715 ''|' ') dflt=none ;;
8718 rp='Pathname where the site-specific library manual pages should be installed?'
8721 siteman3direxp="$ansexp"
8722 : Change installation prefix, if necessary.
8723 if $test X"$prefix" != X"$installprefix"; then
8724 installsiteman3dir=`echo $siteman3direxp | $sed "s#^$prefix#$installprefix#"`
8726 installsiteman3dir="$siteman3direxp"
8729 : determine where add-on public executable scripts go
8730 case "$sitescript" in
8731 '') dflt=$siteprefix/script
8732 $test -d $dflt || dflt=$sitebin ;;
8733 *) dflt="$sitescript" ;;
8736 rp='Pathname where add-on public executable scripts should be installed?'
8739 sitescriptexp="$ansexp"
8740 : Change installation prefix, if necessary.
8741 if $test X"$prefix" != X"$installprefix"; then
8742 installsitescript=`echo $sitescriptexp | sed "s#^$prefix#$installprefix#"`
8744 installsitescript="$sitescriptexp"
8747 case "$usefaststdio" in
8748 $define|true|[yY]*|'')
8749 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8759 Perl can be built to use 'fast stdio', which means using the stdio
8760 library but also directly manipulating the stdio buffers to enable
8761 faster I/O. Using stdio is better for backward compatibility (especially
8762 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8763 interface has been preferred instead of stdio.
8765 If this doesn't make any sense to you, just accept the default '$dflt'.
8767 rp='Use the "fast stdio" if available?'
8770 y|Y) val="$define" ;;
8777 : define an is-a-typedef? function
8778 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8780 "") inclist="sys/types.h";;
8782 eval "varval=\$$var";
8786 for inc in $inclist; do
8787 echo "#include <$inc>" >>temp.c;
8789 echo "#ifdef $type" >> temp.c;
8790 echo "printf(\"We have $type\");" >> temp.c;
8791 echo "#endif" >> temp.c;
8792 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8793 if $contains $type temp.E >/dev/null 2>&1; then
8799 *) eval "$var=\$varval";;
8802 : define an is-a-typedef? function that prompts if the type is not available.
8803 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8805 "") inclist="sys/types.h";;
8807 eval "varval=\$$var";
8811 for inc in $inclist; do
8812 echo "#include <$inc>" >>temp.c;
8814 echo "#ifdef $type" >> temp.c;
8815 echo "printf(\"We have $type\");" >> temp.c;
8816 echo "#endif" >> temp.c;
8817 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8819 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8820 if $contains $type temp.E >/dev/null 2>&1; then
8821 echo "$type found." >&4;
8824 echo "$type NOT found." >&4;
8830 *) eval "$var=\$varval";;
8833 : see what type lseek is declared as in the kernel
8834 rp="What is the type used for lseek's offset on this system?"
8835 set off_t lseektype long stdio.h sys/types.h
8839 echo "Checking to see how big your file offsets are..." >&4
8841 #include <sys/types.h>
8845 printf("%d\n", (int)sizeof($lseektype));
8850 if eval $compile_ok; then
8851 lseeksize=`$run ./try`
8852 echo "Your file offsets are $lseeksize bytes long."
8856 echo "(I can't seem to compile the test program. Guessing...)"
8857 rp="What is the size of your file offsets (in bytes)?"
8863 : see what type file positions are declared as in the library
8864 rp="What is the type for file position used by fsetpos()?"
8865 set fpos_t fpostype long stdio.h sys/types.h
8870 *_t) zzz="$fpostype" ;;
8873 echo "Checking the size of $zzz..." >&4
8875 #include <sys/types.h>
8882 printf("%d\n", (int)sizeof($fpostype));
8887 if eval $compile_ok; then
8891 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8894 echo "Your $zzz is $fpossize bytes long."
8900 echo "(I can't compile the test program. Guessing...)" >&4
8901 rp="What is the size of your file positions (in bytes)?"
8906 # Backward compatibility (uselfs is deprecated).
8908 "$define"|true|[yY]*)
8911 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8913 uselargefiles="$define"
8917 case "$lseeksize:$fpossize" in
8920 You can have files larger than 2 gigabytes.
8923 *) case "$uselargefiles" in
8924 "$undef"|false|[nN]*) dflt='n' ;;
8929 Perl can be built to understand large files (files larger than 2 gigabytes)
8930 on some systems. To do so, Configure can be run with -Duselargefiles.
8932 If this doesn't make any sense to you, just accept the default '$dflt'.
8934 rp='Try to understand large files, if available?'
8937 y|Y) val="$define" ;;
8944 : Look for a hint-file generated 'call-back-unit'. If the
8945 : user has specified that a large files perl is to be built,
8946 : we may need to set or change some other defaults.
8947 if $test -f uselargefiles.cbu; then
8948 echo "Your platform has some specific hints regarding large file builds, using them..."
8949 . ./uselargefiles.cbu
8951 case "$uselargefiles" in
8953 if $test -f uselargefiles.cbu; then
8955 echo "Rechecking to see how big your file offsets are..." >&4
8957 #include <sys/types.h>
8961 printf("%d\n", (int)sizeof($lseektype));
8966 if eval $compile_ok; then
8967 lseeksize=`$run ./try`
8968 $echo "Your file offsets are now $lseeksize bytes long."
8972 echo "(I can't seem to compile the test program. Guessing...)"
8973 rp="What is the size of your file offsets (in bytes)?"
8978 *_t) zzz="$fpostype" ;;
8981 $echo $n "Rechecking the size of $zzz...$c" >&4
8983 #include <sys/types.h>
8990 printf("%d\n", (int)sizeof($fpostype));
8995 if eval $compile_ok; then
9000 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9003 echo " $fpossize bytes." >&4
9009 echo "(I can't compile the test program. Guessing...)" >&4
9010 rp="What is the size of your file positions (in bytes)?"
9019 # probably will refer to
9020 # $archlib $privlib $sitearch $sitelib $vendorarch $vendorlib
9022 userelocatableinc=undef
9024 case "$vendorprefix" in
9025 '') d_vendorbin="$undef"
9029 *) d_vendorbin="$define"
9030 : determine where vendor-supplied executables go.
9031 case "$vendorbin" in
9032 '') dflt=$vendorprefix/bin ;;
9033 *) dflt="$vendorbin" ;;
9036 rp='Pathname for the vendor-supplied executables directory?'
9039 vendorbinexp="$ansexp"
9042 : Change installation prefix, if necessary.
9043 if $test X"$prefix" != X"$installprefix"; then
9044 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
9046 installvendorbin="$vendorbinexp"
9049 case "$vendorprefix" in
9050 '') vendorhtml1dir=''
9051 vendorhtml1direxp=''
9053 *) : determine where vendor-supplied html pages go.
9054 : There is no standard location, so try to copy the previously-selected
9055 : directory structure for the core html pages.
9056 : XXX Better default suggestions would be welcome.
9057 case "$vendorhtml1dir" in
9058 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9059 *) dflt=$vendorhtml1dir ;;
9062 ''|' ') dflt=none ;;
9065 rp='Pathname for the vendor-supplied html pages?'
9067 vendorhtml1dir="$ans"
9068 vendorhtml1direxp="$ansexp"
9071 : Use ' ' for none so value is preserved next time through Configure
9072 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9073 : Change installation prefix, if necessary.
9074 if $test X"$prefix" != X"$installprefix"; then
9075 installvendorhtml1dir=`echo $vendorhtml1direxp | $sed "s#^$prefix#$installprefix#"`
9077 installvendorhtml1dir="$vendorhtml1direxp"
9080 case "$vendorprefix" in
9081 '') vendorhtml3dir=''
9082 vendorhtml3direxp=''
9084 *) : determine where vendor-supplied module html pages go.
9085 : There is no standard location, so try to copy the previously-selected
9086 : directory structure for the core html pages.
9087 : XXX Better default suggestions would be welcome.
9088 case "$vendorhtml3dir" in
9089 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9090 *) dflt=$vendorhtml3dir ;;
9093 ''|' ') dflt=none ;;
9096 rp='Pathname for the vendor-supplied html pages?'
9098 vendorhtml3dir="$ans"
9099 vendorhtml3direxp="$ansexp"
9102 : Use ' ' for none so value is preserved next time through Configure
9103 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9104 : Change installation prefix, if necessary.
9105 if $test X"$prefix" != X"$installprefix"; then
9106 installvendorhtml3dir=`echo $vendorhtml3direxp | $sed "s#^$prefix#$installprefix#"`
9108 installvendorhtml3dir="$vendorhtml3direxp"
9111 case "$vendorprefix" in
9112 '') vendorman1dir=''
9115 *) : determine where vendor-supplied manual pages go.
9116 case "$vendorman1dir" in
9117 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9118 *) dflt=$vendorman1dir ;;
9121 ''|' ') dflt=none ;;
9124 rp='Pathname for the vendor-supplied manual section 1 pages?'
9126 vendorman1dir="$ans"
9127 vendorman1direxp="$ansexp"
9130 : Use ' ' for none so value is preserved next time through Configure
9131 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9132 : Change installation prefix, if necessary.
9133 if $test X"$prefix" != X"$installprefix"; then
9134 installvendorman1dir=`echo "$vendorman1direxp" | $sed "s#^$prefix#$installprefix#"`
9136 installvendorman1dir="$vendorman1direxp"
9139 case "$vendorprefix" in
9140 '') vendorman3dir=''
9143 *) : determine where vendor-supplied module manual pages go.
9144 case "$vendorman3dir" in
9145 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9146 *) dflt=$vendorman3dir ;;
9149 ''|' ') dflt=none ;;
9152 rp='Pathname for the vendor-supplied manual section 3 pages?'
9154 vendorman3dir="$ans"
9155 vendorman3direxp="$ansexp"
9158 : Use ' ' for none so value is preserved next time through Configure
9159 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9160 : Change installation prefix, if necessary.
9161 if $test X"$prefix" != X"$installprefix"; then
9162 installvendorman3dir=`echo "$vendorman3direxp" | $sed "s#^$prefix#$installprefix#"`
9164 installvendorman3dir="$vendorman3direxp"
9167 case "$vendorprefix" in
9168 '') d_vendorscript="$undef"
9172 *) d_vendorscript="$define"
9173 : determine where vendor-supplied scripts go.
9174 case "$vendorscript" in
9175 '') dflt=$vendorprefix/script
9176 $test -d $dflt || dflt=$vendorbin ;;
9177 *) dflt="$vendorscript" ;;
9181 The installation process will create a directory for
9182 vendor-supplied scripts.
9186 rp='Pathname for the vendor-supplied scripts directory?'
9189 vendorscriptexp="$ansexp"
9192 : Change installation prefix, if necessary.
9193 if $test X"$prefix" != X"$installprefix"; then
9194 installvendorscript=`echo $vendorscriptexp | $sed "s#^$prefix#$installprefix#"`
9196 installvendorscript="$vendorscriptexp"
9199 : see if qgcvt exists
9205 if $test X"$d_longdbl" = X"$define"; then
9207 echo "Checking how to print long doubles..." >&4
9209 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9210 $cat >try.c <<'EOCP'
9211 #include <sys/types.h>
9215 printf("%.3f\n", d);
9219 if eval $compile; then
9223 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9224 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9225 echo "We will use %f."
9231 if $test X"$sPRIfldbl" = X; then
9232 $cat >try.c <<'EOCP'
9233 #include <sys/types.h>
9236 long double d = 123.456;
9237 printf("%.3Lf\n", d);
9241 if eval $compile; then
9245 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9246 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9247 echo "We will use %Lf."
9253 if $test X"$sPRIfldbl" = X; then
9254 $cat >try.c <<'EOCP'
9255 #include <sys/types.h>
9258 long double d = 123.456;
9259 printf("%.3llf\n", d);
9263 if eval $compile; then
9267 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9268 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9269 echo "We will use %llf."
9275 if $test X"$sPRIfldbl" = X; then
9276 $cat >try.c <<'EOCP'
9277 #include <sys/types.h>
9280 long double d = 123.456;
9281 printf("%.3lf\n", d);
9285 if eval $compile; then
9289 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9290 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9291 echo "We will use %lf."
9297 if $test X"$sPRIfldbl" = X; then
9298 echo "Cannot figure out how to print long doubles." >&4
9300 sSCNfldbl=$sPRIfldbl # expect consistency
9307 case "$sPRIfldbl" in
9308 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9309 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9310 d_SCNfldbl="$undef";
9312 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9313 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9314 d_SCNfldbl="$define";
9318 : Check how to convert floats to strings.
9320 if test "X$d_Gconvert" = X; then
9323 echo "Checking for an efficient way to convert floats to strings."
9325 case "$uselongdouble" in
9326 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9328 case "$d_longdbl" in
9329 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9331 case "$d_PRIgldbl" in
9332 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9336 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9337 char *myname = "gconvert";
9340 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9341 char *myname = "gcvt";
9344 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9345 char *myname = "qgcvt";
9346 #define DOUBLETYPE long double
9349 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9351 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9353 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9356 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9358 char *myname = "sprintf";
9362 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9363 #define DOUBLETYPE long double
9365 #define DOUBLETYPE double
9371 #define I_STDLIB $i_stdlib
9377 checkit(expect, got)
9381 if (strcmp(expect, got)) {
9382 printf("%s oddity: Expected %s, got %s\n",
9383 myname, expect, got);
9393 /* This must be 1st test on (which?) platform */
9394 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9395 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9396 checkit("0.1", buf);
9398 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9399 checkit("0.01", buf);
9401 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9402 checkit("0.001", buf);
9404 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9405 checkit("0.0001", buf);
9407 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9408 if (strlen(buf) > 5)
9409 checkit("9e-005", buf); /* for Microsoft ?? */
9411 checkit("9e-05", buf);
9413 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9416 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9417 checkit("1.1", buf);
9419 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9420 checkit("1.01", buf);
9422 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9423 checkit("1.001", buf);
9425 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9426 checkit("1.0001", buf);
9428 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9429 checkit("1.00001", buf);
9431 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9432 checkit("1.000001", buf);
9434 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9437 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9440 /* Some Linux gcvt's give 1.e+5 here. */
9441 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9442 checkit("100000", buf);
9444 /* Some Linux gcvt's give -1.e+5 here. */
9445 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9446 checkit("-100000", buf);
9448 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9449 checkit("123.456", buf);
9451 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9452 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9453 /* 34 should be enough to scare even long double
9454 * places into using the e notation. */
9455 if (strlen(buf) > 5)
9456 checkit("1e+034", buf); /* for Microsoft */
9458 checkit("1e+34", buf);
9460 /* For Perl, if you add additional tests here, also add them to
9461 * t/base/num.t for benefit of platforms not using Configure or
9462 * overriding d_Gconvert */
9467 : first add preferred functions to our list
9469 for xxx_convert in $gconvert_preference; do
9470 case $xxx_convert in
9471 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9472 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9475 : then add any others
9476 for xxx_convert in gconvert gcvt sprintf; do
9479 *) xxx_list="$xxx_list $xxx_convert" ;;
9483 case "$d_longdbl$uselongdouble" in
9485 : again, add prefered functions to our list first
9487 for xxx_convert in $gconvert_ld_preference; do
9488 case $xxx_convert in
9489 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9490 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9493 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9494 for xxx_convert in qgcvt sprintf $xxx_list; do
9495 case "$xxx_ld_list" in
9496 $xxx_convert*|*" $xxx_convert"*) ;;
9497 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9500 : if sprintf cannot do long doubles, move it to the end
9501 if test "$d_PRIgldbl" != "$define"; then
9502 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9504 : if no qgcvt, remove it
9505 if test "$d_qgcvt" != "$define"; then
9506 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9509 xxx_list="$xxx_ld_list"
9513 for xxx_convert in $xxx_list; do
9514 echo "Trying $xxx_convert..."
9516 set try -DTRY_$xxx_convert
9517 if eval $compile; then
9518 echo "$xxx_convert() found." >&4
9520 echo "I'll use $xxx_convert to convert floats into a string." >&4
9523 echo "...But $xxx_convert didn't work as I expected."
9527 echo "$xxx_convert NOT found." >&4
9531 if test X$xxx_convert = X; then
9532 echo "*** WHOA THERE!!! ***" >&4
9533 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9537 case "$xxx_convert" in
9538 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9539 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9540 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9541 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9542 "$define$define$define")
9543 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9544 "$define$define$undef")
9545 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9546 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9553 : see if _fwalk exists
9557 : Initialize h_fcntl
9560 : Initialize h_sysfile
9563 : access call always available on UNIX
9567 : locate the flags for 'access()'
9571 $cat >access.c <<EOCP
9572 #include <sys/types.h>
9577 #include <sys/file.h>
9590 : check sys/file.h first, no particular reason here
9591 if $test `./findhdr sys/file.h` && \
9592 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9594 echo "<sys/file.h> defines the *_OK access constants." >&4
9595 elif $test `./findhdr fcntl.h` && \
9596 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9598 echo "<fcntl.h> defines the *_OK access constants." >&4
9599 elif $test `./findhdr unistd.h` && \
9600 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9601 echo "<unistd.h> defines the *_OK access constants." >&4
9603 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9609 : see if accessx exists
9610 set accessx d_accessx
9613 : see if aintl exists
9617 : see if alarm exists
9621 : see if POSIX threads are available
9622 set pthread.h i_pthread
9625 : define a fucntion to check prototypes
9626 $cat > protochk <<EOSH
9629 optimize="$optimize"
9631 prototype="$prototype"
9634 usethreads=$usethreads
9635 i_pthread=$i_pthread
9636 pthread_h_first=$pthread_h_first
9639 $cat >> protochk <<'EOSH'
9644 while test $# -ge 2; do
9646 $define) echo "#include <$2>" >> try.c ;;
9647 literal) echo "$2" >> try.c ;;
9649 # Extra magic for the benefit of systems that need pthread.h
9650 # to be included early to correctly detect threadsafe functions.
9651 # Such functions must guarantee themselves, though, that the usethreads
9652 # and i_pthread have been defined, before calling protochk.
9653 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9654 echo "#include <pthread.h>" >> try.c
9659 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9660 cat >> try.c <<'EOCP'
9661 #ifdef CAN_PROTOTYPE
9662 #define _(args) args
9667 echo "$foo" >> try.c
9668 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9669 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9677 hasproto='varname=$1; func=$2; shift; shift;
9678 while $test $# -ge 2; do
9680 $define) echo "#include <$2>";;
9684 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9685 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9686 echo "$func() prototype found.";
9689 echo "$func() prototype NOT found.";
9694 $rm -f try.c tryout.c'
9696 : see if sys/types.h has to be included
9697 set sys/types.h i_systypes
9700 : see if sys/select.h has to be included
9701 set sys/select.h i_sysselct
9704 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9705 while $test $# -ge 2; do
9707 $define) echo "#include <$2>";;
9711 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9713 if eval $compile; then
9722 : see if we should include time.h, sys/time.h, or both
9724 if test "X$timeincl" = X; then
9725 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9726 $echo $n "I'm now running the test program...$c"
9728 #include <sys/types.h>
9733 #ifdef SYSTIMEKERNEL
9736 #include <sys/time.h>
9739 #include <sys/select.h>
9752 struct timezone tzp;
9754 if (foo.tm_sec == foo.tm_sec)
9757 if (bar.tv_sec == bar.tv_sec)
9764 for s_timezone in '-DS_TIMEZONE' ''; do
9766 for s_timeval in '-DS_TIMEVAL' ''; do
9767 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9768 for i_time in '' '-DI_TIME'; do
9769 for i_systime in '-DI_SYSTIME' ''; do
9772 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9773 if eval $compile; then
9774 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9778 $echo $n "Succeeded with $flags$c"
9790 *SYSTIMEKERNEL*) i_systimek="$define"
9791 timeincl=`./findhdr sys/time.h`
9792 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9793 *) i_systimek="$undef";;
9796 *I_TIME*) i_time="$define"
9797 timeincl=`./findhdr time.h`" $timeincl"
9798 echo "We'll include <time.h>." >&4;;
9799 *) i_time="$undef";;
9802 *I_SYSTIME*) i_systime="$define"
9803 timeincl=`./findhdr sys/time.h`" $timeincl"
9804 echo "We'll include <sys/time.h>." >&4;;
9805 *) i_systime="$undef";;
9809 : see if struct tm knows about tm_zone
9810 case "$i_systime$i_time" in
9813 echo "Checking to see if your struct tm has tm_zone field..." >&4
9814 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9822 case "$d_tm_tm_zone" in
9823 "$define") echo "Yes, it does." ;;
9824 *) echo "No, it doesn't." ;;
9826 : see if struct tm knows about tm_gmtoff
9827 case "$i_systime$i_time" in
9830 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9831 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9839 case "$d_tm_tm_gmtoff" in
9840 "$define") echo "Yes, it does." ;;
9841 *) echo "No, it doesn't." ;;
9844 : see if asctime_r exists
9845 set asctime_r d_asctime_r
9847 case "$d_asctime_r" in
9849 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9850 case "$d_asctime_r_proto:$usethreads" in
9851 ":define") d_asctime_r_proto=define
9852 set d_asctime_r_proto asctime_r $hdrs
9856 case "$d_asctime_r_proto" in
9858 case "$asctime_r_proto" in
9859 ''|0) try='char* asctime_r(const struct tm*, char*);'
9860 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9862 case "$asctime_r_proto" in
9863 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9864 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9866 case "$asctime_r_proto" in
9867 ''|0) try='int asctime_r(const struct tm*, char*);'
9868 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9870 case "$asctime_r_proto" in
9871 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9872 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9874 case "$asctime_r_proto" in
9875 ''|0) d_asctime_r=undef
9877 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9878 * ) case "$asctime_r_proto" in
9879 REENTRANT_PROTO*) ;;
9880 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9882 echo "Prototype: $try" ;;
9885 *) case "$usethreads" in
9886 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9893 *) asctime_r_proto=0
9897 : see if atolf exists
9901 : see if atoll exists
9905 : Look for GCC-style attribute format
9906 case "$d_attribute_format" in
9909 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
9910 $cat >attrib.c <<'EOCP'
9912 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
9914 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9915 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9916 echo "Your C compiler doesn't support __attribute__((format))."
9919 echo "Your C compiler supports __attribute__((format))."
9923 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9927 *) val="$d_attribute_format" ;;
9929 set d_attribute_format
9933 : Look for GCC-style attribute malloc
9934 case "$d_attribute_malloc" in
9937 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
9938 $cat >attrib.c <<'EOCP'
9940 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
9942 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9943 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9944 echo "Your C compiler doesn't support __attribute__((malloc))."
9947 echo "Your C compiler supports __attribute__((malloc))."
9951 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9955 *) val="$d_attribute_malloc" ;;
9957 set d_attribute_malloc
9961 : Look for GCC-style attribute nonnull
9962 case "$d_attribute_nonnull" in
9965 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
9966 $cat >attrib.c <<'EOCP'
9968 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
9970 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9971 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9972 echo "Your C compiler doesn't support __attribute__((nonnull))."
9975 echo "Your C compiler supports __attribute__((nonnull))."
9979 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9983 *) val="$d_attribute_nonnull" ;;
9985 set d_attribute_nonnull
9989 : Look for GCC-style attribute noreturn
9990 case "$d_attribute_noreturn" in
9993 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
9994 $cat >attrib.c <<'EOCP'
9996 void fall_over_dead( void ) __attribute__((noreturn));
9998 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9999 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10000 echo "Your C compiler doesn't support __attribute__((noreturn))."
10003 echo "Your C compiler supports __attribute__((noreturn))."
10007 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10011 *) val="$d_attribute_noreturn" ;;
10013 set d_attribute_noreturn
10017 : Look for GCC-style attribute pure
10018 case "$d_attribute_pure" in
10021 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10022 $cat >attrib.c <<'EOCP'
10024 int square( int n ) __attribute__((pure));
10026 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10027 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10028 echo "Your C compiler doesn't support __attribute__((pure))."
10031 echo "Your C compiler supports __attribute__((pure))."
10035 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10039 *) val="$d_attribute_pure" ;;
10041 set d_attribute_pure
10045 : Look for GCC-style attribute unused
10046 case "$d_attribute_unused" in
10049 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10050 $cat >attrib.c <<'EOCP'
10052 int do_something( int dummy __attribute__((unused)), int n );
10054 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10055 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10056 echo "Your C compiler doesn't support __attribute__((unused))."
10059 echo "Your C compiler supports __attribute__((unused))."
10063 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10067 *) val="$d_attribute_unused" ;;
10069 set d_attribute_unused
10073 : Look for GCC-style attribute warn_unused_result
10074 case "$d_attribute_warn_unused_result" in
10077 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10078 $cat >attrib.c <<'EOCP'
10080 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10082 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10083 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10084 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10087 echo "Your C compiler supports __attribute__((warn_unused_result))."
10091 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10095 *) val="$d_attribute_warn_unused_result" ;;
10097 set d_attribute_warn_unused_result
10101 : see if bcmp exists
10105 : see if bcopy exists
10109 : see if this is a unistd.h system
10110 set unistd.h i_unistd
10113 : see if getpgrp exists
10114 set getpgrp d_getpgrp
10117 case "$d_getpgrp" in
10120 echo "Checking to see which flavor of getpgrp is in use..."
10122 #$i_unistd I_UNISTD
10123 #include <sys/types.h>
10125 # include <unistd.h>
10127 #$i_stdlib I_STDLIB
10129 #include <stdlib.h>
10133 if (getuid() == 0) {
10134 printf("(I see you are running Configure as super-user...)\n");
10137 #ifdef TRY_BSD_PGRP
10138 if (getpgrp(1) == 0)
10147 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10148 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10150 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10151 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10154 echo "I can't seem to compile and run the test program."
10156 xxx="a USG one, i.e. you use getpgrp()."
10158 # SVR4 systems can appear rather BSD-ish.
10159 case "$i_unistd" in
10161 xxx="a BSD one, i.e. you use getpgrp(pid)."
10165 xxx="probably a USG one, i.e. you use getpgrp()."
10170 echo "Assuming your getpgrp is $xxx" >&4
10179 : see if setpgrp exists
10180 set setpgrp d_setpgrp
10183 case "$d_setpgrp" in
10186 echo "Checking to see which flavor of setpgrp is in use..."
10188 #$i_unistd I_UNISTD
10189 #include <sys/types.h>
10191 # include <unistd.h>
10193 #$i_stdlib I_STDLIB
10195 #include <stdlib.h>
10199 if (getuid() == 0) {
10200 printf("(I see you are running Configure as super-user...)\n");
10203 #ifdef TRY_BSD_PGRP
10204 if (-1 == setpgrp(1, 1))
10207 if (setpgrp() != -1)
10213 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10214 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10216 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10217 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10220 echo "(I can't seem to compile and run the test program.)"
10222 xxx="a USG one, i.e. you use setpgrp()."
10224 # SVR4 systems can appear rather BSD-ish.
10225 case "$i_unistd" in
10227 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10231 xxx="probably a USG one, i.e. you use setpgrp()."
10236 echo "Assuming your setpgrp is $xxx" >&4
10244 : see if bzero exists
10248 : see if signal is declared as pointer to function returning int or void
10250 xxx=`./findhdr signal.h`
10251 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10252 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10253 echo "You have int (*signal())() instead of void." >&4
10255 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10256 echo "You have void (*signal())()." >&4
10258 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10259 echo "You have int (*signal())() instead of void." >&4
10261 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10262 echo "You have void (*signal())()." >&4
10265 case "$d_voidsig" in
10267 echo "I can't determine whether signal handler returns void or int..." >&4
10269 rp="What type does your signal handler return?"
10272 v*) val="$define";;
10276 echo "As you already told me, signal handler returns void." >&4
10279 *) echo "As you already told me, signal handler returns int." >&4
10286 case "$d_voidsig" in
10287 "$define") signal_t="void";;
10288 *) signal_t="int";;
10292 : check for ability to cast large floats to 32-bit ints.
10294 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10295 if $test "$intsize" -ge 4; then
10302 #$i_stdlib I_STDLIB
10304 #include <stdlib.h>
10306 #include <sys/types.h>
10307 #include <signal.h>
10308 $signal_t blech(s) int s; { exit(3); }
10315 signal(SIGFPE, blech);
10317 /* Don't let compiler optimize the test away. Store the number
10318 in a writable string for gcc to pass to sscanf under HP/UX.
10320 sprintf(str, "2147483647");
10321 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10325 /* x86 processors will probably give 0x8000 0000, which is a
10326 sign change. We don't want that. We want to mimic SPARC
10327 behavior here, which is to preserve the sign and give
10330 if (i32 != ($xxx) f)
10336 if eval $compile_ok; then
10340 echo "(I can't seem to compile the test program--assuming it can't)"
10345 echo "Yup, it can."
10348 echo "Nope, it can't."
10355 : check for ability to cast negative floats to unsigned
10357 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10360 #$i_stdlib I_STDLIB
10362 #include <stdlib.h>
10364 #include <sys/types.h>
10365 #include <signal.h>
10366 $signal_t blech(s) int s; { exit(7); }
10367 $signal_t blech_in_list(s) int s; { exit(4); }
10368 unsigned long dummy_long(p) unsigned long p; { return p; }
10369 unsigned int dummy_int(p) unsigned int p; { return p; }
10370 unsigned short dummy_short(p) unsigned short p; { return p; }
10374 unsigned long along;
10376 unsigned short ashort;
10380 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10381 a direct f = -123. assignment. gcc-2.8.0 reportedly
10382 optimized the whole file away
10384 /* Store the number in a writable string for gcc to pass to
10385 sscanf under HP/UX.
10387 sprintf(str, "-123");
10388 sscanf(str, "%lf", &f); /* f = -123.; */
10390 signal(SIGFPE, blech);
10391 along = (unsigned long)f;
10392 aint = (unsigned int)f;
10393 ashort = (unsigned short)f;
10394 if (along != (unsigned long)-123)
10396 if (aint != (unsigned int)-123)
10398 if (ashort != (unsigned short)-123)
10400 sprintf(str, "1073741824.");
10401 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10404 along = (unsigned long)f;
10405 if (along != 0x80000000)
10409 along = (unsigned long)f;
10410 if (along != 0x7fffffff)
10414 along = (unsigned long)f;
10415 if (along != 0x80000001)
10419 signal(SIGFPE, blech_in_list);
10420 sprintf(str, "123.");
10421 sscanf(str, "%lf", &f); /* f = 123.; */
10422 along = dummy_long((unsigned long)f);
10423 aint = dummy_int((unsigned int)f);
10424 ashort = dummy_short((unsigned short)f);
10425 if (along != (unsigned long)123)
10427 if (aint != (unsigned int)123)
10429 if (ashort != (unsigned short)123)
10436 if eval $compile_ok; then
10440 echo "(I can't seem to compile the test program--assuming it can't)"
10443 case "$castflags" in
10445 echo "Yup, it can."
10448 echo "Nope, it can't."
10455 : see if vprintf exists
10457 if set vprintf val -f d_vprintf; eval $csym; $val; then
10458 echo 'vprintf() found.' >&4
10461 #include <varargs.h>
10462 #$i_stdlib I_STDLIB
10464 #include <stdlib.h>
10467 int main() { xxx("foo"); }
10476 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10480 if eval $compile && $run ./try; then
10481 echo "Your vsprintf() returns (int)." >&4
10484 echo "Your vsprintf() returns (char*)." >&4
10488 echo 'vprintf() NOT found.' >&4
10499 : see if chown exists
10503 : see if chroot exists
10504 set chroot d_chroot
10507 : see if chsize exists
10508 set chsize d_chsize
10511 : see if class exists
10515 : see if clearenv exists
10516 set clearenv d_clearenv
10519 hasstruct='varname=$1; struct=$2; shift; shift;
10520 while $test $# -ge 2; do
10522 $define) echo "#include <$2>";;
10526 echo "int main () { struct $struct foo; }" >> try.c;
10528 if eval $compile; then
10535 $rm -f try.c try.o'
10539 : see whether socket exists
10541 $echo $n "Hmm... $c" >&4
10542 if set socket val -f d_socket; eval $csym; $val; then
10543 echo "Looks like you have Berkeley networking support." >&4
10545 if set setsockopt val -f; eval $csym; $val; then
10548 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10549 d_oldsock="$define"
10552 if $contains socklib libc.list >/dev/null 2>&1; then
10553 echo "Looks like you have Berkeley networking support." >&4
10555 : we will have to assume that it supports the 4.2 BSD interface
10558 echo "You don't have Berkeley networking in libc$_a..." >&4
10559 if test "X$d_socket" = "X$define"; then
10560 echo "...but you seem to believe that you have sockets." >&4
10562 for net in net socket
10564 if test -f /usr/lib/lib$net$_a; then
10565 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10566 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10567 if $contains socket libc.list >/dev/null 2>&1; then
10572 echo "...but the Wollongong group seems to have hacked it in." >&4
10573 sockethdr="-I/usr/netinclude"
10576 echo "Found Berkeley sockets interface in lib$net." >&4
10577 if $contains setsockopt libc.list >/dev/null 2>&1; then
10580 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10581 d_oldsock="$define"
10587 if test "X$d_socket" != "X$define"; then
10588 echo "or anywhere else I see." >&4
10596 : see if socketpair exists
10597 set socketpair d_sockpair
10602 echo "Checking the availability of certain socket constants..." >&4
10603 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10604 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10606 #include <sys/types.h>
10607 #include <sys/socket.h>
10613 set try; if eval $compile; then
10616 set d_${enum}; eval $setvar
10620 : see if this is a sys/uio.h system
10621 set sys/uio.h i_sysuio
10626 echo "Checking to see if your system supports struct cmsghdr..." >&4
10627 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10629 case "$d_cmsghdr_s" in
10630 "$define") echo "Yes, it does." ;;
10631 *) echo "No, it doesn't." ;;
10635 : check for const keyword
10637 echo 'Checking to see if your C compiler knows about "const"...' >&4
10638 $cat >const.c <<'EOCP'
10639 typedef struct spug { int drokk; } spug;
10646 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10648 echo "Yup, it does."
10651 echo "Nope, it doesn't."
10656 : see if copysignl exists
10657 set copysignl d_copysignl
10660 : see if crypt exists
10665 $define) cryptlib='' ;;
10666 *) if set crypt val -f d_crypt; eval $csym; $val; then
10667 echo 'crypt() found.' >&4
10671 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
10672 if $test -z "$cryptlib"; then
10673 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
10677 if $test -z "$cryptlib"; then
10678 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
10682 if $test -z "$cryptlib"; then
10683 cryptlib=`./loc libcrypt$_a "" $libpth`
10687 if $test -z "$cryptlib"; then
10688 echo 'crypt() NOT found.' >&4
10699 : see if this is a crypt.h system
10700 set crypt.h i_crypt
10703 : see if crypt_r exists
10704 set crypt_r d_crypt_r
10706 case "$d_crypt_r" in
10708 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
10709 case "$d_crypt_r_proto:$usethreads" in
10710 ":define") d_crypt_r_proto=define
10711 set d_crypt_r_proto crypt_r $hdrs
10715 case "$d_crypt_r_proto" in
10717 case "$crypt_r_proto" in
10718 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
10719 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
10721 case "$crypt_r_proto" in
10722 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
10723 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
10725 case "$crypt_r_proto" in
10726 ''|0) d_crypt_r=undef
10728 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
10729 * ) case "$crypt_r_proto" in
10730 REENTRANT_PROTO*) ;;
10731 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
10733 echo "Prototype: $try" ;;
10736 *) case "$usethreads" in
10737 define) echo "crypt_r has no prototype, not using it." >&4 ;;
10748 : get csh whereabouts
10750 'csh') val="$undef" ;;
10751 *) val="$define" ;;
10755 : Respect a hint or command line value for full_csh.
10756 case "$full_csh" in
10757 '') full_csh=$csh ;;
10760 : see if ctermid_r exists
10761 set ctermid_r d_ctermid_r
10763 case "$d_ctermid_r" in
10765 hdrs="$i_systypes sys/types.h define stdio.h "
10766 case "$d_ctermid_r_proto:$usethreads" in
10767 ":define") d_ctermid_r_proto=define
10768 set d_ctermid_r_proto ctermid_r $hdrs
10772 case "$d_ctermid_r_proto" in
10774 case "$ctermid_r_proto" in
10775 ''|0) try='char* ctermid_r(char*);'
10776 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
10778 case "$ctermid_r_proto" in
10779 ''|0) d_ctermid_r=undef
10781 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
10782 * ) case "$ctermid_r_proto" in
10783 REENTRANT_PROTO*) ;;
10784 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
10786 echo "Prototype: $try" ;;
10789 *) case "$usethreads" in
10790 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
10797 *) ctermid_r_proto=0
10801 : see if ctime_r exists
10802 set ctime_r d_ctime_r
10804 case "$d_ctime_r" in
10806 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10807 case "$d_ctime_r_proto:$usethreads" in
10808 ":define") d_ctime_r_proto=define
10809 set d_ctime_r_proto ctime_r $hdrs
10813 case "$d_ctime_r_proto" in
10815 case "$ctime_r_proto" in
10816 ''|0) try='char* ctime_r(const time_t*, char*);'
10817 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
10819 case "$ctime_r_proto" in
10820 ''|0) try='char* ctime_r(const time_t*, char*, int);'
10821 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
10823 case "$ctime_r_proto" in
10824 ''|0) try='int ctime_r(const time_t*, char*);'
10825 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
10827 case "$ctime_r_proto" in
10828 ''|0) try='int ctime_r(const time_t*, char*, int);'
10829 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
10831 case "$ctime_r_proto" in
10832 ''|0) d_ctime_r=undef
10834 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
10835 * ) case "$ctime_r_proto" in
10836 REENTRANT_PROTO*) ;;
10837 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
10839 echo "Prototype: $try" ;;
10842 *) case "$usethreads" in
10843 define) echo "ctime_r has no prototype, not using it." >&4 ;;
10854 : see if cuserid exists
10855 set cuserid d_cuserid
10858 : see if this is a limits.h system
10859 set limits.h i_limits
10862 : see if this is a float.h system
10863 set float.h i_float
10866 : See if number of significant digits in a double precision number is known
10868 $cat >dbl_dig.c <<EOM
10869 #$i_limits I_LIMITS
10872 #include <limits.h>
10878 printf("Contains DBL_DIG");
10881 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
10882 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
10883 echo "DBL_DIG found." >&4
10886 echo "DBL_DIG NOT found." >&4
10893 : see if dbm.h is available
10894 : see if dbmclose exists
10895 set dbmclose d_dbmclose
10898 case "$d_dbmclose" in
10908 *) set rpcsvc/dbm.h i_rpcsvcdbm
10913 *) echo "We won't be including <dbm.h>"
10923 : see if prototype for dbminit is available
10925 set d_dbminitproto dbminit $i_dbm dbm.h
10928 : see if difftime exists
10929 set difftime d_difftime
10932 : see if this is a dirent system
10934 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
10936 echo "<dirent.h> found." >&4
10939 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
10940 echo "<sys/dir.h> found." >&4
10943 xinc=`./findhdr sys/ndir.h`
10945 echo "<dirent.h> NOT found." >&4
10950 : Look for type of directory structure.
10952 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10954 case "$direntrytype" in
10956 case "$i_dirent" in
10957 $define) guess1='struct dirent' ;;
10958 *) guess1='struct direct' ;;
10961 *) guess1="$direntrytype"
10966 'struct dirent') guess2='struct direct' ;;
10967 *) guess2='struct dirent' ;;
10970 if $contains "$guess1" try.c >/dev/null 2>&1; then
10971 direntrytype="$guess1"
10972 echo "Your directory entries are $direntrytype." >&4
10973 elif $contains "$guess2" try.c >/dev/null 2>&1; then
10974 direntrytype="$guess2"
10975 echo "Your directory entries seem to be $direntrytype." >&4
10977 echo "I don't recognize your system's directory entries." >&4
10978 rp="What type is used for directory entries on this system?"
10981 direntrytype="$ans"
10986 : see if the directory entry stores field length
10988 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10989 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
10990 echo "Good, your directory entry keeps length information in d_namlen." >&4
10993 echo "Your directory entry does not know about the d_namlen field." >&4
11000 : see if this is an sysdir system
11001 set sys/dir.h i_sysdir
11004 : see if this is an sysndir system
11005 set sys/ndir.h i_sysndir
11010 $cat >dirfd.c <<EOM
11012 #$i_stdlib I_STDLIB
11014 #include <stdlib.h>
11016 #$i_dirent I_DIRENT /**/
11017 #$i_sysdir I_SYS_DIR /**/
11018 #$i_sysndir I_SYS_NDIR /**/
11019 #$i_systypes I_SYS_TYPES /**/
11020 #if defined(I_SYS_TYPES)
11021 #include <sys/types.h>
11023 #if defined(I_DIRENT)
11024 #include <dirent.h>
11025 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11026 #include <sys/dir.h>
11030 #include <sys/ndir.h>
11034 #include <ndir.h> /* may be wrong in the future */
11036 #include <sys/dir.h>
11042 DIR *dirp = opendir(".");
11043 if (dirfd(dirp) >= 0)
11051 if eval $compile; then
11055 $define) echo "dirfd() found." >&4 ;;
11056 *) echo "dirfd() NOT found." >&4 ;;
11062 : see if dlerror exists
11065 set dlerror d_dlerror
11069 : see if dlfcn is available
11070 set dlfcn.h i_dlfcn
11077 On a few systems, the dynamically loaded modules that perl generates and uses
11078 will need a different extension than shared libs. The default will probably
11084 *) dflt="$dlext" ;;
11086 rp='What is the extension of dynamically loaded modules'
11095 : Check if dlsym need a leading underscore
11101 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11102 $cat >dyna.c <<'EOM'
11109 #$i_stdlib I_STDLIB
11111 #include <stdlib.h>
11115 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11117 #include <sys/types.h>
11122 extern int fred() ;
11131 int mode = RTLD_LAZY ;
11133 handle = dlopen("./dyna.$dlext", mode) ;
11134 if (handle == NULL) {
11139 symbol = dlsym(handle, "fred") ;
11140 if (symbol == NULL) {
11141 /* try putting a leading underscore */
11142 symbol = dlsym(handle, "_fred") ;
11143 if (symbol == NULL) {
11156 : Call the object file tmp-dyna.o in case dlext=o.
11157 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11158 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11159 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11160 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11163 1) echo "Test program failed using dlopen." >&4
11164 echo "Perhaps you should not use dynamic loading." >&4;;
11165 2) echo "Test program failed using dlsym." >&4
11166 echo "Perhaps you should not use dynamic loading." >&4;;
11167 3) echo "dlsym needs a leading underscore" >&4
11169 4) echo "dlsym doesn't need a leading underscore." >&4;;
11172 echo "I can't compile and run the test program." >&4
11173 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11178 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11183 : see if drand48_r exists
11184 set drand48_r d_drand48_r
11186 case "$d_drand48_r" in
11188 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11189 case "$d_drand48_r_proto:$usethreads" in
11190 ":define") d_drand48_r_proto=define
11191 set d_drand48_r_proto drand48_r $hdrs
11195 case "$d_drand48_r_proto" in
11197 case "$drand48_r_proto" in
11198 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11199 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11201 case "$drand48_r_proto" in
11202 ''|0) d_drand48_r=undef
11204 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11205 * ) case "$drand48_r_proto" in
11206 REENTRANT_PROTO*) ;;
11207 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11209 echo "Prototype: $try" ;;
11212 *) case "$usethreads" in
11213 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11220 *) drand48_r_proto=0
11224 : see if prototype for drand48 is available
11226 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11229 : see if dup2 exists
11233 : see if eaccess exists
11234 set eaccess d_eaccess
11237 : see if endgrent exists
11238 set endgrent d_endgrent
11241 : see if this is an grp system
11247 xxx=`./findhdr grp.h`
11248 $cppstdin $cppflags $cppminus < $xxx >$$.h
11250 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11262 set d_grpasswd; eval $setvar
11266 : see if endgrent_r exists
11267 set endgrent_r d_endgrent_r
11269 case "$d_endgrent_r" in
11271 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11272 case "$d_endgrent_r_proto:$usethreads" in
11273 ":define") d_endgrent_r_proto=define
11274 set d_endgrent_r_proto endgrent_r $hdrs
11278 case "$d_endgrent_r_proto" in
11280 case "$endgrent_r_proto" in
11281 ''|0) try='int endgrent_r(FILE**);'
11282 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11284 case "$endgrent_r_proto" in
11285 ''|0) try='void endgrent_r(FILE**);'
11286 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11288 case "$endgrent_r_proto" in
11289 ''|0) d_endgrent_r=undef
11291 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11292 * ) case "$endgrent_r_proto" in
11293 REENTRANT_PROTO*) ;;
11294 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11296 echo "Prototype: $try" ;;
11299 *) case "$usethreads" in
11300 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11307 *) endgrent_r_proto=0
11311 : see if endhostent exists
11312 set endhostent d_endhent
11315 : see if this is a netdb.h system
11316 set netdb.h i_netdb
11319 : see if endhostent_r exists
11320 set endhostent_r d_endhostent_r
11322 case "$d_endhostent_r" in
11324 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11325 case "$d_endhostent_r_proto:$usethreads" in
11326 ":define") d_endhostent_r_proto=define
11327 set d_endhostent_r_proto endhostent_r $hdrs
11331 case "$d_endhostent_r_proto" in
11333 case "$endhostent_r_proto" in
11334 ''|0) try='int endhostent_r(struct hostent_data*);'
11335 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11337 case "$endhostent_r_proto" in
11338 ''|0) try='void endhostent_r(struct hostent_data*);'
11339 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11341 case "$endhostent_r_proto" in
11342 ''|0) d_endhostent_r=undef
11343 endhostent_r_proto=0
11344 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11345 * ) case "$endhostent_r_proto" in
11346 REENTRANT_PROTO*) ;;
11347 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11349 echo "Prototype: $try" ;;
11352 *) case "$usethreads" in
11353 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11355 d_endhostent_r=undef
11356 endhostent_r_proto=0
11360 *) endhostent_r_proto=0
11364 : see if endnetent exists
11365 set endnetent d_endnent
11368 : see if endnetent_r exists
11369 set endnetent_r d_endnetent_r
11371 case "$d_endnetent_r" in
11373 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11374 case "$d_endnetent_r_proto:$usethreads" in
11375 ":define") d_endnetent_r_proto=define
11376 set d_endnetent_r_proto endnetent_r $hdrs
11380 case "$d_endnetent_r_proto" in
11382 case "$endnetent_r_proto" in
11383 ''|0) try='int endnetent_r(struct netent_data*);'
11384 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11386 case "$endnetent_r_proto" in
11387 ''|0) try='void endnetent_r(struct netent_data*);'
11388 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11390 case "$endnetent_r_proto" in
11391 ''|0) d_endnetent_r=undef
11392 endnetent_r_proto=0
11393 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11394 * ) case "$endnetent_r_proto" in
11395 REENTRANT_PROTO*) ;;
11396 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11398 echo "Prototype: $try" ;;
11401 *) case "$usethreads" in
11402 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11404 d_endnetent_r=undef
11405 endnetent_r_proto=0
11409 *) endnetent_r_proto=0
11413 : see if endprotoent exists
11414 set endprotoent d_endpent
11417 : see if endprotoent_r exists
11418 set endprotoent_r d_endprotoent_r
11420 case "$d_endprotoent_r" in
11422 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11423 case "$d_endprotoent_r_proto:$usethreads" in
11424 ":define") d_endprotoent_r_proto=define
11425 set d_endprotoent_r_proto endprotoent_r $hdrs
11429 case "$d_endprotoent_r_proto" in
11431 case "$endprotoent_r_proto" in
11432 ''|0) try='int endprotoent_r(struct protoent_data*);'
11433 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11435 case "$endprotoent_r_proto" in
11436 ''|0) try='void endprotoent_r(struct protoent_data*);'
11437 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11439 case "$endprotoent_r_proto" in
11440 ''|0) d_endprotoent_r=undef
11441 endprotoent_r_proto=0
11442 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11443 * ) case "$endprotoent_r_proto" in
11444 REENTRANT_PROTO*) ;;
11445 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11447 echo "Prototype: $try" ;;
11450 *) case "$usethreads" in
11451 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11453 d_endprotoent_r=undef
11454 endprotoent_r_proto=0
11458 *) endprotoent_r_proto=0
11462 : see if endpwent exists
11463 set endpwent d_endpwent
11466 : see if this is a pwd.h system
11472 xxx=`./findhdr pwd.h`
11473 $cppstdin $cppflags $cppminus < $xxx >$$.h
11475 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11483 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11491 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11499 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11507 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11515 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11523 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11531 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11543 set d_pwquota; eval $setvar
11544 set d_pwage; eval $setvar
11545 set d_pwchange; eval $setvar
11546 set d_pwclass; eval $setvar
11547 set d_pwexpire; eval $setvar
11548 set d_pwcomment; eval $setvar
11549 set d_pwgecos; eval $setvar
11550 set d_pwpasswd; eval $setvar
11554 : see if endpwent_r exists
11555 set endpwent_r d_endpwent_r
11557 case "$d_endpwent_r" in
11559 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11560 case "$d_endpwent_r_proto:$usethreads" in
11561 ":define") d_endpwent_r_proto=define
11562 set d_endpwent_r_proto endpwent_r $hdrs
11566 case "$d_endpwent_r_proto" in
11568 case "$endpwent_r_proto" in
11569 ''|0) try='int endpwent_r(FILE**);'
11570 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11572 case "$endpwent_r_proto" in
11573 ''|0) try='void endpwent_r(FILE**);'
11574 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11576 case "$endpwent_r_proto" in
11577 ''|0) d_endpwent_r=undef
11579 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11580 * ) case "$endpwent_r_proto" in
11581 REENTRANT_PROTO*) ;;
11582 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11584 echo "Prototype: $try" ;;
11587 *) case "$usethreads" in
11588 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11595 *) endpwent_r_proto=0
11599 : see if endservent exists
11600 set endservent d_endsent
11603 : see if endservent_r exists
11604 set endservent_r d_endservent_r
11606 case "$d_endservent_r" in
11608 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11609 case "$d_endservent_r_proto:$usethreads" in
11610 ":define") d_endservent_r_proto=define
11611 set d_endservent_r_proto endservent_r $hdrs
11615 case "$d_endservent_r_proto" in
11617 case "$endservent_r_proto" in
11618 ''|0) try='int endservent_r(struct servent_data*);'
11619 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
11621 case "$endservent_r_proto" in
11622 ''|0) try='void endservent_r(struct servent_data*);'
11623 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
11625 case "$endservent_r_proto" in
11626 ''|0) d_endservent_r=undef
11627 endservent_r_proto=0
11628 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
11629 * ) case "$endservent_r_proto" in
11630 REENTRANT_PROTO*) ;;
11631 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
11633 echo "Prototype: $try" ;;
11636 *) case "$usethreads" in
11637 define) echo "endservent_r has no prototype, not using it." >&4 ;;
11639 d_endservent_r=undef
11640 endservent_r_proto=0
11644 *) endservent_r_proto=0
11648 : Locate the flags for 'open()'
11651 #include <sys/types.h>
11656 #include <sys/file.h>
11658 #$i_stdlib I_STDLIB
11660 #include <stdlib.h>
11671 : check sys/file.h first to get FREAD on Sun
11672 if $test `./findhdr sys/file.h` && \
11673 set try -DI_SYS_FILE && eval $compile; then
11675 echo "<sys/file.h> defines the O_* constants..." >&4
11676 if $run ./try; then
11677 echo "and you have the 3 argument form of open()." >&4
11680 echo "but not the 3 argument form of open(). Oh, well." >&4
11683 elif $test `./findhdr fcntl.h` && \
11684 set try -DI_FCNTL && eval $compile; then
11686 echo "<fcntl.h> defines the O_* constants..." >&4
11687 if $run ./try; then
11688 echo "and you have the 3 argument form of open()." >&4
11691 echo "but not the 3 argument form of open(). Oh, well." >&4
11696 echo "I can't find the O_* constant definitions! You got problems." >&4
11702 : see which of string.h or strings.h is needed
11704 strings=`./findhdr string.h`
11705 if $test "$strings" && $test -r "$strings"; then
11706 echo "Using <string.h> instead of <strings.h>." >&4
11710 strings=`./findhdr strings.h`
11711 if $test "$strings" && $test -r "$strings"; then
11712 echo "Using <strings.h> instead of <string.h>." >&4
11714 echo "No string header found -- You'll surely have problems." >&4
11719 case "$i_string" in
11720 "$undef") strings=`./findhdr strings.h`;;
11721 *) strings=`./findhdr string.h`;;
11724 : see if this is a sys/file.h system
11729 : do we need to include sys/file.h ?
11733 if $h_sysfile; then
11735 echo "We'll be including <sys/file.h>." >&4
11738 echo "We won't be including <sys/file.h>." >&4
11748 : see if fcntl.h is there
11753 : see if we can include fcntl.h
11759 echo "We'll be including <fcntl.h>." >&4
11762 if $h_sysfile; then
11763 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
11765 echo "We won't be including <fcntl.h>." >&4
11777 : check for non-blocking I/O stuff
11778 case "$h_sysfile" in
11779 true) echo "#include <sys/file.h>" > head.c;;
11782 true) echo "#include <fcntl.h>" > head.c;;
11783 *) echo "#include <sys/fcntl.h>" > head.c;;
11788 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
11789 case "$o_nonblock" in
11791 $cat head.c > try.c
11792 $cat >>try.c <<EOCP
11794 #$i_stdlib I_STDLIB
11796 #include <stdlib.h>
11804 printf("O_NONBLOCK\n");
11808 printf("O_NDELAY\n");
11812 printf("FNDELAY\n");
11819 if eval $compile_ok; then
11820 o_nonblock=`$run ./try`
11821 case "$o_nonblock" in
11822 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
11823 *) echo "Seems like we can use $o_nonblock.";;
11826 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
11829 *) echo "Using $hint value $o_nonblock.";;
11831 $rm -f try try.* .out core
11834 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
11837 $cat head.c > try.c
11838 $cat >>try.c <<EOCP
11840 #include <sys/types.h>
11841 #include <signal.h>
11843 #$i_stdlib I_STDLIB
11845 #include <stdlib.h>
11851 #define MY_O_NONBLOCK $o_nonblock
11852 #ifndef errno /* XXX need better Configure test */
11855 #$i_unistd I_UNISTD
11857 #include <unistd.h>
11859 #$i_string I_STRING
11861 #include <string.h>
11863 #include <strings.h>
11865 $signal_t blech(x) int x; { exit(3); }
11867 $cat >> try.c <<'EOCP'
11875 pipe(pd); /* Down: child -> parent */
11876 pipe(pu); /* Up: parent -> child */
11879 close(pd[1]); /* Parent reads from pd[0] */
11880 close(pu[0]); /* Parent writes (blocking) to pu[1] */
11882 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
11887 signal(SIGALRM, blech);
11889 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
11891 sprintf(string, "%d\n", ret);
11892 write(2, string, strlen(string));
11895 if (errno == EAGAIN) {
11896 printf("EAGAIN\n");
11901 if (errno == EWOULDBLOCK)
11902 printf("EWOULDBLOCK\n");
11905 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
11906 sleep(2); /* Give it time to close our pipe */
11908 ret = read(pd[0], buf, 1); /* Should read EOF */
11910 sprintf(string, "%d\n", ret);
11911 write(4, string, strlen(string));
11915 close(pd[0]); /* We write to pd[1] */
11916 close(pu[1]); /* We read from pu[0] */
11917 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
11918 close(pd[1]); /* Pipe pd is now fully closed! */
11919 exit(0); /* Bye bye, thank you for playing! */
11923 if eval $compile_ok; then
11924 echo "$startsh" >mtry
11925 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
11927 ./mtry >/dev/null 2>&1
11929 0) eagain=`$cat try.out`;;
11930 1) echo "Could not perform non-blocking setting!";;
11931 2) echo "I did a successful read() for something that was not there!";;
11932 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
11933 4) echo "Could not find F_SETFL!";;
11934 *) echo "Something terribly wrong happened during testing.";;
11936 rd_nodata=`$cat try.ret`
11937 echo "A read() system call with no data present returns $rd_nodata."
11938 case "$rd_nodata" in
11941 echo "(That's peculiar, fixing that to be -1.)"
11947 echo "Forcing errno EAGAIN on read() with no data available."
11951 echo "Your read() sets errno to $eagain when no data is available."
11954 status=`$cat try.err`
11956 0) echo "And it correctly returns 0 to signal EOF.";;
11957 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
11958 *) echo "However, your read() returns '$status' on EOF??";;
11961 if test "$status" = "$rd_nodata"; then
11962 echo "WARNING: you can't distinguish between EOF and no data!"
11966 echo "I can't compile the test program--assuming errno EAGAIN will do."
11973 echo "Using $hint value $eagain."
11974 echo "Your read() returns $rd_nodata when no data is present."
11975 case "$d_eofnblk" in
11976 "$define") echo "And you can see EOF because read() returns 0.";;
11977 "$undef") echo "But you can't see EOF status from read() returned value.";;
11979 echo "(Assuming you can't see EOF status from read anyway.)"
11985 $rm -f try try.* .out core head.c mtry
11987 : see if _ptr and _cnt from stdio act std
11990 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
11991 echo "(Looks like you have stdio.h from BSD.)"
11992 case "$stdio_ptr" in
11993 '') stdio_ptr='((fp)->_p)'
11996 *) ptr_lval=$d_stdio_ptr_lval;;
11998 case "$stdio_cnt" in
11999 '') stdio_cnt='((fp)->_r)'
12002 *) cnt_lval=$d_stdio_cnt_lval;;
12004 case "$stdio_base" in
12005 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12007 case "$stdio_bufsiz" in
12008 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12010 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12011 echo "(Looks like you have stdio.h from Linux.)"
12012 case "$stdio_ptr" in
12013 '') stdio_ptr='((fp)->_IO_read_ptr)'
12016 *) ptr_lval=$d_stdio_ptr_lval;;
12018 case "$stdio_cnt" in
12019 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12022 *) cnt_lval=$d_stdio_cnt_lval;;
12024 case "$stdio_base" in
12025 '') stdio_base='((fp)->_IO_read_base)';;
12027 case "$stdio_bufsiz" in
12028 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12031 case "$stdio_ptr" in
12032 '') stdio_ptr='((fp)->_ptr)'
12035 *) ptr_lval=$d_stdio_ptr_lval;;
12037 case "$stdio_cnt" in
12038 '') stdio_cnt='((fp)->_cnt)'
12041 *) cnt_lval=$d_stdio_cnt_lval;;
12043 case "$stdio_base" in
12044 '') stdio_base='((fp)->_base)';;
12046 case "$stdio_bufsiz" in
12047 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12051 : test whether _ptr and _cnt really work
12052 echo "Checking how std your stdio is..." >&4
12055 #$i_stdlib I_STDLIB
12057 #include <stdlib.h>
12059 #define FILE_ptr(fp) $stdio_ptr
12060 #define FILE_cnt(fp) $stdio_cnt
12062 FILE *fp = fopen("try.c", "r");
12065 18 <= FILE_cnt(fp) &&
12066 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12074 if eval $compile && $to try.c; then
12075 if $run ./try; then
12076 echo "Your stdio acts pretty std."
12079 echo "Your stdio isn't very std."
12082 echo "Your stdio doesn't appear very std."
12086 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12087 # direct buffer manipulation no longer works. The Configure tests
12088 # should be changed to correctly detect this, but until then,
12089 # the following check should at least let perl compile and run.
12090 # (This quick fix should be updated before 5.8.1.)
12091 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12092 # A. Dougherty, June 3, 2002.
12093 case "$d_gnulibc" in
12095 case "$gnulibc_version" in
12099 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12108 : Can _ptr be used as an lvalue?
12109 case "$d_stdstdio$ptr_lval" in
12110 $define$define) val=$define ;;
12113 set d_stdio_ptr_lval
12116 : Can _cnt be used as an lvalue?
12117 case "$d_stdstdio$cnt_lval" in
12118 $define$define) val=$define ;;
12121 set d_stdio_cnt_lval
12125 : test whether setting _ptr sets _cnt as a side effect
12126 d_stdio_ptr_lval_sets_cnt="$undef"
12127 d_stdio_ptr_lval_nochange_cnt="$undef"
12128 case "$d_stdio_ptr_lval$d_stdstdio" in
12130 echo "Checking to see what happens if we set the stdio ptr..." >&4
12133 /* Can we scream? */
12134 /* Eat dust sed :-) */
12135 /* In the buffer space, no one can hear you scream. */
12136 #$i_stdlib I_STDLIB
12138 #include <stdlib.h>
12140 #define FILE_ptr(fp) $stdio_ptr
12141 #define FILE_cnt(fp) $stdio_cnt
12142 #include <sys/types.h>
12144 FILE *fp = fopen("try.c", "r");
12149 puts("Fail even to read");
12152 c = getc(fp); /* Read away the first # */
12154 puts("Fail even to read");
12158 18 <= FILE_cnt(fp) &&
12159 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12161 puts("Fail even to read");
12164 ptr = (char*) FILE_ptr(fp);
12165 cnt = (size_t)FILE_cnt(fp);
12167 FILE_ptr(fp) += 42;
12169 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12170 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12173 if (FILE_cnt(fp) <= 20) {
12174 printf ("Fail (<20 chars to test)");
12177 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12178 puts("Fail compare");
12181 if (cnt == FILE_cnt(fp)) {
12182 puts("Pass_unchanged");
12185 if (FILE_cnt(fp) == (cnt - 42)) {
12186 puts("Pass_changed");
12189 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12195 if eval $compile && $to try.c; then
12196 case `$run ./try` in
12198 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12199 d_stdio_ptr_lval_sets_cnt="$define" ;;
12201 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12202 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12204 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12206 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12209 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12215 : see if _base is also standard
12217 case "$d_stdstdio" in
12221 #$i_stdlib I_STDLIB
12223 #include <stdlib.h>
12225 #define FILE_base(fp) $stdio_base
12226 #define FILE_bufsiz(fp) $stdio_bufsiz
12228 FILE *fp = fopen("try.c", "r");
12231 19 <= FILE_bufsiz(fp) &&
12232 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12239 if eval $compile && $to try.c; then
12240 if $run ./try; then
12241 echo "And its _base field acts std."
12244 echo "But its _base field isn't std."
12247 echo "However, it seems to be lacking the _base field."
12255 : see if fast_stdio exists
12257 case "$d_stdstdio:$d_stdio_ptr_lval" in
12259 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12261 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12272 : see if fchdir exists
12273 set fchdir d_fchdir
12276 : see if fchmod exists
12277 set fchmod d_fchmod
12280 : see if fchown exists
12281 set fchown d_fchown
12284 : see if this is an fcntl system
12289 : See if fcntl-based locking works.
12291 #$i_stdlib I_STDLIB
12293 #include <stdlib.h>
12295 #include <unistd.h>
12297 #include <signal.h>
12298 $signal_t blech(x) int x; { exit(3); }
12300 #if defined(F_SETLK) && defined(F_SETLKW)
12301 struct flock flock;
12303 fd = open("try.c", O_RDONLY);
12304 flock.l_type = F_RDLCK;
12305 flock.l_whence = SEEK_SET;
12306 flock.l_start = flock.l_len = 0;
12307 signal(SIGALRM, blech);
12309 retval = fcntl(fd, F_SETLK, &flock);
12311 (retval < 0 ? exit(2) : exit(0));
12317 echo "Checking if fcntl-based file locking works... "
12321 if eval $compile_ok; then
12322 if $run ./try; then
12323 echo "Yes, it seems to work."
12326 echo "Nope, it didn't work."
12331 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12332 *** This is (almost) impossible.
12333 *** If your NFS lock daemons are not feeling well, something like
12334 *** this may happen, please investigate. Cannot continue, aborting.
12342 echo "I'm unable to compile the test program, so I'll assume not."
12347 echo "Nope, since you don't even have fcntl()."
12350 set d_fcntl_can_lock
12355 : check for fd_set items
12358 Checking to see how well your C compiler handles fd_set and friends ...
12361 #$i_stdlib I_STDLIB
12363 #include <stdlib.h>
12365 #$i_systime I_SYS_TIME
12366 #$i_sysselct I_SYS_SELECT
12367 #$d_socket HAS_SOCKET
12368 #include <sys/types.h>
12370 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12373 #include <sys/time.h>
12375 #ifdef I_SYS_SELECT
12376 #include <sys/select.h>
12385 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12393 if eval $compile; then
12394 d_fds_bits="$define"
12396 echo "Well, your system knows about the normal fd_set typedef..." >&4
12397 if $run ./try; then
12398 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12399 d_fd_macros="$define"
12402 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12404 d_fd_macros="$undef"
12408 Hmm, your compiler has some difficulty with fd_set. Checking further...
12411 if eval $compile; then
12412 d_fds_bits="$undef"
12414 echo "Well, your system has some sort of fd_set available..." >&4
12415 if $run ./try; then
12416 echo "and you have the normal fd_set macros." >&4
12417 d_fd_macros="$define"
12420 but not the normal fd_set macros! Gross! More work for me...
12422 d_fd_macros="$undef"
12425 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12427 d_fds_bits="$undef"
12428 d_fd_macros="$undef"
12433 : see if fgetpos exists
12434 set fgetpos d_fgetpos
12437 : see if finite exists
12438 set finite d_finite
12441 : see if finitel exists
12442 set finitel d_finitel
12445 : see if flock exists
12449 : see if prototype for flock is available
12451 set d_flockproto flock $i_sysfile sys/file.h
12454 : see if fork exists
12458 : see if fp_class exists
12459 set fp_class d_fp_class
12462 : see if pathconf exists
12463 set pathconf d_pathconf
12466 : see if fpathconf exists
12467 set fpathconf d_fpathconf
12470 : see if fpclass exists
12471 set fpclass d_fpclass
12474 : see if fpclassify exists
12475 set fpclassify d_fpclassify
12478 : see if fpclassl exists
12479 set fpclassl d_fpclassl
12483 : check for fpos64_t
12485 echo "Checking to see if you have fpos64_t..." >&4
12488 int main() { fpos64_t x = 7; }
12491 if eval $compile; then
12493 echo "You have fpos64_t."
12496 echo "You do not have fpos64_t."
12497 case "$fpossize" in
12498 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12505 : see if frexpl exists
12506 set frexpl d_frexpl
12509 : see if this is a sys/param system
12510 set sys/param.h i_sysparam
12513 : see if this is a sys/mount.h system
12514 set sys/mount.h i_sysmount
12519 echo "Checking to see if your system supports struct fs_data..." >&4
12520 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12522 case "$d_fs_data_s" in
12523 "$define") echo "Yes, it does." ;;
12524 *) echo "No, it doesn't." ;;
12527 : see if fseeko exists
12528 set fseeko d_fseeko
12530 case "$longsize" in
12531 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12534 : see if fsetpos exists
12535 set fsetpos d_fsetpos
12539 : see if fstatfs exists
12540 set fstatfs d_fstatfs
12544 : see if statvfs exists
12545 set statvfs d_statvfs
12548 : see if fstatvfs exists
12549 set fstatvfs d_fstatvfs
12553 : see if fsync exists
12557 : see if ftello exists
12558 set ftello d_ftello
12560 case "$longsize" in
12561 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
12565 : check for a working futimes
12567 echo "Checking for a working futimes()" >&4
12570 #include <sys/time.h>
12577 fd = open ("try.c", O_RDWR);
12578 if (-1 == fd) exit (1);
12579 rv = futimes (fd, NULL);
12580 exit (rv == -1 ? errno : 0);
12584 if eval $compile; then
12588 0) echo "Yes, it does" >&4
12589 d_futimes="$define"
12591 *) echo "No, it has futimes, but it isn't working ($rc) (probably harmless)\n" >&4
12595 echo "No, it does not (probably harmless)\n" >&4
12597 $rm -f try.* try core core.try.*
12599 : see if getcwd exists
12600 set getcwd d_getcwd
12603 : see if getespwnam exists
12604 set getespwnam d_getespwnam
12608 : see if getfsstat exists
12609 set getfsstat d_getfsstat
12612 : see if getgrent exists
12613 set getgrent d_getgrent
12616 : see if getgrent_r exists
12617 set getgrent_r d_getgrent_r
12619 case "$d_getgrent_r" in
12621 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12622 case "$d_getgrent_r_proto:$usethreads" in
12623 ":define") d_getgrent_r_proto=define
12624 set d_getgrent_r_proto getgrent_r $hdrs
12628 case "$d_getgrent_r_proto" in
12630 case "$getgrent_r_proto" in
12631 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
12632 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
12634 case "$getgrent_r_proto" in
12635 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
12636 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
12638 case "$getgrent_r_proto" in
12639 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
12640 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
12642 case "$getgrent_r_proto" in
12643 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
12644 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
12646 case "$getgrent_r_proto" in
12647 ''|0) try='int getgrent_r(struct group*, char*, int);'
12648 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
12650 case "$getgrent_r_proto" in
12651 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
12652 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
12654 case "$getgrent_r_proto" in
12655 ''|0) d_getgrent_r=undef
12657 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
12658 * ) case "$getgrent_r_proto" in
12659 REENTRANT_PROTO*) ;;
12660 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
12662 echo "Prototype: $try" ;;
12665 *) case "$usethreads" in
12666 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
12673 *) getgrent_r_proto=0
12677 : see if getgrgid_r exists
12678 set getgrgid_r d_getgrgid_r
12680 case "$d_getgrgid_r" in
12682 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12683 case "$d_getgrgid_r_proto:$usethreads" in
12684 ":define") d_getgrgid_r_proto=define
12685 set d_getgrgid_r_proto getgrgid_r $hdrs
12689 case "$d_getgrgid_r_proto" in
12691 case "$getgrgid_r_proto" in
12692 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
12693 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
12695 case "$getgrgid_r_proto" in
12696 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
12697 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
12699 case "$getgrgid_r_proto" in
12700 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
12701 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
12703 case "$getgrgid_r_proto" in
12704 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
12705 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
12707 case "$getgrgid_r_proto" in
12708 ''|0) d_getgrgid_r=undef
12710 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
12711 * ) case "$getgrgid_r_proto" in
12712 REENTRANT_PROTO*) ;;
12713 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
12715 echo "Prototype: $try" ;;
12718 *) case "$usethreads" in
12719 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
12726 *) getgrgid_r_proto=0
12730 : see if getgrnam_r exists
12731 set getgrnam_r d_getgrnam_r
12733 case "$d_getgrnam_r" in
12735 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12736 case "$d_getgrnam_r_proto:$usethreads" in
12737 ":define") d_getgrnam_r_proto=define
12738 set d_getgrnam_r_proto getgrnam_r $hdrs
12742 case "$d_getgrnam_r_proto" in
12744 case "$getgrnam_r_proto" in
12745 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
12746 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
12748 case "$getgrnam_r_proto" in
12749 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
12750 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
12752 case "$getgrnam_r_proto" in
12753 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
12754 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
12756 case "$getgrnam_r_proto" in
12757 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
12758 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
12760 case "$getgrnam_r_proto" in
12761 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
12762 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
12764 case "$getgrnam_r_proto" in
12765 ''|0) d_getgrnam_r=undef
12767 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
12768 * ) case "$getgrnam_r_proto" in
12769 REENTRANT_PROTO*) ;;
12770 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
12772 echo "Prototype: $try" ;;
12775 *) case "$usethreads" in
12776 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
12783 *) getgrnam_r_proto=0
12787 : see if gethostbyaddr exists
12788 set gethostbyaddr d_gethbyaddr
12791 : see if gethostbyname exists
12792 set gethostbyname d_gethbyname
12795 : see if gethostent exists
12796 set gethostent d_gethent
12799 : see how we will look up host name
12802 if set gethostname val -f d_gethname; eval $csym; $val; then
12803 echo 'gethostname() found.' >&4
12804 d_gethname="$define"
12807 if set uname val -f d_uname; eval $csym; $val; then
12810 uname() was found, but you're running xenix, and older versions of xenix
12811 have a broken uname(). If you don't really know whether your xenix is old
12812 enough to have a broken system call, use the default answer.
12817 "$define") dflt=n;;
12819 rp='Is your uname() broken?'
12822 n*) d_uname="$define"; call=uname;;
12825 echo 'uname() found.' >&4
12832 case "$d_gethname" in
12833 '') d_gethname="$undef";;
12836 '') d_uname="$undef";;
12838 case "$d_uname$d_gethname" in
12843 Every now and then someone has a $call() that lies about the hostname
12844 but can't be fixed for political or economic reasons. If you wish, I can
12845 pretend $call() isn't there and maybe compute hostname at run-time
12846 thanks to the '$phostname' command.
12849 rp="Shall I ignore $call() from now on?"
12852 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
12855 case "$phostname" in
12856 '') aphostname='';;
12857 *) case "$aphostname" in
12859 *) set X $phostname
12863 file=`./loc $file $file $pth`
12864 aphostname=`echo $file $*`
12869 case "$d_uname$d_gethname" in
12872 case "$phostname" in
12874 echo "There will be no way for $package to get your hostname." >&4;;
12876 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
12880 case "$d_phostname" in
12881 '') d_phostname="$undef";;
12884 : see if gethostbyaddr_r exists
12885 set gethostbyaddr_r d_gethostbyaddr_r
12887 case "$d_gethostbyaddr_r" in
12889 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12890 case "$d_gethostbyaddr_r_proto:$usethreads" in
12891 ":define") d_gethostbyaddr_r_proto=define
12892 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
12896 case "$d_gethostbyaddr_r_proto" in
12898 case "$gethostbyaddr_r_proto" in
12899 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12900 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
12902 case "$gethostbyaddr_r_proto" in
12903 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
12904 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
12906 case "$gethostbyaddr_r_proto" in
12907 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
12908 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
12910 case "$gethostbyaddr_r_proto" in
12911 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
12912 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
12914 case "$gethostbyaddr_r_proto" in
12915 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
12916 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
12918 case "$gethostbyaddr_r_proto" in
12919 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
12920 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
12922 case "$gethostbyaddr_r_proto" in
12923 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
12924 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
12926 case "$gethostbyaddr_r_proto" in
12927 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
12928 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
12930 case "$gethostbyaddr_r_proto" in
12931 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
12932 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
12934 case "$gethostbyaddr_r_proto" in
12935 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
12936 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
12938 case "$gethostbyaddr_r_proto" in
12939 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12940 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
12942 case "$gethostbyaddr_r_proto" in
12943 ''|0) d_gethostbyaddr_r=undef
12944 gethostbyaddr_r_proto=0
12945 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
12946 * ) case "$gethostbyaddr_r_proto" in
12947 REENTRANT_PROTO*) ;;
12948 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
12950 echo "Prototype: $try" ;;
12953 *) case "$usethreads" in
12954 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
12956 d_gethostbyaddr_r=undef
12957 gethostbyaddr_r_proto=0
12961 *) gethostbyaddr_r_proto=0
12965 : see if gethostbyname_r exists
12966 set gethostbyname_r d_gethostbyname_r
12968 case "$d_gethostbyname_r" in
12970 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12971 case "$d_gethostbyname_r_proto:$usethreads" in
12972 ":define") d_gethostbyname_r_proto=define
12973 set d_gethostbyname_r_proto gethostbyname_r $hdrs
12977 case "$d_gethostbyname_r_proto" in
12979 case "$gethostbyname_r_proto" in
12980 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
12981 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
12983 case "$gethostbyname_r_proto" in
12984 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
12985 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
12987 case "$gethostbyname_r_proto" in
12988 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
12989 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
12991 case "$gethostbyname_r_proto" in
12992 ''|0) d_gethostbyname_r=undef
12993 gethostbyname_r_proto=0
12994 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
12995 * ) case "$gethostbyname_r_proto" in
12996 REENTRANT_PROTO*) ;;
12997 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
12999 echo "Prototype: $try" ;;
13002 *) case "$usethreads" in
13003 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13005 d_gethostbyname_r=undef
13006 gethostbyname_r_proto=0
13010 *) gethostbyname_r_proto=0
13014 : see if gethostent_r exists
13015 set gethostent_r d_gethostent_r
13017 case "$d_gethostent_r" in
13019 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13020 case "$d_gethostent_r_proto:$usethreads" in
13021 ":define") d_gethostent_r_proto=define
13022 set d_gethostent_r_proto gethostent_r $hdrs
13026 case "$d_gethostent_r_proto" in
13028 case "$gethostent_r_proto" in
13029 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13030 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13032 case "$gethostent_r_proto" in
13033 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13034 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13036 case "$gethostent_r_proto" in
13037 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13038 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13040 case "$gethostent_r_proto" in
13041 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13042 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13044 case "$gethostent_r_proto" in
13045 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13046 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13048 case "$gethostent_r_proto" in
13049 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13050 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13052 case "$gethostent_r_proto" in
13053 ''|0) d_gethostent_r=undef
13054 gethostent_r_proto=0
13055 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13056 * ) case "$gethostent_r_proto" in
13057 REENTRANT_PROTO*) ;;
13058 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13060 echo "Prototype: $try" ;;
13063 *) case "$usethreads" in
13064 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13066 d_gethostent_r=undef
13067 gethostent_r_proto=0
13071 *) gethostent_r_proto=0
13075 : see if prototypes for various gethostxxx netdb.h functions are available
13077 set d_gethostprotos gethostent $i_netdb netdb.h
13080 : see if getitimer exists
13081 set getitimer d_getitimer
13084 : see if getlogin exists
13085 set getlogin d_getlogin
13088 : see if getlogin_r exists
13089 set getlogin_r d_getlogin_r
13091 case "$d_getlogin_r" in
13093 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13094 case "$d_getlogin_r_proto:$usethreads" in
13095 ":define") d_getlogin_r_proto=define
13096 set d_getlogin_r_proto getlogin_r $hdrs
13100 case "$d_getlogin_r_proto" in
13102 case "$getlogin_r_proto" in
13103 ''|0) try='int getlogin_r(char*, size_t);'
13104 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13106 case "$getlogin_r_proto" in
13107 ''|0) try='int getlogin_r(char*, int);'
13108 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13110 case "$getlogin_r_proto" in
13111 ''|0) try='char* getlogin_r(char*, size_t);'
13112 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13114 case "$getlogin_r_proto" in
13115 ''|0) try='char* getlogin_r(char*, int);'
13116 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13118 case "$getlogin_r_proto" in
13119 ''|0) d_getlogin_r=undef
13121 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13122 * ) case "$getlogin_r_proto" in
13123 REENTRANT_PROTO*) ;;
13124 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13126 echo "Prototype: $try" ;;
13129 *) case "$usethreads" in
13130 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13137 *) getlogin_r_proto=0
13141 : see if getmnt exists
13142 set getmnt d_getmnt
13145 : see if getmntent exists
13146 set getmntent d_getmntent
13149 : see if getnetbyaddr exists
13150 set getnetbyaddr d_getnbyaddr
13153 : see if getnetbyname exists
13154 set getnetbyname d_getnbyname
13157 : see if getnetent exists
13158 set getnetent d_getnent
13161 : see if getnetbyaddr_r exists
13162 set getnetbyaddr_r d_getnetbyaddr_r
13164 case "$d_getnetbyaddr_r" in
13166 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13167 case "$d_getnetbyaddr_r_proto:$usethreads" in
13168 ":define") d_getnetbyaddr_r_proto=define
13169 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13173 case "$d_getnetbyaddr_r_proto" in
13175 case "$getnetbyaddr_r_proto" in
13176 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13177 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13179 case "$getnetbyaddr_r_proto" in
13180 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13181 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13183 case "$getnetbyaddr_r_proto" in
13184 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13185 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13187 case "$getnetbyaddr_r_proto" in
13188 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13189 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13191 case "$getnetbyaddr_r_proto" in
13192 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13193 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13195 case "$getnetbyaddr_r_proto" in
13196 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13197 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13199 case "$getnetbyaddr_r_proto" in
13200 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13201 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13203 case "$getnetbyaddr_r_proto" in
13204 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13205 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13207 case "$getnetbyaddr_r_proto" in
13208 ''|0) d_getnetbyaddr_r=undef
13209 getnetbyaddr_r_proto=0
13210 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13211 * ) case "$getnetbyaddr_r_proto" in
13212 REENTRANT_PROTO*) ;;
13213 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13215 echo "Prototype: $try" ;;
13218 *) case "$usethreads" in
13219 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13221 d_getnetbyaddr_r=undef
13222 getnetbyaddr_r_proto=0
13226 *) getnetbyaddr_r_proto=0
13230 : see if getnetbyname_r exists
13231 set getnetbyname_r d_getnetbyname_r
13233 case "$d_getnetbyname_r" in
13235 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13236 case "$d_getnetbyname_r_proto:$usethreads" in
13237 ":define") d_getnetbyname_r_proto=define
13238 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13242 case "$d_getnetbyname_r_proto" in
13244 case "$getnetbyname_r_proto" in
13245 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13246 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13248 case "$getnetbyname_r_proto" in
13249 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13250 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13252 case "$getnetbyname_r_proto" in
13253 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13254 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13256 case "$getnetbyname_r_proto" in
13257 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13258 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13260 case "$getnetbyname_r_proto" in
13261 ''|0) d_getnetbyname_r=undef
13262 getnetbyname_r_proto=0
13263 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13264 * ) case "$getnetbyname_r_proto" in
13265 REENTRANT_PROTO*) ;;
13266 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13268 echo "Prototype: $try" ;;
13271 *) case "$usethreads" in
13272 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13274 d_getnetbyname_r=undef
13275 getnetbyname_r_proto=0
13279 *) getnetbyname_r_proto=0
13283 : see if getnetent_r exists
13284 set getnetent_r d_getnetent_r
13286 case "$d_getnetent_r" in
13288 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13289 case "$d_getnetent_r_proto:$usethreads" in
13290 ":define") d_getnetent_r_proto=define
13291 set d_getnetent_r_proto getnetent_r $hdrs
13295 case "$d_getnetent_r_proto" in
13297 case "$getnetent_r_proto" in
13298 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13299 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13301 case "$getnetent_r_proto" in
13302 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13303 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13305 case "$getnetent_r_proto" in
13306 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13307 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13309 case "$getnetent_r_proto" in
13310 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13311 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13313 case "$getnetent_r_proto" in
13314 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13315 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13317 case "$getnetent_r_proto" in
13318 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13319 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13321 case "$getnetent_r_proto" in
13322 ''|0) d_getnetent_r=undef
13323 getnetent_r_proto=0
13324 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13325 * ) case "$getnetent_r_proto" in
13326 REENTRANT_PROTO*) ;;
13327 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13329 echo "Prototype: $try" ;;
13332 *) case "$usethreads" in
13333 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13335 d_getnetent_r=undef
13336 getnetent_r_proto=0
13340 *) getnetent_r_proto=0
13344 : see if prototypes for various getnetxxx netdb.h functions are available
13346 set d_getnetprotos getnetent $i_netdb netdb.h
13349 : see if getpagesize exists
13350 set getpagesize d_getpagsz
13354 : see if getprotobyname exists
13355 set getprotobyname d_getpbyname
13358 : see if getprotobynumber exists
13359 set getprotobynumber d_getpbynumber
13362 : see if getprotoent exists
13363 set getprotoent d_getpent
13366 : see if getpgid exists
13367 set getpgid d_getpgid
13370 : see if getpgrp2 exists
13371 set getpgrp2 d_getpgrp2
13374 : see if getppid exists
13375 set getppid d_getppid
13378 : see if getpriority exists
13379 set getpriority d_getprior
13382 : see if getprotobyname_r exists
13383 set getprotobyname_r d_getprotobyname_r
13385 case "$d_getprotobyname_r" in
13387 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13388 case "$d_getprotobyname_r_proto:$usethreads" in
13389 ":define") d_getprotobyname_r_proto=define
13390 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13394 case "$d_getprotobyname_r_proto" in
13396 case "$getprotobyname_r_proto" in
13397 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13398 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13400 case "$getprotobyname_r_proto" in
13401 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13402 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13404 case "$getprotobyname_r_proto" in
13405 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13406 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13408 case "$getprotobyname_r_proto" in
13409 ''|0) d_getprotobyname_r=undef
13410 getprotobyname_r_proto=0
13411 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13412 * ) case "$getprotobyname_r_proto" in
13413 REENTRANT_PROTO*) ;;
13414 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13416 echo "Prototype: $try" ;;
13419 *) case "$usethreads" in
13420 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13422 d_getprotobyname_r=undef
13423 getprotobyname_r_proto=0
13427 *) getprotobyname_r_proto=0
13431 : see if getprotobynumber_r exists
13432 set getprotobynumber_r d_getprotobynumber_r
13434 case "$d_getprotobynumber_r" in
13436 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13437 case "$d_getprotobynumber_r_proto:$usethreads" in
13438 ":define") d_getprotobynumber_r_proto=define
13439 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13443 case "$d_getprotobynumber_r_proto" in
13445 case "$getprotobynumber_r_proto" in
13446 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13447 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13449 case "$getprotobynumber_r_proto" in
13450 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13451 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13453 case "$getprotobynumber_r_proto" in
13454 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13455 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13457 case "$getprotobynumber_r_proto" in
13458 ''|0) d_getprotobynumber_r=undef
13459 getprotobynumber_r_proto=0
13460 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13461 * ) case "$getprotobynumber_r_proto" in
13462 REENTRANT_PROTO*) ;;
13463 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13465 echo "Prototype: $try" ;;
13468 *) case "$usethreads" in
13469 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13471 d_getprotobynumber_r=undef
13472 getprotobynumber_r_proto=0
13476 *) getprotobynumber_r_proto=0
13480 : see if getprotoent_r exists
13481 set getprotoent_r d_getprotoent_r
13483 case "$d_getprotoent_r" in
13485 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13486 case "$d_getprotoent_r_proto:$usethreads" in
13487 ":define") d_getprotoent_r_proto=define
13488 set d_getprotoent_r_proto getprotoent_r $hdrs
13492 case "$d_getprotoent_r_proto" in
13494 case "$getprotoent_r_proto" in
13495 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13496 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13498 case "$getprotoent_r_proto" in
13499 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13500 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13502 case "$getprotoent_r_proto" in
13503 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13504 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13506 case "$getprotoent_r_proto" in
13507 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13508 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13510 case "$getprotoent_r_proto" in
13511 ''|0) d_getprotoent_r=undef
13512 getprotoent_r_proto=0
13513 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13514 * ) case "$getprotoent_r_proto" in
13515 REENTRANT_PROTO*) ;;
13516 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13518 echo "Prototype: $try" ;;
13521 *) case "$usethreads" in
13522 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13524 d_getprotoent_r=undef
13525 getprotoent_r_proto=0
13529 *) getprotoent_r_proto=0
13533 : see if prototypes for various getprotoxxx netdb.h functions are available
13535 set d_getprotoprotos getprotoent $i_netdb netdb.h
13538 : see if getprpwnam exists
13539 set getprpwnam d_getprpwnam
13542 : see if getpwent exists
13543 set getpwent d_getpwent
13546 : see if getpwent_r exists
13547 set getpwent_r d_getpwent_r
13549 case "$d_getpwent_r" in
13551 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13552 case "$d_getpwent_r_proto:$usethreads" in
13553 ":define") d_getpwent_r_proto=define
13554 set d_getpwent_r_proto getpwent_r $hdrs
13558 case "$d_getpwent_r_proto" in
13560 case "$getpwent_r_proto" in
13561 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
13562 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
13564 case "$getpwent_r_proto" in
13565 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
13566 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
13568 case "$getpwent_r_proto" in
13569 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
13570 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
13572 case "$getpwent_r_proto" in
13573 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
13574 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
13576 case "$getpwent_r_proto" in
13577 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
13578 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
13580 case "$getpwent_r_proto" in
13581 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
13582 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
13584 case "$getpwent_r_proto" in
13585 ''|0) d_getpwent_r=undef
13587 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
13588 * ) case "$getpwent_r_proto" in
13589 REENTRANT_PROTO*) ;;
13590 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
13592 echo "Prototype: $try" ;;
13595 *) case "$usethreads" in
13596 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
13603 *) getpwent_r_proto=0
13607 : see if getpwnam_r exists
13608 set getpwnam_r d_getpwnam_r
13610 case "$d_getpwnam_r" in
13612 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13613 case "$d_getpwnam_r_proto:$usethreads" in
13614 ":define") d_getpwnam_r_proto=define
13615 set d_getpwnam_r_proto getpwnam_r $hdrs
13619 case "$d_getpwnam_r_proto" in
13621 case "$getpwnam_r_proto" in
13622 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
13623 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
13625 case "$getpwnam_r_proto" in
13626 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
13627 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
13629 case "$getpwnam_r_proto" in
13630 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
13631 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
13633 case "$getpwnam_r_proto" in
13634 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
13635 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
13637 case "$getpwnam_r_proto" in
13638 ''|0) d_getpwnam_r=undef
13640 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
13641 * ) case "$getpwnam_r_proto" in
13642 REENTRANT_PROTO*) ;;
13643 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
13645 echo "Prototype: $try" ;;
13648 *) case "$usethreads" in
13649 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
13656 *) getpwnam_r_proto=0
13660 : see if getpwuid_r exists
13661 set getpwuid_r d_getpwuid_r
13663 case "$d_getpwuid_r" in
13665 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13666 case "$d_getpwuid_r_proto:$usethreads" in
13667 ":define") d_getpwuid_r_proto=define
13668 set d_getpwuid_r_proto getpwuid_r $hdrs
13672 case "$d_getpwuid_r_proto" in
13674 case "$getpwuid_r_proto" in
13675 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
13676 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
13678 case "$getpwuid_r_proto" in
13679 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
13680 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
13682 case "$getpwuid_r_proto" in
13683 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
13684 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
13686 case "$getpwuid_r_proto" in
13687 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
13688 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
13690 case "$getpwuid_r_proto" in
13691 ''|0) d_getpwuid_r=undef
13693 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
13694 * ) case "$getpwuid_r_proto" in
13695 REENTRANT_PROTO*) ;;
13696 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
13698 echo "Prototype: $try" ;;
13701 *) case "$usethreads" in
13702 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
13709 *) getpwuid_r_proto=0
13714 : see if getservbyname exists
13715 set getservbyname d_getsbyname
13718 : see if getservbyport exists
13719 set getservbyport d_getsbyport
13722 : see if getservent exists
13723 set getservent d_getsent
13726 : see if getservbyname_r exists
13727 set getservbyname_r d_getservbyname_r
13729 case "$d_getservbyname_r" in
13731 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13732 case "$d_getservbyname_r_proto:$usethreads" in
13733 ":define") d_getservbyname_r_proto=define
13734 set d_getservbyname_r_proto getservbyname_r $hdrs
13738 case "$d_getservbyname_r_proto" in
13740 case "$getservbyname_r_proto" in
13741 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
13742 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
13744 case "$getservbyname_r_proto" in
13745 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
13746 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
13748 case "$getservbyname_r_proto" in
13749 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
13750 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
13752 case "$getservbyname_r_proto" in
13753 ''|0) d_getservbyname_r=undef
13754 getservbyname_r_proto=0
13755 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
13756 * ) case "$getservbyname_r_proto" in
13757 REENTRANT_PROTO*) ;;
13758 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
13760 echo "Prototype: $try" ;;
13763 *) case "$usethreads" in
13764 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
13766 d_getservbyname_r=undef
13767 getservbyname_r_proto=0
13771 *) getservbyname_r_proto=0
13775 : see if getservbyport_r exists
13776 set getservbyport_r d_getservbyport_r
13778 case "$d_getservbyport_r" in
13780 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13781 case "$d_getservbyport_r_proto:$usethreads" in
13782 ":define") d_getservbyport_r_proto=define
13783 set d_getservbyport_r_proto getservbyport_r $hdrs
13787 case "$d_getservbyport_r_proto" in
13789 case "$getservbyport_r_proto" in
13790 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
13791 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
13793 case "$getservbyport_r_proto" in
13794 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
13795 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
13797 case "$getservbyport_r_proto" in
13798 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
13799 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
13801 case "$getservbyport_r_proto" in
13802 ''|0) d_getservbyport_r=undef
13803 getservbyport_r_proto=0
13804 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
13805 * ) case "$getservbyport_r_proto" in
13806 REENTRANT_PROTO*) ;;
13807 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
13809 echo "Prototype: $try" ;;
13812 *) case "$usethreads" in
13813 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
13815 d_getservbyport_r=undef
13816 getservbyport_r_proto=0
13820 *) getservbyport_r_proto=0
13824 : see if getservent_r exists
13825 set getservent_r d_getservent_r
13827 case "$d_getservent_r" in
13829 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13830 case "$d_getservent_r_proto:$usethreads" in
13831 ":define") d_getservent_r_proto=define
13832 set d_getservent_r_proto getservent_r $hdrs
13836 case "$d_getservent_r_proto" in
13838 case "$getservent_r_proto" in
13839 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
13840 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
13842 case "$getservent_r_proto" in
13843 ''|0) try='int getservent_r(struct servent*, char*, int);'
13844 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
13846 case "$getservent_r_proto" in
13847 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
13848 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
13850 case "$getservent_r_proto" in
13851 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
13852 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
13854 case "$getservent_r_proto" in
13855 ''|0) d_getservent_r=undef
13856 getservent_r_proto=0
13857 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
13858 * ) case "$getservent_r_proto" in
13859 REENTRANT_PROTO*) ;;
13860 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
13862 echo "Prototype: $try" ;;
13865 *) case "$usethreads" in
13866 define) echo "getservent_r has no prototype, not using it." >&4 ;;
13868 d_getservent_r=undef
13869 getservent_r_proto=0
13873 *) getservent_r_proto=0
13877 : see if prototypes for various getservxxx netdb.h functions are available
13879 set d_getservprotos getservent $i_netdb netdb.h
13882 : see if getspnam exists
13883 set getspnam d_getspnam
13886 : see if this is a shadow.h system
13887 set shadow.h i_shadow
13890 : see if getspnam_r exists
13891 set getspnam_r d_getspnam_r
13893 case "$d_getspnam_r" in
13895 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
13896 case "$d_getspnam_r_proto:$usethreads" in
13897 ":define") d_getspnam_r_proto=define
13898 set d_getspnam_r_proto getspnam_r $hdrs
13902 case "$d_getspnam_r_proto" in
13904 case "$getspnam_r_proto" in
13905 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
13906 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
13908 case "$getspnam_r_proto" in
13909 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
13910 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
13912 case "$getspnam_r_proto" in
13913 ''|0) d_getspnam_r=undef
13915 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
13916 * ) case "$getspnam_r_proto" in
13917 REENTRANT_PROTO*) ;;
13918 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
13920 echo "Prototype: $try" ;;
13923 *) case "$usethreads" in
13924 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
13931 *) getspnam_r_proto=0
13935 : see if gettimeofday or ftime exists
13936 set gettimeofday d_gettimeod
13938 case "$d_gettimeod" in
13944 val="$undef"; set d_ftime; eval $setvar
13947 case "$d_gettimeod$d_ftime" in
13950 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
13954 : see if gmtime_r exists
13955 set gmtime_r d_gmtime_r
13957 case "$d_gmtime_r" in
13959 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
13960 case "$d_gmtime_r_proto:$usethreads" in
13961 ":define") d_gmtime_r_proto=define
13962 set d_gmtime_r_proto gmtime_r $hdrs
13966 case "$d_gmtime_r_proto" in
13968 case "$gmtime_r_proto" in
13969 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
13970 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
13972 case "$gmtime_r_proto" in
13973 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
13974 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
13976 case "$gmtime_r_proto" in
13977 ''|0) d_gmtime_r=undef
13979 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
13980 * ) case "$gmtime_r_proto" in
13981 REENTRANT_PROTO*) ;;
13982 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
13984 echo "Prototype: $try" ;;
13987 *) case "$usethreads" in
13988 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
13995 *) gmtime_r_proto=0
13999 : see if hasmntopt exists
14000 set hasmntopt d_hasmntopt
14003 : see if this is a netinet/in.h or sys/in.h system
14004 set netinet/in.h i_niin sys/in.h i_sysin
14007 : see if arpa/inet.h has to be included
14008 set arpa/inet.h i_arpainet
14011 : see if htonl --and friends-- exists
14016 : Maybe they are macros.
14019 $cat >htonl.c <<EOM
14021 #include <sys/types.h>
14022 #$i_niin I_NETINET_IN
14024 #$i_arpainet I_ARPA_INET
14025 #ifdef I_NETINET_IN
14026 #include <netinet/in.h>
14029 #include <sys/in.h>
14032 #include <arpa/inet.h>
14035 printf("Defined as a macro.");
14038 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14039 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14041 echo "But it seems to be defined as a macro." >&4
14049 : see if ilogbl exists
14050 set ilogbl d_ilogbl
14055 if set index val -f; eval $csym; $val; then
14056 if set strchr val -f d_strchr; eval $csym; $val; then
14057 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14060 echo "strchr() found." >&4
14064 echo "index() found." >&4
14069 echo "index() found." >&4
14072 if set strchr val -f d_strchr; eval $csym; $val; then
14075 echo "strchr() found." >&4
14077 echo "No index() or strchr() found!" >&4
14082 set d_strchr; eval $setvar
14084 set d_index; eval $setvar
14086 : check whether inet_aton exists
14087 set inet_aton d_inetaton
14092 $cat >isascii.c <<EOCP
14095 #$i_stdlib I_STDLIB
14097 #include <stdlib.h>
14108 if eval $compile; then
14109 echo "isascii() found." >&4
14112 echo "isascii() NOT found." >&4
14119 : see if isfinite exists
14120 set isfinite d_isfinite
14123 : see if isinf exists
14127 : see if isnan exists
14131 : see if isnanl exists
14132 set isnanl d_isnanl
14135 : see if killpg exists
14136 set killpg d_killpg
14139 : see if lchown exists
14141 $cat > try.c <<'EOCP'
14142 /* System header to define __stub macros and hopefully few prototypes,
14143 which can conflict with char lchown(); below. */
14144 #include <assert.h>
14145 /* Override any gcc2 internal prototype to avoid an error. */
14146 /* We use char because int might match the return type of a gcc2
14147 builtin and then its argument prototype would still apply. */
14150 /* The GNU C library defines this for functions which it implements
14151 to always fail with ENOSYS. Some functions are actually named
14152 something starting with __ and the normal name is an alias. */
14153 #if defined (__stub_lchown) || defined (__stub___lchown)
14161 if eval $compile; then
14162 $echo "lchown() found." >&4
14165 $echo "lchown() NOT found." >&4
14171 : See if number of significant digits in a double precision number is known
14173 $cat >ldbl_dig.c <<EOM
14174 #$i_limits I_LIMITS
14177 #include <limits.h>
14183 printf("Contains LDBL_DIG");
14186 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14187 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14188 echo "LDBL_DIG found." >&4
14191 echo "LDBL_DIG NOT found." >&4
14198 : see if this is a math.h system
14202 d_libm_lib_version="$undef"
14205 : check to see if math.h defines _LIB_VERSION
14207 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14209 #include <unistd.h>
14211 int main (int argc, char *argv[])
14213 printf ("%d\n", _LIB_VERSION);
14218 if eval $compile; then
14220 echo "Yes, it does ($foo)" >&4
14221 d_libm_lib_version="$define"
14223 echo "No, it does not (probably harmless)\n" >&4
14225 $rm -f try.* try core core.try.*
14230 : see if link exists
14234 : see if localtime_r exists
14235 set localtime_r d_localtime_r
14237 case "$d_localtime_r" in
14239 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14240 case "$d_localtime_r_proto:$usethreads" in
14241 ":define") d_localtime_r_proto=define
14242 set d_localtime_r_proto localtime_r $hdrs
14246 case "$d_localtime_r_proto" in
14248 case "$localtime_r_proto" in
14249 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14250 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14252 case "$localtime_r_proto" in
14253 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14254 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14256 case "$localtime_r_proto" in
14257 ''|0) d_localtime_r=undef
14258 localtime_r_proto=0
14259 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14260 * ) case "$localtime_r_proto" in
14261 REENTRANT_PROTO*) ;;
14262 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14264 echo "Prototype: $try" ;;
14267 *) case "$usethreads" in
14268 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14270 d_localtime_r=undef
14271 localtime_r_proto=0
14275 *) localtime_r_proto=0
14279 : see if localeconv exists
14280 set localeconv d_locconv
14283 : see if lockf exists
14287 : see if prototype for lseek is available
14289 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14292 : see if lstat exists
14296 : see if madvise exists
14297 set madvise d_madvise
14300 : see if malloc_size exists
14301 set malloc_size d_malloc_size
14304 : see if malloc_size_good exists
14305 set malloc_good_size d_malloc_good_size
14308 : see if mblen exists
14312 : see if mbstowcs exists
14313 set mbstowcs d_mbstowcs
14316 : see if mbtowc exists
14317 set mbtowc d_mbtowc
14320 : see if memchr exists
14321 set memchr d_memchr
14324 : see if memcmp exists
14325 set memcmp d_memcmp
14328 : see if memcpy exists
14329 set memcpy d_memcpy
14332 : see if memmove exists
14333 set memmove d_memmove
14336 : see if memset exists
14337 set memset d_memset
14340 : see if mkdir exists
14344 : see if mkdtemp exists
14345 set mkdtemp d_mkdtemp
14348 : see if mkfifo exists
14349 set mkfifo d_mkfifo
14352 : see if mkstemp exists
14353 set mkstemp d_mkstemp
14356 : see if mkstemps exists
14357 set mkstemps d_mkstemps
14360 : see if mktime exists
14361 set mktime d_mktime
14364 : see if this is a sys/mman.h system
14365 set sys/mman.h i_sysmman
14368 : see if mmap exists
14371 : see what shmat returns
14372 : default to something harmless
14374 case "$i_sysmman$d_mmap" in
14376 $cat >mmap.c <<'END'
14377 #include <sys/mman.h>
14380 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14385 echo "and it returns ($mmaptype)." >&4
14391 : see if sqrtl exists
14395 : see if scalbnl exists
14396 set scalbnl d_scalbnl
14399 : see if modfl exists
14403 : see if prototype for modfl is available
14405 set d_modflproto modfl $i_math math.h
14408 d_modfl_pow32_bug="$undef"
14410 case "$d_longdbl$d_modfl" in
14413 Checking to see whether your modfl() is okay for large values...
14419 if $test "X$d_modflproto" != "X$define"; then
14420 $cat >>try.c <<EOCP
14421 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14422 long double modfl (long double, long double *);
14425 $cat >>try.c <<EOCP
14427 long double nv = 4294967303.15;
14433 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14437 case "$osname:$gccversion" in
14438 aix:) saveccflags="$ccflags"
14439 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14442 if eval $compile; then
14445 *" 4294967303.150000 1.150000 4294967302.000000")
14446 echo >&4 "Your modfl() is broken for large values."
14447 d_modfl_pow32_bug="$define"
14449 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14453 *" 4294967303.150000 0.150000 4294967303.000000")
14454 echo >&4 "Your modfl() seems okay for large values."
14456 *) echo >&4 "I don't understand your modfl() at all."
14460 $rm -f try.* try core core.try.*
14462 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14465 case "$osname:$gccversion" in
14466 aix:) ccflags="$saveccflags" ;; # restore
14471 if $test "$uselongdouble" = "$define"; then
14473 if $test "$d_sqrtl" != "$define"; then
14474 message="$message sqrtl"
14476 if $test "$d_modfl" != "$define"; then
14477 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14478 echo "You have both aintl and copysignl, so I can emulate modfl."
14480 message="$message modfl"
14483 if $test "$d_frexpl" != "$define"; then
14484 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14485 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14487 message="$message frexpl"
14491 if $test "$message" != ""; then
14494 *** You requested the use of long doubles but you do not seem to have
14495 *** the following mathematical functions needed for long double support:
14497 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
14498 *** Cannot continue, aborting.
14506 : see if mprotect exists
14507 set mprotect d_mprotect
14510 : see if msgctl exists
14511 set msgctl d_msgctl
14514 : see if msgget exists
14515 set msgget d_msgget
14518 : see if msgsnd exists
14519 set msgsnd d_msgsnd
14522 : see if msgrcv exists
14523 set msgrcv d_msgrcv
14526 : see how much of the 'msg*(2)' library is present.
14529 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
14530 *"$undef"*) h_msg=false;;
14534 case "`ipcs 2>&1`" in
14535 "SVID messages"*"not configured"*)
14536 echo "Your $osname does not have the msg*(2) configured." >&4
14539 set msgctl d_msgctl
14541 set msgget d_msgget
14543 set msgsnd d_msgsnd
14545 set msgrcv d_msgrcv
14551 : we could also check for sys/ipc.h ...
14552 if $h_msg && $test `./findhdr sys/msg.h`; then
14553 echo "You have the full msg*(2) library." >&4
14556 echo "You don't have the full msg*(2) library." >&4
14564 echo "Checking to see if your system supports struct msghdr..." >&4
14565 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
14567 case "$d_msghdr_s" in
14568 "$define") echo "Yes, it does." ;;
14569 *) echo "No, it doesn't." ;;
14573 : see if msync exists
14577 : see if munmap exists
14578 set munmap d_munmap
14581 : see if nice exists
14585 : see if this is a langinfo.h system
14586 set langinfo.h i_langinfo
14589 : see if nl_langinfo exists
14590 set nl_langinfo d_nl_langinfo
14593 : check for length of character
14595 case "$charsize" in
14597 echo "Checking to see how big your characters are (hey, you never know)..." >&4
14600 #$i_stdlib I_STDLIB
14602 #include <stdlib.h>
14606 printf("%d\n", (int)sizeof(char));
14611 if eval $compile_ok; then
14615 echo "(I can't seem to compile the test program. Guessing...)"
14622 rp="What is the size of a character (in bytes)?"
14627 : check for volatile keyword
14629 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
14630 $cat >try.c <<'EOCP'
14633 typedef struct _goo_struct goo_struct;
14634 goo_struct * volatile goo = ((goo_struct *)0);
14635 struct _goo_struct {
14640 typedef unsigned short foo_t;
14641 char *volatile foo;
14643 volatile foo_t blech;
14647 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
14649 echo "Yup, it does."
14652 echo "Nope, it doesn't."
14660 $echo "Choosing the C types to be used for Perl's internal types..." >&4
14662 case "$use64bitint:$d_quad:$quadtype" in
14665 uvtype="$uquadtype"
14670 uvtype="unsigned long"
14676 case "$uselongdouble:$d_longdbl" in
14678 nvtype="long double"
14679 nvsize=$longdblsize
14686 $echo "(IV will be "$ivtype", $ivsize bytes)"
14687 $echo "(UV will be "$uvtype", $uvsize bytes)"
14688 $echo "(NV will be "$nvtype", $nvsize bytes)"
14691 #$i_inttypes I_INTTYPES
14693 #include <inttypes.h>
14698 int8_t i = INT8_MAX;
14699 uint8_t u = UINT8_MAX;
14700 printf("int8_t\n");
14703 int16_t i = INT16_MAX;
14704 uint16_t i = UINT16_MAX;
14705 printf("int16_t\n");
14708 int32_t i = INT32_MAX;
14709 uint32_t u = UINT32_MAX;
14710 printf("int32_t\n");
14716 '') case "$charsize" in
14718 u8type="unsigned char"
14727 if eval $compile; then
14728 case "`$run ./try`" in
14729 int8_t) i8type=int8_t
14739 '') if $test $charsize -ge 1; then
14741 u8type="unsigned char"
14749 '') case "$shortsize" in
14751 u16type="unsigned short"
14759 '') set try -DINT16
14760 if eval $compile; then
14761 case "`$run ./try`" in
14773 '') if $test $shortsize -ge 2; then
14775 u16type="unsigned short"
14783 '') case "$longsize" in
14785 u32type="unsigned long"
14789 *) case "$intsize" in
14791 u32type="unsigned int"
14801 '') set try -DINT32
14802 if eval $compile; then
14803 case "`$run ./try`" in
14815 '') if $test $intsize -ge 4; then
14817 u32type="unsigned int"
14825 '') case "$d_quad:$quadtype" in
14827 i64type="$quadtype"
14828 u64type="$uquadtype"
14836 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
14837 : volatile so that the compiler has to store it out to memory.
14838 if test X"$d_volatile" = X"$define"; then
14843 #$i_stdlib I_STDLIB
14845 #include <stdlib.h>
14847 #include <sys/types.h>
14848 #include <signal.h>
14850 $volatile int bletched = 0;
14851 $signal_t blech(s) int s; { bletched = 1; }
14856 int n = 8 * $uvsize;
14859 signal(SIGFPE, blech);
14862 for (i = 0; i < n; i++) {
14863 u = u << 1 | ($uvtype)1;
14865 if (($uvtype)d != u)
14869 d = ($nvtype)(u - 1);
14870 if (($uvtype)d != (u - 1))
14878 printf("%d\n", ((i == n) ? -n : i));
14884 d_nv_preserves_uv="$undef"
14885 if eval $compile; then
14886 nv_preserves_uv_bits="`$run ./try`"
14888 case "$nv_preserves_uv_bits" in
14890 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
14891 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
14892 d_nv_preserves_uv="$define"
14894 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
14895 d_nv_preserves_uv="$undef" ;;
14896 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
14897 nv_preserves_uv_bits="$undef" ;;
14902 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
14903 : volatile so that the compiler has to store it out to memory.
14904 if test X"$d_volatile" = X"$define"; then
14909 #$i_stdlib I_STDLIB
14911 #include <stdlib.h>
14913 #$i_string I_STRING
14915 # include <string.h>
14917 # include <strings.h>
14919 #include <sys/types.h>
14920 #include <signal.h>
14922 $volatile int bletched = 0;
14923 $signal_t blech(s) int s; { bletched = 1; }
14926 int checkit($nvtype d, char *where) {
14927 unsigned char *p = (char *)&d;
14928 unsigned char *end = p + sizeof(d);
14938 printf("No - %s: 0x", where);
14940 printf ("%02X", *p++);
14945 int main(int argc, char **argv) {
14948 fail += checkit(d, "0.0");
14950 /* The compiler shouldn't be assuming that bletched is 0 */
14953 fail += checkit(d, "bleched");
14956 signal(SIGFPE, blech);
14959 /* Paranoia - the compiler should have no way of knowing that ANSI says
14960 that argv[argc] will always be NULL. Actually, if it did assume this it
14961 would be buggy, as this is C and main() can be called from elsewhere in
14963 d = argv[argc] ? 1 : 0;
14966 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
14969 fail += checkit(d, "ternary");
14971 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
14974 printf("No - memset doesn't give 0.0\n");
14975 /* This might just blow up: */
14976 printf("(gives %g)\n", d);
14982 printf("No - something bleched\n");
14987 printf("No - %d fail(s)\n", fail);
14996 d_nv_zero_is_allbits_zero="$undef"
14997 if eval $compile; then
15003 0.0 is represented as all bits zero in memory
15005 d_nv_zero_is_allbits_zero="$define"
15008 0.0 is not represented as all bits zero in memory
15010 d_nv_zero_is_allbits_zero="$undef"
15015 0.0 is not represented as all bits zero in memory
15017 d_nv_zero_is_allbits_zero="$undef"
15025 : check for off64_t
15027 echo "Checking to see if you have off64_t..." >&4
15029 #include <sys/types.h>
15030 #include <unistd.h>
15031 int main() { off64_t x = 7; }
15034 if eval $compile; then
15036 echo "You have off64_t."
15039 echo "You do not have off64_t."
15040 case "$lseeksize" in
15041 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15048 : how to create joinable pthreads
15049 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15051 echo "Checking what constant to use for creating joinable pthreads..." >&4
15052 $cat >try.c <<'EOCP'
15053 #include <pthread.h>
15055 int detachstate = JOINABLE;
15058 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15059 if eval $compile; then
15060 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15061 val="$undef" # Yes, undef.
15062 set d_old_pthread_create_joinable
15065 set old_pthread_create_joinable
15068 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15069 if eval $compile; then
15070 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15072 set d_old_pthread_create_joinable
15074 val=PTHREAD_CREATE_UNDETACHED
15075 set old_pthread_create_joinable
15078 set try -DJOINABLE=__UNDETACHED
15079 if eval $compile; then
15080 echo "You seem to use __UNDETACHED." >&4
15082 set d_old_pthread_create_joinable
15085 set old_pthread_create_joinable
15088 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15090 set d_old_pthread_create_joinable
15093 set old_pthread_create_joinable
15100 d_old_pthread_create_joinable="$undef"
15101 old_pthread_create_joinable=""
15104 : see if pause exists
15108 : see if pipe exists
15112 : see if poll exists
15116 : see if readlink exists
15117 set readlink d_readlink
15123 case "$d_readlink" in
15125 if $issymlink /proc/self/exe ; then
15126 $ls -l /proc/self/exe > reflect
15127 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15128 echo "You have Linux-like /proc/self/exe."
15129 procselfexe='"/proc/self/exe"'
15133 if $issymlink /proc/curproc/file ; then
15134 $ls -l /proc/curproc/file > reflect
15135 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15136 echo "You have BSD-like /proc/curproc/file."
15137 procselfexe='"/proc/curproc/file"'
15147 : see whether the pthread_atfork exists
15149 #include <pthread.h>
15152 #ifdef PTHREAD_ATFORK
15153 pthread_atfork(NULL,NULL,NULL);
15158 : see if pthread_atfork exists
15159 set try -DPTHREAD_ATFORK
15160 if eval $compile; then
15165 case "$usethreads" in
15168 $define) echo 'pthread_atfork found.' >&4 ;;
15169 *) echo 'pthread_atfork NOT found.' >&4 ;;
15172 set d_pthread_atfork
15175 : see if pthread_attr_setscope exists
15176 set pthread_attr_setscope d_pthread_attr_setscope
15180 : see whether the various POSIXish _yields exist
15182 #include <pthread.h>
15188 #ifdef PTHREAD_YIELD
15191 #ifdef PTHREAD_YIELD_NULL
15192 pthread_yield(NULL);
15198 : see if sched_yield exists
15199 set try -DSCHED_YIELD
15200 if eval $compile; then
15202 sched_yield='sched_yield()'
15206 case "$usethreads" in
15209 $define) echo 'sched_yield() found.' >&4 ;;
15210 *) echo 'sched_yield() NOT found.' >&4 ;;
15216 : see if pthread_yield exists
15217 set try -DPTHREAD_YIELD
15218 if eval $compile; then
15220 case "$sched_yield" in
15221 '') sched_yield='pthread_yield()' ;;
15224 set try -DPTHREAD_YIELD_NULL
15225 if eval $compile; then
15227 case "$sched_yield" in
15228 '') sched_yield='pthread_yield(NULL)' ;;
15234 case "$usethreads" in
15237 $define) echo 'pthread_yield() found.' >&4 ;;
15238 *) echo 'pthread_yield() NOT found.' >&4 ;;
15242 set d_pthread_yield
15245 case "$sched_yield" in
15246 '') sched_yield=undef ;;
15251 : see if random_r exists
15252 set random_r d_random_r
15254 case "$d_random_r" in
15256 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15257 case "$d_random_r_proto:$usethreads" in
15258 ":define") d_random_r_proto=define
15259 set d_random_r_proto random_r $hdrs
15263 case "$d_random_r_proto" in
15265 case "$random_r_proto" in
15266 ''|0) try='int random_r(int*, struct random_data*);'
15267 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15269 case "$random_r_proto" in
15270 ''|0) try='int random_r(long*, struct random_data*);'
15271 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15273 case "$random_r_proto" in
15274 ''|0) try='int random_r(struct random_data*, int32_t*);'
15275 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15277 case "$random_r_proto" in
15278 ''|0) d_random_r=undef
15280 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15281 * ) case "$random_r_proto" in
15282 REENTRANT_PROTO*) ;;
15283 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15285 echo "Prototype: $try" ;;
15288 *) case "$usethreads" in
15289 define) echo "random_r has no prototype, not using it." >&4 ;;
15296 *) random_r_proto=0
15300 : see if readdir and friends exist
15301 set readdir d_readdir
15303 set seekdir d_seekdir
15305 set telldir d_telldir
15307 set rewinddir d_rewinddir
15310 : see if readdir64_r exists
15311 set readdir64_r d_readdir64_r
15313 case "$d_readdir64_r" in
15315 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15316 case "$d_readdir64_r_proto:$usethreads" in
15317 ":define") d_readdir64_r_proto=define
15318 set d_readdir64_r_proto readdir64_r $hdrs
15322 case "$d_readdir64_r_proto" in
15324 case "$readdir64_r_proto" in
15325 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15326 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15328 case "$readdir64_r_proto" in
15329 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15330 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15332 case "$readdir64_r_proto" in
15333 ''|0) d_readdir64_r=undef
15334 readdir64_r_proto=0
15335 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15336 * ) case "$readdir64_r_proto" in
15337 REENTRANT_PROTO*) ;;
15338 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15340 echo "Prototype: $try" ;;
15343 *) case "$usethreads" in
15344 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15346 d_readdir64_r=undef
15347 readdir64_r_proto=0
15351 *) readdir64_r_proto=0
15355 : see if readdir_r exists
15356 set readdir_r d_readdir_r
15358 case "$d_readdir_r" in
15360 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15361 case "$d_readdir_r_proto:$usethreads" in
15362 ":define") d_readdir_r_proto=define
15363 set d_readdir_r_proto readdir_r $hdrs
15367 case "$d_readdir_r_proto" in
15369 case "$readdir_r_proto" in
15370 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15371 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15373 case "$readdir_r_proto" in
15374 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15375 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15377 case "$readdir_r_proto" in
15378 ''|0) d_readdir_r=undef
15380 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15381 * ) case "$readdir_r_proto" in
15382 REENTRANT_PROTO*) ;;
15383 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15385 echo "Prototype: $try" ;;
15388 *) case "$usethreads" in
15389 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15396 *) readdir_r_proto=0
15400 : see if readv exists
15404 : see if recvmsg exists
15405 set recvmsg d_recvmsg
15408 : see if rename exists
15409 set rename d_rename
15412 : see if rmdir exists
15416 : see if memory.h is available.
15421 : See if it conflicts with string.h
15427 $cppstdin $cppflags $cppminus < $strings > mem.h
15428 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15430 echo "We won't be including <memory.h>."
15440 : can bcopy handle overlapping blocks?
15443 case "$d_memmove" in
15444 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15445 *) case "$d_bcopy" in
15447 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15449 #$i_memory I_MEMORY
15450 #$i_stdlib I_STDLIB
15451 #$i_string I_STRING
15452 #$i_unistd I_UNISTD
15454 $cat >>try.c <<'EOCP'
15457 # include <memory.h>
15460 # include <stdlib.h>
15463 # include <string.h>
15465 # include <strings.h>
15468 # include <unistd.h> /* Needed for NetBSD */
15472 char buf[128], abc[128];
15478 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15479 try to store the string in read-only memory. */
15480 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15482 for (align = 7; align >= 0; align--) {
15483 for (len = 36; len; len--) {
15485 bcopy(abc, b, len);
15486 for (off = 1; off <= len; off++) {
15487 bcopy(b, b+off, len);
15488 bcopy(b+off, b, len);
15489 if (bcmp(b, abc, len))
15498 if eval $compile_ok; then
15499 if ./try 2>/dev/null; then
15500 echo "Yes, it can."
15503 echo "It can't, sorry."
15506 echo "(I can't compile the test program, so we'll assume not...)"
15510 $rm -f try.* try core
15516 : can memcpy handle overlapping blocks?
15519 case "$d_memmove" in
15520 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
15521 *) case "$d_memcpy" in
15523 echo "Checking to see if memcpy() can do overlapping copies..." >&4
15525 #$i_memory I_MEMORY
15526 #$i_stdlib I_STDLIB
15527 #$i_string I_STRING
15528 #$i_unistd I_UNISTD
15530 $cat >>try.c <<'EOCP'
15533 # include <memory.h>
15536 # include <stdlib.h>
15539 # include <string.h>
15541 # include <strings.h>
15544 # include <unistd.h> /* Needed for NetBSD */
15548 char buf[128], abc[128];
15554 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15555 try to store the string in read-only memory. */
15556 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
15558 for (align = 7; align >= 0; align--) {
15559 for (len = 36; len; len--) {
15561 memcpy(b, abc, len);
15562 for (off = 1; off <= len; off++) {
15563 memcpy(b+off, b, len);
15564 memcpy(b, b+off, len);
15565 if (memcmp(b, abc, len))
15574 if eval $compile_ok; then
15575 if ./try 2>/dev/null; then
15576 echo "Yes, it can."
15579 echo "It can't, sorry."
15582 echo "(I can't compile the test program, so we'll assume not...)"
15586 $rm -f try.* try core
15592 : can memcmp be trusted to compare relative magnitude?
15594 case "$d_memcmp" in
15597 echo "Checking if your memcmp() can compare relative magnitude..." >&4
15599 #$i_memory I_MEMORY
15600 #$i_stdlib I_STDLIB
15601 #$i_string I_STRING
15602 #$i_unistd I_UNISTD
15604 $cat >>try.c <<'EOCP'
15607 # include <memory.h>
15610 # include <stdlib.h>
15613 # include <string.h>
15615 # include <strings.h>
15618 # include <unistd.h> /* Needed for NetBSD */
15624 if ((a < b) && memcmp(&a, &b, 1) < 0)
15630 if eval $compile_ok; then
15631 if $run ./try 2>/dev/null; then
15632 echo "Yes, it can."
15635 echo "No, it can't (it uses signed chars)."
15638 echo "(I can't compile the test program, so we'll assume not...)"
15642 $rm -f try.* try core
15646 : see if prototype for sbrk is available
15648 set d_sbrkproto sbrk $i_unistd unistd.h
15651 : see if select exists
15652 set select d_select
15655 : see if semctl exists
15656 set semctl d_semctl
15659 : see if semget exists
15660 set semget d_semget
15663 : see if semop exists
15667 : see how much of the 'sem*(2)' library is present.
15670 case "$d_semctl$d_semget$d_semop" in
15671 *"$undef"*) h_sem=false;;
15675 case "`ipcs 2>&1`" in
15676 "SVID messages"*"not configured"*)
15677 echo "Your $osname does not have the sem*(2) configured." >&4
15680 set semctl d_semctl
15682 set semget d_semget
15690 : we could also check for sys/ipc.h ...
15691 if $h_sem && $test `./findhdr sys/sem.h`; then
15692 echo "You have the full sem*(2) library." >&4
15695 echo "You don't have the full sem*(2) library." >&4
15701 : see whether sys/sem.h defines union semun
15703 $cat > try.c <<'END'
15704 #include <sys/types.h>
15705 #include <sys/ipc.h>
15706 #include <sys/sem.h>
15707 int main () { union semun semun; semun.buf = 0; }
15710 if eval $compile; then
15711 echo "You have union semun in <sys/sem.h>." >&4
15714 echo "You do not have union semun in <sys/sem.h>." >&4
15721 : see how to do semctl IPC_STAT
15728 # define S_IRUSR S_IREAD
15729 # define S_IWUSR S_IWRITE
15730 # define S_IXUSR S_IEXEC
15732 # define S_IRUSR 0400
15733 # define S_IWUSR 0200
15734 # define S_IXUSR 0100
15736 # define S_IRGRP (S_IRUSR>>3)
15737 # define S_IWGRP (S_IWUSR>>3)
15738 # define S_IXGRP (S_IXUSR>>3)
15739 # define S_IROTH (S_IRUSR>>6)
15740 # define S_IWOTH (S_IWUSR>>6)
15741 # define S_IXOTH (S_IXUSR>>6)
15744 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
15745 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
15746 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
15749 : see whether semctl IPC_STAT can use union semun
15750 case "$d_semctl_semun" in
15754 #include <sys/types.h>
15755 #include <sys/ipc.h>
15756 #include <sys/sem.h>
15757 #include <sys/stat.h>
15764 #$d_union_semun HAS_UNION_SEMUN
15767 #ifndef HAS_UNION_SEMUN
15770 struct semid_ds *buf;
15771 unsigned short *array;
15777 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15778 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15780 struct semid_ds argbuf;
15783 st = semctl(sem, 0, IPC_STAT, arg);
15787 # endif /* IPC_STAT */
15788 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15790 if (semctl(sem, 0, IPC_RMID, arg) != 0)
15791 # endif /* IPC_RMID */
15792 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15794 #endif /* IPC_PRIVATE && ... */
15795 printf("semget failed: errno = %d\n", errno);
15800 if eval $compile; then
15803 semun) val="$define" ;;
15811 case "$d_semctl_semun" in
15813 echo "You can use union semun for semctl IPC_STAT." >&4
15816 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
15821 : see whether semctl IPC_STAT can use struct semid_ds pointer
15822 case "$d_semctl_semid_ds" in
15825 $cat > try.c <<'END'
15826 #include <sys/types.h>
15827 #include <sys/ipc.h>
15828 #include <sys/sem.h>
15829 #include <sys/stat.h>
15837 struct semid_ds arg;
15840 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15841 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15844 st = semctl(sem, 0, IPC_STAT, &arg);
15846 printf("semid_ds\n");
15848 # endif /* IPC_STAT */
15849 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15851 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
15852 # endif /* IPC_RMID */
15853 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15855 #endif /* IPC_PRIVATE && ... */
15856 printf("semget failed: errno = %d\n", errno);
15862 if eval $compile; then
15865 semid_ds) val="$define" ;;
15869 set d_semctl_semid_ds
15873 case "$d_semctl_semid_ds" in
15875 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
15877 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
15884 # We do not have the full sem*(2) library, so assume we can not
15890 set d_semctl_semid_ds
15895 : see if sendmsg exists
15896 set sendmsg d_sendmsg
15899 : see if setegid exists
15900 set setegid d_setegid
15903 : see if seteuid exists
15904 set seteuid d_seteuid
15907 : see if setgrent exists
15908 set setgrent d_setgrent
15911 : see if setgrent_r exists
15912 set setgrent_r d_setgrent_r
15914 case "$d_setgrent_r" in
15916 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
15917 case "$d_setgrent_r_proto:$usethreads" in
15918 ":define") d_setgrent_r_proto=define
15919 set d_setgrent_r_proto setgrent_r $hdrs
15923 case "$d_setgrent_r_proto" in
15925 case "$setgrent_r_proto" in
15926 ''|0) try='int setgrent_r(FILE**);'
15927 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
15929 case "$setgrent_r_proto" in
15930 ''|0) try='void setgrent_r(FILE**);'
15931 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
15933 case "$setgrent_r_proto" in
15934 ''|0) d_setgrent_r=undef
15936 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
15937 * ) case "$setgrent_r_proto" in
15938 REENTRANT_PROTO*) ;;
15939 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
15941 echo "Prototype: $try" ;;
15944 *) case "$usethreads" in
15945 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
15952 *) setgrent_r_proto=0
15956 : see if sethostent exists
15957 set sethostent d_sethent
15960 : see if sethostent_r exists
15961 set sethostent_r d_sethostent_r
15963 case "$d_sethostent_r" in
15965 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15966 case "$d_sethostent_r_proto:$usethreads" in
15967 ":define") d_sethostent_r_proto=define
15968 set d_sethostent_r_proto sethostent_r $hdrs
15972 case "$d_sethostent_r_proto" in
15974 case "$sethostent_r_proto" in
15975 ''|0) try='int sethostent_r(int, struct hostent_data*);'
15976 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
15978 case "$sethostent_r_proto" in
15979 ''|0) try='void sethostent_r(int, struct hostent_data*);'
15980 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
15982 case "$sethostent_r_proto" in
15983 ''|0) d_sethostent_r=undef
15984 sethostent_r_proto=0
15985 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
15986 * ) case "$sethostent_r_proto" in
15987 REENTRANT_PROTO*) ;;
15988 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
15990 echo "Prototype: $try" ;;
15993 *) case "$usethreads" in
15994 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
15996 d_sethostent_r=undef
15997 sethostent_r_proto=0
16001 *) sethostent_r_proto=0
16005 : see if setitimer exists
16006 set setitimer d_setitimer
16009 : see if setlinebuf exists
16010 set setlinebuf d_setlinebuf
16013 : see if setlocale exists
16014 set setlocale d_setlocale
16017 : see if locale.h is available
16018 set locale.h i_locale
16021 : see if setlocale_r exists
16022 set setlocale_r d_setlocale_r
16024 case "$d_setlocale_r" in
16026 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16027 case "$d_setlocale_r_proto:$usethreads" in
16028 ":define") d_setlocale_r_proto=define
16029 set d_setlocale_r_proto setlocale_r $hdrs
16033 case "$d_setlocale_r_proto" in
16035 case "$setlocale_r_proto" in
16036 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16037 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16039 case "$setlocale_r_proto" in
16040 ''|0) d_setlocale_r=undef
16041 setlocale_r_proto=0
16042 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16043 * ) case "$setlocale_r_proto" in
16044 REENTRANT_PROTO*) ;;
16045 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16047 echo "Prototype: $try" ;;
16050 *) case "$usethreads" in
16051 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16053 d_setlocale_r=undef
16054 setlocale_r_proto=0
16058 *) setlocale_r_proto=0
16062 : see if setnetent exists
16063 set setnetent d_setnent
16066 : see if setnetent_r exists
16067 set setnetent_r d_setnetent_r
16069 case "$d_setnetent_r" in
16071 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16072 case "$d_setnetent_r_proto:$usethreads" in
16073 ":define") d_setnetent_r_proto=define
16074 set d_setnetent_r_proto setnetent_r $hdrs
16078 case "$d_setnetent_r_proto" in
16080 case "$setnetent_r_proto" in
16081 ''|0) try='int setnetent_r(int, struct netent_data*);'
16082 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16084 case "$setnetent_r_proto" in
16085 ''|0) try='void setnetent_r(int, struct netent_data*);'
16086 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16088 case "$setnetent_r_proto" in
16089 ''|0) d_setnetent_r=undef
16090 setnetent_r_proto=0
16091 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16092 * ) case "$setnetent_r_proto" in
16093 REENTRANT_PROTO*) ;;
16094 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16096 echo "Prototype: $try" ;;
16099 *) case "$usethreads" in
16100 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16102 d_setnetent_r=undef
16103 setnetent_r_proto=0
16107 *) setnetent_r_proto=0
16111 : see if setprotoent exists
16112 set setprotoent d_setpent
16115 : see if setpgid exists
16116 set setpgid d_setpgid
16119 : see if setpgrp2 exists
16120 set setpgrp2 d_setpgrp2
16123 : see if setpriority exists
16124 set setpriority d_setprior
16127 : see if setproctitle exists
16128 set setproctitle d_setproctitle
16131 : see if setprotoent_r exists
16132 set setprotoent_r d_setprotoent_r
16134 case "$d_setprotoent_r" in
16136 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16137 case "$d_setprotoent_r_proto:$usethreads" in
16138 ":define") d_setprotoent_r_proto=define
16139 set d_setprotoent_r_proto setprotoent_r $hdrs
16143 case "$d_setprotoent_r_proto" in
16145 case "$setprotoent_r_proto" in
16146 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16147 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16149 case "$setprotoent_r_proto" in
16150 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16151 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16153 case "$setprotoent_r_proto" in
16154 ''|0) d_setprotoent_r=undef
16155 setprotoent_r_proto=0
16156 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16157 * ) case "$setprotoent_r_proto" in
16158 REENTRANT_PROTO*) ;;
16159 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16161 echo "Prototype: $try" ;;
16164 *) case "$usethreads" in
16165 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16167 d_setprotoent_r=undef
16168 setprotoent_r_proto=0
16172 *) setprotoent_r_proto=0
16176 : see if setpwent exists
16177 set setpwent d_setpwent
16180 : see if setpwent_r exists
16181 set setpwent_r d_setpwent_r
16183 case "$d_setpwent_r" in
16185 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16186 case "$d_setpwent_r_proto:$usethreads" in
16187 ":define") d_setpwent_r_proto=define
16188 set d_setpwent_r_proto setpwent_r $hdrs
16192 case "$d_setpwent_r_proto" in
16194 case "$setpwent_r_proto" in
16195 ''|0) try='int setpwent_r(FILE**);'
16196 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16198 case "$setpwent_r_proto" in
16199 ''|0) try='void setpwent_r(FILE**);'
16200 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16202 case "$setpwent_r_proto" in
16203 ''|0) d_setpwent_r=undef
16205 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16206 * ) case "$setpwent_r_proto" in
16207 REENTRANT_PROTO*) ;;
16208 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16210 echo "Prototype: $try" ;;
16213 *) case "$usethreads" in
16214 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16221 *) setpwent_r_proto=0
16225 : see if setregid exists
16226 set setregid d_setregid
16228 set setresgid d_setresgid
16231 : see if setreuid exists
16232 set setreuid d_setreuid
16234 set setresuid d_setresuid
16237 : see if setrgid exists
16238 set setrgid d_setrgid
16241 : see if setruid exists
16242 set setruid d_setruid
16245 : see if setservent exists
16246 set setservent d_setsent
16249 : see if setservent_r exists
16250 set setservent_r d_setservent_r
16252 case "$d_setservent_r" in
16254 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16255 case "$d_setservent_r_proto:$usethreads" in
16256 ":define") d_setservent_r_proto=define
16257 set d_setservent_r_proto setservent_r $hdrs
16261 case "$d_setservent_r_proto" in
16263 case "$setservent_r_proto" in
16264 ''|0) try='int setservent_r(int, struct servent_data*);'
16265 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16267 case "$setservent_r_proto" in
16268 ''|0) try='void setservent_r(int, struct servent_data*);'
16269 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16271 case "$setservent_r_proto" in
16272 ''|0) d_setservent_r=undef
16273 setservent_r_proto=0
16274 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16275 * ) case "$setservent_r_proto" in
16276 REENTRANT_PROTO*) ;;
16277 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16279 echo "Prototype: $try" ;;
16282 *) case "$usethreads" in
16283 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16285 d_setservent_r=undef
16286 setservent_r_proto=0
16290 *) setservent_r_proto=0
16294 : see if setsid exists
16295 set setsid d_setsid
16298 : see if setvbuf exists
16299 set setvbuf d_setvbuf
16302 : see if sfio.h is available
16307 : see if sfio library is available
16318 : Ok, but do we want to use it.
16322 true|$define|[yY]*) dflt='y';;
16325 echo "$package can use the sfio library, but it is experimental."
16326 case "$useperlio" in
16328 echo "For sfio also the PerlIO abstraction layer is needed."
16329 echo "Earlier you said you wouldn't want that."
16332 rp="You seem to have sfio available, do you want to try using it?"
16335 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16336 useperlio="$define"
16339 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16344 *) case "$usesfio" in
16345 true|$define|[yY]*)
16346 echo "Sorry, cannot find sfio on this machine." >&4
16347 echo "Ignoring your setting of usesfio=$usesfio." >&4
16356 $define) usesfio='true';;
16357 *) usesfio='false';;
16361 *) : Remove sfio from list of libraries to use
16364 echo "Removing unneeded -lsfio from library list" >&4
16365 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16368 echo "libs = $libs" >&4
16375 : see if shmctl exists
16376 set shmctl d_shmctl
16379 : see if shmget exists
16380 set shmget d_shmget
16383 : see if shmat exists
16386 : see what shmat returns
16389 $cat >shmat.c <<'END'
16390 #include <sys/shm.h>
16393 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16398 echo "and it returns ($shmattype)." >&4
16399 : see if a prototype for shmat is available
16400 xxx=`./findhdr sys/shm.h`
16401 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16402 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16413 set d_shmatprototype
16416 : see if shmdt exists
16420 : see how much of the 'shm*(2)' library is present.
16423 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16424 *"$undef"*) h_shm=false;;
16428 case "`ipcs 2>&1`" in
16429 "SVID shared memory"*"not configured"*)
16430 echo "Your $osname does not have the shm*(2) configured." >&4
16433 set shmctl d_shmctl
16435 set shmget d_shmget
16445 : we could also check for sys/ipc.h ...
16446 if $h_shm && $test `./findhdr sys/shm.h`; then
16447 echo "You have the full shm*(2) library." >&4
16450 echo "You don't have the full shm*(2) library." >&4
16457 : see if we have sigaction
16458 if set sigaction val -f d_sigaction; eval $csym; $val; then
16459 echo 'sigaction() found.' >&4
16462 #include <sys/types.h>
16463 #include <signal.h>
16464 #$i_stdlib I_STDLIB
16466 #include <stdlib.h>
16470 struct sigaction act, oact;
16472 oact.sa_handler = 0;
16473 /* so that act and oact are used */
16474 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16478 if eval $compile_ok; then
16481 echo "But you don't seem to have a useable struct sigaction." >&4
16485 echo 'sigaction NOT found.' >&4
16488 set d_sigaction; eval $setvar
16489 $rm -f try try$_o try.c
16491 : see if sigprocmask exists
16492 set sigprocmask d_sigprocmask
16495 : see if sigsetjmp exists
16497 case "$d_sigsetjmp" in
16500 #include <setjmp.h>
16501 #$i_stdlib I_STDLIB
16503 #include <stdlib.h>
16509 if (sigsetjmp(env,1))
16512 siglongjmp(env, 1);
16517 if eval $compile; then
16518 if $run ./try >/dev/null 2>&1; then
16519 echo "POSIX sigsetjmp found." >&4
16523 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
16529 echo "sigsetjmp not found." >&4
16533 *) val="$d_sigsetjmp"
16534 case "$d_sigsetjmp" in
16535 $define) echo "POSIX sigsetjmp found." >&4;;
16536 $undef) echo "sigsetjmp not found." >&4;;
16544 : see if snprintf exists
16545 set snprintf d_snprintf
16548 : see if vsnprintf exists
16549 set vsnprintf d_vsnprintf
16552 case "$d_snprintf-$d_vsnprintf" in
16555 Checking whether your snprintf() and vsnprintf() work okay...
16557 $cat >try.c <<'EOCP'
16558 /* v?snprintf testing logic courtesy of Russ Allbery.
16559 * According to C99:
16560 * - if the buffer is too short it still must be \0-terminated
16561 * - if the buffer is too short the potentially required length
16562 * must be returned and not -1
16563 * - if the buffer is NULL the potentially required length
16564 * must be returned and not -1 or core dump
16567 #include <stdarg.h>
16571 int test (char *format, ...)
16576 va_start (args, format);
16577 count = vsnprintf (buf, sizeof buf, format, args);
16584 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
16585 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
16589 if eval $compile; then
16592 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
16594 Your snprintf() and snprintf() don't seem to be working okay.
16596 d_snprintf="$undef"
16597 d_vsnprintf="$undef"
16601 echo "(I can't seem to compile the test program--assuming they don't)"
16602 d_snprintf="$undef"
16603 d_vsnprintf="$undef"
16605 $rm -f try.* try core core.try.*
16609 : see if sockatmark exists
16610 set sockatmark d_sockatmark
16613 : see if prototype for sockatmark is available
16615 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
16618 : see if socks5_init exists
16619 set socks5_init d_socks5_init
16622 : see if sprintf returns the length of the string in the buffer as per ANSI
16623 $echo "Checking whether sprintf returns the length of the string..." >&4
16626 #$i_stdlib I_STDLIB
16628 #include <stdlib.h>
16630 #$i_string I_STRING
16632 # include <string.h>
16634 # include <strings.h>
16643 int check (size_t expect, int test) {
16644 size_t got = strlen(buffer);
16648 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
16653 int main(int argc, char **argv) {
16656 check(sprintf(buffer, ""), ++test);
16657 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
16658 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
16665 d_sprintf_returns_strlen="$undef"
16666 if eval $compile; then
16670 sprintf returns the length of the string (as ANSI says it should)
16672 d_sprintf_returns_strlen="$define"
16675 sprintf does not return the length of the string (how old is this system?)
16677 d_sprintf_returns_strlen="$undef"
16684 : see if srand48_r exists
16685 set srand48_r d_srand48_r
16687 case "$d_srand48_r" in
16689 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16690 case "$d_srand48_r_proto:$usethreads" in
16691 ":define") d_srand48_r_proto=define
16692 set d_srand48_r_proto srand48_r $hdrs
16696 case "$d_srand48_r_proto" in
16698 case "$srand48_r_proto" in
16699 ''|0) try='int srand48_r(long, struct drand48_data*);'
16700 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
16702 case "$srand48_r_proto" in
16703 ''|0) d_srand48_r=undef
16705 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
16706 * ) case "$srand48_r_proto" in
16707 REENTRANT_PROTO*) ;;
16708 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
16710 echo "Prototype: $try" ;;
16713 *) case "$usethreads" in
16714 define) echo "srand48_r has no prototype, not using it." >&4 ;;
16721 *) srand48_r_proto=0
16725 : see if srandom_r exists
16726 set srandom_r d_srandom_r
16728 case "$d_srandom_r" in
16730 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16731 case "$d_srandom_r_proto:$usethreads" in
16732 ":define") d_srandom_r_proto=define
16733 set d_srandom_r_proto srandom_r $hdrs
16737 case "$d_srandom_r_proto" in
16739 case "$srandom_r_proto" in
16740 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
16741 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
16743 case "$srandom_r_proto" in
16744 ''|0) d_srandom_r=undef
16746 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
16747 * ) case "$srandom_r_proto" in
16748 REENTRANT_PROTO*) ;;
16749 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
16751 echo "Prototype: $try" ;;
16754 *) case "$usethreads" in
16755 define) echo "srandom_r has no prototype, not using it." >&4 ;;
16762 *) srandom_r_proto=0
16766 : see if prototype for setresgid is available
16768 set d_sresgproto setresgid $i_unistd unistd.h
16771 : see if prototype for setresuid is available
16773 set d_sresuproto setresuid $i_unistd unistd.h
16776 : see if sys/stat.h is available
16777 set sys/stat.h i_sysstat
16781 : see if stat knows about block sizes
16783 echo "Checking to see if your struct stat has st_blocks field..." >&4
16784 set d_statblks stat st_blocks $i_sysstat sys/stat.h
16788 : see if this is a sys/vfs.h system
16789 set sys/vfs.h i_sysvfs
16793 : see if this is a sys/statfs.h system
16794 set sys/statfs.h i_sysstatfs
16799 echo "Checking to see if your system supports struct statfs..." >&4
16800 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
16802 case "$d_statfs_s" in
16803 "$define") echo "Yes, it does." ;;
16804 *) echo "No, it doesn't." ;;
16809 : see if struct statfs knows about f_flags
16810 case "$d_statfs_s" in
16813 echo "Checking to see if your struct statfs has f_flags field..." >&4
16814 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
16818 set d_statfs_f_flags
16822 case "$d_statfs_f_flags" in
16823 "$define") echo "Yes, it does." ;;
16824 *) echo "No, it doesn't." ;;
16828 Checking how to access stdio streams by file descriptor number...
16830 case "$stdio_stream_array" in
16831 '') $cat >try.c <<EOCP
16834 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
16838 for s in _iob __iob __sF
16840 set try -DSTDIO_STREAM_ARRAY=$s
16841 if eval $compile; then
16842 case "`$run ./try`" in
16843 yes) stdio_stream_array=$s; break ;;
16847 $rm -f try.* try$exe_ext
16849 case "$stdio_stream_array" in
16851 I can't figure out how to access stdio streams by file descriptor number.
16853 d_stdio_stream_array="$undef"
16856 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
16858 d_stdio_stream_array="$define"
16862 : see if strcoll exists
16863 set strcoll d_strcoll
16866 : check for structure copying
16868 echo "Checking to see if your C compiler can copy structs..." >&4
16869 $cat >try.c <<'EOCP'
16879 if $cc -c try.c >/dev/null 2>&1 ; then
16881 echo "Yup, it can."
16884 echo "Nope, it can't."
16890 : see if strerror and/or sys_errlist[] exist
16892 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
16893 if set strerror val -f d_strerror; eval $csym; $val; then
16894 echo 'strerror() found.' >&4
16895 d_strerror="$define"
16896 d_strerrm='strerror(e)'
16897 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16898 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
16899 d_syserrlst="$define"
16901 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
16902 d_syserrlst="$undef"
16904 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
16905 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
16906 echo 'strerror() found in string header.' >&4
16907 d_strerror="$define"
16908 d_strerrm='strerror(e)'
16909 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16910 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
16911 d_syserrlst="$define"
16913 echo "(You don't appear to have any sys_errlist[], how can this be?)"
16914 d_syserrlst="$undef"
16916 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16917 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
16918 d_strerror="$undef"
16919 d_syserrlst="$define"
16920 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
16922 echo 'strerror() and sys_errlist[] NOT found.' >&4
16923 d_strerror="$undef"
16924 d_syserrlst="$undef"
16925 d_strerrm='"unknown"'
16929 : see if strerror_r exists
16930 set strerror_r d_strerror_r
16932 case "$d_strerror_r" in
16934 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
16935 case "$d_strerror_r_proto:$usethreads" in
16936 ":define") d_strerror_r_proto=define
16937 set d_strerror_r_proto strerror_r $hdrs
16941 case "$d_strerror_r_proto" in
16943 case "$strerror_r_proto" in
16944 ''|0) try='int strerror_r(int, char*, size_t);'
16945 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
16947 case "$strerror_r_proto" in
16948 ''|0) try='int strerror_r(int, char*, int);'
16949 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
16951 case "$strerror_r_proto" in
16952 ''|0) try='char* strerror_r(int, char*, size_t);'
16953 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
16955 case "$strerror_r_proto" in
16956 ''|0) d_strerror_r=undef
16958 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
16959 * ) case "$strerror_r_proto" in
16960 REENTRANT_PROTO*) ;;
16961 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
16963 echo "Prototype: $try" ;;
16966 *) case "$usethreads" in
16967 define) echo "strerror_r has no prototype, not using it." >&4 ;;
16974 *) strerror_r_proto=0
16978 : see if strftime exists
16979 set strftime d_strftime
16982 : see if strlcat exists
16983 set strlcat d_strlcat
16986 : see if strlcpy exists
16987 set strlcpy d_strlcpy
16990 : see if strtod exists
16991 set strtod d_strtod
16994 : see if strtol exists
16995 set strtol d_strtol
16998 : see if strtold exists
16999 set strtold d_strtold
17002 : see if strtoll exists
17003 set strtoll d_strtoll
17006 case "$d_longlong-$d_strtoll" in
17009 Checking whether your strtoll() works okay...
17011 $cat >try.c <<'EOCP'
17014 #define strtoll __strtoll
17017 #define strtoll _strtoll
17020 extern long long int strtoll(char *s, char **, int);
17021 static int bad = 0;
17022 int check(char *s, long long ell, int een) {
17025 gll = strtoll(s, 0, 10);
17026 if (!((gll == ell) && (errno == een)))
17030 check(" 1", 1LL, 0);
17031 check(" 0", 0LL, 0);
17032 check("-1", -1LL, 0);
17033 check("-9223372036854775808", -9223372036854775808LL, 0);
17034 check("-9223372036854775808", -9223372036854775808LL, 0);
17035 check(" 9223372036854775807", 9223372036854775807LL, 0);
17036 check("-9223372036854775808", -9223372036854775808LL, 0);
17037 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17038 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17044 if eval $compile; then
17047 ok) echo "Your strtoll() seems to be working okay." ;;
17049 Your strtoll() doesn't seem to be working okay.
17055 echo "(I can't seem to compile the test program--assuming it doesn't)"
17061 : see if strtoq exists
17062 set strtoq d_strtoq
17065 : see if strtoul exists
17066 set strtoul d_strtoul
17069 case "$d_strtoul" in
17072 Checking whether your strtoul() works okay...
17074 $cat >try.c <<'EOCP'
17077 extern unsigned long int strtoul(char *s, char **, int);
17078 static int bad = 0;
17079 void check(char *s, unsigned long eul, int een) {
17082 gul = strtoul(s, 0, 10);
17083 if (!((gul == eul) && (errno == een)))
17087 check(" 1", 1L, 0);
17088 check(" 0", 0L, 0);
17090 case "$longsize" in
17092 $cat >>try.c <<'EOCP'
17093 check("18446744073709551615", 18446744073709551615UL, 0);
17094 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17095 #if 0 /* strtoul() for /^-/ strings is undefined. */
17096 check("-1", 18446744073709551615UL, 0);
17097 check("-18446744073709551614", 2, 0);
17098 check("-18446744073709551615", 1, 0);
17099 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17100 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17105 $cat >>try.c <<'EOCP'
17106 check("4294967295", 4294967295UL, 0);
17107 check("4294967296", 4294967295UL, ERANGE);
17108 #if 0 /* strtoul() for /^-/ strings is undefined. */
17109 check("-1", 4294967295UL, 0);
17110 check("-4294967294", 2, 0);
17111 check("-4294967295", 1, 0);
17112 check("-4294967296", 4294967295UL, ERANGE);
17113 check("-4294967297", 4294967295UL, ERANGE);
17118 : Should we write these tests to be more portable by sprintf-ing
17119 : ~0 and then manipulating that char string as input for strtol?
17122 $cat >>try.c <<'EOCP'
17129 if eval $compile; then
17130 case "`$run ./try`" in
17131 ok) echo "Your strtoul() seems to be working okay." ;;
17133 Your strtoul() doesn't seem to be working okay.
17142 : see if strtoull exists
17143 set strtoull d_strtoull
17146 case "$d_longlong-$d_strtoull" in
17149 Checking whether your strtoull() works okay...
17151 $cat >try.c <<'EOCP'
17154 #define strtoull __strtoull
17157 extern unsigned long long int strtoull(char *s, char **, int);
17158 static int bad = 0;
17159 int check(char *s, long long eull, int een) {
17162 gull = strtoull(s, 0, 10);
17163 if (!((gull == eull) && (errno == een)))
17167 check(" 1", 1LL, 0);
17168 check(" 0", 0LL, 0);
17169 check("18446744073709551615", 18446744073709551615ULL, 0);
17170 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17171 #if 0 /* strtoull() for /^-/ strings is undefined. */
17172 check("-1", 18446744073709551615ULL, 0);
17173 check("-18446744073709551614", 2LL, 0);
17174 check("-18446744073709551615", 1LL, 0);
17175 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17176 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17183 if eval $compile; then
17184 case "`$run ./try`" in
17185 ok) echo "Your strtoull() seems to be working okay." ;;
17187 Your strtoull() doesn't seem to be working okay.
17189 d_strtoull="$undef"
17196 : see if strtouq exists
17197 set strtouq d_strtouq
17200 case "$d_strtouq" in
17203 Checking whether your strtouq() works okay...
17205 $cat >try.c <<'EOCP'
17208 extern unsigned long long int strtouq(char *s, char **, int);
17209 static int bad = 0;
17210 void check(char *s, unsigned long long eull, int een) {
17211 unsigned long long gull;
17213 gull = strtouq(s, 0, 10);
17214 if (!((gull == eull) && (errno == een)))
17218 check(" 1", 1LL, 0);
17219 check(" 0", 0LL, 0);
17220 check("18446744073709551615", 18446744073709551615ULL, 0);
17221 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17222 #if 0 /* strtouq() for /^-/ strings is undefined. */
17223 check("-1", 18446744073709551615ULL, 0);
17224 check("-18446744073709551614", 2LL, 0);
17225 check("-18446744073709551615", 1LL, 0);
17226 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17227 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17235 if eval $compile; then
17236 case "`$run ./try`" in
17237 ok) echo "Your strtouq() seems to be working okay." ;;
17239 Your strtouq() doesn't seem to be working okay.
17248 : see if strxfrm exists
17249 set strxfrm d_strxfrm
17252 : see if symlink exists
17253 set symlink d_symlink
17256 : see if syscall exists
17257 set syscall d_syscall
17260 : see if prototype for syscall is available
17262 set d_syscallproto syscall $i_unistd unistd.h
17265 : see if sysconf exists
17266 set sysconf d_sysconf
17269 : see if system exists
17270 set system d_system
17273 : see if tcgetpgrp exists
17274 set tcgetpgrp d_tcgetpgrp
17277 : see if tcsetpgrp exists
17278 set tcsetpgrp d_tcsetpgrp
17281 : see if prototype for telldir is available
17283 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17286 : see if time exists
17288 if test "X$d_time" = X -o X"$timetype" = X; then
17289 if set time val -f d_time; eval $csym; $val; then
17290 echo 'time() found.' >&4
17292 rp="What is the type returned by time() on this system?"
17293 set time_t timetype long stdio.h sys/types.h
17296 echo 'time() not found, hope that will do.' >&4
17304 : see if this is a sys/times.h system
17305 set sys/times.h i_systimes
17308 : see if times exists
17310 if set times val -f d_times; eval $csym; $val; then
17311 echo 'times() found.' >&4
17314 case "$i_systimes" in
17315 "$define") inc='sys/times.h';;
17317 rp="What is the type returned by times() on this system?"
17318 set clock_t clocktype long stdio.h sys/types.h $inc
17321 echo 'times() NOT found, hope that will do.' >&4
17326 : see if tmpnam_r exists
17327 set tmpnam_r d_tmpnam_r
17329 case "$d_tmpnam_r" in
17331 hdrs="$i_systypes sys/types.h define stdio.h "
17332 case "$d_tmpnam_r_proto:$usethreads" in
17333 ":define") d_tmpnam_r_proto=define
17334 set d_tmpnam_r_proto tmpnam_r $hdrs
17338 case "$d_tmpnam_r_proto" in
17340 case "$tmpnam_r_proto" in
17341 ''|0) try='char* tmpnam_r(char*);'
17342 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17344 case "$tmpnam_r_proto" in
17345 ''|0) d_tmpnam_r=undef
17347 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17348 * ) case "$tmpnam_r_proto" in
17349 REENTRANT_PROTO*) ;;
17350 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17352 echo "Prototype: $try" ;;
17355 *) case "$usethreads" in
17356 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
17363 *) tmpnam_r_proto=0
17367 : see if truncate exists
17368 set truncate d_truncate
17371 : see if ttyname_r exists
17372 set ttyname_r d_ttyname_r
17374 case "$d_ttyname_r" in
17376 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
17377 case "$d_ttyname_r_proto:$usethreads" in
17378 ":define") d_ttyname_r_proto=define
17379 set d_ttyname_r_proto ttyname_r $hdrs
17383 case "$d_ttyname_r_proto" in
17385 case "$ttyname_r_proto" in
17386 ''|0) try='int ttyname_r(int, char*, size_t);'
17387 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
17389 case "$ttyname_r_proto" in
17390 ''|0) try='int ttyname_r(int, char*, int);'
17391 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
17393 case "$ttyname_r_proto" in
17394 ''|0) try='char* ttyname_r(int, char*, int);'
17395 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
17397 case "$ttyname_r_proto" in
17398 ''|0) d_ttyname_r=undef
17400 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
17401 * ) case "$ttyname_r_proto" in
17402 REENTRANT_PROTO*) ;;
17403 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
17405 echo "Prototype: $try" ;;
17408 *) case "$usethreads" in
17409 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
17416 *) ttyname_r_proto=0
17420 : see if tzname[] exists
17422 if set tzname val -a d_tzname; eval $csym; $val; then
17424 echo 'tzname[] found.' >&4
17427 echo 'tzname[] NOT found.' >&4
17433 next|rhapsody|darwin) multiarch="$define" ;;
17435 case "$multiarch" in
17436 ''|[nN]*) multiarch="$undef" ;;
17439 : check for ordering of bytes in a UV
17441 case "$usecrosscompile$multiarch" in
17444 You seem to be either cross-compiling or doing a multiarchitecture build,
17445 skipping the byteorder check.
17451 case "$byteorder" in
17454 In the following, larger digits indicate more significance. A big-endian
17455 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
17456 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
17457 machines may have weird orders like 3412. A Cray will report 87654321,
17458 an Alpha will report 12345678. If the test program works the default is
17460 I'm now running the test program...
17464 #$i_stdlib I_STDLIB
17466 #include <stdlib.h>
17468 #include <sys/types.h>
17469 typedef $uvtype UV;
17479 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
17481 u.l = (UV)0x04030201;
17482 for (i = 0; i < $uvsize; i++)
17483 printf("%c", u.c[i]+'0');
17490 if eval $compile && ./try > /dev/null; then
17493 [1-4][1-4][1-4][1-4]|12345678|87654321)
17494 echo "(The test program ran ok.)"
17495 echo "byteorder=$dflt"
17498 ????|????????) echo "(The test program ran ok.)" ;;
17499 *) echo "(The test program didn't run right for some reason.)" ;;
17504 (I can't seem to compile the test program. Guessing big-endian...)
17507 case "$xxx_prompt" in
17509 rp="What is the order of bytes in $uvtype?"
17525 Checking to see whether you can access character data unalignedly...
17527 case "$d_u32align" in
17528 '') $cat >try.c <<EOCP
17530 #$i_stdlib I_STDLIB
17532 #include <stdlib.h>
17534 #define U32 $u32type
17535 #define BYTEORDER 0x$byteorder
17537 #include <signal.h>
17539 $signal_t bletch(s) int s; { exit(4); }
17542 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
17547 if (sizeof(U32) != 4) {
17548 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
17555 signal(SIGBUS, bletch);
17567 for (i = 0; i < 4; i++) {
17568 up = (U32*)(buf + i);
17569 if (! ((*up == 1 << (8*i)) || /* big-endian */
17570 (*up == 1 << (8*(3-i))) /* little-endian */
17574 printf("read failed (%x)\n", *up);
17580 for (i = 0; i < 4; i++) {
17581 up = (U32*)(buf + i);
17583 if (*up != 0xBeef) {
17584 printf("write failed (%x)\n", *up);
17598 if eval $compile_ok; then
17599 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
17600 $run ./try 2>&1 >/dev/null
17603 You can access character data pretty unalignedly.
17605 d_u32align="$undef"
17608 It seems that you must access character data in an aligned manner.
17610 d_u32align="$define"
17614 rp='Can you access character data at unaligned addresses?'
17618 [yY]*) d_u32align="$undef" ;;
17619 *) d_u32align="$define" ;;
17622 $rm -f core core.try.* try.core
17626 : see if ualarm exists
17627 set ualarm d_ualarm
17630 : see if umask exists
17634 : see if unordered exists
17635 set unordered d_unordered
17638 : see if unsetenv exists
17639 set unsetenv d_unsetenv
17642 : see if usleep exists
17643 set usleep d_usleep
17646 : see if prototype for usleep is available
17648 set d_usleepproto usleep $i_unistd unistd.h
17651 : see if ustat exists
17655 : backward compatibility for d_hvfork
17656 if test X$d_hvfork != X; then
17657 d_vfork="$d_hvfork"
17660 : see if there is a vfork
17665 : Ok, but do we want to use it. vfork is reportedly unreliable in
17666 : perl on Solaris 2.x, and probably elsewhere.
17670 case "$usevfork" in
17676 Perl can only use a vfork() that doesn't suffer from strict
17677 restrictions on calling functions or modifying global data in
17678 the child. For example, glibc-2.1 contains such a vfork()
17679 that is unsuitable. If your system provides a proper fork()
17680 call, chances are that you do NOT want perl to use vfork().
17683 rp="Do you still want to use vfork()?"
17688 echo "Ok, we won't use vfork()."
17697 $define) usevfork='true';;
17698 *) usevfork='false';;
17701 : see if closedir exists
17702 set closedir d_closedir
17705 case "$d_closedir" in
17708 echo "Checking whether closedir() returns a status..." >&4
17710 #$i_dirent I_DIRENT /**/
17711 #$i_sysdir I_SYS_DIR /**/
17712 #$i_sysndir I_SYS_NDIR /**/
17713 #$i_systypes I_SYS_TYPES /**/
17715 #if defined(I_SYS_TYPES)
17716 #include <sys/types.h>
17718 #if defined(I_DIRENT)
17719 #include <dirent.h>
17720 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
17721 #include <sys/dir.h>
17725 #include <sys/ndir.h>
17729 #include <ndir.h> /* may be wrong in the future */
17731 #include <sys/dir.h>
17736 int main() { return closedir(opendir(".")); }
17739 if eval $compile_ok; then
17740 if $run ./try > /dev/null 2>&1 ; then
17741 echo "Yes, it does."
17744 echo "No, it doesn't."
17748 echo "(I can't seem to compile the test program--assuming it doesn't)"
17756 set d_void_closedir
17759 : see if there is a wait4
17763 : see if waitpid exists
17764 set waitpid d_waitpid
17767 : see if wcstombs exists
17768 set wcstombs d_wcstombs
17771 : see if wctomb exists
17772 set wctomb d_wctomb
17775 : see if writev exists
17776 set writev d_writev
17779 : preserve RCS keywords in files with variable substitution, grrr
17784 Revision='$Revision'
17786 : check for alignment requirements
17788 case "$usecrosscompile$multiarch" in
17791 You seem to be either cross-compiling or doing a multiarchitecture build,
17792 skipping the memory alignment check.
17795 case "$alignbytes" in
17796 '') alignbytes=8 ;;
17800 case "$alignbytes" in
17801 '') echo "Checking alignment constraints..." >&4
17802 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
17803 $cat >try.c <<'EOCP'
17804 typedef long double NV;
17807 $cat >try.c <<'EOCP'
17811 $cat >>try.c <<'EOCP'
17819 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
17824 if eval $compile_ok; then
17828 echo "(I can't seem to compile the test program...)"
17831 *) dflt="$alignbytes"
17834 rp="Doubles must be aligned on a how-many-byte boundary?"
17842 : set the base revision
17845 : how do we concatenate cpp tokens here?
17847 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
17848 $cat >cpp_stuff.c <<'EOCP'
17849 #define RCAT(a,b)a/**/b
17850 #define ACAT(a,b)a ## b
17854 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
17855 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
17856 echo "Oh! Smells like ANSI's been here." >&4
17857 echo "We can catify or stringify, separately or together!"
17859 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
17860 echo "Ah, yes! The good old days!" >&4
17861 echo "However, in the good old days we don't know how to stringify and"
17862 echo "catify at the same time."
17866 Hmm, I don't seem to be able to concatenate tokens with your cpp.
17867 You're going to have to edit the values of CAT[2-5] in config.h...
17869 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
17873 : see if this is a db.h system
17879 : Check db version.
17881 echo "Checking Berkeley DB version ..." >&4
17887 #include <sys/types.h>
17889 #$i_stdlib I_STDLIB
17891 #include <stdlib.h>
17894 int main(int argc, char *argv[])
17896 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
17897 int Major, Minor, Patch ;
17898 unsigned long Version ;
17899 (void)db_version(&Major, &Minor, &Patch) ;
17901 printf("%d %d %d %d %d %d\n",
17902 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
17903 Major, Minor, Patch);
17906 printf("You have Berkeley DB Version 2 or greater.\n");
17908 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
17909 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
17910 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
17911 Major, Minor, Patch) ;
17913 /* check that db.h & libdb are compatible */
17914 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
17915 printf("db.h and libdb are incompatible.\n") ;
17919 printf("db.h and libdb are compatible.\n") ;
17921 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
17922 + DB_VERSION_PATCH ;
17924 /* needs to be >= 2.3.4 */
17925 if (Version < 2003004) {
17926 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
17927 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
17933 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
17938 printf("You have Berkeley DB Version 1.\n");
17939 exit(0); /* DB version < 2: the coast is clear. */
17941 exit(1); /* <db.h> not Berkeley DB? */
17947 if eval $compile_ok && $run ./try; then
17948 echo 'Looks OK.' >&4
17950 db_version_major=$1
17951 db_version_minor=$2
17952 db_version_patch=$3
17954 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
17958 : Remove db from list of libraries to use
17959 echo "Removing unusable -ldb from library list" >&4
17960 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
17963 echo "libs = $libs" >&4
17973 : Check the return type needed for hash
17975 echo "Checking return type needed for hash for Berkeley DB ..." >&4
17981 #include <sys/types.h>
17984 #ifndef DB_VERSION_MAJOR
17985 u_int32_t hash_cb (ptr, size)
17993 info.hash = hash_cb;
17997 if $cc $ccflags -c try.c >try.out 2>&1 ; then
17998 if $contains warning try.out >>/dev/null 2>&1 ; then
18001 db_hashtype='u_int32_t'
18004 : XXX Maybe we should just give up here.
18005 db_hashtype=u_int32_t
18007 echo "Help: I can't seem to compile the db test program." >&4
18008 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18011 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18013 *) db_hashtype=u_int32_t
18018 : Check the return type needed for prefix
18020 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18026 #include <sys/types.h>
18029 #ifndef DB_VERSION_MAJOR
18030 size_t prefix_cb (key1, key2)
18038 info.prefix = prefix_cb;
18042 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18043 if $contains warning try.out >>/dev/null 2>&1 ; then
18044 db_prefixtype='int'
18046 db_prefixtype='size_t'
18049 db_prefixtype='size_t'
18050 : XXX Maybe we should just give up here.
18052 echo "Help: I can't seem to compile the db test program." >&4
18053 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18056 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18058 *) db_prefixtype='size_t'
18063 : How can we generate normalized random numbers ?
18065 echo "Looking for a random number function..." >&4
18066 case "$randfunc" in
18068 if set drand48 val -f; eval $csym; $val; then
18070 echo "Good, found drand48()." >&4
18071 elif set random val -f; eval $csym; $val; then
18073 echo "OK, found random()." >&4
18076 echo "Yick, looks like I have to use rand()." >&4
18087 *-Dmy_rand=*|*-Dmy_srand=*)
18088 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18089 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18090 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18091 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18095 while $test "$cont"; do
18096 rp="Use which function to generate random numbers?"
18098 if $test "$ans" = "$dflt"; then
18104 if set $ans val -f; eval $csym; $val; then
18108 rp="I cannot find function $ans. Use that name anyway?"
18117 case "$randfunc" in
18119 drand01="drand48()"
18125 case "$randbits" in
18127 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18129 #$i_unistd I_UNISTD
18130 #$i_stdlib I_STDLIB
18133 # include <unistd.h>
18136 # include <stdlib.h>
18141 register unsigned long tmp;
18142 register unsigned long max = 0L;
18144 for (i = 1000; i; i--) {
18145 tmp = (unsigned long) $randfunc();
18146 if (tmp > max) max = tmp;
18148 for (i = 0; max; i++)
18154 if eval $compile_ok; then
18158 echo "(I can't seem to compile the test program...)"
18165 rp="How many bits does your $randfunc() function produce?"
18169 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18170 seedfunc="s$randfunc"
18171 randseedtype=unsigned
18175 rp="How many bits does your $randfunc() function produce?"
18178 seedfunc="s$randfunc"
18179 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18180 if set $seedfunc val -f; eval $csym; $val; then
18181 echo "(Using $seedfunc() to seed random generator)"
18183 echo "(Warning: no $seedfunc() to seed random generator)"
18186 randseedtype=unsigned
18194 echo "Determining whether or not we are on an EBCDIC system..." >&4
18195 $cat >try.c <<'EOM'
18198 if ('M'==0xd4) return 0;
18205 if eval $compile_ok; then
18206 if $run ./try; then
18207 echo "You seem to speak EBCDIC." >&4
18210 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18213 echo "I'm unable to compile the test program." >&4
18214 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18222 Checking how to flush all pending stdio output...
18224 # I only know how to find the first 32 possibly open files on SunOS.
18225 # See also hints/sunos_4_1.sh and util.c --AD
18227 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18229 $cat >>try.c <<EOCP
18231 #$i_stdlib I_STDLIB
18233 #include <stdlib.h>
18235 #$i_unistd I_UNISTD
18237 # include <unistd.h>
18239 #$d_sysconf HAS_SYSCONF
18240 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18241 #ifdef HAS_STDIO_STREAM_ARRAY
18242 # define STDIO_STREAM_ARRAY $stdio_stream_array
18247 p = fopen("try.out", "w");
18251 # ifdef TRY_FPRINTF
18255 #ifdef TRY_FFLUSH_NULL
18258 #ifdef TRY_FFLUSH_ALL
18260 long open_max = -1;
18261 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18262 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18264 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18265 open_max = sysconf(_SC_OPEN_MAX);
18268 open_max = FOPEN_MAX;
18271 open_max = OPEN_MAX;
18280 # ifdef HAS_STDIO_STREAM_ARRAY
18281 if (open_max > 0) {
18283 for (i = 0; i < open_max; i++)
18284 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18285 STDIO_STREAM_ARRAY[i]._file < open_max &&
18286 STDIO_STREAM_ARRAY[i]._flag)
18287 fflush(&STDIO_STREAM_ARRAY[i]);
18295 : first we have to find out how _not_ to flush
18297 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18299 set try -DTRY_FPUTC
18300 if eval $compile; then
18301 $run ./try 2>/dev/null
18304 if $test ! -s try.out -a "X$code" = X42; then
18310 set try -DTRY_FPRINTF
18311 if eval $compile; then
18312 $run ./try 2>/dev/null
18315 if $test ! -s try.out -a "X$code" = X42; then
18316 output=-DTRY_FPRINTF
18322 : check for fflush NULL behaviour
18323 case "$fflushNULL" in
18324 '') set try -DTRY_FFLUSH_NULL $output
18325 if eval $compile; then
18326 $run ./try 2>/dev/null
18329 if $test -s try.out -a "X$code" = X42; then
18330 fflushNULL="`$cat try.out`"
18332 if $test "X$code" != X42; then
18334 (If this test failed, don't worry, we'll try another method shortly.)
18339 $rm -f core try.core core.try.*
18340 case "$fflushNULL" in
18342 Your fflush(NULL) works okay for output streams.
18343 Let's see if it clobbers input pipes...
18345 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18346 # bug that improperly flushes the input end of pipes. So we avoid the
18347 # autoflush on fork/system/exec support for now. :-(
18348 $cat >tryp.c <<EOCP
18351 main(int argc, char **argv)
18357 while ((i = getc(stdin)) != -1
18358 && (*bp++ = i) != '\n'
18359 && bp < &buf[1024])
18362 fprintf(stdout, "%s", buf);
18370 fflushNULL="$define"
18372 if eval $compile; then
18374 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18375 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18377 fflush(NULL) seems to behave okay with input streams.
18379 fflushNULL="$define"
18382 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18384 fflushNULL="$undef"
18387 $rm -f core tryp.c tryp.core core.tryp.*
18390 Your fflush(NULL) isn't working (contrary to ANSI C).
18392 fflushNULL="$undef"
18395 Cannot figure out whether your fflush(NULL) works or not.
18396 I'm assuming it doesn't (contrary to ANSI C).
18398 fflushNULL="$undef"
18402 $define|true|[yY]*)
18403 fflushNULL="$define"
18406 fflushNULL="$undef"
18409 : check explicit looping only if NULL did not work, and if the pipe
18410 : bug does not show up on an explicit flush too
18411 case "$fflushNULL" in
18413 $cat >tryp.c <<EOCP
18416 main(int argc, char **argv)
18422 while ((i = getc(stdin)) != -1
18423 && (*bp++ = i) != '\n'
18424 && bp < &buf[1024])
18427 fprintf(stdout, "%s", buf);
18436 if eval $compile; then
18438 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18439 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18441 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
18443 : now check for fflushall behaviour
18444 case "$fflushall" in
18445 '') set try -DTRY_FFLUSH_ALL $output
18446 if eval $compile; then
18448 (Now testing the other method--but note that this also may fail.)
18450 $run ./try 2>/dev/null
18453 if $test -s try.out -a "X$code" = X42; then
18454 fflushall="`$cat try.out`"
18457 $rm -f core try.core core.try.*
18458 case "$fflushall" in
18460 Whew. Flushing explicitly all the stdio streams works.
18462 fflushall="$define"
18465 Sigh. Flushing explicitly all the stdio streams doesn't work.
18470 Cannot figure out whether flushing stdio streams explicitly works or not.
18471 I'm assuming it doesn't.
18477 "$define"|true|[yY]*)
18478 fflushall="$define"
18486 All is futile. Even fflush(stdin) clobbers input pipes!
18493 $rm -f core tryp.c tryp.core core.tryp.*
18495 *) fflushall="$undef"
18499 case "$fflushNULL$fflushall" in
18502 OK, I give up. I cannot figure out how to flush pending stdio output.
18503 We won't be flushing handles at all before fork/exec/popen.
18507 $rm -f try.* try$exe_ext
18509 : Store the full pathname to the ar program for use in the C program
18510 : Respect a hint or command line value for full_ar.
18515 : Store the full pathname to the sed program for use in the C program
18518 : see what type gids are declared as in the kernel
18520 echo "Looking for the type for group ids returned by getgid()."
18521 set gid_t gidtype xxx stdio.h sys/types.h
18525 xxx=`./findhdr sys/user.h`
18526 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
18528 unsigned) dflt="$1 $2" ;;
18532 *) dflt="$gidtype";;
18535 gid_t) echo "gid_t found." ;;
18536 *) rp="What is the type for group ids returned by getgid()?"
18544 *_t) zzz="$gidtype" ;;
18547 echo "Checking the size of $zzz..." >&4
18549 #include <sys/types.h>
18551 #$i_stdlib I_STDLIB
18553 #include <stdlib.h>
18556 printf("%d\n", (int)sizeof($gidtype));
18561 if eval $compile_ok; then
18565 echo "(I can't execute the test program--guessing $gidsize.)" >&4
18568 echo "Your $zzz is $gidsize bytes long."
18573 echo "(I can't compile the test program--guessing $gidsize.)" >&4
18579 *_t) zzz="$gidtype" ;;
18582 echo "Checking the sign of $zzz..." >&4
18584 #include <sys/types.h>
18595 if eval $compile; then
18599 echo "(I can't execute the test program--guessing unsigned.)" >&4
18603 1) echo "Your $zzz is unsigned." ;;
18604 -1) echo "Your $zzz is signed." ;;
18610 echo "(I can't compile the test program--guessing unsigned.)" >&4
18616 if $test X"$quadtype" != X; then
18618 echo "Checking how to print 64-bit integers..." >&4
18620 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
18621 $cat >try.c <<'EOCP'
18622 #include <sys/types.h>
18625 int q = 12345678901;
18626 printf("%ld\n", q);
18630 if eval $compile; then
18634 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
18635 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
18636 echo "We will use %d."
18642 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
18643 $cat >try.c <<'EOCP'
18644 #include <sys/types.h>
18647 long q = 12345678901;
18648 printf("%ld\n", q);
18652 if eval $compile; then
18656 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
18657 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
18658 echo "We will use %ld."
18664 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
18665 $cat >try.c <<'EOCP'
18666 #include <sys/types.h>
18667 #include <inttypes.h>
18670 int64_t q = 12345678901;
18671 printf("%" PRId64 "\n", q);
18675 if eval $compile; then
18679 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
18680 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
18681 echo "We will use the C9X style."
18687 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18689 #include <sys/types.h>
18692 $quadtype q = 12345678901;
18693 printf("%Ld\n", q);
18697 if eval $compile; then
18701 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
18702 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
18703 echo "We will use %Ld."
18709 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
18710 $cat >try.c <<'EOCP'
18711 #include <sys/types.h>
18714 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
18715 printf("%lld\n", q);
18719 if eval $compile; then
18723 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
18724 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
18725 echo "We will use the %lld style."
18731 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18733 #include <sys/types.h>
18736 $quadtype q = 12345678901;
18737 printf("%qd\n", q);
18741 if eval $compile; then
18745 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
18746 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
18747 echo "We will use %qd."
18753 if $test X"$sPRId64" = X; then
18754 echo "Cannot figure out how to print 64-bit integers." >&4
18762 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
18763 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
18765 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
18766 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
18772 $echo "Checking the format strings to be used for Perl's internal types..." >&4
18774 if $test X"$ivsize" = X8; then
18775 ivdformat="$sPRId64"
18776 uvuformat="$sPRIu64"
18777 uvoformat="$sPRIo64"
18778 uvxformat="$sPRIx64"
18779 uvXUformat="$sPRIXU64"
18781 if $test X"$ivsize" = X"$longsize"; then
18788 if $test X"$ivsize" = X"$intsize"; then
18796 if $test X"$ivsize" = X"$shortsize"; then
18807 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
18808 nveformat="$sPRIeldbl"
18809 nvfformat="$sPRIfldbl"
18810 nvgformat="$sPRIgldbl"
18811 nvEUformat="$sPRIEUldbl"
18812 nvFUformat="$sPRIFUldbl"
18813 nvGUformat="$sPRIGUldbl"
18823 case "$ivdformat" in
18824 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
18831 $echo "Checking the format string to be used for gids..." >&4
18834 -1) if $test X"$gidsize" = X"$ivsize"; then
18835 gidformat="$ivdformat"
18837 if $test X"$gidsize" = X"$longsize"; then
18840 if $test X"$gidsize" = X"$intsize"; then
18843 if $test X"$gidsize" = X"$shortsize"; then
18850 *) if $test X"$gidsize" = X"$uvsize"; then
18851 gidformat="$uvuformat"
18853 if $test X"$gidsize" = X"$longsize"; then
18856 if $test X"$gidsize" = X"$intsize"; then
18859 if $test X"$gidsize" = X"$shortsize"; then
18868 : see if getgroups exists
18869 set getgroups d_getgrps
18872 : see if setgroups exists
18873 set setgroups d_setgrps
18877 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
18879 case "$d_getgrps$d_setgrps" in
18881 case "$groupstype" in
18882 '') dflt="$gidtype" ;;
18883 *) dflt="$groupstype" ;;
18886 What type of pointer is the second argument to getgroups() and setgroups()?
18887 Usually this is the same as group ids, $gidtype, but not always.
18890 rp='What type pointer is the second argument to getgroups() and setgroups()?'
18894 *) groupstype="$gidtype";;
18898 echo "Checking if your $make program sets \$(MAKE)..." >&4
18899 case "$make_set_make" in
18901 $sed 's/^X //' > testmake.mak << 'EOF'
18903 X @echo 'maketemp="$(MAKE)"'
18905 case "`$make -f testmake.mak 2>/dev/null`" in
18906 *maketemp=*) make_set_make='#' ;;
18907 *) make_set_make="MAKE=$make" ;;
18909 $rm -f testmake.mak
18912 case "$make_set_make" in
18913 '#') echo "Yup, it does.";;
18914 *) echo "Nope, it doesn't.";;
18917 : see what type is used for mode_t
18918 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
18919 set mode_t modetype int stdio.h sys/types.h
18922 : see if stdarg is available
18924 if $test `./findhdr stdarg.h`; then
18925 echo "<stdarg.h> found." >&4
18928 echo "<stdarg.h> NOT found." >&4
18932 : see if varags is available
18934 if $test `./findhdr varargs.h`; then
18935 echo "<varargs.h> found." >&4
18937 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
18940 : set up the varargs testing programs
18941 $cat > varargs.c <<EOP
18943 #include <stdarg.h>
18946 #include <varargs.h>
18950 int f(char *p, ...)
18964 p = va_arg(ap, char *);
18969 $cat > varargs <<EOP
18971 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
18980 : now check which varargs header should be included
18985 if `./varargs I_STDARG`; then
18987 elif `./varargs I_VARARGS`; then
18992 if `./varargs I_VARARGS`; then
18999 echo "I could not find the definition for va_dcl... You have problems..." >&4
19000 val="$undef"; set i_stdarg; eval $setvar
19001 val="$undef"; set i_varargs; eval $setvar
19006 case "$i_varhdr" in
19008 val="$define"; set i_stdarg; eval $setvar
19009 val="$undef"; set i_varargs; eval $setvar
19012 val="$undef"; set i_stdarg; eval $setvar
19013 val="$define"; set i_varargs; eval $setvar
19016 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
19020 : see if we need va_copy
19022 case "$i_stdarg" in
19025 #include <stdarg.h>
19027 #$i_stdlib I_STDLIB
19029 #include <stdlib.h>
19031 #include <signal.h>
19034 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19036 return vfprintf(f, fmt, *valp);
19040 myvfprintf(FILE *f, const char *fmt, va_list val)
19042 return ivfprintf(f, fmt, &val);
19046 myprintf(char *fmt, ...)
19049 va_start(val, fmt);
19050 return myvfprintf(stdout, fmt, val);
19054 main(int ac, char **av)
19056 signal(SIGSEGV, exit);
19058 myprintf("%s%cs all right, then\n", "that", '\'');
19063 if eval $compile && $run ./try 2>&1 >/dev/null; then
19064 case "`$run ./try`" in
19065 "that's all right, then")
19071 yes) echo "It seems that you don't need va_copy()." >&4
19072 need_va_copy="$undef"
19074 *) echo "It seems that va_copy() or similar will be needed." >&4
19075 need_va_copy="$define"
19078 $rm -f try.* core core.* *.core *.core.*
19080 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19084 : see what type is used for size_t
19085 rp="What is the type used for the length parameter for string functions?"
19086 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19089 : check for type of arguments to gethostbyaddr.
19090 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19091 case "$d_gethbyaddr" in
19095 Checking to see what type of arguments are accepted by gethostbyaddr().
19097 hdrs="$define sys/types.h
19098 $d_socket sys/socket.h
19099 $i_niin netinet/in.h
19101 $i_unistd unistd.h"
19102 : The first arg can 'char *' or 'void *'
19103 : The second arg is some of integral type
19104 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19105 for yyy in size_t long int; do
19106 case "$netdb_host_type" in
19107 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19108 if ./protochk "$try" $hdrs; then
19109 echo "Your system accepts $xxx for the first arg."
19110 echo "...and $yyy for the second arg."
19111 netdb_host_type="$xxx"
19112 netdb_hlen_type="$yyy"
19118 : In case none of those worked, prompt the user.
19119 case "$netdb_host_type" in
19120 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19123 netdb_host_type=$ans
19124 rp='What is the type for the 2nd argument to gethostbyaddr?'
19127 netdb_hlen_type=$ans
19131 *) : no gethostbyaddr, so pick harmless defaults
19132 netdb_host_type='char *'
19133 netdb_hlen_type="$sizetype"
19136 # Remove the "const" if needed. -- but then we'll have a
19138 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19141 : check for type of argument to gethostbyname.
19142 if test "X$netdb_name_type" = X ; then
19143 case "$d_gethbyname" in
19147 Checking to see what type of argument is accepted by gethostbyname().
19149 hdrs="$define sys/types.h
19150 $d_socket sys/socket.h
19151 $i_niin netinet/in.h
19153 $i_unistd unistd.h"
19154 for xxx in "const char *" "char *"; do
19155 case "$netdb_name_type" in
19156 '') try="extern struct hostent *gethostbyname($xxx);"
19157 if ./protochk "$try" $hdrs; then
19158 echo "Your system accepts $xxx."
19159 netdb_name_type="$xxx"
19164 : In case none of those worked, prompt the user.
19165 case "$netdb_name_type" in
19166 '') rp='What is the type for the 1st argument to gethostbyname?'
19169 netdb_name_type=$ans
19173 *) : no gethostbyname, so pick harmless default
19174 netdb_name_type='char *'
19179 : check for type of 1st argument to getnetbyaddr.
19180 if test "X$netdb_net_type" = X ; then
19181 case "$d_getnbyaddr" in
19185 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19187 hdrs="$define sys/types.h
19188 $d_socket sys/socket.h
19189 $i_niin netinet/in.h
19191 $i_unistd unistd.h"
19192 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19193 case "$netdb_net_type" in
19194 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19195 if ./protochk "$try" $hdrs; then
19196 echo "Your system accepts $xxx."
19197 netdb_net_type="$xxx"
19202 : In case none of those worked, prompt the user.
19203 case "$netdb_net_type" in
19204 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19207 netdb_net_type=$ans
19211 *) : no getnetbyaddr, so pick harmless default
19212 netdb_net_type='long'
19216 : locate the preferred pager for this system
19223 [a-zA-Z]:/*) dflt=$pg;;
19227 [a-zA-Z]:/*) dflt=$more;;
19231 [a-zA-Z]:/*) dflt=$less;;
19234 '') dflt=/usr/ucb/more;;
19238 : Instruct ./getfile to trust the hinted or previous pager value,
19239 : even if it does not begin with a slash. For example, on os2,
19240 : pager might be cmd /c more. See comments in UU/getfile.
19245 rp='What pager is used on your system?'
19249 : see what type pids are declared as in the kernel
19250 rp="What is the type of process ids on this system?"
19251 set pid_t pidtype int stdio.h sys/types.h
19254 : see if ar generates random libraries by itself
19256 echo "Checking how to generate random libraries on your machine..." >&4
19257 echo 'int bar1() { return bar2(); }' > bar1.c
19258 echo 'int bar2() { return 2; }' > bar2.c
19260 #$i_stdlib I_STDLIB
19262 #include <stdlib.h>
19264 int main() { printf("%d\n", bar1()); exit(0); }
19266 $cc $ccflags -c bar1.c >/dev/null 2>&1
19267 $cc $ccflags -c bar2.c >/dev/null 2>&1
19268 $cc $ccflags -c foo.c >/dev/null 2>&1
19269 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19270 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19271 $run ./foobar >/dev/null 2>&1; then
19272 echo "$ar appears to generate random libraries itself."
19274 if [ "X$ranlib" = "X" ]; then
19277 elif $ar s bar$_a >/dev/null 2>&1 &&
19278 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19279 $run ./foobar >/dev/null 2>&1; then
19280 echo "a table of contents needs to be added with '$ar s'."
19283 elif $ar ts bar$_a >/dev/null 2>&1 &&
19284 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19285 $run ./foobar >/dev/null 2>&1; then
19286 echo "a table of contents needs to be added with '$ar ts'."
19293 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19294 $test -f $ranlib || ranlib=''
19297 if $test -n "$ranlib"; then
19298 echo "your system has '$ranlib'; we'll use that."
19301 echo "your system doesn't seem to support random libraries"
19302 echo "so we'll use lorder and tsort to order the libraries."
19309 : check for type of arguments to select.
19310 case "$selecttype" in
19311 '') case "$d_select" in
19315 Checking to see what type of arguments are accepted by select().
19317 hdrs="$define sys/types.h
19318 $i_systime sys/time.h
19319 $i_sysselct sys/select.h
19320 $d_socket sys/socket.h"
19321 : The first arg can be int, unsigned, or size_t
19322 : The last arg may or may not be 'const'
19324 : void pointer has been seen but using that
19325 : breaks the selectminbits test
19326 for xxx in 'fd_set *' 'int *'; do
19327 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19328 for tmo in 'struct timeval *' 'const struct timeval *'; do
19330 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19331 if ./protochk "$try" $hdrs; then
19332 echo "Your system accepts $xxx."
19341 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19342 case "$d_fd_set" in
19343 $define) dflt="fd_set *" ;;
19352 *) : no select, so pick a harmless default
19359 : check for the select 'width'
19360 case "$selectminbits" in
19361 '') safebits=`expr $ptrsize \* 8`
19362 case "$d_select" in
19366 Checking to see on how many bits at a time your select() operates...
19369 #include <sys/types.h>
19371 #$i_systime I_SYS_TIME
19372 #$i_systimek I_SYS_TIME_KERNEL
19377 # ifdef I_SYS_TIME_KERNEL
19380 # include <sys/time.h>
19381 # ifdef I_SYS_TIME_KERNEL
19385 #$i_sysselct I_SYS_SELECT
19386 #ifdef I_SYS_SELECT
19387 #include <sys/select.h>
19389 #$d_socket HAS_SOCKET
19391 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19394 #$i_stdlib I_STDLIB
19396 #include <stdlib.h>
19399 #define S sizeof(*(b))
19401 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19402 #define NBITS (NBYTES * 8)
19404 char *s = malloc(NBYTES);
19413 fp = fopen("try.c", "r");
19419 b = ($selecttype)s;
19420 for (i = 0; i < NBITS; i++)
19424 select(fd + 1, b, 0, 0, &t);
19425 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19427 printf("%d\n", i + 1);
19432 if eval $compile_ok; then
19433 selectminbits=`$run ./try`
19434 case "$selectminbits" in
19436 Cannot figure out on how many bits at a time your select() operates.
19437 I'll play safe and guess it is $safebits bits.
19439 selectminbits=$safebits
19440 bits="$safebits bits"
19443 *) bits="$selectminbits bits" ;;
19445 echo "Your select() operates on $bits at a time." >&4
19447 rp='What is the minimum number of bits your select() operates on?'
19448 case "$byteorder" in
19449 12345678) dflt=64 ;;
19455 selectminbits="$val"
19459 *) : no select, so pick a harmless default
19460 selectminbits=$safebits
19466 : Trace out the files included by signal.h, then look for SIGxxx names.
19467 : Remove SIGARRAYSIZE used by HPUX.
19468 : Remove SIGSTKSIZE used by Linux.
19469 : Remove SIGSTKSZ used by Posix.
19470 : Remove SIGTYP void lines used by OS2.
19471 : Some cpps, like os390, dont give the file name anywhere
19472 if [ "X$fieldn" = X ]; then
19473 : Just make some guesses. We check them later.
19474 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
19476 xxx=`echo '#include <signal.h>' |
19477 $cppstdin $cppminus $cppflags 2>/dev/null |
19478 $grep '^[ ]*#.*include' |
19479 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
19481 : Check this list of files to be sure we have parsed the cpp output ok.
19482 : This will also avoid potentially non-existent files, such
19485 for xx in $xxx /dev/null ; do
19486 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
19488 : If we have found no files, at least try signal.h
19489 case "$xxxfiles" in
19490 '') xxxfiles=`./findhdr signal.h` ;;
19493 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
19494 print substr($2, 4, 20)
19496 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
19497 print substr($3, 4, 20)
19499 : Append some common names just in case the awk scan failed.
19500 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
19501 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
19502 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19503 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19504 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19506 : generate a few handy files for later
19507 $cat > signal.c <<EOCP
19508 #include <sys/types.h>
19509 #include <signal.h>
19510 #$i_stdlib I_STDLIB
19512 #include <stdlib.h>
19517 /* Strange style to avoid deeply-nested #if/#else/#endif */
19520 # define NSIG (_NSIG)
19526 # define NSIG (SIGMAX+1)
19532 # define NSIG (SIG_MAX+1)
19538 # define NSIG (_SIG_MAX+1)
19544 # define NSIG (MAXSIG+1)
19550 # define NSIG (MAX_SIG+1)
19555 # ifdef SIGARRAYSIZE
19556 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
19562 # define NSIG (_sys_nsig) /* Solaris 2.5 */
19566 /* Default to some arbitrary number that's big enough to get most
19567 of the common signals.
19573 printf("NSIG %d\n", NSIG);
19579 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
19581 printf "#ifdef SIG"; printf $1; printf "\n"
19582 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
19583 printf $1; printf ");\n"
19587 printf "#endif /* JUST_NSIG */\n";
19588 printf "exit(0);\n}\n";
19591 $cat >signal.awk <<'EOP'
19592 BEGIN { ndups = 0 }
19593 $1 ~ /^NSIG$/ { nsig = $2 }
19594 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
19595 if ($2 > maxsig) { maxsig = $2 }
19596 if (sig_name[$2]) {
19597 dup_name[ndups] = $1
19598 dup_num[ndups] = $2
19610 printf("NSIG %d\n", nsig);
19611 for (n = 1; n < nsig; n++) {
19613 printf("%s %d\n", sig_name[n], sig_num[n])
19616 printf("NUM%d %d\n", n, n)
19619 for (n = 0; n < ndups; n++) {
19620 printf("%s %d\n", dup_name[n], dup_num[n])
19624 $cat >signal_cmd <<EOS
19626 if $test -s signal.lst; then
19627 echo "Using your existing signal.lst file"
19632 $cat >>signal_cmd <<'EOS'
19635 if eval $compile_ok; then
19636 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
19638 echo "(I can't seem be able to compile the whole test program)" >&4
19639 echo "(I'll try it in little pieces.)" >&4
19640 set signal -DJUST_NSIG
19641 if eval $compile_ok; then
19642 $run ./signal$_exe > signal.nsg
19645 echo "I can't seem to figure out how many signals you have." >&4
19646 echo "Guessing 50." >&4
19647 echo 'NSIG 50' > signal.nsg
19649 : Now look at all the signal names, one at a time.
19650 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
19651 $cat > signal.c <<EOCP
19652 #include <sys/types.h>
19653 #include <signal.h>
19656 printf("$xx %d\n", SIG${xx});
19661 if eval $compile; then
19662 echo "SIG${xx} found."
19663 $run ./signal$_exe >> signal.ls1
19665 echo "SIG${xx} NOT found."
19668 if $test -s signal.ls1; then
19669 $cat signal.nsg signal.ls1 |
19670 $sort -n | $uniq | $awk -f signal.awk >signal.lst
19674 if $test -s signal.lst; then
19677 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
19678 echo 'kill -l' >signal
19679 set X `csh -f <signal`
19683 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
19685 echo $@ | $tr ' ' $trnl | \
19686 $awk '{ printf "%s %d\n", $1, ++s; }
19687 END { printf "NSIG %d\n", ++s }' >signal.lst
19689 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
19691 chmod a+x signal_cmd
19692 $eunicefix signal_cmd
19694 : generate list of signal names
19696 case "$sig_name_init" in
19698 *) case "$sig_num_init" in
19699 ''|*,*) doinit=yes ;;
19704 echo "Generating a list of signal names and numbers..." >&4
19706 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
19707 sig_name=`$awk 'BEGIN { printf "ZERO " }
19708 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
19709 sig_num=`$awk 'BEGIN { printf "0 " }
19710 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
19711 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
19712 !/^NSIG/ { printf "\"%s\", ", $1 }
19713 END { printf "0\n" }' signal.lst`
19714 sig_num_init=`$awk 'BEGIN { printf "0, " }
19715 !/^NSIG/ { printf "%d, ", $2}
19716 END { printf "0\n"}' signal.lst`
19719 echo "The following $sig_count signals are available:"
19721 echo $sig_name | $awk \
19722 'BEGIN { linelen = 0 }
19724 for (i = 1; i <= NF; i++) {
19725 name = "SIG" $i " "
19726 linelen = linelen + length(name)
19727 if (linelen > 70) {
19729 linelen = length(name)
19735 sig_size=`echo $sig_name | awk '{print NF}'`
19736 $rm -f signal signal.c signal.awk signal.lst signal_cmd
19739 case "$sizetype" in
19740 *_t) zzz="$sizetype" ;;
19741 *) zzz="filesize" ;;
19743 echo "Checking the size of $zzz..." >&4
19745 #include <sys/types.h>
19747 #$i_stdlib I_STDLIB
19749 #include <stdlib.h>
19752 printf("%d\n", (int)sizeof($sizetype));
19757 if eval $compile_ok; then
19761 echo "(I can't execute the test program--guessing $sizesize.)" >&4
19764 echo "Your $zzz size is $sizesize bytes."
19769 echo "(I can't compile the test program--guessing $sizesize.)" >&4
19773 : check for socklen_t
19775 echo "Checking to see if you have socklen_t..." >&4
19777 #include <sys/types.h>
19778 #$d_socket HAS_SOCKET
19780 #include <sys/socket.h>
19782 int main() { socklen_t x = 16; }
19785 if eval $compile; then
19787 echo "You have socklen_t."
19790 echo "You do not have socklen_t."
19791 case "$sizetype" in
19792 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
19799 : see if this is a socks.h system
19800 set socks.h i_socks
19803 : check for type of the size argument to socket calls
19804 case "$d_socket" in
19808 Checking to see what type is the last argument of accept().
19811 case "$d_socklen_t" in
19812 "$define") yyy="$yyy socklen_t"
19814 yyy="$yyy $sizetype int long unsigned"
19815 for xxx in $yyy; do
19816 case "$socksizetype" in
19817 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
19818 case "$usesocks" in
19820 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
19821 echo "Your system accepts '$xxx *' for the last argument of accept()."
19822 socksizetype="$xxx"
19825 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
19826 echo "Your system accepts '$xxx *' for the last argument of accept()."
19827 socksizetype="$xxx"
19834 : In case none of those worked, prompt the user.
19835 case "$socksizetype" in
19836 '') rp='What is the type for socket address structure sizes?'
19843 *) : no sockets, so pick relatively harmless default
19848 : see what type is used for signed size_t
19849 set ssize_t ssizetype int stdio.h sys/types.h
19854 #$i_stdlib I_STDLIB
19856 #include <stdlib.h>
19858 #include <sys/types.h>
19859 #define Size_t $sizetype
19860 #define SSize_t $dflt
19863 if (sizeof(Size_t) == sizeof(SSize_t))
19865 else if (sizeof(Size_t) == sizeof(int))
19874 if eval $compile_ok && $run ./try > /dev/null; then
19875 ssizetype=`$run ./try`
19876 echo "I'll be using $ssizetype for functions returning a byte count." >&4
19879 Help! I can't compile and run the ssize_t test program: please enlighten me!
19880 (This is probably a misconfiguration in your system or libraries, and
19881 you really ought to fix it. Still, I'll try anyway.)
19883 I need a type that is the same size as $sizetype, but is guaranteed to
19884 be signed. Common values are ssize_t, int and long.
19887 rp="What signed type is the same size as $sizetype?"
19893 : see what type of char stdio uses.
19895 echo '#include <stdio.h>' > stdio.c
19896 $cppstdin $cppminus < stdio.c > stdioh
19897 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
19898 echo "Your stdio uses unsigned chars." >&4
19899 stdchar="unsigned char"
19901 echo "Your stdio uses signed chars." >&4
19904 $rm -f stdio.* stdioh
19906 : see what type uids are declared as in the kernel
19908 echo "Looking for the type for user ids returned by getuid()."
19909 set uid_t uidtype xxx stdio.h sys/types.h
19913 xxx=`./findhdr sys/user.h`
19914 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
19916 unsigned) dflt="$1 $2" ;;
19920 *) dflt="$uidtype";;
19923 uid_t) echo "uid_t found." ;;
19924 *) rp="What is the type for user ids returned by getuid()?"
19932 *_t) zzz="$uidtype" ;;
19935 echo "Checking the size of $zzz..." >&4
19937 #include <sys/types.h>
19939 #$i_stdlib I_STDLIB
19941 #include <stdlib.h>
19944 printf("%d\n", (int)sizeof($uidtype));
19949 if eval $compile_ok; then
19953 echo "(I can't execute the test program--guessing $uidsize.)" >&4
19956 echo "Your $zzz is $uidsize bytes long."
19961 echo "(I can't compile the test program--guessing $uidsize.)" >&4
19966 *_t) zzz="$uidtype" ;;
19969 echo "Checking the sign of $zzz..." >&4
19971 #include <sys/types.h>
19982 if eval $compile; then
19986 echo "(I can't execute the test program--guessing unsigned.)" >&4
19990 1) echo "Your $zzz is unsigned." ;;
19991 -1) echo "Your $zzz is signed." ;;
19997 echo "(I can't compile the test program--guessing unsigned.)" >&4
20003 $echo "Checking the format string to be used for uids..." >&4
20006 -1) if $test X"$uidsize" = X"$ivsize"; then
20007 uidformat="$ivdformat"
20009 if $test X"$uidsize" = X"$longsize"; then
20012 if $test X"$uidsize" = X"$intsize"; then
20015 if $test X"$uidsize" = X"$shortsize"; then
20022 *) if $test X"$uidsize" = X"$uvsize"; then
20023 uidformat="$uvuformat"
20025 if $test X"$uidsize" = X"$longsize"; then
20028 if $test X"$uidsize" = X"$intsize"; then
20031 if $test X"$uidsize" = X"$shortsize"; then
20041 case "$usesitecustomize" in
20042 $define|true|[Yy]*)
20043 usesitecustomize="$define"
20046 usesitecustomize="$undef"
20050 : determine compiler compiler
20059 if $test -f "$byacc$_exe"; then
20061 comp="byacc or $comp"
20063 if $test -f "$bison$_exe"; then
20064 comp="$comp or bison -y"
20066 rp="Which compiler compiler ($comp) shall I use?"
20075 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20081 : see if this is a fp.h system
20085 : see if this is a fp_class.h system
20086 set fp_class.h i_fp_class
20089 : see if this is a ieeefp.h system
20090 case "$i_ieeefp" in
20091 '' ) set ieeefp.h i_ieeefp
20096 : see if this is a libutil.h system
20097 set libutil.h i_libutil
20100 : see if mach cthreads are available
20101 if test "X$usethreads" = "X$define"; then
20102 set mach/cthreads.h i_machcthr
20105 i_machcthr="$undef"
20110 : see if this is a mntent.h system
20111 set mntent.h i_mntent
20114 : see if ndbm.h is available
20120 # Some Linux distributions such as RedHat 7.1 put the
20121 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20122 if $test -f /usr/include/gdbm/ndbm.h; then
20123 echo '<gdbm/ndbm.h> found.'
20124 ccflags="$ccflags -I/usr/include/gdbm"
20125 cppflags="$cppflags -I/usr/include/gdbm"
20133 : see if dbm_open exists
20134 set dbm_open d_dbm_open
20136 case "$d_dbm_open" in
20139 echo "We won't be including <ndbm.h>"
20148 : see if net/errno.h is available
20150 set net/errno.h val
20153 : Unfortunately, it causes problems on some systems. Arrgh.
20156 cat > try.c <<'EOM'
20159 #include <net/errno.h>
20165 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20166 echo "We'll be including <net/errno.h>." >&4
20168 echo "We won't be including <net/errno.h>." >&4
20177 : see if netinet/tcp.h is available
20178 set netinet/tcp.h i_netinettcp
20181 : see if this is a poll.h system
20185 : see if this is a prot.h system
20190 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20191 $cat <<'EOSH' > Cppsym.know
20192 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20193 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20194 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20195 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20196 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20197 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20198 bull c cadmus clipper CMU COFF COMPILER_VERSION
20199 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20200 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20201 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20202 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20204 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20205 H3050R H3050RX hbullx20 hcx host_mips
20206 hp200 hp300 hp700 HP700 hp800 hp9000
20207 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20208 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20209 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20210 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20211 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20212 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20213 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20214 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20215 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20216 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20217 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20218 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20219 MATH_HAS_NO_SIDE_EFFECTS
20220 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20221 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20222 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20223 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20224 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20225 NetBSD news1500 news1700 news1800 news1900 news3700
20226 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20227 ns32016 ns32332 ns32k nsc32000
20228 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20229 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20230 pc532 pdp11 PGC PIC plexus PORTAR posix
20231 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20232 POSIX_C_SOURCE POSIX_SOURCE POWER
20233 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
20234 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20235 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20236 sony sony_news sonyrisc sparc sparclite spectrum
20237 stardent stdc STDC_EXT stratos sun sun3 sun386
20238 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20239 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20240 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20241 sysV68 sysV88 Tek4132 Tek4300 titan
20242 TM3200 TM5400 TM5600
20243 tower tower32 tower32_200 tower32_600 tower32_700
20244 tower32_800 tower32_850 tss
20245 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20246 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20247 unix UNIX95 UNIX99 unixpc unos
20248 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20249 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20250 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20252 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20253 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20254 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20257 # Maybe put other stuff here too.
20258 cat <<EOSH >>Cppsym.know
20261 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20262 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20263 $cat Cppsym.know > Cppsym.c
20264 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20265 $rm -f Cppsym.a Cppsym.b Cppsym.c
20266 cat <<EOSH > Cppsym
20268 if $test \$# -gt 0; then
20269 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20270 if $test -s Cppsym.got; then
20277 $tr " " "$trnl" | ./Cppsym.try
20283 cat <<EOSH > Cppsym.try
20285 cat <<'EOCP' > try.c
20288 #define STRINGIFY(a) "a"
20290 #if cpp_stuff == 42
20291 #define StGiFy(a) #a
20292 #define STRINGIFY(a) StGiFy(a)
20294 #if $cpp_stuff != 1 && $cpp_stuff != 42
20295 # include "Bletch: How does this C preprocessor stringify macros?"
20301 cat <<'EOSH' >> Cppsym.try
20303 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20304 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20305 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20306 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
20308 echo 'return 0;}' >> try.c
20310 cat <<EOSH >> Cppsym.try
20312 case "$osname-$gccversion" in
20313 irix-) ccflags="\$ccflags -woff 1178" ;;
20314 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20316 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
20318 chmod +x Cppsym.try
20319 $eunicefix Cppsym.try
20320 ./Cppsym < Cppsym.know > Cppsym.true
20321 : now check the C compiler for additional symbols
20322 postprocess_cc_v=''
20324 aix) postprocess_cc_v="|$tr , ' '" ;;
20331 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20334 -D*) echo "\$i" | $sed 's/^-D//';;
20335 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20340 postprocess_cc_v=''
20343 ./ccsym > ccsym1.raw
20344 if $test -s ccsym1.raw; then
20345 $sort ccsym1.raw | $uniq >ccsym.raw
20347 mv ccsym1.raw ccsym.raw
20350 $awk '/\=/ { print $0; next }
20351 { print $0"=1" }' ccsym.raw >ccsym.list
20352 $comm -13 Cppsym.true ccsym.list >ccsym.own
20353 $comm -12 Cppsym.true ccsym.list >ccsym.com
20354 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
20356 if $test -z ccsym.raw; then
20357 echo "Your C compiler doesn't seem to define any symbols!" >&4
20359 echo "However, your C preprocessor defines the following symbols:"
20362 cppsymbols=`$cat Cppsym.true`
20363 cppsymbols=`echo $cppsymbols`
20364 cppccsymbols="$cppsymbols"
20366 if $test -s ccsym.com; then
20367 echo "Your C compiler and pre-processor define these symbols:"
20368 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20371 cppccsymbols=`$cat ccsym.com`
20372 cppccsymbols=`echo $cppccsymbols`
20373 $test "$silent" || sleep 1
20375 if $test -s ccsym.cpp; then
20376 $test "$also" && echo " "
20377 echo "Your C pre-processor ${also}defines the following symbols:"
20378 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20380 cppsymbols=`$cat ccsym.cpp`
20381 cppsymbols=`echo $cppsymbols`
20382 $test "$silent" || sleep 1
20384 if $test -s ccsym.own; then
20385 $test "$also" && echo " "
20386 echo "Your C compiler ${also}defines the following cpp symbols:"
20387 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20388 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20389 ccsymbols=`$cat ccsym.own`
20390 ccsymbols=`echo $ccsymbols`
20391 $test "$silent" || sleep 1
20395 : see if this is a termio system
20399 if $test `./findhdr termios.h`; then
20400 set tcsetattr i_termios
20406 "$define") echo "You have POSIX termios.h... good!" >&4;;
20407 *) if ./Cppsym pyr; then
20408 case "`/bin/universe`" in
20409 ucb) if $test `./findhdr sgtty.h`; then
20411 echo "<sgtty.h> found." >&4
20413 echo "System is pyramid with BSD universe."
20414 echo "<sgtty.h> not found--you could have problems." >&4
20416 *) if $test `./findhdr termio.h`; then
20418 echo "<termio.h> found." >&4
20420 echo "System is pyramid with USG universe."
20421 echo "<termio.h> not found--you could have problems." >&4
20425 if $test `./findhdr termio.h`; then
20426 echo "<termio.h> found." >&4
20428 elif $test `./findhdr sgtty.h`; then
20429 echo "<sgtty.h> found." >&4
20432 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
20435 if $test `./findhdr sgtty.h`; then
20436 echo "<sgtty.h> found." >&4
20438 elif $test `./findhdr termio.h`; then
20439 echo "<termio.h> found." >&4
20442 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
20446 set i_termio; eval $setvar
20447 val=$val2; set i_sgtty; eval $setvar
20448 val=$val3; set i_termios; eval $setvar
20450 : see if stddef is available
20451 set stddef.h i_stddef
20454 : see if this is a sunmath.h system
20455 set sunmath.h i_sunmath
20458 : see if sys/access.h is available
20459 set sys/access.h i_sysaccess
20462 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
20463 set sys/filio.h i_sysfilio
20466 if $test `./findhdr sys/ioctl.h`; then
20468 echo '<sys/ioctl.h> found.' >&4
20471 if $test $i_sysfilio = "$define"; then
20472 echo '<sys/ioctl.h> NOT found.' >&4
20474 $test $i_sgtty = "$define" && xxx="sgtty.h"
20475 $test $i_termio = "$define" && xxx="termio.h"
20476 $test $i_termios = "$define" && xxx="termios.h"
20477 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
20483 : see if socket ioctl defs are in sys/sockio.h
20485 xxx=`./findhdr sys/sockio.h`
20486 if $test "$xxx"; then
20487 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
20489 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
20492 echo "No socket ioctls found in <sys/sockio.h>." >&4
20497 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
20504 : see if this is a syslog.h system
20505 set syslog.h i_syslog
20509 : see if this is a sys/mode.h system
20510 set sys/mode.h i_sysmode
20513 : see if sys/resource.h has to be included
20514 set sys/resource.h i_sysresrc
20517 : see if sys/security.h is available
20518 set sys/security.h i_syssecrt
20521 : see if this is a sys/statvfs.h system
20522 set sys/statvfs.h i_sysstatvfs
20525 : see if this is a sys/un.h system
20526 set sys/un.h i_sysun
20530 : see if this is a sys/utsname.h system
20531 set sys/utsname.h i_sysutsname
20534 : see if this is a syswait system
20535 set sys/wait.h i_syswait
20538 : see if this is a ustat.h system
20539 set ustat.h i_ustat
20542 : see if this is an utime system
20543 set utime.h i_utime
20546 : see if this is a values.h system
20547 set values.h i_values
20550 : see if this is a vfork system
20553 set vfork.h i_vfork
20561 : see if gdbm.h is available
20566 : see if gdbm_open exists
20567 set gdbm_open d_gdbm_open
20569 case "$d_gdbm_open" in
20572 echo "We won't be including <gdbm.h>"
20582 echo "Looking for extensions..." >&4
20583 : If we are using the old config.sh, known_extensions may contain
20584 : old or inaccurate or duplicate values.
20585 known_extensions=''
20586 nonxs_extensions=''
20587 : We do not use find because it might not be available.
20588 : We do not just use MANIFEST because the user may have dropped
20589 : some additional extensions into the source tree and expect them
20592 : Function to recursively find available extensions, ignoring DynaLoader
20593 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
20597 DynaLoader|dynaload) ;;
20599 if $test -f $xxx/$xxx.xs; then
20600 known_extensions="$known_extensions $1$xxx";
20601 elif $test -f $xxx/Makefile.PL; then
20602 nonxs_extensions="$nonxs_extensions $1$xxx";
20604 if $test -d $xxx -a $# -lt 10; then
20607 eval $find_extensions;
20619 eval $find_extensions
20620 # Special case: Add in threads/shared since it is not picked up by the
20621 # recursive find above (and adding in general recursive finding breaks
20622 # SDBM_File/sdbm). A.D. 10/25/2001.
20623 known_extensions="$known_extensions threads/shared"
20624 set X $nonxs_extensions
20626 nonxs_extensions="$*"
20627 set X $known_extensions
20629 known_extensions="$*"
20632 : Now see which are supported on this system.
20634 for xxx in $known_extensions ; do
20638 $define) avail_ext="$avail_ext $xxx" ;;
20641 GDBM_File|gdbm_fil)
20643 $define) avail_ext="$avail_ext $xxx" ;;
20646 I18N/Langinfo|i18n_lan)
20647 case "$i_langinfo$d_nl_langinfo" in
20648 $define$define) avail_ext="$avail_ext $xxx" ;;
20651 NDBM_File|ndbm_fil)
20654 case "$osname-$use64bitint" in
20657 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
20660 *) avail_ext="$avail_ext $xxx" ;;
20665 ODBM_File|odbm_fil)
20666 case "${i_dbm}${i_rpcsvcdbm}" in
20668 case "$osname-$use64bitint" in
20671 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
20674 *) avail_ext="$avail_ext $xxx" ;;
20680 case "$useposix" in
20681 true|define|y) avail_ext="$avail_ext $xxx" ;;
20685 case "$useopcode" in
20686 true|define|y) avail_ext="$avail_ext $xxx" ;;
20690 case "$d_socket" in
20693 beos) ;; # not unless BONE
20694 *) avail_ext="$avail_ext $xxx" ;;
20699 Sys/Syslog|sys/syslog)
20700 : XXX syslog requires socket
20701 case "$d_socket" in
20702 true|$define|y) avail_ext="$avail_ext $xxx" ;;
20706 case "$usethreads" in
20708 case "$useithreads" in
20709 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
20713 XS/APItest|xs/apitest)
20714 # This is just for testing. Skip it unless we have dynamic loading.
20717 $define) avail_ext="$avail_ext $xxx" ;;
20720 XS/Typemap|xs/typemap)
20721 # This is just for testing. Skip it unless we have dynamic loading.
20723 $define) avail_ext="$avail_ext $xxx" ;;
20726 threads|threads/shared)
20727 # threads and threads::shared are special cases.
20728 # To stop people from asking "Perl 5.8.0 was supposed
20729 # to have this new fancy threads implementation but my
20730 # perl doesn't have it" and from people trying to
20731 # (re)install the threads module using CPAN.pm and
20732 # CPAN.pm then offering to reinstall Perl 5.8.0,
20733 # the threads.pm and threads/shared.pm will always be
20734 # there, croaking informatively ("you need to rebuild
20735 # all of Perl with threads, sorry") when threads haven't
20736 # been compiled in.
20738 avail_ext="$avail_ext $xxx"
20741 : XXX Do we need a useipcsysv variable here
20742 case "${d_msg}${d_sem}${d_shm}" in
20743 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
20746 *) avail_ext="$avail_ext $xxx"
20755 case "$onlyextensions" in
20757 *) keepextensions=''
20758 echo "You have requested that only certains extensions be included..." >&4
20759 for i in $onlyextensions; do
20760 case " $avail_ext " in
20762 echo "Keeping extension $i."
20763 keepextensions="$keepextensions $i"
20765 *) echo "Ignoring extension $i." ;;
20768 avail_ext="$keepextensions"
20772 case "$noextensions" in
20774 *) keepextensions=''
20775 echo "You have requested that certain extensions be ignored..." >&4
20776 for i in $avail_ext; do
20777 case " $noextensions " in
20778 *" $i "*) echo "Ignoring extension $i." ;;
20779 *) echo "Keeping extension $i.";
20780 keepextensions="$keepextensions $i"
20784 avail_ext="$keepextensions"
20788 : Now see which nonxs extensions are supported on this system.
20789 : For now assume all are.
20791 for xxx in $nonxs_extensions ; do
20793 *) nonxs_ext="$nonxs_ext $xxx"
20805 A number of extensions are supplied with $package. You may choose to
20806 compile these extensions for dynamic loading (the default), compile
20807 them into the $package executable (static loading), or not include
20808 them at all. Answer "none" to include no extensions.
20809 Note that DynaLoader is always built and need not be mentioned here.
20812 case "$dynamic_ext" in
20814 : Exclude those listed in static_ext
20816 for xxx in $avail_ext; do
20817 case " $static_ext " in
20819 *) dflt="$dflt $xxx" ;;
20826 *) dflt="$dynamic_ext"
20827 # Perhaps we are reusing an old out-of-date config.sh.
20830 if test X"$dynamic_ext" != X"$avail_ext"; then
20832 NOTICE: Your previous config.sh list may be incorrect.
20833 The extensions now available to you are
20835 but the default list from your previous config.sh is
20847 rp="What extensions do you wish to load dynamically?"
20850 none) dynamic_ext=' ' ;;
20851 *) dynamic_ext="$ans" ;;
20854 case "$static_ext" in
20856 : Exclude those already listed in dynamic linking
20858 for xxx in $avail_ext; do
20859 case " $dynamic_ext " in
20861 *) dflt="$dflt $xxx" ;;
20868 *) dflt="$static_ext"
20875 rp="What extensions do you wish to load statically?"
20878 none) static_ext=' ' ;;
20879 *) static_ext="$ans" ;;
20884 A number of extensions are supplied with $package. Answer "none"
20885 to include no extensions.
20886 Note that DynaLoader is always built and need not be mentioned here.
20889 case "$static_ext" in
20890 '') dflt="$avail_ext" ;;
20891 *) dflt="$static_ext"
20892 # Perhaps we are reusing an old out-of-date config.sh.
20895 if test X"$static_ext" != X"$avail_ext"; then
20897 NOTICE: Your previous config.sh list may be incorrect.
20898 The extensions now available to you are
20900 but the default list from your previous config.sh is
20909 : Exclude those that are not xs extensions
20913 rp="What extensions do you wish to include?"
20916 none) static_ext=' ' ;;
20917 *) static_ext="$ans" ;;
20922 # Encode is a special case. If we are building Encode as a static
20923 # extension, we need to explicitly list its subextensions as well.
20924 # For other nested extensions, this is handled automatically by
20925 # the appropriate Makefile.PL.
20926 case " $static_ext " in
20927 *" Encode "*) # Add the subextensions of Encode
20929 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
20930 static_ext="$static_ext Encode/$xxx"
20936 set X $dynamic_ext $static_ext $nonxs_ext
20940 # Sanity check: We require an extension suitable for use with
20941 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
20942 # should show up as failures in the test suite, but it's helpful to
20943 # catch them now.) The 'extensions' list is normally sorted
20944 # alphabetically, so we need to accept either
20945 # DB_File ... Fcntl ... IO ....
20946 # or something like
20947 # Fcntl ... NDBM_File ... IO ....
20948 case " $extensions" in
20949 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
20950 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
20951 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
20952 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
20953 echo "WARNING: The Perl you are building will be quite crippled." >& 4
20957 : Remove libraries needed only for extensions
20958 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
20959 : The exception is SunOS 4.x, which needs them.
20960 case "${osname}X${osvers}" in
20964 *) case "$usedl" in
20965 $define|true|[yY]*)
20966 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
20970 *) perllibs="$libs"
20976 : Remove build directory name from cppstdin so it can be used from
20977 : either the present location or the final installed location.
20979 : Get out of the UU directory to get correct path name.
20981 case "$cppstdin" in
20983 echo "Stripping down cppstdin path name"
20989 : end of configuration questions
20991 echo "End of configuration questions."
20994 : back to where it started
20995 if test -d ../UU; then
20999 : configuration may be patched via a 'config.arch' file
21000 if $test -f config.arch; then
21001 echo "I see a config.arch file, loading it."
21005 : configuration may be patched via a 'config.over' file
21006 if $test -f config.over; then
21009 rp='I see a config.over file. Do you wish to load it?'
21012 n*) echo "OK, I'll ignore it.";;
21014 echo "Configuration override changes have been loaded."
21019 : in case they want portability, strip down executable paths
21020 case "$d_portable" in
21023 echo "Stripping down executable paths..." >&4
21024 for file in $loclist $trylist; do
21026 eval $file=`basename $temp`
21031 : create config.sh file
21033 echo "Creating config.sh..." >&4
21034 $spitshell <<EOT >config.sh
21037 # This file was produced by running the Configure script. It holds all the
21038 # definitions figured out by Configure. Should you modify one of these values,
21039 # do not forget to propagate your changes by running "Configure -der". You may
21040 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21043 # Package name : $package
21044 # Source directory : $src
21045 # Configuration time: $cf_time
21046 # Configured by : $cf_by
21047 # Target system : $myuname
21057 Revision='$Revision'
21065 alignbytes='$alignbytes'
21066 ansi2knr='$ansi2knr'
21067 aphostname='$aphostname'
21068 api_revision='$api_revision'
21069 api_subversion='$api_subversion'
21070 api_version='$api_version'
21071 api_versionstring='$api_versionstring'
21074 archlibexp='$archlibexp'
21075 archname64='$archname64'
21076 archname='$archname'
21077 archobjs='$archobjs'
21078 asctime_r_proto='$asctime_r_proto'
21086 byteorder='$byteorder'
21088 castflags='$castflags'
21091 cccdlflags='$cccdlflags'
21092 ccdlflags='$ccdlflags'
21094 ccflags_uselargefiles='$ccflags_uselargefiles'
21096 ccsymbols='$ccsymbols'
21097 ccversion='$ccversion'
21099 cf_email='$cf_email'
21101 charsize='$charsize'
21105 clocktype='$clocktype'
21107 compress='$compress'
21108 contains='$contains'
21112 cpp_stuff='$cpp_stuff'
21113 cppccsymbols='$cppccsymbols'
21114 cppflags='$cppflags'
21116 cppminus='$cppminus'
21118 cppstdin='$cppstdin'
21119 cppsymbols='$cppsymbols'
21120 crypt_r_proto='$crypt_r_proto'
21121 cryptlib='$cryptlib'
21123 ctermid_r_proto='$ctermid_r_proto'
21124 ctime_r_proto='$ctime_r_proto'
21125 d_Gconvert='$d_Gconvert'
21126 d_PRIEUldbl='$d_PRIEUldbl'
21127 d_PRIFUldbl='$d_PRIFUldbl'
21128 d_PRIGUldbl='$d_PRIGUldbl'
21129 d_PRIXU64='$d_PRIXU64'
21130 d_PRId64='$d_PRId64'
21131 d_PRIeldbl='$d_PRIeldbl'
21132 d_PRIfldbl='$d_PRIfldbl'
21133 d_PRIgldbl='$d_PRIgldbl'
21134 d_PRIi64='$d_PRIi64'
21135 d_PRIo64='$d_PRIo64'
21136 d_PRIu64='$d_PRIu64'
21137 d_PRIx64='$d_PRIx64'
21138 d_SCNfldbl='$d_SCNfldbl'
21139 d__fwalk='$d__fwalk'
21140 d_access='$d_access'
21141 d_accessx='$d_accessx'
21144 d_archlib='$d_archlib'
21145 d_asctime_r='$d_asctime_r'
21148 d_attribute_format='$d_attribute_format'
21149 d_attribute_malloc='$d_attribute_malloc'
21150 d_attribute_nonnull='$d_attribute_nonnull'
21151 d_attribute_noreturn='$d_attribute_noreturn'
21152 d_attribute_pure='$d_attribute_pure'
21153 d_attribute_unused='$d_attribute_unused'
21154 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21158 d_bsdgetpgrp='$d_bsdgetpgrp'
21159 d_bsdsetpgrp='$d_bsdsetpgrp'
21161 d_casti32='$d_casti32'
21162 d_castneg='$d_castneg'
21163 d_charvspr='$d_charvspr'
21165 d_chroot='$d_chroot'
21166 d_chsize='$d_chsize'
21168 d_clearenv='$d_clearenv'
21169 d_closedir='$d_closedir'
21170 d_cmsghdr_s='$d_cmsghdr_s'
21172 d_copysignl='$d_copysignl'
21174 d_crypt_r='$d_crypt_r'
21176 d_ctermid_r='$d_ctermid_r'
21177 d_ctime_r='$d_ctime_r'
21178 d_cuserid='$d_cuserid'
21179 d_dbl_dig='$d_dbl_dig'
21180 d_dbminitproto='$d_dbminitproto'
21181 d_difftime='$d_difftime'
21183 d_dirnamlen='$d_dirnamlen'
21184 d_dlerror='$d_dlerror'
21185 d_dlopen='$d_dlopen'
21186 d_dlsymun='$d_dlsymun'
21187 d_dosuid='$d_dosuid'
21188 d_drand48_r='$d_drand48_r'
21189 d_drand48proto='$d_drand48proto'
21191 d_eaccess='$d_eaccess'
21192 d_endgrent='$d_endgrent'
21193 d_endgrent_r='$d_endgrent_r'
21194 d_endhent='$d_endhent'
21195 d_endhostent_r='$d_endhostent_r'
21196 d_endnent='$d_endnent'
21197 d_endnetent_r='$d_endnetent_r'
21198 d_endpent='$d_endpent'
21199 d_endprotoent_r='$d_endprotoent_r'
21200 d_endpwent='$d_endpwent'
21201 d_endpwent_r='$d_endpwent_r'
21202 d_endsent='$d_endsent'
21203 d_endservent_r='$d_endservent_r'
21204 d_eofnblk='$d_eofnblk'
21205 d_eunice='$d_eunice'
21206 d_faststdio='$d_faststdio'
21207 d_fchdir='$d_fchdir'
21208 d_fchmod='$d_fchmod'
21209 d_fchown='$d_fchown'
21211 d_fcntl_can_lock='$d_fcntl_can_lock'
21212 d_fd_macros='$d_fd_macros'
21213 d_fd_set='$d_fd_set'
21214 d_fds_bits='$d_fds_bits'
21215 d_fgetpos='$d_fgetpos'
21216 d_finite='$d_finite'
21217 d_finitel='$d_finitel'
21218 d_flexfnam='$d_flexfnam'
21220 d_flockproto='$d_flockproto'
21222 d_fp_class='$d_fp_class'
21223 d_fpathconf='$d_fpathconf'
21224 d_fpclass='$d_fpclass'
21225 d_fpclassify='$d_fpclassify'
21226 d_fpclassl='$d_fpclassl'
21227 d_fpos64_t='$d_fpos64_t'
21228 d_frexpl='$d_frexpl'
21229 d_fs_data_s='$d_fs_data_s'
21230 d_fseeko='$d_fseeko'
21231 d_fsetpos='$d_fsetpos'
21232 d_fstatfs='$d_fstatfs'
21233 d_fstatvfs='$d_fstatvfs'
21235 d_ftello='$d_ftello'
21237 d_futimes='$d_futimes'
21238 d_getcwd='$d_getcwd'
21239 d_getespwnam='$d_getespwnam'
21240 d_getfsstat='$d_getfsstat'
21241 d_getgrent='$d_getgrent'
21242 d_getgrent_r='$d_getgrent_r'
21243 d_getgrgid_r='$d_getgrgid_r'
21244 d_getgrnam_r='$d_getgrnam_r'
21245 d_getgrps='$d_getgrps'
21246 d_gethbyaddr='$d_gethbyaddr'
21247 d_gethbyname='$d_gethbyname'
21248 d_gethent='$d_gethent'
21249 d_gethname='$d_gethname'
21250 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21251 d_gethostbyname_r='$d_gethostbyname_r'
21252 d_gethostent_r='$d_gethostent_r'
21253 d_gethostprotos='$d_gethostprotos'
21254 d_getitimer='$d_getitimer'
21255 d_getlogin='$d_getlogin'
21256 d_getlogin_r='$d_getlogin_r'
21257 d_getmnt='$d_getmnt'
21258 d_getmntent='$d_getmntent'
21259 d_getnbyaddr='$d_getnbyaddr'
21260 d_getnbyname='$d_getnbyname'
21261 d_getnent='$d_getnent'
21262 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21263 d_getnetbyname_r='$d_getnetbyname_r'
21264 d_getnetent_r='$d_getnetent_r'
21265 d_getnetprotos='$d_getnetprotos'
21266 d_getpagsz='$d_getpagsz'
21267 d_getpbyname='$d_getpbyname'
21268 d_getpbynumber='$d_getpbynumber'
21269 d_getpent='$d_getpent'
21270 d_getpgid='$d_getpgid'
21271 d_getpgrp2='$d_getpgrp2'
21272 d_getpgrp='$d_getpgrp'
21273 d_getppid='$d_getppid'
21274 d_getprior='$d_getprior'
21275 d_getprotobyname_r='$d_getprotobyname_r'
21276 d_getprotobynumber_r='$d_getprotobynumber_r'
21277 d_getprotoent_r='$d_getprotoent_r'
21278 d_getprotoprotos='$d_getprotoprotos'
21279 d_getprpwnam='$d_getprpwnam'
21280 d_getpwent='$d_getpwent'
21281 d_getpwent_r='$d_getpwent_r'
21282 d_getpwnam_r='$d_getpwnam_r'
21283 d_getpwuid_r='$d_getpwuid_r'
21284 d_getsbyname='$d_getsbyname'
21285 d_getsbyport='$d_getsbyport'
21286 d_getsent='$d_getsent'
21287 d_getservbyname_r='$d_getservbyname_r'
21288 d_getservbyport_r='$d_getservbyport_r'
21289 d_getservent_r='$d_getservent_r'
21290 d_getservprotos='$d_getservprotos'
21291 d_getspnam='$d_getspnam'
21292 d_getspnam_r='$d_getspnam_r'
21293 d_gettimeod='$d_gettimeod'
21294 d_gmtime_r='$d_gmtime_r'
21295 d_gnulibc='$d_gnulibc'
21296 d_grpasswd='$d_grpasswd'
21297 d_hasmntopt='$d_hasmntopt'
21299 d_ilogbl='$d_ilogbl'
21301 d_inetaton='$d_inetaton'
21302 d_int64_t='$d_int64_t'
21303 d_isascii='$d_isascii'
21304 d_isfinite='$d_isfinite'
21307 d_isnanl='$d_isnanl'
21308 d_killpg='$d_killpg'
21309 d_lchown='$d_lchown'
21310 d_ldbl_dig='$d_ldbl_dig'
21311 d_libm_lib_version='$d_libm_lib_version'
21313 d_localtime_r='$d_localtime_r'
21314 d_locconv='$d_locconv'
21316 d_longdbl='$d_longdbl'
21317 d_longlong='$d_longlong'
21318 d_lseekproto='$d_lseekproto'
21320 d_madvise='$d_madvise'
21321 d_malloc_good_size='$d_malloc_good_size'
21322 d_malloc_size='$d_malloc_size'
21324 d_mbstowcs='$d_mbstowcs'
21325 d_mbtowc='$d_mbtowc'
21326 d_memchr='$d_memchr'
21327 d_memcmp='$d_memcmp'
21328 d_memcpy='$d_memcpy'
21329 d_memmove='$d_memmove'
21330 d_memset='$d_memset'
21332 d_mkdtemp='$d_mkdtemp'
21333 d_mkfifo='$d_mkfifo'
21334 d_mkstemp='$d_mkstemp'
21335 d_mkstemps='$d_mkstemps'
21336 d_mktime='$d_mktime'
21339 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21340 d_modflproto='$d_modflproto'
21341 d_mprotect='$d_mprotect'
21343 d_msg_ctrunc='$d_msg_ctrunc'
21344 d_msg_dontroute='$d_msg_dontroute'
21345 d_msg_oob='$d_msg_oob'
21346 d_msg_peek='$d_msg_peek'
21347 d_msg_proxy='$d_msg_proxy'
21348 d_msgctl='$d_msgctl'
21349 d_msgget='$d_msgget'
21350 d_msghdr_s='$d_msghdr_s'
21351 d_msgrcv='$d_msgrcv'
21352 d_msgsnd='$d_msgsnd'
21354 d_munmap='$d_munmap'
21355 d_mymalloc='$d_mymalloc'
21357 d_nl_langinfo='$d_nl_langinfo'
21358 d_nv_preserves_uv='$d_nv_preserves_uv'
21359 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21360 d_off64_t='$d_off64_t'
21361 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21362 d_oldpthreads='$d_oldpthreads'
21363 d_oldsock='$d_oldsock'
21365 d_pathconf='$d_pathconf'
21367 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21368 d_phostname='$d_phostname'
21371 d_portable='$d_portable'
21372 d_procselfexe='$d_procselfexe'
21373 d_pthread_atfork='$d_pthread_atfork'
21374 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21375 d_pthread_yield='$d_pthread_yield'
21377 d_pwchange='$d_pwchange'
21378 d_pwclass='$d_pwclass'
21379 d_pwcomment='$d_pwcomment'
21380 d_pwexpire='$d_pwexpire'
21381 d_pwgecos='$d_pwgecos'
21382 d_pwpasswd='$d_pwpasswd'
21383 d_pwquota='$d_pwquota'
21386 d_random_r='$d_random_r'
21387 d_readdir64_r='$d_readdir64_r'
21388 d_readdir='$d_readdir'
21389 d_readdir_r='$d_readdir_r'
21390 d_readlink='$d_readlink'
21392 d_recvmsg='$d_recvmsg'
21393 d_rename='$d_rename'
21394 d_rewinddir='$d_rewinddir'
21396 d_safebcpy='$d_safebcpy'
21397 d_safemcpy='$d_safemcpy'
21398 d_sanemcmp='$d_sanemcmp'
21399 d_sbrkproto='$d_sbrkproto'
21400 d_scalbnl='$d_scalbnl'
21401 d_sched_yield='$d_sched_yield'
21402 d_scm_rights='$d_scm_rights'
21403 d_seekdir='$d_seekdir'
21404 d_select='$d_select'
21406 d_semctl='$d_semctl'
21407 d_semctl_semid_ds='$d_semctl_semid_ds'
21408 d_semctl_semun='$d_semctl_semun'
21409 d_semget='$d_semget'
21411 d_sendmsg='$d_sendmsg'
21412 d_setegid='$d_setegid'
21413 d_seteuid='$d_seteuid'
21414 d_setgrent='$d_setgrent'
21415 d_setgrent_r='$d_setgrent_r'
21416 d_setgrps='$d_setgrps'
21417 d_sethent='$d_sethent'
21418 d_sethostent_r='$d_sethostent_r'
21419 d_setitimer='$d_setitimer'
21420 d_setlinebuf='$d_setlinebuf'
21421 d_setlocale='$d_setlocale'
21422 d_setlocale_r='$d_setlocale_r'
21423 d_setnent='$d_setnent'
21424 d_setnetent_r='$d_setnetent_r'
21425 d_setpent='$d_setpent'
21426 d_setpgid='$d_setpgid'
21427 d_setpgrp2='$d_setpgrp2'
21428 d_setpgrp='$d_setpgrp'
21429 d_setprior='$d_setprior'
21430 d_setproctitle='$d_setproctitle'
21431 d_setprotoent_r='$d_setprotoent_r'
21432 d_setpwent='$d_setpwent'
21433 d_setpwent_r='$d_setpwent_r'
21434 d_setregid='$d_setregid'
21435 d_setresgid='$d_setresgid'
21436 d_setresuid='$d_setresuid'
21437 d_setreuid='$d_setreuid'
21438 d_setrgid='$d_setrgid'
21439 d_setruid='$d_setruid'
21440 d_setsent='$d_setsent'
21441 d_setservent_r='$d_setservent_r'
21442 d_setsid='$d_setsid'
21443 d_setvbuf='$d_setvbuf'
21447 d_shmatprototype='$d_shmatprototype'
21448 d_shmctl='$d_shmctl'
21450 d_shmget='$d_shmget'
21451 d_sigaction='$d_sigaction'
21452 d_sigprocmask='$d_sigprocmask'
21453 d_sigsetjmp='$d_sigsetjmp'
21454 d_snprintf='$d_snprintf'
21455 d_sockatmark='$d_sockatmark'
21456 d_sockatmarkproto='$d_sockatmarkproto'
21457 d_socket='$d_socket'
21458 d_socklen_t='$d_socklen_t'
21459 d_sockpair='$d_sockpair'
21460 d_socks5_init='$d_socks5_init'
21461 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
21463 d_srand48_r='$d_srand48_r'
21464 d_srandom_r='$d_srandom_r'
21465 d_sresgproto='$d_sresgproto'
21466 d_sresuproto='$d_sresuproto'
21467 d_statblks='$d_statblks'
21468 d_statfs_f_flags='$d_statfs_f_flags'
21469 d_statfs_s='$d_statfs_s'
21470 d_statvfs='$d_statvfs'
21471 d_stdio_cnt_lval='$d_stdio_cnt_lval'
21472 d_stdio_ptr_lval='$d_stdio_ptr_lval'
21473 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
21474 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
21475 d_stdio_stream_array='$d_stdio_stream_array'
21476 d_stdiobase='$d_stdiobase'
21477 d_stdstdio='$d_stdstdio'
21478 d_strchr='$d_strchr'
21479 d_strcoll='$d_strcoll'
21480 d_strctcpy='$d_strctcpy'
21481 d_strerrm='$d_strerrm'
21482 d_strerror='$d_strerror'
21483 d_strerror_r='$d_strerror_r'
21484 d_strftime='$d_strftime'
21485 d_strlcat='$d_strlcat'
21486 d_strlcpy='$d_strlcpy'
21487 d_strtod='$d_strtod'
21488 d_strtol='$d_strtol'
21489 d_strtold='$d_strtold'
21490 d_strtoll='$d_strtoll'
21491 d_strtoq='$d_strtoq'
21492 d_strtoul='$d_strtoul'
21493 d_strtoull='$d_strtoull'
21494 d_strtouq='$d_strtouq'
21495 d_strxfrm='$d_strxfrm'
21496 d_suidsafe='$d_suidsafe'
21497 d_symlink='$d_symlink'
21498 d_syscall='$d_syscall'
21499 d_syscallproto='$d_syscallproto'
21500 d_sysconf='$d_sysconf'
21501 d_sysernlst='$d_sysernlst'
21502 d_syserrlst='$d_syserrlst'
21503 d_system='$d_system'
21504 d_tcgetpgrp='$d_tcgetpgrp'
21505 d_tcsetpgrp='$d_tcsetpgrp'
21506 d_telldir='$d_telldir'
21507 d_telldirproto='$d_telldirproto'
21510 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
21511 d_tm_tm_zone='$d_tm_tm_zone'
21512 d_tmpnam_r='$d_tmpnam_r'
21513 d_truncate='$d_truncate'
21514 d_ttyname_r='$d_ttyname_r'
21515 d_tzname='$d_tzname'
21516 d_u32align='$d_u32align'
21517 d_ualarm='$d_ualarm'
21520 d_union_semun='$d_union_semun'
21521 d_unordered='$d_unordered'
21522 d_unsetenv='$d_unsetenv'
21523 d_usleep='$d_usleep'
21524 d_usleepproto='$d_usleepproto'
21526 d_vendorarch='$d_vendorarch'
21527 d_vendorbin='$d_vendorbin'
21528 d_vendorlib='$d_vendorlib'
21529 d_vendorscript='$d_vendorscript'
21531 d_void_closedir='$d_void_closedir'
21532 d_voidsig='$d_voidsig'
21533 d_voidtty='$d_voidtty'
21534 d_volatile='$d_volatile'
21535 d_vprintf='$d_vprintf'
21536 d_vsnprintf='$d_vsnprintf'
21538 d_waitpid='$d_waitpid'
21539 d_wcstombs='$d_wcstombs'
21540 d_wctomb='$d_wctomb'
21541 d_writev='$d_writev'
21544 db_hashtype='$db_hashtype'
21545 db_prefixtype='$db_prefixtype'
21546 db_version_major='$db_version_major'
21547 db_version_minor='$db_version_minor'
21548 db_version_patch='$db_version_patch'
21549 defvoidused='$defvoidused'
21550 direntrytype='$direntrytype'
21553 doublesize='$doublesize'
21555 drand48_r_proto='$drand48_r_proto'
21556 dynamic_ext='$dynamic_ext'
21562 endgrent_r_proto='$endgrent_r_proto'
21563 endhostent_r_proto='$endhostent_r_proto'
21564 endnetent_r_proto='$endnetent_r_proto'
21565 endprotoent_r_proto='$endprotoent_r_proto'
21566 endpwent_r_proto='$endpwent_r_proto'
21567 endservent_r_proto='$endservent_r_proto'
21568 eunicefix='$eunicefix'
21571 extensions='$extensions'
21573 fflushNULL='$fflushNULL'
21574 fflushall='$fflushall'
21576 firstmakefile='$firstmakefile'
21578 fpossize='$fpossize'
21579 fpostype='$fpostype'
21580 freetype='$freetype'
21583 full_csh='$full_csh'
21584 full_sed='$full_sed'
21585 gccansipedantic='$gccansipedantic'
21586 gccosandvers='$gccosandvers'
21587 gccversion='$gccversion'
21588 getgrent_r_proto='$getgrent_r_proto'
21589 getgrgid_r_proto='$getgrgid_r_proto'
21590 getgrnam_r_proto='$getgrnam_r_proto'
21591 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
21592 gethostbyname_r_proto='$gethostbyname_r_proto'
21593 gethostent_r_proto='$gethostent_r_proto'
21594 getlogin_r_proto='$getlogin_r_proto'
21595 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
21596 getnetbyname_r_proto='$getnetbyname_r_proto'
21597 getnetent_r_proto='$getnetent_r_proto'
21598 getprotobyname_r_proto='$getprotobyname_r_proto'
21599 getprotobynumber_r_proto='$getprotobynumber_r_proto'
21600 getprotoent_r_proto='$getprotoent_r_proto'
21601 getpwent_r_proto='$getpwent_r_proto'
21602 getpwnam_r_proto='$getpwnam_r_proto'
21603 getpwuid_r_proto='$getpwuid_r_proto'
21604 getservbyname_r_proto='$getservbyname_r_proto'
21605 getservbyport_r_proto='$getservbyport_r_proto'
21606 getservent_r_proto='$getservent_r_proto'
21607 getspnam_r_proto='$getspnam_r_proto'
21608 gidformat='$gidformat'
21614 gmtime_r_proto='$gmtime_r_proto'
21615 gnulibc_version='$gnulibc_version'
21617 groupcat='$groupcat'
21618 groupstype='$groupstype'
21621 h_sysfile='$h_sysfile'
21624 html1dir='$html1dir'
21625 html1direxp='$html1direxp'
21626 html3dir='$html3dir'
21627 html3direxp='$html3direxp'
21636 i_arpainet='$i_arpainet'
21637 i_bsdioctl='$i_bsdioctl'
21641 i_dirent='$i_dirent'
21647 i_fp_class='$i_fp_class'
21650 i_ieeefp='$i_ieeefp'
21651 i_inttypes='$i_inttypes'
21652 i_langinfo='$i_langinfo'
21653 i_libutil='$i_libutil'
21654 i_limits='$i_limits'
21655 i_locale='$i_locale'
21656 i_machcthr='$i_machcthr'
21657 i_malloc='$i_malloc'
21659 i_memory='$i_memory'
21660 i_mntent='$i_mntent'
21663 i_neterrno='$i_neterrno'
21664 i_netinettcp='$i_netinettcp'
21668 i_pthread='$i_pthread'
21670 i_rpcsvcdbm='$i_rpcsvcdbm'
21673 i_shadow='$i_shadow'
21675 i_stdarg='$i_stdarg'
21676 i_stddef='$i_stddef'
21677 i_stdlib='$i_stdlib'
21678 i_string='$i_string'
21679 i_sunmath='$i_sunmath'
21680 i_sysaccess='$i_sysaccess'
21681 i_sysdir='$i_sysdir'
21682 i_sysfile='$i_sysfile'
21683 i_sysfilio='$i_sysfilio'
21685 i_sysioctl='$i_sysioctl'
21686 i_syslog='$i_syslog'
21687 i_sysmman='$i_sysmman'
21688 i_sysmode='$i_sysmode'
21689 i_sysmount='$i_sysmount'
21690 i_sysndir='$i_sysndir'
21691 i_sysparam='$i_sysparam'
21692 i_sysresrc='$i_sysresrc'
21693 i_syssecrt='$i_syssecrt'
21694 i_sysselct='$i_sysselct'
21695 i_syssockio='$i_syssockio'
21696 i_sysstat='$i_sysstat'
21697 i_sysstatfs='$i_sysstatfs'
21698 i_sysstatvfs='$i_sysstatvfs'
21699 i_systime='$i_systime'
21700 i_systimek='$i_systimek'
21701 i_systimes='$i_systimes'
21702 i_systypes='$i_systypes'
21703 i_sysuio='$i_sysuio'
21705 i_sysutsname='$i_sysutsname'
21706 i_sysvfs='$i_sysvfs'
21707 i_syswait='$i_syswait'
21708 i_termio='$i_termio'
21709 i_termios='$i_termios'
21711 i_unistd='$i_unistd'
21714 i_values='$i_values'
21715 i_varargs='$i_varargs'
21716 i_varhdr='$i_varhdr'
21718 ignore_versioned_solibs='$ignore_versioned_solibs'
21719 inc_version_list='$inc_version_list'
21720 inc_version_list_init='$inc_version_list_init'
21723 installarchlib='$installarchlib'
21724 installbin='$installbin'
21725 installhtml1dir='$installhtml1dir'
21726 installhtml3dir='$installhtml3dir'
21727 installman1dir='$installman1dir'
21728 installman3dir='$installman3dir'
21729 installprefix='$installprefix'
21730 installprefixexp='$installprefixexp'
21731 installprivlib='$installprivlib'
21732 installscript='$installscript'
21733 installsitearch='$installsitearch'
21734 installsitebin='$installsitebin'
21735 installsitehtml1dir='$installsitehtml1dir'
21736 installsitehtml3dir='$installsitehtml3dir'
21737 installsitelib='$installsitelib'
21738 installsiteman1dir='$installsiteman1dir'
21739 installsiteman3dir='$installsiteman3dir'
21740 installsitescript='$installsitescript'
21741 installstyle='$installstyle'
21742 installusrbinperl='$installusrbinperl'
21743 installvendorarch='$installvendorarch'
21744 installvendorbin='$installvendorbin'
21745 installvendorhtml1dir='$installvendorhtml1dir'
21746 installvendorhtml3dir='$installvendorhtml3dir'
21747 installvendorlib='$installvendorlib'
21748 installvendorman1dir='$installvendorman1dir'
21749 installvendorman3dir='$installvendorman3dir'
21750 installvendorscript='$installvendorscript'
21752 issymlink='$issymlink'
21753 ivdformat='$ivdformat'
21756 known_extensions='$known_extensions'
21759 lddlflags='$lddlflags'
21761 ldflags_uselargefiles='$ldflags_uselargefiles'
21762 ldlibpthname='$ldlibpthname'
21769 libsdirs='$libsdirs'
21770 libsfiles='$libsfiles'
21771 libsfound='$libsfound'
21772 libspath='$libspath'
21773 libswanted='$libswanted'
21774 libswanted_uselargefiles='$libswanted_uselargefiles'
21780 localtime_r_proto='$localtime_r_proto'
21781 locincpth='$locincpth'
21782 loclibpth='$loclibpth'
21783 longdblsize='$longdblsize'
21784 longlongsize='$longlongsize'
21785 longsize='$longsize'
21789 lseeksize='$lseeksize'
21790 lseektype='$lseektype'
21794 make_set_make='$make_set_make'
21795 mallocobj='$mallocobj'
21796 mallocsrc='$mallocsrc'
21797 malloctype='$malloctype'
21799 man1direxp='$man1direxp'
21802 man3direxp='$man3direxp'
21804 mips_type='$mips_type'
21805 mistrustnm='$mistrustnm'
21807 mmaptype='$mmaptype'
21808 modetype='$modetype'
21810 multiarch='$multiarch'
21812 myarchname='$myarchname'
21813 mydomain='$mydomain'
21814 myhostname='$myhostname'
21817 need_va_copy='$need_va_copy'
21818 netdb_hlen_type='$netdb_hlen_type'
21819 netdb_host_type='$netdb_host_type'
21820 netdb_name_type='$netdb_name_type'
21821 netdb_net_type='$netdb_net_type'
21824 nm_so_opt='$nm_so_opt'
21825 nonxs_ext='$nonxs_ext'
21827 nvEUformat='$nvEUformat'
21828 nvFUformat='$nvFUformat'
21829 nvGUformat='$nvGUformat'
21830 nv_preserves_uv_bits='$nv_preserves_uv_bits'
21831 nveformat='$nveformat'
21832 nvfformat='$nvfformat'
21833 nvgformat='$nvgformat'
21836 o_nonblock='$o_nonblock'
21838 old_pthread_create_joinable='$old_pthread_create_joinable'
21839 optimize='$optimize'
21840 orderlib='$orderlib'
21843 otherlibdirs='$otherlibdirs'
21847 patchlevel='$patchlevel'
21848 path_sep='$path_sep'
21851 perl_patchlevel='$perl_patchlevel'
21852 perladmin='$perladmin'
21853 perllibs='$perllibs'
21854 perlpath='$perlpath'
21856 phostname='$phostname'
21862 prefixexp='$prefixexp'
21864 privlibexp='$privlibexp'
21865 procselfexe='$procselfexe'
21866 prototype='$prototype'
21868 quadkind='$quadkind'
21869 quadtype='$quadtype'
21870 randbits='$randbits'
21871 randfunc='$randfunc'
21872 random_r_proto='$random_r_proto'
21873 randseedtype='$randseedtype'
21875 rd_nodata='$rd_nodata'
21876 readdir64_r_proto='$readdir64_r_proto'
21877 readdir_r_proto='$readdir_r_proto'
21878 revision='$revision'
21883 sPRIEUldbl='$sPRIEUldbl'
21884 sPRIFUldbl='$sPRIFUldbl'
21885 sPRIGUldbl='$sPRIGUldbl'
21886 sPRIXU64='$sPRIXU64'
21888 sPRIeldbl='$sPRIeldbl'
21889 sPRIfldbl='$sPRIfldbl'
21890 sPRIgldbl='$sPRIgldbl'
21895 sSCNfldbl='$sSCNfldbl'
21896 sched_yield='$sched_yield'
21897 scriptdir='$scriptdir'
21898 scriptdirexp='$scriptdirexp'
21900 seedfunc='$seedfunc'
21901 selectminbits='$selectminbits'
21902 selecttype='$selecttype'
21903 sendmail='$sendmail'
21904 setgrent_r_proto='$setgrent_r_proto'
21905 sethostent_r_proto='$sethostent_r_proto'
21906 setlocale_r_proto='$setlocale_r_proto'
21907 setnetent_r_proto='$setnetent_r_proto'
21908 setprotoent_r_proto='$setprotoent_r_proto'
21909 setpwent_r_proto='$setpwent_r_proto'
21910 setservent_r_proto='$setservent_r_proto'
21913 sharpbang='$sharpbang'
21914 shmattype='$shmattype'
21915 shortsize='$shortsize'
21918 sig_count='$sig_count'
21919 sig_name='$sig_name'
21920 sig_name_init='$sig_name_init'
21922 sig_num_init='$sig_num_init'
21923 sig_size='$sig_size'
21924 signal_t='$signal_t'
21925 sitearch='$sitearch'
21926 sitearchexp='$sitearchexp'
21928 sitebinexp='$sitebinexp'
21929 sitehtml1dir='$sitehtml1dir'
21930 sitehtml1direxp='$sitehtml1direxp'
21931 sitehtml3dir='$sitehtml3dir'
21932 sitehtml3direxp='$sitehtml3direxp'
21934 sitelib_stem='$sitelib_stem'
21935 sitelibexp='$sitelibexp'
21936 siteman1dir='$siteman1dir'
21937 siteman1direxp='$siteman1direxp'
21938 siteman3dir='$siteman3dir'
21939 siteman3direxp='$siteman3direxp'
21940 siteprefix='$siteprefix'
21941 siteprefixexp='$siteprefixexp'
21942 sitescript='$sitescript'
21943 sitescriptexp='$sitescriptexp'
21944 sizesize='$sizesize'
21945 sizetype='$sizetype'
21949 sockethdr='$sockethdr'
21950 socketlib='$socketlib'
21951 socksizetype='$socksizetype'
21953 spackage='$spackage'
21954 spitshell='$spitshell'
21955 srand48_r_proto='$srand48_r_proto'
21956 srandom_r_proto='$srandom_r_proto'
21958 ssizetype='$ssizetype'
21959 startperl='$startperl'
21961 static_ext='$static_ext'
21963 stdio_base='$stdio_base'
21964 stdio_bufsiz='$stdio_bufsiz'
21965 stdio_cnt='$stdio_cnt'
21966 stdio_filbuf='$stdio_filbuf'
21967 stdio_ptr='$stdio_ptr'
21968 stdio_stream_array='$stdio_stream_array'
21969 strerror_r_proto='$strerror_r_proto'
21972 subversion='$subversion'
21976 targetarch='$targetarch'
21980 timeincl='$timeincl'
21981 timetype='$timetype'
21982 tmpnam_r_proto='$tmpnam_r_proto'
21988 ttyname_r_proto='$ttyname_r_proto'
21997 uidformat='$uidformat'
22003 uquadtype='$uquadtype'
22004 use5005threads='$use5005threads'
22005 use64bitall='$use64bitall'
22006 use64bitint='$use64bitint'
22007 usecrosscompile='$usecrosscompile'
22009 usefaststdio='$usefaststdio'
22010 useithreads='$useithreads'
22011 uselargefiles='$uselargefiles'
22012 uselongdouble='$uselongdouble'
22013 usemallocwrap='$usemallocwrap'
22014 usemorebits='$usemorebits'
22015 usemultiplicity='$usemultiplicity'
22016 usemymalloc='$usemymalloc'
22018 useopcode='$useopcode'
22019 useperlio='$useperlio'
22020 useposix='$useposix'
22021 usereentrant='$usereentrant'
22022 userelocatableinc='$userelocatableinc'
22024 useshrplib='$useshrplib'
22025 usesitecustomize='$usesitecustomize'
22026 usesocks='$usesocks'
22027 usethreads='$usethreads'
22028 usevendorprefix='$usevendorprefix'
22029 usevfork='$usevfork'
22032 uvXUformat='$uvXUformat'
22033 uvoformat='$uvoformat'
22036 uvuformat='$uvuformat'
22037 uvxformat='$uvxformat'
22038 vendorarch='$vendorarch'
22039 vendorarchexp='$vendorarchexp'
22040 vendorbin='$vendorbin'
22041 vendorbinexp='$vendorbinexp'
22042 vendorhtml1dir='$vendorhtml1dir'
22043 vendorhtml1direxp='$vendorhtml1direxp'
22044 vendorhtml3dir='$vendorhtml3dir'
22045 vendorhtml3direxp='$vendorhtml3direxp'
22046 vendorlib='$vendorlib'
22047 vendorlib_stem='$vendorlib_stem'
22048 vendorlibexp='$vendorlibexp'
22049 vendorman1dir='$vendorman1dir'
22050 vendorman1direxp='$vendorman1direxp'
22051 vendorman3dir='$vendorman3dir'
22052 vendorman3direxp='$vendorman3direxp'
22053 vendorprefix='$vendorprefix'
22054 vendorprefixexp='$vendorprefixexp'
22055 vendorscript='$vendorscript'
22056 vendorscriptexp='$vendorscriptexp'
22058 version_patchlevel_string='$version_patchlevel_string'
22059 versiononly='$versiononly'
22061 voidflags='$voidflags'
22064 yaccflags='$yaccflags'
22069 : Add in command line options if available
22070 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22072 : add special variables
22073 $test -f $src/patchlevel.h && \
22074 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22075 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22076 echo "PERL_CONFIG_SH=true" >>config.sh
22078 : propagate old symbols
22079 if $test -f UU/config.sh; then
22080 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22081 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
22082 $sort | $uniq -u >UU/oldsyms
22083 set X `cat UU/oldsyms`
22089 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22091 echo "# Variables propagated from previous config.sh file." >>config.sh
22092 for sym in `cat UU/oldsyms`; do
22093 echo " Propagating $hint variable "'$'"$sym..."
22094 eval 'tmp="$'"${sym}"'"'
22096 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22102 : Finish up by extracting the .SH files
22106 echo "Extraction done."
22116 If you'd like to make any changes to the config.sh file before I begin
22117 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22120 rp="Press return or use a shell escape to edit config.sh:"
22125 *) : in case they cannot read
22126 sh 1>&4 -c "$ans";;
22131 : if this fails, just run all the .SH files by hand
22140 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22147 Now you need to generate make dependencies by running "$make depend".
22148 You might prefer to run it in background: "$make depend > makedepend.out &"
22149 It can take a while, so you might not want to run it right now.
22154 rp="Run $make depend now?"
22158 $make depend && echo "Now you must run '$make'."
22161 echo "You must run '$make depend' then '$make'."
22164 elif test -f [Mm]akefile; then
22166 echo "Now you must run a $make."
22168 echo "Configure done."
22171 if $test -f Policy.sh; then
22174 If you compile $package on a different machine or from a different object
22175 directory, copy the Policy.sh file from this object directory to the
22176 new one before you run Configure -- this will help you with most of
22177 the policy defaults.
22181 if $test -f config.msg; then
22182 echo "Hmm. I also noted the following information while running:"
22184 $cat config.msg >&4
22187 $rm -f kit*isdone ark*isdone