3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist package (which contains metaconfig) is available via SVN:
17 # svn co https://svn.sourceforge.net/svnroot/dist/trunk/dist
20 # Though this script was generated by metaconfig, it is OK to send
21 # patches against it. It's up to the Configure pumpkin to backport
22 # the patch to the metaunits if it is accepted.
23 # See Porting/pumpkin.pod for more information on metaconfig.
26 # $Id: Head.U 6 2006-08-25 22:21:46Z rmanfredi $
28 # Generated on Wed Dec 3 15:26:54 CET 2008 [metaconfig 3.5 PL0]
29 # (with additional metaconfig patches by perlbug@perl.org)
34 SCO csh still thinks true is false. Write to SCO today and tell them that next
35 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
37 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
38 we'd have to do is go in and swap the && and || tokens, wherever they are.)
40 [End of diatribe. We now return you to your regularly scheduled programming...]
44 OOPS! You naughty creature! You didn't run Configure with sh!
45 I will attempt to remedy the situation by running sh for you...
49 true || exec sh $0 $argv:q
51 (exit $?0) || cat c2$$
52 (exit $?0) || exec sh $0 $argv:q
55 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
58 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
59 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
60 *** Please read the README.plan9 for further instructions.
61 *** Cannot continue, aborting.
67 if test ! -c /dev/null ; then
70 *** I'm sorry, but /dev/null appears to be a file rather than a device.
71 *** Please consult your operating sytem's notes for making a device
73 *** Cannot continue, aborting.
79 : compute my invocation name
83 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
88 : Proper separator for the PATH environment variable
90 : On OS/2 this directory should exist if this is not floppy only system ":-]"
91 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
92 if test -n "$OS2_SHELL"; then
94 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
95 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
97 elif test -n "$DJGPP"; then
98 case "X${MACHTYPE:-nonesuchmach}" in
105 : Proper PATH setting
106 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
107 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
108 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
109 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
110 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
111 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
112 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
113 paths="$paths /sbin /usr/sbin /usr/libexec"
114 paths="$paths /system/gnu_library/bin"
118 case "$p_$PATH$p_" in
120 *) test -d $p && PATH=$PATH$p_$p ;;
127 : shall we be using ksh?
133 if (PATH=.; alias -x) >/dev/null 2>&1; then
136 if test -f /hp-ux -a -f /bin/ksh; then
137 needksh='to avoid sh bug in "here document" expansion'
139 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
140 if test X`/usr/bin/uname -v` = X4; then
141 avoidksh="to avoid AIX 4's /bin/sh"
145 if test -f /osf_boot -a -f /usr/sbin/setld; then
146 if test X`/usr/bin/uname -s` = XOSF1; then
147 avoidksh="to avoid Digital UNIX' ksh"
152 case "$inksh/$needksh" in
159 case "$inksh/$avoidksh" in
165 case "$inksh/$needksh-$avoidksh-" in
168 (I see you are using the Korn shell. Some ksh's blow up on $me,
169 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
176 echo "(Feeding myself to $newsh $reason.)"
178 Configure|*/Configure) exec $newsh $0 "$@";;
179 *) exec $newsh Configure "$@";;
183 test -x "${newsh}" || unset newsh
185 : if needed, set CDPATH to a harmless value that is not chatty
186 : avoid bash 2.02 problems with empty CDPATH.
190 *bash*) CDPATH='.' ;;
196 : Configure runs within the UU subdirectory
197 test -d UU || mkdir UU
337 initialinstalllocation=''
364 d_attribute_deprecated=''
365 d_attribute_format=''
366 d_attribute_malloc=''
367 d_attribute_nonnull=''
368 d_attribute_noreturn=''
370 d_attribute_unused=''
371 d_attribute_warn_unused_result=''
372 d_printf_format_null=''
375 d_builtin_choose_expr=''
378 d_c99_variadic_macros=''
425 endhostent_r_proto=''
431 endprotoent_r_proto=''
437 endservent_r_proto=''
489 gethostbyaddr_r_proto=''
491 gethostbyname_r_proto=''
493 gethostent_r_proto=''
505 getnetbyaddr_r_proto=''
507 getnetbyname_r_proto=''
521 d_getprotobyname_r=''
522 getprotobyname_r_proto=''
523 d_getprotobynumber_r=''
524 getprotobynumber_r_proto=''
526 getprotoent_r_proto=''
538 getservbyname_r_proto=''
540 getservbyport_r_proto=''
542 getservent_r_proto=''
566 d_libm_lib_version=''
569 d_localtime_r_needs_tzset=''
580 d_malloc_good_size=''
622 d_old_pthread_create_joinable=''
623 old_pthread_create_joinable=''
625 d_pthread_attr_setscope=''
664 sethostent_r_proto=''
681 setprotoent_r_proto=''
693 setservent_r_proto=''
727 d_sprintf_returns_strlen=''
742 d_stdio_ptr_lval_nochange_cnt=''
743 d_stdio_ptr_lval_sets_cnt=''
886 d_gdbm_ndbm_h_uses_prototypes=''
887 d_gdbmndbm_h_uses_prototypes=''
889 d_ndbm_h_uses_prototypes=''
963 d_inc_version_list=''
965 inc_version_list_init=''
984 ignore_versioned_solibs=''
1048 d_perl_otherlibdirs=''
1056 api_versionstring=''
1062 version_patchlevel_string=''
1066 d_nv_preserves_uv=''
1067 d_nv_zero_is_allbits_zero=''
1078 nv_overflows_integers_at=''
1079 nv_preserves_uv_bits=''
1151 installsitehtml1dir=''
1154 installsitehtml3dir=''
1161 installsiteman1dir=''
1164 installsiteman3dir=''
1169 installsitescript=''
1184 d_stdio_stream_array=''
1185 stdio_stream_array=''
1202 ccflags_uselargefiles=''
1203 ldflags_uselargefiles=''
1204 libswanted_uselargefiles=''
1224 installvendorarch=''
1231 installvendorhtml1dir=''
1233 vendorhtml1direxp=''
1234 installvendorhtml3dir=''
1236 vendorhtml3direxp=''
1242 installvendorman1dir=''
1245 installvendorman3dir=''
1252 installvendorscript=''
1265 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1268 : We must find out about Eunice early
1270 if test -f /etc/unixtovms; then
1271 eunicefix=/etc/unixtovms
1273 if test -f /etc/unixtovms.exe; then
1274 eunicefix=/etc/unixtovms.exe
1277 : Set executable suffix now -- needed before hints available
1278 if test -f "/libs/version.library"; then
1281 elif test -f "/system/gnu_library/bin/ar.pm"; then
1284 elif test -n "$DJGPP"; then
1287 elif test -d c:/. -o -n "$is_os2" ; then
1294 : Trailing extension. Override this in a hint file, if needed.
1295 : Extra object files, if any, needed on this platform.
1299 : change the next line if compiling for Xenix/286 on Xenix/386
1300 xlibpth='/usr/lib/386 /lib/386'
1301 : Possible local library directories to search.
1302 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1303 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1305 : general looking path for locating libraries
1306 glibpth="/lib /usr/lib $xlibpth"
1307 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1308 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1309 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1310 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1312 : Private path used by Configure to find libraries. Its value
1313 : is prepended to libpth. This variable takes care of special
1314 : machines, like the mips. Usually, it should be empty.
1317 : default library list
1319 : some systems want to use only the non-versioned libso:s
1320 ignore_versioned_solibs=''
1321 : set usethreads on the Configure command line to enable threads.
1322 usereentrant='undef'
1323 : full support for void wanted by default
1326 : Possible local include directories to search.
1327 : Set locincpth to "" in a hint file to defeat local include searches.
1328 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1329 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1331 : no include file wanted by default
1334 : Enable -DEBUGGING and -DDEBUGGING from the command line
1341 : set useposix=false in your hint file to disable the POSIX extension.
1343 : set useopcode=false in your hint file to disable the Opcode extension.
1346 ccflags_uselargefiles=''
1347 ldflags_uselargefiles=''
1348 libswanted_uselargefiles=''
1349 : set usemultiplicity on the Configure command line to enable multiplicity.
1350 : set usesocks on the Configure command line to enable socks.
1351 : List of libraries we want.
1352 : If anyone needs extra -lxxx, put those in a hint file.
1353 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1354 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1355 : We probably want to search /usr/shlib before most other libraries.
1356 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1357 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1358 glibpth="/usr/shlib $glibpth"
1359 : Do not use vfork unless overridden by a hint file.
1362 : Find the basic shell for Bourne shell scripts
1366 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1369 if test -f "$xxx"; then
1372 : Build up a list and do a single loop so we can 'break' out.
1373 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1374 for xxx in sh bash ksh pdksh ash; do
1376 try="$try ${p}/${xxx}"
1380 if test -f "$xxx"; then
1383 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1386 elif test -f "$xxx.exe"; then
1397 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1399 Usually it's in /bin/sh. How did you even get this far?
1400 Please contact me (Perl Maintainers) at perlbug@perl.org and
1401 we'll try to straighten this all out.
1407 : see if sh knows # comments
1408 if `$sh -c '#' >/dev/null 2>&1`; then
1412 test -f $xcat$_exe || xcat=/usr/bin/cat
1413 if test ! -f $xcat$_exe; then
1414 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1415 if test -f $p/cat$_exe; then
1420 if test ! -f $xcat$_exe; then
1421 echo "Can't find cat anywhere!"
1425 echo "#!$xcat" >sharp
1428 ./sharp > today 2>/dev/null
1429 if test -s today; then
1432 echo "#! $xcat" > sharp
1435 ./sharp > today 2>/dev/null
1436 if test -s today; then
1444 echo "Your $sh doesn't grok # comments--I will strip them later on."
1447 echo "exec grep -v '^[ ]*#'" >spitshell
1449 $eunicefix spitshell
1450 spitshell=`pwd`/spitshell
1452 echo "I presume that if # doesn't work, #! won't work either!"
1457 : figure out how to guarantee sh startup
1459 '') startsh=${sharpbang}${sh} ;;
1471 : echo "Yup, it does."
1473 echo "Hmm... '$startsh' does not guarantee sh startup..."
1474 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1478 : Save command line options in file UU/cmdline.opt for later use in
1479 : generating config.sh.
1480 cat > cmdline.opt <<EOSH
1481 : Configure command line arguments.
1490 cat >>cmdline.opt <<EOSH
1491 config_arg$argn='$arg'
1493 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1496 arg_exp=`cat cmdl.opt`
1497 args_exp="$args_exp$args_sep'$arg_exp'"
1498 argn=`expr $argn + 1`
1503 : produce awk script to parse command line options
1504 cat >options.awk <<'EOF'
1506 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1508 len = length(optstr);
1509 for (i = 1; i <= len; i++) {
1510 c = substr(optstr, i, 1);
1511 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1522 if (substr(str, 1, 1) != "-") {
1523 printf("'%s'\n", str);
1527 for (i = 2; i <= len; i++) {
1528 c = substr(str, i, 1);
1530 printf("-%s\n", substr(str, i));
1536 printf("'%s'\n", substr(str, i + 1));
1549 : process the command line options
1550 set X `for arg in "$@"; do echo "X$arg"; done |
1551 sed -e s/X// | awk -f options.awk`
1556 : set up default values
1566 rm -f optdef.sh posthint.sh
1567 cat >optdef.sh <<EOS
1573 while test $# -gt 0; do
1575 -d) shift; fastread=yes;;
1576 -e) shift; alldone=cont;;
1580 if test -r "$1"; then
1583 echo "$me: cannot read config file $1." >&2
1589 -h) shift; error=true;;
1590 -r) shift; reuseval=true;;
1591 -s) shift; silent=true; realsilent=true;;
1592 -E) shift; alldone=exit;;
1593 -K) shift; knowitall=true;;
1594 -O) shift; override=true;;
1595 -S) shift; silent=true; extractsh=true;;
1600 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1601 echo "$me: ignoring -D $1" >&2
1604 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1605 *) echo "$1='define'" >> optdef.sh;;
1612 *=) echo "$1" >> optdef.sh;;
1614 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1615 echo "$me: ignoring -U $1" >&2
1617 *) echo "$1='undef'" >> optdef.sh;;
1628 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1632 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1633 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1639 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1640 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1641 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1642 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1643 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1644 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1650 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1652 echo "$yyy=''" >> posthint.sh ;;
1657 echo "$yyy='$zzz'" >> posthint.sh ;;
1659 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1661 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1666 echo "$yyy=$zzz" >> posthint.sh ;;
1667 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1671 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1674 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1682 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1683 [-U symbol] [-U symbol=] [-A command:symbol...]
1684 -d : use defaults for all answers.
1685 -e : go on without questioning past the production of config.sh.
1686 -f : specify an alternate default configuration file.
1687 -h : print this help message and exit (with an error status).
1688 -r : reuse C symbols value if possible (skips costly nm extraction).
1689 -s : silent mode, only echoes questions and essential information.
1690 -D : define symbol to have some value:
1691 -D symbol symbol gets the value 'define'
1692 -D symbol=value symbol gets the value 'value'
1693 common used examples (see INSTALL for more info):
1694 -Duse64bitint use 64bit integers
1695 -Duse64bitall use 64bit integers and pointers
1696 -Dusethreads use thread support
1697 -Dinc_version_list=none do not include older perl trees in @INC
1698 -DEBUGGING=none DEBUGGING options
1699 -Dcc=gcc choose your compiler
1700 -Dprefix=/opt/perl5 choose your destination
1701 -E : stop at the end of questions, after having produced config.sh.
1702 -K : do not use unless you know what you are doing.
1703 -O : let -D and -U override definitions from loaded configuration file.
1704 -S : perform variable substitutions on all .SH files (can mix with -f)
1705 -U : undefine symbol:
1706 -U symbol symbol gets the value 'undef'
1707 -U symbol= symbol gets completely empty
1709 -A : manipulate symbol after the platform specific hints have been applied:
1710 -A append:symbol=value append value to symbol
1711 -A symbol=value like append:, but with a separating space
1712 -A define:symbol=value define symbol to have value
1713 -A clear:symbol define symbol to be ''
1714 -A define:symbol define symbol to be 'define'
1715 -A eval:symbol=value define symbol to be eval of value
1716 -A prepend:symbol=value prepend value to symbol
1717 -A undef:symbol define symbol to be 'undef'
1718 -A undef:symbol= define symbol to be ''
1719 e.g.: -A prepend:libswanted='cl pthread '
1720 -A ccflags=-DSOME_MACRO
1721 -V : print version number and exit (with a zero status).
1728 case "$fastread$alldone" in
1731 case "$extractsh" in
1734 if test ! -t 0; then
1735 echo "Say 'sh Configure', not 'sh <Configure'"
1745 true) exec 1>/dev/null;;
1748 : run the defines and the undefines, if any, but leave the file out there...
1751 : create the posthint manipulation script and leave the file out there...
1756 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1757 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1758 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1759 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1760 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1763 : Some greps do not return status, grrr.
1764 echo "grimblepritz" >grimble
1765 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1767 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1773 : the following should work in any shell
1777 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1778 cat >contains <<'EOSS'
1779 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1784 : Find the path to the source tree
1787 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1791 *) src=`cd ../$src && pwd` ;;
1804 if test -f $rsrc/Configure && \
1805 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1807 : found it, so we are ok.
1810 for src in . .. ../.. ../../.. ../../../..; do
1811 if test -f ../$src/Configure && \
1812 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1823 Sorry, I can't seem to locate the source dir for $package. Please start
1824 Configure with an explicit path -- i.e. /some/path/Configure.
1832 echo "Sources for $package found in \"$src\"." >&4
1836 : script used to extract .SH files with variable substitutions
1837 cat >extract <<'EOS'
1839 echo "Doing variable substitutions on .SH files..."
1840 if test -f MANIFEST; then
1841 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1843 echo "(Looking for .SH files under the source directory.)"
1844 set x `(cd "$src"; find . -name "*.SH" -print)`
1848 0) set x `(cd "$src"; echo *.SH)`; shift;;
1850 if test ! -f "$src/$1"; then
1856 while test $name; do
1857 if test ! -d "$name"; then
1858 create="$name $create";
1859 name=`echo $name | sed -e "s|^[^/]*$||"`;
1860 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1865 for file in $create; do
1874 dir=`expr X$file : 'X\(.*\)/'`
1875 file=`expr X$file : 'X.*/\(.*\)'`
1876 (cd "$dir" && . ./$file)
1886 dir=`expr X$file : 'X\(.*\)/'`
1887 file=`expr X$file : 'X.*/\(.*\)'`
1888 (set x $dir; shift; eval $mkdir_p)
1889 sh <"$src/$dir/$file"
1898 if test -f "$src/config_h.SH"; then
1899 if test ! -f config.h; then
1900 : oops, they left it out of MANIFEST, probably, so do it anyway.
1901 . "$src/config_h.SH"
1906 : extract files and exit if asked to do so
1907 case "$extractsh" in
1909 case "$realsilent" in
1913 case "$config_sh" in
1914 '') config_sh='config.sh';;
1917 echo "Fetching answers from $config_sh..."
1920 test "$override" && . ./optdef.sh
1924 echo "Extraction done."
1929 : Eunice requires " " instead of "", can you believe it
1932 echo "Beginning of configuration questions for $package."
1934 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1936 : first determine how to suppress newline on echo command
1938 echo "Checking echo to see how to suppress newlines..."
1939 (echo "hi there\c" ; echo " ") >.echotmp
1940 if $contains c .echotmp >/dev/null 2>&1 ; then
1951 echo $n "The star should be here-->$c"
1955 : Now test for existence of everything in MANIFEST
1957 if test -f "$rsrc/MANIFEST"; then
1958 echo "First let's make sure your kit is complete. Checking..." >&4
1959 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1960 (split -l 50 2>/dev/null || split -50)
1963 for filelist in x??; do
1964 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1965 >/dev/null 2>>"$tmppwd/missing")
1967 if test -s missing; then
1971 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1973 You have the option of continuing the configuration process, despite the
1974 distinct possibility that your kit is damaged, by typing 'y'es. If you
1975 do, don't blame me if something goes wrong. I advise you to type 'n'o
1976 and contact the author (perlbug@perl.org).
1979 echo $n "Continue? [n] $c" >&4
1983 echo "Continuing..." >&4
1987 echo "ABORTING..." >&4
1992 echo "Looks good..."
1995 echo "There is no MANIFEST file. I hope your kit is complete !"
1999 : Find the appropriate value for a newline for tr
2001 if test -n "$DJGPP"; then
2004 if test X"$trnl" = X; then
2005 case "`echo foo|tr '\n' x 2>/dev/null`" in
2009 if test X"$trnl" = X; then
2010 case "`echo foo|tr '\012' x 2>/dev/null`" in
2011 foox) trnl='\012' ;;
2014 if test X"$trnl" = X; then
2015 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2016 fooxy) trnl='\n\r' ;;
2019 if test X"$trnl" = X; then
2022 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2028 : compute the number of columns on the terminal for proper question formatting
2033 : set up the echo used in my read
2034 myecho="case \"\$xxxm\" in
2035 '') echo $n \"\$rp $c\" >&4;;
2037 '') echo $n \"[\$xxxm] $c\";;
2039 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2041 echo $n \"[\$xxxm] $c\" >&4
2043 echo $n \"\$rp [\$xxxm] $c\" >&4
2049 : now set up to do reads with possible shell escape and default assignment
2055 case "\$fastread" in
2056 yes) case "\$dflt" in
2059 case "\$silent-\$rp" in
2064 *) case "\$silent" in
2065 true) case "\$rp" in
2070 while expr "X\$ans" : "X!" >/dev/null; do
2074 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2082 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2091 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2096 echo "(OK, I'll run with -d after this question.)" >&4
2099 echo "*** Sorry, \$1 not supported yet." >&4
2109 echo "*** Substitution done -- please confirm."
2111 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2116 echo "*** Error -- try again."
2123 case "\$ans\$xxxm\$nostick" in
2135 : create .config dir to save info across Configure sessions
2136 test -d ../.config || mkdir ../.config
2137 cat >../.config/README <<EOF
2138 This directory created by Configure to save information that should
2139 persist across sessions for $package.
2141 You may safely delete it if you wish.
2144 : See if we are using a devel version and want that
2145 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2148 usedevel="$define" ;;
2149 *) case "$xversion" in
2152 *** WHOA THERE!!! ***
2154 This is an UNSTABLE DEVELOPMENT release.
2155 The version of this $package distribution is $xversion, that is, odd,
2156 (as opposed to even) and that signifies a development release.
2157 If you want a maintenance release, you want an even-numbered version.
2159 Do ***NOT*** install this into production use.
2160 Data corruption and crashes are possible.
2162 It is most seriously suggested that you do not continue any further
2163 unless you want to help in developing and debugging Perl.
2165 If you *still* want to build perl, you can answer 'y' now,
2166 or pass -Dusedevel to Configure.
2169 rp='Do you really want to continue?'
2173 [yY]) echo >&4 "Okay, continuing."
2174 usedevel="$define" ;;
2175 *) echo >&4 "Okay, bye."
2186 case "$versiononly" in
2187 '') versiononly="$define" ;;
2189 case "$installusrbinperl" in
2190 '') installusrbinperl="$undef" ;;
2195 : general instructions
2198 user=`(logname) 2>/dev/null`
2200 '') user=`whoami 2>&1`;;
2202 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2205 rp='Would you like to see the instructions?'
2216 This installation shell script will examine your system and ask you questions
2217 to determine how the perl5 package should be installed. If you get
2218 stuck on a question, you may use a ! shell escape to start a subshell or
2219 execute a command. Many of the questions will have default answers in square
2220 brackets; typing carriage return will give you the default.
2222 On some of the questions which ask for file or directory names you are allowed
2223 to use the ~name construct to specify the login directory belonging to "name",
2224 even if you don't have a shell which knows about that. Questions where this is
2225 allowed will be marked "(~name ok)".
2229 dflt='Type carriage return to continue'
2233 The prompter used in this script allows you to use shell variables and
2234 backticks in your answers. You may use $1, $2, etc... to refer to the words
2235 in the default answer, as if the default line was a set of arguments given to a
2236 script shell. This means you may also use $* to repeat the whole default line,
2237 so you do not have to re-type everything to add something to the default.
2239 Everytime there is a substitution, you will have to confirm. If there is an
2240 error (e.g. an unmatched backtick), the default answer will remain unchanged
2241 and you will be prompted again.
2243 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2244 the questions and use the computed defaults (or the previous answers if there
2245 was already a config.sh file). Type 'Configure -h' for a list of options.
2246 You may also start interactively and then answer '& -d' at any prompt to turn
2247 on the non-interactive behaviour for the remainder of the execution.
2253 Much effort has been expended to ensure that this shell script will run on any
2254 Unix system. If despite that it blows up on yours, your best bet is to edit
2255 Configure and run it again. If you can't run Configure for some reason,
2256 you'll have to generate a config.sh file by hand. Whatever problems you
2257 have, let me (perlbug@perl.org) know how I blew it.
2259 This installation script affects things in two ways:
2261 1) it may do direct variable substitutions on some of the files included
2263 2) it builds a config.h file for inclusion in C programs. You may edit
2264 any of these files as the need arises after running this script.
2266 If you make a mistake on a question, there is no easy way to back up to it
2267 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2268 files. Configure will offer to let you do this before it runs the SH files.
2271 dflt='Type carriage return to continue'
2273 case "$firsttime" in
2274 true) echo $user >>../.config/instruct;;
2278 : find out where common programs are
2280 echo "Locating common programs..." >&4
2293 if test -d \$dir/\$thing; then
2299 for thisthing in \$dir/\$thing; do
2300 : just loop through to pick last item
2302 if test -f \$thisthing; then
2305 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2308 elif test -f \$dir/\$thing.exe; then
2309 if test -n "$DJGPP"; then
2310 echo \$dir/\$thing.exe
2311 elif test "$eunicefix" != ":"; then
2312 : on Eunice apparently
2364 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2365 pth="$pth /lib /usr/lib"
2366 for file in $loclist; do
2370 if test -f "$xxx"; then
2373 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2374 xxx=`./loc $file $file $pth`
2377 '') xxx=`./loc $file $file $pth`;;
2378 *) xxx=`./loc $xxx $xxx $pth`;;
2380 eval $file=$xxx$_exe
2384 echo $file is in $xxx.
2387 echo $file is in $xxx.
2390 echo "I don't know where '$file' is, and my life depends on it." >&4
2391 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2397 echo "Don't worry if any of the following aren't found..."
2399 for file in $trylist; do
2403 if test -f "$xxx"; then
2406 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2407 xxx=`./loc $file $file $pth`
2410 '') xxx=`./loc $file $file $pth`;;
2411 *) xxx=`./loc $xxx $xxx $pth`;;
2413 eval $file=$xxx$_exe
2417 echo $file is in $xxx.
2420 echo $file is in $xxx.
2423 echo "I don't see $file out there, $say."
2430 echo "Substituting grep for egrep."
2437 echo "Substituting cp for ln."
2446 echo "I can't find make or gmake, and my life depends on it." >&4
2447 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2455 *) # We can't have osname yet.
2456 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2457 # Assume that gmake, if found, is definitely GNU make
2458 # and prefer it over the system make.
2459 echo "Substituting gmake for make."
2467 echo "Hopefully test is built into your sh."
2470 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2471 echo "Using the test built into your sh."
2479 echo "Hopefully echo is built into your sh."
2484 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2485 $echo $n "hi there$c" >foo1
2486 echo $n "hi there$c" >foo2
2487 if cmp foo1 foo2 >/dev/null 2>&1; then
2488 echo "They are compatible. In fact, they may be identical."
2495 They are not compatible! You are probably running ksh on a non-USG system.
2496 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2497 have echo built in and we may have to run some Bourne shell scripts. That
2498 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2501 $echo $n "The star should be here-->$c"
2508 # This question was auctioned at YAPC::Europe-2007 in Vienna
2509 # I never promised you could answer it. I only auctioned the question.
2511 The following message is sponsored by
2513 Dresden.pm<--The stars should be here.
2515 Dear Perl user, system administrator or package
2516 maintainer, the Perl community sends greetings to
2517 you. Do you (emblematical) greet back [Y/n]? n
2521 : Check what type of C compiler we use
2525 cat <<'EOSC' >>trygcc
2530 int main(int argc, char *argv[]) {
2534 if $cc -o try $ccflags $ldflags try.c; then
2537 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2543 # Skip this test because it gives a false match on output like:
2544 # ./trygcc: line 23: cc: command not found
2545 # case "`$cc -v -c try.c 2>&1`" in
2546 # *gcc*) trygcc=no ;;
2548 if $test X"$trygcc" = Xyes; then
2549 if gcc -o try -c try.c; then
2551 echo "You seem to have a working gcc, though." >&4
2552 # Switching compilers may undo the work of hints files.
2553 # The most common problem is -D_REENTRANT for threads.
2554 # This heuristic catches that case, but gets false positives
2555 # if -Dusethreads was not actually specified. Better to
2556 # bail out here with a useful message than fail
2557 # mysteriously later. Should we perhaps just try to
2558 # re-invoke Configure -Dcc=gcc config_args ?
2559 if $test -f usethreads.cbu; then
2562 *** However, any setting of the C compiler flags (e.g. for thread support)
2563 *** will be lost. It may be necessary for you to restart Configure and
2564 *** add -Dcc=gcc to your Configure command line.
2567 rp="Would you like to go ahead and try gcc anyway?"
2570 rp="Would you like to use it?"
2573 if $test -f myread; then
2576 if $test -f UU/myread; then
2579 echo "Cannot find myread, sorry. Aborting." >&2
2584 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2597 cat <<'EOSC' >>checkcc
2602 int main(int argc, char *argv[]) {
2606 if $cc -o try $ccflags $ldflags try.c; then
2609 if $test X"$despair" = Xyes; then
2610 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2613 You need to find a working C compiler.
2614 Either (purchase and) install the C compiler supplied by your OS vendor,
2615 or for a free C compiler try http://gcc.gnu.org/
2616 I cannot continue any further, aborting.
2625 : determine whether symbolic links are supported
2628 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2629 echo "Symbolic links are supported." >&4
2632 echo "Symbolic links are NOT supported." >&4
2637 : determine whether symbolic links are supported
2641 echo "Checking how to test for symbolic links..." >&4
2643 if $test "X$issymlink" = X; then
2645 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2646 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2648 if test $? = 0; then
2651 echo "Your builtin 'test -h' may be broken." >&4
2654 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2657 if test -f "$p/$test"; then
2666 echo "Trying external '$test -h'." >&4
2667 issymlink="$test -h"
2668 if $test ! -h sym >/dev/null 2>&1; then
2669 echo "External '$test -h' is broken, too." >&4
2677 if $test "X$issymlink" = X; then
2678 if $test -L sym 2>/dev/null; then
2679 issymlink="$test -L"
2680 echo "The builtin '$test -L' worked." >&4
2683 if $test "X$issymlink" != X; then
2684 echo "You can test for symbolic links with '$issymlink'." >&4
2686 echo "I do not know how you can test for symbolic links." >&4
2690 *) echo "No symbolic links, so not testing for their testing..." >&4
2695 : Make symlinks util
2696 case "$mksymlinks" in
2699 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2702 *) case "$lns:$issymlink" in
2703 *"ln"*" -s:"*"test -"?)
2704 echo "Creating the symbolic links..." >&4
2705 echo "(First creating the subdirectories...)" >&4
2707 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2709 test -z "$directory" && break
2713 if test ! -d t/base; then
2714 echo "Failed to create the subdirectories. Aborting." >&4
2717 echo "(Then creating the symlinks...)" >&4
2718 awk '{print $1}' $src/MANIFEST | while true; do
2720 test -z "$filename" && break
2721 if test -f $filename; then
2722 if $issymlink $filename; then
2726 if test -f $filename; then
2727 echo "$filename already exists, not symlinking."
2729 ln -s $src/$filename $filename
2733 if test ! -f t/base/lex.t; then
2734 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2739 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2747 : Check for Cross-Compilation
2748 case "$usecrosscompile" in
2750 $echo "Cross-compiling..."
2753 *-*-gcc) # A cross-compiling gcc, probably.
2754 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2756 # leave out ld, choosing it is more complex
2758 ranlib=$targetarch-ranlib
2759 $echo 'extern int foo;' > try.c
2760 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2762 if $test $# -gt 0; then
2764 incpth="`$echo $incpth|$sed 's/^ //'`"
2765 echo "Guessing incpth '$incpth'." >&4
2767 j="`$echo $i|$sed 's,/include$,/lib,'`"
2768 if $test -d $j; then
2772 libpth="`$echo $libpth|$sed 's/^ //'`"
2773 echo "Guessing libpth '$libpth'." >&4
2778 case "$targetarch" in
2779 '') echo "Targetarch not defined." >&4; croak=y ;;
2780 *) echo "Using targetarch $targetarch." >&4 ;;
2783 '') echo "Incpth not defined." >&4; croak=y ;;
2784 *) echo "Using incpth '$incpth'." >&4 ;;
2787 '') echo "Libpth not defined." >&4; croak=y ;;
2788 *) echo "Using libpth '$libpth'." >&4 ;;
2791 '') for i in $incpth; do
2792 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2794 echo "Guessing usrinc $usrinc." >&4
2799 '') echo "Usrinc not defined." >&4; croak=y ;;
2802 *) echo "Using usrinc $usrinc." >&4 ;;
2804 case "$targethost" in
2805 '') echo "Targethost not defined." >&4; croak=y ;;
2806 *) echo "Using targethost $targethost." >&4
2811 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2814 /*) run=$src/Cross/run
2815 targetmkdir=$src/Cross/mkdir
2817 from=$src/Cross/from
2819 *) pwd=`$test -f ../Configure & cd ..; pwd`
2821 targetmkdir=$pwd/Cross/mkdir
2823 from=$pwd/Cross/from
2826 case "$targetrun" in
2827 '') targetrun=ssh ;;
2832 case "$targetfrom" in
2833 '') targetfrom=scp ;;
2837 from=$from-$targetfrom
2838 case "$targetdir" in
2840 echo "Guessing targetdir $targetdir." >&4
2843 case "$targetuser" in
2845 echo "Guessing targetuser $targetuser." >&4
2848 case "$targetfrom" in
2852 case "$targetrun" in
2864 '') cwd=$targetdir ;;
2868 if $test ! -f \$exe.xok; then
2872 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2875 *) echo "Unknown targetrun '$targetrun'" >&4
2879 case "$targetmkdir" in
2881 cat >$targetmkdir <<EOF
2883 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2885 $chmod a+rx $targetmkdir
2887 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2899 $targetmkdir \`dirname \$f\`
2900 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2903 $targetmkdir $targetdir/\`dirname \$f\`
2904 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2917 $mkdir -p $targetdir/\`dirname \$f\`
2918 $cp \$f $targetdir/\$f || exit 1
2921 $targetmkdir $targetdir/\`dirname \$f\`
2922 $cp \$f $targetdir/\$f || exit 1
2929 *) echo "Unknown targetto '$targetto'" >&4
2933 case "$targetfrom" in
2940 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2945 cp) cat >$from <<EOF
2950 cp $targetdir/\$f . || exit 1
2955 *) echo "Unknown targetfrom '$targetfrom'" >&4
2959 if $test ! -f $run; then
2960 echo "Target 'run' script '$run' not found." >&4
2964 if $test ! -f $to; then
2965 echo "Target 'to' script '$to' not found." >&4
2969 if $test ! -f $from; then
2970 echo "Target 'from' script '$from' not found." >&4
2974 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2978 Using '$run' for remote execution,
2979 and '$from' and '$to'
2980 for remote file transfer.
2986 usecrosscompile='undef'
2991 : see whether [:lower:] and [:upper:] are supported character classes
2993 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2995 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2999 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3000 # (0xd9 and 0xe2), therefore that is a nice testing point.
3001 if test "X$up" = X -o "X$low" = X; then
3002 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3008 if test "X$up" = X -o "X$low" = X; then
3009 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3015 if test "X$up" = X -o "X$low" = X; then
3016 case "`echo RS | od -x 2>/dev/null`" in
3018 echo "Hey, this might be EBCDIC." >&4
3019 if test "X$up" = X -o "X$low" = X; then
3020 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3021 rs) up='[A-IJ-RS-Z]'
3026 if test "X$up" = X -o "X$low" = X; then
3027 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3037 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3039 echo "Using $up and $low to convert case." >&4
3042 echo "I don't know how to translate letters from upper to lower case." >&4
3043 echo "Your tr is not acting any way I know of." >&4
3047 : set up the translation script tr, must be called with ./tr of course
3051 '[A-Z][a-z]') exec $tr '$up' '$low';;
3052 '[a-z][A-Z]') exec $tr '$low' '$up';;
3059 : Try to determine whether config.sh was made on this system
3060 case "$config_sh" in
3062 myuname=`$uname -a 2>/dev/null`
3063 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3064 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3065 # because the A-Z/a-z are not consecutive.
3066 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3067 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3068 newmyuname="$myuname"
3070 case "$knowitall" in
3072 if test -f ../config.sh; then
3073 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3074 eval "`grep myuname= ../config.sh`"
3076 if test "X$myuname" = "X$newmyuname"; then
3084 : Get old answers from old config file if Configure was run on the
3085 : same system, otherwise use the hints.
3088 if test -f config.sh; then
3090 rp="I see a config.sh file. Shall I use it to set the defaults?"
3093 n*|N*) echo "OK, I'll ignore it."
3094 mv config.sh config.sh.old
3095 myuname="$newmyuname"
3097 *) echo "Fetching default answers from your old config.sh file..." >&4
3105 : Older versions did not always set $sh. Catch re-use of such
3115 if test ! -f config.sh; then
3118 First time through, eh? I have some defaults handy for some systems
3119 that need some extra help getting the Configure answers right:
3122 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3124 : Half the following guesses are probably wrong... If you have better
3125 : tests or hints, please send them to perlbug@perl.org
3126 : The metaconfig authors would also appreciate a copy...
3127 $test -f /irix && osname=irix
3128 $test -f /xenix && osname=sco_xenix
3129 $test -f /dynix && osname=dynix
3130 $test -f /dnix && osname=dnix
3131 $test -f /lynx.os && osname=lynxos
3132 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3133 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3134 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3135 $test -f /bin/mips && /bin/mips && osname=mips
3136 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3137 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3138 $test -d /usr/apollo/bin && osname=apollo
3139 $test -f /etc/saf/_sactab && osname=svr4
3140 $test -d /usr/include/minix && osname=minix
3141 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3142 if $test -d /MachTen -o -d /MachTen_Folder; then
3144 if $test -x /sbin/version; then
3145 osvers=`/sbin/version | $awk '{print $2}' |
3146 $sed -e 's/[A-Za-z]$//'`
3147 elif $test -x /usr/etc/version; then
3148 osvers=`/usr/etc/version | $awk '{print $2}' |
3149 $sed -e 's/[A-Za-z]$//'`
3155 $test -f /sys/posix.dll &&
3156 $test -f /usr/bin/what &&
3157 set X `/usr/bin/what /sys/posix.dll` &&
3158 $test "$3" = UWIN &&
3162 if $test -f $uname; then
3170 umips) osname=umips ;;
3173 [23]100) osname=mips ;;
3174 next*) osname=next ;;
3176 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3177 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3180 elif $test -f /etc/kconfig; then
3182 if test "$lns" = "$ln -s"; then
3184 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3186 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3193 if test -n "$DJGPP"; then
3202 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3204 # oslevel can fail with:
3205 # oslevel: Unable to acquire lock.
3206 *not\ found) osvers="$4"."$3" ;;
3207 '<3240'|'<>3240') osvers=3.2.0 ;;
3208 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3209 '=3250'|'>3250') osvers=3.2.5 ;;
3213 bsd386) osname=bsd386
3216 cygwin*) osname=cygwin
3219 *dc.osx) osname=dcosx
3225 domainos) osname=apollo
3231 dragonfly) osname=dragonfly
3234 dynixptx*) osname=dynixptx
3235 osvers=`echo "$4"|sed 's/^v//'`
3237 freebsd) osname=freebsd
3239 genix) osname=genix ;;
3243 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3259 netbsd*) osname=netbsd
3262 news-os) osvers="$3"
3264 4*) osname=newsos4 ;;
3268 next*) osname=next ;;
3269 nonstop-ux) osname=nonstopux ;;
3270 openbsd) osname=openbsd
3276 POSIX-BC | posix-bc ) osname=posix-bc
3279 powerux | power_ux | powermax_os | powermaxos | \
3280 powerunix | power_unix) osname=powerux
3286 solaris) osname=solaris
3288 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3295 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3299 titanos) osname=titanos
3308 ultrix) osname=ultrix
3311 osf1|mls+) case "$5" in
3314 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3317 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3320 hp*) osname=hp_osf1 ;;
3321 mips) osname=mips_osf1 ;;
3324 # UnixWare 7.1.2 is known as Open UNIX 8
3325 openunix|unixware) osname=svr5
3333 $2) case "$osname" in
3337 : svr4.x or possibly later
3347 if test -f /stand/boot ; then
3348 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3349 if test -n "$INITPROG" -a -f "$INITPROG"; then
3350 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3351 if test -n "$isesix"; then
3359 *) if test -f /etc/systemid; then
3361 set `echo $3 | $sed 's/\./ /g'` $4
3362 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3364 elif $test -f $src/hints/sco_$1_$2.sh; then
3366 elif $test -f $src/hints/sco_$1.sh; then
3371 '') : Still unknown. Probably a generic Sys V.
3380 *) case "$osname" in
3381 '') : Still unknown. Probably a generic BSD.
3389 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3390 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3391 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3394 $rm -f UU/kernel.what
3395 elif test -d c:/. -o -n "$is_os2" ; then
3402 case "$targetarch" in
3405 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3410 : Now look for a hint file osname_osvers, unless one has been
3411 : specified already.
3414 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3415 : Also try without trailing minor version numbers.
3416 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3417 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3418 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3419 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3422 *) case "$osvers" in
3425 *) if $test -f $src/hints/$file.sh ; then
3427 elif $test -f $src/hints/$xfile.sh ; then
3429 elif $test -f $src/hints/$xxfile.sh ; then
3431 elif $test -f $src/hints/$xxxfile.sh ; then
3433 elif $test -f $src/hints/$xxxxfile.sh ; then
3435 elif $test -f "$src/hints/${osname}.sh" ; then
3444 if $test -f Policy.sh ; then
3447 none) dflt="Policy" ;;
3448 *) dflt="Policy $dflt" ;;
3453 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3457 if $test -f Policy.sh ; then
3460 There's also a Policy hint file available, which should make the
3461 site-specific (policy) questions easier to answer.
3468 You may give one or more space-separated answers, or "none" if appropriate.
3469 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3470 previous run of Configure, you may specify it as well as or instead of
3471 OS-specific hints. If hints are provided for your OS, you should use them:
3472 although Perl can probably be built without hints on many platforms, using
3473 hints often improve performance and may enable features that Configure can't
3474 set up on its own. If there are no hints that match your OS, specify "none";
3475 DO NOT give a wrong version or a wrong OS.
3479 rp="Which of these apply, if any?"
3482 for file in $tans; do
3483 if $test X$file = XPolicy -a -f Policy.sh; then
3485 $cat Policy.sh >> UU/config.sh
3486 elif $test -f $src/hints/$file.sh; then
3487 . $src/hints/$file.sh
3488 $cat $src/hints/$file.sh >> UU/config.sh
3489 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3492 : Give one chance to correct a possible typo.
3493 echo "$file.sh does not exist"
3495 rp="hint to use instead?"
3497 for file in $ans; do
3498 if $test -f "$src/hints/$file.sh"; then
3499 . $src/hints/$file.sh
3500 $cat $src/hints/$file.sh >> UU/config.sh
3501 elif $test X$ans = X -o X$ans = Xnone ; then
3504 echo "$file.sh does not exist -- ignored."
3511 : Remember our hint file for later.
3512 if $test -f "$src/hints/$file.sh" ; then
3522 echo "Fetching default answers from $config_sh..." >&4
3526 cp $config_sh config.sh 2>/dev/null
3536 test "$override" && . ./optdef.sh
3538 : Restore computed paths
3539 for file in $loclist $trylist; do
3540 eval $file="\$_$file"
3545 Configure uses the operating system name and version to set some defaults.
3546 The default value is probably right if the name rings a bell. Otherwise,
3547 since spelling matters for me, either accept the default or answer "none"
3554 ''|' '|none) dflt=none ;;
3555 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3558 *) dflt="$osname" ;;
3560 rp="Operating system name?"
3564 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3570 ''|' '|none) dflt=none ;;
3571 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3572 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3574 ''|' ') dflt=none ;;
3579 *) dflt="$osvers" ;;
3581 rp="Operating system version?"
3591 : who configured the system
3592 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3595 cf_by=`(logname) 2>/dev/null`
3598 cf_by=`(whoami) 2>/dev/null`
3600 "") cf_by=unknown ;;
3605 : decide how portable to be. Allow command line overrides.
3606 case "$d_portable" in
3608 *) d_portable="$define" ;;
3611 : set up shell script to do ~ expansion
3617 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3620 if $test -f /bin/csh; then
3621 /bin/csh -f -c "glob \$1"
3626 name=\`$expr x\$1 : '..\([^/]*\)'\`
3627 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3628 if $test ! -d "\$dir"; then
3630 echo "\$me: can't locate home directory for: \$name" >&2
3635 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3651 : now set up to get a file name
3655 cat <<'EOSC' >>getfile
3671 : getfile will accept an answer from the comma-separated list
3672 : enclosed in parentheses even if it does not meet other criteria.
3673 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3674 fn=`echo $fn | sed 's/(.*)//'`
3680 loc_file=`expr $fn : '.*:\(.*\)'`
3681 fn=`expr $fn : '\(.*\):.*'`
3689 */*) fullpath=true;;
3698 *e*) exp_file=true;;
3701 *p*) nopath_ok=true;;
3706 *d*) type='Directory';;
3707 *l*) type='Locate';;
3712 Locate) what='File';;
3717 case "$d_portable" in
3725 while test "$type"; do
3730 true) rp="$rp (~name ok)";;
3733 if test -f UU/getfile.ok && \
3734 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3753 value=`UU/filexp $ans`
3756 if test "$ans" != "$value"; then
3757 echo "(That expands to $value on this system.)"
3771 /*) value="$ansexp" ;;
3772 [a-zA-Z]:/*) value="$ansexp" ;;
3777 echo "I shall only accept a full path name, as in /bin/ls." >&4
3778 echo "Use a ! shell escape if you wish to check pathnames." >&4
3781 echo "Please give a full path name, starting with slash." >&4
3784 echo "Note that using ~name is ok provided it expands well." >&4
3797 for fp in $gfpth; do
3798 if test "X$fp" = X.; then
3803 if test -f "$pf"; then
3805 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3807 echo "($value is not a plain file, but that's ok.)"
3810 if test X"$type" = X; then
3817 for fp in $gfpth; do
3818 if test "X$fp" = X.; then
3823 direxp="$fp/$ansexp"
3825 if test -d "$direxp"; then
3833 if test -d "$ansexp"; then
3834 echo "(Looking for $loc_file in directory $value.)"
3835 value="$value/$loc_file"
3836 ansexp="$ansexp/$loc_file"
3838 if test -f "$ansexp"; then
3841 case "$nopath_ok" in
3842 true) case "$value" in
3844 *) echo "Assuming $value will be in people's path."
3860 if test "$fastread" = yes; then
3865 rp="$what $value doesn't exist. Use that name anyway?"
3884 test "X$gfpthkeep" != Xy && gfpth=""
3887 : determine root of directory hierarchy where package will be installed.
3890 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3893 dflt=`echo "$prefix" | sed 's/.$//'`
3901 By default, $package will be installed in $dflt/bin, manual pages
3902 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3903 installation directories. Typically this is something like /usr/local.
3904 If you wish to have binaries under /usr/bin but other parts of the
3905 installation under /usr/local, that's ok: you will be prompted
3906 separately for each of the installation directories, the prefix being
3907 only used to set the defaults.
3911 rp='Installation prefix to use?'
3919 *) oldprefix="$prefix";;
3926 : allow them to override the AFS root
3929 *) afsroot=$afsroot ;;
3935 $define|true) afs=true ;;
3936 $undef|false) afs=false ;;
3937 *) if $test -d $afsroot; then
3945 echo "AFS may be running... I'll be extra cautious then..." >&4
3947 echo "AFS does not seem to be running..." >&4
3950 : determine installation prefix for where package is to be installed.
3954 Since you are running AFS, I need to distinguish the directory in which
3955 files will reside from the directory in which they are installed (and from
3956 which they are presumably copied to the former directory by occult means).
3959 case "$installprefix" in
3960 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3961 *) dflt="$installprefix";;
3966 In some special cases, particularly when building $package for distribution,
3967 it is convenient to distinguish the directory in which files should be
3968 installed from the directory ($prefix) in which they will
3969 eventually reside. For most users, these two directories are the same.
3972 case "$installprefix" in
3974 *) dflt=$installprefix;;
3978 rp='What installation prefix should I use for installing files?'
3980 installprefix="$ans"
3981 installprefixexp="$ansexp"
3983 : Perform the prefixexp/installprefixexp correction if necessary
3984 cat <<EOS >installprefix
3987 cat <<'EOSC' >>installprefix
3988 : Change installation prefix, if necessary.
3989 if $test X"$prefix" != X"$installprefix"; then
3990 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3992 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3995 chmod +x installprefix
3996 $eunicefix installprefix
3998 : Set variables such as privlib and privlibexp from the output of ./getfile
3999 : performing the prefixexp/installprefixexp correction if necessary.
4000 cat <<EOS >setprefixvar
4003 cat <<'EOSC' >>setprefixvar
4004 eval "${prefixvar}=\"\$ans\""
4005 eval "${prefixvar}exp=\"\$ansexp\""
4008 chmod +x setprefixvar
4009 $eunicefix setprefixvar
4011 : set up the script used to warn in case of inconsistency
4020 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4022 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4023 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4028 echo "*** WHOA THERE!!! ***" >&4
4029 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4032 rp=" Keep the $hint value?"
4035 y) td=$was; tu=$was;;
4039 : function used to set '$1' to '$val'
4040 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4042 $define$undef) . ./whoa; eval "$var=\$td";;
4043 $undef$define) . ./whoa; eval "$var=\$tu";;
4044 *) eval "$var=$val";;
4047 : Check is we will use socks
4049 $define|true|[yY]*) dflt='y';;
4054 Perl can be built to use the SOCKS proxy protocol library. To do so,
4055 Configure must be run with -Dusesocks. If you use SOCKS you also need
4056 to use the PerlIO abstraction layer, this will be implicitly selected.
4058 If this doesn't make any sense to you, just accept the default '$dflt'.
4060 rp='Build Perl for SOCKS?'
4063 y|Y) val="$define" ;;
4070 $define|true|[yY]*) useperlio="$define";;
4073 : Check if we want perlio
4074 case "$useperlio" in
4075 $define|true|[yY]*|'') dflt='y';;
4080 Previous version of $package used the standard IO mechanisms as
4081 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4082 alternate IO mechanisms via the PerlIO abstraction layer, but the
4083 stdio mechanism is still available if needed. The abstraction layer
4084 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4085 Using PerlIO with sfio may cause problems with some extension modules.
4087 If this doesn't make any sense to you, just accept the default '$dflt'.
4089 rp='Use the PerlIO abstraction layer?'
4096 echo "Ok, doing things the stdio way."
4105 case "$useperlio" in
4106 $define|true|[yY]*) ;;
4109 You are using the SOCKS proxy protocol library which means that you
4110 should also use the PerlIO layer. You may be headed for trouble.
4118 : get the patchlevel
4120 echo "Getting the current patchlevel..." >&4
4121 if $test -r $rsrc/patchlevel.h;then
4122 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4123 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4124 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4125 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4126 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4127 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4128 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4137 $echo "(You do not have patchlevel.h. Eek.)"
4139 if $test -r $rsrc/.patch ; then
4140 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
4141 perl_patchlevel=`cat $rsrc/.patch`
4144 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4145 version_patchlevel_string="version $patchlevel subversion $subversion"
4146 case "$perl_patchlevel" in
4148 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
4151 $echo "(You have $package $version_patchlevel_string.)"
4155 : XXX Should be a Configure test for double-dots in filenames.
4156 version=`echo $revision $patchlevel $subversion | \
4157 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4158 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4159 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4162 version=`echo $revision $patchlevel $subversion | \
4163 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4164 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4165 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4168 : Special case the 5.005_xx maintenance series, which used 5.005
4169 : without any subversion label as a subdirectory in $sitelib
4170 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4171 api_versionstring='5.005'
4174 : Do we want threads support and if so, what type
4175 case "$usethreads" in
4176 $define|true|[yY]*) dflt='y';;
4177 *) # Catch case where user specified ithreads or 5005threads but
4178 # forgot -Dusethreads (A.D. 4/2002)
4179 case "$useithreads$use5005threads" in
4181 case "$useperlio" in
4182 "$define") dflt='y' ;;
4192 Perl can be built to take advantage of threads on some systems.
4193 To do so, Configure can be run with -Dusethreads.
4195 Note that Perl built with threading support runs slightly slower
4196 and uses more memory than plain Perl. The current implementation
4197 is believed to be stable, but it is fairly new, and so should be
4198 treated with caution.
4200 If this doesn't make any sense to you, just accept the default '$dflt'.
4202 rp='Build a threading Perl?'
4205 y|Y) val="$define" ;;
4211 if $test $patchlevel -lt 9; then
4212 case "$usethreads" in
4216 Since release 5.6, Perl has had two different threading implementations,
4217 the newer interpreter-based version (ithreads) with one interpreter per
4218 thread, and the older 5.005 version (5005threads).
4219 The 5005threads version is effectively unmaintained and will probably be
4220 removed in Perl 5.10, so there should be no need to build a Perl using it
4221 unless needed for backwards compatibility with some existing 5.005threads
4225 : Default to ithreads unless overridden on command line or with
4228 case "$use5005threads" in
4229 $define|true|[yY]*) dflt='n';;
4231 case "$useithreads" in
4232 $undef|false|[nN]*) dflt='n';;
4234 rp='Use the newer interpreter-based ithreads?'
4237 y|Y) val="$define" ;;
4242 : Now set use5005threads to the opposite value.
4243 case "$useithreads" in
4244 $define) val="$undef" ;;
4251 useithreads="$undef"
4252 use5005threads="$undef"
4256 case "$useithreads$use5005threads" in
4260 You cannot have both the ithreads and the 5.005 threads enabled
4261 at the same time. Disabling the 5.005 threads since they are
4262 much less stable than the ithreads.
4265 use5005threads="$undef"
4270 : perl-5.9.x and later
4272 if test X"$usethreads" = "X$define"; then
4273 case "$use5005threads" in
4277 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4284 use5005threads="$undef"
4285 useithreads="$usethreads"
4288 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4291 *** To build with ithreads you must also use the PerlIO layer.
4292 *** Cannot continue, aborting.
4298 case "$d_oldpthreads" in
4299 '') : Configure tests would be welcome here. For now, assume undef.
4301 *) val="$d_oldpthreads" ;;
4307 : Look for a hint-file generated 'call-back-unit'. If the
4308 : user has specified that a threading perl is to be built,
4309 : we may need to set or change some other defaults.
4310 if $test -f usethreads.cbu; then
4311 echo "Your platform has some specific hints regarding threaded builds, using them..."
4314 case "$usethreads" in
4315 "$define"|true|[yY]*)
4317 (Your platform does not have any specific hints for threaded builds.
4318 Assuming POSIX threads, then.)
4324 : Check if multiplicity is required
4327 Perl can be built so that multiple Perl interpreters can coexist
4328 within the same Perl executable.
4331 case "$useithreads" in
4334 This multiple interpreter support is required for interpreter-based threads.
4338 *) case "$usemultiplicity" in
4339 $define|true|[yY]*) dflt='y';;
4343 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4344 rp='Build Perl for multiplicity?'
4347 y|Y) val="$define" ;;
4355 : Check if morebits is requested
4356 case "$usemorebits" in
4357 "$define"|true|[yY]*)
4358 use64bitint="$define"
4359 uselongdouble="$define"
4360 usemorebits="$define"
4362 *) usemorebits="$undef"
4366 : Determine the C compiler to be used
4372 rp="Use which C compiler?"
4376 : See whether they have no cc but they do have gcc
4378 if $test -f cc.cbu; then
4383 : make some quick guesses about what we are up against
4385 $echo $n "Hmm... $c"
4395 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4396 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4398 echo "Looks kind of like an OSF/1 system, but we'll see..."
4400 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4401 xxx=`./loc addbib blurfl $pth`
4402 if $test -f $xxx; then
4403 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4407 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4408 echo "Looks kind of like an extended USG system, but we'll see..."
4410 echo "Looks kind of like a USG system, but we'll see..."
4414 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4415 echo "Looks kind of like a BSD system, but we'll see..."
4419 echo "Looks kind of like a Version 7 system, but we'll see..."
4422 case "$eunicefix" in
4425 There is, however, a strange, musty smell in the air that reminds me of
4426 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4430 : it so happens the Eunice I know will not run shell scripts in Unix format
4434 echo "Congratulations. You aren't running Eunice."
4438 : Detect OS2. The p_ variable is set above in the Head.U unit.
4439 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4440 : semicolon as a patch separator
4445 I have the feeling something is not exactly right, however...don't tell me...
4446 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4447 (Or you may be running DOS with DJGPP.)
4452 if test -f /xenix; then
4453 echo "Actually, this looks more like a XENIX system..."
4458 echo "It's not Xenix..."
4463 if test -f /venix; then
4464 echo "Actually, this looks more like a VENIX system..."
4471 echo "Nor is it Venix..."
4474 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4475 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4478 : Check if we are using GNU gcc and what its version is
4480 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4484 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4486 printf("%s\n", __VERSION__);
4488 printf("%s\n", "1");
4494 if $cc -o try $ccflags $ldflags try.c; then
4495 gccversion=`$run ./try`
4496 case "$gccversion" in
4497 '') echo "You are not using GNU cc." ;;
4498 *) echo "You are using GNU cc $gccversion."
4504 echo "*** WHOA THERE!!! ***" >&4
4505 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4506 case "$knowitall" in
4508 echo " You'd better start hunting for one and let me know about it." >&4
4514 case "$gccversion" in
4515 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4517 case "$gccversion" in
4518 '') gccosandvers='' ;;
4519 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4520 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4522 case "$gccosandvers" in
4523 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4524 $osname$osvers) ;; # looking good
4525 $osname*) cat <<EOM >&4
4527 *** WHOA THERE!!! ***
4529 Your gcc has not been compiled for the exact release of
4530 your operating system ($gccosandvers versus $osname$osvers).
4532 In general it is a good idea to keep gcc synchronized with
4533 the operating system because otherwise serious problems
4534 may ensue when trying to compile software, like Perl.
4536 I'm trying to be optimistic here, though, and will continue.
4537 If later during the configuration and build icky compilation
4538 problems appear (headerfile conflicts being the most common
4539 manifestation), I suggest reinstalling the gcc to match
4540 your operating system release.
4544 *) gccosandvers='' ;; # failed to parse, better be silent
4552 # gcc 3.* complain about adding -Idirectories that they already know about,
4553 # so we will take those off from locincpth.
4554 case "$gccversion" in
4556 echo "main(){}">try.c
4557 for incdir in $locincpth; do
4558 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4559 grep '^c[cp]p*[01]: warning: changing search order '`
4560 if test "X$warn" != X; then
4561 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4567 : What should the include directory be ?
4569 $echo $n "Hmm... $c"
4573 if $test -f /bin/mips && /bin/mips; then
4574 echo "Looks like a MIPS system..."
4575 $cat >usr.c <<'EOCP'
4576 #ifdef SYSTYPE_BSD43
4580 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4581 dflt='/bsd43/usr/include'
4585 mips_type='System V'
4587 $rm -f usr.c usr.out
4588 echo "and you're compiling with the $mips_type compiler and libraries."
4592 echo "Doesn't look like a MIPS system."
4602 case "$xxx_prompt" in
4605 rp='Where are the include files you want to use?'
4613 : see how we invoke the C preprocessor
4615 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4616 cat <<'EOT' >testcpp.c
4622 if test ! -f cppstdin; then
4623 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4624 # AIX cc -E doesn't show the absolute headerfile
4625 # locations but we'll cheat by using the -M flag.
4626 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
4628 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4631 echo "Keeping your $hint cppstdin wrapper."
4634 wrapper=`pwd`/cppstdin
4638 if $test "X$cppstdin" != "X" && \
4639 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4640 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4642 echo "You used to use $cppstdin $cppminus so we'll use that again."
4644 '') echo "But let's see if we can live without a wrapper..." ;;
4646 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4647 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4649 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4652 echo "(However, $cpprun $cpplast does not work, let's see...)"
4660 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4667 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4668 $cc -E <testcpp.c >testcpp.out 2>&1; \
4669 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4670 echo "Yup, it does."
4673 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4674 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4675 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4676 echo "Yup, it does."
4679 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4680 $cc -P <testcpp.c >testcpp.out 2>&1; \
4681 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4682 echo "Yipee, that works!"
4685 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4686 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4687 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4688 echo "At long last!"
4691 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4692 $cpp <testcpp.c >testcpp.out 2>&1; \
4693 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4697 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4698 $cpp - <testcpp.c >testcpp.out 2>&1; \
4699 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4700 echo "Hooray, it works! I was beginning to wonder."
4703 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4704 $wrapper <testcpp.c >testcpp.out 2>&1; \
4705 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4711 rp="No dice. I can't find a C preprocessor. Name one:"
4715 $x_cpp <testcpp.c >testcpp.out 2>&1
4716 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4717 echo "OK, that will do." >&4
4719 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4734 echo "Perhaps can we force $cc -E using a wrapper..."
4735 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4736 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4742 echo "Nope, we'll have to live without it..."
4756 "$wrapper"|'cppstdin') ;;
4757 *) $rm -f $wrapper;;
4759 $rm -f testcpp.c testcpp.out
4761 : Set private lib path
4764 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4769 '') dlist="$loclibpth $plibpth $glibpth";;
4770 *) dlist="$libpth";;
4773 : Now check and see which directories actually exist, avoiding duplicates
4777 if $test -d $xxx; then
4780 *) libpth="$libpth $xxx";;
4786 Some systems have incompatible or broken versions of libraries. Among
4787 the directories listed in the question below, please remove any you
4788 know not to be holding relevant libraries, and add any that are needed.
4789 Say "none" for none.
4800 rp="Directories to use for library searches?"
4807 : compute shared library extension
4810 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4820 On some systems, shared libraries may be available. Answer 'none' if
4821 you want to suppress searching of shared libraries for the remainder
4822 of this configuration.
4825 rp='What is the file extension used for shared libraries?'
4829 : Define several unixisms.
4830 : Hints files or command line option can be used to override them.
4831 : The convoluted testing is in case hints files set either the old
4834 '') case "$exe_ext" in
4836 *) _exe="$exe_ext" ;;
4841 '') case "$lib_ext" in
4848 '') case "$obj_ext" in
4855 '') case "$path_sep" in
4866 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4868 : Which makefile gets called first. This is used by make depend.
4869 case "$firstmakefile" in
4870 '') firstmakefile='makefile';;
4873 : Check for uselongdouble support
4875 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4878 case "$uselongdouble" in
4879 $define|true|[yY]*) dflt='y';;
4884 Perl can be built to take advantage of long doubles which
4885 (if available) may give more accuracy and range for floating point numbers.
4887 If this doesn't make any sense to you, just accept the default '$dflt'.
4889 rp='Try to use long doubles if available?'
4892 y|Y) val="$define" ;;
4898 case "$uselongdouble" in
4899 true|[yY]*) uselongdouble="$define" ;;
4902 : Look for a hint-file generated 'call-back-unit'. If the
4903 : user has specified that long doubles should be used,
4904 : we may need to set or change some other defaults.
4905 if $test -f uselongdouble.cbu; then
4906 echo "Your platform has some specific hints regarding long doubles, using them..."
4907 . ./uselongdouble.cbu
4909 case "$uselongdouble" in
4912 (Your platform does not have any specific hints for long doubles.)
4918 : Looking for optional libraries
4920 echo "Checking for optional libraries..." >&4
4925 case "$libswanted" in
4926 '') libswanted='c_s';;
4929 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4935 for thisdir in $libpth $xlibpth; do
4936 test -d $thisdir && libspath="$libspath $thisdir"
4938 for thislib in $libswanted; do
4939 for thisdir in $libspath; do
4941 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4942 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4943 $test -f "$xxx" && eval $libscheck
4944 $test -f "$xxx" && libstyle=shared
4946 if test ! -f "$xxx"; then
4947 xxx=$thisdir/lib$thislib.$so
4948 $test -f "$xxx" && eval $libscheck
4949 $test -f "$xxx" && libstyle=shared
4951 if test ! -f "$xxx"; then
4952 xxx=$thisdir/lib$thislib$_a
4953 $test -f "$xxx" && eval $libscheck
4954 $test -f "$xxx" && libstyle=static
4956 if test ! -f "$xxx"; then
4957 xxx=$thisdir/$thislib$_a
4958 $test -f "$xxx" && eval $libscheck
4959 $test -f "$xxx" && libstyle=static
4961 if test ! -f "$xxx"; then
4962 xxx=$thisdir/lib${thislib}_s$_a
4963 $test -f "$xxx" && eval $libscheck
4964 $test -f "$xxx" && libstyle=static
4965 $test -f "$xxx" && thislib=${thislib}_s
4967 if test ! -f "$xxx"; then
4968 xxx=$thisdir/Slib$thislib$_a
4969 $test -f "$xxx" && eval $libscheck
4970 $test -f "$xxx" && libstyle=static
4972 if $test -f "$xxx"; then
4974 shared) echo "Found -l$thislib (shared)." ;;
4975 static) echo "Found -l$thislib." ;;
4976 *) echo "Found -l$thislib ($libstyle)." ;;
4980 *) dflt="$dflt -l$thislib"
4981 libsfound="$libsfound $xxx"
4983 libsfiles="$libsfiles $yyy"
4984 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4985 case " $libsdirs " in
4987 *) libsdirs="$libsdirs $yyy" ;;
4994 if $test ! -f "$xxx"; then
4995 echo "No -l$thislib."
5006 ' '|'') dflt='none';;
5011 In order to compile $package on your machine, a number of libraries
5012 are usually needed. Include any other special libraries here as well.
5013 Say "none" for none. The default list is almost always right.
5017 rp="What libraries to use?"
5024 : determine optimization, if desired, or use for debug flag also
5026 ' '|$undef) dflt='none';;
5028 *) dflt="$optimize";;
5032 By default, $package compiles with the -O flag to use the optimizer.
5033 Alternately, you might want to use the symbolic debugger, which uses
5034 the -g flag (on traditional Unix systems). Either flag can be
5035 specified here. To use neither flag, specify the word "none".
5038 rp="What optimizer/debugger flag should be used?"
5042 'none') optimize=" ";;
5045 : Check what DEBUGGING is required from the command line
5046 : -DEBUGGING or -DDEBUGGING or
5047 : -DEBUGGING=both = -g + -DDEBUGGING
5048 : -DEBUGGING=-g or -Doptimize=-g = -g
5049 : -DEBUGGING=none or -UDEBUGGING =
5050 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5053 *) DEBUGGING=$EBUGGING ;;
5056 case "$DEBUGGING" in
5060 *) optimize="$optimize -g" ;;
5064 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5072 case "$DEBUGGING" in
5073 both|$define) dflt='-DDEBUGGING'
5076 : argument order is deliberate, as the flag will start with - which set could
5077 : think is an option
5078 checkccflag='check=$1; flag=$2; callback=$3;
5080 echo "Checking if your compiler accepts $flag" 2>&1;
5081 echo "int main(void) { return 0; }" > gcctest.c;
5082 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5083 echo "Yes, it does." 2>&1;
5084 if $test -s gcctest.out ; then
5085 echo "But your platform does not like it:";
5090 echo "Leaving current flags $ccflags alone." 2>&1
5092 *) dflt="$dflt $flag";
5098 echo "Nope, it does not, but that is ok." 2>&1;
5102 : We will not override a previous value, but we might want to
5103 : augment a hint file
5105 default|recommended)
5106 case "$gccversion" in
5107 1*) dflt="$dflt -fpcc-struct-return" ;;
5109 case "$optimize:$DEBUGGING" in
5110 *-g*:old) dflt="$dflt -DDEBUGGING";;
5112 case "$gccversion" in
5113 2*) if $test -d /etc/conf/kconfig.d &&
5114 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5116 # Interactive Systems (ISC) POSIX mode.
5121 case "$gccversion" in
5124 ?*) set strict-aliasing -fno-strict-aliasing
5128 # For gcc, adding -pipe speeds up compilations for some, but apparently
5129 # some assemblers can't read from stdin. (It also slows down compilations
5130 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5131 case "$gccversion" in
5137 # on x86_64 (at least) we require an extra library (libssp) in the
5138 # link command line. This library is not named, so I infer that it is
5139 # an implementation detail that may change. Hence the safest approach
5140 # is to add the flag to the flags passed to the compiler at link time,
5141 # as that way the compiler can do the right implementation dependant
5143 case "$gccversion" in
5144 ?*) set stack-protector -fstack-protector
5151 case "$mips_type" in
5152 *BSD*|'') inclwanted="$locincpth $usrinc";;
5153 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5155 for thisincl in $inclwanted; do
5156 if $test -d $thisincl; then
5157 if $test x$thisincl != x$usrinc; then
5159 *" -I$thisincl "*);;
5160 *) dflt="$dflt -I$thisincl ";;
5166 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5168 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5176 *) dflt="$dflt -D$2";;
5180 set signal.h LANGUAGE_C; eval $inctest
5184 ccflags="$ccflags -DSOCKS"
5189 default|recommended) dflt="$ccflags $dflt" ;;
5190 *) dflt="$ccflags";;
5199 Your C compiler may want other flags. For this question you should include
5200 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5201 but you should NOT include libraries or ld flags like -lwhatever. If you
5202 want $package to honor its debug switch, you should include -DDEBUGGING here.
5203 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5205 To use no flags, specify the word "none".
5211 rp="Any additional cc flags?"
5218 : the following weeds options from ccflags that are of no interest to cpp
5220 '') cppflags="$ccflags" ;;
5221 *) cppflags="$cppflags $ccflags" ;;
5223 case "$gccversion" in
5224 1*) cppflags="$cppflags -D__GNUC__"
5226 case "$mips_type" in
5228 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5234 echo "Let me guess what the preprocessor flags are..." >&4
5248 *) ftry="$previous $flag";;
5250 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5251 >cpp1.out 2>/dev/null && \
5252 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5253 >cpp2.out 2>/dev/null && \
5254 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5255 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5257 cppflags="$cppflags $ftry"
5267 *-*) echo "They appear to be: $cppflags";;
5269 $rm -f cpp.c cpp?.out
5273 : flags used in final linking phase
5275 '') if ./venix; then
5281 *-posix*) dflt="$dflt -posix" ;;
5284 *) dflt="$ldflags";;
5286 # See note above about -fstack-protector
5288 *-fstack-protector*)
5290 *-fstack-protector*) ;; # Don't add it again
5291 *) dflt="$dflt -fstack-protector" ;;
5296 : Try to guess additional flags to pick up local libraries.
5297 for thislibdir in $libpth; do
5298 case " $loclibpth " in
5301 *"-L$thislibdir "*) ;;
5302 *) dflt="$dflt -L$thislibdir" ;;
5314 Your C linker may need flags. For this question you should
5315 include -L/whatever and any other flags used by the C linker, but you
5316 should NOT include libraries like -lwhatever.
5318 Make sure you include the appropriate -L/path flags if your C linker
5319 does not normally search all of the directories you specified above,
5322 To use no flags, specify the word "none".
5326 rp="Any additional ld flags (NOT including libraries)?"
5332 rmlist="$rmlist pdp11"
5336 echo "Checking your choice of C compiler and flags for coherency..." >&4
5337 $cat > try.c <<'EOF'
5339 int main() { printf("Ok\n"); return(0); }
5341 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5343 $cat >try.msg <<'EOM'
5344 I've tried to compile and run the following simple program:
5347 $cat try.c >> try.msg
5349 $cat >> try.msg <<EOM
5356 and I got the following output:
5360 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5361 if $sh -c "$run ./try " >>try.msg 2>&1; then
5365 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5368 cat >> try.msg <<'EOQS'
5369 If $libs contains -lsfio, and sfio is mis-configured, then it
5370 sometimes (apparently) runs and exits with a 0 status, but with no
5371 output! It may have to do with sfio's use of _exit vs. exit.
5374 rp="You have a big problem. Shall I abort Configure"
5381 echo "The program compiled OK, but exited with status $?." >>try.msg
5382 rp="You have a problem. Shall I abort Configure"
5386 echo "I can't compile the test program." >>try.msg
5387 rp="You have a BIG problem. Shall I abort Configure"
5393 case "$knowitall" in
5395 echo "(The supplied flags or libraries might be incorrect.)"
5403 *) echo "Ok. Stopping Configure." >&4
5408 n) echo "OK, that should do.";;
5410 $rm_try gcctest gcctest.out
5412 : define a shorthand compile call
5416 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5417 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5421 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5422 : define a shorthand compile call for compilations that should be ok.
5426 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5428 : determine filename position in cpp output
5430 echo "Computing filename position in cpp output for #include directives..." >&4
5432 vos) testaccess=-e ;;
5435 echo '#include <stdio.h>' > foo.c
5438 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5439 $grep '^[ ]*#.*stdio\.h' | \
5440 while read cline; do
5443 while $test \$# -gt 0; do
5444 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5449 pos=\`expr \$pos + 1\`
5461 *) pos="${fieldn}th";;
5463 echo "Your cpp writes the filename in the $pos field of the line."
5466 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5467 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5470 : locate header file
5475 for usrincdir in $usrinc
5477 if test -f \$usrincdir/\$wanted; then
5478 echo "\$usrincdir/\$wanted"
5482 awkprg='{ print \$$fieldn }'
5483 echo "#include <\$wanted>" > foo\$\$.c
5484 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5485 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5486 while read cline; do
5487 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5489 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5490 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5495 # status = 0: grep returned 0 lines, case statement not executed
5496 # status = 1: headerfile found
5497 # status = 2: while loop executed, no headerfile found
5501 if test \$status -eq 1; then
5508 : define an alternate in-header-list? function
5509 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5510 cont=true; xxf="echo \"<\$1> found.\" >&4";
5511 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5512 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5514 case $# in 4) instead=instead;; *) instead="at last";; esac;
5515 while $test "$cont"; do
5517 var=$2; eval "was=\$$2";
5518 if $test "$xxx" && $test -r "$xxx";
5520 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5523 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5524 set $yyy; shift; shift; yyy=$@;
5525 case $# in 0) cont="";;
5526 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5527 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5528 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5529 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5533 do set $yyy; var=$2; eval "was=\$$2";
5534 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5535 set $yyy; shift; shift; yyy=$@;
5538 : see if stdlib is available
5539 set stdlib.h i_stdlib
5542 : check for lengths of integral types
5546 echo "Checking to see how big your integers are..." >&4
5555 printf("intsize=%d;\n", (int)sizeof(int));
5556 printf("longsize=%d;\n", (int)sizeof(long));
5557 printf("shortsize=%d;\n", (int)sizeof(short));
5562 if eval $compile_ok && $run ./try > /dev/null; then
5564 echo "Your integers are $intsize bytes long."
5565 echo "Your long integers are $longsize bytes long."
5566 echo "Your short integers are $shortsize bytes long."
5570 Help! I can't compile and run the intsize test program: please enlighten me!
5571 (This is probably a misconfiguration in your system or libraries, and
5572 you really ought to fix it. Still, I'll try anyway.)
5576 rp="What is the size of an integer (in bytes)?"
5580 rp="What is the size of a long integer (in bytes)?"
5584 rp="What is the size of a short integer (in bytes)?"
5592 : check for long long
5594 echo "Checking to see if you have long long..." >&4
5595 echo 'int main() { long long x = 7; return 0; }' > try.c
5597 if eval $compile; then
5599 echo "You have long long."
5602 echo "You do not have long long."
5608 : check for length of long long
5609 case "${d_longlong}${longlongsize}" in
5612 echo "Checking to see how big your long longs are..." >&4
5613 $cat >try.c <<'EOCP'
5617 printf("%d\n", (int)sizeof(long long));
5622 if eval $compile_ok; then
5623 longlongsize=`$run ./try`
5624 echo "Your long longs are $longlongsize bytes long."
5628 echo "(I can't seem to compile the test program. Guessing...)"
5629 rp="What is the size of a long long (in bytes)?"
5633 if $test "X$longsize" = "X$longlongsize"; then
5634 echo "(That isn't any different from an ordinary long.)"
5640 : see if inttypes.h is available
5641 : we want a real compile instead of Inhdr because some systems
5642 : have an inttypes.h which includes non-existent headers
5645 #include <inttypes.h>
5647 static int32_t foo32 = 0x12345678;
5651 if eval $compile; then
5652 echo "<inttypes.h> found." >&4
5655 echo "<inttypes.h> NOT found." >&4
5664 echo "Checking to see if you have int64_t..." >&4
5666 #include <sys/types.h>
5667 #$i_inttypes I_INTTYPES
5669 #include <inttypes.h>
5671 int main() { int64_t x = 7; }
5674 if eval $compile; then
5676 echo "You have int64_t."
5679 echo "You do not have int64_t."
5685 : Check if 64bit ints have a quad type
5687 echo "Checking which 64-bit integer type we could use..." >&4
5693 val='"unsigned int"'
5698 *) case "$longsize" in
5702 val='"unsigned long"'
5707 *) case "$d_longlong:$longlongsize" in
5712 val='"unsigned long long"'
5717 *) case "$d_int64_t" in
5736 '') echo "Alas, no 64-bit integer types in sight." >&4
5739 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5744 : Do we want 64bit support
5745 case "$uselonglong" in
5746 "$define"|true|[yY]*)
5749 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5751 use64bitint="$define"
5754 case "$use64bits" in
5755 "$define"|true|[yY]*)
5758 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5760 use64bitint="$define"
5763 case "$use64bitints" in
5764 "$define"|true|[yY]*)
5767 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5769 use64bitint="$define"
5772 case "$use64bitsint" in
5773 "$define"|true|[yY]*)
5776 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5778 use64bitint="$define"
5781 case "$uselonglongs" in
5782 "$define"|true|[yY]*)
5785 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5787 use64bitint="$define"
5790 case "$use64bitsall" in
5791 "$define"|true|[yY]*)
5794 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5796 use64bitall="$define"
5801 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5803 case "$use64bitall" in
5804 "$define"|true|[yY]*) use64bitint="$define" ;;
5810 You have natively 64-bit long integers.
5814 *) case "$use64bitint" in
5815 "$define"|true|[yY]*) dflt='y';;
5824 Perl can be built to take advantage of 64-bit integer types
5825 on some systems. To do so, Configure can be run with -Duse64bitint.
5826 Choosing this option will most probably introduce binary incompatibilities.
5828 If this doesn't make any sense to you, just accept the default '$dflt'.
5829 (The default has been chosen based on your configuration.)
5831 rp='Try to use 64-bit integers, if available?'
5834 [yY]*) val="$define" ;;
5842 case "$use64bitall" in
5843 "$define"|true|[yY]*) dflt='y' ;;
5844 *) case "$longsize" in
5852 You may also choose to try maximal 64-bitness. It means using as much
5853 64-bitness as possible on the platform. This in turn means even more
5854 binary incompatibilities. On the other hand, your platform may not
5855 have any more 64-bitness available than what you already have chosen.
5857 If this doesn't make any sense to you, just accept the default '$dflt'.
5858 (The default has been chosen based on your configuration.)
5860 rp='Try to use maximal 64-bit support, if available?'
5863 [yY]*) val="$define" ;;
5868 case "$use64bitall" in
5870 case "$use64bitint" in
5874 Since you have chosen a maximally 64-bit build, I'm also turning on
5875 the use of 64-bit integers.
5877 use64bitint="$define" ;;
5882 : Look for a hint-file generated 'call-back-unit'. If the
5883 : user has specified that a 64-bit perl is to be built,
5884 : we may need to set or change some other defaults.
5885 if $test -f use64bitint.cbu; then
5886 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5889 case "$use64bitint" in
5890 "$define"|true|[yY]*)
5892 4) case "$archname64" in
5893 '') archname64=64int ;;
5900 : Look for a hint-file generated 'call-back-unit'. If the
5901 : user has specified that a maximally 64-bit perl is to be built,
5902 : we may need to set or change some other defaults.
5903 if $test -f use64bitall.cbu; then
5904 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5907 case "$use64bitall" in
5908 "$define"|true|[yY]*)
5910 4) case "$archname64" in
5911 ''|64int) archname64=64all ;;
5918 case "$d_quad:$use64bitint" in
5922 *** You have chosen to use 64-bit integers,
5923 *** but none can be found.
5924 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5925 *** Cannot continue, aborting.
5932 : check for length of double
5934 case "$doublesize" in
5936 echo "Checking to see how big your double precision numbers are..." >&4
5945 printf("%d\n", (int)sizeof(double));
5950 if eval $compile_ok; then
5951 doublesize=`$run ./try`
5952 echo "Your double is $doublesize bytes long."
5955 echo "(I can't seem to compile the test program. Guessing...)"
5956 rp="What is the size of a double precision number (in bytes)?"
5964 : check for long doubles
5966 echo "Checking to see if you have long double..." >&4
5967 echo 'int main() { long double x = 7.0; }' > try.c
5969 if eval $compile; then
5971 echo "You have long double."
5974 echo "You do not have long double."
5980 : check for length of long double
5981 case "${d_longdbl}${longdblsize}" in
5984 echo "Checking to see how big your long doubles are..." >&4
5985 $cat >try.c <<'EOCP'
5989 printf("%d\n", sizeof(long double));
5994 if eval $compile; then
5995 longdblsize=`$run ./try`
5996 echo "Your long doubles are $longdblsize bytes long."
6000 echo "(I can't seem to compile the test program. Guessing...)" >&4
6001 rp="What is the size of a long double (in bytes)?"
6005 if $test "X$doublesize" = "X$longdblsize"; then
6006 echo "That isn't any different from an ordinary double."
6007 echo "I'll keep your setting anyway, but you may see some"
6008 echo "harmless compilation warnings."
6014 : determine the architecture name
6016 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6017 tarch=`arch`"-$osname"
6018 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6019 if uname -m > tmparch 2>&1 ; then
6020 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6021 -e 's/$/'"-$osname/" tmparch`
6029 case "$myarchname" in
6032 echo "(Your architecture name used to be $myarchname.)"
6036 case "$targetarch" in
6038 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6043 *) dflt="$archname";;
6045 rp='What is your architecture name'
6048 case "$usethreads" in
6050 echo "Threads selected." >&4
6052 *-thread*) echo "...and architecture name already has -thread." >&4
6054 *) archname="$archname-thread"
6055 echo "...setting architecture name to $archname." >&4
6060 case "$usemultiplicity" in
6062 echo "Multiplicity selected." >&4
6064 *-multi*) echo "...and architecture name already has -multi." >&4
6066 *) archname="$archname-multi"
6067 echo "...setting architecture name to $archname." >&4
6072 case "$use64bitint$use64bitall" in
6074 case "$archname64" in
6076 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6079 case "$use64bitint" in
6080 "$define") echo "64 bit integers selected." >&4 ;;
6082 case "$use64bitall" in
6083 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6086 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6088 *) archname="$archname-$archname64"
6089 echo "...setting architecture name to $archname." >&4
6095 case "$uselongdouble" in
6097 echo "Long doubles selected." >&4
6098 case "$longdblsize" in
6100 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6104 *-ld*) echo "...and architecture name already has -ld." >&4
6106 *) archname="$archname-ld"
6107 echo "...setting architecture name to $archname." >&4
6114 case "$useperlio" in
6116 echo "Perlio selected." >&4
6119 echo "Perlio not selected, using stdio." >&4
6121 *-stdio*) echo "...and architecture name already has -stdio." >&4
6123 *) archname="$archname-stdio"
6124 echo "...setting architecture name to $archname." >&4
6129 if $test -f archname.cbu; then
6130 echo "Your platform has some specific hints for architecture name, using them..."
6134 : set the prefixit variable, to compute a suitable default value
6135 prefixit='case "$3" in
6137 case "$oldprefix" in
6138 "") eval "$1=\"\$$2\"";;
6145 ""|" ") eval "$1=\"\$$2\"";;
6151 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6153 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6154 /*-$oldprefix/*|\~*-$oldprefix/*)
6155 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6156 *) eval "$1=\"\$$2\"";;
6160 : determine installation style
6161 : For now, try to deduce it from prefix unless it is already set.
6162 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6163 case "$installstyle" in
6164 '') case "$prefix" in
6165 *perl*) dflt='lib';;
6166 *) dflt='lib/perl5' ;;
6169 *) dflt="$installstyle" ;;
6171 : Probably not worth prompting for this since we prompt for all
6172 : the directories individually, and the prompt would be too long and
6176 : determine where public executables go
6181 rp='Pathname where the public executables will reside?'
6183 if $test "X$ansexp" != "X$binexp"; then
6187 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6188 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6189 : this via initialinstalllocation
6192 case "$userelocatableinc" in
6193 $define|true|[yY]*) dflt='y' ;;
6198 Would you like to build Perl so that the installation is relocatable, so that
6199 library paths in @INC are determined relative to the path of the perl binary?
6200 This is not advised for system Perl installs, or if you need to run setid
6201 scripts or scripts under taint mode.
6203 If this doesn't make any sense to you, just accept the default '$dflt'.
6205 rp='Use relocatable @INC?'
6208 y|Y) val="$define" ;;
6211 set userelocatableinc
6214 initialinstalllocation="$binexp"
6215 : Default prefix is now "up one level from where the binaries are"
6216 case "$userelocatableinc" in
6222 installprefixexp=".../.."
6226 : determine where private library files go
6227 : Usual default is /usr/local/lib/perl5/$version.
6228 : Also allow things like /opt/perl/lib/$version, since
6229 : /opt/perl/lib/perl5... would be redundant.
6230 : The default "style" setting is made in installstyle.U
6231 case "$installstyle" in
6232 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6233 *) set dflt privlib lib/$version ;;
6238 There are some auxiliary files for $package that need to be put into a
6239 private library directory that is accessible by everyone.
6244 rp='Pathname where the private library files will reside?'
6249 : set the prefixup variable, to restore leading tilda escape
6250 prefixup='case "$prefixexp" in
6252 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6255 : determine where public architecture dependent libraries go
6258 : privlib default is /usr/local/lib/$package/$version
6259 : archlib default is /usr/local/lib/$package/$version/$archname
6260 : privlib may have an optional trailing /share.
6261 tdflt=`echo $privlib | $sed 's,/share$,,'`
6262 tdflt=$tdflt/$archname
6271 $spackage contains architecture-dependent library files. If you are
6272 sharing libraries in a heterogeneous environment, you might store
6273 these files in a separate location. Otherwise, you can just include
6274 them with the rest of the public library files.
6279 rp='Where do you want to put the public architecture-dependent libraries?'
6283 if $test X"$archlib" = X"$privlib"; then
6289 : see if setuid scripts can be secure
6292 Some kernels have a bug that prevents setuid #! scripts from being
6293 secure. Some sites have disabled setuid #! scripts because of this.
6295 First let's decide if your kernel supports secure setuid #! scripts.
6296 (If setuid #! scripts would be secure but have been disabled anyway,
6297 don't say that they are secure if asked.)
6302 if $test -d /dev/fd; then
6303 echo "#!$ls" >reflect
6304 chmod +x,u+s reflect
6305 ./reflect >flect 2>&1
6306 if $contains "/dev/fd" flect >/dev/null; then
6307 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6311 If you are not sure if they are secure, I can check but I'll need a
6312 username and password different from the one you are using right now.
6313 If you don't have such a username or don't want me to test, simply
6317 rp='Other username to test security of setuid scripts with?'
6322 case "$d_suidsafe" in
6323 '') echo "I'll assume setuid scripts are *not* secure." >&4
6326 echo "Well, the $hint value is *not* secure." >&4
6328 *) echo "Well, the $hint value *is* secure." >&4
6333 $rm -f reflect flect
6334 echo "#!$ls" >reflect
6335 chmod +x,u+s reflect
6338 echo '"su" will (probably) prompt you for '"$ans's password."
6339 su $ans -c './reflect >flect'
6340 if $contains "/dev/fd" flect >/dev/null; then
6341 echo "Okay, it looks like setuid scripts are secure." >&4
6344 echo "I don't think setuid scripts are secure." >&4
6349 rp='Does your kernel have *secure* setuid scripts?'
6352 [yY]*) val="$define";;
6357 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6358 echo "(That's for file descriptors, not floppy disks.)"
6364 $rm -f reflect flect
6366 : now see if they want to do setuid emulation
6369 case "$d_suidsafe" in
6372 echo "No need to emulate SUID scripts since they are secure here." >&4
6376 Some systems have disabled setuid scripts, especially systems where
6377 setuid scripts cannot be secure. On systems where setuid scripts have
6378 been disabled, the setuid/setgid bits on scripts are currently
6379 useless. It is possible for $package to detect those bits and emulate
6380 setuid/setgid in a secure fashion. This emulation will only work if
6381 setuid scripts have been disabled in your kernel.
6385 "$define") dflt=y ;;
6388 rp="Do you want to do setuid/setgid emulation?"
6391 [yY]*) val="$define";;
6399 : Find perl5.005 or later.
6400 echo "Looking for a previously installed perl5.005 or later... "
6402 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6403 : Check if this perl is recent and can load a simple module
6404 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6407 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6417 '') echo "None found. That's ok.";;
6418 *) echo "Using $perl5." ;;
6421 : Set the siteprefix variables
6424 After $package is installed, you may wish to install various
6425 add-on modules and utilities. Typically, these add-ons will
6426 be installed under $prefix with the rest
6427 of this package. However, you may wish to install such add-ons
6428 elsewhere under a different prefix.
6430 If you do not wish to put everything under a single prefix, that's
6431 ok. You will be prompted for the individual locations; this siteprefix
6432 is only used to suggest the defaults.
6434 The default should be fine for most people.
6438 rp='Installation prefix to use for add-on modules and utilities?'
6439 : XXX Here might be another good place for an installstyle setting.
6440 case "$siteprefix" in
6442 *) dflt=$siteprefix ;;
6445 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6447 case "$siteprefix" in
6451 *) oldsiteprefix="$prefix";;
6456 siteprefixexp="$ansexp"
6458 : determine where site specific libraries go.
6459 : Usual default is /usr/local/lib/perl5/site_perl/$version
6460 : The default "style" setting is made in installstyle.U
6461 : XXX No longer works with Prefixit stuff.
6462 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6464 '') case "$installstyle" in
6465 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6466 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6474 The installation process will create a directory for
6475 site-specific extensions and modules. Most users find it convenient
6476 to place all site-specific files in this directory rather than in the
6477 main distribution directory.
6481 rp='Pathname for the site-specific library files?'
6485 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6487 : Determine list of previous versions to include in @INC
6488 $cat > getverlist <<EOPL
6491 \$api_versionstring = "$api_versionstring";
6492 \$version = "$version";
6493 \$stem = "$sitelib_stem";
6494 \$archname = "$archname";
6496 $cat >> getverlist <<'EOPL'
6497 # The list found is store twice for each entry: the original name, and
6498 # the binary broken down version as pack "sss", so sorting is easy and
6499 # unambiguous. This will work for all versions that have a maximum of
6500 # three digit groups, separate by '.'s or '_'s. Names are extended with
6501 # ".0.0" to ensure at least three elements for the pack.
6502 # -- H.Merijn Brand (m)'06 23-10-2006
6504 # Can't have leading @ because metaconfig interprets it as a command!
6505 ;@inc_version_list=();
6506 # XXX Redo to do opendir/readdir?
6509 ;@candidates = map {
6510 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6516 ($pversion, $aversion, $vsn5005) = map {
6517 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6518 foreach $d (@candidates) {
6519 if ($d->[1] lt $pversion) {
6520 if ($d->[1] ge $aversion) {
6521 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6523 elsif ($d->[1] ge $vsn5005) {
6524 unshift(@inc_version_list, grep { -d } $d->[0]);
6528 # Skip newer version. I.e. don't look in
6529 # 5.7.0 if we're installing 5.6.1.
6533 if (@inc_version_list) {
6534 print join(' ', @inc_version_list);
6537 # Blank space to preserve value for next Configure run.
6542 case "$inc_version_list" in
6543 '') if test -x "$perl5$exe_ext"; then
6544 dflt=`$perl5 getverlist`
6549 $undef) dflt='none' ;;
6550 *) eval dflt=\"$inc_version_list\" ;;
6553 ''|' ') dflt=none ;;
6560 In order to ease the process of upgrading, this version of perl
6561 can be configured to use modules built and installed with earlier
6562 versions of perl that were installed under $prefix. Specify here
6563 the list of earlier versions that this version of perl should check.
6564 If Configure detected no earlier versions of perl installed under
6565 $prefix, then the list will be empty. Answer 'none' to tell perl
6566 to not search earlier versions.
6568 The default should almost always be sensible, so if you're not sure,
6569 just accept the default.
6572 rp='List of earlier versions to include in @INC?'
6575 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6576 *) inc_version_list="$ans" ;;
6578 case "$inc_version_list" in
6580 inc_version_list_init='0'
6581 d_inc_version_list="$undef"
6583 *) inc_version_list_init=`echo $inc_version_list |
6584 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6585 d_inc_version_list="$define"
6590 : see if malloc/malloc.h has to be included
6591 set malloc/malloc.h i_mallocmalloc
6594 : see if this is a malloc.h system
6595 : we want a real compile instead of Inhdr because some systems have a
6596 : malloc.h that just gives a compile error saying to use stdlib.h instead
6601 #$i_mallocmalloc I_MALLOCMALLOC
6602 #ifdef I_MALLOCMALLOC
6603 # include <malloc/malloc.h>
6606 int main () { return 0; }
6609 if eval $compile; then
6610 echo "<malloc.h> found." >&4
6613 echo "<malloc.h> NOT found." >&4
6620 : check for void type
6622 echo "Checking to see how well your C compiler groks the void type..." >&4
6623 case "$voidflags" in
6635 extern void moo(); /* function returning void */
6636 void (*goo)(); /* ptr to func returning void */
6638 void *hue; /* generic ptr */
6651 int main() { sub(); }
6653 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6654 voidflags=$defvoidused
6655 echo "Good. It appears to support void to the level $package wants.">&4
6656 if $contains warning .out >/dev/null 2>&1; then
6657 echo "However, you might get some warnings that look like this:"
6661 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6662 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6663 echo "It supports 1..."
6664 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6665 echo "It also supports 2..."
6666 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6668 echo "And it supports 4 but not 8 definitely."
6670 echo "It doesn't support 4..."
6671 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6673 echo "But it supports 8."
6676 echo "Neither does it support 8."
6680 echo "It does not support 2..."
6681 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6683 echo "But it supports 4 and 8."
6685 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6687 echo "And it supports 4 but has not heard about 8."
6689 echo "However it supports 8 but not 4."
6694 echo "There is no support at all for void."
6699 case "$voidflags" in
6702 Support flag bits are:
6703 1: basic void declarations.
6704 2: arrays of pointers to functions returning void.
6705 4: operations between pointers to and addresses of void functions.
6706 8: generic void pointers.
6709 rp="Your void support flags add up to what?"
6716 : check for length of pointer
6720 echo "Checking to see how big your pointers are..." >&4
6721 if test "$voidflags" -gt 7; then
6722 echo '#define VOID_PTR char *' > try.c
6724 echo '#define VOID_PTR void *' > try.c
6734 printf("%d\n", (int)sizeof(VOID_PTR));
6739 if eval $compile_ok; then
6740 ptrsize=`$run ./try`
6741 echo "Your pointers are $ptrsize bytes long."
6744 echo "(I can't seem to compile the test program. Guessing...)" >&4
6745 rp="What is the size of a pointer (in bytes)?"
6752 case "$use64bitall" in
6753 "$define"|true|[yY]*)
6757 *** You have chosen a maximally 64-bit build,
6758 *** but your pointers are only 4 bytes wide.
6759 *** Please rerun Configure without -Duse64bitall.
6764 *** Since you have quads, you could possibly try with -Duse64bitint.
6769 *** Cannot continue, aborting.
6780 : determine whether to use malloc wrapping
6782 case "$usemallocwrap" in
6783 [yY]*|true|$define) dflt='y' ;;
6784 [nN]*|false|$undef) dflt='n' ;;
6785 *) case "$usedevel" in
6786 [yY]*|true|$define) dflt='y' ;;
6791 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6793 usemallocwrap="$ans"
6796 usemallocwrap="$define" ;;
6798 usemallocwrap="$undef" ;;
6801 : determine which malloc to compile in
6803 case "$usemymalloc" in
6804 [yY]*|true|$define) dflt='y' ;;
6805 [nN]*|false|$undef) dflt='n' ;;
6806 *) case "$ptrsize" in
6812 rp="Do you wish to attempt to use the malloc that comes with $package?"
6818 mallocsrc='malloc.c'
6819 mallocobj="malloc$_o"
6820 d_mymalloc="$define"
6823 : Remove malloc from list of libraries to use
6824 echo "Removing unneeded -lmalloc from library list" >&4
6825 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6828 echo "libs = $libs" >&4
6840 : compute the return types of malloc and free
6842 $cat >malloc.c <<END
6846 #include <sys/types.h>
6860 case "$malloctype" in
6862 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6869 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6873 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6880 echo "Your system uses $freetype free(), it would seem." >&4
6882 : determine where site specific architecture-dependent libraries go.
6883 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6884 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6885 : sitelib may have an optional trailing /share.
6887 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6888 dflt="$dflt/$archname"
6893 set sitearch sitearch none
6897 The installation process will also create a directory for
6898 architecture-dependent site-specific extensions and modules.
6902 rp='Pathname for the site-specific architecture-dependent library files?'
6906 if $test X"$sitearch" = X"$sitelib"; then
6909 d_sitearch="$define"
6912 : Set the vendorprefix variables
6915 The installation process will also create a directory for
6916 vendor-supplied add-ons. Vendors who supply perl with their system
6917 may find it convenient to place all vendor-supplied files in this
6918 directory rather than in the main distribution directory. This will
6919 ease upgrades between binary-compatible maintenance versions of perl.
6921 Of course you may also use these directories in whatever way you see
6922 fit. For example, you might use them to access modules shared over a
6923 company-wide network.
6925 The default answer should be fine for most people.
6926 This causes further questions about vendor add-ons to be skipped
6927 and no vendor-specific directories will be configured for perl.
6930 rp='Do you want to configure vendor-specific add-on directories?'
6931 case "$usevendorprefix" in
6932 define|true|[yY]*) dflt=y ;;
6933 *) : User may have set vendorprefix directly on Configure command line.
6934 case "$vendorprefix" in
6943 rp='Installation prefix to use for vendor-supplied add-ons?'
6944 case "$vendorprefix" in
6946 *) dflt=$vendorprefix ;;
6949 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6951 case "$vendorprefix" in
6955 *) oldvendorprefix="$prefix";;
6959 usevendorprefix="$define"
6961 vendorprefixexp="$ansexp"
6963 *) usevendorprefix="$undef"
6969 : Set the vendorlib variables
6970 case "$vendorprefix" in
6971 '') d_vendorlib="$undef"
6975 *) d_vendorlib="$define"
6976 : determine where vendor-supplied modules go.
6977 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6978 case "$vendorlib" in
6980 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6981 case "$installstyle" in
6982 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6983 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6986 *) dflt="$vendorlib"
6990 rp='Pathname for the vendor-supplied library files?'
6993 vendorlibexp="$ansexp"
6996 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7000 : Set the vendorarch variables
7001 case "$vendorprefix" in
7002 '') d_vendorarch="$undef"
7006 *) d_vendorarch="$define"
7007 : determine where vendor-supplied architecture-dependent libraries go.
7008 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7009 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7010 : vendorlib may have an optional trailing /share.
7011 case "$vendorarch" in
7012 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7013 dflt="$dflt/$archname"
7015 *) dflt="$vendorarch" ;;
7018 rp='Pathname for vendor-supplied architecture-dependent files?'
7021 vendorarchexp="$ansexp"
7024 prefixvar=vendorarch
7026 if $test X"$vendorarch" = X"$vendorlib"; then
7027 d_vendorarch="$undef"
7029 d_vendorarch="$define"
7032 : Final catch-all directories to search
7035 Lastly, you can have perl look in other directories for extensions and
7036 modules in addition to those already specified.
7037 These directories will be searched after
7041 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7042 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7044 case "$otherlibdirs" in
7045 ''|' ') dflt='none' ;;
7046 *) dflt="$otherlibdirs" ;;
7049 Enter a colon-separated set of extra paths to include in perl's @INC
7050 search path, or enter 'none' for no extra paths.
7054 rp='Colon-separated list of additional directories for perl to search?'
7057 ' '|''|none) otherlibdirs=' ' ;;
7058 *) otherlibdirs="$ans" ;;
7060 case "$otherlibdirs" in
7064 set d_perl_otherlibdirs
7067 : Cruising for prototypes
7069 echo "Checking out function prototypes..." >&4
7070 $cat >prototype.c <<EOCP
7075 int main(int argc, char *argv[]) {
7078 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7079 echo "Your C compiler appears to support function prototypes."
7082 echo "Your C compiler doesn't seem to understand function prototypes."
7089 : Check if ansi2knr is required
7090 case "$prototype" in
7092 *) ansi2knr='ansi2knr'
7097 This version of $package can only be compiled by a compiler that
7098 understands function prototypes. Unfortunately, your C compiler
7100 doesn't seem to understand them. Sorry about that.
7102 If GNU cc is available for your system, perhaps you could try that instead.
7104 Eventually, we hope to support building Perl with pre-ANSI compilers.
7105 If you would like to help in that effort, please contact <perlbug@perl.org>.
7107 Aborting Configure now.
7114 dflt_dtrace='/usr/sbin/dtrace'
7117 Perl can be built to support DTrace on platforms that support it.
7118 DTrace is a diagnosis and performance analysis tool from Sun.
7120 If this doesn't make any sense to you, just accept the default '$dflt'.
7124 case "$usedtrace" in
7130 dflt_dtrace=$usedtrace
7137 rp='Support DTrace if available?'
7140 y|Y) val="$define" ;;
7146 test "X$usedtrace" != "X$define" && break
7149 rp='Where is the dtrace executable?'
7158 if $dtrace -h -s ../perldtrace.d \
7159 -o perldtrace.tmp >/dev/null 2>&1 \
7160 && rm -f perldtrace.tmp
7163 echo "Good: your $dtrace knows about the -h flag."
7167 *** $me: Fatal Error: $dtrace doesn't support -h flag
7169 *** Your installed dtrace doesn't support the -h switch to compile a D
7170 *** program into a C header. Can't continue.
7182 *** $me: Fatal Error: $dtrace not found.
7189 echo "*** $dtrace was not found."
7195 : See if we want extra modules installed
7202 Perl can be built with extra modules or bundles of modules which
7203 will be fetched from the CPAN and installed alongside Perl.
7205 Notice that you will need access to the CPAN; either via the Internet,
7206 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7207 be asked later to configure the CPAN.pm module which will in turn do
7208 the installation of the rest of the extra modules or bundles.)
7210 Notice also that if the modules require any external software such as
7211 libraries and headers (the libz library and the zlib.h header for the
7212 Compress::Zlib module, for example) you MUST have any such software
7213 already installed, this configuration process will NOT install such
7216 If this doesn't make any sense to you, just accept the default '$dflt'.
7218 rp='Install any extra modules (y or n)?'
7224 Please list any extra modules or bundles to be installed from CPAN,
7225 with spaces between the names. The names can be in any format the
7226 'install' command of CPAN.pm will understand. (Answer 'none',
7227 without the quotes, to install no extra modules or bundles.)
7237 $rm -f ../extras.lst
7239 *) echo "(Saving the list of extras for later...)"
7240 echo "$extras" > ../extras.lst
7248 : determine where html pages for programs go
7249 set html1dir html1dir none
7253 If you wish to install html files for programs in $spackage, indicate
7254 the appropriate directory here. To skip installing html files,
7258 ''|none|$undef|' ') dflt=none ;;
7259 *) dflt=$html1dir ;;
7262 rp="Directory for the main $spackage html pages?"
7266 : Use ' ' for none so value is preserved next time through Configure
7267 $test X"$html1dir" = "X" && html1dir=' '
7269 : determine where html pages for libraries and modules go
7270 set html3dir html3dir none
7274 If you wish to install html files for modules associated with $spackage,
7275 indicate the appropriate directory here. To skip installing html files,
7278 : There is no obvious default. If they have specified html1dir, then
7279 : try to key off that, possibly changing .../html1 into .../html3.
7281 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7282 *) dflt=$html3dir ;;
7285 rp="Directory for the $spackage module html pages?"
7289 : Use ' ' for none so value is preserved next time through Configure
7290 $test X"$html3dir" = "X" && html3dir=' '
7292 : determine whether to install perl also as /usr/bin/perl
7295 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7297 Many scripts expect perl to be installed as /usr/bin/perl.
7299 If you want to, I can install the perl you are about to compile
7300 as /usr/bin/perl (in addition to $bin/perl).
7302 if test -f /usr/bin/perl; then
7305 However, please note that because you already have a /usr/bin/perl,
7306 overwriting that with a new Perl would very probably cause problems.
7307 Therefore I'm assuming you don't want to do that (unless you insist).
7310 case "$installusrbinperl" in
7311 "$define"|[yY]*) dflt='y';;
7317 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7320 case "$installusrbinperl" in
7321 "$undef"|[nN]*) dflt='n';;
7325 rp="Do you want to install perl as /usr/bin/perl?"
7328 [yY]*) val="$define";;
7334 set installusrbinperl
7337 : Check if we are using the GNU C library
7339 echo "Checking for GNU C Library..." >&4
7341 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7342 alone are insufficient to distinguish different versions, such as
7343 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7344 libc version 2.1.0. A. Dougherty, June 3, 2002.
7350 # ifdef __GLIBC_MINOR__
7351 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7352 # include <gnu/libc-version.h>
7353 printf("%s\n", gnu_get_libc_version());
7355 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7358 printf("%d\n", __GLIBC__);
7367 if eval $compile_ok && $run ./try > glibc.ver; then
7369 gnulibc_version=`$cat glibc.ver`
7370 echo "You are using the GNU C Library version $gnulibc_version"
7374 echo "You are not using the GNU C Library"
7380 : see if nm is to be used to determine whether a symbol is defined or not
7384 case "$d_gnulibc" in
7387 echo "nm probably won't work on the GNU C Library." >&4
7393 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7395 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7396 echo "'nm' won't be sufficient on this sytem." >&4
7402 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7403 if $test $dflt -gt 20; then
7413 true|$define) dflt=y;;
7420 I can use $nm to extract the symbols from your C libraries. This
7421 is a time consuming task which may generate huge output on the disk (up
7422 to 3 megabytes) but that should make the symbols extraction faster. The
7423 alternative is to skip the 'nm' extraction part and to compile a small
7424 test program instead to determine whether each symbol is present. If
7425 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7426 this may be the best solution.
7428 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7431 rp="Shall I use $nm to extract C symbols from the libraries?"
7434 [Nn]*) usenm=false;;
7443 : nm options which may be necessary
7445 '') if $test -f /mach_boot; then
7447 elif $test -d /usr/ccs/lib; then
7448 nm_opt='-p' # Solaris (and SunOS?)
7449 elif $test -f /dgux; then
7451 elif $test -f /lib64/rld; then
7452 nm_opt='-p' # 64-bit Irix
7458 : nm options which may be necessary for shared libraries but illegal
7459 : for archive libraries. Thank you, Linux.
7460 case "$nm_so_opt" in
7461 '') case "$myuname" in
7463 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7464 nm_so_opt='--dynamic'
7471 : Figure out where the libc is located
7474 : get list of predefined functions in a handy place
7479 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7485 *) for thislib in $libs; do
7488 : Handle C library specially below.
7491 thislib=`echo $thislib | $sed -e 's/^-l//'`
7492 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7494 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7496 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7498 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7500 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7502 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7504 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7509 libnames="$libnames $try"
7511 *) libnames="$libnames $thislib" ;;
7520 for xxx in $libpth; do
7521 $test -r $1 || set $xxx/libc.$so
7522 : The messy sed command sorts on library version numbers.
7524 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7525 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7527 s/[0-9][0-9]*/0000&/g
7528 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7531 $sort | $sed -e 's/^.* //'`
7534 $test -r $1 || set /usr/ccs/lib/libc.$so
7535 $test -r $1 || set /lib/libsys_s$_a
7541 if $test -r "$1"; then
7542 echo "Your (shared) C library seems to be in $1."
7544 elif $test -r /lib/libc && $test -r /lib/clib; then
7545 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7547 libc='/lib/clib /lib/libc'
7548 if $test -r /lib/syslib; then
7549 echo "(Your math library is in /lib/syslib.)"
7550 libc="$libc /lib/syslib"
7552 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7553 echo "Your C library seems to be in $libc, as you said before."
7554 elif $test -r $incpath/usr/lib/libc$_a; then
7555 libc=$incpath/usr/lib/libc$_a;
7556 echo "Your C library seems to be in $libc. That's fine."
7557 elif $test -r /lib/libc$_a; then
7559 echo "Your C library seems to be in $libc. You're normal."
7561 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7563 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7564 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7565 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7567 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7569 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7572 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7574 if $test -r "$tans"; then
7575 echo "Your C library seems to be in $tans, of all places."
7581 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7585 If the guess above is wrong (which it might be if you're using a strange
7586 compiler, or your machine supports multiple models), you can override it here.
7591 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7593 I can't seem to find your C library. I've looked in the following places:
7596 $sed 's/^/ /' libpath
7599 None of these seems to contain your C library. I need to get its name...
7604 rp='Where is your C library?'
7609 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7610 set X `cat libnames`
7613 case $# in 1) xxx=file; esac
7614 echo "Extracting names from the following $xxx for later perusal:" >&4
7616 $sed 's/^/ /' libnames >&4
7618 $echo $n "This may take a while...$c" >&4
7622 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7623 *) $nm $nm_opt $file 2>/dev/null;;
7628 $grep fprintf libc.tmp > libc.ptf
7629 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7630 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7632 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7634 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7636 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7638 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7640 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7642 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7644 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7646 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7648 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7650 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7652 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7654 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7656 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7657 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7659 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7661 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7663 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7665 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7667 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7669 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7671 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7673 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7675 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7677 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7679 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7681 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7683 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7685 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7687 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7690 $nm -p $* 2>/dev/null >libc.tmp
7691 $grep fprintf libc.tmp > libc.ptf
7692 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7693 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7699 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7701 if $ar t $libc > libc.tmp && \
7702 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7704 for thisname in $libnames $libc; do
7705 $ar t $thisname >>libc.tmp
7707 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7709 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7710 for thisname in $libnames $libc; do
7711 $ar tv $thisname >>libc.tmp
7712 emximp -o tmp.imp $thisname \
7714 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7715 < tmp.imp >>libc.tmp
7718 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7721 echo "$ar didn't seem to work right." >&4
7722 echo "Maybe this is a Cray...trying bld instead..." >&4
7724 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7727 for thisname in $libnames; do
7729 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7730 $ar t $thisname >>libc.tmp
7734 echo "That didn't work either. Giving up." >&4
7744 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7745 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7747 *) if $test -f /lib/syscalls.exp; then
7749 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7750 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7751 /lib/syscalls.exp >>libc.list
7757 $rm -f libnames libpath
7759 : see if dld is available
7763 : Check if we are using C++
7765 echo "Checking for C++..." >&4
7766 $cat >try.c <<'EOCP'
7778 if eval $compile_ok && $run ./try; then
7780 echo "You are using a C++ compiler."
7783 echo "You are not using a C++ compiler."
7789 : is a C symbol defined?
7792 -v) tf=libc.tmp; tdc="";;
7793 -a) tf=libc.tmp; tdc="[]";;
7794 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7796 case "$d_cplusplus" in
7797 $define) extern_C="extern \"C\"" ;;
7798 *) extern_C="extern" ;;
7801 case "$reuseval-$4" in
7803 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7808 if $test "$runnm" = true; then
7809 if $contains $tlook $tf >/dev/null 2>&1; then
7811 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7812 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7813 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7814 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7818 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7819 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7825 $define) tval=true;;
7832 : define an is-in-libc? function
7833 inlibc='echo " "; td=$define; tu=$undef;
7834 sym=$1; var=$2; eval "was=\$$2";
7836 case "$reuseval$was" in
7846 echo "$sym() found." >&4;
7847 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7849 echo "$sym() NOT found." >&4;
7850 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7854 $define) echo "$sym() found." >&4;;
7855 *) echo "$sym() NOT found." >&4;;
7859 : see if dlopen exists
7861 xxx_ccflags="$ccflags"
7863 : with g++ one needs -shared to get is-in-libc to work for dlopen
7864 case "$gccversion" in
7866 *) case "$d_cplusplus" in
7867 "$define") ccflags="$ccflags -shared" ;;
7874 ccflags="$xxx_ccflags"
7876 : see if this is a unistd.h system
7877 set unistd.h i_unistd
7880 : determine which dynamic loading, if any, to compile in
7882 dldir="ext/DynaLoader"
7895 $define) dflt='y' ;;
7898 $define) dflt='y' ;;
7900 : Does a dl_xxx.xs file exist for this operating system
7901 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7904 rp="Do you wish to use dynamic loading?"
7911 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7912 dflt="$dldir/dl_${osname}.xs"
7913 elif $test "$d_dlopen" = "$define" ; then
7914 dflt="$dldir/dl_dlopen.xs"
7915 elif $test "$i_dld" = "$define" ; then
7916 dflt="$dldir/dl_dld.xs"
7921 *) dflt="$dldir/$dlsrc"
7924 echo "The following dynamic loading files are available:"
7925 : Can not go over to $dldir because getfile has path hard-coded in.
7926 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7927 rp="Source file to use for dynamic loading"
7933 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7937 Some systems may require passing special flags to $cc -c to
7938 compile modules that will be used to create a shared library.
7939 To use no flags, say "none".
7942 case "$cccdlflags" in
7943 '') case "$gccversion" in
7944 '') case "$osname" in
7946 next) dflt='none' ;;
7947 irix*) dflt='-KPIC' ;;
7948 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7949 sunos) dflt='-pic' ;;
7953 *) case "$osname" in
7954 darwin) dflt='none' ;;
7955 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7960 *) dflt="$cccdlflags" ;;
7962 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7965 none) cccdlflags=' ' ;;
7966 *) cccdlflags="$ans" ;;
7971 Some systems use ld to create libraries that can be dynamically loaded,
7972 while other systems (such as those using ELF) use $cc.
7976 '') $cat >try.c <<EOM
7977 /* Test for whether ELF binaries are produced */
7989 int i = open("a.out",O_RDONLY);
7992 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7993 exit(0); /* succeed (yes, it's ELF) */
7998 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8000 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8004 echo "I'll use ld to build dynamic libraries."
8013 rp="What command should be used to create dynamic libraries?"
8019 Some systems may require passing special flags to $ld to create a
8020 library that can be dynamically loaded. If your ld flags include
8021 -L/other/path options to locate libraries outside your loader's normal
8022 search path, you may need to specify those -L options here as well. To
8023 use no flags, say "none".
8026 case "$lddlflags" in
8027 '') case "$osname" in
8028 beos) dflt='-nostart' ;;
8029 haiku) dflt='-shared' ;;
8031 case "$gccversion" in
8032 '') dflt="$dflt +vnocompatwarnings" ;;
8035 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8036 next) dflt='none' ;;
8037 solaris) dflt='-G' ;;
8038 sunos) dflt='-assert nodefinitions' ;;
8039 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8043 *) dflt="$lddlflags" ;;
8046 : Try to guess additional flags to pick up local libraries.
8047 : Be careful not to append to a plain 'none'
8051 for thisflag in $ldflags; do
8056 *) dflt="$dflt $thisflag" ;;
8063 ''|' ') dflt='none' ;;
8067 *-fstack-protector*)
8069 *-fstack-protector*) ;; # Don't add it again
8070 *) dflt="$dflt -fstack-protector" ;;
8076 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8079 none) lddlflags=' ' ;;
8080 *) lddlflags="$ans" ;;
8085 Some systems may require passing special flags to $cc to indicate that
8086 the resulting executable will use dynamic linking. To use no flags,
8090 case "$ccdlflags" in
8091 '') case "$osname" in
8092 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8093 next|sunos) dflt='none' ;;
8097 *) dflt="$ccdlflags" ;;
8099 rp="Any special flags to pass to $cc to use dynamic linking?"
8102 none) ccdlflags=' ' ;;
8103 *) ccdlflags="$ans" ;;
8114 : Do we want a shared libperl?
8118 # No dynamic loading being used, so don't bother even to prompt.
8121 *) case "$useshrplib" in
8122 '') case "$osname" in
8123 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|haiku|cygwin*)
8125 also='Building a shared libperl is required for dynamic loading to work on your system.'
8130 also='Building a shared libperl is needed for MAB support.'
8148 The perl executable is normally obtained by linking perlmain.c with
8149 libperl${_a}, any static extensions (usually just DynaLoader), and
8150 any other libraries needed on this system (such as -lm, etc.). Since
8151 your system supports dynamic loading, it is probably possible to build
8152 a shared libperl.$so. If you will have more than one executable linked
8153 to libperl.$so, this will significantly reduce the size of each
8154 executable, but it may have a noticeable effect on performance. The
8155 default is probably sensible for your system.
8159 rp="Build a shared libperl.$so (y/n)"
8163 useshrplib='true' ;;
8164 *) useshrplib='false' ;;
8169 case "$useshrplib" in
8173 # Figure out a good name for libperl.so. Since it gets stored in
8174 # a version-specific architecture-dependent library, the version
8175 # number isn't really that important, except for making cc/ld happy.
8177 # A name such as libperl.so.10.1
8178 majmin="libperl.$so.$patchlevel.$subversion"
8179 # A name such as libperl.so.100
8180 majonly=`echo $patchlevel $subversion |
8181 $awk '{printf "%d%02d", $1, $2}'`
8182 majonly=libperl.$so.$majonly
8183 # I'd prefer to keep the os-specific stuff here to a minimum, and
8184 # rely on figuring it out from the naming of libc.
8185 case "${osname}${osvers}" in
8188 # XXX How handle the --version stuff for MAB?
8190 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8193 cygwin*) # ld links now against the dll directly
8194 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8195 majonly=`echo $patchlevel $subversion |
8196 $awk '{printf "%03d%03d", $1, $2}'`
8197 majonly=cygperl5.$majonly.$so
8200 *) # Try to guess based on whether libc has major.minor.
8202 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8203 *libc.$so.[0-9]*) dflt=$majonly ;;
8204 *) dflt=libperl.$so ;;
8214 I need to select a good name for the shared libperl. If your system uses
8215 library names with major and minor numbers, then you might want something
8216 like $majmin. Alternatively, if your system uses a single version
8217 number for shared libraries, then you might want to use $majonly.
8218 Or, your system might be quite happy with a simple libperl.$so.
8220 Since the shared libperl will get installed into a version-specific
8221 architecture-dependent directory, the version number of the shared perl
8222 library probably isn't important, so the default should be o.k.
8225 rp='What name do you want to give to the shared libperl?'
8228 echo "Ok, I'll use $libperl"
8231 libperl="libperl${_a}"
8235 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8239 WARNING: Use of the shrpdir variable for the installation location of
8240 the shared $libperl is not supported. It was never documented and
8241 will not work in this version. Let me (perlbug@perl.org)
8242 know of any problems this may cause.
8248 But your current setting of $shrpdir is
8249 the default anyway, so it's harmless.
8254 Further, your current attempted setting of $shrpdir
8255 conflicts with the value of $archlibexp/CORE
8256 that installperl will use.
8263 # How will the perl executable find the installed shared $libperl?
8264 # Add $xxx to ccdlflags.
8265 # If we can't figure out a command-line option, use $shrpenv to
8266 # set env LD_RUN_PATH. The main perl makefile uses this.
8267 shrpdir=$archlibexp/CORE
8270 if "$useshrplib"; then
8273 # We'll set it in Makefile.SH...
8278 freebsd|netbsd|openbsd|interix|dragonfly)
8279 xxx="-Wl,-R$shrpdir"
8281 bsdos|linux|irix*|dec_osf|gnu*)
8282 xxx="-Wl,-rpath,$shrpdir"
8285 # next doesn't like the default...
8288 # beos doesn't like the default, either.
8291 # Haiku doesn't like the default, either.
8294 # hpux doesn't like the default, either.
8295 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8298 # cygwin needs only ldlibpth
8301 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8307 # Only add $xxx if it isn't already in ccdlflags.
8308 case " $ccdlflags " in
8310 *) ccdlflags="$ccdlflags $xxx"
8313 Adding $xxx to the flags
8314 passed to $ld so that the perl executable will find the
8315 installed shared $libperl.
8323 # Fix ccdlflags in AIX for building external extensions.
8324 # (For building Perl itself bare -bE:perl.exp is needed,
8325 # Makefile.SH takes care of this.)
8327 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8329 # Respect a hint or command-line value.
8331 '') shrpenv="$tmp_shrpenv" ;;
8333 case "$ldlibpthname" in
8334 '') ldlibpthname=LD_LIBRARY_PATH ;;
8335 none) ldlibpthname='' ;;
8338 : determine where manual pages are on this system
8342 syspath='/usr/share/man/man1 /usr/man/man1'
8343 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8344 syspath="$syspath /usr/man/u_man/man1"
8345 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8346 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8347 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8348 sysman=`./loc . /usr/man/man1 $syspath`
8351 if $test -d "$sysman"; then
8352 echo "System manual is in $sysman." >&4
8354 echo "Could not find manual pages in source form." >&4
8357 : determine where manual pages go
8358 set man1dir man1dir none
8362 $spackage has manual pages available in source form.
8366 echo "However, you don't have nroff, so they're probably useless to you."
8368 '') man1dir="none";;
8371 echo "If you don't want the manual sources installed, answer 'none'."
8376 lookpath="$prefixexp/share/man/man1"
8377 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8378 lookpath="$lookpath $prefixexp/man/p_man/man1"
8379 lookpath="$lookpath $prefixexp/man/u_man/man1"
8380 lookpath="$lookpath $prefixexp/man/man.1"
8382 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8383 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8393 rp="Where do the main $spackage manual pages (source) go?"
8395 if $test "X$man1direxp" != "X$ansexp"; then
8406 : What suffix to use on installed man pages
8413 rp="What suffix should be used for the main $spackage man pages?"
8415 '') case "$man1dir" in
8429 *) dflt="$man1ext";;
8436 : see if we can have long filenames
8438 first=123456789abcdef
8440 if (echo hi >$first) 2>/dev/null; then
8441 if $test -f 123456789abcde; then
8442 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8445 echo 'You can have filenames longer than 14 characters.'>&4
8450 You can't have filenames longer than 14 chars.
8451 You can't even think about them!
8457 $rm -rf 123456789abcde*
8459 : determine where library module manual pages go
8460 set man3dir man3dir none
8464 $spackage has manual pages for many of the library modules.
8470 However, you don't have nroff, so they're probably useless to you.
8473 '') man3dir="none";;
8477 case "$d_flexfnam" in
8480 However, your system can't handle the long file names like File::Basename.3.
8483 '') man3dir="none";;
8487 echo "If you don't want the manual sources installed, answer 'none'."
8488 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8490 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8491 if $test -d "$privlib/man/man3"; then
8494 WARNING: Previous versions of perl installed man3 pages into
8495 $privlib/man/man3. This version will suggest a
8496 new default of $dflt.
8500 rp='Do you wish to preserve the old behavior?(y/n)'
8503 y*) dflt="$privlib/man/man3" ;;
8508 *) dflt="$man3dir" ;;
8515 rp="Where do the $package library man pages (source) go?"
8525 : What suffix to use on installed man pages
8531 rp="What suffix should be used for the $package library man pages?"
8533 '') case "$man3dir" in
8547 *) dflt="$man3ext";;
8554 : see if we have to deal with yellow pages, now NIS.
8555 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8556 if $test -f /usr/etc/nibindd; then
8558 echo "I'm fairly confident you're on a NeXT."
8560 rp='Do you get the hosts file via NetInfo?'
8569 y*) hostcat='nidump hosts .';;
8570 *) case "$hostcat" in
8571 nidump*) hostcat='';;
8581 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8589 rp='Are you getting the hosts file via yellow pages?'
8592 y*) hostcat='ypcat hosts';;
8593 *) hostcat='cat /etc/hosts';;
8599 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8602 '') test -f /etc/group && groupcat='cat /etc/group';;
8605 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8608 : now get the host name
8610 echo "Figuring out host name..." >&4
8611 case "$myhostname" in
8613 echo 'Maybe "hostname" will work...'
8614 if tans=`sh -c hostname 2>&1` ; then
8622 if $test "$cont"; then
8624 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8625 if tans=`cat /etc/systemid 2>&1` ; then
8627 phostname='cat /etc/systemid'
8628 echo "Whadyaknow. Xenix always was a bit strange..."
8631 elif $test -r /etc/systemid; then
8632 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8635 if $test "$cont"; then
8636 echo 'No, maybe "uuname -l" will work...'
8637 if tans=`sh -c 'uuname -l' 2>&1` ; then
8639 phostname='uuname -l'
8641 echo 'Strange. Maybe "uname -n" will work...'
8642 if tans=`sh -c 'uname -n' 2>&1` ; then
8644 phostname='uname -n'
8646 echo 'Oh well, maybe I can mine it out of whoami.h...'
8647 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8648 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8649 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8651 case "$myhostname" in
8652 '') echo "Does this machine have an identity crisis or something?"
8655 echo "Well, you said $myhostname before..."
8656 phostname='echo $myhostname';;
8662 case "$myhostname" in
8663 '') myhostname=noname ;;
8665 : you do not want to know about this
8670 if $test "$myhostname" ; then
8672 rp='Your host name appears to be "'$myhostname'".'" Right?"
8680 : bad guess or no guess
8681 while $test "X$myhostname" = X ; do
8683 rp="Please type the (one word) name of your host:"
8688 : translate upper to lower if necessary
8689 case "$myhostname" in
8691 echo "(Normalizing case in your host name)"
8692 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8696 case "$myhostname" in
8698 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8699 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8700 echo "(Trimming domain name from host name--host name is now $myhostname)"
8702 *) case "$mydomain" in
8705 test "X$hostcat" = "Xypcat hosts" &&
8706 ypmatch "$myhostname" hosts 2>/dev/null |\
8707 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8710 test "X$hostcat" != "X" &&
8711 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8712 /[ ]$myhostname[ . ]/p" > hosts
8715 if $test -f hosts; then
8716 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8717 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8718 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8719 hosts | $sort | $uniq | \
8720 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8721 case `$echo X$dflt` in
8722 X*\ *) echo "(Several hosts in the database matched hostname)"
8725 X.) echo "(You do not have fully-qualified names in the hosts database)"
8729 echo "(I cannot locate a hosts database anywhere)"
8734 tans=`./loc resolv.conf X /etc /usr/etc`
8735 if $test -f "$tans"; then
8736 echo "(Attempting domain name extraction from $tans)"
8737 dflt=.`$sed -n -e 's/ / /g' \
8738 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8741 .) dflt=.`$sed -n -e 's/ / /g' \
8742 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8750 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8751 dflt=.`sh -c domainname 2>/dev/null`
8754 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8758 case "$dflt$osname" in
8759 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8760 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8764 .) echo "(Lost all hope -- silly guess then)"
8770 *) dflt="$mydomain";;
8774 rp="What is your domain name?"
8784 : translate upper to lower if necessary
8787 echo "(Normalizing case in your domain name)"
8788 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8792 : a little sanity check here
8793 case "$phostname" in
8796 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8797 $myhostname$mydomain|$myhostname) ;;
8799 case "$phostname" in
8801 echo "(That doesn't agree with your whoami.h file, by the way.)"
8804 echo "(That doesn't agree with your $phostname command, by the way.)"
8812 : determine the e-mail address of the user who is running us
8815 I need to get your e-mail address in Internet format if possible, i.e.
8816 something like user@host.domain. Please answer accurately since I have
8817 no easy means to double check it. The default value provided below
8818 is most probably close to reality but may not be valid from outside
8819 your organization...
8823 while test "$cont"; do
8825 '') dflt="$cf_by@$myhostname$mydomain";;
8826 *) dflt="$cf_email";;
8828 rp='What is your e-mail address?'
8834 rp='Address does not look like an Internet one. Use it anyway?'
8848 : Ask e-mail of administrator
8851 If you or somebody else will be maintaining perl at your site, please
8852 fill in the correct e-mail address here so that they may be contacted
8853 if necessary. Currently, the "perlbug" program included with perl
8854 will send mail to this address in addition to perlbug@perl.org. You may
8855 enter "none" for no administrator.
8858 case "$perladmin" in
8859 '') dflt="$cf_email";;
8860 *) dflt="$perladmin";;
8862 rp='Perl administrator e-mail address'
8866 : determine whether to only install version-specific parts.
8869 Do you want to install only the version-specific parts of the perl
8870 distribution? Usually you do *not* want to do this.
8872 case "$versiononly" in
8873 "$define"|[Yy]*|true) dflt='y' ;;
8876 rp="Do you want to install only the version-specific parts of perl?"
8879 [yY]*) val="$define";;
8885 case "$versiononly" in
8886 "$define") inc_version_list=''
8887 inc_version_list_init=0
8891 : figure out how to guarantee perl startup
8892 : XXX Note that this currently takes advantage of the bug that binexp ignores
8893 : the Configure -Dinstallprefix setting, which in turn means that under
8894 : relocatable @INC, initialinstalllocation is what binexp started as.
8895 case "$startperl" in
8897 case "$sharpbang" in
8901 I can use the #! construct to start perl on your system. This will
8902 make startup of perl scripts faster, but may cause problems if you
8903 want to share those scripts and perl is not in a standard place
8904 ($initialinstalllocation/perl) on all your platforms. The alternative
8905 is to force a shell by starting the script with a single ':' character.
8908 case "$versiononly" in
8909 "$define") dflt="$initialinstalllocation/perl$version";;
8910 *) dflt="$initialinstalllocation/perl";;
8912 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8915 none) startperl=": # use perl";;
8916 *) startperl="#!$ans"
8917 if $test 30 -lt `echo "$ans" | wc -c`; then
8920 WARNING: Some systems limit the #! command to 32 characters.
8921 If you experience difficulty running Perl scripts with #!, try
8922 installing Perl in a directory with a shorter pathname.
8928 *) startperl=": # use perl"
8933 echo "I'll use $startperl to start perl scripts."
8935 : figure best path for perl in scripts
8938 case "$versiononly" in
8939 "$define") perlpath="$initialinstalllocation/perl$version";;
8940 *) perlpath="$initialinstalllocation/perl";;
8942 case "$startperl" in
8947 I will use the "eval 'exec'" idiom to start Perl on your system.
8948 I can use the full path of your Perl binary for this purpose, but
8949 doing so may cause problems if you want to share those scripts and
8950 Perl is not always in a standard place ($initialinstalllocation/perl).
8953 dflt="$initialinstalllocation/perl"
8954 rp="What path shall I use in \"eval 'exec'\"?"
8961 case "$startperl" in
8963 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8966 : determine where public executable scripts go
8967 set scriptdir scriptdir
8969 case "$scriptdir" in
8972 : guess some guesses
8973 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8974 $test -d /usr/share/bin && dflt=/usr/share/bin
8975 $test -d /usr/local/script && dflt=/usr/local/script
8976 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8977 $test -d $prefixexp/script && dflt=$prefixexp/script
8981 *) dflt="$scriptdir"
8986 Some installations have a separate directory just for executable scripts so
8987 that they can mount it across multiple architectures but keep the scripts in
8988 one spot. You might, for example, have a subdirectory of /usr/share for this.
8989 Or you might just lump your scripts in with all your other executables.
8993 rp='Where do you keep publicly executable scripts?'
8995 if $test "X$ansexp" != "X$scriptdirexp"; then
9001 : A little fix up for an irregularly named variable.
9002 installscript="$installscriptdir"
9004 : determine where add-on public executables go
9006 '') dflt=$siteprefix/bin ;;
9010 rp='Pathname where the add-on public executables should be installed?'
9015 : determine where add-on html pages go
9016 : There is no standard location, so try to copy the previously-selected
9017 : directory structure for the core html pages.
9018 case "$sitehtml1dir" in
9019 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9020 *) dflt=$sitehtml1dir ;;
9023 ''|' ') dflt=none ;;
9026 rp='Pathname where the site-specific html pages should be installed?'
9028 prefixvar=sitehtml1dir
9031 : determine where add-on library html pages go
9032 : There is no standard location, so try to copy the previously-selected
9033 : directory structure for the core html pages.
9034 case "$sitehtml3dir" in
9035 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9036 *) dflt=$sitehtml3dir ;;
9039 ''|' ') dflt=none ;;
9042 rp='Pathname where the site-specific library html pages should be installed?'
9044 prefixvar=sitehtml3dir
9047 : determine where add-on manual pages go
9048 case "$siteman1dir" in
9049 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9050 *) dflt=$siteman1dir ;;
9053 ''|' ') dflt=none ;;
9056 rp='Pathname where the site-specific manual pages should be installed?'
9058 prefixvar=siteman1dir
9061 : determine where add-on library man pages go
9062 case "$siteman3dir" in
9063 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9064 *) dflt=$siteman3dir ;;
9067 ''|' ') dflt=none ;;
9070 rp='Pathname where the site-specific library manual pages should be installed?'
9072 prefixvar=siteman3dir
9075 : determine where add-on public executable scripts go
9076 case "$sitescript" in
9077 '') dflt=$siteprefix/script
9078 $test -d $dflt || dflt=$sitebin ;;
9079 *) dflt="$sitescript" ;;
9082 rp='Pathname where add-on public executable scripts should be installed?'
9084 prefixvar=sitescript
9087 : Check if faststdio is requested and available
9088 case "$usefaststdio" in
9089 $define|true|[yY]*|'')
9090 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9100 Perl can be built to use 'fast stdio', which means using the stdio
9101 library but also directly manipulating the stdio buffers to enable
9102 faster I/O. Using stdio is better for backward compatibility (especially
9103 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9104 interface has been preferred instead of stdio.
9106 If this doesn't make any sense to you, just accept the default '$dflt'.
9108 rp='Use the "fast stdio" if available?'
9111 y|Y) val="$define" ;;
9118 : define an is-a-typedef? function
9119 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9121 "") inclist="sys/types.h";;
9123 eval "varval=\$$var";
9127 for inc in $inclist; do
9128 echo "#include <$inc>" >>temp.c;
9130 echo "#ifdef $type" >> temp.c;
9131 echo "printf(\"We have $type\");" >> temp.c;
9132 echo "#endif" >> temp.c;
9133 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9134 if $contains $type temp.E >/dev/null 2>&1; then
9140 *) eval "$var=\$varval";;
9143 : define an is-a-typedef? function that prompts if the type is not available.
9144 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9146 "") inclist="sys/types.h";;
9148 eval "varval=\$$var";
9152 for inc in $inclist; do
9153 echo "#include <$inc>" >>temp.c;
9155 echo "#ifdef $type" >> temp.c;
9156 echo "printf(\"We have $type\");" >> temp.c;
9157 echo "#endif" >> temp.c;
9158 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9160 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9161 if $contains $type temp.E >/dev/null 2>&1; then
9162 echo "$type found." >&4;
9165 echo "$type NOT found." >&4;
9171 *) eval "$var=\$varval";;
9174 : see what type lseek is declared as in the kernel
9175 rp="What is the type used for lseek's offset on this system?"
9176 set off_t lseektype long stdio.h sys/types.h
9180 echo "Checking to see how big your file offsets are..." >&4
9182 #include <sys/types.h>
9186 printf("%d\n", (int)sizeof($lseektype));
9191 if eval $compile_ok; then
9192 lseeksize=`$run ./try`
9193 echo "Your file offsets are $lseeksize bytes long."
9197 echo "(I can't seem to compile the test program. Guessing...)"
9198 rp="What is the size of your file offsets (in bytes)?"
9204 : see what type file positions are declared as in the library
9205 rp="What is the type for file position used by fsetpos()?"
9206 set fpos_t fpostype long stdio.h sys/types.h
9209 : Check size for Fpos_t
9212 *_t) zzz="$fpostype" ;;
9215 echo "Checking the size of $zzz..." >&4
9217 #include <sys/types.h>
9224 printf("%d\n", (int)sizeof($fpostype));
9229 if eval $compile_ok; then
9233 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9236 echo "Your $zzz is $fpossize bytes long."
9242 echo "(I can't compile the test program. Guessing...)" >&4
9243 rp="What is the size of your file positions (in bytes)?"
9248 : Check for large file support
9249 # Backward compatibility (uselfs is deprecated).
9251 "$define"|true|[yY]*)
9254 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9256 uselargefiles="$define"
9260 case "$lseeksize:$fpossize" in
9263 You can have files larger than 2 gigabytes.
9266 *) case "$uselargefiles" in
9267 "$undef"|false|[nN]*) dflt='n' ;;
9272 Perl can be built to understand large files (files larger than 2 gigabytes)
9273 on some systems. To do so, Configure can be run with -Duselargefiles.
9275 If this doesn't make any sense to you, just accept the default '$dflt'.
9277 rp='Try to understand large files, if available?'
9280 y|Y) val="$define" ;;
9287 : Look for a hint-file generated 'call-back-unit'. If the
9288 : user has specified that a large files perl is to be built,
9289 : we may need to set or change some other defaults.
9290 if $test -f uselargefiles.cbu; then
9291 echo "Your platform has some specific hints regarding large file builds, using them..."
9292 . ./uselargefiles.cbu
9294 case "$uselargefiles" in
9296 if $test -f uselargefiles.cbu; then
9298 echo "Rechecking to see how big your file offsets are..." >&4
9300 #include <sys/types.h>
9304 printf("%d\n", (int)sizeof($lseektype));
9309 if eval $compile_ok; then
9310 lseeksize=`$run ./try`
9311 $echo "Your file offsets are now $lseeksize bytes long."
9315 echo "(I can't seem to compile the test program. Guessing...)"
9316 rp="What is the size of your file offsets (in bytes)?"
9321 *_t) zzz="$fpostype" ;;
9324 $echo $n "Rechecking the size of $zzz...$c" >&4
9326 #include <sys/types.h>
9333 printf("%d\n", (int)sizeof($fpostype));
9338 if eval $compile_ok; then
9343 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9346 echo " $fpossize bytes." >&4
9352 echo "(I can't compile the test program. Guessing...)" >&4
9353 rp="What is the size of your file positions (in bytes)?"
9362 : Set the vendorbin variables
9363 case "$vendorprefix" in
9364 '') d_vendorbin="$undef"
9368 *) d_vendorbin="$define"
9369 : determine where vendor-supplied executables go.
9370 case "$vendorbin" in
9371 '') dflt=$vendorprefix/bin ;;
9372 *) dflt="$vendorbin" ;;
9375 rp='Pathname for the vendor-supplied executables directory?'
9378 vendorbinexp="$ansexp"
9384 : Set the vendorhtml1dir variables
9385 case "$vendorprefix" in
9386 '') vendorhtml1dir=''
9387 vendorhtml1direxp=''
9389 *) : determine where vendor-supplied html pages go.
9390 : There is no standard location, so try to copy the previously-selected
9391 : directory structure for the core html pages.
9392 : XXX Better default suggestions would be welcome.
9393 case "$vendorhtml1dir" in
9394 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9395 *) dflt=$vendorhtml1dir ;;
9398 ''|' ') dflt=none ;;
9401 rp='Pathname for the vendor-supplied html pages?'
9403 vendorhtml1dir="$ans"
9404 vendorhtml1direxp="$ansexp"
9407 : Use ' ' for none so value is preserved next time through Configure
9408 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9409 prefixvar=vendorhtml1dir
9412 : Set the vendorhtml3dir variables
9413 case "$vendorprefix" in
9414 '') vendorhtml3dir=''
9415 vendorhtml3direxp=''
9417 *) : determine where vendor-supplied module html pages go.
9418 : There is no standard location, so try to copy the previously-selected
9419 : directory structure for the core html pages.
9420 : XXX Better default suggestions would be welcome.
9421 case "$vendorhtml3dir" in
9422 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9423 *) dflt=$vendorhtml3dir ;;
9426 ''|' ') dflt=none ;;
9429 rp='Pathname for the vendor-supplied html pages?'
9431 vendorhtml3dir="$ans"
9432 vendorhtml3direxp="$ansexp"
9435 : Use ' ' for none so value is preserved next time through Configure
9436 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9437 prefixvar=vendorhtml3dir
9440 : Set the vendorman1dir variables
9441 case "$vendorprefix" in
9442 '') vendorman1dir=''
9445 *) : determine where vendor-supplied manual pages go.
9446 case "$vendorman1dir" in
9447 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9448 *) dflt=$vendorman1dir ;;
9451 ''|' ') dflt=none ;;
9454 rp='Pathname for the vendor-supplied manual section 1 pages?'
9456 vendorman1dir="$ans"
9457 vendorman1direxp="$ansexp"
9460 : Use ' ' for none so value is preserved next time through Configure
9461 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9462 prefixvar=vendorman1dir
9465 : Set the vendorman3dir variables
9466 case "$vendorprefix" in
9467 '') vendorman3dir=''
9470 *) : determine where vendor-supplied module manual pages go.
9471 case "$vendorman3dir" in
9472 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9473 *) dflt=$vendorman3dir ;;
9476 ''|' ') dflt=none ;;
9479 rp='Pathname for the vendor-supplied manual section 3 pages?'
9481 vendorman3dir="$ans"
9482 vendorman3direxp="$ansexp"
9485 : Use ' ' for none so value is preserved next time through Configure
9486 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9487 prefixvar=vendorman3dir
9490 : Set the vendorscript variables
9491 case "$vendorprefix" in
9492 '') d_vendorscript="$undef"
9496 *) d_vendorscript="$define"
9497 : determine where vendor-supplied scripts go.
9498 case "$vendorscript" in
9499 '') dflt=$vendorprefix/script
9500 $test -d $dflt || dflt=$vendorbin ;;
9501 *) dflt="$vendorscript" ;;
9505 The installation process will create a directory for
9506 vendor-supplied scripts.
9510 rp='Pathname for the vendor-supplied scripts directory?'
9513 vendorscriptexp="$ansexp"
9516 prefixvar=vendorscript
9519 : script used to emit important warnings
9522 if test \$# -gt 0; then
9527 echo "*** WARNING:" >&4
9528 sed -e 's/^/*** /' <msg >&4
9530 cat msg >>config.msg
9531 echo " " >>config.msg
9537 : see which of string.h or strings.h is needed
9539 strings=`./findhdr string.h`
9540 if $test "$strings" && $test -r "$strings"; then
9541 echo "Using <string.h> instead of <strings.h>." >&4
9545 strings=`./findhdr strings.h`
9546 if $test "$strings" && $test -r "$strings"; then
9547 echo "Using <strings.h> instead of <string.h>." >&4
9549 ./warn "No string header found -- You'll surely have problems."
9555 "$undef") strings=`./findhdr strings.h`;;
9556 *) strings=`./findhdr string.h`;;
9559 : see if qgcvt exists
9563 : Check print/scan long double stuff
9566 if $test X"$d_longdbl" = X"$define"; then
9568 echo "Checking how to print long doubles..." >&4
9570 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9571 $cat >try.c <<'EOCP'
9572 #include <sys/types.h>
9576 printf("%.3f\n", d);
9580 if eval $compile; then
9584 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9585 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9586 echo "We will use %f."
9592 if $test X"$sPRIfldbl" = X; then
9593 $cat >try.c <<'EOCP'
9594 #include <sys/types.h>
9597 long double d = 123.456;
9598 printf("%.3Lf\n", d);
9602 if eval $compile; then
9606 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9607 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9608 echo "We will use %Lf."
9614 if $test X"$sPRIfldbl" = X; then
9615 $cat >try.c <<'EOCP'
9616 #include <sys/types.h>
9619 long double d = 123.456;
9620 printf("%.3llf\n", d);
9624 if eval $compile; then
9628 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9629 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9630 echo "We will use %llf."
9636 if $test X"$sPRIfldbl" = X; then
9637 $cat >try.c <<'EOCP'
9638 #include <sys/types.h>
9641 long double d = 123.456;
9642 printf("%.3lf\n", d);
9646 if eval $compile; then
9650 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9651 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9652 echo "We will use %lf."
9658 if $test X"$sPRIfldbl" = X; then
9659 echo "Cannot figure out how to print long doubles." >&4
9661 sSCNfldbl=$sPRIfldbl # expect consistency
9668 case "$sPRIfldbl" in
9669 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9670 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9671 d_SCNfldbl="$undef";
9673 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9674 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9675 d_SCNfldbl="$define";
9679 : Check how to convert floats to strings.
9681 if test "X$d_Gconvert" = X; then
9684 echo "Checking for an efficient way to convert floats to strings."
9686 case "$uselongdouble" in
9687 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9689 case "$d_longdbl" in
9690 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9692 case "$d_PRIgldbl" in
9693 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9697 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9698 char *myname = "gconvert";
9701 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9702 char *myname = "gcvt";
9705 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9706 char *myname = "qgcvt";
9707 #define DOUBLETYPE long double
9710 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9712 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9714 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9717 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9719 char *myname = "sprintf";
9723 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9724 #define DOUBLETYPE long double
9726 #define DOUBLETYPE double
9738 # include <string.h>
9740 # include <strings.h>
9743 int checkit(char *expect, char *got)
9745 if (strcmp(expect, got)) {
9746 printf("%s oddity: Expected %s, got %s\n",
9747 myname, expect, got);
9757 /* This must be 1st test on (which?) platform */
9758 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9759 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9760 checkit("0.1", buf);
9762 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9763 checkit("0.01", buf);
9765 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9766 checkit("0.001", buf);
9768 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9769 checkit("0.0001", buf);
9771 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9772 if (strlen(buf) > 5)
9773 checkit("9e-005", buf); /* for Microsoft ?? */
9775 checkit("9e-05", buf);
9777 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9780 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9781 checkit("1.1", buf);
9783 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9784 checkit("1.01", buf);
9786 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9787 checkit("1.001", buf);
9789 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9790 checkit("1.0001", buf);
9792 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9793 checkit("1.00001", buf);
9795 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9796 checkit("1.000001", buf);
9798 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9801 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9804 /* Some Linux gcvt's give 1.e+5 here. */
9805 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9806 checkit("100000", buf);
9808 /* Some Linux gcvt's give -1.e+5 here. */
9809 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9810 checkit("-100000", buf);
9812 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9813 checkit("123.456", buf);
9815 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9816 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9817 /* 34 should be enough to scare even long double
9818 * places into using the e notation. */
9819 if (strlen(buf) > 5)
9820 checkit("1e+034", buf); /* for Microsoft */
9822 checkit("1e+34", buf);
9824 /* For Perl, if you add additional tests here, also add them to
9825 * t/base/num.t for benefit of platforms not using Configure or
9826 * overriding d_Gconvert */
9831 : first add preferred functions to our list
9833 for xxx_convert in $gconvert_preference; do
9834 case $xxx_convert in
9835 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9836 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9839 : then add any others
9840 for xxx_convert in gconvert gcvt sprintf; do
9843 *) xxx_list="$xxx_list $xxx_convert" ;;
9847 case "$d_longdbl$uselongdouble" in
9849 : again, add prefered functions to our list first
9851 for xxx_convert in $gconvert_ld_preference; do
9852 case $xxx_convert in
9853 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9854 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9857 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9858 for xxx_convert in qgcvt sprintf $xxx_list; do
9859 case "$xxx_ld_list" in
9860 $xxx_convert*|*" $xxx_convert"*) ;;
9861 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9864 : if sprintf cannot do long doubles, move it to the end
9865 if test "$d_PRIgldbl" != "$define"; then
9866 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9868 : if no qgcvt, remove it
9869 if test "$d_qgcvt" != "$define"; then
9870 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9873 xxx_list="$xxx_ld_list"
9877 for xxx_convert in $xxx_list; do
9878 echo "Trying $xxx_convert..."
9879 $rm -f try try$_o core
9880 set try -DTRY_$xxx_convert
9881 if eval $compile; then
9882 echo "$xxx_convert() found." >&4
9884 echo "I'll use $xxx_convert to convert floats into a string." >&4
9887 echo "...But $xxx_convert didn't work as I expected."
9891 echo "$xxx_convert NOT found." >&4
9895 if test X$xxx_convert = X; then
9896 echo "*** WHOA THERE!!! ***" >&4
9897 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9901 case "$xxx_convert" in
9902 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9903 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9904 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9905 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9906 "$define$define$define")
9907 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9908 "$define$define$undef")
9909 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9910 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9918 : see if _fwalk exists
9922 : Initialize h_fcntl
9925 : Initialize h_sysfile
9928 : access call always available on UNIX
9932 : locate the flags for 'access()'
9936 $cat >access.c <<EOCP
9937 #include <sys/types.h>
9942 #include <sys/file.h>
9955 : check sys/file.h first, no particular reason here
9956 if $test `./findhdr sys/file.h` && \
9957 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9959 echo "<sys/file.h> defines the *_OK access constants." >&4
9960 elif $test `./findhdr fcntl.h` && \
9961 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9963 echo "<fcntl.h> defines the *_OK access constants." >&4
9964 elif $test `./findhdr unistd.h` && \
9965 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9966 echo "<unistd.h> defines the *_OK access constants." >&4
9968 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9974 : see if accessx exists
9975 set accessx d_accessx
9978 : see if aintl exists
9982 : see if alarm exists
9986 : see if 64bit time functions exists
9988 set ctime64 d_ctime64
9991 set localtime64 d_localtime64
9994 set gmtime64 d_gmtime64
9997 set mktime64 d_mktime64
10000 set difftime64 d_difftime64
10003 set asctime64 d_asctime64
10006 : see if POSIX threads are available
10007 set pthread.h i_pthread
10010 : define a fucntion to check prototypes
10011 $cat > protochk <<EOSH
10014 optimize="$optimize"
10016 prototype="$prototype"
10019 usethreads=$usethreads
10020 i_pthread=$i_pthread
10021 pthread_h_first=$pthread_h_first
10024 $cat >> protochk <<'EOSH'
10029 while test $# -ge 2; do
10031 $define) echo "#include <$2>" >> try.c ;;
10032 literal) echo "$2" >> try.c ;;
10034 # Extra magic for the benefit of systems that need pthread.h
10035 # to be included early to correctly detect threadsafe functions.
10036 # Such functions must guarantee themselves, though, that the usethreads
10037 # and i_pthread have been defined, before calling protochk.
10038 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10039 echo "#include <pthread.h>" >> try.c
10044 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10045 cat >> try.c <<'EOCP'
10046 #ifdef CAN_PROTOTYPE
10047 #define _(args) args
10052 echo "$foo" >> try.c
10053 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10054 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10060 $eunicefix protochk
10062 : Define hasproto macro for Configure internal use
10063 hasproto='varname=$1; func=$2; shift; shift;
10064 while $test $# -ge 2; do
10066 $define) echo "#include <$2>";;
10070 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10071 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10072 echo "$func() prototype found.";
10075 echo "$func() prototype NOT found.";
10082 : see if sys/types.h has to be included
10083 set sys/types.h i_systypes
10086 : see if sys/select.h has to be included
10087 set sys/select.h i_sysselct
10090 : Define hasfield macro for Configure internal use
10091 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10092 while $test $# -ge 2; do
10094 $define) echo "#include <$2>";;
10098 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10100 if eval $compile; then
10109 : see if we should include time.h, sys/time.h, or both
10111 if test "X$timeincl" = X; then
10112 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10113 $echo $n "I'm now running the test program...$c"
10115 #include <sys/types.h>
10120 #ifdef SYSTIMEKERNEL
10123 #include <sys/time.h>
10126 #include <sys/select.h>
10128 #$i_stdlib I_STDLIB
10130 #include <stdlib.h>
10136 struct timeval bar;
10139 struct timezone tzp;
10141 if (foo.tm_sec == foo.tm_sec)
10144 if (bar.tv_sec == bar.tv_sec)
10151 for s_timezone in '-DS_TIMEZONE' ''; do
10153 for s_timeval in '-DS_TIMEVAL' ''; do
10154 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10155 for i_time in '' '-DI_TIME'; do
10156 for i_systime in '-DI_SYSTIME' ''; do
10159 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10160 if eval $compile; then
10161 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10165 $echo $n "Succeeded with $flags$c"
10177 *SYSTIMEKERNEL*) i_systimek="$define"
10178 timeincl=`./findhdr sys/time.h`
10179 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10180 *) i_systimek="$undef";;
10183 *I_TIME*) i_time="$define"
10184 timeincl=`./findhdr time.h`" $timeincl"
10185 echo "We'll include <time.h>." >&4;;
10186 *) i_time="$undef";;
10189 *I_SYSTIME*) i_systime="$define"
10190 timeincl=`./findhdr sys/time.h`" $timeincl"
10191 echo "We'll include <sys/time.h>." >&4;;
10192 *) i_systime="$undef";;
10196 : see if struct tm knows about tm_zone
10197 case "$i_systime$i_time" in
10200 echo "Checking to see if your struct tm has tm_zone field..." >&4
10201 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10209 case "$d_tm_tm_zone" in
10210 "$define") echo "Yes, it does." ;;
10211 *) echo "No, it doesn't." ;;
10213 : see if struct tm knows about tm_gmtoff
10214 case "$i_systime$i_time" in
10217 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10218 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10226 case "$d_tm_tm_gmtoff" in
10227 "$define") echo "Yes, it does." ;;
10228 *) echo "No, it doesn't." ;;
10231 : see if asctime_r exists
10232 set asctime_r d_asctime_r
10234 case "$d_asctime_r" in
10236 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10237 case "$d_asctime_r_proto:$usethreads" in
10238 ":define") d_asctime_r_proto=define
10239 set d_asctime_r_proto asctime_r $hdrs
10243 case "$d_asctime_r_proto" in
10245 case "$asctime_r_proto" in
10246 ''|0) try='char* asctime_r(const struct tm*, char*);'
10247 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10249 case "$asctime_r_proto" in
10250 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10251 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10253 case "$asctime_r_proto" in
10254 ''|0) try='int asctime_r(const struct tm*, char*);'
10255 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10257 case "$asctime_r_proto" in
10258 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10259 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10261 case "$asctime_r_proto" in
10262 ''|0) d_asctime_r=undef
10264 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10265 * ) case "$asctime_r_proto" in
10266 REENTRANT_PROTO*) ;;
10267 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10269 echo "Prototype: $try" ;;
10272 *) case "$usethreads" in
10273 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10280 *) asctime_r_proto=0
10284 : see if atolf exists
10288 : see if atoll exists
10292 : Look for GCC-style attribute format
10293 case "$d_attribute_format" in
10296 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10297 $cat >attrib.c <<'EOCP'
10299 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10301 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10302 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10303 echo "Your C compiler doesn't support __attribute__((format))."
10306 echo "Your C compiler supports __attribute__((format))."
10310 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10314 *) val="$d_attribute_format" ;;
10316 set d_attribute_format
10320 : Look for GCC-style attribute format with null format allowed
10321 case "$d_printf_format_null" in
10322 '') case "$d_attribute_format" in
10325 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10326 $cat >attrib.c <<EOCP
10328 #$i_stdlib I_STDLIB
10330 #include <stdlib.h>
10332 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10333 int null_printf (char* pat,...) { return (int)pat; }
10334 int main () { exit(null_printf(NULL)); }
10336 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10337 : run the executable in case it produces a run-time warning
10338 if $run ./attrib >>attrib.out 2>&1; then
10339 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10340 echo "Your C compiler doesn't allow __printf__ format to be null."
10343 echo "Your C compiler allows __printf__ format to be null."
10347 echo "Your C compiler executable failed with __printf__ format null."
10351 echo "Your C compiler fails with __printf__ format null."
10358 *) val="$d_printf_format_null" ;;
10360 set d_printf_format_null
10364 : Look for GCC-style attribute malloc
10365 case "$d_attribute_malloc" in
10368 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10369 $cat >attrib.c <<'EOCP'
10371 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10373 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10374 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10375 echo "Your C compiler doesn't support __attribute__((malloc))."
10378 echo "Your C compiler supports __attribute__((malloc))."
10382 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10386 *) val="$d_attribute_malloc" ;;
10388 set d_attribute_malloc
10392 : Look for GCC-style attribute nonnull
10393 case "$d_attribute_nonnull" in
10396 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10397 $cat >attrib.c <<'EOCP'
10399 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10401 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10402 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10403 echo "Your C compiler doesn't support __attribute__((nonnull))."
10406 echo "Your C compiler supports __attribute__((nonnull))."
10410 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10414 *) val="$d_attribute_nonnull" ;;
10416 set d_attribute_nonnull
10420 : Look for GCC-style attribute noreturn
10421 case "$d_attribute_noreturn" in
10424 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10425 $cat >attrib.c <<'EOCP'
10427 void fall_over_dead( void ) __attribute__((noreturn));
10429 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10430 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10431 echo "Your C compiler doesn't support __attribute__((noreturn))."
10434 echo "Your C compiler supports __attribute__((noreturn))."
10438 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10442 *) val="$d_attribute_noreturn" ;;
10444 set d_attribute_noreturn
10448 : Look for GCC-style attribute pure
10449 case "$d_attribute_pure" in
10452 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10453 $cat >attrib.c <<'EOCP'
10455 int square( int n ) __attribute__((pure));
10457 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10458 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10459 echo "Your C compiler doesn't support __attribute__((pure))."
10462 echo "Your C compiler supports __attribute__((pure))."
10466 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10470 *) val="$d_attribute_pure" ;;
10472 set d_attribute_pure
10476 : Look for GCC-style attribute unused
10477 case "$d_attribute_unused" in
10480 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10481 $cat >attrib.c <<'EOCP'
10483 int do_something( int dummy __attribute__((unused)), int n );
10485 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10486 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10487 echo "Your C compiler doesn't support __attribute__((unused))."
10490 echo "Your C compiler supports __attribute__((unused))."
10494 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10498 *) val="$d_attribute_unused" ;;
10500 set d_attribute_unused
10504 : Look for GCC-style attribute deprecated
10505 case "$d_attribute_deprecated" in
10508 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10509 $cat >attrib.c <<'EOCP'
10511 int I_am_deprecated(void) __attribute__((deprecated));
10513 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10514 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10515 echo "Your C compiler doesn't support __attribute__((deprecated))."
10518 echo "Your C compiler supports __attribute__((deprecated))."
10522 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10526 *) val="$d_attribute_deprecated" ;;
10528 set d_attribute_deprecated
10532 : Look for GCC-style attribute warn_unused_result
10533 case "$d_attribute_warn_unused_result" in
10536 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10537 $cat >attrib.c <<'EOCP'
10539 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10541 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10542 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10543 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10546 echo "Your C compiler supports __attribute__((warn_unused_result))."
10550 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10554 *) val="$d_attribute_warn_unused_result" ;;
10556 set d_attribute_warn_unused_result
10560 : see if bcmp exists
10564 : see if bcopy exists
10568 : see if getpgrp exists
10569 set getpgrp d_getpgrp
10572 case "$d_getpgrp" in
10575 echo "Checking to see which flavor of getpgrp is in use..."
10577 #$i_unistd I_UNISTD
10578 #include <sys/types.h>
10580 # include <unistd.h>
10582 #$i_stdlib I_STDLIB
10584 #include <stdlib.h>
10588 if (getuid() == 0) {
10589 printf("(I see you are running Configure as super-user...)\n");
10592 #ifdef TRY_BSD_PGRP
10593 if (getpgrp(1) == 0)
10602 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10603 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10605 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10606 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10609 echo "I can't seem to compile and run the test program."
10611 xxx="a USG one, i.e. you use getpgrp()."
10613 # SVR4 systems can appear rather BSD-ish.
10614 case "$i_unistd" in
10616 xxx="a BSD one, i.e. you use getpgrp(pid)."
10620 xxx="probably a USG one, i.e. you use getpgrp()."
10625 echo "Assuming your getpgrp is $xxx" >&4
10634 : see if setpgrp exists
10635 set setpgrp d_setpgrp
10638 case "$d_setpgrp" in
10641 echo "Checking to see which flavor of setpgrp is in use..."
10643 #$i_unistd I_UNISTD
10644 #include <sys/types.h>
10646 # include <unistd.h>
10648 #$i_stdlib I_STDLIB
10650 #include <stdlib.h>
10654 if (getuid() == 0) {
10655 printf("(I see you are running Configure as super-user...)\n");
10658 #ifdef TRY_BSD_PGRP
10659 if (-1 == setpgrp(1, 1))
10662 if (setpgrp() != -1)
10668 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10669 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10671 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10672 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10675 echo "(I can't seem to compile and run the test program.)"
10677 xxx="a USG one, i.e. you use setpgrp()."
10679 # SVR4 systems can appear rather BSD-ish.
10680 case "$i_unistd" in
10682 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10686 xxx="probably a USG one, i.e. you use setpgrp()."
10691 echo "Assuming your setpgrp is $xxx" >&4
10700 : Look for GCC-style __builtin_choose_expr
10701 case "$d_builtin_choose_expr" in
10704 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10705 $cat >try.c <<'EOCP'
10706 #include <assert.h>
10707 #include <stdlib.h>
10710 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10713 assert( SYRINX(1) == 2112 );
10714 assert( SYRINX(1) != 5150 );
10715 assert( SYRINX(0) == 5150 );
10716 assert( SYRINX(0) != 2112 );
10717 puts( "All good!" );
10723 if eval $compile && $run ./try; then
10724 echo "Your C compiler supports __builtin_choose_expr."
10727 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10731 *) val="$d_builtin_choose_expr" ;;
10734 set d_builtin_choose_expr
10738 : Look for GCC-style __builtin_expect
10739 case "$d_builtin_expect" in
10742 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10743 $cat >try.c <<'EOCP'
10746 if ( __builtin_expect(n, 0) ) n = 1;
10747 /* Remember shell exit code truth is 0, C truth is non-zero */
10752 if eval $compile && $run ./try; then
10753 echo "Your C compiler supports __builtin_expect."
10756 echo "Your C compiler doesn't seem to understand __builtin_expect."
10760 *) val="$d_builtin_expect" ;;
10763 set d_builtin_expect
10767 : see if bzero exists
10771 : see if stdarg is available
10773 if $test `./findhdr stdarg.h`; then
10774 echo "<stdarg.h> found." >&4
10777 echo "<stdarg.h> NOT found." >&4
10781 : see if varags is available
10783 if $test `./findhdr varargs.h`; then
10784 echo "<varargs.h> found." >&4
10786 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10789 : set up the varargs testing programs
10790 $cat > varargs.c <<EOP
10792 #include <stdarg.h>
10795 #include <varargs.h>
10799 int f(char *p, ...)
10813 p = va_arg(ap, char *);
10819 $cat > varargs <<EOP
10821 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10830 : now check which varargs header should be included
10835 if `./varargs I_STDARG`; then
10837 elif `./varargs I_VARARGS`; then
10842 if `./varargs I_VARARGS`; then
10849 echo "I could not find the definition for va_dcl... You have problems..." >&4
10850 val="$undef"; set i_stdarg; eval $setvar
10851 val="$undef"; set i_varargs; eval $setvar
10856 case "$i_varhdr" in
10858 val="$define"; set i_stdarg; eval $setvar
10859 val="$undef"; set i_varargs; eval $setvar
10862 val="$undef"; set i_stdarg; eval $setvar
10863 val="$define"; set i_varargs; eval $setvar
10866 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10870 : see if the Compiler supports C99 variadic macros
10871 case "$i_stdarg$i_stdlib" in
10873 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10876 #include <stdarg.h>
10878 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10882 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10888 if eval $compile && $run ./try 2>&1 >/dev/null; then
10889 case "`$run ./try`" in
10891 echo "You have C99 variadic macros." >&4
10892 d_c99_variadic_macros="$define"
10895 echo "You don't have functional C99 variadic macros." >&4
10896 d_c99_variadic_macros="$undef"
10900 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10901 d_c99_variadic_macros="$undef"
10906 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10907 d_c99_variadic_macros="$undef"
10911 : see if signal is declared as pointer to function returning int or void
10913 xxx=`./findhdr signal.h`
10914 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10915 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10916 echo "You have int (*signal())() instead of void." >&4
10918 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10919 echo "You have void (*signal())()." >&4
10921 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10922 echo "You have int (*signal())() instead of void." >&4
10924 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10925 echo "You have void (*signal())()." >&4
10928 case "$d_voidsig" in
10930 echo "I can't determine whether signal handler returns void or int..." >&4
10932 rp="What type does your signal handler return?"
10935 v*) val="$define";;
10939 echo "As you already told me, signal handler returns void." >&4
10942 *) echo "As you already told me, signal handler returns int." >&4
10949 case "$d_voidsig" in
10950 "$define") signal_t="void";;
10951 *) signal_t="int";;
10955 : check for ability to cast large floats to 32-bit ints.
10957 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10958 if $test "$intsize" -ge 4; then
10965 #$i_stdlib I_STDLIB
10967 #include <stdlib.h>
10969 #include <sys/types.h>
10970 #include <signal.h>
10971 $signal_t blech(int s) { exit(3); }
10978 signal(SIGFPE, blech);
10980 /* Don't let compiler optimize the test away. Store the number
10981 in a writable string for gcc to pass to sscanf under HP/UX.
10983 sprintf(str, "2147483647");
10984 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10988 /* x86 processors will probably give 0x8000 0000, which is a
10989 sign change. We don't want that. We want to mimic SPARC
10990 behavior here, which is to preserve the sign and give
10993 if (i32 != ($xxx) f)
10999 if eval $compile_ok; then
11003 echo "(I can't seem to compile the test program--assuming it can't)"
11008 echo "Yup, it can."
11011 echo "Nope, it can't."
11018 : check for ability to cast negative floats to unsigned
11020 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11023 #$i_stdlib I_STDLIB
11025 #include <stdlib.h>
11027 #include <sys/types.h>
11028 #include <signal.h>
11029 $signal_t blech(int s) { exit(7); }
11030 $signal_t blech_in_list(int s) { exit(4); }
11031 unsigned long dummy_long(unsigned long p) { return p; }
11032 unsigned int dummy_int(unsigned int p) { return p; }
11033 unsigned short dummy_short(unsigned short p) { return p; }
11037 unsigned long along;
11039 unsigned short ashort;
11043 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11044 a direct f = -123. assignment. gcc-2.8.0 reportedly
11045 optimized the whole file away
11047 /* Store the number in a writable string for gcc to pass to
11048 sscanf under HP/UX.
11050 sprintf(str, "-123");
11051 sscanf(str, "%lf", &f); /* f = -123.; */
11053 signal(SIGFPE, blech);
11054 along = (unsigned long)f;
11055 aint = (unsigned int)f;
11056 ashort = (unsigned short)f;
11057 if (along != (unsigned long)-123)
11059 if (aint != (unsigned int)-123)
11061 if (ashort != (unsigned short)-123)
11063 sprintf(str, "1073741824.");
11064 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11067 along = (unsigned long)f;
11068 if (along != 0x80000000)
11072 along = (unsigned long)f;
11073 if (along != 0x7fffffff)
11077 along = (unsigned long)f;
11078 if (along != 0x80000001)
11082 signal(SIGFPE, blech_in_list);
11083 sprintf(str, "123.");
11084 sscanf(str, "%lf", &f); /* f = 123.; */
11085 along = dummy_long((unsigned long)f);
11086 aint = dummy_int((unsigned int)f);
11087 ashort = dummy_short((unsigned short)f);
11088 if (along != (unsigned long)123)
11090 if (aint != (unsigned int)123)
11092 if (ashort != (unsigned short)123)
11099 if eval $compile_ok; then
11103 echo "(I can't seem to compile the test program--assuming it can't)"
11106 case "$castflags" in
11108 echo "Yup, it can."
11111 echo "Nope, it can't."
11118 : see if vprintf exists
11120 if set vprintf val -f d_vprintf; eval $csym; $val; then
11121 echo 'vprintf() found.' >&4
11124 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11125 #$i_varargs I_VARARGS
11127 #$i_stdlib I_STDLIB
11128 #$i_unistd I_UNISTD
11131 # include <stdarg.h>
11132 #else /* I_VARARGS */
11133 # include <varargs.h>
11137 # include <unistd.h>
11141 # include <stdlib.h>
11144 #include <stdio.h> /* vsprintf prototype */
11147 void xxx(int n, ...)
11152 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11154 int main() { xxx(1, "foo"); }
11156 #else /* I_VARARGS */
11164 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11166 int main() { xxx("foo"); }
11172 if eval $compile_ok; then
11173 if $run ./try; then
11174 echo "Your vsprintf() returns (int)." >&4
11177 echo "Your vsprintf() returns (char*)." >&4
11181 echo 'I am unable to compile the vsprintf() test program.' >&4
11182 # We shouldn't get here. If we do, assume the standard signature,
11183 # not the old BSD one.
11184 echo 'Guessing that vsprintf() returns (int).' >&4
11188 echo 'vprintf() NOT found.' >&4
11199 : see if chown exists
11203 : see if chroot exists
11204 set chroot d_chroot
11207 : see if chsize exists
11208 set chsize d_chsize
11211 : see if class exists
11215 : see if clearenv exists
11216 set clearenv d_clearenv
11219 : Define hasstruct macro for Configure internal use
11220 hasstruct='varname=$1; struct=$2; shift; shift;
11221 while $test $# -ge 2; do
11223 $define) echo "#include <$2>";;
11227 echo "int main () { struct $struct foo; }" >> try.c;
11229 if eval $compile; then
11238 : see whether socket exists
11242 $echo $n "Hmm... $c" >&4
11243 if set socket val -f d_socket; eval $csym; $val; then
11244 echo "Looks like you have Berkeley networking support." >&4
11246 if set setsockopt val -f; eval $csym; $val; then
11249 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11250 d_oldsock="$define"
11253 if $contains socklib libc.list >/dev/null 2>&1; then
11254 echo "Looks like you have Berkeley networking support." >&4
11256 : we will have to assume that it supports the 4.2 BSD interface
11259 echo "You don't have Berkeley networking in libc$_a..." >&4
11260 if test "X$d_socket" = "X$define"; then
11261 echo "...but you seem to believe that you have sockets." >&4
11263 for net in net socket
11265 if test -f /usr/lib/lib$net$_a; then
11266 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11267 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11268 if $contains socket libc.list >/dev/null 2>&1; then
11273 echo "...but the Wollongong group seems to have hacked it in." >&4
11274 sockethdr="-I/usr/netinclude"
11277 echo "Found Berkeley sockets interface in lib$net." >&4
11278 if $contains setsockopt libc.list >/dev/null 2>&1; then
11281 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11282 d_oldsock="$define"
11288 if test "X$d_socket" != "X$define"; then
11289 echo "or anywhere else I see." >&4
11297 : see if socketpair exists
11298 set socketpair d_sockpair
11303 echo "Checking the availability of certain socket constants..." >&4
11304 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11305 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11307 #include <sys/types.h>
11308 #include <sys/socket.h>
11314 set try; if eval $compile; then
11317 set d_${enum}; eval $setvar
11321 : see if this is a sys/uio.h system
11322 set sys/uio.h i_sysuio
11325 : Check for cmsghdr support
11327 echo "Checking to see if your system supports struct cmsghdr..." >&4
11328 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11330 case "$d_cmsghdr_s" in
11331 "$define") echo "Yes, it does." ;;
11332 *) echo "No, it doesn't." ;;
11336 : check for const keyword
11338 echo 'Checking to see if your C compiler knows about "const"...' >&4
11339 $cat >const.c <<'EOCP'
11340 typedef struct spug { int drokk; } spug;
11344 const spug y = { 0 };
11347 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11349 echo "Yup, it does."
11352 echo "Nope, it doesn't."
11357 : see if copysignl exists
11358 set copysignl d_copysignl
11361 : see if crypt exists
11366 $define) cryptlib='' ;;
11367 *) if set crypt val -f d_crypt; eval $csym; $val; then
11368 echo 'crypt() found.' >&4
11372 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11373 if $test -z "$cryptlib"; then
11374 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11378 if $test -z "$cryptlib"; then
11379 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11383 if $test -z "$cryptlib"; then
11384 cryptlib=`./loc libcrypt$_a "" $libpth`
11388 if $test -z "$cryptlib"; then
11389 echo 'crypt() NOT found.' >&4
11400 : see if this is a crypt.h system
11401 set crypt.h i_crypt
11404 : see if crypt_r exists
11405 set crypt_r d_crypt_r
11407 case "$d_crypt_r" in
11409 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11410 case "$d_crypt_r_proto:$usethreads" in
11411 ":define") d_crypt_r_proto=define
11412 set d_crypt_r_proto crypt_r $hdrs
11416 case "$d_crypt_r_proto" in
11418 case "$crypt_r_proto" in
11419 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11420 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11422 case "$crypt_r_proto" in
11423 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11424 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11426 case "$crypt_r_proto" in
11427 ''|0) d_crypt_r=undef
11429 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11430 * ) case "$crypt_r_proto" in
11431 REENTRANT_PROTO*) ;;
11432 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11434 echo "Prototype: $try" ;;
11437 *) case "$usethreads" in
11438 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11449 : get csh whereabouts
11451 'csh') val="$undef" ;;
11452 *) val="$define" ;;
11456 : Respect a hint or command line value for full_csh.
11457 case "$full_csh" in
11458 '') full_csh=$csh ;;
11461 : see if ctermid exists
11462 set ctermid d_ctermid
11465 : see if ctermid_r exists
11466 set ctermid_r d_ctermid_r
11468 case "$d_ctermid_r" in
11470 hdrs="$i_systypes sys/types.h define stdio.h "
11471 case "$d_ctermid_r_proto:$usethreads" in
11472 ":define") d_ctermid_r_proto=define
11473 set d_ctermid_r_proto ctermid_r $hdrs
11477 case "$d_ctermid_r_proto" in
11479 case "$ctermid_r_proto" in
11480 ''|0) try='char* ctermid_r(char*);'
11481 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11483 case "$ctermid_r_proto" in
11484 ''|0) d_ctermid_r=undef
11486 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11487 * ) case "$ctermid_r_proto" in
11488 REENTRANT_PROTO*) ;;
11489 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11491 echo "Prototype: $try" ;;
11494 *) case "$usethreads" in
11495 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11502 *) ctermid_r_proto=0
11506 : see if ctime_r exists
11507 set ctime_r d_ctime_r
11509 case "$d_ctime_r" in
11511 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11512 case "$d_ctime_r_proto:$usethreads" in
11513 ":define") d_ctime_r_proto=define
11514 set d_ctime_r_proto ctime_r $hdrs
11518 case "$d_ctime_r_proto" in
11520 case "$ctime_r_proto" in
11521 ''|0) try='char* ctime_r(const time_t*, char*);'
11522 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11524 case "$ctime_r_proto" in
11525 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11526 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11528 case "$ctime_r_proto" in
11529 ''|0) try='int ctime_r(const time_t*, char*);'
11530 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11532 case "$ctime_r_proto" in
11533 ''|0) try='int ctime_r(const time_t*, char*, int);'
11534 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11536 case "$ctime_r_proto" in
11537 ''|0) d_ctime_r=undef
11539 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11540 * ) case "$ctime_r_proto" in
11541 REENTRANT_PROTO*) ;;
11542 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11544 echo "Prototype: $try" ;;
11547 *) case "$usethreads" in
11548 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11559 : see if cuserid exists
11560 set cuserid d_cuserid
11563 : see if this is a limits.h system
11564 set limits.h i_limits
11567 : see if this is a float.h system
11568 set float.h i_float
11571 : See if number of significant digits in a double precision number is known
11573 $cat >dbl_dig.c <<EOM
11574 #$i_limits I_LIMITS
11577 #include <limits.h>
11583 printf("Contains DBL_DIG");
11586 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11587 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11588 echo "DBL_DIG found." >&4
11591 echo "DBL_DIG NOT found." >&4
11598 : see if dbm.h is available
11599 : see if dbmclose exists
11600 set dbmclose d_dbmclose
11603 case "$d_dbmclose" in
11613 *) set rpcsvc/dbm.h i_rpcsvcdbm
11618 *) echo "We won't be including <dbm.h>"
11628 : see if prototype for dbminit is available
11630 set d_dbminitproto dbminit $i_dbm dbm.h
11633 : see if difftime exists
11634 set difftime d_difftime
11637 : see if this is a dirent system
11639 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11641 echo "<dirent.h> found." >&4
11644 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11645 echo "<sys/dir.h> found." >&4
11648 xinc=`./findhdr sys/ndir.h`
11650 echo "<dirent.h> NOT found." >&4
11655 : Look for type of directory structure.
11657 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11659 case "$direntrytype" in
11661 case "$i_dirent" in
11662 $define) guess1='struct dirent' ;;
11663 *) guess1='struct direct' ;;
11666 *) guess1="$direntrytype"
11671 'struct dirent') guess2='struct direct' ;;
11672 *) guess2='struct dirent' ;;
11675 if $contains "$guess1" try.c >/dev/null 2>&1; then
11676 direntrytype="$guess1"
11677 echo "Your directory entries are $direntrytype." >&4
11678 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11679 direntrytype="$guess2"
11680 echo "Your directory entries seem to be $direntrytype." >&4
11682 echo "I don't recognize your system's directory entries." >&4
11683 rp="What type is used for directory entries on this system?"
11686 direntrytype="$ans"
11690 : see if the directory entry stores field length
11692 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11693 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11694 echo "Good, your directory entry keeps length information in d_namlen." >&4
11697 echo "Your directory entry does not know about the d_namlen field." >&4
11704 : Look for DIR.dd_fd
11705 case "$i_dirent" in
11707 echo "Checking to see if DIR has a dd_fd member variable" >&4
11709 #$i_stdlib I_STDLIB
11711 #include <stdlib.h>
11713 #include <dirent.h>
11723 if eval $compile; then
11724 echo "Yes, it does."
11727 echo "No, it does not."
11732 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11740 : see if this is an sysdir system
11741 set sys/dir.h i_sysdir
11744 : see if this is an sysndir system
11745 set sys/ndir.h i_sysndir
11750 $cat >dirfd.c <<EOM
11752 #$i_stdlib I_STDLIB
11754 #include <stdlib.h>
11756 #$i_dirent I_DIRENT /**/
11757 #$i_sysdir I_SYS_DIR /**/
11758 #$i_sysndir I_SYS_NDIR /**/
11759 #$i_systypes I_SYS_TYPES /**/
11760 #if defined(I_SYS_TYPES)
11761 #include <sys/types.h>
11763 #if defined(I_DIRENT)
11764 #include <dirent.h>
11765 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11766 #include <sys/dir.h>
11770 #include <sys/ndir.h>
11774 #include <ndir.h> /* may be wrong in the future */
11776 #include <sys/dir.h>
11782 DIR *dirp = opendir(".");
11783 if (dirfd(dirp) >= 0)
11791 if eval $compile; then
11795 $define) echo "dirfd() found." >&4 ;;
11796 *) echo "dirfd() NOT found." >&4 ;;
11802 : see if dlerror exists
11805 set dlerror d_dlerror
11809 : see if dlfcn is available
11810 set dlfcn.h i_dlfcn
11813 : Check what extension to use for shared libs
11818 On a few systems, the dynamically loaded modules that perl generates and uses
11819 will need a different extension than shared libs. The default will probably
11825 *) dflt="$dlext" ;;
11827 rp='What is the extension of dynamically loaded modules'
11836 : Check if dlsym need a leading underscore
11842 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11843 $cat >dyna.c <<'EOM'
11850 #$i_stdlib I_STDLIB
11852 #include <stdlib.h>
11856 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11858 #include <sys/types.h>
11863 extern int fred() ;
11872 int mode = RTLD_LAZY ;
11874 handle = dlopen("./dyna.$dlext", mode) ;
11875 if (handle == NULL) {
11880 symbol = dlsym(handle, "fred") ;
11881 if (symbol == NULL) {
11882 /* try putting a leading underscore */
11883 symbol = dlsym(handle, "_fred") ;
11884 if (symbol == NULL) {
11897 : Call the object file tmp-dyna.o in case dlext=o.
11898 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11899 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11900 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11901 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11904 1) echo "Test program failed using dlopen." >&4
11905 echo "Perhaps you should not use dynamic loading." >&4;;
11906 2) echo "Test program failed using dlsym." >&4
11907 echo "Perhaps you should not use dynamic loading." >&4;;
11908 3) echo "dlsym needs a leading underscore" >&4
11910 4) echo "dlsym doesn't need a leading underscore." >&4;;
11913 echo "I can't compile and run the test program." >&4
11914 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11919 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11924 : see if drand48_r exists
11925 set drand48_r d_drand48_r
11927 case "$d_drand48_r" in
11929 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11930 case "$d_drand48_r_proto:$usethreads" in
11931 ":define") d_drand48_r_proto=define
11932 set d_drand48_r_proto drand48_r $hdrs
11936 case "$d_drand48_r_proto" in
11938 case "$drand48_r_proto" in
11939 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11940 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
11942 case "$drand48_r_proto" in
11943 ''|0) d_drand48_r=undef
11945 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11946 * ) case "$drand48_r_proto" in
11947 REENTRANT_PROTO*) ;;
11948 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11950 echo "Prototype: $try" ;;
11953 *) case "$usethreads" in
11954 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11961 *) drand48_r_proto=0
11965 : see if prototype for drand48 is available
11967 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11970 : see if dup2 exists
11974 : see if eaccess exists
11975 set eaccess d_eaccess
11978 : see if endgrent exists
11979 set endgrent d_endgrent
11982 : see if this is an grp system
11988 xxx=`./findhdr grp.h`
11989 $cppstdin $cppflags $cppminus < $xxx >$$.h
11991 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12003 set d_grpasswd; eval $setvar
12007 : see if endgrent_r exists
12008 set endgrent_r d_endgrent_r
12010 case "$d_endgrent_r" in
12012 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12013 case "$d_endgrent_r_proto:$usethreads" in
12014 ":define") d_endgrent_r_proto=define
12015 set d_endgrent_r_proto endgrent_r $hdrs
12019 case "$d_endgrent_r_proto" in
12021 case "$endgrent_r_proto" in
12022 ''|0) try='int endgrent_r(FILE**);'
12023 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12025 case "$endgrent_r_proto" in
12026 ''|0) try='void endgrent_r(FILE**);'
12027 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12029 case "$endgrent_r_proto" in
12030 ''|0) d_endgrent_r=undef
12032 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12033 * ) case "$endgrent_r_proto" in
12034 REENTRANT_PROTO*) ;;
12035 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12037 echo "Prototype: $try" ;;
12040 *) case "$usethreads" in
12041 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12048 *) endgrent_r_proto=0
12052 : see if endhostent exists
12053 set endhostent d_endhent
12056 : see if this is a netdb.h system
12057 set netdb.h i_netdb
12060 : see if endhostent_r exists
12061 set endhostent_r d_endhostent_r
12063 case "$d_endhostent_r" in
12065 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12066 case "$d_endhostent_r_proto:$usethreads" in
12067 ":define") d_endhostent_r_proto=define
12068 set d_endhostent_r_proto endhostent_r $hdrs
12072 case "$d_endhostent_r_proto" in
12074 case "$endhostent_r_proto" in
12075 ''|0) try='int endhostent_r(struct hostent_data*);'
12076 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12078 case "$endhostent_r_proto" in
12079 ''|0) try='void endhostent_r(struct hostent_data*);'
12080 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12082 case "$endhostent_r_proto" in
12083 ''|0) d_endhostent_r=undef
12084 endhostent_r_proto=0
12085 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12086 * ) case "$endhostent_r_proto" in
12087 REENTRANT_PROTO*) ;;
12088 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12090 echo "Prototype: $try" ;;
12093 *) case "$usethreads" in
12094 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12096 d_endhostent_r=undef
12097 endhostent_r_proto=0
12101 *) endhostent_r_proto=0
12105 : see if endnetent exists
12106 set endnetent d_endnent
12109 : see if endnetent_r exists
12110 set endnetent_r d_endnetent_r
12112 case "$d_endnetent_r" in
12114 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12115 case "$d_endnetent_r_proto:$usethreads" in
12116 ":define") d_endnetent_r_proto=define
12117 set d_endnetent_r_proto endnetent_r $hdrs
12121 case "$d_endnetent_r_proto" in
12123 case "$endnetent_r_proto" in
12124 ''|0) try='int endnetent_r(struct netent_data*);'
12125 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12127 case "$endnetent_r_proto" in
12128 ''|0) try='void endnetent_r(struct netent_data*);'
12129 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12131 case "$endnetent_r_proto" in
12132 ''|0) d_endnetent_r=undef
12133 endnetent_r_proto=0
12134 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12135 * ) case "$endnetent_r_proto" in
12136 REENTRANT_PROTO*) ;;
12137 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12139 echo "Prototype: $try" ;;
12142 *) case "$usethreads" in
12143 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12145 d_endnetent_r=undef
12146 endnetent_r_proto=0
12150 *) endnetent_r_proto=0
12154 : see if endprotoent exists
12155 set endprotoent d_endpent
12158 : see if endprotoent_r exists
12159 set endprotoent_r d_endprotoent_r
12161 case "$d_endprotoent_r" in
12163 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12164 case "$d_endprotoent_r_proto:$usethreads" in
12165 ":define") d_endprotoent_r_proto=define
12166 set d_endprotoent_r_proto endprotoent_r $hdrs
12170 case "$d_endprotoent_r_proto" in
12172 case "$endprotoent_r_proto" in
12173 ''|0) try='int endprotoent_r(struct protoent_data*);'
12174 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12176 case "$endprotoent_r_proto" in
12177 ''|0) try='void endprotoent_r(struct protoent_data*);'
12178 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12180 case "$endprotoent_r_proto" in
12181 ''|0) d_endprotoent_r=undef
12182 endprotoent_r_proto=0
12183 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12184 * ) case "$endprotoent_r_proto" in
12185 REENTRANT_PROTO*) ;;
12186 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12188 echo "Prototype: $try" ;;
12191 *) case "$usethreads" in
12192 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12194 d_endprotoent_r=undef
12195 endprotoent_r_proto=0
12199 *) endprotoent_r_proto=0
12203 : see if endpwent exists
12204 set endpwent d_endpwent
12207 : see if this is a pwd.h system
12213 xxx=`./findhdr pwd.h`
12214 $cppstdin $cppflags $cppminus < $xxx >$$.h
12216 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12224 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12232 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12240 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12248 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12256 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12264 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12272 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12284 set d_pwquota; eval $setvar
12285 set d_pwage; eval $setvar
12286 set d_pwchange; eval $setvar
12287 set d_pwclass; eval $setvar
12288 set d_pwexpire; eval $setvar
12289 set d_pwcomment; eval $setvar
12290 set d_pwgecos; eval $setvar
12291 set d_pwpasswd; eval $setvar
12295 : see if endpwent_r exists
12296 set endpwent_r d_endpwent_r
12298 case "$d_endpwent_r" in
12300 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12301 case "$d_endpwent_r_proto:$usethreads" in
12302 ":define") d_endpwent_r_proto=define
12303 set d_endpwent_r_proto endpwent_r $hdrs
12307 case "$d_endpwent_r_proto" in
12309 case "$endpwent_r_proto" in
12310 ''|0) try='int endpwent_r(FILE**);'
12311 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12313 case "$endpwent_r_proto" in
12314 ''|0) try='void endpwent_r(FILE**);'
12315 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12317 case "$endpwent_r_proto" in
12318 ''|0) d_endpwent_r=undef
12320 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12321 * ) case "$endpwent_r_proto" in
12322 REENTRANT_PROTO*) ;;
12323 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12325 echo "Prototype: $try" ;;
12328 *) case "$usethreads" in
12329 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12336 *) endpwent_r_proto=0
12340 : see if endservent exists
12341 set endservent d_endsent
12344 : see if endservent_r exists
12345 set endservent_r d_endservent_r
12347 case "$d_endservent_r" in
12349 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12350 case "$d_endservent_r_proto:$usethreads" in
12351 ":define") d_endservent_r_proto=define
12352 set d_endservent_r_proto endservent_r $hdrs
12356 case "$d_endservent_r_proto" in
12358 case "$endservent_r_proto" in
12359 ''|0) try='int endservent_r(struct servent_data*);'
12360 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12362 case "$endservent_r_proto" in
12363 ''|0) try='void endservent_r(struct servent_data*);'
12364 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12366 case "$endservent_r_proto" in
12367 ''|0) d_endservent_r=undef
12368 endservent_r_proto=0
12369 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12370 * ) case "$endservent_r_proto" in
12371 REENTRANT_PROTO*) ;;
12372 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12374 echo "Prototype: $try" ;;
12377 *) case "$usethreads" in
12378 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12380 d_endservent_r=undef
12381 endservent_r_proto=0
12385 *) endservent_r_proto=0
12389 : Locate the flags for 'open()'
12392 #include <sys/types.h>
12397 #include <sys/file.h>
12399 #$i_stdlib I_STDLIB
12401 #include <stdlib.h>
12412 : check sys/file.h first to get FREAD on Sun
12413 if $test `./findhdr sys/file.h` && \
12414 set try -DI_SYS_FILE && eval $compile; then
12416 echo "<sys/file.h> defines the O_* constants..." >&4
12417 if $run ./try; then
12418 echo "and you have the 3 argument form of open()." >&4
12421 echo "but not the 3 argument form of open(). Oh, well." >&4
12424 elif $test `./findhdr fcntl.h` && \
12425 set try -DI_FCNTL && eval $compile; then
12427 echo "<fcntl.h> defines the O_* constants..." >&4
12428 if $run ./try; then
12429 echo "and you have the 3 argument form of open()." >&4
12432 echo "but not the 3 argument form of open(). Oh, well." >&4
12437 echo "I can't find the O_* constant definitions! You got problems." >&4
12443 : see if this is a sys/file.h system
12448 : do we need to include sys/file.h ?
12452 if $h_sysfile; then
12454 echo "We'll be including <sys/file.h>." >&4
12457 echo "We won't be including <sys/file.h>." >&4
12467 : see if fcntl.h is there
12472 : see if we can include fcntl.h
12478 echo "We'll be including <fcntl.h>." >&4
12481 if $h_sysfile; then
12482 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12484 echo "We won't be including <fcntl.h>." >&4
12496 : see if fork exists
12500 : see if pipe exists
12504 : check for non-blocking I/O stuff
12505 case "$h_sysfile" in
12506 true) echo "#include <sys/file.h>" > head.c;;
12509 true) echo "#include <fcntl.h>" > head.c;;
12510 *) echo "#include <sys/fcntl.h>" > head.c;;
12515 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12516 case "$o_nonblock" in
12518 $cat head.c > try.c
12519 $cat >>try.c <<EOCP
12521 #$i_stdlib I_STDLIB
12523 #include <stdlib.h>
12531 printf("O_NONBLOCK\n");
12535 printf("O_NDELAY\n");
12539 printf("FNDELAY\n");
12546 if eval $compile_ok; then
12547 o_nonblock=`$run ./try`
12548 case "$o_nonblock" in
12549 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12550 *) echo "Seems like we can use $o_nonblock.";;
12553 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12556 *) echo "Using $hint value $o_nonblock.";;
12561 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12564 case "$d_fork:$d_pipe" in
12566 $cat head.c > try.c
12567 $cat >>try.c <<EOCP
12569 #include <sys/types.h>
12570 #include <signal.h>
12572 #$i_stdlib I_STDLIB
12574 #include <stdlib.h>
12580 #define MY_O_NONBLOCK $o_nonblock
12581 #ifndef errno /* XXX need better Configure test */
12584 #$i_unistd I_UNISTD
12586 #include <unistd.h>
12588 #$i_string I_STRING
12590 #include <string.h>
12592 #include <strings.h>
12594 $signal_t blech(int x) { exit(3); }
12596 $cat >> try.c <<'EOCP'
12604 pipe(pd); /* Down: child -> parent */
12605 pipe(pu); /* Up: parent -> child */
12608 close(pd[1]); /* Parent reads from pd[0] */
12609 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12611 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12616 signal(SIGALRM, blech);
12618 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12620 sprintf(string, "%d\n", ret);
12621 write(2, string, strlen(string));
12624 if (errno == EAGAIN) {
12625 printf("EAGAIN\n");
12630 if (errno == EWOULDBLOCK)
12631 printf("EWOULDBLOCK\n");
12634 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12635 sleep(2); /* Give it time to close our pipe */
12637 ret = read(pd[0], buf, 1); /* Should read EOF */
12639 sprintf(string, "%d\n", ret);
12640 write(4, string, strlen(string));
12644 close(pd[0]); /* We write to pd[1] */
12645 close(pu[1]); /* We read from pu[0] */
12646 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12647 close(pd[1]); /* Pipe pd is now fully closed! */
12648 exit(0); /* Bye bye, thank you for playing! */
12652 if eval $compile_ok; then
12653 echo "$startsh" >mtry
12654 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12656 ./mtry >/dev/null 2>&1
12658 0) eagain=`$cat try.out`;;
12659 1) echo "Could not perform non-blocking setting!";;
12660 2) echo "I did a successful read() for something that was not there!";;
12661 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12662 4) echo "Could not find F_SETFL!";;
12663 *) echo "Something terribly wrong happened during testing.";;
12665 rd_nodata=`$cat try.ret`
12666 echo "A read() system call with no data present returns $rd_nodata."
12667 case "$rd_nodata" in
12670 echo "(That's peculiar, fixing that to be -1.)"
12676 echo "Forcing errno EAGAIN on read() with no data available."
12680 echo "Your read() sets errno to $eagain when no data is available."
12683 status=`$cat try.err`
12685 0) echo "And it correctly returns 0 to signal EOF.";;
12686 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12687 *) echo "However, your read() returns '$status' on EOF??";;
12690 if test "$status" = "$rd_nodata"; then
12691 echo "WARNING: you can't distinguish between EOF and no data!"
12695 echo "I can't compile the test program--assuming errno EAGAIN will do."
12699 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12708 echo "Using $hint value $eagain."
12709 echo "Your read() returns $rd_nodata when no data is present."
12710 case "$d_eofnblk" in
12711 "$define") echo "And you can see EOF because read() returns 0.";;
12712 "$undef") echo "But you can't see EOF status from read() returned value.";;
12714 echo "(Assuming you can't see EOF status from read anyway.)"
12720 $rm_try head.c mtry
12722 : see if _ptr and _cnt from stdio act std
12725 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12726 echo "(Looks like you have stdio.h from BSD.)"
12727 case "$stdio_ptr" in
12728 '') stdio_ptr='((fp)->_p)'
12731 *) ptr_lval=$d_stdio_ptr_lval;;
12733 case "$stdio_cnt" in
12734 '') stdio_cnt='((fp)->_r)'
12737 *) cnt_lval=$d_stdio_cnt_lval;;
12739 case "$stdio_base" in
12740 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12742 case "$stdio_bufsiz" in
12743 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12745 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12746 echo "(Looks like you have stdio.h from Linux.)"
12747 case "$stdio_ptr" in
12748 '') stdio_ptr='((fp)->_IO_read_ptr)'
12751 *) ptr_lval=$d_stdio_ptr_lval;;
12753 case "$stdio_cnt" in
12754 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12757 *) cnt_lval=$d_stdio_cnt_lval;;
12759 case "$stdio_base" in
12760 '') stdio_base='((fp)->_IO_read_base)';;
12762 case "$stdio_bufsiz" in
12763 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12766 case "$stdio_ptr" in
12767 '') stdio_ptr='((fp)->_ptr)'
12770 *) ptr_lval=$d_stdio_ptr_lval;;
12772 case "$stdio_cnt" in
12773 '') stdio_cnt='((fp)->_cnt)'
12776 *) cnt_lval=$d_stdio_cnt_lval;;
12778 case "$stdio_base" in
12779 '') stdio_base='((fp)->_base)';;
12781 case "$stdio_bufsiz" in
12782 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12786 : test whether _ptr and _cnt really work
12787 echo "Checking how std your stdio is..." >&4
12790 #$i_stdlib I_STDLIB
12792 #include <stdlib.h>
12794 #define FILE_ptr(fp) $stdio_ptr
12795 #define FILE_cnt(fp) $stdio_cnt
12797 FILE *fp = fopen("try.c", "r");
12800 18 <= FILE_cnt(fp) &&
12801 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12809 if eval $compile && $to try.c; then
12810 if $run ./try; then
12811 echo "Your stdio acts pretty std."
12814 echo "Your stdio isn't very std."
12817 echo "Your stdio doesn't appear very std."
12821 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12822 # direct buffer manipulation no longer works. The Configure tests
12823 # should be changed to correctly detect this, but until then,
12824 # the following check should at least let perl compile and run.
12825 # (This quick fix should be updated before 5.8.1.)
12826 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12827 # A. Dougherty, June 3, 2002.
12828 case "$d_gnulibc" in
12830 case "$gnulibc_version" in
12834 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12843 : Can _ptr be used as an lvalue?
12844 case "$d_stdstdio$ptr_lval" in
12845 $define$define) val=$define ;;
12848 set d_stdio_ptr_lval
12851 : Can _cnt be used as an lvalue?
12852 case "$d_stdstdio$cnt_lval" in
12853 $define$define) val=$define ;;
12856 set d_stdio_cnt_lval
12860 : test whether setting _ptr sets _cnt as a side effect
12861 d_stdio_ptr_lval_sets_cnt="$undef"
12862 d_stdio_ptr_lval_nochange_cnt="$undef"
12863 case "$d_stdio_ptr_lval$d_stdstdio" in
12865 echo "Checking to see what happens if we set the stdio ptr..." >&4
12868 /* Can we scream? */
12869 /* Eat dust sed :-) */
12870 /* In the buffer space, no one can hear you scream. */
12871 #$i_stdlib I_STDLIB
12873 #include <stdlib.h>
12875 #define FILE_ptr(fp) $stdio_ptr
12876 #define FILE_cnt(fp) $stdio_cnt
12877 #include <sys/types.h>
12879 FILE *fp = fopen("try.c", "r");
12884 puts("Fail even to read");
12887 c = getc(fp); /* Read away the first # */
12889 puts("Fail even to read");
12893 18 <= FILE_cnt(fp) &&
12894 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12896 puts("Fail even to read");
12899 ptr = (char*) FILE_ptr(fp);
12900 cnt = (size_t)FILE_cnt(fp);
12902 FILE_ptr(fp) += 42;
12904 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12905 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12908 if (FILE_cnt(fp) <= 20) {
12909 printf ("Fail (<20 chars to test)");
12912 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12913 puts("Fail compare");
12916 if (cnt == FILE_cnt(fp)) {
12917 puts("Pass_unchanged");
12920 if (FILE_cnt(fp) == (cnt - 42)) {
12921 puts("Pass_changed");
12924 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12930 if eval $compile && $to try.c; then
12931 case `$run ./try` in
12933 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12934 d_stdio_ptr_lval_sets_cnt="$define" ;;
12936 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12937 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12939 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12941 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12944 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12950 : see if _base is also standard
12952 case "$d_stdstdio" in
12956 #$i_stdlib I_STDLIB
12958 #include <stdlib.h>
12960 #define FILE_base(fp) $stdio_base
12961 #define FILE_bufsiz(fp) $stdio_bufsiz
12963 FILE *fp = fopen("try.c", "r");
12966 19 <= FILE_bufsiz(fp) &&
12967 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12974 if eval $compile && $to try.c; then
12975 if $run ./try; then
12976 echo "And its _base field acts std."
12979 echo "But its _base field isn't std."
12982 echo "However, it seems to be lacking the _base field."
12990 : see if fast_stdio exists
12992 case "$d_stdstdio:$d_stdio_ptr_lval" in
12994 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12996 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13007 : see if fchdir exists
13008 set fchdir d_fchdir
13011 : see if fchmod exists
13012 set fchmod d_fchmod
13015 : see if fchown exists
13016 set fchown d_fchown
13019 : see if this is an fcntl system
13023 : See if fcntl-based locking works.
13026 #$i_stdlib I_STDLIB
13028 #include <stdlib.h>
13030 #include <unistd.h>
13032 #include <signal.h>
13033 $signal_t blech(int x) { exit(3); }
13035 #if defined(F_SETLK) && defined(F_SETLKW)
13036 struct flock flock;
13038 fd = open("try.c", O_RDONLY);
13039 flock.l_type = F_RDLCK;
13040 flock.l_whence = SEEK_SET;
13041 flock.l_start = flock.l_len = 0;
13042 signal(SIGALRM, blech);
13044 retval = fcntl(fd, F_SETLK, &flock);
13046 (retval < 0 ? exit(2) : exit(0));
13052 echo "Checking if fcntl-based file locking works... "
13056 if eval $compile_ok; then
13057 if $run ./try; then
13058 echo "Yes, it seems to work."
13061 echo "Nope, it didn't work."
13066 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13067 *** This is (almost) impossible.
13068 *** If your NFS lock daemons are not feeling well, something like
13069 *** this may happen, please investigate. Cannot continue, aborting.
13077 echo "I'm unable to compile the test program, so I'll assume not."
13082 echo "Nope, since you don't even have fcntl()."
13085 set d_fcntl_can_lock
13089 : check for fd_set items
13092 Checking to see how well your C compiler handles fd_set and friends ...
13095 #$i_stdlib I_STDLIB
13097 #include <stdlib.h>
13099 #$i_systime I_SYS_TIME
13100 #$i_sysselct I_SYS_SELECT
13101 #$d_socket HAS_SOCKET
13102 #include <sys/types.h>
13104 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13107 #include <sys/time.h>
13109 #ifdef I_SYS_SELECT
13110 #include <sys/select.h>
13119 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13127 if eval $compile; then
13128 d_fds_bits="$define"
13130 echo "Well, your system knows about the normal fd_set typedef..." >&4
13131 if $run ./try; then
13132 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13133 d_fd_macros="$define"
13136 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13138 d_fd_macros="$undef"
13142 Hmm, your compiler has some difficulty with fd_set. Checking further...
13145 if eval $compile; then
13146 d_fds_bits="$undef"
13148 echo "Well, your system has some sort of fd_set available..." >&4
13149 if $run ./try; then
13150 echo "and you have the normal fd_set macros." >&4
13151 d_fd_macros="$define"
13154 but not the normal fd_set macros! Gross! More work for me...
13156 d_fd_macros="$undef"
13159 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13161 d_fds_bits="$undef"
13162 d_fd_macros="$undef"
13167 : see if fgetpos exists
13168 set fgetpos d_fgetpos
13171 : see if finite exists
13172 set finite d_finite
13175 : see if finitel exists
13176 set finitel d_finitel
13179 : see if flock exists
13183 : see if prototype for flock is available
13185 set d_flockproto flock $i_sysfile sys/file.h
13188 : see if fp_class exists
13189 set fp_class d_fp_class
13192 : see if pathconf exists
13193 set pathconf d_pathconf
13196 : see if fpathconf exists
13197 set fpathconf d_fpathconf
13200 : see if fpclass exists
13201 set fpclass d_fpclass
13204 : see if fpclassify exists
13205 set fpclassify d_fpclassify
13208 : see if fpclassl exists
13209 set fpclassl d_fpclassl
13212 : check for fpos64_t
13214 echo "Checking to see if you have fpos64_t..." >&4
13217 int main() { fpos64_t x = 7; }
13220 if eval $compile; then
13222 echo "You have fpos64_t."
13225 echo "You do not have fpos64_t."
13226 case "$fpossize" in
13227 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13234 : see if frexpl exists
13235 set frexpl d_frexpl
13238 : see if this is a sys/param system
13239 set sys/param.h i_sysparam
13242 : see if this is a sys/mount.h system
13243 set sys/mount.h i_sysmount
13246 : Check for fs_data_s
13248 echo "Checking to see if your system supports struct fs_data..." >&4
13249 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13251 case "$d_fs_data_s" in
13252 "$define") echo "Yes, it does." ;;
13253 *) echo "No, it doesn't." ;;
13256 : see if fseeko exists
13257 set fseeko d_fseeko
13259 case "$longsize" in
13260 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13263 : see if fsetpos exists
13264 set fsetpos d_fsetpos
13267 : see if fstatfs exists
13268 set fstatfs d_fstatfs
13271 : see if statvfs exists
13272 set statvfs d_statvfs
13275 : see if fstatvfs exists
13276 set fstatvfs d_fstatvfs
13280 : see if fsync exists
13284 : see if ftello exists
13285 set ftello d_ftello
13287 case "$longsize" in
13288 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13291 : check for a working futimes
13294 echo "Checking if you have a working futimes()" >&4
13297 #include <sys/time.h>
13304 fd = open ("try.c", O_RDWR);
13305 if (-1 == fd) exit (1);
13306 rv = futimes (fd, NULL);
13307 exit (rv == -1 ? errno : 0);
13311 if eval $compile; then
13315 0) echo "Yes, you have" >&4
13316 d_futimes="$define"
13318 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13322 echo "No, it does not (probably harmless)" >&4
13326 : see if ndbm.h is available
13329 : Compatibility location for RedHat 7.1
13330 set gdbm/ndbm.h i_gdbmndbm
13332 : Compatibility location for Debian 4.0
13333 set gdbm-ndbm.h i_gdbm_ndbm
13337 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13338 : see if dbm_open exists
13339 set dbm_open d_dbm_open
13341 case "$d_dbm_open" in
13344 i_gdbmndbm="$undef"
13345 i_gdbm_ndbm="$undef"
13346 echo "We won't be including <ndbm.h>"
13356 ndbm_hdr_protochk='name=$1; hdr=$2;
13357 eval "ihdr=\$""i_$name";
13359 if $test "$ihdr" = "$define"; then
13360 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13361 case "$d_cplusplus" in
13362 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13363 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13366 $define) $echo "Your <$hdr> seems to have prototypes";;
13367 *) $echo "Your <$hdr> does not seem to have prototypes";;
13370 set "d_${name}_h_uses_prototypes";
13374 eval $ndbm_hdr_protochk
13375 set gdbmndbm gdbm/ndbm.h
13376 eval $ndbm_hdr_protochk
13377 set gdbm_ndbm gdbm-ndbm.h
13378 eval $ndbm_hdr_protochk
13380 : see if getcwd exists
13381 set getcwd d_getcwd
13384 : see if getespwnam exists
13385 set getespwnam d_getespwnam
13388 : see if getfsstat exists
13389 set getfsstat d_getfsstat
13392 : see if getgrent exists
13393 set getgrent d_getgrent
13396 : see if getgrent_r exists
13397 set getgrent_r d_getgrent_r
13399 case "$d_getgrent_r" in
13401 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13402 case "$d_getgrent_r_proto:$usethreads" in
13403 ":define") d_getgrent_r_proto=define
13404 set d_getgrent_r_proto getgrent_r $hdrs
13408 case "$d_getgrent_r_proto" in
13410 case "$getgrent_r_proto" in
13411 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13412 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13414 case "$getgrent_r_proto" in
13415 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13416 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13418 case "$getgrent_r_proto" in
13419 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13420 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13422 case "$getgrent_r_proto" in
13423 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13424 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13426 case "$getgrent_r_proto" in
13427 ''|0) try='int getgrent_r(struct group*, char*, int);'
13428 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13430 case "$getgrent_r_proto" in
13431 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13432 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13434 case "$getgrent_r_proto" in
13435 ''|0) d_getgrent_r=undef
13437 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13438 * ) case "$getgrent_r_proto" in
13439 REENTRANT_PROTO*) ;;
13440 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13442 echo "Prototype: $try" ;;
13445 *) case "$usethreads" in
13446 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13453 *) getgrent_r_proto=0
13457 : see if getgrgid_r exists
13458 set getgrgid_r d_getgrgid_r
13460 case "$d_getgrgid_r" in
13462 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13463 case "$d_getgrgid_r_proto:$usethreads" in
13464 ":define") d_getgrgid_r_proto=define
13465 set d_getgrgid_r_proto getgrgid_r $hdrs
13469 case "$d_getgrgid_r_proto" in
13471 case "$getgrgid_r_proto" in
13472 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13473 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13475 case "$getgrgid_r_proto" in
13476 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13477 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13479 case "$getgrgid_r_proto" in
13480 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13481 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13483 case "$getgrgid_r_proto" in
13484 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13485 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13487 case "$getgrgid_r_proto" in
13488 ''|0) d_getgrgid_r=undef
13490 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13491 * ) case "$getgrgid_r_proto" in
13492 REENTRANT_PROTO*) ;;
13493 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13495 echo "Prototype: $try" ;;
13498 *) case "$usethreads" in
13499 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13506 *) getgrgid_r_proto=0
13510 : see if getgrnam_r exists
13511 set getgrnam_r d_getgrnam_r
13513 case "$d_getgrnam_r" in
13515 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13516 case "$d_getgrnam_r_proto:$usethreads" in
13517 ":define") d_getgrnam_r_proto=define
13518 set d_getgrnam_r_proto getgrnam_r $hdrs
13522 case "$d_getgrnam_r_proto" in
13524 case "$getgrnam_r_proto" in
13525 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13526 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13528 case "$getgrnam_r_proto" in
13529 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13530 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13532 case "$getgrnam_r_proto" in
13533 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13534 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13536 case "$getgrnam_r_proto" in
13537 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13538 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13540 case "$getgrnam_r_proto" in
13541 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13542 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13544 case "$getgrnam_r_proto" in
13545 ''|0) d_getgrnam_r=undef
13547 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13548 * ) case "$getgrnam_r_proto" in
13549 REENTRANT_PROTO*) ;;
13550 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13552 echo "Prototype: $try" ;;
13555 *) case "$usethreads" in
13556 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13563 *) getgrnam_r_proto=0
13567 : see if gethostbyaddr exists
13568 set gethostbyaddr d_gethbyaddr
13571 : see if gethostbyname exists
13572 set gethostbyname d_gethbyname
13575 : see if gethostent exists
13576 set gethostent d_gethent
13579 : see how we will look up host name
13582 if set gethostname val -f d_gethname; eval $csym; $val; then
13583 echo 'gethostname() found.' >&4
13584 d_gethname="$define"
13587 if set uname val -f d_uname; eval $csym; $val; then
13590 uname() was found, but you're running xenix, and older versions of xenix
13591 have a broken uname(). If you don't really know whether your xenix is old
13592 enough to have a broken system call, use the default answer.
13597 "$define") dflt=n;;
13599 rp='Is your uname() broken?'
13602 n*) d_uname="$define"; call=uname;;
13605 echo 'uname() found.' >&4
13612 case "$d_gethname" in
13613 '') d_gethname="$undef";;
13616 '') d_uname="$undef";;
13618 case "$d_uname$d_gethname" in
13623 Every now and then someone has a $call() that lies about the hostname
13624 but can't be fixed for political or economic reasons. If you wish, I can
13625 pretend $call() isn't there and maybe compute hostname at run-time
13626 thanks to the '$phostname' command.
13629 rp="Shall I ignore $call() from now on?"
13632 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13635 case "$phostname" in
13636 '') aphostname='';;
13637 *) case "$aphostname" in
13639 *) set X $phostname
13643 file=`./loc $file $file $pth`
13644 aphostname=`echo $file $*`
13649 case "$d_uname$d_gethname" in
13652 case "$phostname" in
13654 echo "There will be no way for $package to get your hostname." >&4;;
13656 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13660 case "$d_phostname" in
13661 '') d_phostname="$undef";;
13664 : see if gethostbyaddr_r exists
13665 set gethostbyaddr_r d_gethostbyaddr_r
13667 case "$d_gethostbyaddr_r" in
13669 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13670 case "$d_gethostbyaddr_r_proto:$usethreads" in
13671 ":define") d_gethostbyaddr_r_proto=define
13672 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13676 case "$d_gethostbyaddr_r_proto" in
13678 case "$gethostbyaddr_r_proto" in
13679 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13680 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13682 case "$gethostbyaddr_r_proto" in
13683 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13684 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13686 case "$gethostbyaddr_r_proto" in
13687 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13688 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13690 case "$gethostbyaddr_r_proto" in
13691 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13692 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13694 case "$gethostbyaddr_r_proto" in
13695 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13696 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13698 case "$gethostbyaddr_r_proto" in
13699 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13700 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13702 case "$gethostbyaddr_r_proto" in
13703 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13704 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13706 case "$gethostbyaddr_r_proto" in
13707 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13708 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13710 case "$gethostbyaddr_r_proto" in
13711 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13712 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13714 case "$gethostbyaddr_r_proto" in
13715 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13716 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13718 case "$gethostbyaddr_r_proto" in
13719 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13720 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13722 case "$gethostbyaddr_r_proto" in
13723 ''|0) d_gethostbyaddr_r=undef
13724 gethostbyaddr_r_proto=0
13725 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13726 * ) case "$gethostbyaddr_r_proto" in
13727 REENTRANT_PROTO*) ;;
13728 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13730 echo "Prototype: $try" ;;
13733 *) case "$usethreads" in
13734 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13736 d_gethostbyaddr_r=undef
13737 gethostbyaddr_r_proto=0
13741 *) gethostbyaddr_r_proto=0
13745 : see if gethostbyname_r exists
13746 set gethostbyname_r d_gethostbyname_r
13748 case "$d_gethostbyname_r" in
13750 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13751 case "$d_gethostbyname_r_proto:$usethreads" in
13752 ":define") d_gethostbyname_r_proto=define
13753 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13757 case "$d_gethostbyname_r_proto" in
13759 case "$gethostbyname_r_proto" in
13760 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13761 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13763 case "$gethostbyname_r_proto" in
13764 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13765 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13767 case "$gethostbyname_r_proto" in
13768 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13769 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13771 case "$gethostbyname_r_proto" in
13772 ''|0) d_gethostbyname_r=undef
13773 gethostbyname_r_proto=0
13774 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13775 * ) case "$gethostbyname_r_proto" in
13776 REENTRANT_PROTO*) ;;
13777 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13779 echo "Prototype: $try" ;;
13782 *) case "$usethreads" in
13783 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13785 d_gethostbyname_r=undef
13786 gethostbyname_r_proto=0
13790 *) gethostbyname_r_proto=0
13794 : see if gethostent_r exists
13795 set gethostent_r d_gethostent_r
13797 case "$d_gethostent_r" in
13799 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13800 case "$d_gethostent_r_proto:$usethreads" in
13801 ":define") d_gethostent_r_proto=define
13802 set d_gethostent_r_proto gethostent_r $hdrs
13806 case "$d_gethostent_r_proto" in
13808 case "$gethostent_r_proto" in
13809 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13810 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13812 case "$gethostent_r_proto" in
13813 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13814 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13816 case "$gethostent_r_proto" in
13817 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13818 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13820 case "$gethostent_r_proto" in
13821 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13822 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
13824 case "$gethostent_r_proto" in
13825 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13826 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
13828 case "$gethostent_r_proto" in
13829 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13830 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
13832 case "$gethostent_r_proto" in
13833 ''|0) d_gethostent_r=undef
13834 gethostent_r_proto=0
13835 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13836 * ) case "$gethostent_r_proto" in
13837 REENTRANT_PROTO*) ;;
13838 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13840 echo "Prototype: $try" ;;
13843 *) case "$usethreads" in
13844 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13846 d_gethostent_r=undef
13847 gethostent_r_proto=0
13851 *) gethostent_r_proto=0
13855 : see if prototypes for various gethostxxx netdb.h functions are available
13857 set d_gethostprotos gethostent $i_netdb netdb.h
13860 : see if getitimer exists
13861 set getitimer d_getitimer
13864 : see if getlogin exists
13865 set getlogin d_getlogin
13868 : see if getlogin_r exists
13869 set getlogin_r d_getlogin_r
13871 case "$d_getlogin_r" in
13873 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13874 case "$d_getlogin_r_proto:$usethreads" in
13875 ":define") d_getlogin_r_proto=define
13876 set d_getlogin_r_proto getlogin_r $hdrs
13880 case "$d_getlogin_r_proto" in
13882 case "$getlogin_r_proto" in
13883 ''|0) try='int getlogin_r(char*, size_t);'
13884 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
13886 case "$getlogin_r_proto" in
13887 ''|0) try='int getlogin_r(char*, int);'
13888 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
13890 case "$getlogin_r_proto" in
13891 ''|0) try='char* getlogin_r(char*, size_t);'
13892 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
13894 case "$getlogin_r_proto" in
13895 ''|0) try='char* getlogin_r(char*, int);'
13896 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
13898 case "$getlogin_r_proto" in
13899 ''|0) d_getlogin_r=undef
13901 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13902 * ) case "$getlogin_r_proto" in
13903 REENTRANT_PROTO*) ;;
13904 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13906 echo "Prototype: $try" ;;
13909 *) case "$usethreads" in
13910 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13917 *) getlogin_r_proto=0
13921 : see if getmnt exists
13922 set getmnt d_getmnt
13925 : see if getmntent exists
13926 set getmntent d_getmntent
13929 : see if getnetbyaddr exists
13930 set getnetbyaddr d_getnbyaddr
13933 : see if getnetbyname exists
13934 set getnetbyname d_getnbyname
13937 : see if getnetent exists
13938 set getnetent d_getnent
13941 : see if getnetbyaddr_r exists
13942 set getnetbyaddr_r d_getnetbyaddr_r
13944 case "$d_getnetbyaddr_r" in
13946 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13947 case "$d_getnetbyaddr_r_proto:$usethreads" in
13948 ":define") d_getnetbyaddr_r_proto=define
13949 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13953 case "$d_getnetbyaddr_r_proto" in
13955 case "$getnetbyaddr_r_proto" in
13956 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13957 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13959 case "$getnetbyaddr_r_proto" in
13960 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13961 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13963 case "$getnetbyaddr_r_proto" in
13964 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13965 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13967 case "$getnetbyaddr_r_proto" in
13968 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13969 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13971 case "$getnetbyaddr_r_proto" in
13972 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13973 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13975 case "$getnetbyaddr_r_proto" in
13976 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13977 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13979 case "$getnetbyaddr_r_proto" in
13980 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13981 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13983 case "$getnetbyaddr_r_proto" in
13984 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13985 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13987 case "$getnetbyaddr_r_proto" in
13988 ''|0) d_getnetbyaddr_r=undef
13989 getnetbyaddr_r_proto=0
13990 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13991 * ) case "$getnetbyaddr_r_proto" in
13992 REENTRANT_PROTO*) ;;
13993 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13995 echo "Prototype: $try" ;;
13998 *) case "$usethreads" in
13999 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14001 d_getnetbyaddr_r=undef
14002 getnetbyaddr_r_proto=0
14006 *) getnetbyaddr_r_proto=0
14010 : see if getnetbyname_r exists
14011 set getnetbyname_r d_getnetbyname_r
14013 case "$d_getnetbyname_r" in
14015 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14016 case "$d_getnetbyname_r_proto:$usethreads" in
14017 ":define") d_getnetbyname_r_proto=define
14018 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14022 case "$d_getnetbyname_r_proto" in
14024 case "$getnetbyname_r_proto" in
14025 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14026 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14028 case "$getnetbyname_r_proto" in
14029 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14030 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14032 case "$getnetbyname_r_proto" in
14033 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14034 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14036 case "$getnetbyname_r_proto" in
14037 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14038 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14040 case "$getnetbyname_r_proto" in
14041 ''|0) d_getnetbyname_r=undef
14042 getnetbyname_r_proto=0
14043 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14044 * ) case "$getnetbyname_r_proto" in
14045 REENTRANT_PROTO*) ;;
14046 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14048 echo "Prototype: $try" ;;
14051 *) case "$usethreads" in
14052 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14054 d_getnetbyname_r=undef
14055 getnetbyname_r_proto=0
14059 *) getnetbyname_r_proto=0
14063 : see if getnetent_r exists
14064 set getnetent_r d_getnetent_r
14066 case "$d_getnetent_r" in
14068 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14069 case "$d_getnetent_r_proto:$usethreads" in
14070 ":define") d_getnetent_r_proto=define
14071 set d_getnetent_r_proto getnetent_r $hdrs
14075 case "$d_getnetent_r_proto" in
14077 case "$getnetent_r_proto" in
14078 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14079 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14081 case "$getnetent_r_proto" in
14082 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14083 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14085 case "$getnetent_r_proto" in
14086 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14087 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14089 case "$getnetent_r_proto" in
14090 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14091 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14093 case "$getnetent_r_proto" in
14094 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14095 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14097 case "$getnetent_r_proto" in
14098 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14099 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14101 case "$getnetent_r_proto" in
14102 ''|0) d_getnetent_r=undef
14103 getnetent_r_proto=0
14104 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14105 * ) case "$getnetent_r_proto" in
14106 REENTRANT_PROTO*) ;;
14107 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14109 echo "Prototype: $try" ;;
14112 *) case "$usethreads" in
14113 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14115 d_getnetent_r=undef
14116 getnetent_r_proto=0
14120 *) getnetent_r_proto=0
14124 : see if prototypes for various getnetxxx netdb.h functions are available
14126 set d_getnetprotos getnetent $i_netdb netdb.h
14129 : see if getpagesize exists
14130 set getpagesize d_getpagsz
14133 : Optional checks for getprotobyname and getprotobynumber
14135 : see if getprotobyname exists
14136 set getprotobyname d_getpbyname
14139 : see if getprotobynumber exists
14140 set getprotobynumber d_getpbynumber
14143 : see if getprotoent exists
14144 set getprotoent d_getpent
14147 : see if getpgid exists
14148 set getpgid d_getpgid
14151 : see if getpgrp2 exists
14152 set getpgrp2 d_getpgrp2
14155 : see if getppid exists
14156 set getppid d_getppid
14159 : see if getpriority exists
14160 set getpriority d_getprior
14163 : see if getprotobyname_r exists
14164 set getprotobyname_r d_getprotobyname_r
14166 case "$d_getprotobyname_r" in
14168 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14169 case "$d_getprotobyname_r_proto:$usethreads" in
14170 ":define") d_getprotobyname_r_proto=define
14171 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14175 case "$d_getprotobyname_r_proto" in
14177 case "$getprotobyname_r_proto" in
14178 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14179 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14181 case "$getprotobyname_r_proto" in
14182 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14183 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14185 case "$getprotobyname_r_proto" in
14186 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14187 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14189 case "$getprotobyname_r_proto" in
14190 ''|0) d_getprotobyname_r=undef
14191 getprotobyname_r_proto=0
14192 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14193 * ) case "$getprotobyname_r_proto" in
14194 REENTRANT_PROTO*) ;;
14195 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14197 echo "Prototype: $try" ;;
14200 *) case "$usethreads" in
14201 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14203 d_getprotobyname_r=undef
14204 getprotobyname_r_proto=0
14208 *) getprotobyname_r_proto=0
14212 : see if getprotobynumber_r exists
14213 set getprotobynumber_r d_getprotobynumber_r
14215 case "$d_getprotobynumber_r" in
14217 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14218 case "$d_getprotobynumber_r_proto:$usethreads" in
14219 ":define") d_getprotobynumber_r_proto=define
14220 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14224 case "$d_getprotobynumber_r_proto" in
14226 case "$getprotobynumber_r_proto" in
14227 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14228 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14230 case "$getprotobynumber_r_proto" in
14231 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14232 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14234 case "$getprotobynumber_r_proto" in
14235 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14236 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14238 case "$getprotobynumber_r_proto" in
14239 ''|0) d_getprotobynumber_r=undef
14240 getprotobynumber_r_proto=0
14241 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14242 * ) case "$getprotobynumber_r_proto" in
14243 REENTRANT_PROTO*) ;;
14244 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14246 echo "Prototype: $try" ;;
14249 *) case "$usethreads" in
14250 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14252 d_getprotobynumber_r=undef
14253 getprotobynumber_r_proto=0
14257 *) getprotobynumber_r_proto=0
14261 : see if getprotoent_r exists
14262 set getprotoent_r d_getprotoent_r
14264 case "$d_getprotoent_r" in
14266 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14267 case "$d_getprotoent_r_proto:$usethreads" in
14268 ":define") d_getprotoent_r_proto=define
14269 set d_getprotoent_r_proto getprotoent_r $hdrs
14273 case "$d_getprotoent_r_proto" in
14275 case "$getprotoent_r_proto" in
14276 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14277 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14279 case "$getprotoent_r_proto" in
14280 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14281 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14283 case "$getprotoent_r_proto" in
14284 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14285 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14287 case "$getprotoent_r_proto" in
14288 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14289 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14291 case "$getprotoent_r_proto" in
14292 ''|0) d_getprotoent_r=undef
14293 getprotoent_r_proto=0
14294 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14295 * ) case "$getprotoent_r_proto" in
14296 REENTRANT_PROTO*) ;;
14297 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14299 echo "Prototype: $try" ;;
14302 *) case "$usethreads" in
14303 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14305 d_getprotoent_r=undef
14306 getprotoent_r_proto=0
14310 *) getprotoent_r_proto=0
14314 : see if prototypes for various getprotoxxx netdb.h functions are available
14316 set d_getprotoprotos getprotoent $i_netdb netdb.h
14319 : see if getprpwnam exists
14320 set getprpwnam d_getprpwnam
14323 : see if getpwent exists
14324 set getpwent d_getpwent
14327 : see if getpwent_r exists
14328 set getpwent_r d_getpwent_r
14330 case "$d_getpwent_r" in
14332 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14333 case "$d_getpwent_r_proto:$usethreads" in
14334 ":define") d_getpwent_r_proto=define
14335 set d_getpwent_r_proto getpwent_r $hdrs
14339 case "$d_getpwent_r_proto" in
14341 case "$getpwent_r_proto" in
14342 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14343 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14345 case "$getpwent_r_proto" in
14346 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14347 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14349 case "$getpwent_r_proto" in
14350 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14351 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14353 case "$getpwent_r_proto" in
14354 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14355 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14357 case "$getpwent_r_proto" in
14358 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14359 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14361 case "$getpwent_r_proto" in
14362 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14363 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14365 case "$getpwent_r_proto" in
14366 ''|0) d_getpwent_r=undef
14368 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14369 * ) case "$getpwent_r_proto" in
14370 REENTRANT_PROTO*) ;;
14371 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14373 echo "Prototype: $try" ;;
14376 *) case "$usethreads" in
14377 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14384 *) getpwent_r_proto=0
14388 : see if getpwnam_r exists
14389 set getpwnam_r d_getpwnam_r
14391 case "$d_getpwnam_r" in
14393 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14394 case "$d_getpwnam_r_proto:$usethreads" in
14395 ":define") d_getpwnam_r_proto=define
14396 set d_getpwnam_r_proto getpwnam_r $hdrs
14400 case "$d_getpwnam_r_proto" in
14402 case "$getpwnam_r_proto" in
14403 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14404 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14406 case "$getpwnam_r_proto" in
14407 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14408 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14410 case "$getpwnam_r_proto" in
14411 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14412 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14414 case "$getpwnam_r_proto" in
14415 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14416 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14418 case "$getpwnam_r_proto" in
14419 ''|0) d_getpwnam_r=undef
14421 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14422 * ) case "$getpwnam_r_proto" in
14423 REENTRANT_PROTO*) ;;
14424 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14426 echo "Prototype: $try" ;;
14429 *) case "$usethreads" in
14430 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14437 *) getpwnam_r_proto=0
14441 : see if getpwuid_r exists
14442 set getpwuid_r d_getpwuid_r
14444 case "$d_getpwuid_r" in
14446 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14447 case "$d_getpwuid_r_proto:$usethreads" in
14448 ":define") d_getpwuid_r_proto=define
14449 set d_getpwuid_r_proto getpwuid_r $hdrs
14453 case "$d_getpwuid_r_proto" in
14455 case "$getpwuid_r_proto" in
14456 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14457 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14459 case "$getpwuid_r_proto" in
14460 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14461 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14463 case "$getpwuid_r_proto" in
14464 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14465 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14467 case "$getpwuid_r_proto" in
14468 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14469 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14471 case "$getpwuid_r_proto" in
14472 ''|0) d_getpwuid_r=undef
14474 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14475 * ) case "$getpwuid_r_proto" in
14476 REENTRANT_PROTO*) ;;
14477 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14479 echo "Prototype: $try" ;;
14482 *) case "$usethreads" in
14483 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14490 *) getpwuid_r_proto=0
14494 : Optional checks for getsbyname and getsbyport
14496 : see if getservbyname exists
14497 set getservbyname d_getsbyname
14500 : see if getservbyport exists
14501 set getservbyport d_getsbyport
14504 : see if getservent exists
14505 set getservent d_getsent
14508 : see if getservbyname_r exists
14509 set getservbyname_r d_getservbyname_r
14511 case "$d_getservbyname_r" in
14513 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14514 case "$d_getservbyname_r_proto:$usethreads" in
14515 ":define") d_getservbyname_r_proto=define
14516 set d_getservbyname_r_proto getservbyname_r $hdrs
14520 case "$d_getservbyname_r_proto" in
14522 case "$getservbyname_r_proto" in
14523 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14524 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14526 case "$getservbyname_r_proto" in
14527 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14528 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14530 case "$getservbyname_r_proto" in
14531 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14532 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14534 case "$getservbyname_r_proto" in
14535 ''|0) d_getservbyname_r=undef
14536 getservbyname_r_proto=0
14537 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14538 * ) case "$getservbyname_r_proto" in
14539 REENTRANT_PROTO*) ;;
14540 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14542 echo "Prototype: $try" ;;
14545 *) case "$usethreads" in
14546 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14548 d_getservbyname_r=undef
14549 getservbyname_r_proto=0
14553 *) getservbyname_r_proto=0
14557 : see if getservbyport_r exists
14558 set getservbyport_r d_getservbyport_r
14560 case "$d_getservbyport_r" in
14562 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14563 case "$d_getservbyport_r_proto:$usethreads" in
14564 ":define") d_getservbyport_r_proto=define
14565 set d_getservbyport_r_proto getservbyport_r $hdrs
14569 case "$d_getservbyport_r_proto" in
14571 case "$getservbyport_r_proto" in
14572 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14573 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14575 case "$getservbyport_r_proto" in
14576 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14577 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14579 case "$getservbyport_r_proto" in
14580 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14581 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14583 case "$getservbyport_r_proto" in
14584 ''|0) d_getservbyport_r=undef
14585 getservbyport_r_proto=0
14586 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14587 * ) case "$getservbyport_r_proto" in
14588 REENTRANT_PROTO*) ;;
14589 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14591 echo "Prototype: $try" ;;
14594 *) case "$usethreads" in
14595 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14597 d_getservbyport_r=undef
14598 getservbyport_r_proto=0
14602 *) getservbyport_r_proto=0
14606 : see if getservent_r exists
14607 set getservent_r d_getservent_r
14609 case "$d_getservent_r" in
14611 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14612 case "$d_getservent_r_proto:$usethreads" in
14613 ":define") d_getservent_r_proto=define
14614 set d_getservent_r_proto getservent_r $hdrs
14618 case "$d_getservent_r_proto" in
14620 case "$getservent_r_proto" in
14621 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14622 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14624 case "$getservent_r_proto" in
14625 ''|0) try='int getservent_r(struct servent*, char*, int);'
14626 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14628 case "$getservent_r_proto" in
14629 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14630 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14632 case "$getservent_r_proto" in
14633 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14634 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14636 case "$getservent_r_proto" in
14637 ''|0) d_getservent_r=undef
14638 getservent_r_proto=0
14639 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14640 * ) case "$getservent_r_proto" in
14641 REENTRANT_PROTO*) ;;
14642 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14644 echo "Prototype: $try" ;;
14647 *) case "$usethreads" in
14648 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14650 d_getservent_r=undef
14651 getservent_r_proto=0
14655 *) getservent_r_proto=0
14659 : see if prototypes for various getservxxx netdb.h functions are available
14661 set d_getservprotos getservent $i_netdb netdb.h
14664 : see if getspnam exists
14665 set getspnam d_getspnam
14668 : see if this is a shadow.h system
14669 set shadow.h i_shadow
14672 : see if getspnam_r exists
14673 set getspnam_r d_getspnam_r
14675 case "$d_getspnam_r" in
14677 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14678 case "$d_getspnam_r_proto:$usethreads" in
14679 ":define") d_getspnam_r_proto=define
14680 set d_getspnam_r_proto getspnam_r $hdrs
14684 case "$d_getspnam_r_proto" in
14686 case "$getspnam_r_proto" in
14687 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14688 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14690 case "$getspnam_r_proto" in
14691 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14692 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14694 case "$getspnam_r_proto" in
14695 ''|0) d_getspnam_r=undef
14697 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14698 * ) case "$getspnam_r_proto" in
14699 REENTRANT_PROTO*) ;;
14700 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14702 echo "Prototype: $try" ;;
14705 *) case "$usethreads" in
14706 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14713 *) getspnam_r_proto=0
14717 : see if gettimeofday or ftime exists
14718 set gettimeofday d_gettimeod
14720 case "$d_gettimeod" in
14726 val="$undef"; set d_ftime; eval $setvar
14729 case "$d_gettimeod$d_ftime" in
14732 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14736 : see if gmtime_r exists
14737 set gmtime_r d_gmtime_r
14739 case "$d_gmtime_r" in
14741 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14742 case "$d_gmtime_r_proto:$usethreads" in
14743 ":define") d_gmtime_r_proto=define
14744 set d_gmtime_r_proto gmtime_r $hdrs
14748 case "$d_gmtime_r_proto" in
14750 case "$gmtime_r_proto" in
14751 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14752 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
14754 case "$gmtime_r_proto" in
14755 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14756 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
14758 case "$gmtime_r_proto" in
14759 ''|0) d_gmtime_r=undef
14761 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14762 * ) case "$gmtime_r_proto" in
14763 REENTRANT_PROTO*) ;;
14764 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14766 echo "Prototype: $try" ;;
14769 *) case "$usethreads" in
14770 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14777 *) gmtime_r_proto=0
14781 : see if hasmntopt exists
14782 set hasmntopt d_hasmntopt
14785 : see if this is a netinet/in.h or sys/in.h system
14786 set netinet/in.h i_niin sys/in.h i_sysin
14789 : see if arpa/inet.h has to be included
14790 set arpa/inet.h i_arpainet
14793 : see if htonl --and friends-- exists
14798 : Maybe they are macros.
14801 $cat >htonl.c <<EOM
14803 #include <sys/types.h>
14804 #$i_niin I_NETINET_IN
14806 #$i_arpainet I_ARPA_INET
14807 #ifdef I_NETINET_IN
14808 #include <netinet/in.h>
14811 #include <sys/in.h>
14814 #include <arpa/inet.h>
14817 printf("Defined as a macro.");
14820 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14821 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14823 echo "But it seems to be defined as a macro." >&4
14831 : see if ilogbl exists
14832 set ilogbl d_ilogbl
14837 if set index val -f; eval $csym; $val; then
14838 if set strchr val -f d_strchr; eval $csym; $val; then
14839 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14842 echo "strchr() found." >&4
14846 echo "index() found." >&4
14851 echo "index() found." >&4
14854 if set strchr val -f d_strchr; eval $csym; $val; then
14857 echo "strchr() found." >&4
14859 echo "No index() or strchr() found!" >&4
14864 set d_strchr; eval $setvar
14866 set d_index; eval $setvar
14868 : check whether inet_aton exists
14869 set inet_aton d_inetaton
14874 $cat >isascii.c <<EOCP
14877 #$i_stdlib I_STDLIB
14879 #include <stdlib.h>
14890 if eval $compile; then
14891 echo "isascii() found." >&4
14894 echo "isascii() NOT found." >&4
14901 : see if isfinite exists
14902 set isfinite d_isfinite
14905 : see if isinf exists
14909 : see if isnan exists
14913 : see if isnanl exists
14914 set isnanl d_isnanl
14917 : see if killpg exists
14918 set killpg d_killpg
14921 : see if lchown exists
14923 $cat > try.c <<'EOCP'
14924 /* System header to define __stub macros and hopefully few prototypes,
14925 which can conflict with char lchown(); below. */
14926 #include <assert.h>
14927 /* Override any gcc2 internal prototype to avoid an error. */
14928 /* We use char because int might match the return type of a gcc2
14929 builtin and then its argument prototype would still apply. */
14932 /* The GNU C library defines this for functions which it implements
14933 to always fail with ENOSYS. Some functions are actually named
14934 something starting with __ and the normal name is an alias. */
14935 #if defined (__stub_lchown) || defined (__stub___lchown)
14943 if eval $compile; then
14944 $echo "lchown() found." >&4
14947 $echo "lchown() NOT found." >&4
14953 : See if number of significant digits in a double precision number is known
14955 $cat >ldbl_dig.c <<EOM
14956 #$i_limits I_LIMITS
14959 #include <limits.h>
14965 printf("Contains LDBL_DIG");
14968 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14969 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14970 echo "LDBL_DIG found." >&4
14973 echo "LDBL_DIG NOT found." >&4
14980 : see if this is a math.h system
14984 : check to see if math.h defines _LIB_VERSION
14985 d_libm_lib_version="$undef"
14989 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14991 #include <unistd.h>
14993 int main (int argc, char *argv[])
14995 printf ("%d\n", _LIB_VERSION);
15000 if eval $compile; then
15002 echo "Yes, it does ($foo)" >&4
15003 d_libm_lib_version="$define"
15005 echo "No, it does not (probably harmless)" >&4
15012 : see if link exists
15016 : see if localtime_r exists
15017 set localtime_r d_localtime_r
15019 case "$d_localtime_r" in
15021 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15022 case "$d_localtime_r_proto:$usethreads" in
15023 ":define") d_localtime_r_proto=define
15024 set d_localtime_r_proto localtime_r $hdrs
15028 case "$d_localtime_r_proto" in
15030 case "$localtime_r_proto" in
15031 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15032 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15034 case "$localtime_r_proto" in
15035 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15036 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15038 case "$localtime_r_proto" in
15039 ''|0) d_localtime_r=undef
15040 localtime_r_proto=0
15041 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15042 * ) case "$localtime_r_proto" in
15043 REENTRANT_PROTO*) ;;
15044 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15046 echo "Prototype: $try" ;;
15049 *) case "$usethreads" in
15050 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15052 d_localtime_r=undef
15053 localtime_r_proto=0
15057 *) localtime_r_proto=0
15061 : see if localtime_r calls tzset
15062 case "$localtime_r_proto" in
15065 /* Does our libc's localtime_r call tzset ?
15066 * return 0 if so, 1 otherwise.
15068 #$i_systypes I_SYS_TYPES
15069 #$i_unistd I_UNISTD
15071 #$i_stdlib I_STDLIB
15072 #$i_string I_STRING
15073 #$i_malloc I_MALLOC
15075 # include <sys/types.h>
15078 # include <unistd.h>
15084 #include <stdlib.h>
15087 # include <string.h>
15089 # include <strings.h>
15092 # include <malloc.h>
15096 time_t t = time(0L);
15097 char w_tz[]="TZ" "=GMT+5",
15098 e_tz[]="TZ" "=GMT-5",
15099 *tz_e = (char*)malloc(16),
15100 *tz_w = (char*)malloc(16);
15101 struct tm tm_e, tm_w;
15102 memset(&tm_e,'\0',sizeof(struct tm));
15103 memset(&tm_w,'\0',sizeof(struct tm));
15108 localtime_r(&t, &tm_e);
15111 localtime_r(&t, &tm_w);
15113 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15119 if eval $compile; then
15120 if $run ./try; then
15121 d_localtime_r_needs_tzset=undef;
15123 d_localtime_r_needs_tzset=define;
15126 d_localtime_r_needs_tzset=undef;
15130 d_localtime_r_needs_tzset=undef;
15135 : see if localeconv exists
15136 set localeconv d_locconv
15139 : see if lockf exists
15143 : see if prototype for lseek is available
15145 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15148 : see if lstat exists
15152 : see if madvise exists
15153 set madvise d_madvise
15156 : see if malloc_size exists
15157 set malloc_size d_malloc_size
15160 : see if malloc_size_good exists
15161 set malloc_good_size d_malloc_good_size
15164 : see if mblen exists
15168 : see if mbstowcs exists
15169 set mbstowcs d_mbstowcs
15172 : see if mbtowc exists
15173 set mbtowc d_mbtowc
15176 : see if memchr exists
15177 set memchr d_memchr
15180 : see if memcmp exists
15181 set memcmp d_memcmp
15184 : see if memcpy exists
15185 set memcpy d_memcpy
15188 : see if memmove exists
15189 set memmove d_memmove
15192 : see if memset exists
15193 set memset d_memset
15196 : see if mkdir exists
15200 : see if mkdtemp exists
15201 set mkdtemp d_mkdtemp
15204 : see if mkfifo exists
15205 set mkfifo d_mkfifo
15208 : see if mkstemp exists
15209 set mkstemp d_mkstemp
15212 : see if mkstemps exists
15213 set mkstemps d_mkstemps
15216 : see if mktime exists
15217 set mktime d_mktime
15220 : see if this is a sys/mman.h system
15221 set sys/mman.h i_sysmman
15224 : see if mmap exists
15227 : see what shmat returns
15228 : default to something harmless
15230 case "$i_sysmman$d_mmap" in
15232 $cat >mmap.c <<'END'
15233 #include <sys/mman.h>
15236 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15241 echo "and it returns ($mmaptype)." >&4
15247 : see if sqrtl exists
15251 : see if scalbnl exists
15252 set scalbnl d_scalbnl
15255 : see if modfl exists
15259 : see if prototype for modfl is available
15261 set d_modflproto modfl $i_math math.h
15264 d_modfl_pow32_bug="$undef"
15266 case "$d_longdbl$d_modfl" in
15269 Checking to see whether your modfl() is okay for large values...
15275 if $test "X$d_modflproto" != "X$define"; then
15276 $cat >>try.c <<EOCP
15277 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15278 long double modfl (long double, long double *);
15281 $cat >>try.c <<EOCP
15283 long double nv = 4294967303.15;
15289 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15293 case "$osname:$gccversion" in
15294 aix:) saveccflags="$ccflags"
15295 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15298 if eval $compile; then
15301 *" 4294967303.150000 1.150000 4294967302.000000")
15302 echo >&4 "Your modfl() is broken for large values."
15303 d_modfl_pow32_bug="$define"
15305 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15309 *" 4294967303.150000 0.150000 4294967303.000000")
15310 echo >&4 "Your modfl() seems okay for large values."
15312 *) echo >&4 "I don't understand your modfl() at all."
15318 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15321 case "$osname:$gccversion" in
15322 aix:) ccflags="$saveccflags" ;; # restore
15327 if $test "$uselongdouble" = "$define"; then
15329 if $test "$d_sqrtl" != "$define"; then
15330 message="$message sqrtl"
15332 if $test "$d_modfl" != "$define"; then
15333 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15334 echo "You have both aintl and copysignl, so I can emulate modfl."
15336 message="$message modfl"
15339 if $test "$d_frexpl" != "$define"; then
15340 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15341 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15343 message="$message frexpl"
15347 if $test "$message" != ""; then
15350 *** You requested the use of long doubles but you do not seem to have
15351 *** the following mathematical functions needed for long double support:
15353 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15354 *** Cannot continue, aborting.
15362 : see if mprotect exists
15363 set mprotect d_mprotect
15366 : see if msgctl exists
15367 set msgctl d_msgctl
15370 : see if msgget exists
15371 set msgget d_msgget
15374 : see if msgsnd exists
15375 set msgsnd d_msgsnd
15378 : see if msgrcv exists
15379 set msgrcv d_msgrcv
15382 : see how much of the 'msg*(2)' library is present.
15385 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15386 *"$undef"*) h_msg=false;;
15390 case "`ipcs 2>&1`" in
15391 "SVID messages"*"not configured"*)
15392 echo "Your $osname does not have the msg*(2) configured." >&4
15395 set msgctl d_msgctl
15397 set msgget d_msgget
15399 set msgsnd d_msgsnd
15401 set msgrcv d_msgrcv
15407 : we could also check for sys/ipc.h ...
15408 if $h_msg && $test `./findhdr sys/msg.h`; then
15409 echo "You have the full msg*(2) library." >&4
15412 echo "You don't have the full msg*(2) library." >&4
15418 : Check for msghdr_s
15420 echo "Checking to see if your system supports struct msghdr..." >&4
15421 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15423 case "$d_msghdr_s" in
15424 "$define") echo "Yes, it does." ;;
15425 *) echo "No, it doesn't." ;;
15429 : see if msync exists
15433 : see if munmap exists
15434 set munmap d_munmap
15437 : see if nice exists
15441 : see if this is a langinfo.h system
15442 set langinfo.h i_langinfo
15445 : see if nl_langinfo exists
15446 set nl_langinfo d_nl_langinfo
15449 : check for volatile keyword
15451 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15452 $cat >try.c <<'EOCP'
15455 typedef struct _goo_struct goo_struct;
15456 goo_struct * volatile goo = ((goo_struct *)0);
15457 struct _goo_struct {
15462 typedef unsigned short foo_t;
15463 char *volatile foo;
15465 volatile foo_t blech;
15469 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15471 echo "Yup, it does."
15474 echo "Nope, it doesn't."
15480 : Check basic sizes
15482 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15484 case "$use64bitint:$d_quad:$quadtype" in
15487 uvtype="$uquadtype"
15492 uvtype="unsigned long"
15498 case "$uselongdouble:$d_longdbl" in
15500 nvtype="long double"
15501 nvsize=$longdblsize
15508 $echo "(IV will be "$ivtype", $ivsize bytes)"
15509 $echo "(UV will be "$uvtype", $uvsize bytes)"
15510 $echo "(NV will be "$nvtype", $nvsize bytes)"
15513 #$i_inttypes I_INTTYPES
15515 #include <inttypes.h>
15520 int8_t i = INT8_MAX;
15521 uint8_t u = UINT8_MAX;
15522 printf("int8_t\n");
15525 int16_t i = INT16_MAX;
15526 uint16_t i = UINT16_MAX;
15527 printf("int16_t\n");
15530 int32_t i = INT32_MAX;
15531 uint32_t u = UINT32_MAX;
15532 printf("int32_t\n");
15537 i8type="signed char"
15538 u8type="unsigned char"
15543 '') case "$shortsize" in
15545 u16type="unsigned short"
15553 '') set try -DINT16
15554 if eval $compile; then
15555 case "`$run ./try`" in
15567 '') if $test $shortsize -ge 2; then
15569 u16type="unsigned short"
15577 '') case "$longsize" in
15579 u32type="unsigned long"
15583 *) case "$intsize" in
15585 u32type="unsigned int"
15595 '') set try -DINT32
15596 if eval $compile; then
15597 case "`$run ./try`" in
15609 '') if $test $intsize -ge 4; then
15611 u32type="unsigned int"
15619 '') case "$d_quad:$quadtype" in
15621 i64type="$quadtype"
15622 u64type="$uquadtype"
15630 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15631 : volatile so that the compiler has to store it out to memory.
15632 if test X"$d_volatile" = X"$define"; then
15637 #$i_stdlib I_STDLIB
15639 #include <stdlib.h>
15641 #include <sys/types.h>
15642 #include <signal.h>
15644 $volatile int bletched = 0;
15645 $signal_t blech(int s) { bletched = 1; }
15650 int n = 8 * $uvsize;
15653 signal(SIGFPE, blech);
15656 for (i = 0; i < n; i++) {
15657 u = u << 1 | ($uvtype)1;
15659 if (($uvtype)d != u)
15663 d = ($nvtype)(u - 1);
15664 if (($uvtype)d != (u - 1))
15671 printf("%d\n", ((i == n) ? -n : i));
15677 d_nv_preserves_uv="$undef"
15678 if eval $compile; then
15679 nv_preserves_uv_bits="`$run ./try`"
15681 case "$nv_preserves_uv_bits" in
15683 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15684 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15685 d_nv_preserves_uv="$define"
15687 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15688 d_nv_preserves_uv="$undef" ;;
15689 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15690 nv_preserves_uv_bits="0" ;;
15694 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15695 : volatile so that the compiler has to store it out to memory.
15696 if test X"$d_volatile" = X"$define"; then
15702 typedef $nvtype NV;
15709 while(count < 256) {
15710 $volatile NV up = value + 1.0;
15711 $volatile NV negated = -value;
15712 $volatile NV down = negated - 1.0;
15713 $volatile NV got_up = up - value;
15714 int up_good = got_up == 1.0;
15715 int got_down = down - negated;
15716 int down_good = got_down == -1.0;
15718 if (down_good != up_good) {
15720 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15721 up_good, (double) got_up, down_good, (double) got_down,
15722 count, (double) value);
15729 fputs("256.0", stdout);
15732 fputs("2.0", stdout);
15738 fputs("*", stdout);
15744 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15745 count, (double) value);
15751 nv_overflows_integers_at='0'
15752 if eval $compile; then
15758 The largest integer your NVs can preserve is equal to $xxx
15760 nv_overflows_integers_at="$xxx"
15763 Cannot determine the largest integer value your NVs can hold, unexpected output
15770 Cannot determine the largest integer value your NVs can hold
15777 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15778 : volatile so that the compiler has to store it out to memory.
15779 if test X"$d_volatile" = X"$define"; then
15784 #$i_stdlib I_STDLIB
15786 #include <stdlib.h>
15788 #$i_string I_STRING
15790 # include <string.h>
15792 # include <strings.h>
15794 #include <sys/types.h>
15795 #include <signal.h>
15797 $volatile int bletched = 0;
15798 $signal_t blech(int s) { bletched = 1; }
15801 int checkit($nvtype d, char *where) {
15802 unsigned char *p = (char *)&d;
15803 unsigned char *end = p + sizeof(d);
15813 printf("No - %s: 0x", where);
15815 printf ("%02X", *p++);
15820 int main(int argc, char **argv) {
15823 fail += checkit(d, "0.0");
15825 /* The compiler shouldn't be assuming that bletched is 0 */
15828 fail += checkit(d, "bleched");
15831 signal(SIGFPE, blech);
15834 /* Paranoia - the compiler should have no way of knowing that ANSI says
15835 that argv[argc] will always be NULL. Actually, if it did assume this it
15836 would be buggy, as this is C and main() can be called from elsewhere in
15838 d = argv[argc] ? 1 : 0;
15841 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15844 fail += checkit(d, "ternary");
15846 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15849 printf("No - memset doesn't give 0.0\n");
15850 /* This might just blow up: */
15851 printf("(gives %g)\n", d);
15857 printf("No - something bleched\n");
15862 printf("No - %d fail(s)\n", fail);
15871 d_nv_zero_is_allbits_zero="$undef"
15872 if eval $compile; then
15878 0.0 is represented as all bits zero in memory
15880 d_nv_zero_is_allbits_zero="$define"
15883 0.0 is not represented as all bits zero in memory
15885 d_nv_zero_is_allbits_zero="$undef"
15890 0.0 is not represented as all bits zero in memory
15892 d_nv_zero_is_allbits_zero="$undef"
15898 : check for off64_t
15900 echo "Checking to see if you have off64_t..." >&4
15902 #include <sys/types.h>
15903 #include <unistd.h>
15904 int main() { off64_t x = 7; }
15907 if eval $compile; then
15909 echo "You have off64_t."
15912 echo "You do not have off64_t."
15913 case "$lseeksize" in
15914 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15921 : how to create joinable pthreads
15922 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15924 echo "Checking what constant to use for creating joinable pthreads..." >&4
15925 $cat >try.c <<'EOCP'
15926 #include <pthread.h>
15928 int detachstate = JOINABLE;
15931 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15932 if eval $compile; then
15933 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15934 val="$undef" # Yes, undef.
15935 set d_old_pthread_create_joinable
15938 set old_pthread_create_joinable
15941 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15942 if eval $compile; then
15943 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15945 set d_old_pthread_create_joinable
15947 val=PTHREAD_CREATE_UNDETACHED
15948 set old_pthread_create_joinable
15951 set try -DJOINABLE=__UNDETACHED
15952 if eval $compile; then
15953 echo "You seem to use __UNDETACHED." >&4
15955 set d_old_pthread_create_joinable
15958 set old_pthread_create_joinable
15961 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15963 set d_old_pthread_create_joinable
15966 set old_pthread_create_joinable
15973 d_old_pthread_create_joinable="$undef"
15974 old_pthread_create_joinable=""
15977 : see if pause exists
15981 : see if poll exists
15985 : see if readlink exists
15986 set readlink d_readlink
15989 : Check if exe is symlink to abs path of executing program
15993 case "$d_readlink" in
15995 if $issymlink /proc/self/exe ; then
15996 $ls -l /proc/self/exe > reflect
15997 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15998 echo "You have Linux-like /proc/self/exe."
15999 procselfexe='"/proc/self/exe"'
16003 if $issymlink /proc/curproc/file ; then
16004 $ls -l /proc/curproc/file > reflect
16005 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16006 echo "You have BSD-like /proc/curproc/file."
16007 procselfexe='"/proc/curproc/file"'
16017 : backward compatibility for d_hvfork
16018 if test X$d_hvfork != X; then
16019 d_vfork="$d_hvfork"
16022 : see if there is a vfork
16027 d_pseudofork=$undef
16029 : Ok, but do we want to use it. vfork is reportedly unreliable in
16030 : perl on Solaris 2.x, and probably elsewhere.
16034 case "$usevfork" in
16040 Perl can only use a vfork() that doesn't suffer from strict
16041 restrictions on calling functions or modifying global data in
16042 the child. For example, glibc-2.1 contains such a vfork()
16043 that is unsuitable. If your system provides a proper fork()
16044 call, chances are that you do NOT want perl to use vfork().
16047 rp="Do you still want to use vfork()?"
16052 echo "Ok, we won't use vfork()."
16061 $define) usevfork='true';;
16062 *) usevfork='false';;
16065 : see whether the pthread_atfork exists
16067 #include <pthread.h>
16070 #ifdef PTHREAD_ATFORK
16071 pthread_atfork(NULL,NULL,NULL);
16076 : see if pthread_atfork exists
16077 set try -DPTHREAD_ATFORK
16078 if eval $compile; then
16083 case "$usethreads" in
16086 $define) echo 'pthread_atfork found.' >&4 ;;
16087 *) echo 'pthread_atfork NOT found.' >&4 ;;
16090 set d_pthread_atfork
16093 : see if pthread_attr_setscope exists
16094 set pthread_attr_setscope d_pthread_attr_setscope
16097 : see whether the various POSIXish _yields exist
16099 #include <pthread.h>
16105 #ifdef PTHREAD_YIELD
16108 #ifdef PTHREAD_YIELD_NULL
16109 pthread_yield(NULL);
16115 : see if sched_yield exists
16116 set try -DSCHED_YIELD
16117 if eval $compile; then
16119 sched_yield='sched_yield()'
16123 case "$usethreads" in
16126 $define) echo 'sched_yield() found.' >&4 ;;
16127 *) echo 'sched_yield() NOT found.' >&4 ;;
16133 : see if pthread_yield exists
16134 set try -DPTHREAD_YIELD
16135 if eval $compile; then
16137 case "$sched_yield" in
16138 '') sched_yield='pthread_yield()' ;;
16141 set try -DPTHREAD_YIELD_NULL
16142 if eval $compile; then
16144 case "$sched_yield" in
16145 '') sched_yield='pthread_yield(NULL)' ;;
16151 case "$usethreads" in
16154 $define) echo 'pthread_yield() found.' >&4 ;;
16155 *) echo 'pthread_yield() NOT found.' >&4 ;;
16159 set d_pthread_yield
16161 case "$sched_yield" in
16162 '') sched_yield=undef ;;
16166 : see if random_r exists
16167 set random_r d_random_r
16169 case "$d_random_r" in
16171 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16172 case "$d_random_r_proto:$usethreads" in
16173 ":define") d_random_r_proto=define
16174 set d_random_r_proto random_r $hdrs
16178 case "$d_random_r_proto" in
16180 case "$random_r_proto" in
16181 ''|0) try='int random_r(int*, struct random_data*);'
16182 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16184 case "$random_r_proto" in
16185 ''|0) try='int random_r(long*, struct random_data*);'
16186 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16188 case "$random_r_proto" in
16189 ''|0) try='int random_r(struct random_data*, int32_t*);'
16190 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16192 case "$random_r_proto" in
16193 ''|0) d_random_r=undef
16195 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16196 * ) case "$random_r_proto" in
16197 REENTRANT_PROTO*) ;;
16198 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16200 echo "Prototype: $try" ;;
16203 *) case "$usethreads" in
16204 define) echo "random_r has no prototype, not using it." >&4 ;;
16211 *) random_r_proto=0
16215 : see if readdir and friends exist
16216 set readdir d_readdir
16218 set seekdir d_seekdir
16220 set telldir d_telldir
16222 set rewinddir d_rewinddir
16225 : see if readdir64_r exists
16226 set readdir64_r d_readdir64_r
16228 case "$d_readdir64_r" in
16230 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16231 case "$d_readdir64_r_proto:$usethreads" in
16232 ":define") d_readdir64_r_proto=define
16233 set d_readdir64_r_proto readdir64_r $hdrs
16237 case "$d_readdir64_r_proto" in
16239 case "$readdir64_r_proto" in
16240 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16241 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16243 case "$readdir64_r_proto" in
16244 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16245 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16247 case "$readdir64_r_proto" in
16248 ''|0) d_readdir64_r=undef
16249 readdir64_r_proto=0
16250 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16251 * ) case "$readdir64_r_proto" in
16252 REENTRANT_PROTO*) ;;
16253 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16255 echo "Prototype: $try" ;;
16258 *) case "$usethreads" in
16259 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16261 d_readdir64_r=undef
16262 readdir64_r_proto=0
16266 *) readdir64_r_proto=0
16270 : see if readdir_r exists
16271 set readdir_r d_readdir_r
16273 case "$d_readdir_r" in
16275 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16276 case "$d_readdir_r_proto:$usethreads" in
16277 ":define") d_readdir_r_proto=define
16278 set d_readdir_r_proto readdir_r $hdrs
16282 case "$d_readdir_r_proto" in
16284 case "$readdir_r_proto" in
16285 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16286 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16288 case "$readdir_r_proto" in
16289 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16290 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16292 case "$readdir_r_proto" in
16293 ''|0) d_readdir_r=undef
16295 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16296 * ) case "$readdir_r_proto" in
16297 REENTRANT_PROTO*) ;;
16298 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16300 echo "Prototype: $try" ;;
16303 *) case "$usethreads" in
16304 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16311 *) readdir_r_proto=0
16315 : see if readv exists
16319 : see if recvmsg exists
16320 set recvmsg d_recvmsg
16323 : see if rename exists
16324 set rename d_rename
16327 : see if rmdir exists
16331 : see if memory.h is available.
16336 : See if it conflicts with string.h
16342 $cppstdin $cppflags $cppminus < $strings > mem.h
16343 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16345 echo "We won't be including <memory.h>."
16355 : can bcopy handle overlapping blocks?
16358 case "$d_memmove" in
16359 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16360 *) case "$d_bcopy" in
16362 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16364 #$i_memory I_MEMORY
16365 #$i_stdlib I_STDLIB
16366 #$i_string I_STRING
16367 #$i_unistd I_UNISTD
16369 $cat >>try.c <<'EOCP'
16372 # include <memory.h>
16375 # include <stdlib.h>
16378 # include <string.h>
16380 # include <strings.h>
16383 # include <unistd.h> /* Needed for NetBSD */
16387 char buf[128], abc[128];
16393 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16394 try to store the string in read-only memory. */
16395 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16397 for (align = 7; align >= 0; align--) {
16398 for (len = 36; len; len--) {
16400 bcopy(abc, b, len);
16401 for (off = 1; off <= len; off++) {
16402 bcopy(b, b+off, len);
16403 bcopy(b+off, b, len);
16404 if (bcmp(b, abc, len))
16413 if eval $compile_ok; then
16414 if $run ./try 2>/dev/null; then
16415 echo "Yes, it can."
16418 echo "It can't, sorry."
16421 echo "(I can't compile the test program, so we'll assume not...)"
16431 : can memcpy handle overlapping blocks?
16434 case "$d_memmove" in
16435 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16436 *) case "$d_memcpy" in
16438 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16440 #$i_memory I_MEMORY
16441 #$i_stdlib I_STDLIB
16442 #$i_string I_STRING
16443 #$i_unistd I_UNISTD
16445 $cat >>try.c <<'EOCP'
16448 # include <memory.h>
16451 # include <stdlib.h>
16454 # include <string.h>
16456 # include <strings.h>
16459 # include <unistd.h> /* Needed for NetBSD */
16463 char buf[128], abc[128];
16469 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16470 try to store the string in read-only memory. */
16471 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16473 for (align = 7; align >= 0; align--) {
16474 for (len = 36; len; len--) {
16476 memcpy(b, abc, len);
16477 for (off = 1; off <= len; off++) {
16478 memcpy(b+off, b, len);
16479 memcpy(b, b+off, len);
16480 if (memcmp(b, abc, len))
16489 if eval $compile_ok; then
16490 if $run ./try 2>/dev/null; then
16491 echo "Yes, it can."
16494 echo "It can't, sorry."
16497 echo "(I can't compile the test program, so we'll assume not...)"
16507 : can memcmp be trusted to compare relative magnitude?
16509 case "$d_memcmp" in
16512 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16514 #$i_memory I_MEMORY
16515 #$i_stdlib I_STDLIB
16516 #$i_string I_STRING
16517 #$i_unistd I_UNISTD
16519 $cat >>try.c <<'EOCP'
16522 # include <memory.h>
16525 # include <stdlib.h>
16528 # include <string.h>
16530 # include <strings.h>
16533 # include <unistd.h> /* Needed for NetBSD */
16539 if ((a < b) && memcmp(&a, &b, 1) < 0)
16545 if eval $compile_ok; then
16546 if $run ./try 2>/dev/null; then
16547 echo "Yes, it can."
16550 echo "No, it can't (it uses signed chars)."
16553 echo "(I can't compile the test program, so we'll assume not...)"
16561 : see if prototype for sbrk is available
16563 set d_sbrkproto sbrk $i_unistd unistd.h
16566 : see if select exists
16567 set select d_select
16570 : see if semctl exists
16571 set semctl d_semctl
16574 : see if semget exists
16575 set semget d_semget
16578 : see if semop exists
16582 : see how much of the 'sem*(2)' library is present.
16585 case "$d_semctl$d_semget$d_semop" in
16586 *"$undef"*) h_sem=false;;
16590 case "`ipcs 2>&1`" in
16591 "SVID messages"*"not configured"*)
16592 echo "Your $osname does not have the sem*(2) configured." >&4
16595 set semctl d_semctl
16597 set semget d_semget
16605 : we could also check for sys/ipc.h ...
16606 if $h_sem && $test `./findhdr sys/sem.h`; then
16607 echo "You have the full sem*(2) library." >&4
16610 echo "You don't have the full sem*(2) library." >&4
16616 : see whether sys/sem.h defines union semun
16618 $cat > try.c <<'END'
16619 #include <sys/types.h>
16620 #include <sys/ipc.h>
16621 #include <sys/sem.h>
16622 int main () { union semun semun; semun.buf = 0; }
16625 if eval $compile; then
16626 echo "You have union semun in <sys/sem.h>." >&4
16629 echo "You do not have union semun in <sys/sem.h>." >&4
16636 : see how to do semctl IPC_STAT
16640 $cat > tryh.h <<END
16643 # define S_IRUSR S_IREAD
16644 # define S_IWUSR S_IWRITE
16645 # define S_IXUSR S_IEXEC
16647 # define S_IRUSR 0400
16648 # define S_IWUSR 0200
16649 # define S_IXUSR 0100
16651 # define S_IRGRP (S_IRUSR>>3)
16652 # define S_IWGRP (S_IWUSR>>3)
16653 # define S_IXGRP (S_IXUSR>>3)
16654 # define S_IROTH (S_IRUSR>>6)
16655 # define S_IWOTH (S_IWUSR>>6)
16656 # define S_IXOTH (S_IXUSR>>6)
16659 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16660 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16661 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16664 : see whether semctl IPC_STAT can use union semun
16665 case "$d_semctl_semun" in
16669 #include <sys/types.h>
16670 #include <sys/ipc.h>
16671 #include <sys/sem.h>
16672 #include <sys/stat.h>
16679 #$d_union_semun HAS_UNION_SEMUN
16682 #ifndef HAS_UNION_SEMUN
16685 struct semid_ds *buf;
16686 unsigned short *array;
16692 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16693 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16695 struct semid_ds argbuf;
16698 st = semctl(sem, 0, IPC_STAT, arg);
16702 # endif /* IPC_STAT */
16703 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16705 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16706 # endif /* IPC_RMID */
16707 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16709 #endif /* IPC_PRIVATE && ... */
16710 printf("semget failed: errno = %d\n", errno);
16715 if eval $compile; then
16718 semun) val="$define" ;;
16726 case "$d_semctl_semun" in
16728 echo "You can use union semun for semctl IPC_STAT." >&4
16731 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16736 : see whether semctl IPC_STAT can use struct semid_ds pointer
16737 case "$d_semctl_semid_ds" in
16740 $cat > try.c <<'END'
16741 #include <sys/types.h>
16742 #include <sys/ipc.h>
16743 #include <sys/sem.h>
16744 #include <sys/stat.h>
16752 struct semid_ds arg;
16755 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16756 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16759 st = semctl(sem, 0, IPC_STAT, &arg);
16761 printf("semid_ds\n");
16763 # endif /* IPC_STAT */
16764 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16766 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16767 # endif /* IPC_RMID */
16768 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16770 #endif /* IPC_PRIVATE && ... */
16771 printf("semget failed: errno = %d\n", errno);
16777 if eval $compile; then
16780 semid_ds) val="$define" ;;
16784 set d_semctl_semid_ds
16788 case "$d_semctl_semid_ds" in
16790 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16792 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16798 # We do not have the full sem*(2) library, so assume we can not
16804 set d_semctl_semid_ds
16810 : see if sendmsg exists
16811 set sendmsg d_sendmsg
16814 : see if setegid exists
16815 set setegid d_setegid
16818 : see if seteuid exists
16819 set seteuid d_seteuid
16822 : see if setgrent exists
16823 set setgrent d_setgrent
16826 : see if setgrent_r exists
16827 set setgrent_r d_setgrent_r
16829 case "$d_setgrent_r" in
16831 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16832 case "$d_setgrent_r_proto:$usethreads" in
16833 ":define") d_setgrent_r_proto=define
16834 set d_setgrent_r_proto setgrent_r $hdrs
16838 case "$d_setgrent_r_proto" in
16840 case "$setgrent_r_proto" in
16841 ''|0) try='int setgrent_r(FILE**);'
16842 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
16844 case "$setgrent_r_proto" in
16845 ''|0) try='void setgrent_r(FILE**);'
16846 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
16848 case "$setgrent_r_proto" in
16849 ''|0) d_setgrent_r=undef
16851 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16852 * ) case "$setgrent_r_proto" in
16853 REENTRANT_PROTO*) ;;
16854 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16856 echo "Prototype: $try" ;;
16859 *) case "$usethreads" in
16860 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16867 *) setgrent_r_proto=0
16871 : see if sethostent exists
16872 set sethostent d_sethent
16875 : see if sethostent_r exists
16876 set sethostent_r d_sethostent_r
16878 case "$d_sethostent_r" in
16880 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16881 case "$d_sethostent_r_proto:$usethreads" in
16882 ":define") d_sethostent_r_proto=define
16883 set d_sethostent_r_proto sethostent_r $hdrs
16887 case "$d_sethostent_r_proto" in
16889 case "$sethostent_r_proto" in
16890 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16891 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
16893 case "$sethostent_r_proto" in
16894 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16895 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
16897 case "$sethostent_r_proto" in
16898 ''|0) d_sethostent_r=undef
16899 sethostent_r_proto=0
16900 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16901 * ) case "$sethostent_r_proto" in
16902 REENTRANT_PROTO*) ;;
16903 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16905 echo "Prototype: $try" ;;
16908 *) case "$usethreads" in
16909 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16911 d_sethostent_r=undef
16912 sethostent_r_proto=0
16916 *) sethostent_r_proto=0
16920 : see if setitimer exists
16921 set setitimer d_setitimer
16924 : see if setlinebuf exists
16925 set setlinebuf d_setlinebuf
16928 : see if setlocale exists
16929 set setlocale d_setlocale
16932 : see if locale.h is available
16933 set locale.h i_locale
16936 : see if setlocale_r exists
16937 set setlocale_r d_setlocale_r
16939 case "$d_setlocale_r" in
16941 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16942 case "$d_setlocale_r_proto:$usethreads" in
16943 ":define") d_setlocale_r_proto=define
16944 set d_setlocale_r_proto setlocale_r $hdrs
16948 case "$d_setlocale_r_proto" in
16950 case "$setlocale_r_proto" in
16951 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16952 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16954 case "$setlocale_r_proto" in
16955 ''|0) d_setlocale_r=undef
16956 setlocale_r_proto=0
16957 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16958 * ) case "$setlocale_r_proto" in
16959 REENTRANT_PROTO*) ;;
16960 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16962 echo "Prototype: $try" ;;
16965 *) case "$usethreads" in
16966 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16968 d_setlocale_r=undef
16969 setlocale_r_proto=0
16973 *) setlocale_r_proto=0
16977 : see if setnetent exists
16978 set setnetent d_setnent
16981 : see if setnetent_r exists
16982 set setnetent_r d_setnetent_r
16984 case "$d_setnetent_r" in
16986 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16987 case "$d_setnetent_r_proto:$usethreads" in
16988 ":define") d_setnetent_r_proto=define
16989 set d_setnetent_r_proto setnetent_r $hdrs
16993 case "$d_setnetent_r_proto" in
16995 case "$setnetent_r_proto" in
16996 ''|0) try='int setnetent_r(int, struct netent_data*);'
16997 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
16999 case "$setnetent_r_proto" in
17000 ''|0) try='void setnetent_r(int, struct netent_data*);'
17001 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17003 case "$setnetent_r_proto" in
17004 ''|0) d_setnetent_r=undef
17005 setnetent_r_proto=0
17006 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17007 * ) case "$setnetent_r_proto" in
17008 REENTRANT_PROTO*) ;;
17009 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17011 echo "Prototype: $try" ;;
17014 *) case "$usethreads" in
17015 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17017 d_setnetent_r=undef
17018 setnetent_r_proto=0
17022 *) setnetent_r_proto=0
17026 : see if setprotoent exists
17027 set setprotoent d_setpent
17030 : see if setpgid exists
17031 set setpgid d_setpgid
17034 : see if setpgrp2 exists
17035 set setpgrp2 d_setpgrp2
17038 : see if setpriority exists
17039 set setpriority d_setprior
17042 : see if setproctitle exists
17043 set setproctitle d_setproctitle
17046 : see if setprotoent_r exists
17047 set setprotoent_r d_setprotoent_r
17049 case "$d_setprotoent_r" in
17051 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17052 case "$d_setprotoent_r_proto:$usethreads" in
17053 ":define") d_setprotoent_r_proto=define
17054 set d_setprotoent_r_proto setprotoent_r $hdrs
17058 case "$d_setprotoent_r_proto" in
17060 case "$setprotoent_r_proto" in
17061 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17062 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17064 case "$setprotoent_r_proto" in
17065 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17066 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17068 case "$setprotoent_r_proto" in
17069 ''|0) d_setprotoent_r=undef
17070 setprotoent_r_proto=0
17071 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17072 * ) case "$setprotoent_r_proto" in
17073 REENTRANT_PROTO*) ;;
17074 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17076 echo "Prototype: $try" ;;
17079 *) case "$usethreads" in
17080 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17082 d_setprotoent_r=undef
17083 setprotoent_r_proto=0
17087 *) setprotoent_r_proto=0
17091 : see if setpwent exists
17092 set setpwent d_setpwent
17095 : see if setpwent_r exists
17096 set setpwent_r d_setpwent_r
17098 case "$d_setpwent_r" in
17100 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17101 case "$d_setpwent_r_proto:$usethreads" in
17102 ":define") d_setpwent_r_proto=define
17103 set d_setpwent_r_proto setpwent_r $hdrs
17107 case "$d_setpwent_r_proto" in
17109 case "$setpwent_r_proto" in
17110 ''|0) try='int setpwent_r(FILE**);'
17111 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17113 case "$setpwent_r_proto" in
17114 ''|0) try='void setpwent_r(FILE**);'
17115 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17117 case "$setpwent_r_proto" in
17118 ''|0) d_setpwent_r=undef
17120 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17121 * ) case "$setpwent_r_proto" in
17122 REENTRANT_PROTO*) ;;
17123 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17125 echo "Prototype: $try" ;;
17128 *) case "$usethreads" in
17129 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17136 *) setpwent_r_proto=0
17140 : see if setregid exists
17141 set setregid d_setregid
17143 set setresgid d_setresgid
17146 : see if setreuid exists
17147 set setreuid d_setreuid
17149 set setresuid d_setresuid
17152 : see if setrgid exists
17153 set setrgid d_setrgid
17156 : see if setruid exists
17157 set setruid d_setruid
17160 : see if setservent exists
17161 set setservent d_setsent
17164 : see if setservent_r exists
17165 set setservent_r d_setservent_r
17167 case "$d_setservent_r" in
17169 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17170 case "$d_setservent_r_proto:$usethreads" in
17171 ":define") d_setservent_r_proto=define
17172 set d_setservent_r_proto setservent_r $hdrs
17176 case "$d_setservent_r_proto" in
17178 case "$setservent_r_proto" in
17179 ''|0) try='int setservent_r(int, struct servent_data*);'
17180 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17182 case "$setservent_r_proto" in
17183 ''|0) try='void setservent_r(int, struct servent_data*);'
17184 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17186 case "$setservent_r_proto" in
17187 ''|0) d_setservent_r=undef
17188 setservent_r_proto=0
17189 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17190 * ) case "$setservent_r_proto" in
17191 REENTRANT_PROTO*) ;;
17192 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17194 echo "Prototype: $try" ;;
17197 *) case "$usethreads" in
17198 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17200 d_setservent_r=undef
17201 setservent_r_proto=0
17205 *) setservent_r_proto=0
17209 : see if setsid exists
17210 set setsid d_setsid
17213 : see if setvbuf exists
17214 set setvbuf d_setvbuf
17217 : see if sfio.h is available
17221 : see if sfio library is available
17232 : Ok, but do we want to use it.
17236 true|$define|[yY]*) dflt='y';;
17239 echo "$package can use the sfio library, but it is experimental."
17240 case "$useperlio" in
17242 echo "For sfio also the PerlIO abstraction layer is needed."
17243 echo "Earlier you said you wouldn't want that."
17246 rp="You seem to have sfio available, do you want to try using it?"
17249 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
17250 useperlio="$define"
17253 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17258 *) case "$usesfio" in
17259 true|$define|[yY]*)
17260 echo "Sorry, cannot find sfio on this machine." >&4
17261 echo "Ignoring your setting of usesfio=$usesfio." >&4
17270 $define) usesfio='true';;
17271 *) usesfio='false';;
17275 *) : Remove sfio from list of libraries to use
17278 echo "Removing unneeded -lsfio from library list" >&4
17279 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17282 echo "libs = $libs" >&4
17289 : see if shmctl exists
17290 set shmctl d_shmctl
17293 : see if shmget exists
17294 set shmget d_shmget
17297 : see if shmat exists
17300 : see what shmat returns
17303 $cat >shmat.c <<'END'
17304 #include <sys/shm.h>
17307 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17312 echo "and it returns ($shmattype)." >&4
17313 : see if a prototype for shmat is available
17314 xxx=`./findhdr sys/shm.h`
17315 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17316 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17327 set d_shmatprototype
17330 : see if shmdt exists
17334 : see how much of the 'shm*(2)' library is present.
17337 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17338 *"$undef"*) h_shm=false;;
17342 case "`ipcs 2>&1`" in
17343 "SVID shared memory"*"not configured"*)
17344 echo "Your $osname does not have the shm*(2) configured." >&4
17347 set shmctl d_shmctl
17349 set shmget d_shmget
17359 : we could also check for sys/ipc.h ...
17360 if $h_shm && $test `./findhdr sys/shm.h`; then
17361 echo "You have the full shm*(2) library." >&4
17364 echo "You don't have the full shm*(2) library." >&4
17370 : see if we have sigaction
17372 if set sigaction val -f d_sigaction; eval $csym; $val; then
17373 echo 'sigaction() found.' >&4
17376 #include <sys/types.h>
17377 #include <signal.h>
17378 #$i_stdlib I_STDLIB
17380 #include <stdlib.h>
17384 struct sigaction act, oact;
17386 oact.sa_handler = 0;
17387 /* so that act and oact are used */
17388 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17392 if eval $compile_ok; then
17395 echo "But you don't seem to have a useable struct sigaction." >&4
17399 echo 'sigaction NOT found.' >&4
17402 set d_sigaction; eval $setvar
17405 : see if this is a sunmath.h system
17406 set sunmath.h i_sunmath
17409 : see if signbit exists
17410 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17413 #$i_sunmath I_SUNMATH
17417 #ifdef I_SUNMATH /* Solaris special math library */
17418 # include <sunmath.h>
17421 int main(int argc, char **argv)
17425 if ((signbit(x) == 0) && (signbit(y) != 0))
17433 if eval $compile; then
17434 if $run ./try; then
17438 $echo "Signbit seems to be available, but doesn't work as I expected."
17439 $echo "I won't use it." >&4
17450 : see if sigprocmask exists
17451 set sigprocmask d_sigprocmask
17454 : see if sigsetjmp exists
17456 case "$d_sigsetjmp" in
17459 #include <setjmp.h>
17460 #$i_stdlib I_STDLIB
17462 #include <stdlib.h>
17468 if (sigsetjmp(env,1))
17471 siglongjmp(env, 1);
17476 if eval $compile; then
17477 if $run ./try >/dev/null 2>&1; then
17478 echo "POSIX sigsetjmp found." >&4
17482 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17488 echo "sigsetjmp not found." >&4
17492 *) val="$d_sigsetjmp"
17493 case "$d_sigsetjmp" in
17494 $define) echo "POSIX sigsetjmp found." >&4;;
17495 $undef) echo "sigsetjmp not found." >&4;;
17503 : see if snprintf exists
17504 set snprintf d_snprintf
17507 : see if vsnprintf exists
17508 set vsnprintf d_vsnprintf
17511 case "$d_snprintf-$d_vsnprintf" in
17514 Checking whether your snprintf() and vsnprintf() work okay...
17516 $cat >try.c <<'EOCP'
17517 /* v?snprintf testing logic courtesy of Russ Allbery.
17518 * According to C99:
17519 * - if the buffer is too short it still must be \0-terminated
17520 * - if the buffer is too short the potentially required length
17521 * must be returned and not -1
17522 * - if the buffer is NULL the potentially required length
17523 * must be returned and not -1 or core dump
17526 #include <stdarg.h>
17530 int test (char *format, ...)
17535 va_start (args, format);
17536 count = vsnprintf (buf, sizeof buf, format, args);
17543 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17544 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17548 if eval $compile; then
17551 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17553 Your snprintf() and snprintf() don't seem to be working okay.
17555 d_snprintf="$undef"
17556 d_vsnprintf="$undef"
17560 echo "(I can't seem to compile the test program--assuming they don't)"
17561 d_snprintf="$undef"
17562 d_vsnprintf="$undef"
17568 : see if sockatmark exists
17569 set sockatmark d_sockatmark
17572 : see if prototype for sockatmark is available
17574 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17577 : see if socks5_init exists
17578 set socks5_init d_socks5_init
17581 : see if sprintf returns the length of the string in the buffer as per ANSI
17582 $echo "Checking whether sprintf returns the length of the string..." >&4
17585 #$i_stdlib I_STDLIB
17587 #include <stdlib.h>
17589 #$i_string I_STRING
17591 # include <string.h>
17593 # include <strings.h>
17602 int check (size_t expect, int test) {
17603 size_t got = strlen(buffer);
17607 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17612 int main(int argc, char **argv) {
17615 check(sprintf(buffer, ""), ++test);
17616 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17617 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17624 if eval $compile; then
17628 sprintf returns the length of the string (as ANSI says it should)
17630 d_sprintf_returns_strlen="$define"
17633 sprintf does not return the length of the string (how old is this system?)
17635 d_sprintf_returns_strlen="$undef"
17639 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17640 d_sprintf_returns_strlen="$undef"
17644 : see if srand48_r exists
17645 set srand48_r d_srand48_r
17647 case "$d_srand48_r" in
17649 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17650 case "$d_srand48_r_proto:$usethreads" in
17651 ":define") d_srand48_r_proto=define
17652 set d_srand48_r_proto srand48_r $hdrs
17656 case "$d_srand48_r_proto" in
17658 case "$srand48_r_proto" in
17659 ''|0) try='int srand48_r(long, struct drand48_data*);'
17660 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17662 case "$srand48_r_proto" in
17663 ''|0) d_srand48_r=undef
17665 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17666 * ) case "$srand48_r_proto" in
17667 REENTRANT_PROTO*) ;;
17668 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17670 echo "Prototype: $try" ;;
17673 *) case "$usethreads" in
17674 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17681 *) srand48_r_proto=0
17685 : see if srandom_r exists
17686 set srandom_r d_srandom_r
17688 case "$d_srandom_r" in
17690 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17691 case "$d_srandom_r_proto:$usethreads" in
17692 ":define") d_srandom_r_proto=define
17693 set d_srandom_r_proto srandom_r $hdrs
17697 case "$d_srandom_r_proto" in
17699 case "$srandom_r_proto" in
17700 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17701 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
17703 case "$srandom_r_proto" in
17704 ''|0) d_srandom_r=undef
17706 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17707 * ) case "$srandom_r_proto" in
17708 REENTRANT_PROTO*) ;;
17709 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17711 echo "Prototype: $try" ;;
17714 *) case "$usethreads" in
17715 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17722 *) srandom_r_proto=0
17726 : see if prototype for setresgid is available
17728 set d_sresgproto setresgid $i_unistd unistd.h
17731 : see if prototype for setresuid is available
17733 set d_sresuproto setresuid $i_unistd unistd.h
17736 : see if sys/stat.h is available
17737 set sys/stat.h i_sysstat
17740 : see if stat knows about block sizes
17742 echo "Checking to see if your struct stat has st_blocks field..." >&4
17743 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17746 : see if this is a sys/vfs.h system
17747 set sys/vfs.h i_sysvfs
17750 : see if this is a sys/statfs.h system
17751 set sys/statfs.h i_sysstatfs
17754 : Check for statfs_s
17756 echo "Checking to see if your system supports struct statfs..." >&4
17757 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
17759 case "$d_statfs_s" in
17760 "$define") echo "Yes, it does." ;;
17761 *) echo "No, it doesn't." ;;
17765 : see if struct statfs knows about f_flags
17766 case "$d_statfs_s" in
17769 echo "Checking to see if your struct statfs has f_flags field..." >&4
17770 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
17774 set d_statfs_f_flags
17778 case "$d_statfs_f_flags" in
17779 "$define") echo "Yes, it does." ;;
17780 *) echo "No, it doesn't." ;;
17783 : Check stream access
17785 Checking how to access stdio streams by file descriptor number...
17787 case "$stdio_stream_array" in
17788 '') $cat >try.c <<EOCP
17791 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17795 for s in _iob __iob __sF
17797 set try -DSTDIO_STREAM_ARRAY=$s
17798 if eval $compile; then
17799 case "`$run ./try`" in
17800 yes) stdio_stream_array=$s; break ;;
17806 case "$stdio_stream_array" in
17808 I can't figure out how to access stdio streams by file descriptor number.
17810 d_stdio_stream_array="$undef"
17813 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17815 d_stdio_stream_array="$define"
17819 : see if strcoll exists
17820 set strcoll d_strcoll
17823 : check for structure copying
17825 echo "Checking to see if your C compiler can copy structs..." >&4
17826 $cat >try.c <<'EOCP'
17836 if $cc -c try.c >/dev/null 2>&1 ; then
17838 echo "Yup, it can."
17841 echo "Nope, it can't."
17847 : see if strerror and/or sys_errlist[] exist
17849 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17850 if set strerror val -f d_strerror; eval $csym; $val; then
17851 echo 'strerror() found.' >&4
17852 d_strerror="$define"
17853 d_strerrm='strerror(e)'
17854 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17855 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17856 d_syserrlst="$define"
17858 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17859 d_syserrlst="$undef"
17861 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17862 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17863 echo 'strerror() found in string header.' >&4
17864 d_strerror="$define"
17865 d_strerrm='strerror(e)'
17866 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17867 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17868 d_syserrlst="$define"
17870 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17871 d_syserrlst="$undef"
17873 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17874 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17875 d_strerror="$undef"
17876 d_syserrlst="$define"
17877 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17879 echo 'strerror() and sys_errlist[] NOT found.' >&4
17880 d_strerror="$undef"
17881 d_syserrlst="$undef"
17882 d_strerrm='"unknown"'
17886 : see if strerror_r exists
17887 set strerror_r d_strerror_r
17889 case "$d_strerror_r" in
17891 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17892 case "$d_strerror_r_proto:$usethreads" in
17893 ":define") d_strerror_r_proto=define
17894 set d_strerror_r_proto strerror_r $hdrs
17898 case "$d_strerror_r_proto" in
17900 case "$strerror_r_proto" in
17901 ''|0) try='int strerror_r(int, char*, size_t);'
17902 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
17904 case "$strerror_r_proto" in
17905 ''|0) try='int strerror_r(int, char*, int);'
17906 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
17908 case "$strerror_r_proto" in
17909 ''|0) try='char* strerror_r(int, char*, size_t);'
17910 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
17912 case "$strerror_r_proto" in
17913 ''|0) d_strerror_r=undef
17915 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17916 * ) case "$strerror_r_proto" in
17917 REENTRANT_PROTO*) ;;
17918 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17920 echo "Prototype: $try" ;;
17923 *) case "$usethreads" in
17924 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17931 *) strerror_r_proto=0
17935 : see if strftime exists
17936 set strftime d_strftime
17939 : see if strlcat exists
17940 set strlcat d_strlcat
17943 : see if strlcpy exists
17944 set strlcpy d_strlcpy
17947 : see if strtod exists
17948 set strtod d_strtod
17951 : see if strtol exists
17952 set strtol d_strtol
17955 : see if strtold exists
17956 set strtold d_strtold
17959 : see if strtoll exists
17960 set strtoll d_strtoll
17963 case "$d_longlong-$d_strtoll" in
17966 Checking whether your strtoll() works okay...
17968 $cat >try.c <<'EOCP'
17971 #define strtoll __strtoll
17974 #define strtoll _strtoll
17977 extern long long int strtoll(char *s, char **, int);
17978 static int bad = 0;
17979 int check(char *s, long long ell, int een) {
17982 gll = strtoll(s, 0, 10);
17983 if (!((gll == ell) && (errno == een)))
17987 check(" 1", 1LL, 0);
17988 check(" 0", 0LL, 0);
17989 check("-1", -1LL, 0);
17990 check("-9223372036854775808", -9223372036854775808LL, 0);
17991 check("-9223372036854775808", -9223372036854775808LL, 0);
17992 check(" 9223372036854775807", 9223372036854775807LL, 0);
17993 check("-9223372036854775808", -9223372036854775808LL, 0);
17994 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17995 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18001 if eval $compile; then
18004 ok) echo "Your strtoll() seems to be working okay." ;;
18006 Your strtoll() doesn't seem to be working okay.
18012 echo "(I can't seem to compile the test program--assuming it doesn't)"
18018 : see if strtoq exists
18019 set strtoq d_strtoq
18022 : see if strtoul exists
18023 set strtoul d_strtoul
18026 case "$d_strtoul" in
18029 Checking whether your strtoul() works okay...
18031 $cat >try.c <<'EOCP'
18034 extern unsigned long int strtoul(char *s, char **, int);
18035 static int bad = 0;
18036 void check(char *s, unsigned long eul, int een) {
18039 gul = strtoul(s, 0, 10);
18040 if (!((gul == eul) && (errno == een)))
18044 check(" 1", 1L, 0);
18045 check(" 0", 0L, 0);
18047 case "$longsize" in
18049 $cat >>try.c <<'EOCP'
18050 check("18446744073709551615", 18446744073709551615UL, 0);
18051 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18052 #if 0 /* strtoul() for /^-/ strings is undefined. */
18053 check("-1", 18446744073709551615UL, 0);
18054 check("-18446744073709551614", 2, 0);
18055 check("-18446744073709551615", 1, 0);
18056 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18057 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18062 $cat >>try.c <<'EOCP'
18063 check("4294967295", 4294967295UL, 0);
18064 check("4294967296", 4294967295UL, ERANGE);
18065 #if 0 /* strtoul() for /^-/ strings is undefined. */
18066 check("-1", 4294967295UL, 0);
18067 check("-4294967294", 2, 0);
18068 check("-4294967295", 1, 0);
18069 check("-4294967296", 4294967295UL, ERANGE);
18070 check("-4294967297", 4294967295UL, ERANGE);
18075 : Should we write these tests to be more portable by sprintf-ing
18076 : ~0 and then manipulating that char string as input for strtol?
18079 $cat >>try.c <<'EOCP'
18086 if eval $compile; then
18087 case "`$run ./try`" in
18088 ok) echo "Your strtoul() seems to be working okay." ;;
18090 Your strtoul() doesn't seem to be working okay.
18096 echo "(I can't seem to compile the test program--assuming it doesn't)"
18102 : see if strtoull exists
18103 set strtoull d_strtoull
18106 case "$d_longlong-$d_strtoull" in
18109 Checking whether your strtoull() works okay...
18111 $cat >try.c <<'EOCP'
18114 #define strtoull __strtoull
18117 extern unsigned long long int strtoull(char *s, char **, int);
18118 static int bad = 0;
18119 int check(char *s, long long eull, int een) {
18122 gull = strtoull(s, 0, 10);
18123 if (!((gull == eull) && (errno == een)))
18127 check(" 1", 1LL, 0);
18128 check(" 0", 0LL, 0);
18129 check("18446744073709551615", 18446744073709551615ULL, 0);
18130 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18131 #if 0 /* strtoull() for /^-/ strings is undefined. */
18132 check("-1", 18446744073709551615ULL, 0);
18133 check("-18446744073709551614", 2LL, 0);
18134 check("-18446744073709551615", 1LL, 0);
18135 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18136 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18143 if eval $compile; then
18144 case "`$run ./try`" in
18145 ok) echo "Your strtoull() seems to be working okay." ;;
18147 Your strtoull() doesn't seem to be working okay.
18149 d_strtoull="$undef"
18153 echo "(I can't seem to compile the test program--assuming it doesn't)"
18154 d_strtoull="$undef"
18159 : see if strtouq exists
18160 set strtouq d_strtouq
18163 case "$d_strtouq" in
18166 Checking whether your strtouq() works okay...
18168 $cat >try.c <<'EOCP'
18171 extern unsigned long long int strtouq(char *s, char **, int);
18172 static int bad = 0;
18173 void check(char *s, unsigned long long eull, int een) {
18174 unsigned long long gull;
18176 gull = strtouq(s, 0, 10);
18177 if (!((gull == eull) && (errno == een)))
18181 check(" 1", 1LL, 0);
18182 check(" 0", 0LL, 0);
18183 check("18446744073709551615", 18446744073709551615ULL, 0);
18184 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18185 #if 0 /* strtouq() for /^-/ strings is undefined. */
18186 check("-1", 18446744073709551615ULL, 0);
18187 check("-18446744073709551614", 2LL, 0);
18188 check("-18446744073709551615", 1LL, 0);
18189 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18190 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18198 if eval $compile; then
18199 case "`$run ./try`" in
18200 ok) echo "Your strtouq() seems to be working okay." ;;
18202 Your strtouq() doesn't seem to be working okay.
18208 echo "(I can't seem to compile the test program--assuming it doesn't)"
18214 : see if strxfrm exists
18215 set strxfrm d_strxfrm
18218 : see if symlink exists
18219 set symlink d_symlink
18222 : see if syscall exists
18223 set syscall d_syscall
18226 : see if prototype for syscall is available
18228 set d_syscallproto syscall $i_unistd unistd.h
18231 : see if sysconf exists
18232 set sysconf d_sysconf
18235 : see if system exists
18236 set system d_system
18239 : see if tcgetpgrp exists
18240 set tcgetpgrp d_tcgetpgrp
18243 : see if tcsetpgrp exists
18244 set tcsetpgrp d_tcsetpgrp
18247 : see if prototype for telldir is available
18249 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18252 : see if time exists
18254 if test "X$d_time" = X -o X"$timetype" = X; then
18255 if set time val -f d_time; eval $csym; $val; then
18256 echo 'time() found.' >&4
18258 rp="What is the type returned by time() on this system?"
18259 set time_t timetype long stdio.h sys/types.h
18262 echo 'time() not found, hope that will do.' >&4
18270 : see if timegm exists
18271 set timegm d_timegm
18274 : see if this is a sys/times.h system
18275 set sys/times.h i_systimes
18278 : see if times exists
18280 if set times val -f d_times; eval $csym; $val; then
18281 echo 'times() found.' >&4
18284 case "$i_systimes" in
18285 "$define") inc='sys/times.h';;
18287 rp="What is the type returned by times() on this system?"
18288 set clock_t clocktype long stdio.h sys/types.h $inc
18291 echo 'times() NOT found, hope that will do.' >&4
18296 : see if tmpnam_r exists
18297 set tmpnam_r d_tmpnam_r
18299 case "$d_tmpnam_r" in
18301 hdrs="$i_systypes sys/types.h define stdio.h "
18302 case "$d_tmpnam_r_proto:$usethreads" in
18303 ":define") d_tmpnam_r_proto=define
18304 set d_tmpnam_r_proto tmpnam_r $hdrs
18308 case "$d_tmpnam_r_proto" in
18310 case "$tmpnam_r_proto" in
18311 ''|0) try='char* tmpnam_r(char*);'
18312 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18314 case "$tmpnam_r_proto" in
18315 ''|0) d_tmpnam_r=undef
18317 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18318 * ) case "$tmpnam_r_proto" in
18319 REENTRANT_PROTO*) ;;
18320 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18322 echo "Prototype: $try" ;;
18325 *) case "$usethreads" in
18326 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18333 *) tmpnam_r_proto=0
18337 : see if truncate exists
18338 set truncate d_truncate
18341 : see if ttyname_r exists
18342 set ttyname_r d_ttyname_r
18344 case "$d_ttyname_r" in
18346 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18347 case "$d_ttyname_r_proto:$usethreads" in
18348 ":define") d_ttyname_r_proto=define
18349 set d_ttyname_r_proto ttyname_r $hdrs
18353 case "$d_ttyname_r_proto" in
18355 case "$ttyname_r_proto" in
18356 ''|0) try='int ttyname_r(int, char*, size_t);'
18357 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18359 case "$ttyname_r_proto" in
18360 ''|0) try='int ttyname_r(int, char*, int);'
18361 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18363 case "$ttyname_r_proto" in
18364 ''|0) try='char* ttyname_r(int, char*, int);'
18365 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18367 case "$ttyname_r_proto" in
18368 ''|0) d_ttyname_r=undef
18370 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18371 * ) case "$ttyname_r_proto" in
18372 REENTRANT_PROTO*) ;;
18373 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18375 echo "Prototype: $try" ;;
18378 *) case "$usethreads" in
18379 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18386 *) ttyname_r_proto=0
18390 : see if tzname[] exists
18392 if set tzname val -a d_tzname; eval $csym; $val; then
18394 echo 'tzname[] found.' >&4
18397 echo 'tzname[] NOT found.' >&4
18402 : Check if is a multiplatform env
18404 next|rhapsody|darwin) multiarch="$define" ;;
18406 case "$multiarch" in
18407 ''|[nN]*) multiarch="$undef" ;;
18410 : check for ordering of bytes in a UV
18412 case "$usecrosscompile$multiarch" in
18415 You seem to be either cross-compiling or doing a multiarchitecture build,
18416 skipping the byteorder check.
18422 case "$byteorder" in
18425 In the following, larger digits indicate more significance. A big-endian
18426 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18427 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18428 machines may have weird orders like 3412. A Cray will report 87654321,
18429 an Alpha will report 12345678. If the test program works the default is
18431 I'm now running the test program...
18435 #$i_stdlib I_STDLIB
18437 #include <stdlib.h>
18439 #include <sys/types.h>
18440 typedef $uvtype UV;
18450 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18452 u.l = (UV)0x04030201;
18453 for (i = 0; i < $uvsize; i++)
18454 printf("%c", u.c[i]+'0');
18461 if eval $compile && $run ./try > /dev/null; then
18464 [1-4][1-4][1-4][1-4]|12345678|87654321)
18465 echo "(The test program ran ok.)"
18466 echo "byteorder=$dflt"
18469 ????|????????) echo "(The test program ran ok.)" ;;
18470 *) echo "(The test program didn't run right for some reason.)" ;;
18475 (I can't seem to compile the test program. Guessing big-endian...)
18478 case "$xxx_prompt" in
18480 rp="What is the order of bytes in $uvtype?"
18493 : Checking 32bit aligndness
18496 Checking to see whether you can access character data unalignedly...
18498 case "$d_u32align" in
18499 '') $cat >try.c <<EOCP
18501 #$i_stdlib I_STDLIB
18503 #include <stdlib.h>
18505 #define U32 $u32type
18506 #define BYTEORDER 0x$byteorder
18508 #include <signal.h>
18510 $signal_t bletch(int s) { exit(4); }
18513 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18518 if (sizeof(U32) != 4) {
18519 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18526 signal(SIGBUS, bletch);
18538 for (i = 0; i < 4; i++) {
18539 up = (U32*)(buf + i);
18540 if (! ((*up == 1 << (8*i)) || /* big-endian */
18541 (*up == 1 << (8*(3-i))) /* little-endian */
18545 printf("read failed (%x)\n", *up);
18551 for (i = 0; i < 4; i++) {
18552 up = (U32*)(buf + i);
18554 if (*up != 0xBeef) {
18555 printf("write failed (%x)\n", *up);
18569 if eval $compile_ok; then
18570 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18571 $run ./try 2>&1 >/dev/null
18574 You can access character data pretty unalignedly.
18576 d_u32align="$undef"
18579 It seems that you must access character data in an aligned manner.
18581 d_u32align="$define"
18585 rp='Can you access character data at unaligned addresses?'
18589 [yY]*) d_u32align="$undef" ;;
18590 *) d_u32align="$define" ;;
18597 : see if ualarm exists
18598 set ualarm d_ualarm
18601 : see if umask exists
18605 : see if unordered exists
18606 set unordered d_unordered
18609 : see if unsetenv exists
18610 set unsetenv d_unsetenv
18613 : see if usleep exists
18614 set usleep d_usleep
18617 : see if prototype for usleep is available
18619 set d_usleepproto usleep $i_unistd unistd.h
18622 : see if ustat exists
18626 : see if closedir exists
18627 set closedir d_closedir
18630 case "$d_closedir" in
18633 echo "Checking whether closedir() returns a status..." >&4
18635 #$i_dirent I_DIRENT /**/
18636 #$i_sysdir I_SYS_DIR /**/
18637 #$i_sysndir I_SYS_NDIR /**/
18638 #$i_systypes I_SYS_TYPES /**/
18640 #if defined(I_SYS_TYPES)
18641 #include <sys/types.h>
18643 #if defined(I_DIRENT)
18644 #include <dirent.h>
18645 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18646 #include <sys/dir.h>
18650 #include <sys/ndir.h>
18654 #include <ndir.h> /* may be wrong in the future */
18656 #include <sys/dir.h>
18661 int main() { return closedir(opendir(".")); }
18664 if eval $compile_ok; then
18665 if $run ./try > /dev/null 2>&1 ; then
18666 echo "Yes, it does."
18669 echo "No, it doesn't."
18673 echo "(I can't seem to compile the test program--assuming it doesn't)"
18681 set d_void_closedir
18685 : see if there is a wait4
18689 : see if waitpid exists
18690 set waitpid d_waitpid
18693 : see if wcstombs exists
18694 set wcstombs d_wcstombs
18697 : see if wctomb exists
18698 set wctomb d_wctomb
18701 : see if writev exists
18702 set writev d_writev
18705 : preserve RCS keywords in files with variable substitution, grrr
18710 Revision='$Revision'
18712 : check for alignment requirements
18714 case "$usecrosscompile$multiarch" in
18717 You seem to be either cross-compiling or doing a multiarchitecture build,
18718 skipping the memory alignment check.
18721 case "$alignbytes" in
18722 '') alignbytes=8 ;;
18726 case "$alignbytes" in
18727 '') echo "Checking alignment constraints..." >&4
18728 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18729 $cat >try.c <<'EOCP'
18730 typedef long double NV;
18733 $cat >try.c <<'EOCP'
18737 $cat >>try.c <<'EOCP'
18745 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18750 if eval $compile_ok; then
18754 echo "(I can't seem to compile the test program...)"
18757 *) dflt="$alignbytes"
18760 rp="Doubles must be aligned on a how-many-byte boundary?"
18768 : set the base revision
18771 : how do we concatenate cpp tokens here?
18773 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18774 $cat >cpp_stuff.c <<'EOCP'
18775 #define RCAT(a,b)a/**/b
18776 #define ACAT(a,b)a ## b
18780 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18781 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18782 echo "Oh! Smells like ANSI's been here." >&4
18783 echo "We can catify or stringify, separately or together!"
18785 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18786 echo "Ah, yes! The good old days!" >&4
18787 echo "However, in the good old days we don't know how to stringify and"
18788 echo "catify at the same time."
18792 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18793 You're going to have to edit the values of CAT[2-5] in config.h...
18795 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18799 : see if this is a db.h system
18805 : Check db version.
18807 echo "Checking Berkeley DB version ..." >&4
18813 #include <sys/types.h>
18815 #$i_stdlib I_STDLIB
18817 #include <stdlib.h>
18820 int main(int argc, char *argv[])
18822 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18823 int Major, Minor, Patch ;
18824 unsigned long Version ;
18825 (void)db_version(&Major, &Minor, &Patch) ;
18827 printf("%d %d %d %d %d %d\n",
18828 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18829 Major, Minor, Patch);
18832 printf("You have Berkeley DB Version 2 or greater.\n");
18834 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18835 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18836 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18837 Major, Minor, Patch) ;
18839 /* check that db.h & libdb are compatible */
18840 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18841 printf("db.h and libdb are incompatible.\n") ;
18845 printf("db.h and libdb are compatible.\n") ;
18847 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18848 + DB_VERSION_PATCH ;
18850 /* needs to be >= 2.3.4 */
18851 if (Version < 2003004) {
18852 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18853 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18859 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18864 printf("You have Berkeley DB Version 1.\n");
18865 exit(0); /* DB version < 2: the coast is clear. */
18867 exit(1); /* <db.h> not Berkeley DB? */
18873 if eval $compile_ok && $run ./try; then
18874 echo 'Looks OK.' >&4
18876 db_version_major=$1
18877 db_version_minor=$2
18878 db_version_patch=$3
18880 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18884 : Remove db from list of libraries to use
18885 echo "Removing unusable -ldb from library list" >&4
18886 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18889 echo "libs = $libs" >&4
18899 : Check the return type needed for hash
18901 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18907 #include <sys/types.h>
18910 #ifndef DB_VERSION_MAJOR
18911 u_int32_t hash_cb (ptr, size)
18919 info.hash = hash_cb;
18923 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18924 if $contains warning try.out >>/dev/null 2>&1 ; then
18927 db_hashtype='u_int32_t'
18930 : XXX Maybe we should just give up here.
18931 db_hashtype=u_int32_t
18933 echo "Help: I can't seem to compile the db test program." >&4
18934 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18937 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18939 *) db_hashtype=u_int32_t
18944 : Check the return type needed for prefix
18946 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18952 #include <sys/types.h>
18955 #ifndef DB_VERSION_MAJOR
18956 size_t prefix_cb (key1, key2)
18964 info.prefix = prefix_cb;
18968 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18969 if $contains warning try.out >>/dev/null 2>&1 ; then
18970 db_prefixtype='int'
18972 db_prefixtype='size_t'
18975 db_prefixtype='size_t'
18976 : XXX Maybe we should just give up here.
18978 echo "Help: I can't seem to compile the db test program." >&4
18979 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18982 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18984 *) db_prefixtype='size_t'
18988 : How can we generate normalized random numbers ?
18990 echo "Looking for a random number function..." >&4
18991 case "$randfunc" in
18993 if set drand48 val -f; eval $csym; $val; then
18995 echo "Good, found drand48()." >&4
18996 elif set random val -f; eval $csym; $val; then
18998 echo "OK, found random()." >&4
19001 echo "Yick, looks like I have to use rand()." >&4
19012 *-Dmy_rand=*|*-Dmy_srand=*)
19013 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19014 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19015 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19016 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19020 while $test "$cont"; do
19021 rp="Use which function to generate random numbers?"
19023 if $test "$ans" = "$dflt"; then
19029 if set $ans val -f; eval $csym; $val; then
19033 rp="I cannot find function $ans. Use that name anyway?"
19042 case "$randfunc" in
19044 drand01="drand48()"
19050 case "$randbits" in
19052 echo "Checking to see how many bits your $randfunc() function produces..." >&4
19054 #$i_unistd I_UNISTD
19055 #$i_stdlib I_STDLIB
19058 # include <unistd.h>
19061 # include <stdlib.h>
19066 register unsigned long tmp;
19067 register unsigned long max = 0L;
19069 for (i = 1000; i; i--) {
19070 tmp = (unsigned long) $randfunc();
19071 if (tmp > max) max = tmp;
19073 for (i = 0; max; i++)
19079 if eval $compile_ok; then
19083 echo "(I can't seem to compile the test program...)"
19090 rp="How many bits does your $randfunc() function produce?"
19094 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19095 seedfunc="s$randfunc"
19096 randseedtype=unsigned
19100 rp="How many bits does your $randfunc() function produce?"
19103 seedfunc="s$randfunc"
19104 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19105 if set $seedfunc val -f; eval $csym; $val; then
19106 echo "(Using $seedfunc() to seed random generator)"
19108 echo "(Warning: no $seedfunc() to seed random generator)"
19111 randseedtype=unsigned
19118 : Determine if this is an EBCDIC system
19120 echo "Determining whether or not we are on an EBCDIC system..." >&4
19121 $cat >try.c <<'EOM'
19124 if ('M'==0xd4) return 0;
19131 if eval $compile_ok; then
19132 if $run ./try; then
19133 echo "You seem to speak EBCDIC." >&4
19136 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19139 echo "I'm unable to compile the test program." >&4
19140 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19146 : Check how to flush
19149 Checking how to flush all pending stdio output...
19151 # I only know how to find the first 32 possibly open files on SunOS.
19152 # See also hints/sunos_4_1.sh and util.c --AD
19154 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19156 $cat >>try.c <<EOCP
19158 #$i_stdlib I_STDLIB
19160 #include <stdlib.h>
19162 #$i_unistd I_UNISTD
19164 # include <unistd.h>
19166 #$d_sysconf HAS_SYSCONF
19167 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19168 #ifdef HAS_STDIO_STREAM_ARRAY
19169 # define STDIO_STREAM_ARRAY $stdio_stream_array
19174 p = fopen("try.out", "w");
19178 # ifdef TRY_FPRINTF
19182 #ifdef TRY_FFLUSH_NULL
19185 #ifdef TRY_FFLUSH_ALL
19187 long open_max = -1;
19188 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19189 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19191 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19192 open_max = sysconf(_SC_OPEN_MAX);
19195 open_max = FOPEN_MAX;
19198 open_max = OPEN_MAX;
19207 # ifdef HAS_STDIO_STREAM_ARRAY
19208 if (open_max > 0) {
19210 for (i = 0; i < open_max; i++)
19211 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19212 STDIO_STREAM_ARRAY[i]._file < open_max &&
19213 STDIO_STREAM_ARRAY[i]._flag)
19214 fflush(&STDIO_STREAM_ARRAY[i]);
19222 : first we have to find out how _not_ to flush
19224 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19226 set try -DTRY_FPUTC
19227 if eval $compile; then
19228 $run ./try 2>/dev/null
19231 if $test ! -s try.out -a "X$code" = X42; then
19237 set try -DTRY_FPRINTF
19238 if eval $compile; then
19239 $run ./try 2>/dev/null
19242 if $test ! -s try.out -a "X$code" = X42; then
19243 output=-DTRY_FPRINTF
19249 : check for fflush NULL behaviour
19250 case "$fflushNULL" in
19251 '') set try -DTRY_FFLUSH_NULL $output
19252 if eval $compile; then
19253 $run ./try 2>/dev/null
19256 if $test -s try.out -a "X$code" = X42; then
19257 fflushNULL="`$cat try.out`"
19259 if $test "X$code" != X42; then
19261 (If this test failed, don't worry, we'll try another method shortly.)
19266 $rm -f core try.core core.try.*
19267 case "$fflushNULL" in
19269 Your fflush(NULL) works okay for output streams.
19270 Let's see if it clobbers input pipes...
19272 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19273 # bug that improperly flushes the input end of pipes. So we avoid the
19274 # autoflush on fork/system/exec support for now. :-(
19275 $cat >tryp.c <<EOCP
19278 main(int argc, char **argv)
19284 while ((i = getc(stdin)) != -1
19285 && (*bp++ = i) != '\n'
19286 && bp < &buf[1024])
19289 fprintf(stdout, "%s", buf);
19297 fflushNULL="$define"
19299 if eval $compile; then
19301 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19302 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19304 fflush(NULL) seems to behave okay with input streams.
19306 fflushNULL="$define"
19309 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19311 fflushNULL="$undef"
19314 $rm -f core tryp.c tryp.core core.tryp.*
19317 Your fflush(NULL) isn't working (contrary to ANSI C).
19319 fflushNULL="$undef"
19322 Cannot figure out whether your fflush(NULL) works or not.
19323 I'm assuming it doesn't (contrary to ANSI C).
19325 fflushNULL="$undef"
19329 $define|true|[yY]*)
19330 fflushNULL="$define"
19333 fflushNULL="$undef"
19336 : check explicit looping only if NULL did not work, and if the pipe
19337 : bug does not show up on an explicit flush too
19338 case "$fflushNULL" in
19340 $cat >tryp.c <<EOCP
19343 main(int argc, char **argv)
19349 while ((i = getc(stdin)) != -1
19350 && (*bp++ = i) != '\n'
19351 && bp < &buf[1024])
19354 fprintf(stdout, "%s", buf);
19363 if eval $compile; then
19365 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19366 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19368 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19370 : now check for fflushall behaviour
19371 case "$fflushall" in
19372 '') set try -DTRY_FFLUSH_ALL $output
19373 if eval $compile; then
19375 (Now testing the other method--but note that this also may fail.)
19377 $run ./try 2>/dev/null
19380 if $test -s try.out -a "X$code" = X42; then
19381 fflushall="`$cat try.out`"
19385 case "$fflushall" in
19387 Whew. Flushing explicitly all the stdio streams works.
19389 fflushall="$define"
19392 Sigh. Flushing explicitly all the stdio streams doesn't work.
19397 Cannot figure out whether flushing stdio streams explicitly works or not.
19398 I'm assuming it doesn't.
19404 "$define"|true|[yY]*)
19405 fflushall="$define"
19413 All is futile. Even fflush(stdin) clobbers input pipes!
19420 $rm -f core tryp.c tryp.core core.tryp.*
19422 *) fflushall="$undef"
19426 case "$fflushNULL$fflushall" in
19429 OK, I give up. I cannot figure out how to flush pending stdio output.
19430 We won't be flushing handles at all before fork/exec/popen.
19436 : Store the full pathname to the ar program for use in the C program
19437 : Respect a hint or command line value for full_ar.
19442 : Store the full pathname to the sed program for use in the C program
19445 : see what type gids are declared as in the kernel
19447 echo "Looking for the type for group ids returned by getgid()."
19448 set gid_t gidtype xxx stdio.h sys/types.h
19452 xxx=`./findhdr sys/user.h`
19453 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19455 unsigned) dflt="$1 $2" ;;
19459 *) dflt="$gidtype";;
19462 gid_t) echo "gid_t found." ;;
19463 *) rp="What is the type for group ids returned by getgid()?"
19469 : Check the size of GID
19472 *_t) zzz="$gidtype" ;;
19475 echo "Checking the size of $zzz..." >&4
19477 #include <sys/types.h>
19479 #$i_stdlib I_STDLIB
19481 #include <stdlib.h>
19484 printf("%d\n", (int)sizeof($gidtype));
19489 if eval $compile_ok; then
19493 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19496 echo "Your $zzz is $gidsize bytes long."
19501 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19505 : Check if GID is signed
19508 *_t) zzz="$gidtype" ;;
19511 echo "Checking the sign of $zzz..." >&4
19513 #include <sys/types.h>
19524 if eval $compile; then
19528 echo "(I can't execute the test program--guessing unsigned.)" >&4
19532 1) echo "Your $zzz is unsigned." ;;
19533 -1) echo "Your $zzz is signed." ;;
19539 echo "(I can't compile the test program--guessing unsigned.)" >&4
19543 : Check 64bit sizes
19546 if $test X"$quadtype" != X; then
19548 echo "Checking how to print 64-bit integers..." >&4
19550 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19551 $cat >try.c <<'EOCP'
19552 #include <sys/types.h>
19555 int q = 12345678901;
19556 printf("%ld\n", q);
19560 if eval $compile; then
19564 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19565 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19566 echo "We will use %d."
19572 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19573 $cat >try.c <<'EOCP'
19574 #include <sys/types.h>
19577 long q = 12345678901;
19578 printf("%ld\n", q);
19582 if eval $compile; then
19586 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19587 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19588 echo "We will use %ld."
19594 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19595 $cat >try.c <<'EOCP'
19596 #include <sys/types.h>
19597 #include <inttypes.h>
19600 int64_t q = 12345678901;
19601 printf("%" PRId64 "\n", q);
19605 if eval $compile; then
19609 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19610 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19611 echo "We will use the C9X style."
19617 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19619 #include <sys/types.h>
19622 $quadtype q = 12345678901;
19623 printf("%Ld\n", q);
19627 if eval $compile; then
19631 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19632 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19633 echo "We will use %Ld."
19639 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19640 $cat >try.c <<'EOCP'
19641 #include <sys/types.h>
19644 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19645 printf("%lld\n", q);
19649 if eval $compile; then
19653 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19654 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19655 echo "We will use the %lld style."
19661 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19663 #include <sys/types.h>
19666 $quadtype q = 12345678901;
19667 printf("%qd\n", q);
19671 if eval $compile; then
19675 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19676 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19677 echo "We will use %qd."
19683 if $test X"$sPRId64" = X; then
19684 echo "Cannot figure out how to print 64-bit integers." >&4
19691 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19692 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19694 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19695 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19699 : Check format strings for internal types
19701 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19703 if $test X"$ivsize" = X8; then
19704 ivdformat="$sPRId64"
19705 uvuformat="$sPRIu64"
19706 uvoformat="$sPRIo64"
19707 uvxformat="$sPRIx64"
19708 uvXUformat="$sPRIXU64"
19710 if $test X"$ivsize" = X"$longsize"; then
19717 if $test X"$ivsize" = X"$intsize"; then
19725 if $test X"$ivsize" = X"$shortsize"; then
19736 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19737 nveformat="$sPRIeldbl"
19738 nvfformat="$sPRIfldbl"
19739 nvgformat="$sPRIgldbl"
19740 nvEUformat="$sPRIEUldbl"
19741 nvFUformat="$sPRIFUldbl"
19742 nvGUformat="$sPRIGUldbl"
19752 case "$ivdformat" in
19753 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19758 : Check format string for GID
19761 $echo "Checking the format string to be used for gids..." >&4
19764 -1) if $test X"$gidsize" = X"$ivsize"; then
19765 gidformat="$ivdformat"
19767 if $test X"$gidsize" = X"$longsize"; then
19770 if $test X"$gidsize" = X"$intsize"; then
19773 if $test X"$gidsize" = X"$shortsize"; then
19780 *) if $test X"$gidsize" = X"$uvsize"; then
19781 gidformat="$uvuformat"
19783 if $test X"$gidsize" = X"$longsize"; then
19786 if $test X"$gidsize" = X"$intsize"; then
19789 if $test X"$gidsize" = X"$shortsize"; then
19798 : see if getgroups exists
19799 set getgroups d_getgrps
19802 : see if setgroups exists
19803 set setgroups d_setgrps
19806 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19808 case "$d_getgrps$d_setgrps" in
19810 case "$groupstype" in
19811 '') dflt="$gidtype" ;;
19812 *) dflt="$groupstype" ;;
19815 What type of pointer is the second argument to getgroups() and setgroups()?
19816 Usually this is the same as group ids, $gidtype, but not always.
19819 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19823 *) groupstype="$gidtype";;
19826 : MAD = Misc Attribute Definition
19828 if $test $patchlevel -lt 9; then
19829 : MAD is not available in 5.8.x or earlier.
19833 $define|true|[yY]*) dflt='y' ;;
19838 Would you like to build with Misc Attribute Decoration? This is development
19839 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19840 overhead on the interpreter.
19842 If this doesn't make any sense to you, just accept the default '$dflt'.
19844 rp='Build Perl with MAD?'
19849 madlyh='madly.h madly.act madly.tab'
19851 madlyobj="madly$_o" ;;
19860 : check whether make sets MAKE
19862 echo "Checking if your $make program sets \$(MAKE)..." >&4
19863 case "$make_set_make" in
19865 $sed 's/^X //' > testmake.mak << 'EOF'
19867 X @echo 'maketemp="$(MAKE)"'
19869 case "`$make -f testmake.mak 2>/dev/null`" in
19870 *maketemp=*) make_set_make='#' ;;
19871 *) make_set_make="MAKE=$make" ;;
19873 $rm -f testmake.mak
19876 case "$make_set_make" in
19877 '#') echo "Yup, it does.";;
19878 *) echo "Nope, it doesn't.";;
19881 : see what type is used for mode_t
19882 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19883 set mode_t modetype int stdio.h sys/types.h
19886 : see if we need va_copy
19888 case "$i_stdarg" in
19891 #include <stdarg.h>
19893 #$i_stdlib I_STDLIB
19895 #include <stdlib.h>
19897 #include <signal.h>
19900 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19902 return vfprintf(f, fmt, *valp);
19906 myvfprintf(FILE *f, const char *fmt, va_list val)
19908 return ivfprintf(f, fmt, &val);
19912 myprintf(char *fmt, ...)
19915 va_start(val, fmt);
19916 return myvfprintf(stdout, fmt, val);
19920 main(int ac, char **av)
19922 signal(SIGSEGV, exit);
19924 myprintf("%s%cs all right, then\n", "that", '\'');
19929 if eval $compile && $run ./try 2>&1 >/dev/null; then
19930 case "`$run ./try`" in
19931 "that's all right, then")
19937 yes) echo "It seems that you don't need va_copy()." >&4
19938 need_va_copy="$undef"
19940 *) echo "It seems that va_copy() or similar will be needed." >&4
19941 need_va_copy="$define"
19946 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19950 : see what type is used for size_t
19951 rp="What is the type used for the length parameter for string functions?"
19952 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19955 : check for type of arguments to gethostbyaddr.
19956 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19957 case "$d_gethbyaddr" in
19961 Checking to see what type of arguments are accepted by gethostbyaddr().
19963 hdrs="$define sys/types.h
19964 $d_socket sys/socket.h
19965 $i_niin netinet/in.h
19967 $i_unistd unistd.h"
19968 : The first arg can 'char *' or 'void *'
19969 : The second arg is some of integral type
19970 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19971 for yyy in size_t long int; do
19972 case "$netdb_host_type" in
19973 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
19974 if ./protochk "$try" $hdrs; then
19975 echo "Your system accepts $xxx for the first arg."
19976 echo "...and $yyy for the second arg."
19977 netdb_host_type="$xxx"
19978 netdb_hlen_type="$yyy"
19984 : In case none of those worked, prompt the user.
19985 case "$netdb_host_type" in
19986 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19989 netdb_host_type=$ans
19990 rp='What is the type for the 2nd argument to gethostbyaddr?'
19993 netdb_hlen_type=$ans
19997 *) : no gethostbyaddr, so pick harmless defaults
19998 netdb_host_type='char *'
19999 netdb_hlen_type="$sizetype"
20002 # Remove the "const" if needed. -- but then we'll have a
20004 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20007 : check for type of argument to gethostbyname.
20008 if test "X$netdb_name_type" = X ; then
20009 case "$d_gethbyname" in
20013 Checking to see what type of argument is accepted by gethostbyname().
20015 hdrs="$define sys/types.h
20016 $d_socket sys/socket.h
20017 $i_niin netinet/in.h
20019 $i_unistd unistd.h"
20020 for xxx in "const char *" "char *"; do
20021 case "$netdb_name_type" in
20022 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20023 if ./protochk "$try" $hdrs; then
20024 echo "Your system accepts $xxx."
20025 netdb_name_type="$xxx"
20030 : In case none of those worked, prompt the user.
20031 case "$netdb_name_type" in
20032 '') rp='What is the type for the 1st argument to gethostbyname?'
20035 netdb_name_type=$ans
20039 *) : no gethostbyname, so pick harmless default
20040 netdb_name_type='char *'
20045 : check for type of 1st argument to getnetbyaddr.
20046 if test "X$netdb_net_type" = X ; then
20047 case "$d_getnbyaddr" in
20051 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20053 hdrs="$define sys/types.h
20054 $d_socket sys/socket.h
20055 $i_niin netinet/in.h
20057 $i_unistd unistd.h"
20058 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20059 case "$netdb_net_type" in
20060 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20061 if ./protochk "$try" $hdrs; then
20062 echo "Your system accepts $xxx."
20063 netdb_net_type="$xxx"
20068 : In case none of those worked, prompt the user.
20069 case "$netdb_net_type" in
20070 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20073 netdb_net_type=$ans
20077 *) : no getnetbyaddr, so pick harmless default
20078 netdb_net_type='long'
20082 : locate the preferred pager for this system
20089 [a-zA-Z]:/*) dflt=$pg;;
20093 [a-zA-Z]:/*) dflt=$more;;
20097 [a-zA-Z]:/*) dflt=$less;;
20100 '') dflt=/usr/ucb/more;;
20108 rp='What pager is used on your system?'
20112 : see what type pids are declared as in the kernel
20113 rp="What is the type of process ids on this system?"
20114 set pid_t pidtype int stdio.h sys/types.h
20117 : see if ar generates random libraries by itself
20119 echo "Checking how to generate random libraries on your machine..." >&4
20120 echo 'int bar1() { return bar2(); }' > bar1.c
20121 echo 'int bar2() { return 2; }' > bar2.c
20123 #$i_stdlib I_STDLIB
20125 #include <stdlib.h>
20127 int main() { printf("%d\n", bar1()); exit(0); }
20129 $cc $ccflags -c bar1.c >/dev/null 2>&1
20130 $cc $ccflags -c bar2.c >/dev/null 2>&1
20131 $cc $ccflags -c foo.c >/dev/null 2>&1
20132 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20133 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20134 $run ./foobar >/dev/null 2>&1; then
20135 echo "$ar appears to generate random libraries itself."
20137 if [ "X$ranlib" = "X" ]; then
20140 elif $ar s bar$_a >/dev/null 2>&1 &&
20141 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20142 $run ./foobar >/dev/null 2>&1; then
20143 echo "a table of contents needs to be added with '$ar s'."
20146 elif $ar ts bar$_a >/dev/null 2>&1 &&
20147 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20148 $run ./foobar >/dev/null 2>&1; then
20149 echo "a table of contents needs to be added with '$ar ts'."
20156 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20157 $test -f $ranlib || ranlib=''
20160 if $test -n "$ranlib"; then
20161 echo "your system has '$ranlib'; we'll use that."
20164 echo "your system doesn't seem to support random libraries"
20165 echo "so we'll use lorder and tsort to order the libraries."
20172 : see if this is a values.h system
20173 set values.h i_values
20176 : Check the max offset that gmtime and localtime accept
20177 echo "Checking max offsets that gmtime () accepts"
20180 define) yyy="#include <values.h>" ;;
20184 case "$sGMTIME_min/$sGMTIME_max" in
20187 #include <sys/types.h>
20196 void gm_check (time_t t, int min_year, int max_year)
20199 if ( tmp == NULL ||
20200 /* Check tm_year overflow */
20201 tmp->tm_year < min_year || tmp->tm_year > max_year)
20212 gm_check (MAXLONG, 69, 0x7fffffff);
20214 if (tmp == NULL || tmp->tm_year < 0) {
20215 for (i = 63; i >= 0; i--) {
20216 time_t x = pt | ((time_t)1 << i);
20217 if (x < 0 || x < pt) continue;
20218 gm_check (x, 69, 0x7fffffff);
20221 printf ("sGMTIME_max=%ld\n", pt);
20230 gm_check (MINLONG, -1900, 70);
20233 for (i = 36; i >= 0; i--) {
20234 time_t x = pt - ((time_t)1 << i);
20235 if (x > 0) continue;
20236 gm_check (x, -1900, 70);
20239 printf ("sGMTIME_min=%ld\n", pt);
20243 int main (int argc, char *argv[])
20245 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20252 if eval $compile; then
20255 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20261 echo "Checking max offsets that localtime () accepts"
20263 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20266 #include <sys/types.h>
20275 void local_check (time_t t, int min_year, int max_year)
20277 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20280 tmp = localtime (&t);
20281 if ( tmp == NULL ||
20282 /* Check tm_year overflow */
20283 tmp->tm_year < min_year || tmp->tm_year > max_year)
20287 } /* local_check */
20294 local_check (MAXLONG, 69, 0x7fffffff);
20296 if (tmp == NULL || tmp->tm_year < 0) {
20297 for (i = 63; i >= 0; i--) {
20298 time_t x = pt | ((time_t)1 << i);
20299 if (x < 0 || x < pt) continue;
20300 local_check (x, 69, 0x7fffffff);
20303 printf ("sLOCALTIME_max=%ld\n", pt);
20312 local_check (MINLONG, -1900, 70);
20315 for (i = 36; i >= 0; i--) {
20316 time_t x = pt - ((time_t)1 << i);
20317 if (x > 0) continue;
20318 local_check (x, -1900, 70);
20321 printf ("sLOCALTIME_min=%ld\n", pt);
20325 int main (int argc, char *argv[])
20333 if eval $compile; then
20336 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20342 : check for type of arguments to select.
20343 case "$selecttype" in
20344 '') case "$d_select" in
20348 Checking to see what type of arguments are accepted by select().
20350 hdrs="$define sys/types.h
20351 $i_systime sys/time.h
20352 $i_sysselct sys/select.h
20353 $d_socket sys/socket.h"
20354 : The first arg can be int, unsigned, or size_t
20355 : The last arg may or may not be 'const'
20357 : void pointer has been seen but using that
20358 : breaks the selectminbits test
20359 for xxx in 'fd_set *' 'int *'; do
20360 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20361 for tmo in 'struct timeval *' 'const struct timeval *'; do
20363 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20364 if ./protochk "$try" $hdrs; then
20365 echo "Your system accepts $xxx."
20374 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20375 case "$d_fd_set" in
20376 $define) dflt="fd_set *" ;;
20385 *) : no select, so pick a harmless default
20392 : check for the select 'width'
20393 case "$selectminbits" in
20394 '') safebits=`expr $ptrsize \* 8`
20395 case "$d_select" in
20399 Checking to see on how many bits at a time your select() operates...
20402 #include <sys/types.h>
20404 #$i_systime I_SYS_TIME
20405 #$i_systimek I_SYS_TIME_KERNEL
20410 # ifdef I_SYS_TIME_KERNEL
20413 # include <sys/time.h>
20414 # ifdef I_SYS_TIME_KERNEL
20418 #$i_sysselct I_SYS_SELECT
20419 #ifdef I_SYS_SELECT
20420 #include <sys/select.h>
20422 #$d_socket HAS_SOCKET
20424 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20427 #$i_stdlib I_STDLIB
20429 #include <stdlib.h>
20432 #define S sizeof(*(b))
20434 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20435 #define NBITS (NBYTES * 8)
20437 char *s = (char *)malloc(NBYTES);
20446 fp = fopen("try.c", "r");
20452 b = ($selecttype)s;
20453 for (i = 0; i < NBITS; i++)
20457 select(fd + 1, b, 0, 0, &t);
20458 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20460 printf("%d\n", i + 1);
20465 if eval $compile_ok; then
20466 selectminbits=`$run ./try`
20467 case "$selectminbits" in
20469 Cannot figure out on how many bits at a time your select() operates.
20470 I'll play safe and guess it is $safebits bits.
20472 selectminbits=$safebits
20473 bits="$safebits bits"
20476 *) bits="$selectminbits bits" ;;
20478 echo "Your select() operates on $bits at a time." >&4
20480 rp='What is the minimum number of bits your select() operates on?'
20481 case "$byteorder" in
20482 12345678) dflt=64 ;;
20488 selectminbits="$val"
20492 *) : no select, so pick a harmless default
20493 selectminbits=$safebits
20499 : Trace out the files included by signal.h, then look for SIGxxx names.
20500 if [ "X$fieldn" = X ]; then
20501 : Just make some guesses. We check them later.
20502 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20504 xxx=`echo '#include <signal.h>' |
20505 $cppstdin $cppminus $cppflags 2>/dev/null |
20506 $grep '^[ ]*#.*include' |
20507 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20508 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20511 for xx in $xxx /dev/null ; do
20512 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20514 case "$xxxfiles" in
20515 '') xxxfiles=`./findhdr signal.h` ;;
20518 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20519 print substr($2, 4, 20)
20521 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20522 print substr($3, 4, 20)
20524 : Append some common names just in case the awk scan failed.
20525 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20526 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20527 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20528 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20529 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20531 : generate a few handy files for later
20532 $cat > signal.c <<EOCP
20533 #include <sys/types.h>
20534 #include <signal.h>
20535 #$i_stdlib I_STDLIB
20537 #include <stdlib.h>
20542 /* Strange style to avoid deeply-nested #if/#else/#endif */
20545 # define NSIG (_NSIG)
20551 # define NSIG (SIGMAX+1)
20557 # define NSIG (SIG_MAX+1)
20563 # define NSIG (_SIG_MAX+1)
20569 # define NSIG (MAXSIG+1)
20575 # define NSIG (MAX_SIG+1)
20580 # ifdef SIGARRAYSIZE
20581 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20587 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20591 /* Default to some arbitrary number that's big enough to get most
20592 of the common signals.
20598 printf("NSIG %d\n", NSIG);
20604 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20606 printf "#ifdef SIG"; printf $1; printf "\n"
20607 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20608 printf $1; printf ");\n"
20612 printf "#endif /* JUST_NSIG */\n";
20613 printf "exit(0);\n}\n";
20616 $cat >signal.awk <<'EOP'
20617 BEGIN { ndups = 0 }
20618 $1 ~ /^NSIG$/ { nsig = $2 }
20619 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20620 if ($2 > maxsig) { maxsig = $2 }
20621 if (sig_name[$2]) {
20622 dup_name[ndups] = $1
20623 dup_num[ndups] = $2
20635 printf("NSIG %d\n", nsig);
20636 for (n = 1; n < nsig; n++) {
20638 printf("%s %d\n", sig_name[n], sig_num[n])
20641 printf("NUM%d %d\n", n, n)
20644 for (n = 0; n < ndups; n++) {
20645 printf("%s %d\n", dup_name[n], dup_num[n])
20649 $cat >signal_cmd <<EOS
20651 if $test -s signal.lst; then
20652 echo "Using your existing signal.lst file"
20657 $cat >>signal_cmd <<'EOS'
20660 if eval $compile_ok; then
20661 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20662 $uniq | $awk -f signal.awk >signal.lst
20664 echo "(I can't seem be able to compile the whole test program)" >&4
20665 echo "(I'll try it in little pieces.)" >&4
20666 set signal -DJUST_NSIG
20667 if eval $compile_ok; then
20668 $run ./signal$_exe > signal.nsg
20671 echo "I can't seem to figure out how many signals you have." >&4
20672 echo "Guessing 50." >&4
20673 echo 'NSIG 50' > signal.nsg
20675 : Now look at all the signal names, one at a time.
20676 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20677 $cat > signal.c <<EOCP
20678 #include <sys/types.h>
20679 #include <signal.h>
20682 printf("$xx %d\n", SIG${xx});
20687 if eval $compile; then
20688 echo "SIG${xx} found."
20689 $run ./signal$_exe >> signal.ls1
20691 echo "SIG${xx} NOT found."
20694 if $test -s signal.ls1; then
20695 $cat signal.nsg signal.ls1 |
20696 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20700 if $test -s signal.lst; then
20703 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20704 echo 'kill -l' >signal
20705 set X `csh -f <signal`
20709 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20711 echo $@ | $tr ' ' $trnl | \
20712 $awk '{ printf "%s %d\n", $1, ++s; }
20713 END { printf "NSIG %d\n", ++s }' >signal.lst
20715 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20717 chmod a+x signal_cmd
20718 $eunicefix signal_cmd
20720 : generate list of signal names
20722 case "$sig_name_init" in
20724 *) case "$sig_num_init" in
20725 ''|*,*) doinit=yes ;;
20730 echo "Generating a list of signal names and numbers..." >&4
20732 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20733 sig_name=`$awk 'BEGIN { printf "ZERO " }
20734 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20735 sig_num=`$awk 'BEGIN { printf "0 " }
20736 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20737 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20738 !/^NSIG/ { printf "\"%s\", ", $1 }
20739 END { printf "0\n" }' signal.lst`
20740 sig_num_init=`$awk 'BEGIN { printf "0, " }
20741 !/^NSIG/ { printf "%d, ", $2}
20742 END { printf "0\n"}' signal.lst`
20745 echo "The following $sig_count signals are available:"
20747 echo $sig_name | $awk \
20748 'BEGIN { linelen = 0 }
20750 for (i = 1; i <= NF; i++) {
20751 name = "SIG" $i " "
20752 linelen = linelen + length(name)
20753 if (linelen > 70) {
20755 linelen = length(name)
20761 sig_size=`echo $sig_name | awk '{print NF}'`
20762 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20764 : Check size of size
20766 case "$sizetype" in
20767 *_t) zzz="$sizetype" ;;
20768 *) zzz="filesize" ;;
20770 echo "Checking the size of $zzz..." >&4
20772 #include <sys/types.h>
20774 #$i_stdlib I_STDLIB
20776 #include <stdlib.h>
20779 printf("%d\n", (int)sizeof($sizetype));
20784 if eval $compile_ok; then
20788 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20791 echo "Your $zzz size is $sizesize bytes."
20796 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20800 : check for socklen_t
20802 echo "Checking to see if you have socklen_t..." >&4
20804 #include <sys/types.h>
20805 #$d_socket HAS_SOCKET
20807 #include <sys/socket.h>
20809 int main() { socklen_t x = 16; }
20812 if eval $compile; then
20814 echo "You have socklen_t."
20817 echo "You do not have socklen_t."
20818 case "$sizetype" in
20819 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20826 : see if this is a socks.h system
20827 set socks.h i_socks
20830 : check for type of the size argument to socket calls
20831 case "$d_socket" in
20835 Checking to see what type is the last argument of accept().
20838 case "$d_socklen_t" in
20839 "$define") yyy="$yyy socklen_t"
20841 yyy="$yyy $sizetype int long unsigned"
20842 for xxx in $yyy; do
20843 case "$socksizetype" in
20844 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
20845 case "$usesocks" in
20847 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20848 echo "Your system accepts '$xxx *' for the last argument of accept()."
20849 socksizetype="$xxx"
20852 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20853 echo "Your system accepts '$xxx *' for the last argument of accept()."
20854 socksizetype="$xxx"
20861 : In case none of those worked, prompt the user.
20862 case "$socksizetype" in
20863 '') rp='What is the type for socket address structure sizes?'
20870 *) : no sockets, so pick relatively harmless default
20875 : see what type is used for signed size_t
20876 set ssize_t ssizetype int stdio.h sys/types.h
20881 #$i_stdlib I_STDLIB
20883 #include <stdlib.h>
20885 #include <sys/types.h>
20886 #define Size_t $sizetype
20887 #define SSize_t $dflt
20890 if (sizeof(Size_t) == sizeof(SSize_t))
20892 else if (sizeof(Size_t) == sizeof(int))
20901 if eval $compile_ok && $run ./try > /dev/null; then
20902 ssizetype=`$run ./try`
20903 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20906 Help! I can't compile and run the ssize_t test program: please enlighten me!
20907 (This is probably a misconfiguration in your system or libraries, and
20908 you really ought to fix it. Still, I'll try anyway.)
20910 I need a type that is the same size as $sizetype, but is guaranteed to
20911 be signed. Common values are ssize_t, int and long.
20914 rp="What signed type is the same size as $sizetype?"
20920 : see what type of char stdio uses.
20922 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
20923 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20924 echo "Your stdio uses unsigned chars." >&4
20925 stdchar="unsigned char"
20927 echo "Your stdio uses signed chars." >&4
20932 : see what type uids are declared as in the kernel
20934 echo "Looking for the type for user ids returned by getuid()."
20935 set uid_t uidtype xxx stdio.h sys/types.h
20939 xxx=`./findhdr sys/user.h`
20940 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20942 unsigned) dflt="$1 $2" ;;
20946 *) dflt="$uidtype";;
20949 uid_t) echo "uid_t found." ;;
20950 *) rp="What is the type for user ids returned by getuid()?"
20956 : Check size of UID
20959 *_t) zzz="$uidtype" ;;
20962 echo "Checking the size of $zzz..." >&4
20964 #include <sys/types.h>
20966 #$i_stdlib I_STDLIB
20968 #include <stdlib.h>
20971 printf("%d\n", (int)sizeof($uidtype));
20976 if eval $compile_ok; then
20980 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20983 echo "Your $zzz is $uidsize bytes long."
20988 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20991 : Check if UID is signed
20994 *_t) zzz="$uidtype" ;;
20997 echo "Checking the sign of $zzz..." >&4
20999 #include <sys/types.h>
21010 if eval $compile; then
21014 echo "(I can't execute the test program--guessing unsigned.)" >&4
21018 1) echo "Your $zzz is unsigned." ;;
21019 -1) echo "Your $zzz is signed." ;;
21025 echo "(I can't compile the test program--guessing unsigned.)" >&4
21029 : Check format string for UID
21031 $echo "Checking the format string to be used for uids..." >&4
21034 -1) if $test X"$uidsize" = X"$ivsize"; then
21035 uidformat="$ivdformat"
21037 if $test X"$uidsize" = X"$longsize"; then
21040 if $test X"$uidsize" = X"$intsize"; then
21043 if $test X"$uidsize" = X"$shortsize"; then
21050 *) if $test X"$uidsize" = X"$uvsize"; then
21051 uidformat="$uvuformat"
21053 if $test X"$uidsize" = X"$longsize"; then
21056 if $test X"$uidsize" = X"$intsize"; then
21059 if $test X"$uidsize" = X"$shortsize"; then
21068 : Check if site customization support was requested
21069 case "$usesitecustomize" in
21070 $define|true|[Yy]*)
21071 usesitecustomize="$define"
21074 usesitecustomize="$undef"
21078 : determine compiler compiler
21087 if $test -f "$byacc$_exe"; then
21089 comp="byacc or $comp"
21091 if $test -f "$bison$_exe"; then
21092 comp="$comp or bison -y"
21094 rp="Which compiler compiler ($comp) shall I use?"
21103 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
21109 : see if this is a assert.h system
21110 set assert.h i_assert
21113 : see if this is a fp.h system
21117 : see if this is a fp_class.h system
21118 set fp_class.h i_fp_class
21121 : see if gdbm.h is available
21126 : see if gdbm_open exists
21127 set gdbm_open d_gdbm_open
21129 case "$d_gdbm_open" in
21132 echo "We won't be including <gdbm.h>"
21141 : see if this is a ieeefp.h system
21142 case "$i_ieeefp" in
21143 '' ) set ieeefp.h i_ieeefp
21148 : see if this is a libutil.h system
21149 set libutil.h i_libutil
21152 : see if mach cthreads are available
21153 if test "X$usethreads" = "X$define"; then
21154 set mach/cthreads.h i_machcthr
21157 i_machcthr="$undef"
21160 : see if this is a mntent.h system
21161 set mntent.h i_mntent
21164 : see if net/errno.h is available
21166 set net/errno.h val
21169 : Unfortunately, it causes problems on some systems. Arrgh.
21172 cat > try.c <<'EOM'
21175 #include <net/errno.h>
21181 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21182 echo "We'll be including <net/errno.h>." >&4
21184 echo "We won't be including <net/errno.h>." >&4
21193 : see if netinet/tcp.h is available
21194 set netinet/tcp.h i_netinettcp
21197 : see if this is a poll.h system
21201 : see if this is a prot.h system
21205 : Preprocessor symbols
21207 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21208 $cat <<'EOSH' > Cppsym.know
21209 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21210 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21211 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21212 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21213 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21214 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21215 bull c cadmus clipper CMU COFF COMPILER_VERSION
21216 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21217 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21218 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21219 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21221 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21222 H3050R H3050RX hbullx20 hcx host_mips
21223 hp200 hp300 hp700 HP700 hp800 hp9000
21224 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21225 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21226 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21227 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21228 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21229 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21230 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21231 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21232 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21233 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21234 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21235 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21236 MATH_HAS_NO_SIDE_EFFECTS
21237 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21238 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21239 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21240 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21241 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21242 NetBSD news1500 news1700 news1800 news1900 news3700
21243 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21244 ns32016 ns32332 ns32k nsc32000
21245 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21246 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21247 pc532 pdp11 PGC PIC plexus PORTAR posix
21248 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21249 POSIX_C_SOURCE POSIX_SOURCE POWER
21250 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21251 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21252 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21253 sony sony_news sonyrisc sparc sparclite spectrum
21254 stardent stdc STDC_EXT stratos sun sun3 sun386
21255 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21256 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21257 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21258 sysV68 sysV88 Tek4132 Tek4300 titan
21259 TM3200 TM5400 TM5600
21260 tower tower32 tower32_200 tower32_600 tower32_700
21261 tower32_800 tower32_850 tss
21262 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21263 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21264 unix UNIX95 UNIX99 unixpc unos
21265 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21266 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21267 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21269 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21270 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21271 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21274 # Maybe put other stuff here too.
21275 cat <<EOSH >>Cppsym.know
21278 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21279 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21280 $cat Cppsym.know > Cppsym.c
21281 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21282 $rm -f Cppsym.a Cppsym.b Cppsym.c
21283 cat <<EOSH > Cppsym
21285 if $test \$# -gt 0; then
21286 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21287 if $test -s Cppsym.got; then
21294 $tr " " "$trnl" | ./Cppsym.try
21300 cat <<EOSH > Cppsym.try
21302 cat <<'EOCP' > try.c
21305 #define STRINGIFY(a) "a"
21307 #if cpp_stuff == 42
21308 #define StGiFy(a) #a
21309 #define STRINGIFY(a) StGiFy(a)
21311 #if $cpp_stuff != 1 && $cpp_stuff != 42
21312 # include "Bletch: How does this C preprocessor stringify macros?"
21318 cat <<'EOSH' >> Cppsym.try
21320 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21321 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21322 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21323 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21325 echo 'return 0;}' >> try.c
21327 cat <<EOSH >> Cppsym.try
21329 case "$osname-$gccversion" in
21330 irix-) ccflags="\$ccflags -woff 1178" ;;
21331 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21333 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21335 chmod +x Cppsym.try
21336 $eunicefix Cppsym.try
21337 ./Cppsym < Cppsym.know > Cppsym.true
21338 : Add in any linux cpp "predefined macros":
21339 case "$osname::$gccversion" in
21342 rm -f $tHdrH'.h' $tHdrH
21344 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21345 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21346 if [ -s $tHdrH'_cppsym.real' ]; then
21347 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21350 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21353 : now check the C compiler for additional symbols
21354 postprocess_cc_v=''
21356 aix) postprocess_cc_v="|$tr , ' '" ;;
21363 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21366 -D*) echo "\$i" | $sed 's/^-D//';;
21367 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21372 postprocess_cc_v=''
21375 ./ccsym > ccsym1.raw
21376 if $test -s ccsym1.raw; then
21377 $sort ccsym1.raw | $uniq >ccsym.raw
21379 mv ccsym1.raw ccsym.raw
21382 $awk '/\=/ { print $0; next }
21383 { print $0"=1" }' ccsym.raw >ccsym.list
21384 $comm -13 Cppsym.true ccsym.list >ccsym.own
21385 $comm -12 Cppsym.true ccsym.list >ccsym.com
21386 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21388 if $test -z ccsym.raw; then
21389 echo "Your C compiler doesn't seem to define any symbols!" >&4
21391 echo "However, your C preprocessor defines the following symbols:"
21394 cppsymbols=`$cat Cppsym.true`
21395 cppsymbols=`echo $cppsymbols`
21396 cppccsymbols="$cppsymbols"
21398 if $test -s ccsym.com; then
21399 echo "Your C compiler and pre-processor define these symbols:"
21400 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
21403 cppccsymbols=`$cat ccsym.com`
21404 cppccsymbols=`echo $cppccsymbols`
21405 $test "$silent" || sleep 1
21407 if $test -s ccsym.cpp; then
21408 $test "$also" && echo " "
21409 echo "Your C pre-processor ${also}defines the following symbols:"
21410 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
21412 cppsymbols=`$cat ccsym.cpp`
21413 cppsymbols=`echo $cppsymbols`
21414 $test "$silent" || sleep 1
21416 if $test -s ccsym.own; then
21417 $test "$also" && echo " "
21418 echo "Your C compiler ${also}defines the following cpp symbols:"
21419 $sed -e 's/\(..*\)=1/\1/' ccsym.own
21420 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
21421 ccsymbols=`$cat ccsym.own`
21422 ccsymbols=`echo $ccsymbols`
21423 $test "$silent" || sleep 1
21427 : see if this is a termio system
21431 if $test `./findhdr termios.h`; then
21432 set tcsetattr i_termios
21438 "$define") echo "You have POSIX termios.h... good!" >&4;;
21439 *) if ./Cppsym pyr; then
21440 case "`/bin/universe`" in
21441 ucb) if $test `./findhdr sgtty.h`; then
21443 echo "<sgtty.h> found." >&4
21445 echo "System is pyramid with BSD universe."
21446 ./warn "<sgtty.h> not found--you could have problems."
21448 *) if $test `./findhdr termio.h`; then
21450 echo "<termio.h> found." >&4
21452 echo "System is pyramid with USG universe."
21453 ./warn "<termio.h> not found--you could have problems."
21457 if $test `./findhdr termio.h`; then
21458 echo "<termio.h> found." >&4
21460 elif $test `./findhdr sgtty.h`; then
21461 echo "<sgtty.h> found." >&4
21464 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
21467 if $test `./findhdr sgtty.h`; then
21468 echo "<sgtty.h> found." >&4
21470 elif $test `./findhdr termio.h`; then
21471 echo "<termio.h> found." >&4
21474 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
21478 set i_termio; eval $setvar
21479 val=$val2; set i_sgtty; eval $setvar
21480 val=$val3; set i_termios; eval $setvar
21482 : see if stddef is available
21483 set stddef.h i_stddef
21486 : see if sys/access.h is available
21487 set sys/access.h i_sysaccess
21490 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
21491 set sys/filio.h i_sysfilio
21494 if $test `./findhdr sys/ioctl.h`; then
21496 echo '<sys/ioctl.h> found.' >&4
21499 if $test $i_sysfilio = "$define"; then
21500 echo '<sys/ioctl.h> NOT found.' >&4
21502 $test $i_sgtty = "$define" && xxx="sgtty.h"
21503 $test $i_termio = "$define" && xxx="termio.h"
21504 $test $i_termios = "$define" && xxx="termios.h"
21505 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
21511 : see if socket ioctl defs are in sys/sockio.h
21513 xxx=`./findhdr sys/sockio.h`
21514 if $test "$xxx"; then
21515 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
21517 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
21520 echo "No socket ioctls found in <sys/sockio.h>." >&4
21525 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
21531 : see if this is a syslog.h system
21532 set syslog.h i_syslog
21535 : see if this is a sys/mode.h system
21536 set sys/mode.h i_sysmode
21539 : see if there is a sys/poll.h file
21540 set sys/poll.h i_syspoll
21543 : see if sys/resource.h has to be included
21544 set sys/resource.h i_sysresrc
21547 : see if sys/security.h is available
21548 set sys/security.h i_syssecrt
21551 : see if this is a sys/statvfs.h system
21552 set sys/statvfs.h i_sysstatvfs
21555 : see if this is a sys/un.h system
21556 set sys/un.h i_sysun
21559 : see if this is a sys/utsname.h system
21560 set sys/utsname.h i_sysutsname
21563 : see if this is a syswait system
21564 set sys/wait.h i_syswait
21567 : see if this is a ustat.h system
21568 set ustat.h i_ustat
21571 : see if this is an utime system
21572 set utime.h i_utime
21575 : see if this is a vfork system
21578 set vfork.h i_vfork
21588 echo "Looking for extensions..." >&4
21589 : If we are using the old config.sh, known_extensions may contain
21590 : old or inaccurate or duplicate values.
21591 known_extensions=''
21592 nonxs_extensions=''
21593 : We do not use find because it might not be available.
21594 : We do not just use MANIFEST because the user may have dropped
21595 : some additional extensions into the source tree and expect them
21598 : Function to recursively find available extensions, ignoring DynaLoader
21599 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21603 DynaLoader|dynaload) ;;
21605 if $test -f $xxx/$xxx.xs -o -f $xxx/$xxx.c; then
21606 known_extensions="$known_extensions $1$xxx";
21607 elif $test -f $xxx/Makefile.PL; then
21608 nonxs_extensions="$nonxs_extensions $1$xxx";
21610 if $test -d $xxx -a $# -lt 10; then
21613 eval $find_extensions;
21625 eval $find_extensions
21626 # Special case: Add in modules that nest beyond the first level.
21627 # Currently threads/shared and Hash/Util/FieldHash, since they are
21628 # not picked up by the recursive find above (and adding in general
21629 # recursive finding breaks SDBM_File/sdbm).
21630 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
21631 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
21632 set X $known_extensions
21634 known_extensions="$*"
21635 set X $nonxs_extensions
21637 nonxs_extensions="$*"
21640 : Now see which are supported on this system.
21642 for xxx in $known_extensions ; do
21646 $define) avail_ext="$avail_ext $xxx" ;;
21649 GDBM_File|gdbm_fil)
21651 $define) avail_ext="$avail_ext $xxx" ;;
21654 I18N/Langinfo|i18n_lan)
21655 case "$i_langinfo$d_nl_langinfo" in
21656 $define$define) avail_ext="$avail_ext $xxx" ;;
21660 : XXX Do we need a useipcsysv variable here
21661 case "${d_msg}${d_sem}${d_shm}" in
21662 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21665 NDBM_File|ndbm_fil)
21668 case "$osname-$use64bitint" in
21671 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21674 *) avail_ext="$avail_ext $xxx" ;;
21679 ODBM_File|odbm_fil)
21680 case "${i_dbm}${i_rpcsvcdbm}" in
21682 case "$d_cplusplus" in
21683 define) ;; # delete as a function name will not work
21684 *) case "$osname-$use64bitint" in
21687 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21690 *) avail_ext="$avail_ext $xxx" ;;
21698 case "$useopcode" in
21699 true|define|y) avail_ext="$avail_ext $xxx" ;;
21703 case "$useposix" in
21704 true|define|y) avail_ext="$avail_ext $xxx" ;;
21708 case "$d_socket" in
21711 beos) ;; # not unless BONE
21712 *) avail_ext="$avail_ext $xxx" ;;
21717 Sys/Syslog|sys/syslog)
21718 : XXX syslog requires socket
21719 case "$d_socket" in
21720 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21724 case "$usethreads" in
21726 case "$use5005threads" in
21727 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
21731 threads|threads/shared)
21732 # threads and threads::shared are special cases.
21733 # To stop people from asking "Perl 5.8.0 was supposed
21734 # to have this new fancy threads implementation but my
21735 # perl doesn't have it" and from people trying to
21736 # (re)install the threads module using CPAN.pm and
21737 # CPAN.pm then offering to reinstall Perl 5.8.0,
21738 # the threads.pm and threads/shared.pm will always be
21739 # there, croaking informatively ("you need to rebuild
21740 # all of Perl with threads, sorry") when threads haven't
21741 # been compiled in.
21743 avail_ext="$avail_ext $xxx"
21747 cygwin) avail_ext="$avail_ext $xxx" ;;
21750 XS/APItest|xs/apitest)
21751 # This is just for testing. Skip it unless we have dynamic loading.
21754 $define) avail_ext="$avail_ext $xxx" ;;
21757 XS/Typemap|xs/typemap)
21758 # This is just for testing. Skip it unless we have dynamic loading.
21760 $define) avail_ext="$avail_ext $xxx" ;;
21763 *) avail_ext="$avail_ext $xxx"
21772 case "$onlyextensions" in
21774 *) keepextensions=''
21775 echo "You have requested that only certains extensions be included..." >&4
21776 for i in $onlyextensions; do
21777 case " $avail_ext " in
21779 echo "Keeping extension $i."
21780 keepextensions="$keepextensions $i"
21782 *) echo "Ignoring extension $i." ;;
21785 avail_ext="$keepextensions"
21789 case "$noextensions" in
21791 *) keepextensions=''
21792 echo "You have requested that certain extensions be ignored..." >&4
21793 for i in $avail_ext; do
21794 case " $noextensions " in
21795 *" $i "*) echo "Ignoring extension $i." ;;
21796 *) echo "Keeping extension $i.";
21797 keepextensions="$keepextensions $i"
21801 avail_ext="$keepextensions"
21805 : Now see which nonxs extensions are supported on this system.
21806 : For now assume all are.
21808 for xxx in $nonxs_extensions ; do
21810 *) nonxs_ext="$nonxs_ext $xxx"
21822 A number of extensions are supplied with $package. You may choose to
21823 compile these extensions for dynamic loading (the default), compile
21824 them into the $package executable (static loading), or not include
21825 them at all. Answer "none" to include no extensions.
21826 Note that DynaLoader is always built and need not be mentioned here.
21829 case "$dynamic_ext" in
21831 : Exclude those listed in static_ext
21833 for xxx in $avail_ext; do
21834 case " $static_ext " in
21836 *) dflt="$dflt $xxx" ;;
21843 *) dflt="$dynamic_ext"
21844 # Perhaps we are reusing an old out-of-date config.sh.
21847 if test X"$dynamic_ext" != X"$avail_ext"; then
21849 NOTICE: Your previous config.sh list may be incorrect.
21850 The extensions now available to you are
21852 but the default list from your previous config.sh is
21864 rp="What extensions do you wish to load dynamically?"
21867 none) dynamic_ext=' ' ;;
21868 *) dynamic_ext="$ans" ;;
21871 case "$static_ext" in
21873 : Exclude those already listed in dynamic linking
21875 for xxx in $avail_ext; do
21876 case " $dynamic_ext " in
21878 *) dflt="$dflt $xxx" ;;
21885 *) dflt="$static_ext"
21892 rp="What extensions do you wish to load statically?"
21895 none) static_ext=' ' ;;
21896 *) static_ext="$ans" ;;
21901 A number of extensions are supplied with $package. Answer "none"
21902 to include no extensions.
21903 Note that DynaLoader is always built and need not be mentioned here.
21906 case "$static_ext" in
21907 '') dflt="$avail_ext" ;;
21908 *) dflt="$static_ext"
21909 # Perhaps we are reusing an old out-of-date config.sh.
21912 if test X"$static_ext" != X"$avail_ext"; then
21914 NOTICE: Your previous config.sh list may be incorrect.
21915 The extensions now available to you are
21917 but the default list from your previous config.sh is
21926 : Exclude those that are not xs extensions
21930 rp="What extensions do you wish to include?"
21933 none) static_ext=' ' ;;
21934 *) static_ext="$ans" ;;
21939 # Encode is a special case. If we are building Encode as a static
21940 # extension, we need to explicitly list its subextensions as well.
21941 # For other nested extensions, this is handled automatically by
21942 # the appropriate Makefile.PL.
21943 case " $static_ext " in
21944 *" Encode "*) # Add the subextensions of Encode
21946 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21947 static_ext="$static_ext Encode/$xxx"
21953 set X $dynamic_ext $static_ext $nonxs_ext
21957 # Sanity check: We require an extension suitable for use with
21958 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21959 # should show up as failures in the test suite, but it's helpful to
21960 # catch them now.) The 'extensions' list is normally sorted
21961 # alphabetically, so we need to accept either
21962 # DB_File ... Fcntl ... IO ....
21963 # or something like
21964 # Fcntl ... NDBM_File ... IO ....
21965 case " $extensions" in
21966 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21967 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21968 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21969 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21970 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21974 : Remove libraries needed only for extensions
21975 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21976 : The exception is SunOS 4.x, which needs them.
21977 case "${osname}X${osvers}" in
21981 *) case "$usedl" in
21982 $define|true|[yY]*)
21983 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21987 *) perllibs="$libs"
21993 : Remove build directory name from cppstdin so it can be used from
21994 : either the present location or the final installed location.
21996 : Get out of the UU directory to get correct path name.
21998 case "$cppstdin" in
22000 echo "Stripping down cppstdin path name"
22006 : end of configuration questions
22008 echo "End of configuration questions."
22011 : back to where it started
22012 if test -d ../UU; then
22016 : configuration may be unconditionally patched via a 'config.arch' file
22017 if $test -f config.arch; then
22018 echo "I see a config.arch file, loading it." >&4
22022 : configuration may be patched via a 'config.over' file
22023 if $test -f config.over; then
22026 rp='I see a config.over file. Do you wish to load it?'
22029 n*) echo "OK, I'll ignore it.";;
22031 echo "Configuration override changes have been loaded."
22036 : in case they want portability, strip down executable paths
22037 case "$d_portable" in
22040 echo "Stripping down executable paths..." >&4
22041 for file in $loclist $trylist; do
22043 eval $file=`basename $temp`
22048 : create config.sh file
22050 echo "Creating config.sh..." >&4
22051 $spitshell <<EOT >config.sh
22054 # This file was produced by running the Configure script. It holds all the
22055 # definitions figured out by Configure. Should you modify one of these values,
22056 # do not forget to propagate your changes by running "Configure -der". You may
22057 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22060 # Package name : $package
22061 # Source directory : $src
22062 # Configuration time: $cf_time
22063 # Configured by : $cf_by
22064 # Target system : $myuname
22067 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22068 $spitshell <<EOT >>config.sh
22077 Revision='$Revision'
22085 alignbytes='$alignbytes'
22086 ansi2knr='$ansi2knr'
22087 aphostname='$aphostname'
22088 api_revision='$api_revision'
22089 api_subversion='$api_subversion'
22090 api_version='$api_version'
22091 api_versionstring='$api_versionstring'
22094 archlibexp='$archlibexp'
22095 archname64='$archname64'
22096 archname='$archname'
22097 archobjs='$archobjs'
22098 asctime_r_proto='$asctime_r_proto'
22106 byteorder='$byteorder'
22108 castflags='$castflags'
22111 cccdlflags='$cccdlflags'
22112 ccdlflags='$ccdlflags'
22114 ccflags_uselargefiles='$ccflags_uselargefiles'
22116 ccsymbols='$ccsymbols'
22117 ccversion='$ccversion'
22119 cf_email='$cf_email'
22124 clocktype='$clocktype'
22126 compress='$compress'
22127 contains='$contains'
22131 cpp_stuff='$cpp_stuff'
22132 cppccsymbols='$cppccsymbols'
22133 cppflags='$cppflags'
22135 cppminus='$cppminus'
22137 cppstdin='$cppstdin'
22138 cppsymbols='$cppsymbols'
22139 crypt_r_proto='$crypt_r_proto'
22140 cryptlib='$cryptlib'
22142 ctermid_r_proto='$ctermid_r_proto'
22143 ctime_r_proto='$ctime_r_proto'
22144 d_Gconvert='$d_Gconvert'
22145 d_PRIEUldbl='$d_PRIEUldbl'
22146 d_PRIFUldbl='$d_PRIFUldbl'
22147 d_PRIGUldbl='$d_PRIGUldbl'
22148 d_PRIXU64='$d_PRIXU64'
22149 d_PRId64='$d_PRId64'
22150 d_PRIeldbl='$d_PRIeldbl'
22151 d_PRIfldbl='$d_PRIfldbl'
22152 d_PRIgldbl='$d_PRIgldbl'
22153 d_PRIi64='$d_PRIi64'
22154 d_PRIo64='$d_PRIo64'
22155 d_PRIu64='$d_PRIu64'
22156 d_PRIx64='$d_PRIx64'
22157 d_SCNfldbl='$d_SCNfldbl'
22158 d__fwalk='$d__fwalk'
22159 d_access='$d_access'
22160 d_accessx='$d_accessx'
22163 d_archlib='$d_archlib'
22164 d_asctime64='$d_asctime64'
22165 d_asctime_r='$d_asctime_r'
22168 d_attribute_deprecated='$d_attribute_deprecated'
22169 d_attribute_format='$d_attribute_format'
22170 d_attribute_malloc='$d_attribute_malloc'
22171 d_attribute_nonnull='$d_attribute_nonnull'
22172 d_attribute_noreturn='$d_attribute_noreturn'
22173 d_attribute_pure='$d_attribute_pure'
22174 d_attribute_unused='$d_attribute_unused'
22175 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22179 d_bsdgetpgrp='$d_bsdgetpgrp'
22180 d_bsdsetpgrp='$d_bsdsetpgrp'
22181 d_builtin_choose_expr='$d_builtin_choose_expr'
22182 d_builtin_expect='$d_builtin_expect'
22184 d_c99_variadic_macros='$d_c99_variadic_macros'
22185 d_casti32='$d_casti32'
22186 d_castneg='$d_castneg'
22187 d_charvspr='$d_charvspr'
22189 d_chroot='$d_chroot'
22190 d_chsize='$d_chsize'
22192 d_clearenv='$d_clearenv'
22193 d_closedir='$d_closedir'
22194 d_cmsghdr_s='$d_cmsghdr_s'
22196 d_copysignl='$d_copysignl'
22197 d_cplusplus='$d_cplusplus'
22199 d_crypt_r='$d_crypt_r'
22201 d_ctermid='$d_ctermid'
22202 d_ctermid_r='$d_ctermid_r'
22203 d_ctime64='$d_ctime64'
22204 d_ctime_r='$d_ctime_r'
22205 d_cuserid='$d_cuserid'
22206 d_dbl_dig='$d_dbl_dig'
22207 d_dbminitproto='$d_dbminitproto'
22208 d_difftime64='$d_difftime64'
22209 d_difftime='$d_difftime'
22210 d_dir_dd_fd='$d_dir_dd_fd'
22212 d_dirnamlen='$d_dirnamlen'
22213 d_dlerror='$d_dlerror'
22214 d_dlopen='$d_dlopen'
22215 d_dlsymun='$d_dlsymun'
22216 d_dosuid='$d_dosuid'
22217 d_drand48_r='$d_drand48_r'
22218 d_drand48proto='$d_drand48proto'
22220 d_eaccess='$d_eaccess'
22221 d_endgrent='$d_endgrent'
22222 d_endgrent_r='$d_endgrent_r'
22223 d_endhent='$d_endhent'
22224 d_endhostent_r='$d_endhostent_r'
22225 d_endnent='$d_endnent'
22226 d_endnetent_r='$d_endnetent_r'
22227 d_endpent='$d_endpent'
22228 d_endprotoent_r='$d_endprotoent_r'
22229 d_endpwent='$d_endpwent'
22230 d_endpwent_r='$d_endpwent_r'
22231 d_endsent='$d_endsent'
22232 d_endservent_r='$d_endservent_r'
22233 d_eofnblk='$d_eofnblk'
22234 d_eunice='$d_eunice'
22235 d_faststdio='$d_faststdio'
22236 d_fchdir='$d_fchdir'
22237 d_fchmod='$d_fchmod'
22238 d_fchown='$d_fchown'
22240 d_fcntl_can_lock='$d_fcntl_can_lock'
22241 d_fd_macros='$d_fd_macros'
22242 d_fd_set='$d_fd_set'
22243 d_fds_bits='$d_fds_bits'
22244 d_fgetpos='$d_fgetpos'
22245 d_finite='$d_finite'
22246 d_finitel='$d_finitel'
22247 d_flexfnam='$d_flexfnam'
22249 d_flockproto='$d_flockproto'
22251 d_fp_class='$d_fp_class'
22252 d_fpathconf='$d_fpathconf'
22253 d_fpclass='$d_fpclass'
22254 d_fpclassify='$d_fpclassify'
22255 d_fpclassl='$d_fpclassl'
22256 d_fpos64_t='$d_fpos64_t'
22257 d_frexpl='$d_frexpl'
22258 d_fs_data_s='$d_fs_data_s'
22259 d_fseeko='$d_fseeko'
22260 d_fsetpos='$d_fsetpos'
22261 d_fstatfs='$d_fstatfs'
22262 d_fstatvfs='$d_fstatvfs'
22264 d_ftello='$d_ftello'
22266 d_futimes='$d_futimes'
22267 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
22268 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
22269 d_getcwd='$d_getcwd'
22270 d_getespwnam='$d_getespwnam'
22271 d_getfsstat='$d_getfsstat'
22272 d_getgrent='$d_getgrent'
22273 d_getgrent_r='$d_getgrent_r'
22274 d_getgrgid_r='$d_getgrgid_r'
22275 d_getgrnam_r='$d_getgrnam_r'
22276 d_getgrps='$d_getgrps'
22277 d_gethbyaddr='$d_gethbyaddr'
22278 d_gethbyname='$d_gethbyname'
22279 d_gethent='$d_gethent'
22280 d_gethname='$d_gethname'
22281 d_gethostbyaddr_r='$d_gethostbyaddr_r'
22282 d_gethostbyname_r='$d_gethostbyname_r'
22283 d_gethostent_r='$d_gethostent_r'
22284 d_gethostprotos='$d_gethostprotos'
22285 d_getitimer='$d_getitimer'
22286 d_getlogin='$d_getlogin'
22287 d_getlogin_r='$d_getlogin_r'
22288 d_getmnt='$d_getmnt'
22289 d_getmntent='$d_getmntent'
22290 d_getnbyaddr='$d_getnbyaddr'
22291 d_getnbyname='$d_getnbyname'
22292 d_getnent='$d_getnent'
22293 d_getnetbyaddr_r='$d_getnetbyaddr_r'
22294 d_getnetbyname_r='$d_getnetbyname_r'
22295 d_getnetent_r='$d_getnetent_r'
22296 d_getnetprotos='$d_getnetprotos'
22297 d_getpagsz='$d_getpagsz'
22298 d_getpbyname='$d_getpbyname'
22299 d_getpbynumber='$d_getpbynumber'
22300 d_getpent='$d_getpent'
22301 d_getpgid='$d_getpgid'
22302 d_getpgrp2='$d_getpgrp2'
22303 d_getpgrp='$d_getpgrp'
22304 d_getppid='$d_getppid'
22305 d_getprior='$d_getprior'
22306 d_getprotobyname_r='$d_getprotobyname_r'
22307 d_getprotobynumber_r='$d_getprotobynumber_r'
22308 d_getprotoent_r='$d_getprotoent_r'
22309 d_getprotoprotos='$d_getprotoprotos'
22310 d_getprpwnam='$d_getprpwnam'
22311 d_getpwent='$d_getpwent'
22312 d_getpwent_r='$d_getpwent_r'
22313 d_getpwnam_r='$d_getpwnam_r'
22314 d_getpwuid_r='$d_getpwuid_r'
22315 d_getsbyname='$d_getsbyname'
22316 d_getsbyport='$d_getsbyport'
22317 d_getsent='$d_getsent'
22318 d_getservbyname_r='$d_getservbyname_r'
22319 d_getservbyport_r='$d_getservbyport_r'
22320 d_getservent_r='$d_getservent_r'
22321 d_getservprotos='$d_getservprotos'
22322 d_getspnam='$d_getspnam'
22323 d_getspnam_r='$d_getspnam_r'
22324 d_gettimeod='$d_gettimeod'
22325 d_gmtime64='$d_gmtime64'
22326 d_gmtime_r='$d_gmtime_r'
22327 d_gnulibc='$d_gnulibc'
22328 d_grpasswd='$d_grpasswd'
22329 d_hasmntopt='$d_hasmntopt'
22331 d_ilogbl='$d_ilogbl'
22332 d_inc_version_list='$d_inc_version_list'
22334 d_inetaton='$d_inetaton'
22335 d_int64_t='$d_int64_t'
22336 d_isascii='$d_isascii'
22337 d_isfinite='$d_isfinite'
22340 d_isnanl='$d_isnanl'
22341 d_killpg='$d_killpg'
22342 d_lchown='$d_lchown'
22343 d_ldbl_dig='$d_ldbl_dig'
22344 d_libm_lib_version='$d_libm_lib_version'
22346 d_localtime64='$d_localtime64'
22347 d_localtime_r='$d_localtime_r'
22348 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
22349 d_locconv='$d_locconv'
22351 d_longdbl='$d_longdbl'
22352 d_longlong='$d_longlong'
22353 d_lseekproto='$d_lseekproto'
22355 d_madvise='$d_madvise'
22356 d_malloc_good_size='$d_malloc_good_size'
22357 d_malloc_size='$d_malloc_size'
22359 d_mbstowcs='$d_mbstowcs'
22360 d_mbtowc='$d_mbtowc'
22361 d_memchr='$d_memchr'
22362 d_memcmp='$d_memcmp'
22363 d_memcpy='$d_memcpy'
22364 d_memmove='$d_memmove'
22365 d_memset='$d_memset'
22367 d_mkdtemp='$d_mkdtemp'
22368 d_mkfifo='$d_mkfifo'
22369 d_mkstemp='$d_mkstemp'
22370 d_mkstemps='$d_mkstemps'
22371 d_mktime64='$d_mktime64'
22372 d_mktime='$d_mktime'
22375 d_modfl_pow32_bug='$d_modfl_pow32_bug'
22376 d_modflproto='$d_modflproto'
22377 d_mprotect='$d_mprotect'
22379 d_msg_ctrunc='$d_msg_ctrunc'
22380 d_msg_dontroute='$d_msg_dontroute'
22381 d_msg_oob='$d_msg_oob'
22382 d_msg_peek='$d_msg_peek'
22383 d_msg_proxy='$d_msg_proxy'
22384 d_msgctl='$d_msgctl'
22385 d_msgget='$d_msgget'
22386 d_msghdr_s='$d_msghdr_s'
22387 d_msgrcv='$d_msgrcv'
22388 d_msgsnd='$d_msgsnd'
22390 d_munmap='$d_munmap'
22391 d_mymalloc='$d_mymalloc'
22393 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
22395 d_nl_langinfo='$d_nl_langinfo'
22396 d_nv_preserves_uv='$d_nv_preserves_uv'
22397 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
22398 d_off64_t='$d_off64_t'
22399 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
22400 d_oldpthreads='$d_oldpthreads'
22401 d_oldsock='$d_oldsock'
22403 d_pathconf='$d_pathconf'
22405 d_perl_otherlibdirs='$d_perl_otherlibdirs'
22406 d_phostname='$d_phostname'
22409 d_portable='$d_portable'
22410 d_printf_format_null='$d_printf_format_null'
22411 d_procselfexe='$d_procselfexe'
22412 d_pseudofork='$d_pseudofork'
22413 d_pthread_atfork='$d_pthread_atfork'
22414 d_pthread_attr_setscope='$d_pthread_attr_setscope'
22415 d_pthread_yield='$d_pthread_yield'
22417 d_pwchange='$d_pwchange'
22418 d_pwclass='$d_pwclass'
22419 d_pwcomment='$d_pwcomment'
22420 d_pwexpire='$d_pwexpire'
22421 d_pwgecos='$d_pwgecos'
22422 d_pwpasswd='$d_pwpasswd'
22423 d_pwquota='$d_pwquota'
22426 d_random_r='$d_random_r'
22427 d_readdir64_r='$d_readdir64_r'
22428 d_readdir='$d_readdir'
22429 d_readdir_r='$d_readdir_r'
22430 d_readlink='$d_readlink'
22432 d_recvmsg='$d_recvmsg'
22433 d_rename='$d_rename'
22434 d_rewinddir='$d_rewinddir'
22436 d_safebcpy='$d_safebcpy'
22437 d_safemcpy='$d_safemcpy'
22438 d_sanemcmp='$d_sanemcmp'
22439 d_sbrkproto='$d_sbrkproto'
22440 d_scalbnl='$d_scalbnl'
22441 d_sched_yield='$d_sched_yield'
22442 d_scm_rights='$d_scm_rights'
22443 d_seekdir='$d_seekdir'
22444 d_select='$d_select'
22446 d_semctl='$d_semctl'
22447 d_semctl_semid_ds='$d_semctl_semid_ds'
22448 d_semctl_semun='$d_semctl_semun'
22449 d_semget='$d_semget'
22451 d_sendmsg='$d_sendmsg'
22452 d_setegid='$d_setegid'
22453 d_seteuid='$d_seteuid'
22454 d_setgrent='$d_setgrent'
22455 d_setgrent_r='$d_setgrent_r'
22456 d_setgrps='$d_setgrps'
22457 d_sethent='$d_sethent'
22458 d_sethostent_r='$d_sethostent_r'
22459 d_setitimer='$d_setitimer'
22460 d_setlinebuf='$d_setlinebuf'
22461 d_setlocale='$d_setlocale'
22462 d_setlocale_r='$d_setlocale_r'
22463 d_setnent='$d_setnent'
22464 d_setnetent_r='$d_setnetent_r'
22465 d_setpent='$d_setpent'
22466 d_setpgid='$d_setpgid'
22467 d_setpgrp2='$d_setpgrp2'
22468 d_setpgrp='$d_setpgrp'
22469 d_setprior='$d_setprior'
22470 d_setproctitle='$d_setproctitle'
22471 d_setprotoent_r='$d_setprotoent_r'
22472 d_setpwent='$d_setpwent'
22473 d_setpwent_r='$d_setpwent_r'
22474 d_setregid='$d_setregid'
22475 d_setresgid='$d_setresgid'
22476 d_setresuid='$d_setresuid'
22477 d_setreuid='$d_setreuid'
22478 d_setrgid='$d_setrgid'
22479 d_setruid='$d_setruid'
22480 d_setsent='$d_setsent'
22481 d_setservent_r='$d_setservent_r'
22482 d_setsid='$d_setsid'
22483 d_setvbuf='$d_setvbuf'
22487 d_shmatprototype='$d_shmatprototype'
22488 d_shmctl='$d_shmctl'
22490 d_shmget='$d_shmget'
22491 d_sigaction='$d_sigaction'
22492 d_signbit='$d_signbit'
22493 d_sigprocmask='$d_sigprocmask'
22494 d_sigsetjmp='$d_sigsetjmp'
22495 d_sitearch='$d_sitearch'
22496 d_snprintf='$d_snprintf'
22497 d_sockatmark='$d_sockatmark'
22498 d_sockatmarkproto='$d_sockatmarkproto'
22499 d_socket='$d_socket'
22500 d_socklen_t='$d_socklen_t'
22501 d_sockpair='$d_sockpair'
22502 d_socks5_init='$d_socks5_init'
22503 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
22505 d_srand48_r='$d_srand48_r'
22506 d_srandom_r='$d_srandom_r'
22507 d_sresgproto='$d_sresgproto'
22508 d_sresuproto='$d_sresuproto'
22509 d_statblks='$d_statblks'
22510 d_statfs_f_flags='$d_statfs_f_flags'
22511 d_statfs_s='$d_statfs_s'
22512 d_statvfs='$d_statvfs'
22513 d_stdio_cnt_lval='$d_stdio_cnt_lval'
22514 d_stdio_ptr_lval='$d_stdio_ptr_lval'
22515 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
22516 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
22517 d_stdio_stream_array='$d_stdio_stream_array'
22518 d_stdiobase='$d_stdiobase'
22519 d_stdstdio='$d_stdstdio'
22520 d_strchr='$d_strchr'
22521 d_strcoll='$d_strcoll'
22522 d_strctcpy='$d_strctcpy'
22523 d_strerrm='$d_strerrm'
22524 d_strerror='$d_strerror'
22525 d_strerror_r='$d_strerror_r'
22526 d_strftime='$d_strftime'
22527 d_strlcat='$d_strlcat'
22528 d_strlcpy='$d_strlcpy'
22529 d_strtod='$d_strtod'
22530 d_strtol='$d_strtol'
22531 d_strtold='$d_strtold'
22532 d_strtoll='$d_strtoll'
22533 d_strtoq='$d_strtoq'
22534 d_strtoul='$d_strtoul'
22535 d_strtoull='$d_strtoull'
22536 d_strtouq='$d_strtouq'
22537 d_strxfrm='$d_strxfrm'
22538 d_suidsafe='$d_suidsafe'
22539 d_symlink='$d_symlink'
22540 d_syscall='$d_syscall'
22541 d_syscallproto='$d_syscallproto'
22542 d_sysconf='$d_sysconf'
22543 d_sysernlst='$d_sysernlst'
22544 d_syserrlst='$d_syserrlst'
22545 d_system='$d_system'
22546 d_tcgetpgrp='$d_tcgetpgrp'
22547 d_tcsetpgrp='$d_tcsetpgrp'
22548 d_telldir='$d_telldir'
22549 d_telldirproto='$d_telldirproto'
22551 d_timegm='$d_timegm'
22553 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
22554 d_tm_tm_zone='$d_tm_tm_zone'
22555 d_tmpnam_r='$d_tmpnam_r'
22556 d_truncate='$d_truncate'
22557 d_ttyname_r='$d_ttyname_r'
22558 d_tzname='$d_tzname'
22559 d_u32align='$d_u32align'
22560 d_ualarm='$d_ualarm'
22563 d_union_semun='$d_union_semun'
22564 d_unordered='$d_unordered'
22565 d_unsetenv='$d_unsetenv'
22566 d_usleep='$d_usleep'
22567 d_usleepproto='$d_usleepproto'
22569 d_vendorarch='$d_vendorarch'
22570 d_vendorbin='$d_vendorbin'
22571 d_vendorlib='$d_vendorlib'
22572 d_vendorscript='$d_vendorscript'
22574 d_void_closedir='$d_void_closedir'
22575 d_voidsig='$d_voidsig'
22576 d_voidtty='$d_voidtty'
22577 d_volatile='$d_volatile'
22578 d_vprintf='$d_vprintf'
22579 d_vsnprintf='$d_vsnprintf'
22581 d_waitpid='$d_waitpid'
22582 d_wcstombs='$d_wcstombs'
22583 d_wctomb='$d_wctomb'
22584 d_writev='$d_writev'
22587 db_hashtype='$db_hashtype'
22588 db_prefixtype='$db_prefixtype'
22589 db_version_major='$db_version_major'
22590 db_version_minor='$db_version_minor'
22591 db_version_patch='$db_version_patch'
22592 defvoidused='$defvoidused'
22593 direntrytype='$direntrytype'
22596 doublesize='$doublesize'
22598 drand48_r_proto='$drand48_r_proto'
22600 dynamic_ext='$dynamic_ext'
22606 endgrent_r_proto='$endgrent_r_proto'
22607 endhostent_r_proto='$endhostent_r_proto'
22608 endnetent_r_proto='$endnetent_r_proto'
22609 endprotoent_r_proto='$endprotoent_r_proto'
22610 endpwent_r_proto='$endpwent_r_proto'
22611 endservent_r_proto='$endservent_r_proto'
22612 eunicefix='$eunicefix'
22615 extensions='$extensions'
22616 extern_C='$extern_C'
22618 fflushNULL='$fflushNULL'
22619 fflushall='$fflushall'
22621 firstmakefile='$firstmakefile'
22623 fpossize='$fpossize'
22624 fpostype='$fpostype'
22625 freetype='$freetype'
22628 full_csh='$full_csh'
22629 full_sed='$full_sed'
22630 gccansipedantic='$gccansipedantic'
22631 gccosandvers='$gccosandvers'
22632 gccversion='$gccversion'
22633 getgrent_r_proto='$getgrent_r_proto'
22634 getgrgid_r_proto='$getgrgid_r_proto'
22635 getgrnam_r_proto='$getgrnam_r_proto'
22636 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22637 gethostbyname_r_proto='$gethostbyname_r_proto'
22638 gethostent_r_proto='$gethostent_r_proto'
22639 getlogin_r_proto='$getlogin_r_proto'
22640 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22641 getnetbyname_r_proto='$getnetbyname_r_proto'
22642 getnetent_r_proto='$getnetent_r_proto'
22643 getprotobyname_r_proto='$getprotobyname_r_proto'
22644 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22645 getprotoent_r_proto='$getprotoent_r_proto'
22646 getpwent_r_proto='$getpwent_r_proto'
22647 getpwnam_r_proto='$getpwnam_r_proto'
22648 getpwuid_r_proto='$getpwuid_r_proto'
22649 getservbyname_r_proto='$getservbyname_r_proto'
22650 getservbyport_r_proto='$getservbyport_r_proto'
22651 getservent_r_proto='$getservent_r_proto'
22652 getspnam_r_proto='$getspnam_r_proto'
22653 gidformat='$gidformat'
22659 gmtime_r_proto='$gmtime_r_proto'
22660 gnulibc_version='$gnulibc_version'
22662 groupcat='$groupcat'
22663 groupstype='$groupstype'
22666 h_sysfile='$h_sysfile'
22669 html1dir='$html1dir'
22670 html1direxp='$html1direxp'
22671 html3dir='$html3dir'
22672 html3direxp='$html3direxp'
22681 i_arpainet='$i_arpainet'
22682 i_assert='$i_assert'
22683 i_bsdioctl='$i_bsdioctl'
22687 i_dirent='$i_dirent'
22693 i_fp_class='$i_fp_class'
22695 i_gdbm_ndbm='$i_gdbm_ndbm'
22696 i_gdbmndbm='$i_gdbmndbm'
22698 i_ieeefp='$i_ieeefp'
22699 i_inttypes='$i_inttypes'
22700 i_langinfo='$i_langinfo'
22701 i_libutil='$i_libutil'
22702 i_limits='$i_limits'
22703 i_locale='$i_locale'
22704 i_machcthr='$i_machcthr'
22705 i_malloc='$i_malloc'
22706 i_mallocmalloc='$i_mallocmalloc'
22708 i_memory='$i_memory'
22709 i_mntent='$i_mntent'
22712 i_neterrno='$i_neterrno'
22713 i_netinettcp='$i_netinettcp'
22717 i_pthread='$i_pthread'
22719 i_rpcsvcdbm='$i_rpcsvcdbm'
22722 i_shadow='$i_shadow'
22724 i_stdarg='$i_stdarg'
22725 i_stddef='$i_stddef'
22726 i_stdlib='$i_stdlib'
22727 i_string='$i_string'
22728 i_sunmath='$i_sunmath'
22729 i_sysaccess='$i_sysaccess'
22730 i_sysdir='$i_sysdir'
22731 i_sysfile='$i_sysfile'
22732 i_sysfilio='$i_sysfilio'
22734 i_sysioctl='$i_sysioctl'
22735 i_syslog='$i_syslog'
22736 i_sysmman='$i_sysmman'
22737 i_sysmode='$i_sysmode'
22738 i_sysmount='$i_sysmount'
22739 i_sysndir='$i_sysndir'
22740 i_sysparam='$i_sysparam'
22741 i_syspoll='$i_syspoll'
22742 i_sysresrc='$i_sysresrc'
22743 i_syssecrt='$i_syssecrt'
22744 i_sysselct='$i_sysselct'
22745 i_syssockio='$i_syssockio'
22746 i_sysstat='$i_sysstat'
22747 i_sysstatfs='$i_sysstatfs'
22748 i_sysstatvfs='$i_sysstatvfs'
22749 i_systime='$i_systime'
22750 i_systimek='$i_systimek'
22751 i_systimes='$i_systimes'
22752 i_systypes='$i_systypes'
22753 i_sysuio='$i_sysuio'
22755 i_sysutsname='$i_sysutsname'
22756 i_sysvfs='$i_sysvfs'
22757 i_syswait='$i_syswait'
22758 i_termio='$i_termio'
22759 i_termios='$i_termios'
22761 i_unistd='$i_unistd'
22764 i_values='$i_values'
22765 i_varargs='$i_varargs'
22766 i_varhdr='$i_varhdr'
22768 ignore_versioned_solibs='$ignore_versioned_solibs'
22769 inc_version_list='$inc_version_list'
22770 inc_version_list_init='$inc_version_list_init'
22773 initialinstalllocation='$initialinstalllocation'
22774 installarchlib='$installarchlib'
22775 installbin='$installbin'
22776 installhtml1dir='$installhtml1dir'
22777 installhtml3dir='$installhtml3dir'
22778 installman1dir='$installman1dir'
22779 installman3dir='$installman3dir'
22780 installprefix='$installprefix'
22781 installprefixexp='$installprefixexp'
22782 installprivlib='$installprivlib'
22783 installscript='$installscript'
22784 installsitearch='$installsitearch'
22785 installsitebin='$installsitebin'
22786 installsitehtml1dir='$installsitehtml1dir'
22787 installsitehtml3dir='$installsitehtml3dir'
22788 installsitelib='$installsitelib'
22789 installsiteman1dir='$installsiteman1dir'
22790 installsiteman3dir='$installsiteman3dir'
22791 installsitescript='$installsitescript'
22792 installstyle='$installstyle'
22793 installusrbinperl='$installusrbinperl'
22794 installvendorarch='$installvendorarch'
22795 installvendorbin='$installvendorbin'
22796 installvendorhtml1dir='$installvendorhtml1dir'
22797 installvendorhtml3dir='$installvendorhtml3dir'
22798 installvendorlib='$installvendorlib'
22799 installvendorman1dir='$installvendorman1dir'
22800 installvendorman3dir='$installvendorman3dir'
22801 installvendorscript='$installvendorscript'
22803 issymlink='$issymlink'
22804 ivdformat='$ivdformat'
22807 known_extensions='$known_extensions'
22810 lddlflags='$lddlflags'
22812 ldflags_uselargefiles='$ldflags_uselargefiles'
22813 ldlibpthname='$ldlibpthname'
22820 libsdirs='$libsdirs'
22821 libsfiles='$libsfiles'
22822 libsfound='$libsfound'
22823 libspath='$libspath'
22824 libswanted='$libswanted'
22825 libswanted_uselargefiles='$libswanted_uselargefiles'
22831 localtime_r_proto='$localtime_r_proto'
22832 locincpth='$locincpth'
22833 loclibpth='$loclibpth'
22834 longdblsize='$longdblsize'
22835 longlongsize='$longlongsize'
22836 longsize='$longsize'
22840 lseeksize='$lseeksize'
22841 lseektype='$lseektype'
22844 madlyobj='$madlyobj'
22845 madlysrc='$madlysrc'
22849 make_set_make='$make_set_make'
22850 mallocobj='$mallocobj'
22851 mallocsrc='$mallocsrc'
22852 malloctype='$malloctype'
22854 man1direxp='$man1direxp'
22857 man3direxp='$man3direxp'
22859 mips_type='$mips_type'
22860 mistrustnm='$mistrustnm'
22862 mmaptype='$mmaptype'
22863 modetype='$modetype'
22865 multiarch='$multiarch'
22867 myarchname='$myarchname'
22868 mydomain='$mydomain'
22869 myhostname='$myhostname'
22872 need_va_copy='$need_va_copy'
22873 netdb_hlen_type='$netdb_hlen_type'
22874 netdb_host_type='$netdb_host_type'
22875 netdb_name_type='$netdb_name_type'
22876 netdb_net_type='$netdb_net_type'
22879 nm_so_opt='$nm_so_opt'
22880 nonxs_ext='$nonxs_ext'
22882 nvEUformat='$nvEUformat'
22883 nvFUformat='$nvFUformat'
22884 nvGUformat='$nvGUformat'
22885 nv_overflows_integers_at='$nv_overflows_integers_at'
22886 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22887 nveformat='$nveformat'
22888 nvfformat='$nvfformat'
22889 nvgformat='$nvgformat'
22892 o_nonblock='$o_nonblock'
22894 old_pthread_create_joinable='$old_pthread_create_joinable'
22895 optimize='$optimize'
22896 orderlib='$orderlib'
22899 otherlibdirs='$otherlibdirs'
22903 patchlevel='$patchlevel'
22904 path_sep='$path_sep'
22907 perl_patchlevel='$perl_patchlevel'
22908 perladmin='$perladmin'
22909 perllibs='$perllibs'
22910 perlpath='$perlpath'
22912 phostname='$phostname'
22918 prefixexp='$prefixexp'
22920 privlibexp='$privlibexp'
22921 procselfexe='$procselfexe'
22922 prototype='$prototype'
22924 quadkind='$quadkind'
22925 quadtype='$quadtype'
22926 randbits='$randbits'
22927 randfunc='$randfunc'
22928 random_r_proto='$random_r_proto'
22929 randseedtype='$randseedtype'
22931 rd_nodata='$rd_nodata'
22932 readdir64_r_proto='$readdir64_r_proto'
22933 readdir_r_proto='$readdir_r_proto'
22934 revision='$revision'
22940 sGMTIME_max='$sGMTIME_max'
22941 sGMTIME_min='$sGMTIME_min'
22942 sLOCALTIME_max='$sLOCALTIME_max'
22943 sLOCALTIME_min='$sLOCALTIME_min'
22944 sPRIEUldbl='$sPRIEUldbl'
22945 sPRIFUldbl='$sPRIFUldbl'
22946 sPRIGUldbl='$sPRIGUldbl'
22947 sPRIXU64='$sPRIXU64'
22949 sPRIeldbl='$sPRIeldbl'
22950 sPRIfldbl='$sPRIfldbl'
22951 sPRIgldbl='$sPRIgldbl'
22956 sSCNfldbl='$sSCNfldbl'
22957 sched_yield='$sched_yield'
22958 scriptdir='$scriptdir'
22959 scriptdirexp='$scriptdirexp'
22961 seedfunc='$seedfunc'
22962 selectminbits='$selectminbits'
22963 selecttype='$selecttype'
22964 sendmail='$sendmail'
22965 setgrent_r_proto='$setgrent_r_proto'
22966 sethostent_r_proto='$sethostent_r_proto'
22967 setlocale_r_proto='$setlocale_r_proto'
22968 setnetent_r_proto='$setnetent_r_proto'
22969 setprotoent_r_proto='$setprotoent_r_proto'
22970 setpwent_r_proto='$setpwent_r_proto'
22971 setservent_r_proto='$setservent_r_proto'
22974 sharpbang='$sharpbang'
22975 shmattype='$shmattype'
22976 shortsize='$shortsize'
22979 sig_count='$sig_count'
22980 sig_name='$sig_name'
22981 sig_name_init='$sig_name_init'
22983 sig_num_init='$sig_num_init'
22984 sig_size='$sig_size'
22985 signal_t='$signal_t'
22986 sitearch='$sitearch'
22987 sitearchexp='$sitearchexp'
22989 sitebinexp='$sitebinexp'
22990 sitehtml1dir='$sitehtml1dir'
22991 sitehtml1direxp='$sitehtml1direxp'
22992 sitehtml3dir='$sitehtml3dir'
22993 sitehtml3direxp='$sitehtml3direxp'
22995 sitelib_stem='$sitelib_stem'
22996 sitelibexp='$sitelibexp'
22997 siteman1dir='$siteman1dir'
22998 siteman1direxp='$siteman1direxp'
22999 siteman3dir='$siteman3dir'
23000 siteman3direxp='$siteman3direxp'
23001 siteprefix='$siteprefix'
23002 siteprefixexp='$siteprefixexp'
23003 sitescript='$sitescript'
23004 sitescriptexp='$sitescriptexp'
23005 sizesize='$sizesize'
23006 sizetype='$sizetype'
23010 sockethdr='$sockethdr'
23011 socketlib='$socketlib'
23012 socksizetype='$socksizetype'
23014 spackage='$spackage'
23015 spitshell='$spitshell'
23016 srand48_r_proto='$srand48_r_proto'
23017 srandom_r_proto='$srandom_r_proto'
23019 ssizetype='$ssizetype'
23020 startperl='$startperl'
23022 static_ext='$static_ext'
23024 stdio_base='$stdio_base'
23025 stdio_bufsiz='$stdio_bufsiz'
23026 stdio_cnt='$stdio_cnt'
23027 stdio_filbuf='$stdio_filbuf'
23028 stdio_ptr='$stdio_ptr'
23029 stdio_stream_array='$stdio_stream_array'
23030 strerror_r_proto='$strerror_r_proto'
23033 subversion='$subversion'
23037 targetarch='$targetarch'
23041 timeincl='$timeincl'
23042 timetype='$timetype'
23043 tmpnam_r_proto='$tmpnam_r_proto'
23049 ttyname_r_proto='$ttyname_r_proto'
23058 uidformat='$uidformat'
23064 uquadtype='$uquadtype'
23065 use5005threads='$use5005threads'
23066 use64bitall='$use64bitall'
23067 use64bitint='$use64bitint'
23068 usecrosscompile='$usecrosscompile'
23069 usedevel='$usedevel'
23071 usedtrace='$usedtrace'
23072 usefaststdio='$usefaststdio'
23073 useithreads='$useithreads'
23074 uselargefiles='$uselargefiles'
23075 uselongdouble='$uselongdouble'
23076 usemallocwrap='$usemallocwrap'
23077 usemorebits='$usemorebits'
23078 usemultiplicity='$usemultiplicity'
23079 usemymalloc='$usemymalloc'
23081 useopcode='$useopcode'
23082 useperlio='$useperlio'
23083 useposix='$useposix'
23084 usereentrant='$usereentrant'
23085 userelocatableinc='$userelocatableinc'
23087 useshrplib='$useshrplib'
23088 usesitecustomize='$usesitecustomize'
23089 usesocks='$usesocks'
23090 usethreads='$usethreads'
23091 usevendorprefix='$usevendorprefix'
23092 usevfork='$usevfork'
23095 uvXUformat='$uvXUformat'
23096 uvoformat='$uvoformat'
23099 uvuformat='$uvuformat'
23100 uvxformat='$uvxformat'
23101 vendorarch='$vendorarch'
23102 vendorarchexp='$vendorarchexp'
23103 vendorbin='$vendorbin'
23104 vendorbinexp='$vendorbinexp'
23105 vendorhtml1dir='$vendorhtml1dir'
23106 vendorhtml1direxp='$vendorhtml1direxp'
23107 vendorhtml3dir='$vendorhtml3dir'
23108 vendorhtml3direxp='$vendorhtml3direxp'
23109 vendorlib='$vendorlib'
23110 vendorlib_stem='$vendorlib_stem'
23111 vendorlibexp='$vendorlibexp'
23112 vendorman1dir='$vendorman1dir'
23113 vendorman1direxp='$vendorman1direxp'
23114 vendorman3dir='$vendorman3dir'
23115 vendorman3direxp='$vendorman3direxp'
23116 vendorprefix='$vendorprefix'
23117 vendorprefixexp='$vendorprefixexp'
23118 vendorscript='$vendorscript'
23119 vendorscriptexp='$vendorscriptexp'
23121 version_patchlevel_string='$version_patchlevel_string'
23122 versiononly='$versiononly'
23124 voidflags='$voidflags'
23127 yaccflags='$yaccflags'
23132 : Add in command line options if available
23133 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23135 : add special variables
23136 $test -f $src/patchlevel.h && \
23137 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23138 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
23139 echo "PERL_CONFIG_SH=true" >>config.sh
23141 : propagate old symbols
23142 if $test -f UU/config.sh; then
23143 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23144 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23145 config.sh config.sh UU/oldconfig.sh |\
23146 $sort | $uniq -u >UU/oldsyms
23147 set X `cat UU/oldsyms`
23153 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23155 echo ": Variables propagated from previous config.sh file." >>config.sh
23156 for sym in `cat UU/oldsyms`; do
23157 echo " Propagating $hint variable "'$'"$sym..."
23158 eval 'tmp="$'"${sym}"'"'
23160 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23166 : Finish up by extracting the .SH files
23170 echo "Extraction done."
23180 If you'd like to make any changes to the config.sh file before I begin
23181 to configure things, do it as a shell escape now (e.g. !vi config.sh).
23184 rp="Press return or use a shell escape to edit config.sh:"
23189 *) : in case they cannot read
23190 sh 1>&4 -c "$ans";;
23195 : if this fails, just run all the .SH files by hand
23204 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
23211 Now you need to generate make dependencies by running "$make depend".
23212 You might prefer to run it in background: "$make depend > makedepend.out &"
23213 It can take a while, so you might not want to run it right now.
23218 rp="Run $make depend now?"
23222 $make depend && echo "Now you must run '$make'."
23225 echo "You must run '$make depend' then '$make'."
23228 elif test -f [Mm]akefile; then
23230 echo "Now you must run a $make."
23232 echo "Configure done."
23235 if $test -f Policy.sh; then
23238 If you compile $package on a different machine or from a different object
23239 directory, copy the Policy.sh file from this object directory to the
23240 new one before you run Configure -- this will help you with most of
23241 the policy defaults.
23245 if $test -f config.msg; then
23246 echo "Hmm. I also noted the following information while running:"
23248 $cat config.msg >&4
23251 $rm -f kit*isdone ark*isdone