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
19 # Though this script was generated by metaconfig from metaunits, it is
20 # OK to send patches against Configure itself. It's up to the Configure
21 # pumpkin to backport the patch to the metaunits if it is accepted.
22 # For more information on patching Configure, see pod/perlhack.pod
24 # The metaunits are also available from the public git repository:
25 # http://perl5.git.perl.org/metaconfig.git/ or
26 # $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig
28 # See Porting/pumpkin.pod for more information on metaconfig.
31 # $Id: Head.U 6 2006-08-25 22:21:46Z rmanfredi $
33 # Generated on Mon Mar 29 10:12:43 CEST 2010 [metaconfig 3.5 PL0]
34 # (with additional metaconfig patches by perlbug@perl.org)
39 SCO csh still thinks true is false. Write to SCO today and tell them that next
40 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
42 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
43 we'd have to do is go in and swap the && and || tokens, wherever they are.)
45 [End of diatribe. We now return you to your regularly scheduled programming...]
49 OOPS! You naughty creature! You didn't run Configure with sh!
50 I will attempt to remedy the situation by running sh for you...
54 true || exec sh $0 $argv:q
56 (exit $?0) || cat c2$$
57 (exit $?0) || exec sh $0 $argv:q
60 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
63 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
64 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
65 *** Please read the README.plan9 for further instructions.
66 *** Cannot continue, aborting.
72 if test ! -c /dev/null ; then
75 *** I'm sorry, but /dev/null appears to be a file rather than a device.
76 *** Please consult your operating sytem's notes for making a device
78 *** Cannot continue, aborting.
84 : compute my invocation name
88 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
93 : Proper separator for the PATH environment variable
95 : On OS/2 this directory should exist if this is not floppy only system ":-]"
96 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
97 if test -n "$OS2_SHELL"; then
99 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
100 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
102 elif test -n "$DJGPP"; then
103 case "X${MACHTYPE:-nonesuchmach}" in
110 : Proper PATH setting
111 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
112 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
113 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
114 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
115 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
116 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
117 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
118 paths="$paths /sbin /usr/sbin /usr/libexec"
119 paths="$paths /system/gnu_library/bin"
123 case "$p_$PATH$p_" in
125 *) test -d $p && PATH=$PATH$p_$p ;;
132 : shall we be using ksh?
138 if (PATH=.; alias -x) >/dev/null 2>&1; then
141 if test -f /hp-ux -a -f /bin/ksh; then
142 needksh='to avoid sh bug in "here document" expansion'
144 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
145 if test X`/usr/bin/uname -v` = X4; then
146 avoidksh="to avoid AIX 4's /bin/sh"
150 if test -f /osf_boot -a -f /usr/sbin/setld; then
151 if test X`/usr/bin/uname -s` = XOSF1; then
152 avoidksh="to avoid Digital UNIX' ksh"
157 case "$inksh/$needksh" in
164 case "$inksh/$avoidksh" in
170 case "$inksh/$needksh-$avoidksh-" in
173 (I see you are using the Korn shell. Some ksh's blow up on $me,
174 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
181 echo "(Feeding myself to $newsh $reason.)"
183 Configure|*/Configure) exec $newsh $0 "$@";;
184 *) exec $newsh Configure "$@";;
188 test -x "${newsh}" || unset newsh
190 : if needed, set CDPATH to a harmless value that is not chatty
191 : avoid bash 2.02 problems with empty CDPATH.
195 *bash*) CDPATH='.' ;;
201 : Configure runs within the UU subdirectory
202 test -d UU || mkdir UU
342 initialinstalllocation=''
371 d_attribute_deprecated=''
372 d_attribute_format=''
373 d_attribute_malloc=''
374 d_attribute_nonnull=''
375 d_attribute_noreturn=''
377 d_attribute_unused=''
378 d_attribute_warn_unused_result=''
379 d_printf_format_null=''
382 d_builtin_choose_expr=''
385 d_c99_variadic_macros=''
432 endhostent_r_proto=''
438 endprotoent_r_proto=''
444 endservent_r_proto=''
497 gethostbyaddr_r_proto=''
499 gethostbyname_r_proto=''
501 gethostent_r_proto=''
514 getnetbyaddr_r_proto=''
516 getnetbyname_r_proto=''
530 d_getprotobyname_r=''
531 getprotobyname_r_proto=''
532 d_getprotobynumber_r=''
533 getprotobynumber_r_proto=''
535 getprotoent_r_proto=''
547 getservbyname_r_proto=''
549 getservbyport_r_proto=''
551 getservent_r_proto=''
577 d_libm_lib_version=''
580 d_localtime_r_needs_tzset=''
591 d_malloc_good_size=''
635 d_old_pthread_create_joinable=''
636 old_pthread_create_joinable=''
638 d_pthread_attr_setscope=''
677 sethostent_r_proto=''
694 setprotoent_r_proto=''
706 setservent_r_proto=''
740 d_sprintf_returns_strlen=''
755 d_stdio_ptr_lval_nochange_cnt=''
756 d_stdio_ptr_lval_sets_cnt=''
900 d_gdbm_ndbm_h_uses_prototypes=''
901 d_gdbmndbm_h_uses_prototypes=''
903 d_ndbm_h_uses_prototypes=''
977 d_inc_version_list=''
979 inc_version_list_init=''
998 ignore_versioned_solibs=''
1062 d_perl_otherlibdirs=''
1070 api_versionstring=''
1076 version_patchlevel_string=''
1080 d_nv_preserves_uv=''
1081 d_nv_zero_is_allbits_zero=''
1092 nv_overflows_integers_at=''
1093 nv_preserves_uv_bits=''
1165 installsitehtml1dir=''
1168 installsitehtml3dir=''
1175 installsiteman1dir=''
1178 installsiteman3dir=''
1183 installsitescript=''
1198 d_stdio_stream_array=''
1199 stdio_stream_array=''
1216 ccflags_uselargefiles=''
1217 ldflags_uselargefiles=''
1218 libswanted_uselargefiles=''
1239 installvendorarch=''
1246 installvendorhtml1dir=''
1248 vendorhtml1direxp=''
1249 installvendorhtml3dir=''
1251 vendorhtml3direxp=''
1257 installvendorman1dir=''
1260 installvendorman3dir=''
1267 installvendorscript=''
1280 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1283 : We must find out about Eunice early
1285 if test -f /etc/unixtovms; then
1286 eunicefix=/etc/unixtovms
1288 if test -f /etc/unixtovms.exe; then
1289 eunicefix=/etc/unixtovms.exe
1292 : Set executable suffix now -- needed before hints available
1293 if test -f "/libs/version.library"; then
1296 elif test -f "/system/gnu_library/bin/ar.pm"; then
1299 elif test -n "$DJGPP"; then
1302 elif test -d c:/. -o -n "$is_os2" ; then
1309 : Trailing extension. Override this in a hint file, if needed.
1310 : Extra object files, if any, needed on this platform.
1314 : change the next line if compiling for Xenix/286 on Xenix/386
1315 xlibpth='/usr/lib/386 /lib/386'
1316 : Possible local library directories to search.
1317 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1318 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1320 : general looking path for locating libraries
1321 glibpth="/lib /usr/lib $xlibpth"
1322 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1323 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1324 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1325 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1327 : Private path used by Configure to find libraries. Its value
1328 : is prepended to libpth. This variable takes care of special
1329 : machines, like the mips. Usually, it should be empty.
1332 : default library list
1334 : some systems want to use only the non-versioned libso:s
1335 ignore_versioned_solibs=''
1336 : set usethreads on the Configure command line to enable threads.
1337 usereentrant='undef'
1338 : full support for void wanted by default
1341 : Possible local include directories to search.
1342 : Set locincpth to "" in a hint file to defeat local include searches.
1343 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1344 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1346 : no include file wanted by default
1349 : Enable -DEBUGGING and -DDEBUGGING from the command line
1356 : set useposix=false in your hint file to disable the POSIX extension.
1358 : set useopcode=false in your hint file to disable the Opcode extension.
1361 ccflags_uselargefiles=''
1362 ldflags_uselargefiles=''
1363 libswanted_uselargefiles=''
1364 : set usemultiplicity on the Configure command line to enable multiplicity.
1365 : set usesocks on the Configure command line to enable socks.
1366 : List of libraries we want.
1367 : If anyone needs extra -lxxx, put those in a hint file.
1368 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1369 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1370 : We probably want to search /usr/shlib before most other libraries.
1371 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1372 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1373 glibpth="/usr/shlib $glibpth"
1374 : Do not use vfork unless overridden by a hint file.
1377 : Find the basic shell for Bourne shell scripts
1381 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1384 if test -f "$xxx"; then
1387 : Build up a list and do a single loop so we can 'break' out.
1388 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1389 for xxx in sh bash ksh pdksh ash; do
1391 try="$try ${p}/${xxx}"
1395 if test -f "$xxx"; then
1398 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1401 elif test -f "$xxx.exe"; then
1412 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1414 Usually it's in /bin/sh. How did you even get this far?
1415 Please contact me (Perl Maintainers) at perlbug@perl.org and
1416 we'll try to straighten this all out.
1422 : see if sh knows # comments
1423 if `$sh -c '#' >/dev/null 2>&1`; then
1427 test -f $xcat$_exe || xcat=/usr/bin/cat
1428 if test ! -f $xcat$_exe; then
1429 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1430 if test -f $p/cat$_exe; then
1435 if test ! -f $xcat$_exe; then
1436 echo "Can't find cat anywhere!"
1440 echo "#!$xcat" >sharp
1443 ./sharp > today 2>/dev/null
1444 if test -s today; then
1447 echo "#! $xcat" > sharp
1450 ./sharp > today 2>/dev/null
1451 if test -s today; then
1459 echo "Your $sh doesn't grok # comments--I will strip them later on."
1462 echo "exec grep -v '^[ ]*#'" >spitshell
1464 $eunicefix spitshell
1465 spitshell=`pwd`/spitshell
1467 echo "I presume that if # doesn't work, #! won't work either!"
1472 : figure out how to guarantee sh startup
1474 '') startsh=${sharpbang}${sh} ;;
1486 : echo "Yup, it does."
1488 echo "Hmm... '$startsh' does not guarantee sh startup..."
1489 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1493 : Save command line options in file UU/cmdline.opt for later use in
1494 : generating config.sh.
1495 cat > cmdline.opt <<EOSH
1496 : Configure command line arguments.
1505 cat >>cmdline.opt <<EOSH
1506 config_arg$argn='$arg'
1508 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1511 arg_exp=`cat cmdl.opt`
1512 args_exp="$args_exp$args_sep'$arg_exp'"
1513 argn=`expr $argn + 1`
1518 : produce awk script to parse command line options
1519 cat >options.awk <<'EOF'
1521 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1523 len = length(optstr);
1524 for (i = 1; i <= len; i++) {
1525 c = substr(optstr, i, 1);
1526 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1537 if (substr(str, 1, 1) != "-") {
1538 printf("'%s'\n", str);
1542 for (i = 2; i <= len; i++) {
1543 c = substr(str, i, 1);
1545 printf("-%s\n", substr(str, i));
1551 printf("'%s'\n", substr(str, i + 1));
1564 : process the command line options
1565 set X `for arg in "$@"; do echo "X$arg"; done |
1566 sed -e s/X// | awk -f options.awk`
1571 : set up default values
1581 rm -f optdef.sh posthint.sh
1582 cat >optdef.sh <<EOS
1588 while test $# -gt 0; do
1590 -d) shift; fastread=yes;;
1591 -e) shift; alldone=cont;;
1595 if test -r "$1"; then
1598 echo "$me: cannot read config file $1." >&2
1604 -h) shift; error=true;;
1605 -r) shift; reuseval=true;;
1606 -s) shift; silent=true; realsilent=true;;
1607 -E) shift; alldone=exit;;
1608 -K) shift; knowitall=true;;
1609 -O) shift; override=true;;
1610 -S) shift; silent=true; extractsh=true;;
1615 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1616 echo "$me: ignoring -D $1" >&2
1619 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1620 *) echo "$1='define'" >> optdef.sh;;
1627 *=) echo "$1" >> optdef.sh;;
1629 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1630 echo "$me: ignoring -U $1" >&2
1632 *) echo "$1='undef'" >> optdef.sh;;
1643 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1647 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1648 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1654 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1655 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1656 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1657 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1658 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1659 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1665 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1667 echo "$yyy=''" >> posthint.sh ;;
1672 echo "$yyy='$zzz'" >> posthint.sh ;;
1674 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1676 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1681 echo "$yyy=$zzz" >> posthint.sh ;;
1682 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1686 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1689 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1697 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1698 [-U symbol] [-U symbol=] [-A command:symbol...]
1699 -d : use defaults for all answers.
1700 -e : go on without questioning past the production of config.sh.
1701 -f : specify an alternate default configuration file.
1702 -h : print this help message and exit (with an error status).
1703 -r : reuse C symbols value if possible (skips costly nm extraction).
1704 -s : silent mode, only echoes questions and essential information.
1705 -D : define symbol to have some value:
1706 -D symbol symbol gets the value 'define'
1707 -D symbol=value symbol gets the value 'value'
1708 common used examples (see INSTALL for more info):
1709 -Duse64bitint use 64bit integers
1710 -Duse64bitall use 64bit integers and pointers
1711 -Dusethreads use thread support
1712 -Dinc_version_list=none do not include older perl trees in @INC
1713 -DEBUGGING=none DEBUGGING options
1714 -Dcc=gcc choose your compiler
1715 -Dprefix=/opt/perl5 choose your destination
1716 -E : stop at the end of questions, after having produced config.sh.
1717 -K : do not use unless you know what you are doing.
1718 -O : let -D and -U override definitions from loaded configuration file.
1719 -S : perform variable substitutions on all .SH files (can mix with -f)
1720 -U : undefine symbol:
1721 -U symbol symbol gets the value 'undef'
1722 -U symbol= symbol gets completely empty
1724 -A : manipulate symbol after the platform specific hints have been applied:
1725 -A append:symbol=value append value to symbol
1726 -A symbol=value like append:, but with a separating space
1727 -A define:symbol=value define symbol to have value
1728 -A clear:symbol define symbol to be ''
1729 -A define:symbol define symbol to be 'define'
1730 -A eval:symbol=value define symbol to be eval of value
1731 -A prepend:symbol=value prepend value to symbol
1732 -A undef:symbol define symbol to be 'undef'
1733 -A undef:symbol= define symbol to be ''
1734 e.g.: -A prepend:libswanted='cl pthread '
1735 -A ccflags=-DSOME_MACRO
1736 -V : print version number and exit (with a zero status).
1743 case "$fastread$alldone" in
1746 case "$extractsh" in
1749 if test ! -t 0; then
1750 echo "Say 'sh Configure', not 'sh <Configure'"
1760 true) exec 1>/dev/null;;
1763 : run the defines and the undefines, if any, but leave the file out there...
1766 : create the posthint manipulation script and leave the file out there...
1771 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1772 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1773 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1774 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1775 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1778 : Some greps do not return status, grrr.
1779 echo "grimblepritz" >grimble
1780 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1782 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1788 : the following should work in any shell
1792 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1793 cat >contains <<'EOSS'
1794 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1799 : Find the path to the source tree
1802 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1806 *) src=`cd ../$src && pwd` ;;
1819 if test -f $rsrc/Configure && \
1820 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1822 : found it, so we are ok.
1825 for src in . .. ../.. ../../.. ../../../..; do
1826 if test -f ../$src/Configure && \
1827 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1838 Sorry, I can't seem to locate the source dir for $package. Please start
1839 Configure with an explicit path -- i.e. /some/path/Configure.
1847 echo "Sources for $package found in \"$src\"." >&4
1851 : script used to extract .SH files with variable substitutions
1852 cat >extract <<'EOS'
1854 echo "Doing variable substitutions on .SH files..."
1855 if test -f MANIFEST; then
1856 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1858 echo "(Looking for .SH files under the source directory.)"
1859 set x `(cd "$src"; find . -name "*.SH" -print)`
1863 0) set x `(cd "$src"; echo *.SH)`; shift;;
1865 if test ! -f "$src/$1"; then
1871 while test $name; do
1872 if test ! -d "$name"; then
1873 create="$name $create";
1874 name=`echo $name | sed -e "s|^[^/]*$||"`;
1875 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1880 for file in $create; do
1889 dir=`expr X$file : 'X\(.*\)/'`
1890 file=`expr X$file : 'X.*/\(.*\)'`
1891 (cd "$dir" && . ./$file)
1901 dir=`expr X$file : 'X\(.*\)/'`
1902 file=`expr X$file : 'X.*/\(.*\)'`
1903 (set x $dir; shift; eval $mkdir_p)
1904 sh <"$src/$dir/$file"
1913 if test -f "$src/config_h.SH"; then
1914 if test ! -f config.h; then
1915 : oops, they left it out of MANIFEST, probably, so do it anyway.
1916 . "$src/config_h.SH"
1921 : extract files and exit if asked to do so
1922 case "$extractsh" in
1924 case "$realsilent" in
1928 case "$config_sh" in
1929 '') config_sh='config.sh';;
1932 echo "Fetching answers from $config_sh..."
1935 test "$override" && . ./optdef.sh
1939 echo "Extraction done."
1944 : Eunice requires " " instead of "", can you believe it
1947 echo "Beginning of configuration questions for $package."
1949 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1951 : first determine how to suppress newline on echo command
1953 echo "Checking echo to see how to suppress newlines..."
1954 (echo "hi there\c" ; echo " ") >.echotmp
1955 if $contains c .echotmp >/dev/null 2>&1 ; then
1966 echo $n "The star should be here-->$c"
1970 : Now test for existence of everything in MANIFEST
1972 if test -f "$rsrc/MANIFEST"; then
1973 echo "First let's make sure your kit is complete. Checking..." >&4
1974 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1975 (split -l 50 2>/dev/null || split -50)
1978 for filelist in x??; do
1979 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1980 >/dev/null 2>>"$tmppwd/missing")
1982 if test -s missing; then
1986 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1988 You have the option of continuing the configuration process, despite the
1989 distinct possibility that your kit is damaged, by typing 'y'es. If you
1990 do, don't blame me if something goes wrong. I advise you to type 'n'o
1991 and contact the author (perlbug@perl.org).
1994 echo $n "Continue? [n] $c" >&4
1998 echo "Continuing..." >&4
2002 echo "ABORTING..." >&4
2007 echo "Looks good..."
2010 echo "There is no MANIFEST file. I hope your kit is complete !"
2014 : Find the appropriate value for a newline for tr
2016 if test -n "$DJGPP"; then
2019 if test X"$trnl" = X; then
2020 case "`echo foo|tr '\n' x 2>/dev/null`" in
2024 if test X"$trnl" = X; then
2025 case "`echo foo|tr '\012' x 2>/dev/null`" in
2026 foox) trnl='\012' ;;
2029 if test X"$trnl" = X; then
2030 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2031 fooxy) trnl='\n\r' ;;
2034 if test X"$trnl" = X; then
2037 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2043 : compute the number of columns on the terminal for proper question formatting
2048 : set up the echo used in my read
2049 myecho="case \"\$xxxm\" in
2050 '') echo $n \"\$rp $c\" >&4;;
2052 '') echo $n \"[\$xxxm] $c\";;
2054 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2056 echo $n \"[\$xxxm] $c\" >&4
2058 echo $n \"\$rp [\$xxxm] $c\" >&4
2064 : now set up to do reads with possible shell escape and default assignment
2070 case "\$fastread" in
2071 yes) case "\$dflt" in
2074 case "\$silent-\$rp" in
2079 *) case "\$silent" in
2080 true) case "\$rp" in
2085 while expr "X\$ans" : "X!" >/dev/null; do
2089 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2097 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2106 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2111 echo "(OK, I'll run with -d after this question.)" >&4
2114 echo "*** Sorry, \$1 not supported yet." >&4
2124 echo "*** Substitution done -- please confirm."
2126 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2131 echo "*** Error -- try again."
2138 case "\$ans\$xxxm\$nostick" in
2150 : create .config dir to save info across Configure sessions
2151 test -d ../.config || mkdir ../.config
2152 cat >../.config/README <<EOF
2153 This directory created by Configure to save information that should
2154 persist across sessions for $package.
2156 You may safely delete it if you wish.
2159 : See if we are using a devel version and want that
2160 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2163 usedevel="$define" ;;
2164 *) case "$xversion" in
2167 *** WHOA THERE!!! ***
2169 This is an UNSTABLE DEVELOPMENT release.
2170 The version of this $package distribution is $xversion, that is, odd,
2171 (as opposed to even) and that signifies a development release.
2172 If you want a maintenance release, you want an even-numbered version.
2174 Do ***NOT*** install this into production use.
2175 Data corruption and crashes are possible.
2177 It is most seriously suggested that you do not continue any further
2178 unless you want to help in developing and debugging Perl.
2180 If you *still* want to build perl, you can answer 'y' now,
2181 or pass -Dusedevel to Configure.
2184 rp='Do you really want to continue?'
2188 [yY]) echo >&4 "Okay, continuing."
2189 usedevel="$define" ;;
2190 *) echo >&4 "Okay, bye."
2201 case "$versiononly" in
2202 '') versiononly="$define" ;;
2204 case "$installusrbinperl" in
2205 '') installusrbinperl="$undef" ;;
2210 : general instructions
2213 user=`(logname) 2>/dev/null`
2215 '') user=`whoami 2>&1`;;
2217 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2220 rp='Would you like to see the instructions?'
2231 This installation shell script will examine your system and ask you questions
2232 to determine how the perl5 package should be installed. If you get
2233 stuck on a question, you may use a ! shell escape to start a subshell or
2234 execute a command. Many of the questions will have default answers in square
2235 brackets; typing carriage return will give you the default.
2237 On some of the questions which ask for file or directory names you are allowed
2238 to use the ~name construct to specify the login directory belonging to "name",
2239 even if you don't have a shell which knows about that. Questions where this is
2240 allowed will be marked "(~name ok)".
2244 dflt='Type carriage return to continue'
2248 The prompter used in this script allows you to use shell variables and
2249 backticks in your answers. You may use $1, $2, etc... to refer to the words
2250 in the default answer, as if the default line was a set of arguments given to a
2251 script shell. This means you may also use $* to repeat the whole default line,
2252 so you do not have to re-type everything to add something to the default.
2254 Everytime there is a substitution, you will have to confirm. If there is an
2255 error (e.g. an unmatched backtick), the default answer will remain unchanged
2256 and you will be prompted again.
2258 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2259 the questions and use the computed defaults (or the previous answers if there
2260 was already a config.sh file). Type 'Configure -h' for a list of options.
2261 You may also start interactively and then answer '& -d' at any prompt to turn
2262 on the non-interactive behaviour for the remainder of the execution.
2268 Much effort has been expended to ensure that this shell script will run on any
2269 Unix system. If despite that it blows up on yours, your best bet is to edit
2270 Configure and run it again. If you can't run Configure for some reason,
2271 you'll have to generate a config.sh file by hand. Whatever problems you
2272 have, let me (perlbug@perl.org) know how I blew it.
2274 This installation script affects things in two ways:
2276 1) it may do direct variable substitutions on some of the files included
2278 2) it builds a config.h file for inclusion in C programs. You may edit
2279 any of these files as the need arises after running this script.
2281 If you make a mistake on a question, there is no easy way to back up to it
2282 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2283 files. Configure will offer to let you do this before it runs the SH files.
2286 dflt='Type carriage return to continue'
2288 case "$firsttime" in
2289 true) echo $user >>../.config/instruct;;
2293 : find out where common programs are
2295 echo "Locating common programs..." >&4
2308 if test -d \$dir/\$thing; then
2314 for thisthing in \$dir/\$thing; do
2315 : just loop through to pick last item
2317 if test -f \$thisthing; then
2320 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2323 elif test -f \$dir/\$thing.exe; then
2324 if test -n "$DJGPP"; then
2325 echo \$dir/\$thing.exe
2326 elif test "$eunicefix" != ":"; then
2327 : on Eunice apparently
2379 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2380 pth="$pth /lib /usr/lib"
2381 for file in $loclist; do
2385 if test -f "$xxx"; then
2388 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2389 xxx=`./loc $file $file $pth`
2392 '') xxx=`./loc $file $file $pth`;;
2393 *) xxx=`./loc $xxx $xxx $pth`;;
2395 eval $file=$xxx$_exe
2399 echo $file is in $xxx.
2402 echo $file is in $xxx.
2405 echo "I don't know where '$file' is, and my life depends on it." >&4
2406 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2412 echo "Don't worry if any of the following aren't found..."
2414 for file in $trylist; do
2418 if test -f "$xxx"; then
2421 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2422 xxx=`./loc $file $file $pth`
2425 '') xxx=`./loc $file $file $pth`;;
2426 *) xxx=`./loc $xxx $xxx $pth`;;
2428 eval $file=$xxx$_exe
2432 echo $file is in $xxx.
2435 echo $file is in $xxx.
2438 echo "I don't see $file out there, $say."
2445 echo "Substituting grep for egrep."
2452 *) if $less -R </dev/null >/dev/null; then
2453 echo "Substituting less -R for less."
2461 echo "Substituting cp for ln."
2470 echo "I can't find make or gmake, and my life depends on it." >&4
2471 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2479 *) # We can't have osname yet.
2480 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2481 # Assume that gmake, if found, is definitely GNU make
2482 # and prefer it over the system make.
2483 echo "Substituting gmake for make."
2491 echo "Hopefully test is built into your sh."
2494 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2495 echo "Using the test built into your sh."
2503 echo "Hopefully echo is built into your sh."
2508 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2509 $echo $n "hi there$c" >foo1
2510 echo $n "hi there$c" >foo2
2511 if cmp foo1 foo2 >/dev/null 2>&1; then
2512 echo "They are compatible. In fact, they may be identical."
2519 They are not compatible! You are probably running ksh on a non-USG system.
2520 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2521 have echo built in and we may have to run some Bourne shell scripts. That
2522 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2525 $echo $n "The star should be here-->$c"
2532 # This question was auctioned at YAPC::Europe-2007 in Vienna
2533 # I never promised you could answer it. I only auctioned the question.
2535 The following message is sponsored by
2537 Dresden.pm<--The stars should be here.
2539 Dear Perl user, system administrator or package
2540 maintainer, the Perl community sends greetings to
2541 you. Do you (emblematical) greet back [Y/n]? n
2545 : Check what type of C compiler we use
2549 cat <<'EOSC' >>trygcc
2554 int main(int argc, char *argv[]) {
2558 if $cc -o try $ccflags $ldflags try.c; then
2561 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2567 # Skip this test because it gives a false match on output like:
2568 # ./trygcc: line 23: cc: command not found
2569 # case "`$cc -v -c try.c 2>&1`" in
2570 # *gcc*) trygcc=no ;;
2572 if $test X"$trygcc" = Xyes; then
2573 if gcc -o try -c try.c; then
2575 echo "You seem to have a working gcc, though." >&4
2576 # Switching compilers may undo the work of hints files.
2577 # The most common problem is -D_REENTRANT for threads.
2578 # This heuristic catches that case, but gets false positives
2579 # if -Dusethreads was not actually specified. Better to
2580 # bail out here with a useful message than fail
2581 # mysteriously later. Should we perhaps just try to
2582 # re-invoke Configure -Dcc=gcc config_args ?
2583 if $test -f usethreads.cbu; then
2586 *** However, any setting of the C compiler flags (e.g. for thread support)
2587 *** will be lost. It may be necessary for you to restart Configure and
2588 *** add -Dcc=gcc to your Configure command line.
2591 rp="Would you like to go ahead and try gcc anyway?"
2594 rp="Would you like to use it?"
2597 if $test -f myread; then
2600 if $test -f UU/myread; then
2603 echo "Cannot find myread, sorry. Aborting." >&2
2608 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2621 cat <<'EOSC' >>checkcc
2626 int main(int argc, char *argv[]) {
2630 if $cc -o try $ccflags $ldflags try.c; then
2633 if $test X"$despair" = Xyes; then
2634 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2637 You need to find a working C compiler.
2638 Either (purchase and) install the C compiler supplied by your OS vendor,
2639 or for a free C compiler try http://gcc.gnu.org/
2640 I cannot continue any further, aborting.
2649 : determine whether symbolic links are supported
2652 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2653 echo "Symbolic links are supported." >&4
2656 echo "Symbolic links are NOT supported." >&4
2661 : determine whether symbolic links are supported
2665 echo "Checking how to test for symbolic links..." >&4
2667 if $test "X$issymlink" = X; then
2669 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2670 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2672 if test $? = 0; then
2675 echo "Your builtin 'test -h' may be broken." >&4
2678 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2681 if test -f "$p/$test"; then
2690 echo "Trying external '$test -h'." >&4
2691 issymlink="$test -h"
2692 if $test ! -h sym >/dev/null 2>&1; then
2693 echo "External '$test -h' is broken, too." >&4
2701 if $test "X$issymlink" = X; then
2702 if $test -L sym 2>/dev/null; then
2703 issymlink="$test -L"
2704 echo "The builtin '$test -L' worked." >&4
2707 if $test "X$issymlink" != X; then
2708 echo "You can test for symbolic links with '$issymlink'." >&4
2710 echo "I do not know how you can test for symbolic links." >&4
2714 *) echo "No symbolic links, so not testing for their testing..." >&4
2719 : Make symlinks util
2720 case "$mksymlinks" in
2723 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2726 *) case "$lns:$issymlink" in
2727 *"ln"*" -s:"*"test -"?)
2728 echo "Creating the symbolic links..." >&4
2729 echo "(First creating the subdirectories...)" >&4
2731 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2733 test -z "$directory" && break
2737 if test ! -d t/base; then
2738 echo "Failed to create the subdirectories. Aborting." >&4
2741 echo "(Then creating the symlinks...)" >&4
2742 awk '{print $1}' $src/MANIFEST | while true; do
2744 test -z "$filename" && break
2745 if test -f $filename; then
2746 if $issymlink $filename; then
2750 if test -f $filename; then
2751 echo "$filename already exists, not symlinking."
2753 ln -s $src/$filename $filename
2757 if test ! -f t/base/lex.t; then
2758 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2763 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2771 : Check for Cross-Compilation
2772 case "$usecrosscompile" in
2774 $echo "Cross-compiling..."
2777 *-*-gcc) # A cross-compiling gcc, probably.
2778 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2780 # leave out ld, choosing it is more complex
2782 ranlib=$targetarch-ranlib
2783 $echo 'extern int foo;' > try.c
2784 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2786 if $test $# -gt 0; then
2788 incpth="`$echo $incpth|$sed 's/^ //'`"
2789 echo "Guessing incpth '$incpth'." >&4
2791 j="`$echo $i|$sed 's,/include$,/lib,'`"
2792 if $test -d $j; then
2796 libpth="`$echo $libpth|$sed 's/^ //'`"
2797 echo "Guessing libpth '$libpth'." >&4
2802 case "$targetarch" in
2803 '') echo "Targetarch not defined." >&4; croak=y ;;
2804 *) echo "Using targetarch $targetarch." >&4 ;;
2807 '') echo "Incpth not defined." >&4; croak=y ;;
2808 *) echo "Using incpth '$incpth'." >&4 ;;
2811 '') echo "Libpth not defined." >&4; croak=y ;;
2812 *) echo "Using libpth '$libpth'." >&4 ;;
2815 '') for i in $incpth; do
2816 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2818 echo "Guessing usrinc $usrinc." >&4
2823 '') echo "Usrinc not defined." >&4; croak=y ;;
2826 *) echo "Using usrinc $usrinc." >&4 ;;
2828 case "$targethost" in
2829 '') echo "Targethost not defined." >&4; croak=y ;;
2830 *) echo "Using targethost $targethost." >&4
2835 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2838 /*) run=$src/Cross/run
2839 targetmkdir=$src/Cross/mkdir
2841 from=$src/Cross/from
2843 *) pwd=`$test -f ../Configure & cd ..; pwd`
2845 targetmkdir=$pwd/Cross/mkdir
2847 from=$pwd/Cross/from
2850 case "$targetrun" in
2851 '') targetrun=ssh ;;
2856 case "$targetfrom" in
2857 '') targetfrom=scp ;;
2861 from=$from-$targetfrom
2862 case "$targetdir" in
2864 echo "Guessing targetdir $targetdir." >&4
2867 case "$targetuser" in
2869 echo "Guessing targetuser $targetuser." >&4
2872 case "$targetfrom" in
2876 case "$targetrun" in
2888 '') cwd=$targetdir ;;
2892 if $test ! -f \$exe.xok; then
2896 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2899 *) echo "Unknown targetrun '$targetrun'" >&4
2903 case "$targetmkdir" in
2905 cat >$targetmkdir <<EOF
2907 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2909 $chmod a+rx $targetmkdir
2911 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2923 $targetmkdir \`dirname \$f\`
2924 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2927 $targetmkdir $targetdir/\`dirname \$f\`
2928 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2941 $mkdir -p $targetdir/\`dirname \$f\`
2942 $cp \$f $targetdir/\$f || exit 1
2945 $targetmkdir $targetdir/\`dirname \$f\`
2946 $cp \$f $targetdir/\$f || exit 1
2953 *) echo "Unknown targetto '$targetto'" >&4
2957 case "$targetfrom" in
2964 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2969 cp) cat >$from <<EOF
2974 cp $targetdir/\$f . || exit 1
2979 *) echo "Unknown targetfrom '$targetfrom'" >&4
2983 if $test ! -f $run; then
2984 echo "Target 'run' script '$run' not found." >&4
2988 if $test ! -f $to; then
2989 echo "Target 'to' script '$to' not found." >&4
2993 if $test ! -f $from; then
2994 echo "Target 'from' script '$from' not found." >&4
2998 if $test ! -f $run -o ! -f $to -o ! -f $from; then
3002 Using '$run' for remote execution,
3003 and '$from' and '$to'
3004 for remote file transfer.
3010 usecrosscompile='undef'
3015 : see whether [:lower:] and [:upper:] are supported character classes
3017 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3019 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3023 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
3024 # (0xd9 and 0xe2), therefore that is a nice testing point.
3025 if test "X$up" = X -o "X$low" = X; then
3026 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3032 if test "X$up" = X -o "X$low" = X; then
3033 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3039 if test "X$up" = X -o "X$low" = X; then
3040 case "`echo RS | od -x 2>/dev/null`" in
3042 echo "Hey, this might be EBCDIC." >&4
3043 if test "X$up" = X -o "X$low" = X; then
3044 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3045 rs) up='[A-IJ-RS-Z]'
3050 if test "X$up" = X -o "X$low" = X; then
3051 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3061 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3063 echo "Using $up and $low to convert case." >&4
3066 echo "I don't know how to translate letters from upper to lower case." >&4
3067 echo "Your tr is not acting any way I know of." >&4
3071 : set up the translation script tr, must be called with ./tr of course
3075 '[A-Z][a-z]') exec $tr '$up' '$low';;
3076 '[a-z][A-Z]') exec $tr '$low' '$up';;
3083 : Try to determine whether config.sh was made on this system
3084 case "$config_sh" in
3086 myuname=`$uname -a 2>/dev/null`
3087 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3088 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3089 # because the A-Z/a-z are not consecutive.
3090 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3091 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3092 newmyuname="$myuname"
3094 case "$knowitall" in
3096 if test -f ../config.sh; then
3097 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3098 eval "`grep myuname= ../config.sh`"
3100 if test "X$myuname" = "X$newmyuname"; then
3108 : Get old answers from old config file if Configure was run on the
3109 : same system, otherwise use the hints.
3112 if test -f config.sh; then
3114 rp="I see a config.sh file. Shall I use it to set the defaults?"
3117 n*|N*) echo "OK, I'll ignore it."
3118 mv config.sh config.sh.old
3119 myuname="$newmyuname"
3121 *) echo "Fetching default answers from your old config.sh file..." >&4
3129 : Older versions did not always set $sh. Catch re-use of such
3139 if test ! -f config.sh; then
3142 First time through, eh? I have some defaults handy for some systems
3143 that need some extra help getting the Configure answers right:
3146 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3148 : Half the following guesses are probably wrong... If you have better
3149 : tests or hints, please send them to perlbug@perl.org
3150 : The metaconfig authors would also appreciate a copy...
3151 $test -f /irix && osname=irix
3152 $test -f /xenix && osname=sco_xenix
3153 $test -f /dynix && osname=dynix
3154 $test -f /dnix && osname=dnix
3155 $test -f /lynx.os && osname=lynxos
3156 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3157 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3158 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3159 $test -f /bin/mips && /bin/mips && osname=mips
3160 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3161 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3162 $test -d /usr/apollo/bin && osname=apollo
3163 $test -f /etc/saf/_sactab && osname=svr4
3164 $test -d /usr/include/minix && osname=minix
3165 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3166 if $test -d /MachTen -o -d /MachTen_Folder; then
3168 if $test -x /sbin/version; then
3169 osvers=`/sbin/version | $awk '{print $2}' |
3170 $sed -e 's/[A-Za-z]$//'`
3171 elif $test -x /usr/etc/version; then
3172 osvers=`/usr/etc/version | $awk '{print $2}' |
3173 $sed -e 's/[A-Za-z]$//'`
3179 $test -f /sys/posix.dll &&
3180 $test -f /usr/bin/what &&
3181 set X `/usr/bin/what /sys/posix.dll` &&
3182 $test "$3" = UWIN &&
3186 if $test -f $uname; then
3194 umips) osname=umips ;;
3197 [23]100) osname=mips ;;
3198 next*) osname=next ;;
3200 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3201 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3204 elif $test -f /etc/kconfig; then
3206 if test "$lns" = "$ln -s"; then
3208 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3210 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3217 if test -n "$DJGPP"; then
3226 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3228 # oslevel can fail with:
3229 # oslevel: Unable to acquire lock.
3230 *not\ found) osvers="$4"."$3" ;;
3231 '<3240'|'<>3240') osvers=3.2.0 ;;
3232 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3233 '=3250'|'>3250') osvers=3.2.5 ;;
3237 bsd386) osname=bsd386
3240 cygwin*) osname=cygwin
3243 *dc.osx) osname=dcosx
3249 domainos) osname=apollo
3255 dragonfly) osname=dragonfly
3258 dynixptx*) osname=dynixptx
3259 osvers=`echo "$4"|sed 's/^v//'`
3261 freebsd) osname=freebsd
3263 genix) osname=genix ;;
3267 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3283 netbsd*) osname=netbsd
3286 news-os) osvers="$3"
3288 4*) osname=newsos4 ;;
3292 next*) osname=next ;;
3293 nonstop-ux) osname=nonstopux ;;
3294 openbsd) osname=openbsd
3300 POSIX-BC | posix-bc ) osname=posix-bc
3303 powerux | power_ux | powermax_os | powermaxos | \
3304 powerunix | power_unix) osname=powerux
3310 solaris) osname=solaris
3312 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3319 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3323 titanos) osname=titanos
3332 ultrix) osname=ultrix
3335 osf1|mls+) case "$5" in
3338 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3341 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3344 hp*) osname=hp_osf1 ;;
3345 mips) osname=mips_osf1 ;;
3348 # UnixWare 7.1.2 is known as Open UNIX 8
3349 openunix|unixware) osname=svr5
3357 $2) case "$osname" in
3361 : svr4.x or possibly later
3371 if test -f /stand/boot ; then
3372 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3373 if test -n "$INITPROG" -a -f "$INITPROG"; then
3374 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3375 if test -n "$isesix"; then
3383 *) if test -f /etc/systemid; then
3385 set `echo $3 | $sed 's/\./ /g'` $4
3386 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3388 elif $test -f $src/hints/sco_$1_$2.sh; then
3390 elif $test -f $src/hints/sco_$1.sh; then
3395 '') : Still unknown. Probably a generic Sys V.
3404 *) case "$osname" in
3405 '') : Still unknown. Probably a generic BSD.
3413 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3414 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3415 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3418 $rm -f UU/kernel.what
3419 elif test -d c:/. -o -n "$is_os2" ; then
3426 case "$targetarch" in
3429 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3434 : Now look for a hint file osname_osvers, unless one has been
3435 : specified already.
3438 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3439 : Also try without trailing minor version numbers.
3440 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3441 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3442 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3443 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3446 *) case "$osvers" in
3449 *) if $test -f $src/hints/$file.sh ; then
3451 elif $test -f $src/hints/$xfile.sh ; then
3453 elif $test -f $src/hints/$xxfile.sh ; then
3455 elif $test -f $src/hints/$xxxfile.sh ; then
3457 elif $test -f $src/hints/$xxxxfile.sh ; then
3459 elif $test -f "$src/hints/${osname}.sh" ; then
3468 if $test -f Policy.sh ; then
3471 none) dflt="Policy" ;;
3472 *) dflt="Policy $dflt" ;;
3477 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3481 if $test -f Policy.sh ; then
3484 There's also a Policy hint file available, which should make the
3485 site-specific (policy) questions easier to answer.
3492 You may give one or more space-separated answers, or "none" if appropriate.
3493 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3494 previous run of Configure, you may specify it as well as or instead of
3495 OS-specific hints. If hints are provided for your OS, you should use them:
3496 although Perl can probably be built without hints on many platforms, using
3497 hints often improve performance and may enable features that Configure can't
3498 set up on its own. If there are no hints that match your OS, specify "none";
3499 DO NOT give a wrong version or a wrong OS.
3503 rp="Which of these apply, if any?"
3506 for file in $tans; do
3507 if $test X$file = XPolicy -a -f Policy.sh; then
3509 $cat Policy.sh >> UU/config.sh
3510 elif $test -f $src/hints/$file.sh; then
3511 . $src/hints/$file.sh
3512 $cat $src/hints/$file.sh >> UU/config.sh
3513 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3516 : Give one chance to correct a possible typo.
3517 echo "$file.sh does not exist"
3519 rp="hint to use instead?"
3521 for file in $ans; do
3522 if $test -f "$src/hints/$file.sh"; then
3523 . $src/hints/$file.sh
3524 $cat $src/hints/$file.sh >> UU/config.sh
3525 elif $test X$ans = X -o X$ans = Xnone ; then
3528 echo "$file.sh does not exist -- ignored."
3535 : Remember our hint file for later.
3536 if $test -f "$src/hints/$file.sh" ; then
3546 echo "Fetching default answers from $config_sh..." >&4
3550 cp $config_sh config.sh 2>/dev/null
3560 test "$override" && . ./optdef.sh
3562 : Restore computed paths
3563 for file in $loclist $trylist; do
3564 eval $file="\$_$file"
3569 Configure uses the operating system name and version to set some defaults.
3570 The default value is probably right if the name rings a bell. Otherwise,
3571 since spelling matters for me, either accept the default or answer "none"
3578 ''|' '|none) dflt=none ;;
3579 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3582 *) dflt="$osname" ;;
3584 rp="Operating system name?"
3588 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3594 ''|' '|none) dflt=none ;;
3595 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3596 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3598 ''|' ') dflt=none ;;
3603 *) dflt="$osvers" ;;
3605 rp="Operating system version?"
3615 : who configured the system
3616 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3619 cf_by=`(logname) 2>/dev/null`
3622 cf_by=`(whoami) 2>/dev/null`
3624 "") cf_by=unknown ;;
3629 : decide how portable to be. Allow command line overrides.
3630 case "$d_portable" in
3632 *) d_portable="$define" ;;
3635 : set up shell script to do ~ expansion
3641 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3644 if $test -f /bin/csh; then
3645 /bin/csh -f -c "glob \$1"
3650 name=\`$expr x\$1 : '..\([^/]*\)'\`
3651 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3652 if $test ! -d "\$dir"; then
3654 echo "\$me: can't locate home directory for: \$name" >&2
3659 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3675 : now set up to get a file name
3679 cat <<'EOSC' >>getfile
3695 : getfile will accept an answer from the comma-separated list
3696 : enclosed in parentheses even if it does not meet other criteria.
3697 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3698 fn=`echo $fn | sed 's/(.*)//'`
3704 loc_file=`expr $fn : '.*:\(.*\)'`
3705 fn=`expr $fn : '\(.*\):.*'`
3713 */*) fullpath=true;;
3722 *e*) exp_file=true;;
3725 *p*) nopath_ok=true;;
3730 *d*) type='Directory';;
3731 *l*) type='Locate';;
3736 Locate) what='File';;
3741 case "$d_portable" in
3749 while test "$type"; do
3754 true) rp="$rp (~name ok)";;
3757 if test -f UU/getfile.ok && \
3758 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3777 value=`UU/filexp $ans`
3780 if test "$ans" != "$value"; then
3781 echo "(That expands to $value on this system.)"
3795 /*) value="$ansexp" ;;
3796 [a-zA-Z]:/*) value="$ansexp" ;;
3801 echo "I shall only accept a full path name, as in /bin/ls." >&4
3802 echo "Use a ! shell escape if you wish to check pathnames." >&4
3805 echo "Please give a full path name, starting with slash." >&4
3808 echo "Note that using ~name is ok provided it expands well." >&4
3821 for fp in $gfpth; do
3822 if test "X$fp" = X.; then
3827 if test -f "$pf"; then
3829 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3831 echo "($value is not a plain file, but that's ok.)"
3834 if test X"$type" = X; then
3841 for fp in $gfpth; do
3842 if test "X$fp" = X.; then
3847 direxp="$fp/$ansexp"
3849 if test -d "$direxp"; then
3857 if test -d "$ansexp"; then
3858 echo "(Looking for $loc_file in directory $value.)"
3859 value="$value/$loc_file"
3860 ansexp="$ansexp/$loc_file"
3862 if test -f "$ansexp"; then
3865 case "$nopath_ok" in
3866 true) case "$value" in
3868 *) echo "Assuming $value will be in people's path."
3884 if test "$fastread" = yes; then
3889 rp="$what $value doesn't exist. Use that name anyway?"
3908 test "X$gfpthkeep" != Xy && gfpth=""
3911 : determine root of directory hierarchy where package will be installed.
3914 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3917 dflt=`echo "$prefix" | sed 's/.$//'`
3925 By default, $package will be installed in $dflt/bin, manual pages
3926 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3927 installation directories. Typically this is something like /usr/local.
3928 If you wish to have binaries under /usr/bin but other parts of the
3929 installation under /usr/local, that's ok: you will be prompted
3930 separately for each of the installation directories, the prefix being
3931 only used to set the defaults.
3935 rp='Installation prefix to use?'
3943 *) oldprefix="$prefix";;
3950 : allow them to override the AFS root
3953 *) afsroot=$afsroot ;;
3959 $define|true) afs=true ;;
3960 $undef|false) afs=false ;;
3961 *) if $test -d $afsroot; then
3969 echo "AFS may be running... I'll be extra cautious then..." >&4
3971 echo "AFS does not seem to be running..." >&4
3974 : determine installation prefix for where package is to be installed.
3978 Since you are running AFS, I need to distinguish the directory in which
3979 files will reside from the directory in which they are installed (and from
3980 which they are presumably copied to the former directory by occult means).
3983 case "$installprefix" in
3984 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3985 *) dflt="$installprefix";;
3990 In some special cases, particularly when building $package for distribution,
3991 it is convenient to distinguish the directory in which files should be
3992 installed from the directory ($prefix) in which they will
3993 eventually reside. For most users, these two directories are the same.
3996 case "$installprefix" in
3998 *) dflt=$installprefix;;
4002 rp='What installation prefix should I use for installing files?'
4004 installprefix="$ans"
4005 installprefixexp="$ansexp"
4007 : Perform the prefixexp/installprefixexp correction if necessary
4008 cat <<EOS >installprefix
4011 cat <<'EOSC' >>installprefix
4012 : Change installation prefix, if necessary.
4013 if $test X"$prefix" != X"$installprefix"; then
4014 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
4016 eval "install${prefixvar}=\"\$${prefixvar}exp\""
4019 chmod +x installprefix
4020 $eunicefix installprefix
4022 : Set variables such as privlib and privlibexp from the output of ./getfile
4023 : performing the prefixexp/installprefixexp correction if necessary.
4024 cat <<EOS >setprefixvar
4027 cat <<'EOSC' >>setprefixvar
4028 eval "${prefixvar}=\"\$ans\""
4029 eval "${prefixvar}exp=\"\$ansexp\""
4032 chmod +x setprefixvar
4033 $eunicefix setprefixvar
4035 : set up the script used to warn in case of inconsistency
4044 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4046 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4047 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4052 echo "*** WHOA THERE!!! ***" >&4
4053 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4056 rp=" Keep the $hint value?"
4059 y) td=$was; tu=$was;;
4063 : function used to set '$1' to '$val'
4064 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4066 $define$undef) . ./whoa; eval "$var=\$td";;
4067 $undef$define) . ./whoa; eval "$var=\$tu";;
4068 *) eval "$var=$val";;
4071 : Check is we will use socks
4073 $define|true|[yY]*) dflt='y';;
4078 Perl can be built to use the SOCKS proxy protocol library. To do so,
4079 Configure must be run with -Dusesocks. If you use SOCKS you also need
4080 to use the PerlIO abstraction layer, this will be implicitly selected.
4082 If this doesn't make any sense to you, just accept the default '$dflt'.
4084 rp='Build Perl for SOCKS?'
4087 y|Y) val="$define" ;;
4094 $define|true|[yY]*) useperlio="$define";;
4097 : Check if we want perlio
4098 case "$useperlio" in
4099 $define|true|[yY]*|'') dflt='y';;
4104 Previous version of $package used the standard IO mechanisms as
4105 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4106 alternate IO mechanisms via the PerlIO abstraction layer, but the
4107 stdio mechanism is still available if needed. The abstraction layer
4108 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4109 Using PerlIO with sfio may cause problems with some extension modules.
4111 If this doesn't make any sense to you, just accept the default '$dflt'.
4113 rp='Use the PerlIO abstraction layer?'
4120 echo "Ok, doing things the stdio way."
4129 case "$useperlio" in
4130 $define|true|[yY]*) ;;
4133 You are using the SOCKS proxy protocol library which means that you
4134 should also use the PerlIO layer. You may be headed for trouble.
4142 : get the patchlevel
4144 echo "Getting the current patchlevel..." >&4
4145 if $test -r $rsrc/patchlevel.h;then
4146 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4147 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4148 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4149 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4150 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4151 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4152 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4161 $echo "(You do not have patchlevel.h. Eek.)"
4163 if $test -r $rsrc/.patch ; then
4164 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
4165 perl_patchlevel=`cat $rsrc/.patch`
4168 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4169 version_patchlevel_string="version $patchlevel subversion $subversion"
4170 case "$perl_patchlevel" in
4172 *) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
4173 version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
4177 $echo "(You have $package $version_patchlevel_string.)"
4181 : XXX Should be a Configure test for double-dots in filenames.
4182 version=`echo $revision $patchlevel $subversion | \
4183 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4184 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4185 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4188 version=`echo $revision $patchlevel $subversion | \
4189 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4190 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4191 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4194 : Special case the 5.005_xx maintenance series, which used 5.005
4195 : without any subversion label as a subdirectory in $sitelib
4196 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4197 api_versionstring='5.005'
4200 : Do we want threads support and if so, what type
4201 case "$usethreads" in
4202 $define|true|[yY]*) dflt='y';;
4203 *) # Catch case where user specified ithreads or 5005threads but
4204 # forgot -Dusethreads (A.D. 4/2002)
4205 case "$useithreads$use5005threads" in
4207 case "$useperlio" in
4208 "$define") dflt='y' ;;
4218 Perl can be built to take advantage of threads on some systems.
4219 To do so, Configure can be run with -Dusethreads.
4221 Note that Perl built with threading support runs slightly slower
4222 and uses more memory than plain Perl. The current implementation
4223 is believed to be stable, but it is fairly new, and so should be
4224 treated with caution.
4226 If this doesn't make any sense to you, just accept the default '$dflt'.
4228 rp='Build a threading Perl?'
4231 y|Y) val="$define" ;;
4237 if $test $patchlevel -lt 9; then
4238 case "$usethreads" in
4242 Since release 5.6, Perl has had two different threading implementations,
4243 the newer interpreter-based version (ithreads) with one interpreter per
4244 thread, and the older 5.005 version (5005threads).
4245 The 5005threads version is effectively unmaintained and will probably be
4246 removed in Perl 5.10, so there should be no need to build a Perl using it
4247 unless needed for backwards compatibility with some existing 5.005threads
4251 : Default to ithreads unless overridden on command line or with
4254 case "$use5005threads" in
4255 $define|true|[yY]*) dflt='n';;
4257 case "$useithreads" in
4258 $undef|false|[nN]*) dflt='n';;
4260 rp='Use the newer interpreter-based ithreads?'
4263 y|Y) val="$define" ;;
4268 : Now set use5005threads to the opposite value.
4269 case "$useithreads" in
4270 $define) val="$undef" ;;
4277 useithreads="$undef"
4278 use5005threads="$undef"
4282 case "$useithreads$use5005threads" in
4286 You cannot have both the ithreads and the 5.005 threads enabled
4287 at the same time. Disabling the 5.005 threads since they are
4288 much less stable than the ithreads.
4291 use5005threads="$undef"
4296 : perl-5.9.x and later
4298 if test X"$usethreads" = "X$define"; then
4299 case "$use5005threads" in
4303 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4310 use5005threads="$undef"
4311 useithreads="$usethreads"
4314 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4317 *** To build with ithreads you must also use the PerlIO layer.
4318 *** Cannot continue, aborting.
4324 case "$d_oldpthreads" in
4325 '') : Configure tests would be welcome here. For now, assume undef.
4327 *) val="$d_oldpthreads" ;;
4333 : Look for a hint-file generated 'call-back-unit'. If the
4334 : user has specified that a threading perl is to be built,
4335 : we may need to set or change some other defaults.
4336 if $test -f usethreads.cbu; then
4337 echo "Your platform has some specific hints regarding threaded builds, using them..."
4340 case "$usethreads" in
4341 "$define"|true|[yY]*)
4343 (Your platform does not have any specific hints for threaded builds.
4344 Assuming POSIX threads, then.)
4350 : Check if multiplicity is required
4353 Perl can be built so that multiple Perl interpreters can coexist
4354 within the same Perl executable.
4357 case "$useithreads" in
4360 This multiple interpreter support is required for interpreter-based threads.
4364 *) case "$usemultiplicity" in
4365 $define|true|[yY]*) dflt='y';;
4369 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4370 rp='Build Perl for multiplicity?'
4373 y|Y) val="$define" ;;
4381 : Check if morebits is requested
4382 case "$usemorebits" in
4383 "$define"|true|[yY]*)
4384 use64bitint="$define"
4385 uselongdouble="$define"
4386 usemorebits="$define"
4388 *) usemorebits="$undef"
4392 : Determine the C compiler to be used
4398 rp="Use which C compiler?"
4402 : See whether they have no cc but they do have gcc
4404 if $test -f cc.cbu; then
4409 : make some quick guesses about what we are up against
4411 $echo $n "Hmm... $c"
4421 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4422 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4424 echo "Looks kind of like an OSF/1 system, but we'll see..."
4426 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4427 xxx=`./loc addbib blurfl $pth`
4428 if $test -f $xxx; then
4429 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4433 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4434 echo "Looks kind of like an extended USG system, but we'll see..."
4436 echo "Looks kind of like a USG system, but we'll see..."
4440 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4441 echo "Looks kind of like a BSD system, but we'll see..."
4445 echo "Looks kind of like a Version 7 system, but we'll see..."
4448 case "$eunicefix" in
4451 There is, however, a strange, musty smell in the air that reminds me of
4452 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4456 : it so happens the Eunice I know will not run shell scripts in Unix format
4460 echo "Congratulations. You aren't running Eunice."
4464 : Detect OS2. The p_ variable is set above in the Head.U unit.
4465 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4466 : semicolon as a patch separator
4471 I have the feeling something is not exactly right, however...don't tell me...
4472 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4473 (Or you may be running DOS with DJGPP.)
4478 if test -f /xenix; then
4479 echo "Actually, this looks more like a XENIX system..."
4484 echo "It's not Xenix..."
4489 if test -f /venix; then
4490 echo "Actually, this looks more like a VENIX system..."
4497 echo "Nor is it Venix..."
4500 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4501 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4504 : Check if we are using GNU gcc and what its version is
4506 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4510 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4512 printf("%s\n", __VERSION__);
4514 printf("%s\n", "1");
4520 if $cc -o try $ccflags $ldflags try.c; then
4521 gccversion=`$run ./try`
4522 case "$gccversion" in
4523 '') echo "You are not using GNU cc." ;;
4524 *) echo "You are using GNU cc $gccversion."
4530 echo "*** WHOA THERE!!! ***" >&4
4531 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4532 case "$knowitall" in
4534 echo " You'd better start hunting for one and let me know about it." >&4
4540 case "$gccversion" in
4541 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4543 case "$gccversion" in
4544 '') gccosandvers='' ;;
4545 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4546 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4548 case "$gccosandvers" in
4549 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4550 $osname$osvers) ;; # looking good
4551 $osname*) cat <<EOM >&4
4553 *** WHOA THERE!!! ***
4555 Your gcc has not been compiled for the exact release of
4556 your operating system ($gccosandvers versus $osname$osvers).
4558 In general it is a good idea to keep gcc synchronized with
4559 the operating system because otherwise serious problems
4560 may ensue when trying to compile software, like Perl.
4562 I'm trying to be optimistic here, though, and will continue.
4563 If later during the configuration and build icky compilation
4564 problems appear (headerfile conflicts being the most common
4565 manifestation), I suggest reinstalling the gcc to match
4566 your operating system release.
4570 *) gccosandvers='' ;; # failed to parse, better be silent
4578 # gcc 3.* complain about adding -Idirectories that they already know about,
4579 # so we will take those off from locincpth.
4580 case "$gccversion" in
4582 echo "main(){}">try.c
4583 for incdir in $locincpth; do
4584 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4585 grep '^c[cp]p*[01]: warning: changing search order '`
4586 if test "X$warn" != X; then
4587 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4593 : What should the include directory be ?
4595 $echo $n "Hmm... $c"
4599 if $test -f /bin/mips && /bin/mips; then
4600 echo "Looks like a MIPS system..."
4601 $cat >usr.c <<'EOCP'
4602 #ifdef SYSTYPE_BSD43
4606 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4607 dflt='/bsd43/usr/include'
4611 mips_type='System V'
4613 $rm -f usr.c usr.out
4614 echo "and you're compiling with the $mips_type compiler and libraries."
4618 echo "Doesn't look like a MIPS system."
4628 case "$xxx_prompt" in
4631 rp='Where are the include files you want to use?'
4639 : see how we invoke the C preprocessor
4641 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4642 cat <<'EOT' >testcpp.c
4648 if test ! -f cppstdin; then
4649 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4650 # AIX cc -E doesn't show the absolute headerfile
4651 # locations but we'll cheat by using the -M flag.
4652 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
4654 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4657 echo "Keeping your $hint cppstdin wrapper."
4660 wrapper=`pwd`/cppstdin
4664 if $test "X$cppstdin" != "X" && \
4665 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4666 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4668 echo "You used to use $cppstdin $cppminus so we'll use that again."
4670 '') echo "But let's see if we can live without a wrapper..." ;;
4672 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4673 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4675 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4678 echo "(However, $cpprun $cpplast does not work, let's see...)"
4686 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4693 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4694 $cc -E <testcpp.c >testcpp.out 2>&1; \
4695 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4696 echo "Yup, it does."
4699 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4700 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4701 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4702 echo "Yup, it does."
4705 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4706 $cc -P <testcpp.c >testcpp.out 2>&1; \
4707 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4708 echo "Yipee, that works!"
4711 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4712 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4713 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4714 echo "At long last!"
4717 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4718 $cpp <testcpp.c >testcpp.out 2>&1; \
4719 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4723 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4724 $cpp - <testcpp.c >testcpp.out 2>&1; \
4725 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4726 echo "Hooray, it works! I was beginning to wonder."
4729 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4730 $wrapper <testcpp.c >testcpp.out 2>&1; \
4731 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4737 rp="No dice. I can't find a C preprocessor. Name one:"
4741 $x_cpp <testcpp.c >testcpp.out 2>&1
4742 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4743 echo "OK, that will do." >&4
4745 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4760 echo "Perhaps can we force $cc -E using a wrapper..."
4761 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4762 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4768 echo "Nope, we'll have to live without it..."
4782 "$wrapper"|'cppstdin') ;;
4783 *) $rm -f $wrapper;;
4785 $rm -f testcpp.c testcpp.out
4787 : Set private lib path
4790 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4795 '') dlist="$loclibpth $plibpth $glibpth";;
4796 *) dlist="$libpth";;
4799 : Now check and see which directories actually exist, avoiding duplicates
4803 if $test -d $xxx; then
4806 *) libpth="$libpth $xxx";;
4812 Some systems have incompatible or broken versions of libraries. Among
4813 the directories listed in the question below, please remove any you
4814 know not to be holding relevant libraries, and add any that are needed.
4815 Say "none" for none.
4826 rp="Directories to use for library searches?"
4833 : compute shared library extension
4836 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4846 On some systems, shared libraries may be available. Answer 'none' if
4847 you want to suppress searching of shared libraries for the remainder
4848 of this configuration.
4851 rp='What is the file extension used for shared libraries?'
4855 : Define several unixisms.
4856 : Hints files or command line option can be used to override them.
4857 : The convoluted testing is in case hints files set either the old
4860 '') case "$exe_ext" in
4862 *) _exe="$exe_ext" ;;
4867 '') case "$lib_ext" in
4874 '') case "$obj_ext" in
4881 '') case "$path_sep" in
4892 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4894 : Which makefile gets called first. This is used by make depend.
4895 case "$firstmakefile" in
4896 '') firstmakefile='makefile';;
4899 : Check for uselongdouble support
4901 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4904 case "$uselongdouble" in
4905 $define|true|[yY]*) dflt='y';;
4910 Perl can be built to take advantage of long doubles which
4911 (if available) may give more accuracy and range for floating point numbers.
4913 If this doesn't make any sense to you, just accept the default '$dflt'.
4915 rp='Try to use long doubles if available?'
4918 y|Y) val="$define" ;;
4924 case "$uselongdouble" in
4925 true|[yY]*) uselongdouble="$define" ;;
4928 : Look for a hint-file generated 'call-back-unit'. If the
4929 : user has specified that long doubles should be used,
4930 : we may need to set or change some other defaults.
4931 if $test -f uselongdouble.cbu; then
4932 echo "Your platform has some specific hints regarding long doubles, using them..."
4933 . ./uselongdouble.cbu
4935 case "$uselongdouble" in
4938 (Your platform does not have any specific hints for long doubles.)
4944 : Looking for optional libraries
4946 echo "Checking for optional libraries..." >&4
4951 case "$libswanted" in
4952 '') libswanted='c_s';;
4955 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4961 for thisdir in $libpth $xlibpth; do
4962 test -d $thisdir && libspath="$libspath $thisdir"
4964 for thislib in $libswanted; do
4965 for thisdir in $libspath; do
4967 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4968 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4969 $test -f "$xxx" && eval $libscheck
4970 $test -f "$xxx" && libstyle=shared
4972 if test ! -f "$xxx"; then
4973 xxx=$thisdir/lib$thislib.$so
4974 $test -f "$xxx" && eval $libscheck
4975 $test -f "$xxx" && libstyle=shared
4977 if test ! -f "$xxx"; then
4978 xxx=$thisdir/lib$thislib$_a
4979 $test -f "$xxx" && eval $libscheck
4980 $test -f "$xxx" && libstyle=static
4982 if test ! -f "$xxx"; then
4983 xxx=$thisdir/$thislib$_a
4984 $test -f "$xxx" && eval $libscheck
4985 $test -f "$xxx" && libstyle=static
4987 if test ! -f "$xxx"; then
4988 xxx=$thisdir/lib${thislib}_s$_a
4989 $test -f "$xxx" && eval $libscheck
4990 $test -f "$xxx" && libstyle=static
4991 $test -f "$xxx" && thislib=${thislib}_s
4993 if test ! -f "$xxx"; then
4994 xxx=$thisdir/Slib$thislib$_a
4995 $test -f "$xxx" && eval $libscheck
4996 $test -f "$xxx" && libstyle=static
4998 if $test -f "$xxx"; then
5000 shared) echo "Found -l$thislib (shared)." ;;
5001 static) echo "Found -l$thislib." ;;
5002 *) echo "Found -l$thislib ($libstyle)." ;;
5006 *) dflt="$dflt -l$thislib"
5007 libsfound="$libsfound $xxx"
5009 libsfiles="$libsfiles $yyy"
5010 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
5011 case " $libsdirs " in
5013 *) libsdirs="$libsdirs $yyy" ;;
5020 if $test ! -f "$xxx"; then
5021 echo "No -l$thislib."
5032 ' '|'') dflt='none';;
5037 In order to compile $package on your machine, a number of libraries
5038 are usually needed. Include any other special libraries here as well.
5039 Say "none" for none. The default list is almost always right.
5043 rp="What libraries to use?"
5050 : determine optimization, if desired, or use for debug flag also
5052 ' '|$undef) dflt='none';;
5054 *) dflt="$optimize";;
5058 By default, $package compiles with the -O flag to use the optimizer.
5059 Alternately, you might want to use the symbolic debugger, which uses
5060 the -g flag (on traditional Unix systems). Either flag can be
5061 specified here. To use neither flag, specify the word "none".
5064 rp="What optimizer/debugger flag should be used?"
5068 'none') optimize=" ";;
5071 : Check what DEBUGGING is required from the command line
5072 : -DEBUGGING or -DDEBUGGING or
5073 : -DEBUGGING=both = -g + -DDEBUGGING
5074 : -DEBUGGING=-g or -Doptimize=-g = -g
5075 : -DEBUGGING=none or -UDEBUGGING =
5076 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5079 *) DEBUGGING=$EBUGGING ;;
5082 case "$DEBUGGING" in
5086 *) optimize="$optimize -g" ;;
5090 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5098 case "$DEBUGGING" in
5099 both|$define) dflt='-DDEBUGGING'
5102 : argument order is deliberate, as the flag will start with - which set could
5103 : think is an option
5104 checkccflag='check=$1; flag=$2; callback=$3;
5106 echo "Checking if your compiler accepts $flag" 2>&1;
5107 echo "int main(void) { return 0; }" > gcctest.c;
5108 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5109 echo "Yes, it does." 2>&1;
5110 if $test -s gcctest.out ; then
5111 echo "But your platform does not like it:";
5116 echo "Leaving current flags $ccflags alone." 2>&1
5118 *) dflt="$dflt $flag";
5124 echo "Nope, it does not, but that is ok." 2>&1;
5128 : We will not override a previous value, but we might want to
5129 : augment a hint file
5131 default|recommended)
5132 case "$gccversion" in
5133 1*) dflt="$dflt -fpcc-struct-return" ;;
5135 case "$optimize:$DEBUGGING" in
5136 *-g*:old) dflt="$dflt -DDEBUGGING";;
5138 case "$gccversion" in
5139 2*) if $test -d /etc/conf/kconfig.d &&
5140 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5142 # Interactive Systems (ISC) POSIX mode.
5147 case "$gccversion" in
5150 ?*) set strict-aliasing -fno-strict-aliasing
5154 # For gcc, adding -pipe speeds up compilations for some, but apparently
5155 # some assemblers can't read from stdin. (It also slows down compilations
5156 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5157 case "$gccversion" in
5163 # on x86_64 (at least) we require an extra library (libssp) in the
5164 # link command line. This library is not named, so I infer that it is
5165 # an implementation detail that may change. Hence the safest approach
5166 # is to add the flag to the flags passed to the compiler at link time,
5167 # as that way the compiler can do the right implementation dependant
5169 case "$gccversion" in
5170 ?*) set stack-protector -fstack-protector
5177 case "$mips_type" in
5178 *BSD*|'') inclwanted="$locincpth $usrinc";;
5179 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5181 for thisincl in $inclwanted; do
5182 if $test -d $thisincl; then
5183 if $test x$thisincl != x$usrinc; then
5185 *" -I$thisincl "*);;
5186 *) dflt="$dflt -I$thisincl ";;
5192 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5194 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5202 *) dflt="$dflt -D$2";;
5206 set signal.h LANGUAGE_C; eval $inctest
5210 ccflags="$ccflags -DSOCKS"
5215 default|recommended) dflt="$ccflags $dflt" ;;
5216 *) dflt="$ccflags";;
5225 Your C compiler may want other flags. For this question you should include
5226 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5227 but you should NOT include libraries or ld flags like -lwhatever. If you
5228 want $package to honor its debug switch, you should include -DDEBUGGING here.
5229 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5231 To use no flags, specify the word "none".
5237 rp="Any additional cc flags?"
5244 : the following weeds options from ccflags that are of no interest to cpp
5246 '') cppflags="$ccflags" ;;
5247 *) cppflags="$cppflags $ccflags" ;;
5249 case "$gccversion" in
5250 1*) cppflags="$cppflags -D__GNUC__"
5252 case "$mips_type" in
5254 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5260 echo "Let me guess what the preprocessor flags are..." >&4
5274 *) ftry="$previous $flag";;
5276 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5277 >cpp1.out 2>/dev/null && \
5278 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5279 >cpp2.out 2>/dev/null && \
5280 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5281 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5283 cppflags="$cppflags $ftry"
5293 *-*) echo "They appear to be: $cppflags";;
5295 $rm -f cpp.c cpp?.out
5299 : flags used in final linking phase
5301 '') if ./venix; then
5307 *-posix*) dflt="$dflt -posix" ;;
5310 *) dflt="$ldflags";;
5312 # See note above about -fstack-protector
5314 *-fstack-protector*)
5316 *-fstack-protector*) ;; # Don't add it again
5317 *) dflt="$dflt -fstack-protector" ;;
5322 : Try to guess additional flags to pick up local libraries.
5323 for thislibdir in $libpth; do
5324 case " $loclibpth " in
5327 *"-L$thislibdir "*) ;;
5328 *) dflt="$dflt -L$thislibdir" ;;
5340 Your C linker may need flags. For this question you should
5341 include -L/whatever and any other flags used by the C linker, but you
5342 should NOT include libraries like -lwhatever.
5344 Make sure you include the appropriate -L/path flags if your C linker
5345 does not normally search all of the directories you specified above,
5348 To use no flags, specify the word "none".
5352 rp="Any additional ld flags (NOT including libraries)?"
5358 rmlist="$rmlist pdp11"
5362 echo "Checking your choice of C compiler and flags for coherency..." >&4
5363 $cat > try.c <<'EOF'
5365 int main() { printf("Ok\n"); return(0); }
5367 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5369 $cat >try.msg <<'EOM'
5370 I've tried to compile and run the following simple program:
5373 $cat try.c >> try.msg
5375 $cat >> try.msg <<EOM
5382 and I got the following output:
5386 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5387 if $sh -c "$run ./try " >>try.msg 2>&1; then
5391 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5394 cat >> try.msg <<'EOQS'
5395 If $libs contains -lsfio, and sfio is mis-configured, then it
5396 sometimes (apparently) runs and exits with a 0 status, but with no
5397 output! It may have to do with sfio's use of _exit vs. exit.
5400 rp="You have a big problem. Shall I abort Configure"
5407 echo "The program compiled OK, but exited with status $?." >>try.msg
5408 rp="You have a problem. Shall I abort Configure"
5412 echo "I can't compile the test program." >>try.msg
5413 rp="You have a BIG problem. Shall I abort Configure"
5419 case "$knowitall" in
5421 echo "(The supplied flags or libraries might be incorrect.)"
5429 *) echo "Ok. Stopping Configure." >&4
5434 n) echo "OK, that should do.";;
5436 $rm_try gcctest gcctest.out
5438 : define a shorthand compile call
5442 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5443 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5447 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5448 : define a shorthand compile call for compilations that should be ok.
5452 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5454 : determine filename position in cpp output
5456 echo "Computing filename position in cpp output for #include directives..." >&4
5458 vos) testaccess=-e ;;
5461 echo '#include <stdio.h>' > foo.c
5464 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5465 $grep '^[ ]*#.*stdio\.h' | \
5466 while read cline; do
5469 while $test \$# -gt 0; do
5470 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5475 pos=\`expr \$pos + 1\`
5487 *) pos="${fieldn}th";;
5489 echo "Your cpp writes the filename in the $pos field of the line."
5492 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5493 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5496 : locate header file
5501 for usrincdir in $usrinc
5503 if test -f \$usrincdir/\$wanted; then
5504 echo "\$usrincdir/\$wanted"
5508 awkprg='{ print \$$fieldn }'
5509 echo "#include <\$wanted>" > foo\$\$.c
5510 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5511 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5512 while read cline; do
5513 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5515 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5516 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5521 # status = 0: grep returned 0 lines, case statement not executed
5522 # status = 1: headerfile found
5523 # status = 2: while loop executed, no headerfile found
5527 if test \$status -eq 1; then
5534 : define an alternate in-header-list? function
5535 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5536 cont=true; xxf="echo \"<\$1> found.\" >&4";
5537 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5538 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5540 case $# in 4) instead=instead;; *) instead="at last";; esac;
5541 while $test "$cont"; do
5543 var=$2; eval "was=\$$2";
5544 if $test "$xxx" && $test -r "$xxx";
5546 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5549 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5550 set $yyy; shift; shift; yyy=$@;
5551 case $# in 0) cont="";;
5552 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5553 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5554 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5555 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5559 do set $yyy; var=$2; eval "was=\$$2";
5560 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5561 set $yyy; shift; shift; yyy=$@;
5564 : see if stdlib is available
5565 set stdlib.h i_stdlib
5568 : check for lengths of integral types
5572 echo "Checking to see how big your integers are..." >&4
5581 printf("intsize=%d;\n", (int)sizeof(int));
5582 printf("longsize=%d;\n", (int)sizeof(long));
5583 printf("shortsize=%d;\n", (int)sizeof(short));
5588 if eval $compile_ok && $run ./try > /dev/null; then
5590 echo "Your integers are $intsize bytes long."
5591 echo "Your long integers are $longsize bytes long."
5592 echo "Your short integers are $shortsize bytes long."
5596 Help! I can't compile and run the intsize test program: please enlighten me!
5597 (This is probably a misconfiguration in your system or libraries, and
5598 you really ought to fix it. Still, I'll try anyway.)
5602 rp="What is the size of an integer (in bytes)?"
5606 rp="What is the size of a long integer (in bytes)?"
5610 rp="What is the size of a short integer (in bytes)?"
5618 : check for long long
5620 echo "Checking to see if you have long long..." >&4
5621 echo 'int main() { long long x = 7; return 0; }' > try.c
5623 if eval $compile; then
5625 echo "You have long long."
5628 echo "You do not have long long."
5634 : check for length of long long
5635 case "${d_longlong}${longlongsize}" in
5638 echo "Checking to see how big your long longs are..." >&4
5639 $cat >try.c <<'EOCP'
5643 printf("%d\n", (int)sizeof(long long));
5648 if eval $compile_ok; then
5649 longlongsize=`$run ./try`
5650 echo "Your long longs are $longlongsize bytes long."
5654 echo "(I can't seem to compile the test program. Guessing...)"
5655 rp="What is the size of a long long (in bytes)?"
5659 if $test "X$longsize" = "X$longlongsize"; then
5660 echo "(That isn't any different from an ordinary long.)"
5666 : see if inttypes.h is available
5667 : we want a real compile instead of Inhdr because some systems
5668 : have an inttypes.h which includes non-existent headers
5671 #include <inttypes.h>
5673 static int32_t foo32 = 0x12345678;
5677 if eval $compile; then
5678 echo "<inttypes.h> found." >&4
5681 echo "<inttypes.h> NOT found." >&4
5690 echo "Checking to see if you have int64_t..." >&4
5692 #include <sys/types.h>
5693 #$i_inttypes I_INTTYPES
5695 #include <inttypes.h>
5697 int main() { int64_t x = 7; }
5700 if eval $compile; then
5702 echo "You have int64_t."
5705 echo "You do not have int64_t."
5711 : Check if 64bit ints have a quad type
5713 echo "Checking which 64-bit integer type we could use..." >&4
5719 val='"unsigned int"'
5724 *) case "$longsize" in
5728 val='"unsigned long"'
5733 *) case "$d_longlong:$longlongsize" in
5738 val='"unsigned long long"'
5743 *) case "$d_int64_t" in
5762 '') echo "Alas, no 64-bit integer types in sight." >&4
5765 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5770 : Do we want 64bit support
5771 case "$uselonglong" in
5772 "$define"|true|[yY]*)
5775 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5777 use64bitint="$define"
5780 case "$use64bits" in
5781 "$define"|true|[yY]*)
5784 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5786 use64bitint="$define"
5789 case "$use64bitints" in
5790 "$define"|true|[yY]*)
5793 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5795 use64bitint="$define"
5798 case "$use64bitsint" in
5799 "$define"|true|[yY]*)
5802 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5804 use64bitint="$define"
5807 case "$uselonglongs" in
5808 "$define"|true|[yY]*)
5811 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5813 use64bitint="$define"
5816 case "$use64bitsall" in
5817 "$define"|true|[yY]*)
5820 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5822 use64bitall="$define"
5827 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5829 case "$use64bitall" in
5830 "$define"|true|[yY]*) use64bitint="$define" ;;
5836 You have natively 64-bit long integers.
5840 *) case "$use64bitint" in
5841 "$define"|true|[yY]*) dflt='y';;
5850 Perl can be built to take advantage of 64-bit integer types
5851 on some systems. To do so, Configure can be run with -Duse64bitint.
5852 Choosing this option will most probably introduce binary incompatibilities.
5854 If this doesn't make any sense to you, just accept the default '$dflt'.
5855 (The default has been chosen based on your configuration.)
5857 rp='Try to use 64-bit integers, if available?'
5860 [yY]*) val="$define" ;;
5868 case "$use64bitall" in
5869 "$define"|true|[yY]*) dflt='y' ;;
5870 *) case "$longsize" in
5878 You may also choose to try maximal 64-bitness. It means using as much
5879 64-bitness as possible on the platform. This in turn means even more
5880 binary incompatibilities. On the other hand, your platform may not
5881 have any more 64-bitness available than what you already have chosen.
5883 If this doesn't make any sense to you, just accept the default '$dflt'.
5884 (The default has been chosen based on your configuration.)
5886 rp='Try to use maximal 64-bit support, if available?'
5889 [yY]*) val="$define" ;;
5894 case "$use64bitall" in
5896 case "$use64bitint" in
5900 Since you have chosen a maximally 64-bit build, I'm also turning on
5901 the use of 64-bit integers.
5903 use64bitint="$define" ;;
5908 : Look for a hint-file generated 'call-back-unit'. If the
5909 : user has specified that a 64-bit perl is to be built,
5910 : we may need to set or change some other defaults.
5911 if $test -f use64bitint.cbu; then
5912 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5915 case "$use64bitint" in
5916 "$define"|true|[yY]*)
5918 4) case "$archname64" in
5919 '') archname64=64int ;;
5926 : Look for a hint-file generated 'call-back-unit'. If the
5927 : user has specified that a maximally 64-bit perl is to be built,
5928 : we may need to set or change some other defaults.
5929 if $test -f use64bitall.cbu; then
5930 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5933 case "$use64bitall" in
5934 "$define"|true|[yY]*)
5936 4) case "$archname64" in
5937 ''|64int) archname64=64all ;;
5944 case "$d_quad:$use64bitint" in
5948 *** You have chosen to use 64-bit integers,
5949 *** but none can be found.
5950 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5951 *** Cannot continue, aborting.
5958 : check for length of double
5960 case "$doublesize" in
5962 echo "Checking to see how big your double precision numbers are..." >&4
5971 printf("%d\n", (int)sizeof(double));
5976 if eval $compile_ok; then
5977 doublesize=`$run ./try`
5978 echo "Your double is $doublesize bytes long."
5981 echo "(I can't seem to compile the test program. Guessing...)"
5982 rp="What is the size of a double precision number (in bytes)?"
5990 : check for long doubles
5992 echo "Checking to see if you have long double..." >&4
5993 echo 'int main() { long double x = 7.0; }' > try.c
5995 if eval $compile; then
5997 echo "You have long double."
6000 echo "You do not have long double."
6006 : check for length of long double
6007 case "${d_longdbl}${longdblsize}" in
6010 echo "Checking to see how big your long doubles are..." >&4
6011 $cat >try.c <<'EOCP'
6015 printf("%d\n", sizeof(long double));
6020 if eval $compile; then
6021 longdblsize=`$run ./try`
6022 echo "Your long doubles are $longdblsize bytes long."
6026 echo "(I can't seem to compile the test program. Guessing...)" >&4
6027 rp="What is the size of a long double (in bytes)?"
6031 if $test "X$doublesize" = "X$longdblsize"; then
6032 echo "That isn't any different from an ordinary double."
6033 echo "I'll keep your setting anyway, but you may see some"
6034 echo "harmless compilation warnings."
6040 : determine the architecture name
6042 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6043 tarch=`arch`"-$osname"
6044 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6045 if uname -m > tmparch 2>&1 ; then
6046 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6047 -e 's/$/'"-$osname/" tmparch`
6055 case "$myarchname" in
6058 echo "(Your architecture name used to be $myarchname.)"
6062 case "$targetarch" in
6064 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6069 *) dflt="$archname";;
6071 rp='What is your architecture name'
6074 case "$usethreads" in
6076 echo "Threads selected." >&4
6078 *-thread*) echo "...and architecture name already has -thread." >&4
6080 *) archname="$archname-thread"
6081 echo "...setting architecture name to $archname." >&4
6086 case "$usemultiplicity" in
6088 echo "Multiplicity selected." >&4
6090 *-multi*) echo "...and architecture name already has -multi." >&4
6092 *) archname="$archname-multi"
6093 echo "...setting architecture name to $archname." >&4
6098 case "$use64bitint$use64bitall" in
6100 case "$archname64" in
6102 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6105 case "$use64bitint" in
6106 "$define") echo "64 bit integers selected." >&4 ;;
6108 case "$use64bitall" in
6109 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6112 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6114 *) archname="$archname-$archname64"
6115 echo "...setting architecture name to $archname." >&4
6121 case "$uselongdouble" in
6123 echo "Long doubles selected." >&4
6124 case "$longdblsize" in
6126 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6130 *-ld*) echo "...and architecture name already has -ld." >&4
6132 *) archname="$archname-ld"
6133 echo "...setting architecture name to $archname." >&4
6140 case "$useperlio" in
6142 echo "Perlio selected." >&4
6145 echo "Perlio not selected, using stdio." >&4
6147 *-stdio*) echo "...and architecture name already has -stdio." >&4
6149 *) archname="$archname-stdio"
6150 echo "...setting architecture name to $archname." >&4
6155 if $test -f archname.cbu; then
6156 echo "Your platform has some specific hints for architecture name, using them..."
6160 : set the prefixit variable, to compute a suitable default value
6161 prefixit='case "$3" in
6163 case "$oldprefix" in
6164 "") eval "$1=\"\$$2\"";;
6171 ""|" ") eval "$1=\"\$$2\"";;
6177 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6179 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6180 /*-$oldprefix/*|\~*-$oldprefix/*)
6181 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6182 *) eval "$1=\"\$$2\"";;
6186 : determine installation style
6187 : For now, try to deduce it from prefix unless it is already set.
6188 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6189 case "$installstyle" in
6190 '') case "$prefix" in
6191 *perl*) dflt='lib';;
6192 *) dflt='lib/perl5' ;;
6195 *) dflt="$installstyle" ;;
6197 : Probably not worth prompting for this since we prompt for all
6198 : the directories individually, and the prompt would be too long and
6202 : determine where public executables go
6207 rp='Pathname where the public executables will reside?'
6209 if $test "X$ansexp" != "X$binexp"; then
6213 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6214 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6215 : this via initialinstalllocation
6218 case "$userelocatableinc" in
6219 $define|true|[yY]*) dflt='y' ;;
6224 Would you like to build Perl so that the installation is relocatable, so that
6225 library paths in @INC are determined relative to the path of the perl binary?
6226 This is not advised for system Perl installs, or if you need to run setid
6227 scripts or scripts under taint mode.
6229 If this doesn't make any sense to you, just accept the default '$dflt'.
6231 rp='Use relocatable @INC?'
6234 y|Y) val="$define" ;;
6237 set userelocatableinc
6240 initialinstalllocation="$binexp"
6241 : Default prefix is now "up one level from where the binaries are"
6242 case "$userelocatableinc" in
6248 installprefixexp=".../.."
6252 : determine where private library files go
6253 : Usual default is /usr/local/lib/perl5/$version.
6254 : Also allow things like /opt/perl/lib/$version, since
6255 : /opt/perl/lib/perl5... would be redundant.
6256 : The default "style" setting is made in installstyle.U
6257 case "$installstyle" in
6258 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6259 *) set dflt privlib lib/$version ;;
6264 There are some auxiliary files for $package that need to be put into a
6265 private library directory that is accessible by everyone.
6270 rp='Pathname where the private library files will reside?'
6275 : set the prefixup variable, to restore leading tilda escape
6276 prefixup='case "$prefixexp" in
6278 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6281 : determine where public architecture dependent libraries go
6284 : privlib default is /usr/local/lib/$package/$version
6285 : archlib default is /usr/local/lib/$package/$version/$archname
6286 : privlib may have an optional trailing /share.
6287 tdflt=`echo $privlib | $sed 's,/share$,,'`
6288 tdflt=$tdflt/$archname
6297 $spackage contains architecture-dependent library files. If you are
6298 sharing libraries in a heterogeneous environment, you might store
6299 these files in a separate location. Otherwise, you can just include
6300 them with the rest of the public library files.
6305 rp='Where do you want to put the public architecture-dependent libraries?'
6309 if $test X"$archlib" = X"$privlib"; then
6315 : see if setuid scripts can be secure
6318 Some kernels have a bug that prevents setuid #! scripts from being
6319 secure. Some sites have disabled setuid #! scripts because of this.
6321 First let's decide if your kernel supports secure setuid #! scripts.
6322 (If setuid #! scripts would be secure but have been disabled anyway,
6323 don't say that they are secure if asked.)
6328 if $test -d /dev/fd; then
6329 echo "#!$ls" >reflect
6330 chmod +x,u+s reflect
6331 ./reflect >flect 2>&1
6332 if $contains "/dev/fd" flect >/dev/null; then
6333 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6337 If you are not sure if they are secure, I can check but I'll need a
6338 username and password different from the one you are using right now.
6339 If you don't have such a username or don't want me to test, simply
6343 rp='Other username to test security of setuid scripts with?'
6348 case "$d_suidsafe" in
6349 '') echo "I'll assume setuid scripts are *not* secure." >&4
6352 echo "Well, the $hint value is *not* secure." >&4
6354 *) echo "Well, the $hint value *is* secure." >&4
6359 $rm -f reflect flect
6360 echo "#!$ls" >reflect
6361 chmod +x,u+s reflect
6364 echo '"su" will (probably) prompt you for '"$ans's password."
6365 su $ans -c './reflect >flect'
6366 if $contains "/dev/fd" flect >/dev/null; then
6367 echo "Okay, it looks like setuid scripts are secure." >&4
6370 echo "I don't think setuid scripts are secure." >&4
6375 rp='Does your kernel have *secure* setuid scripts?'
6378 [yY]*) val="$define";;
6383 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6384 echo "(That's for file descriptors, not floppy disks.)"
6390 $rm -f reflect flect
6392 : now see if they want to do setuid emulation
6393 if $test $patchlevel -lt 11; then
6396 case "$d_suidsafe" in
6399 echo "No need to emulate SUID scripts since they are secure here." >&4
6403 Some systems have disabled setuid scripts, especially systems where
6404 setuid scripts cannot be secure. On systems where setuid scripts have
6405 been disabled, the setuid/setgid bits on scripts are currently
6406 useless. It is possible for $package to detect those bits and emulate
6407 setuid/setgid in a secure fashion. This emulation will only work if
6408 setuid scripts have been disabled in your kernel.
6412 "$define") dflt=y ;;
6415 rp="Do you want to do setuid/setgid emulation?"
6418 [yY]*) val="$define";;
6430 SUID emulation has been removed for 5.12
6431 Please re-run Configure without -Dd_dosuid
6440 : Find perl5.005 or later.
6441 echo "Looking for a previously installed perl5.005 or later... "
6443 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6444 : Check if this perl is recent and can load a simple module
6445 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6448 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6458 '') echo "None found. That's ok.";;
6459 *) echo "Using $perl5." ;;
6462 : Set the siteprefix variables
6465 After $package is installed, you may wish to install various
6466 add-on modules and utilities. Typically, these add-ons will
6467 be installed under $prefix with the rest
6468 of this package. However, you may wish to install such add-ons
6469 elsewhere under a different prefix.
6471 If you do not wish to put everything under a single prefix, that's
6472 ok. You will be prompted for the individual locations; this siteprefix
6473 is only used to suggest the defaults.
6475 The default should be fine for most people.
6479 rp='Installation prefix to use for add-on modules and utilities?'
6480 : XXX Here might be another good place for an installstyle setting.
6481 case "$siteprefix" in
6483 *) dflt=$siteprefix ;;
6486 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6488 case "$siteprefix" in
6492 *) oldsiteprefix="$prefix";;
6497 siteprefixexp="$ansexp"
6499 : determine where site specific libraries go.
6500 : Usual default is /usr/local/lib/perl5/site_perl/$version
6501 : The default "style" setting is made in installstyle.U
6502 : XXX No longer works with Prefixit stuff.
6503 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6505 '') case "$installstyle" in
6506 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6507 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6515 The installation process will create a directory for
6516 site-specific extensions and modules. Most users find it convenient
6517 to place all site-specific files in this directory rather than in the
6518 main distribution directory.
6522 rp='Pathname for the site-specific library files?'
6526 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6528 : Determine list of previous versions to include in @INC
6529 $cat > getverlist <<EOPL
6532 \$api_versionstring = "$api_versionstring";
6533 \$version = "$version";
6534 \$stem = "$sitelib_stem";
6535 \$archname = "$archname";
6537 $cat >> getverlist <<'EOPL'
6538 # The list found is store twice for each entry: the original name, and
6539 # the binary broken down version as pack "sss", so sorting is easy and
6540 # unambiguous. This will work for all versions that have a maximum of
6541 # three digit groups, separate by '.'s or '_'s. Names are extended with
6542 # ".0.0" to ensure at least three elements for the pack.
6543 # -- H.Merijn Brand (m)'06 23-10-2006
6545 # Can't have leading @ because metaconfig interprets it as a command!
6546 ;@inc_version_list=();
6547 # XXX Redo to do opendir/readdir?
6550 ;@candidates = map {
6551 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6552 ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
6558 ($pversion, $aversion, $vsn5005) = map {
6559 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6560 foreach $d (@candidates) {
6561 if ($d->[1] lt $pversion) {
6562 if ($d->[1] ge $aversion) {
6563 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6565 elsif ($d->[1] ge $vsn5005) {
6566 unshift(@inc_version_list, grep { -d } $d->[0]);
6570 # Skip newer version. I.e. don't look in
6571 # 5.7.0 if we're installing 5.6.1.
6575 if (@inc_version_list) {
6576 print join(' ', @inc_version_list);
6579 # Blank space to preserve value for next Configure run.
6584 case "$inc_version_list" in
6585 '') if test -x "$perl5$exe_ext"; then
6586 dflt=`$perl5 getverlist`
6591 $undef) dflt='none' ;;
6592 *) eval dflt=\"$inc_version_list\" ;;
6595 ''|' ') dflt=none ;;
6602 In order to ease the process of upgrading, this version of perl
6603 can be configured to use modules built and installed with earlier
6604 versions of perl that were installed under $prefix. Specify here
6605 the list of earlier versions that this version of perl should check.
6606 If Configure detected no earlier versions of perl installed under
6607 $prefix, then the list will be empty. Answer 'none' to tell perl
6608 to not search earlier versions.
6610 The default should almost always be sensible, so if you're not sure,
6611 just accept the default.
6614 rp='List of earlier versions to include in @INC?'
6617 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6618 *) inc_version_list="$ans" ;;
6620 case "$inc_version_list" in
6622 inc_version_list_init='0'
6623 d_inc_version_list="$undef"
6625 *) inc_version_list_init=`echo $inc_version_list |
6626 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6627 d_inc_version_list="$define"
6632 : see if malloc/malloc.h has to be included
6633 set malloc/malloc.h i_mallocmalloc
6636 : see if this is a malloc.h system
6637 : we want a real compile instead of Inhdr because some systems have a
6638 : malloc.h that just gives a compile error saying to use stdlib.h instead
6643 #$i_mallocmalloc I_MALLOCMALLOC
6644 #ifdef I_MALLOCMALLOC
6645 # include <malloc/malloc.h>
6648 int main () { return 0; }
6651 if eval $compile; then
6652 echo "<malloc.h> found." >&4
6655 echo "<malloc.h> NOT found." >&4
6662 : check for void type
6664 echo "Checking to see how well your C compiler groks the void type..." >&4
6665 case "$voidflags" in
6677 extern void moo(); /* function returning void */
6678 void (*goo)(); /* ptr to func returning void */
6680 void *hue; /* generic ptr */
6693 int main() { sub(); }
6695 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6696 voidflags=$defvoidused
6697 echo "Good. It appears to support void to the level $package wants.">&4
6698 if $contains warning .out >/dev/null 2>&1; then
6699 echo "However, you might get some warnings that look like this:"
6703 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6704 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6705 echo "It supports 1..."
6706 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6707 echo "It also supports 2..."
6708 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6710 echo "And it supports 4 but not 8 definitely."
6712 echo "It doesn't support 4..."
6713 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6715 echo "But it supports 8."
6718 echo "Neither does it support 8."
6722 echo "It does not support 2..."
6723 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6725 echo "But it supports 4 and 8."
6727 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6729 echo "And it supports 4 but has not heard about 8."
6731 echo "However it supports 8 but not 4."
6736 echo "There is no support at all for void."
6741 case "$voidflags" in
6744 Support flag bits are:
6745 1: basic void declarations.
6746 2: arrays of pointers to functions returning void.
6747 4: operations between pointers to and addresses of void functions.
6748 8: generic void pointers.
6751 rp="Your void support flags add up to what?"
6758 : check for length of pointer
6762 echo "Checking to see how big your pointers are..." >&4
6763 if test "$voidflags" -gt 7; then
6764 echo '#define VOID_PTR char *' > try.c
6766 echo '#define VOID_PTR void *' > try.c
6776 printf("%d\n", (int)sizeof(VOID_PTR));
6781 if eval $compile_ok; then
6782 ptrsize=`$run ./try`
6783 echo "Your pointers are $ptrsize bytes long."
6786 echo "(I can't seem to compile the test program. Guessing...)" >&4
6787 rp="What is the size of a pointer (in bytes)?"
6794 case "$use64bitall" in
6795 "$define"|true|[yY]*)
6799 *** You have chosen a maximally 64-bit build,
6800 *** but your pointers are only 4 bytes wide.
6801 *** Please rerun Configure without -Duse64bitall.
6806 *** Since you have quads, you could possibly try with -Duse64bitint.
6811 *** Cannot continue, aborting.
6822 : determine whether to use malloc wrapping
6824 case "$usemallocwrap" in
6825 [yY]*|true|$define) dflt='y' ;;
6826 [nN]*|false|$undef) dflt='n' ;;
6827 *) case "$usedevel" in
6828 [yY]*|true|$define) dflt='y' ;;
6833 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6835 usemallocwrap="$ans"
6838 usemallocwrap="$define" ;;
6840 usemallocwrap="$undef" ;;
6843 : determine which malloc to compile in
6845 case "$usemymalloc" in
6846 [yY]*|true|$define) dflt='y' ;;
6847 [nN]*|false|$undef) dflt='n' ;;
6848 *) case "$ptrsize" in
6854 rp="Do you wish to attempt to use the malloc that comes with $package?"
6860 mallocsrc='malloc.c'
6861 mallocobj="malloc$_o"
6862 d_mymalloc="$define"
6865 : Remove malloc from list of libraries to use
6866 echo "Removing unneeded -lmalloc from library list" >&4
6867 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6870 echo "libs = $libs" >&4
6882 : compute the return types of malloc and free
6884 $cat >malloc.c <<END
6888 #include <sys/types.h>
6902 case "$malloctype" in
6904 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6911 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6915 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6922 echo "Your system uses $freetype free(), it would seem." >&4
6924 : determine where site specific architecture-dependent libraries go.
6925 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6926 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6927 : sitelib may have an optional trailing /share.
6929 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6930 dflt="$dflt/$archname"
6935 set sitearch sitearch none
6939 The installation process will also create a directory for
6940 architecture-dependent site-specific extensions and modules.
6944 rp='Pathname for the site-specific architecture-dependent library files?'
6948 if $test X"$sitearch" = X"$sitelib"; then
6951 d_sitearch="$define"
6954 : Set the vendorprefix variables
6957 The installation process will also create a directory for
6958 vendor-supplied add-ons. Vendors who supply perl with their system
6959 may find it convenient to place all vendor-supplied files in this
6960 directory rather than in the main distribution directory. This will
6961 ease upgrades between binary-compatible maintenance versions of perl.
6963 Of course you may also use these directories in whatever way you see
6964 fit. For example, you might use them to access modules shared over a
6965 company-wide network.
6967 The default answer should be fine for most people.
6968 This causes further questions about vendor add-ons to be skipped
6969 and no vendor-specific directories will be configured for perl.
6972 rp='Do you want to configure vendor-specific add-on directories?'
6973 case "$usevendorprefix" in
6974 define|true|[yY]*) dflt=y ;;
6975 *) : User may have set vendorprefix directly on Configure command line.
6976 case "$vendorprefix" in
6985 rp='Installation prefix to use for vendor-supplied add-ons?'
6986 case "$vendorprefix" in
6988 *) dflt=$vendorprefix ;;
6991 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6993 case "$vendorprefix" in
6997 *) oldvendorprefix="$prefix";;
7001 usevendorprefix="$define"
7003 vendorprefixexp="$ansexp"
7005 *) usevendorprefix="$undef"
7011 : Set the vendorlib variables
7012 case "$vendorprefix" in
7013 '') d_vendorlib="$undef"
7017 *) d_vendorlib="$define"
7018 : determine where vendor-supplied modules go.
7019 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7020 case "$vendorlib" in
7022 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7023 case "$installstyle" in
7024 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7025 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7028 *) dflt="$vendorlib"
7032 rp='Pathname for the vendor-supplied library files?'
7035 vendorlibexp="$ansexp"
7038 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7042 : Set the vendorarch variables
7043 case "$vendorprefix" in
7044 '') d_vendorarch="$undef"
7048 *) d_vendorarch="$define"
7049 : determine where vendor-supplied architecture-dependent libraries go.
7050 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7051 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7052 : vendorlib may have an optional trailing /share.
7053 case "$vendorarch" in
7054 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7055 dflt="$dflt/$archname"
7057 *) dflt="$vendorarch" ;;
7060 rp='Pathname for vendor-supplied architecture-dependent files?'
7063 vendorarchexp="$ansexp"
7066 prefixvar=vendorarch
7068 if $test X"$vendorarch" = X"$vendorlib"; then
7069 d_vendorarch="$undef"
7071 d_vendorarch="$define"
7074 : Final catch-all directories to search
7077 Lastly, you can have perl look in other directories for extensions and
7078 modules in addition to those already specified.
7079 These directories will be searched after
7083 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7084 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7086 case "$otherlibdirs" in
7087 ''|' ') dflt='none' ;;
7088 *) dflt="$otherlibdirs" ;;
7091 Enter a colon-separated set of extra paths to include in perl's @INC
7092 search path, or enter 'none' for no extra paths.
7096 rp='Colon-separated list of additional directories for perl to search?'
7099 ' '|''|none) otherlibdirs=' ' ;;
7100 *) otherlibdirs="$ans" ;;
7102 case "$otherlibdirs" in
7106 set d_perl_otherlibdirs
7109 : Cruising for prototypes
7111 echo "Checking out function prototypes..." >&4
7112 $cat >prototype.c <<EOCP
7117 int main(int argc, char *argv[]) {
7120 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7121 echo "Your C compiler appears to support function prototypes."
7124 echo "Your C compiler doesn't seem to understand function prototypes."
7131 : Check if ansi2knr is required
7132 case "$prototype" in
7134 *) ansi2knr='ansi2knr'
7139 This version of $package can only be compiled by a compiler that
7140 understands function prototypes. Unfortunately, your C compiler
7142 doesn't seem to understand them. Sorry about that.
7144 If GNU cc is available for your system, perhaps you could try that instead.
7146 Eventually, we hope to support building Perl with pre-ANSI compilers.
7147 If you would like to help in that effort, please contact <perlbug@perl.org>.
7149 Aborting Configure now.
7156 dflt_dtrace='/usr/sbin/dtrace'
7157 $test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
7161 Perl can be built to support DTrace on platforms that support it.
7162 DTrace is a diagnosis and performance analysis tool from Sun.
7164 If this doesn't make any sense to you, just accept the default '$dflt'.
7168 case "$usedtrace" in
7174 dflt_dtrace=$usedtrace
7181 rp='Support DTrace if available?'
7184 y|Y) val="$define" ;;
7190 test "X$usedtrace" != "X$define" && break
7193 rp='Where is the dtrace executable?'
7202 if $dtrace -h -s ../perldtrace.d \
7203 -o perldtrace.tmp >/dev/null 2>&1 \
7204 && rm -f perldtrace.tmp
7207 echo "Good: your $dtrace knows about the -h flag."
7211 *** $me: Fatal Error: $dtrace doesn't support -h flag
7213 *** Your installed dtrace doesn't support the -h switch to compile a D
7214 *** program into a C header. Can't continue.
7226 *** $me: Fatal Error: $dtrace not found.
7233 echo "*** $dtrace was not found."
7239 : See if we want extra modules installed
7246 Perl can be built with extra modules or bundles of modules which
7247 will be fetched from the CPAN and installed alongside Perl.
7249 Notice that you will need access to the CPAN; either via the Internet,
7250 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7251 be asked later to configure the CPAN.pm module which will in turn do
7252 the installation of the rest of the extra modules or bundles.)
7254 Notice also that if the modules require any external software such as
7255 libraries and headers (the libz library and the zlib.h header for the
7256 Compress::Zlib module, for example) you MUST have any such software
7257 already installed, this configuration process will NOT install such
7260 If this doesn't make any sense to you, just accept the default '$dflt'.
7262 rp='Install any extra modules (y or n)?'
7268 Please list any extra modules or bundles to be installed from CPAN,
7269 with spaces between the names. The names can be in any format the
7270 'install' command of CPAN.pm will understand. (Answer 'none',
7271 without the quotes, to install no extra modules or bundles.)
7281 $rm -f ../extras.lst
7283 *) echo "(Saving the list of extras for later...)"
7284 echo "$extras" > ../extras.lst
7292 : determine where html pages for programs go
7293 set html1dir html1dir none
7297 If you wish to install html files for programs in $spackage, indicate
7298 the appropriate directory here. To skip installing html files,
7302 ''|none|$undef|' ') dflt=none ;;
7303 *) dflt=$html1dir ;;
7306 rp="Directory for the main $spackage html pages?"
7310 : Use ' ' for none so value is preserved next time through Configure
7311 $test X"$html1dir" = "X" && html1dir=' '
7313 : determine where html pages for libraries and modules go
7314 set html3dir html3dir none
7318 If you wish to install html files for modules associated with $spackage,
7319 indicate the appropriate directory here. To skip installing html files,
7322 : There is no obvious default. If they have specified html1dir, then
7323 : try to key off that, possibly changing .../html1 into .../html3.
7325 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7326 *) dflt=$html3dir ;;
7329 rp="Directory for the $spackage module html pages?"
7333 : Use ' ' for none so value is preserved next time through Configure
7334 $test X"$html3dir" = "X" && html3dir=' '
7336 : determine whether to install perl also as /usr/bin/perl
7339 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7341 Many scripts expect perl to be installed as /usr/bin/perl.
7343 If you want to, I can install the perl you are about to compile
7344 as /usr/bin/perl (in addition to $bin/perl).
7346 if test -f /usr/bin/perl; then
7349 However, please note that because you already have a /usr/bin/perl,
7350 overwriting that with a new Perl would very probably cause problems.
7351 Therefore I'm assuming you don't want to do that (unless you insist).
7354 case "$installusrbinperl" in
7355 "$define"|[yY]*) dflt='y';;
7361 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7364 case "$installusrbinperl" in
7365 "$undef"|[nN]*) dflt='n';;
7369 rp="Do you want to install perl as /usr/bin/perl?"
7372 [yY]*) val="$define";;
7378 set installusrbinperl
7381 : Check if we are using the GNU C library
7383 echo "Checking for GNU C Library..." >&4
7385 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7386 alone are insufficient to distinguish different versions, such as
7387 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7388 libc version 2.1.0. A. Dougherty, June 3, 2002.
7394 # ifdef __GLIBC_MINOR__
7395 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7396 # include <gnu/libc-version.h>
7397 printf("%s\n", gnu_get_libc_version());
7399 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7402 printf("%d\n", __GLIBC__);
7411 if eval $compile_ok && $run ./try > glibc.ver; then
7413 gnulibc_version=`$cat glibc.ver`
7414 echo "You are using the GNU C Library version $gnulibc_version"
7418 echo "You are not using the GNU C Library"
7424 : see if nm is to be used to determine whether a symbol is defined or not
7428 case "$d_gnulibc" in
7431 echo "nm probably won't work on the GNU C Library." >&4
7437 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7439 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7440 echo "'nm' won't be sufficient on this sytem." >&4
7446 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7447 if $test $dflt -gt 20; then
7457 true|$define) dflt=y;;
7464 I can use $nm to extract the symbols from your C libraries. This
7465 is a time consuming task which may generate huge output on the disk (up
7466 to 3 megabytes) but that should make the symbols extraction faster. The
7467 alternative is to skip the 'nm' extraction part and to compile a small
7468 test program instead to determine whether each symbol is present. If
7469 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7470 this may be the best solution.
7472 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7475 rp="Shall I use $nm to extract C symbols from the libraries?"
7478 [Nn]*) usenm=false;;
7487 : nm options which may be necessary
7489 '') if $test -f /mach_boot; then
7491 elif $test -d /usr/ccs/lib; then
7492 nm_opt='-p' # Solaris (and SunOS?)
7493 elif $test -f /dgux; then
7495 elif $test -f /lib64/rld; then
7496 nm_opt='-p' # 64-bit Irix
7502 : nm options which may be necessary for shared libraries but illegal
7503 : for archive libraries. Thank you, Linux.
7504 case "$nm_so_opt" in
7505 '') case "$myuname" in
7507 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7508 nm_so_opt='--dynamic'
7515 : Figure out where the libc is located
7518 : get list of predefined functions in a handy place
7523 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7529 *) for thislib in $libs; do
7532 : Handle C library specially below.
7535 thislib=`echo $thislib | $sed -e 's/^-l//'`
7536 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7538 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7540 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7542 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7544 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7546 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7548 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7553 libnames="$libnames $try"
7555 *) libnames="$libnames $thislib" ;;
7564 for xxx in $libpth; do
7565 $test -r $1 || set $xxx/libc.$so
7566 : The messy sed command sorts on library version numbers.
7568 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7569 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7571 s/[0-9][0-9]*/0000&/g
7572 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7575 $sort | $sed -e 's/^.* //'`
7578 $test -r $1 || set /usr/ccs/lib/libc.$so
7579 $test -r $1 || set /lib/libsys_s$_a
7585 if $test -r "$1"; then
7586 echo "Your (shared) C library seems to be in $1."
7588 elif $test -r /lib/libc && $test -r /lib/clib; then
7589 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7591 libc='/lib/clib /lib/libc'
7592 if $test -r /lib/syslib; then
7593 echo "(Your math library is in /lib/syslib.)"
7594 libc="$libc /lib/syslib"
7596 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7597 echo "Your C library seems to be in $libc, as you said before."
7598 elif $test -r $incpath/usr/lib/libc$_a; then
7599 libc=$incpath/usr/lib/libc$_a;
7600 echo "Your C library seems to be in $libc. That's fine."
7601 elif $test -r /lib/libc$_a; then
7603 echo "Your C library seems to be in $libc. You're normal."
7605 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7607 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7608 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7609 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7611 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7613 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7616 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7618 if $test -r "$tans"; then
7619 echo "Your C library seems to be in $tans, of all places."
7625 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7629 If the guess above is wrong (which it might be if you're using a strange
7630 compiler, or your machine supports multiple models), you can override it here.
7635 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7637 I can't seem to find your C library. I've looked in the following places:
7640 $sed 's/^/ /' libpath
7643 None of these seems to contain your C library. I need to get its name...
7648 rp='Where is your C library?'
7653 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7654 set X `cat libnames`
7657 case $# in 1) xxx=file; esac
7658 echo "Extracting names from the following $xxx for later perusal:" >&4
7660 $sed 's/^/ /' libnames >&4
7662 $echo $n "This may take a while...$c" >&4
7666 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7667 *) $nm $nm_opt $file 2>/dev/null;;
7672 $grep fprintf libc.tmp > libc.ptf
7673 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7674 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7676 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7678 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7680 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7682 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7684 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7686 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7688 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7690 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7692 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7694 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7696 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7698 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7700 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7701 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7703 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7705 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7707 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7709 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7711 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7713 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7715 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7717 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7719 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7721 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7723 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7725 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7727 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7729 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7731 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7734 $nm -p $* 2>/dev/null >libc.tmp
7735 $grep fprintf libc.tmp > libc.ptf
7736 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7737 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7743 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7745 if $ar t $libc > libc.tmp && \
7746 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7748 for thisname in $libnames $libc; do
7749 $ar t $thisname >>libc.tmp
7751 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7753 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7754 for thisname in $libnames $libc; do
7755 $ar tv $thisname >>libc.tmp
7756 emximp -o tmp.imp $thisname \
7758 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7759 < tmp.imp >>libc.tmp
7762 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7765 echo "$ar didn't seem to work right." >&4
7766 echo "Maybe this is a Cray...trying bld instead..." >&4
7768 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7771 for thisname in $libnames; do
7773 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7774 $ar t $thisname >>libc.tmp
7778 echo "That didn't work either. Giving up." >&4
7788 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7789 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7791 *) if $test -f /lib/syscalls.exp; then
7793 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7794 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7795 /lib/syscalls.exp >>libc.list
7801 $rm -f libnames libpath
7803 : see if dld is available
7807 : Check if we are using C++
7809 echo "Checking for C++..." >&4
7810 $cat >try.c <<'EOCP'
7822 if eval $compile_ok && $run ./try; then
7824 echo "You are using a C++ compiler."
7827 echo "You are not using a C++ compiler."
7833 : is a C symbol defined?
7836 -v) tf=libc.tmp; tdc="";;
7837 -a) tf=libc.tmp; tdc="[]";;
7838 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7840 case "$d_cplusplus" in
7841 $define) extern_C="extern \"C\"" ;;
7842 *) extern_C="extern" ;;
7845 case "$reuseval-$4" in
7847 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7852 if $test "$runnm" = true; then
7853 if $contains $tlook $tf >/dev/null 2>&1; then
7855 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7856 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7857 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7858 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7862 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7863 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7869 $define) tval=true;;
7876 : define an is-in-libc? function
7877 inlibc='echo " "; td=$define; tu=$undef;
7878 sym=$1; var=$2; eval "was=\$$2";
7880 case "$reuseval$was" in
7890 echo "$sym() found." >&4;
7891 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7893 echo "$sym() NOT found." >&4;
7894 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7898 $define) echo "$sym() found." >&4;;
7899 *) echo "$sym() NOT found." >&4;;
7903 : see if dlopen exists
7905 xxx_ccflags="$ccflags"
7907 : with g++ one needs -shared to get is-in-libc to work for dlopen
7908 case "$gccversion" in
7910 *) case "$d_cplusplus" in
7911 "$define") ccflags="$ccflags -shared" ;;
7918 ccflags="$xxx_ccflags"
7920 : see if this is a unistd.h system
7921 set unistd.h i_unistd
7924 : determine which dynamic loading, if any, to compile in
7926 dldir="ext/DynaLoader"
7939 $define) dflt='y' ;;
7942 $define) dflt='y' ;;
7944 : Does a dl_xxx.xs file exist for this operating system
7945 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7948 rp="Do you wish to use dynamic loading?"
7956 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7957 dflt="$dldir/dl_${osname}.xs"
7958 elif $test "$d_dlopen" = "$define" ; then
7959 dflt="$dldir/dl_dlopen.xs"
7960 elif $test "$i_dld" = "$define" ; then
7961 dflt="$dldir/dl_dld.xs"
7966 *) dflt="$dldir/$dlsrc"
7969 echo "The following dynamic loading files are available:"
7970 : Can not go over to $dldir because getfile has path hard-coded in.
7971 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7972 rp="Source file to use for dynamic loading"
7978 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7982 Some systems may require passing special flags to $cc -c to
7983 compile modules that will be used to create a shared library.
7984 To use no flags, say "none".
7987 case "$cccdlflags" in
7988 '') case "$gccversion" in
7989 '') case "$osname" in
7991 next) dflt='none' ;;
7992 irix*) dflt='-KPIC' ;;
7993 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7994 sunos) dflt='-pic' ;;
7998 *) case "$osname" in
7999 darwin) dflt='none' ;;
8000 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
8005 *) dflt="$cccdlflags" ;;
8007 rp="Any special flags to pass to $cc -c to compile shared library modules?"
8010 none) cccdlflags=' ' ;;
8011 *) cccdlflags="$ans" ;;
8016 Some systems use ld to create libraries that can be dynamically loaded,
8017 while other systems (such as those using ELF) use $cc.
8021 '') $cat >try.c <<EOM
8022 /* Test for whether ELF binaries are produced */
8034 int i = open("a.out",O_RDONLY);
8037 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
8038 exit(0); /* succeed (yes, it's ELF) */
8043 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
8045 You appear to have ELF support. I'll use $cc to build dynamic libraries.
8050 echo "I'll use ld to build dynamic libraries."
8059 rp="What command should be used to create dynamic libraries?"
8065 Some systems may require passing special flags to $ld to create a
8066 library that can be dynamically loaded. If your ld flags include
8067 -L/other/path options to locate libraries outside your loader's normal
8068 search path, you may need to specify those -L options here as well. To
8069 use no flags, say "none".
8072 case "$lddlflags" in
8073 '') case "$osname" in
8074 beos) dflt='-nostart' ;;
8075 haiku) dflt='-shared' ;;
8077 case "$gccversion" in
8078 '') dflt="$dflt +vnocompatwarnings" ;;
8081 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8082 next) dflt='none' ;;
8083 solaris) dflt='-G' ;;
8084 sunos) dflt='-assert nodefinitions' ;;
8085 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8089 *) dflt="$lddlflags" ;;
8092 : Try to guess additional flags to pick up local libraries.
8093 : Be careful not to append to a plain 'none'
8097 for thisflag in $ldflags; do
8102 *) dflt="$dflt $thisflag" ;;
8109 ''|' ') dflt='none' ;;
8113 *-fstack-protector*)
8115 *-fstack-protector*) ;; # Don't add it again
8116 *) dflt="$dflt -fstack-protector" ;;
8122 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8125 none) lddlflags=' ' ;;
8126 *) lddlflags="$ans" ;;
8131 Some systems may require passing special flags to $cc to indicate that
8132 the resulting executable will use dynamic linking. To use no flags,
8136 case "$ccdlflags" in
8137 '') case "$osname" in
8138 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8139 next|sunos) dflt='none' ;;
8143 *) dflt="$ccdlflags" ;;
8145 rp="Any special flags to pass to $cc to use dynamic linking?"
8148 none) ccdlflags=' ' ;;
8149 *) ccdlflags="$ans" ;;
8160 : Do we want a shared libperl?
8164 # No dynamic loading being used, so don't bother even to prompt.
8167 *) case "$useshrplib" in
8168 '') case "$osname" in
8169 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|haiku|cygwin*)
8171 also='Building a shared libperl is required for dynamic loading to work on your system.'
8176 also='Building a shared libperl is needed for MAB support.'
8194 The perl executable is normally obtained by linking perlmain.c with
8195 libperl${_a}, any static extensions (usually just DynaLoader), and
8196 any other libraries needed on this system (such as -lm, etc.). Since
8197 your system supports dynamic loading, it is probably possible to build
8198 a shared libperl.$so. If you will have more than one executable linked
8199 to libperl.$so, this will significantly reduce the size of each
8200 executable, but it may have a noticeable effect on performance. The
8201 default is probably sensible for your system.
8205 rp="Build a shared libperl.$so (y/n)"
8209 useshrplib='true' ;;
8210 *) useshrplib='false' ;;
8215 case "$useshrplib" in
8217 case "$userelocatableinc" in
8219 echo "Cannot build with both -Duserelocatableinc and -Duseshrplib" >&4
8220 echo "See INSTALL for an explanation why that won't work." >&4
8226 # Figure out a good name for libperl.so. Since it gets stored in
8227 # a version-specific architecture-dependent library, the version
8228 # number isn't really that important, except for making cc/ld happy.
8230 # A name such as libperl.so.10.1
8231 majmin="libperl.$so.$patchlevel.$subversion"
8232 # A name such as libperl.so.100
8233 majonly=`echo $patchlevel $subversion |
8234 $awk '{printf "%d%02d", $1, $2}'`
8235 majonly=libperl.$so.$majonly
8236 # I'd prefer to keep the os-specific stuff here to a minimum, and
8237 # rely on figuring it out from the naming of libc.
8238 case "${osname}${osvers}" in
8241 # XXX How handle the --version stuff for MAB?
8243 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8246 cygwin*) # ld links now against the dll directly
8247 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8248 majonly=`echo $patchlevel $subversion |
8249 $awk '{printf "%03d%03d", $1, $2}'`
8250 majonly=cygperl5.$majonly.$so
8253 *) # Try to guess based on whether libc has major.minor.
8255 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8256 *libc.$so.[0-9]*) dflt=$majonly ;;
8257 *) dflt=libperl.$so ;;
8267 I need to select a good name for the shared libperl. If your system uses
8268 library names with major and minor numbers, then you might want something
8269 like $majmin. Alternatively, if your system uses a single version
8270 number for shared libraries, then you might want to use $majonly.
8271 Or, your system might be quite happy with a simple libperl.$so.
8273 Since the shared libperl will get installed into a version-specific
8274 architecture-dependent directory, the version number of the shared perl
8275 library probably isn't important, so the default should be o.k.
8278 rp='What name do you want to give to the shared libperl?'
8281 echo "Ok, I'll use $libperl"
8284 libperl="libperl${_a}"
8288 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8292 WARNING: Use of the shrpdir variable for the installation location of
8293 the shared $libperl is not supported. It was never documented and
8294 will not work in this version. Let me (perlbug@perl.org)
8295 know of any problems this may cause.
8301 But your current setting of $shrpdir is
8302 the default anyway, so it's harmless.
8307 Further, your current attempted setting of $shrpdir
8308 conflicts with the value of $archlibexp/CORE
8309 that installperl will use.
8316 # How will the perl executable find the installed shared $libperl?
8317 # Add $xxx to ccdlflags.
8318 # If we can't figure out a command-line option, use $shrpenv to
8319 # set env LD_RUN_PATH. The main perl makefile uses this.
8320 shrpdir=$archlibexp/CORE
8323 if "$useshrplib"; then
8326 # We'll set it in Makefile.SH...
8331 freebsd|netbsd|openbsd|interix|dragonfly)
8332 xxx="-Wl,-R$shrpdir"
8334 bsdos|linux|irix*|dec_osf|gnu*)
8335 xxx="-Wl,-rpath,$shrpdir"
8338 # next doesn't like the default...
8341 # beos doesn't like the default, either.
8344 # Haiku doesn't like the default, either.
8347 # hpux doesn't like the default, either.
8348 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8351 # cygwin needs only ldlibpth
8354 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8360 # Only add $xxx if it isn't already in ccdlflags.
8361 case " $ccdlflags " in
8363 *) ccdlflags="$ccdlflags $xxx"
8366 Adding $xxx to the flags
8367 passed to $ld so that the perl executable will find the
8368 installed shared $libperl.
8376 # Fix ccdlflags in AIX for building external extensions.
8377 # (For building Perl itself bare -bE:perl.exp is needed,
8378 # Makefile.SH takes care of this.)
8380 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8382 # Respect a hint or command-line value.
8384 '') shrpenv="$tmp_shrpenv" ;;
8386 case "$ldlibpthname" in
8387 '') ldlibpthname=LD_LIBRARY_PATH ;;
8388 none) ldlibpthname='' ;;
8391 : determine where manual pages are on this system
8395 syspath='/usr/share/man/man1 /usr/man/man1'
8396 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8397 syspath="$syspath /usr/man/u_man/man1"
8398 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8399 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8400 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8401 sysman=`./loc . /usr/man/man1 $syspath`
8404 if $test -d "$sysman"; then
8405 echo "System manual is in $sysman." >&4
8407 echo "Could not find manual pages in source form." >&4
8410 : determine where manual pages go
8411 set man1dir man1dir none
8415 $spackage has manual pages available in source form.
8419 echo "However, you don't have nroff, so they're probably useless to you."
8421 '') man1dir="none";;
8424 echo "If you don't want the manual sources installed, answer 'none'."
8429 lookpath="$prefixexp/share/man/man1"
8430 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8431 lookpath="$lookpath $prefixexp/man/p_man/man1"
8432 lookpath="$lookpath $prefixexp/man/u_man/man1"
8433 lookpath="$lookpath $prefixexp/man/man.1"
8435 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8436 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8446 rp="Where do the main $spackage manual pages (source) go?"
8448 if $test "X$man1direxp" != "X$ansexp"; then
8459 : What suffix to use on installed man pages
8466 rp="What suffix should be used for the main $spackage man pages?"
8468 '') case "$man1dir" in
8482 *) dflt="$man1ext";;
8489 : see if we can have long filenames
8491 first=123456789abcdef
8493 if (echo hi >$first) 2>/dev/null; then
8494 if $test -f 123456789abcde; then
8495 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8498 echo 'You can have filenames longer than 14 characters.'>&4
8503 You can't have filenames longer than 14 chars.
8504 You can't even think about them!
8510 $rm -rf 123456789abcde*
8512 : determine where library module manual pages go
8513 set man3dir man3dir none
8517 $spackage has manual pages for many of the library modules.
8523 However, you don't have nroff, so they're probably useless to you.
8526 '') man3dir="none";;
8530 case "$d_flexfnam" in
8533 However, your system can't handle the long file names like File::Basename.3.
8536 '') man3dir="none";;
8540 echo "If you don't want the manual sources installed, answer 'none'."
8541 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8543 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8544 if $test -d "$privlib/man/man3"; then
8547 WARNING: Previous versions of perl installed man3 pages into
8548 $privlib/man/man3. This version will suggest a
8549 new default of $dflt.
8553 rp='Do you wish to preserve the old behavior?(y/n)'
8556 y*) dflt="$privlib/man/man3" ;;
8561 *) dflt="$man3dir" ;;
8568 rp="Where do the $package library man pages (source) go?"
8578 : What suffix to use on installed man pages
8584 rp="What suffix should be used for the $package library man pages?"
8586 '') case "$man3dir" in
8600 *) dflt="$man3ext";;
8607 : see if we have to deal with yellow pages, now NIS.
8608 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8609 if $test -f /usr/etc/nibindd; then
8611 echo "I'm fairly confident you're on a NeXT."
8613 rp='Do you get the hosts file via NetInfo?'
8622 y*) hostcat='nidump hosts .';;
8623 *) case "$hostcat" in
8624 nidump*) hostcat='';;
8634 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8642 rp='Are you getting the hosts file via yellow pages?'
8645 y*) hostcat='ypcat hosts';;
8646 *) hostcat='cat /etc/hosts';;
8652 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8655 '') test -f /etc/group && groupcat='cat /etc/group';;
8658 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8661 : now get the host name
8663 echo "Figuring out host name..." >&4
8664 case "$myhostname" in
8666 echo 'Maybe "hostname" will work...'
8667 if tans=`sh -c hostname 2>&1` ; then
8675 if $test "$cont"; then
8677 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8678 if tans=`cat /etc/systemid 2>&1` ; then
8680 phostname='cat /etc/systemid'
8681 echo "Whadyaknow. Xenix always was a bit strange..."
8684 elif $test -r /etc/systemid; then
8685 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8688 if $test "$cont"; then
8689 echo 'No, maybe "uuname -l" will work...'
8690 if tans=`sh -c 'uuname -l' 2>&1` ; then
8692 phostname='uuname -l'
8694 echo 'Strange. Maybe "uname -n" will work...'
8695 if tans=`sh -c 'uname -n' 2>&1` ; then
8697 phostname='uname -n'
8699 echo 'Oh well, maybe I can mine it out of whoami.h...'
8700 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8701 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8702 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8704 case "$myhostname" in
8705 '') echo "Does this machine have an identity crisis or something?"
8708 echo "Well, you said $myhostname before..."
8709 phostname='echo $myhostname';;
8715 case "$myhostname" in
8716 '') myhostname=noname ;;
8718 : you do not want to know about this
8723 if $test "$myhostname" ; then
8725 rp='Your host name appears to be "'$myhostname'".'" Right?"
8733 : bad guess or no guess
8734 while $test "X$myhostname" = X ; do
8736 rp="Please type the (one word) name of your host:"
8741 : translate upper to lower if necessary
8742 case "$myhostname" in
8744 echo "(Normalizing case in your host name)"
8745 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8749 case "$myhostname" in
8751 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8752 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8753 echo "(Trimming domain name from host name--host name is now $myhostname)"
8755 *) case "$mydomain" in
8758 test "X$hostcat" = "Xypcat hosts" &&
8759 ypmatch "$myhostname" hosts 2>/dev/null |\
8760 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8763 test "X$hostcat" != "X" &&
8764 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8765 /[ ]$myhostname[ . ]/p" > hosts
8768 if $test -f hosts; then
8769 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8770 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8771 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8772 hosts | $sort | $uniq | \
8773 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8774 case `$echo X$dflt` in
8775 X*\ *) echo "(Several hosts in the database matched hostname)"
8778 X.) echo "(You do not have fully-qualified names in the hosts database)"
8782 echo "(I cannot locate a hosts database anywhere)"
8787 tans=`./loc resolv.conf X /etc /usr/etc`
8788 if $test -f "$tans"; then
8789 echo "(Attempting domain name extraction from $tans)"
8790 dflt=.`$sed -n -e 's/ / /g' \
8791 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8794 .) dflt=.`$sed -n -e 's/ / /g' \
8795 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8803 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8804 dflt=.`sh -c domainname 2>/dev/null`
8807 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8811 case "$dflt$osname" in
8812 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8813 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8817 .) echo "(Lost all hope -- silly guess then)"
8823 *) dflt="$mydomain";;
8827 rp="What is your domain name?"
8837 : translate upper to lower if necessary
8840 echo "(Normalizing case in your domain name)"
8841 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8845 : a little sanity check here
8846 case "$phostname" in
8849 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8850 $myhostname$mydomain|$myhostname) ;;
8852 case "$phostname" in
8854 echo "(That doesn't agree with your whoami.h file, by the way.)"
8857 echo "(That doesn't agree with your $phostname command, by the way.)"
8865 : determine the e-mail address of the user who is running us
8868 I need to get your e-mail address in Internet format if possible, i.e.
8869 something like user@host.domain. Please answer accurately since I have
8870 no easy means to double check it. The default value provided below
8871 is most probably close to reality but may not be valid from outside
8872 your organization...
8876 while test "$cont"; do
8878 '') dflt="$cf_by@$myhostname$mydomain";;
8879 *) dflt="$cf_email";;
8881 rp='What is your e-mail address?'
8887 rp='Address does not look like an Internet one. Use it anyway?'
8901 : Ask e-mail of administrator
8904 If you or somebody else will be maintaining perl at your site, please
8905 fill in the correct e-mail address here so that they may be contacted
8906 if necessary. Currently, the "perlbug" program included with perl
8907 will send mail to this address in addition to perlbug@perl.org. You may
8908 enter "none" for no administrator.
8911 case "$perladmin" in
8912 '') dflt="$cf_email";;
8913 *) dflt="$perladmin";;
8915 rp='Perl administrator e-mail address'
8919 : determine whether to only install version-specific parts.
8922 Do you want to install only the version-specific parts of the perl
8923 distribution? Usually you do *not* want to do this.
8925 case "$versiononly" in
8926 "$define"|[Yy]*|true) dflt='y' ;;
8929 rp="Do you want to install only the version-specific parts of perl?"
8932 [yY]*) val="$define";;
8938 case "$versiononly" in
8939 "$define") inc_version_list=''
8940 inc_version_list_init=0
8944 : figure out how to guarantee perl startup
8945 : XXX Note that this currently takes advantage of the bug that binexp ignores
8946 : the Configure -Dinstallprefix setting, which in turn means that under
8947 : relocatable @INC, initialinstalllocation is what binexp started as.
8948 case "$startperl" in
8950 case "$sharpbang" in
8954 I can use the #! construct to start perl on your system. This will
8955 make startup of perl scripts faster, but may cause problems if you
8956 want to share those scripts and perl is not in a standard place
8957 ($initialinstalllocation/perl) on all your platforms. The alternative
8958 is to force a shell by starting the script with a single ':' character.
8961 case "$versiononly" in
8962 "$define") dflt="$initialinstalllocation/perl$version";;
8963 *) dflt="$initialinstalllocation/perl";;
8965 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8968 none) startperl=": # use perl";;
8969 *) startperl="#!$ans"
8970 if $test 30 -lt `echo "$ans" | wc -c`; then
8973 WARNING: Some systems limit the #! command to 32 characters.
8974 If you experience difficulty running Perl scripts with #!, try
8975 installing Perl in a directory with a shorter pathname.
8981 *) startperl=": # use perl"
8986 echo "I'll use $startperl to start perl scripts."
8988 : figure best path for perl in scripts
8991 case "$versiononly" in
8992 "$define") perlpath="$initialinstalllocation/perl$version";;
8993 *) perlpath="$initialinstalllocation/perl";;
8995 case "$startperl" in
9000 I will use the "eval 'exec'" idiom to start Perl on your system.
9001 I can use the full path of your Perl binary for this purpose, but
9002 doing so may cause problems if you want to share those scripts and
9003 Perl is not always in a standard place ($initialinstalllocation/perl).
9006 dflt="$initialinstalllocation/perl"
9007 rp="What path shall I use in \"eval 'exec'\"?"
9014 case "$startperl" in
9016 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
9019 : determine where public executable scripts go
9020 set scriptdir scriptdir
9022 case "$scriptdir" in
9025 : guess some guesses
9026 $test -d /usr/share/scripts && dflt=/usr/share/scripts
9027 $test -d /usr/share/bin && dflt=/usr/share/bin
9028 $test -d /usr/local/script && dflt=/usr/local/script
9029 $test -d /usr/local/scripts && dflt=/usr/local/scripts
9030 $test -d $prefixexp/script && dflt=$prefixexp/script
9034 *) dflt="$scriptdir"
9039 Some installations have a separate directory just for executable scripts so
9040 that they can mount it across multiple architectures but keep the scripts in
9041 one spot. You might, for example, have a subdirectory of /usr/share for this.
9042 Or you might just lump your scripts in with all your other executables.
9046 rp='Where do you keep publicly executable scripts?'
9048 if $test "X$ansexp" != "X$scriptdirexp"; then
9054 : A little fix up for an irregularly named variable.
9055 installscript="$installscriptdir"
9057 : determine where add-on public executables go
9059 '') dflt=$siteprefix/bin ;;
9063 rp='Pathname where the add-on public executables should be installed?'
9068 : determine where add-on html pages go
9069 : There is no standard location, so try to copy the previously-selected
9070 : directory structure for the core html pages.
9071 case "$sitehtml1dir" in
9072 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9073 *) dflt=$sitehtml1dir ;;
9076 ''|' ') dflt=none ;;
9079 rp='Pathname where the site-specific html pages should be installed?'
9081 prefixvar=sitehtml1dir
9084 : determine where add-on library html pages go
9085 : There is no standard location, so try to copy the previously-selected
9086 : directory structure for the core html pages.
9087 case "$sitehtml3dir" in
9088 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9089 *) dflt=$sitehtml3dir ;;
9092 ''|' ') dflt=none ;;
9095 rp='Pathname where the site-specific library html pages should be installed?'
9097 prefixvar=sitehtml3dir
9100 : determine where add-on manual pages go
9101 case "$siteman1dir" in
9102 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9103 *) dflt=$siteman1dir ;;
9106 ''|' ') dflt=none ;;
9109 rp='Pathname where the site-specific manual pages should be installed?'
9111 prefixvar=siteman1dir
9114 : determine where add-on library man pages go
9115 case "$siteman3dir" in
9116 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9117 *) dflt=$siteman3dir ;;
9120 ''|' ') dflt=none ;;
9123 rp='Pathname where the site-specific library manual pages should be installed?'
9125 prefixvar=siteman3dir
9128 : determine where add-on public executable scripts go
9129 case "$sitescript" in
9130 '') dflt=$siteprefix/script
9131 $test -d $dflt || dflt=$sitebin ;;
9132 *) dflt="$sitescript" ;;
9135 rp='Pathname where add-on public executable scripts should be installed?'
9137 prefixvar=sitescript
9140 : Check if faststdio is requested and available
9141 case "$usefaststdio" in
9142 $define|true|[yY]*|'')
9143 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9153 Perl can be built to use 'fast stdio', which means using the stdio
9154 library but also directly manipulating the stdio buffers to enable
9155 faster I/O. Using stdio is better for backward compatibility (especially
9156 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9157 interface has been preferred instead of stdio.
9159 If this doesn't make any sense to you, just accept the default '$dflt'.
9161 rp='Use the "fast stdio" if available?'
9164 y|Y) val="$define" ;;
9171 : define an is-a-typedef? function
9172 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9174 "") inclist="sys/types.h";;
9176 eval "varval=\$$var";
9180 for inc in $inclist; do
9181 echo "#include <$inc>" >>temp.c;
9183 echo "#ifdef $type" >> temp.c;
9184 echo "printf(\"We have $type\");" >> temp.c;
9185 echo "#endif" >> temp.c;
9186 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9187 if $contains $type temp.E >/dev/null 2>&1; then
9193 *) eval "$var=\$varval";;
9196 : define an is-a-typedef? function that prompts if the type is not available.
9197 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9199 "") inclist="sys/types.h";;
9201 eval "varval=\$$var";
9205 for inc in $inclist; do
9206 echo "#include <$inc>" >>temp.c;
9208 echo "#ifdef $type" >> temp.c;
9209 echo "printf(\"We have $type\");" >> temp.c;
9210 echo "#endif" >> temp.c;
9211 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9213 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9214 if $contains $type temp.E >/dev/null 2>&1; then
9215 echo "$type found." >&4;
9218 echo "$type NOT found." >&4;
9224 *) eval "$var=\$varval";;
9227 : see what type lseek is declared as in the kernel
9228 rp="What is the type used for lseek's offset on this system?"
9229 set off_t lseektype long stdio.h sys/types.h
9233 echo "Checking to see how big your file offsets are..." >&4
9235 #include <sys/types.h>
9239 printf("%d\n", (int)sizeof($lseektype));
9244 if eval $compile_ok; then
9245 lseeksize=`$run ./try`
9246 echo "Your file offsets are $lseeksize bytes long."
9250 echo "(I can't seem to compile the test program. Guessing...)"
9251 rp="What is the size of your file offsets (in bytes)?"
9257 : see what type file positions are declared as in the library
9258 rp="What is the type for file position used by fsetpos()?"
9259 set fpos_t fpostype long stdio.h sys/types.h
9262 : Check size for Fpos_t
9265 *_t) zzz="$fpostype" ;;
9268 echo "Checking the size of $zzz..." >&4
9270 #include <sys/types.h>
9277 printf("%d\n", (int)sizeof($fpostype));
9282 if eval $compile_ok; then
9286 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9289 echo "Your $zzz is $fpossize bytes long."
9295 echo "(I can't compile the test program. Guessing...)" >&4
9296 rp="What is the size of your file positions (in bytes)?"
9301 : Check for large file support
9302 # Backward compatibility (uselfs is deprecated).
9304 "$define"|true|[yY]*)
9307 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9309 uselargefiles="$define"
9313 case "$lseeksize:$fpossize" in
9316 You can have files larger than 2 gigabytes.
9319 *) case "$uselargefiles" in
9320 "$undef"|false|[nN]*) dflt='n' ;;
9325 Perl can be built to understand large files (files larger than 2 gigabytes)
9326 on some systems. To do so, Configure can be run with -Duselargefiles.
9328 If this doesn't make any sense to you, just accept the default '$dflt'.
9330 rp='Try to understand large files, if available?'
9333 y|Y) val="$define" ;;
9340 : Look for a hint-file generated 'call-back-unit'. If the
9341 : user has specified that a large files perl is to be built,
9342 : we may need to set or change some other defaults.
9343 if $test -f uselargefiles.cbu; then
9344 echo "Your platform has some specific hints regarding large file builds, using them..."
9345 . ./uselargefiles.cbu
9347 case "$uselargefiles" in
9349 if $test -f uselargefiles.cbu; then
9351 echo "Rechecking to see how big your file offsets are..." >&4
9353 #include <sys/types.h>
9357 printf("%d\n", (int)sizeof($lseektype));
9362 if eval $compile_ok; then
9363 lseeksize=`$run ./try`
9364 $echo "Your file offsets are now $lseeksize bytes long."
9368 echo "(I can't seem to compile the test program. Guessing...)"
9369 rp="What is the size of your file offsets (in bytes)?"
9374 *_t) zzz="$fpostype" ;;
9377 $echo $n "Rechecking the size of $zzz...$c" >&4
9379 #include <sys/types.h>
9386 printf("%d\n", (int)sizeof($fpostype));
9391 if eval $compile_ok; then
9396 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9399 echo " $fpossize bytes." >&4
9405 echo "(I can't compile the test program. Guessing...)" >&4
9406 rp="What is the size of your file positions (in bytes)?"
9415 : Set the vendorbin variables
9416 case "$vendorprefix" in
9417 '') d_vendorbin="$undef"
9421 *) d_vendorbin="$define"
9422 : determine where vendor-supplied executables go.
9423 case "$vendorbin" in
9424 '') dflt=$vendorprefix/bin ;;
9425 *) dflt="$vendorbin" ;;
9428 rp='Pathname for the vendor-supplied executables directory?'
9431 vendorbinexp="$ansexp"
9437 : Set the vendorhtml1dir variables
9438 case "$vendorprefix" in
9439 '') vendorhtml1dir=''
9440 vendorhtml1direxp=''
9442 *) : determine where vendor-supplied html pages go.
9443 : There is no standard location, so try to copy the previously-selected
9444 : directory structure for the core html pages.
9445 : XXX Better default suggestions would be welcome.
9446 case "$vendorhtml1dir" in
9447 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9448 *) dflt=$vendorhtml1dir ;;
9451 ''|' ') dflt=none ;;
9454 rp='Pathname for the vendor-supplied html pages?'
9456 vendorhtml1dir="$ans"
9457 vendorhtml1direxp="$ansexp"
9460 : Use ' ' for none so value is preserved next time through Configure
9461 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9462 prefixvar=vendorhtml1dir
9465 : Set the vendorhtml3dir variables
9466 case "$vendorprefix" in
9467 '') vendorhtml3dir=''
9468 vendorhtml3direxp=''
9470 *) : determine where vendor-supplied module html pages go.
9471 : There is no standard location, so try to copy the previously-selected
9472 : directory structure for the core html pages.
9473 : XXX Better default suggestions would be welcome.
9474 case "$vendorhtml3dir" in
9475 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9476 *) dflt=$vendorhtml3dir ;;
9479 ''|' ') dflt=none ;;
9482 rp='Pathname for the vendor-supplied html pages?'
9484 vendorhtml3dir="$ans"
9485 vendorhtml3direxp="$ansexp"
9488 : Use ' ' for none so value is preserved next time through Configure
9489 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9490 prefixvar=vendorhtml3dir
9493 : Set the vendorman1dir variables
9494 case "$vendorprefix" in
9495 '') vendorman1dir=''
9498 *) : determine where vendor-supplied manual pages go.
9499 case "$vendorman1dir" in
9500 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9501 *) dflt=$vendorman1dir ;;
9504 ''|' ') dflt=none ;;
9507 rp='Pathname for the vendor-supplied manual section 1 pages?'
9509 vendorman1dir="$ans"
9510 vendorman1direxp="$ansexp"
9513 : Use ' ' for none so value is preserved next time through Configure
9514 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9515 prefixvar=vendorman1dir
9518 : Set the vendorman3dir variables
9519 case "$vendorprefix" in
9520 '') vendorman3dir=''
9523 *) : determine where vendor-supplied module manual pages go.
9524 case "$vendorman3dir" in
9525 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9526 *) dflt=$vendorman3dir ;;
9529 ''|' ') dflt=none ;;
9532 rp='Pathname for the vendor-supplied manual section 3 pages?'
9534 vendorman3dir="$ans"
9535 vendorman3direxp="$ansexp"
9538 : Use ' ' for none so value is preserved next time through Configure
9539 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9540 prefixvar=vendorman3dir
9543 : Set the vendorscript variables
9544 case "$vendorprefix" in
9545 '') d_vendorscript="$undef"
9549 *) d_vendorscript="$define"
9550 : determine where vendor-supplied scripts go.
9551 case "$vendorscript" in
9552 '') dflt=$vendorprefix/script
9553 $test -d $dflt || dflt=$vendorbin ;;
9554 *) dflt="$vendorscript" ;;
9558 The installation process will create a directory for
9559 vendor-supplied scripts.
9563 rp='Pathname for the vendor-supplied scripts directory?'
9566 vendorscriptexp="$ansexp"
9569 prefixvar=vendorscript
9572 : script used to emit important warnings
9575 if test \$# -gt 0; then
9580 echo "*** WARNING:" >&4
9581 sed -e 's/^/*** /' <msg >&4
9583 cat msg >>config.msg
9584 echo " " >>config.msg
9590 : see which of string.h or strings.h is needed
9592 strings=`./findhdr string.h`
9593 if $test "$strings" && $test -r "$strings"; then
9594 echo "Using <string.h> instead of <strings.h>." >&4
9598 strings=`./findhdr strings.h`
9599 if $test "$strings" && $test -r "$strings"; then
9600 echo "Using <strings.h> instead of <string.h>." >&4
9602 ./warn "No string header found -- You'll surely have problems."
9608 "$undef") strings=`./findhdr strings.h`;;
9609 *) strings=`./findhdr string.h`;;
9612 : see if qgcvt exists
9616 : Check print/scan long double stuff
9619 if $test X"$d_longdbl" = X"$define"; then
9621 echo "Checking how to print long doubles..." >&4
9623 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9624 $cat >try.c <<'EOCP'
9625 #include <sys/types.h>
9629 printf("%.3f\n", d);
9633 if eval $compile; then
9637 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9638 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9639 echo "We will use %f."
9645 if $test X"$sPRIfldbl" = X; then
9646 $cat >try.c <<'EOCP'
9647 #include <sys/types.h>
9650 long double d = 123.456;
9651 printf("%.3Lf\n", d);
9655 if eval $compile; then
9659 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9660 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9661 echo "We will use %Lf."
9667 if $test X"$sPRIfldbl" = X; then
9668 $cat >try.c <<'EOCP'
9669 #include <sys/types.h>
9672 long double d = 123.456;
9673 printf("%.3llf\n", d);
9677 if eval $compile; then
9681 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9682 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9683 echo "We will use %llf."
9689 if $test X"$sPRIfldbl" = X; then
9690 $cat >try.c <<'EOCP'
9691 #include <sys/types.h>
9694 long double d = 123.456;
9695 printf("%.3lf\n", d);
9699 if eval $compile; then
9703 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9704 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9705 echo "We will use %lf."
9711 if $test X"$sPRIfldbl" = X; then
9712 echo "Cannot figure out how to print long doubles." >&4
9714 sSCNfldbl=$sPRIfldbl # expect consistency
9721 case "$sPRIfldbl" in
9722 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9723 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9724 d_SCNfldbl="$undef";
9726 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9727 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9728 d_SCNfldbl="$define";
9732 : Check how to convert floats to strings.
9734 if test "X$d_Gconvert" = X; then
9737 echo "Checking for an efficient way to convert floats to strings."
9739 case "$uselongdouble" in
9740 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9742 case "$d_longdbl" in
9743 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9745 case "$d_PRIgldbl" in
9746 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9750 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9751 char *myname = "gconvert";
9754 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9755 char *myname = "gcvt";
9758 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9759 char *myname = "qgcvt";
9760 #define DOUBLETYPE long double
9763 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9765 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9767 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9770 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9772 char *myname = "sprintf";
9776 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9777 #define DOUBLETYPE long double
9779 #define DOUBLETYPE double
9791 # include <string.h>
9793 # include <strings.h>
9796 int checkit(char *expect, char *got)
9798 if (strcmp(expect, got)) {
9799 printf("%s oddity: Expected %s, got %s\n",
9800 myname, expect, got);
9810 /* This must be 1st test on (which?) platform */
9811 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9812 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9813 checkit("0.1", buf);
9815 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9816 checkit("0.01", buf);
9818 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9819 checkit("0.001", buf);
9821 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9822 checkit("0.0001", buf);
9824 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9825 if (strlen(buf) > 5)
9826 checkit("9e-005", buf); /* for Microsoft ?? */
9828 checkit("9e-05", buf);
9830 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9833 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9834 checkit("1.1", buf);
9836 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9837 checkit("1.01", buf);
9839 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9840 checkit("1.001", buf);
9842 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9843 checkit("1.0001", buf);
9845 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9846 checkit("1.00001", buf);
9848 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9849 checkit("1.000001", buf);
9851 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9854 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9857 /* Some Linux gcvt's give 1.e+5 here. */
9858 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9859 checkit("100000", buf);
9861 /* Some Linux gcvt's give -1.e+5 here. */
9862 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9863 checkit("-100000", buf);
9865 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9866 checkit("123.456", buf);
9868 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9869 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9870 /* 34 should be enough to scare even long double
9871 * places into using the e notation. */
9872 if (strlen(buf) > 5)
9873 checkit("1e+034", buf); /* for Microsoft */
9875 checkit("1e+34", buf);
9877 /* For Perl, if you add additional tests here, also add them to
9878 * t/base/num.t for benefit of platforms not using Configure or
9879 * overriding d_Gconvert */
9884 : first add preferred functions to our list
9886 for xxx_convert in $gconvert_preference; do
9887 case $xxx_convert in
9888 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9889 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9892 : then add any others
9893 for xxx_convert in gconvert gcvt sprintf; do
9896 *) xxx_list="$xxx_list $xxx_convert" ;;
9900 case "$d_longdbl$uselongdouble" in
9902 : again, add prefered functions to our list first
9904 for xxx_convert in $gconvert_ld_preference; do
9905 case $xxx_convert in
9906 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9907 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9910 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9911 for xxx_convert in qgcvt sprintf $xxx_list; do
9912 case "$xxx_ld_list" in
9913 $xxx_convert*|*" $xxx_convert"*) ;;
9914 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9917 : if sprintf cannot do long doubles, move it to the end
9918 if test "$d_PRIgldbl" != "$define"; then
9919 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9921 : if no qgcvt, remove it
9922 if test "$d_qgcvt" != "$define"; then
9923 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9926 xxx_list="$xxx_ld_list"
9930 for xxx_convert in $xxx_list; do
9931 echo "Trying $xxx_convert..."
9932 $rm -f try try$_o core
9933 set try -DTRY_$xxx_convert
9934 if eval $compile; then
9935 echo "$xxx_convert() found." >&4
9937 echo "I'll use $xxx_convert to convert floats into a string." >&4
9940 echo "...But $xxx_convert didn't work as I expected."
9944 echo "$xxx_convert NOT found." >&4
9948 if test X$xxx_convert = X; then
9949 echo "*** WHOA THERE!!! ***" >&4
9950 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9954 case "$xxx_convert" in
9955 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9956 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9957 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9958 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9959 "$define$define$define")
9960 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9961 "$define$define$undef")
9962 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9963 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9971 : see if _fwalk exists
9975 : Initialize h_fcntl
9978 : Initialize h_sysfile
9981 : access call always available on UNIX
9985 : locate the flags for 'access()'
9989 $cat >access.c <<EOCP
9990 #include <sys/types.h>
9995 #include <sys/file.h>
10000 #$i_stdlib I_STDLIB
10002 #include <stdlib.h>
10008 : check sys/file.h first, no particular reason here
10009 if $test `./findhdr sys/file.h` && \
10010 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
10012 echo "<sys/file.h> defines the *_OK access constants." >&4
10013 elif $test `./findhdr fcntl.h` && \
10014 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
10016 echo "<fcntl.h> defines the *_OK access constants." >&4
10017 elif $test `./findhdr unistd.h` && \
10018 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
10019 echo "<unistd.h> defines the *_OK access constants." >&4
10021 echo "I can't find the four *_OK access constants--I'll use mine." >&4
10027 : see if accessx exists
10028 set accessx d_accessx
10031 : see if aintl exists
10035 : see if alarm exists
10039 : see if 64bit time functions exists
10041 set ctime64 d_ctime64
10044 set localtime64 d_localtime64
10047 set gmtime64 d_gmtime64
10050 set mktime64 d_mktime64
10053 set difftime64 d_difftime64
10056 set asctime64 d_asctime64
10059 : see if POSIX threads are available
10060 set pthread.h i_pthread
10063 : define a fucntion to check prototypes
10064 $cat > protochk <<EOSH
10067 optimize="$optimize"
10069 prototype="$prototype"
10072 usethreads=$usethreads
10073 i_pthread=$i_pthread
10074 pthread_h_first=$pthread_h_first
10077 $cat >> protochk <<'EOSH'
10082 while test $# -ge 2; do
10084 $define) echo "#include <$2>" >> try.c ;;
10085 literal) echo "$2" >> try.c ;;
10087 # Extra magic for the benefit of systems that need pthread.h
10088 # to be included early to correctly detect threadsafe functions.
10089 # Such functions must guarantee themselves, though, that the usethreads
10090 # and i_pthread have been defined, before calling protochk.
10091 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10092 echo "#include <pthread.h>" >> try.c
10097 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10098 cat >> try.c <<'EOCP'
10099 #ifdef CAN_PROTOTYPE
10100 #define _(args) args
10105 echo "$foo" >> try.c
10106 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10107 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10113 $eunicefix protochk
10115 : Define hasproto macro for Configure internal use
10116 hasproto='varname=$1; func=$2; shift; shift;
10117 while $test $# -ge 2; do
10119 $define) echo "#include <$2>";;
10123 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10124 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10125 echo "$func() prototype found.";
10128 echo "$func() prototype NOT found.";
10135 : see if sys/types.h has to be included
10136 set sys/types.h i_systypes
10139 : see if sys/select.h has to be included
10140 set sys/select.h i_sysselct
10143 : Define hasfield macro for Configure internal use
10144 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10145 while $test $# -ge 2; do
10147 $define) echo "#include <$2>";;
10151 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10153 if eval $compile; then
10162 : see if we should include time.h, sys/time.h, or both
10164 if test "X$timeincl" = X; then
10165 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10166 $echo $n "I'm now running the test program...$c"
10168 #include <sys/types.h>
10173 #ifdef SYSTIMEKERNEL
10176 #include <sys/time.h>
10179 #include <sys/select.h>
10181 #$i_stdlib I_STDLIB
10183 #include <stdlib.h>
10189 struct timeval bar;
10192 struct timezone tzp;
10194 if (foo.tm_sec == foo.tm_sec)
10197 if (bar.tv_sec == bar.tv_sec)
10204 for s_timezone in '-DS_TIMEZONE' ''; do
10206 for s_timeval in '-DS_TIMEVAL' ''; do
10207 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10208 for i_time in '' '-DI_TIME'; do
10209 for i_systime in '-DI_SYSTIME' ''; do
10212 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10213 if eval $compile; then
10214 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10218 $echo $n "Succeeded with $flags$c"
10230 *SYSTIMEKERNEL*) i_systimek="$define"
10231 timeincl=`./findhdr sys/time.h`
10232 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10233 *) i_systimek="$undef";;
10236 *I_TIME*) i_time="$define"
10237 timeincl=`./findhdr time.h`" $timeincl"
10238 echo "We'll include <time.h>." >&4;;
10239 *) i_time="$undef";;
10242 *I_SYSTIME*) i_systime="$define"
10243 timeincl=`./findhdr sys/time.h`" $timeincl"
10244 echo "We'll include <sys/time.h>." >&4;;
10245 *) i_systime="$undef";;
10249 : see if struct tm knows about tm_zone
10250 case "$i_systime$i_time" in
10253 echo "Checking to see if your struct tm has tm_zone field..." >&4
10254 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10262 case "$d_tm_tm_zone" in
10263 "$define") echo "Yes, it does." ;;
10264 *) echo "No, it doesn't." ;;
10266 : see if struct tm knows about tm_gmtoff
10267 case "$i_systime$i_time" in
10270 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10271 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10279 case "$d_tm_tm_gmtoff" in
10280 "$define") echo "Yes, it does." ;;
10281 *) echo "No, it doesn't." ;;
10284 : see if asctime_r exists
10285 set asctime_r d_asctime_r
10287 case "$d_asctime_r" in
10289 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10290 case "$d_asctime_r_proto:$usethreads" in
10291 ":define") d_asctime_r_proto=define
10292 set d_asctime_r_proto asctime_r $hdrs
10296 case "$d_asctime_r_proto" in
10298 case "$asctime_r_proto" in
10299 ''|0) try='char* asctime_r(const struct tm*, char*);'
10300 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10302 case "$asctime_r_proto" in
10303 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10304 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10306 case "$asctime_r_proto" in
10307 ''|0) try='int asctime_r(const struct tm*, char*);'
10308 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10310 case "$asctime_r_proto" in
10311 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10312 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10314 case "$asctime_r_proto" in
10315 ''|0) d_asctime_r=undef
10317 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10318 * ) case "$asctime_r_proto" in
10319 REENTRANT_PROTO*) ;;
10320 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10322 echo "Prototype: $try" ;;
10325 *) case "$usethreads" in
10326 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10333 *) asctime_r_proto=0
10337 : see if atolf exists
10341 : see if atoll exists
10345 : Look for GCC-style attribute format
10346 case "$d_attribute_format" in
10349 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10350 $cat >attrib.c <<'EOCP'
10352 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10354 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10355 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10356 echo "Your C compiler doesn't support __attribute__((format))."
10359 echo "Your C compiler supports __attribute__((format))."
10363 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10367 *) val="$d_attribute_format" ;;
10369 set d_attribute_format
10373 : Look for GCC-style attribute format with null format allowed
10374 case "$d_printf_format_null" in
10375 '') case "$d_attribute_format" in
10378 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10379 $cat >attrib.c <<EOCP
10381 #$i_stdlib I_STDLIB
10383 #include <stdlib.h>
10385 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10386 int null_printf (char* pat,...) { return (int)pat; }
10387 int main () { exit(null_printf(NULL)); }
10389 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10390 : run the executable in case it produces a run-time warning
10391 if $run ./attrib >>attrib.out 2>&1; then
10392 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10393 echo "Your C compiler doesn't allow __printf__ format to be null."
10396 echo "Your C compiler allows __printf__ format to be null."
10400 echo "Your C compiler executable failed with __printf__ format null."
10404 echo "Your C compiler fails with __printf__ format null."
10411 *) val="$d_printf_format_null" ;;
10413 set d_printf_format_null
10417 : Look for GCC-style attribute malloc
10418 case "$d_attribute_malloc" in
10421 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10422 $cat >attrib.c <<'EOCP'
10424 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10426 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10427 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10428 echo "Your C compiler doesn't support __attribute__((malloc))."
10431 echo "Your C compiler supports __attribute__((malloc))."
10435 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10439 *) val="$d_attribute_malloc" ;;
10441 set d_attribute_malloc
10445 : Look for GCC-style attribute nonnull
10446 case "$d_attribute_nonnull" in
10449 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10450 $cat >attrib.c <<'EOCP'
10452 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10454 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10455 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10456 echo "Your C compiler doesn't support __attribute__((nonnull))."
10459 echo "Your C compiler supports __attribute__((nonnull))."
10463 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10467 *) val="$d_attribute_nonnull" ;;
10469 set d_attribute_nonnull
10473 : Look for GCC-style attribute noreturn
10474 case "$d_attribute_noreturn" in
10477 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10478 $cat >attrib.c <<'EOCP'
10480 void fall_over_dead( void ) __attribute__((noreturn));
10482 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10483 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10484 echo "Your C compiler doesn't support __attribute__((noreturn))."
10487 echo "Your C compiler supports __attribute__((noreturn))."
10491 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10495 *) val="$d_attribute_noreturn" ;;
10497 set d_attribute_noreturn
10501 : Look for GCC-style attribute pure
10502 case "$d_attribute_pure" in
10505 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10506 $cat >attrib.c <<'EOCP'
10508 int square( int n ) __attribute__((pure));
10510 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10511 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10512 echo "Your C compiler doesn't support __attribute__((pure))."
10515 echo "Your C compiler supports __attribute__((pure))."
10519 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10523 *) val="$d_attribute_pure" ;;
10525 set d_attribute_pure
10529 : Look for GCC-style attribute unused
10530 case "$d_attribute_unused" in
10533 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10534 $cat >attrib.c <<'EOCP'
10536 int do_something( int dummy __attribute__((unused)), int n );
10538 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10539 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10540 echo "Your C compiler doesn't support __attribute__((unused))."
10543 echo "Your C compiler supports __attribute__((unused))."
10547 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10551 *) val="$d_attribute_unused" ;;
10553 set d_attribute_unused
10557 : Look for GCC-style attribute deprecated
10558 case "$d_attribute_deprecated" in
10561 echo "Checking whether your compiler can handle __attribute__((deprecated)) ..." >&4
10562 $cat >attrib.c <<'EOCP'
10564 int I_am_deprecated(void) __attribute__((deprecated));
10566 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10567 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10568 echo "Your C compiler doesn't support __attribute__((deprecated))."
10571 echo "Your C compiler supports __attribute__((deprecated))."
10575 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10579 *) val="$d_attribute_deprecated" ;;
10581 set d_attribute_deprecated
10585 : Look for GCC-style attribute warn_unused_result
10586 case "$d_attribute_warn_unused_result" in
10589 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10590 $cat >attrib.c <<'EOCP'
10592 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10594 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10595 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10596 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10599 echo "Your C compiler supports __attribute__((warn_unused_result))."
10603 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10607 *) val="$d_attribute_warn_unused_result" ;;
10609 set d_attribute_warn_unused_result
10613 : see if bcmp exists
10617 : see if bcopy exists
10621 : see if getpgrp exists
10622 set getpgrp d_getpgrp
10625 case "$d_getpgrp" in
10628 echo "Checking to see which flavor of getpgrp is in use..."
10630 #$i_unistd I_UNISTD
10631 #include <sys/types.h>
10633 # include <unistd.h>
10635 #$i_stdlib I_STDLIB
10637 #include <stdlib.h>
10641 if (getuid() == 0) {
10642 printf("(I see you are running Configure as super-user...)\n");
10645 #ifdef TRY_BSD_PGRP
10646 if (getpgrp(1) == 0)
10655 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10656 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10658 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10659 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10662 echo "I can't seem to compile and run the test program."
10664 xxx="a USG one, i.e. you use getpgrp()."
10666 # SVR4 systems can appear rather BSD-ish.
10667 case "$i_unistd" in
10669 xxx="a BSD one, i.e. you use getpgrp(pid)."
10673 xxx="probably a USG one, i.e. you use getpgrp()."
10678 echo "Assuming your getpgrp is $xxx" >&4
10687 : see if setpgrp exists
10688 set setpgrp d_setpgrp
10691 case "$d_setpgrp" in
10694 echo "Checking to see which flavor of setpgrp is in use..."
10696 #$i_unistd I_UNISTD
10697 #include <sys/types.h>
10699 # include <unistd.h>
10701 #$i_stdlib I_STDLIB
10703 #include <stdlib.h>
10707 if (getuid() == 0) {
10708 printf("(I see you are running Configure as super-user...)\n");
10711 #ifdef TRY_BSD_PGRP
10712 if (-1 == setpgrp(1, 1))
10715 if (setpgrp() != -1)
10721 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10722 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10724 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10725 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10728 echo "(I can't seem to compile and run the test program.)"
10730 xxx="a USG one, i.e. you use setpgrp()."
10732 # SVR4 systems can appear rather BSD-ish.
10733 case "$i_unistd" in
10735 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10739 xxx="probably a USG one, i.e. you use setpgrp()."
10744 echo "Assuming your setpgrp is $xxx" >&4
10753 : Look for GCC-style __builtin_choose_expr
10754 case "$d_builtin_choose_expr" in
10757 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10758 $cat >try.c <<'EOCP'
10759 #include <assert.h>
10760 #include <stdlib.h>
10763 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10766 assert( SYRINX(1) == 2112 );
10767 assert( SYRINX(1) != 5150 );
10768 assert( SYRINX(0) == 5150 );
10769 assert( SYRINX(0) != 2112 );
10770 puts( "All good!" );
10776 if eval $compile && $run ./try; then
10777 echo "Your C compiler supports __builtin_choose_expr."
10780 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10784 *) val="$d_builtin_choose_expr" ;;
10787 set d_builtin_choose_expr
10791 : Look for GCC-style __builtin_expect
10792 case "$d_builtin_expect" in
10795 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10796 $cat >try.c <<'EOCP'
10799 if ( __builtin_expect(n, 0) ) n = 1;
10800 /* Remember shell exit code truth is 0, C truth is non-zero */
10805 if eval $compile && $run ./try; then
10806 echo "Your C compiler supports __builtin_expect."
10809 echo "Your C compiler doesn't seem to understand __builtin_expect."
10813 *) val="$d_builtin_expect" ;;
10816 set d_builtin_expect
10820 : see if bzero exists
10824 : see if stdarg is available
10826 if $test `./findhdr stdarg.h`; then
10827 echo "<stdarg.h> found." >&4
10830 echo "<stdarg.h> NOT found." >&4
10834 : see if varags is available
10836 if $test `./findhdr varargs.h`; then
10837 echo "<varargs.h> found." >&4
10839 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10842 : set up the varargs testing programs
10843 $cat > varargs.c <<EOP
10845 #include <stdarg.h>
10848 #include <varargs.h>
10852 int f(char *p, ...)
10866 p = va_arg(ap, char *);
10872 $cat > varargs <<EOP
10874 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10883 : now check which varargs header should be included
10888 if `./varargs I_STDARG`; then
10890 elif `./varargs I_VARARGS`; then
10895 if `./varargs I_VARARGS`; then
10902 echo "I could not find the definition for va_dcl... You have problems..." >&4
10903 val="$undef"; set i_stdarg; eval $setvar
10904 val="$undef"; set i_varargs; eval $setvar
10909 case "$i_varhdr" in
10911 val="$define"; set i_stdarg; eval $setvar
10912 val="$undef"; set i_varargs; eval $setvar
10915 val="$undef"; set i_stdarg; eval $setvar
10916 val="$define"; set i_varargs; eval $setvar
10919 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10923 : see if the Compiler supports C99 variadic macros
10924 case "$i_stdarg$i_stdlib" in
10926 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10929 #include <stdarg.h>
10931 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10935 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10941 if eval $compile && $run ./try 2>&1 >/dev/null; then
10942 case "`$run ./try`" in
10944 echo "You have C99 variadic macros." >&4
10945 d_c99_variadic_macros="$define"
10948 echo "You don't have functional C99 variadic macros." >&4
10949 d_c99_variadic_macros="$undef"
10953 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10954 d_c99_variadic_macros="$undef"
10959 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10960 d_c99_variadic_macros="$undef"
10964 : see if signal is declared as pointer to function returning int or void
10966 xxx=`./findhdr signal.h`
10967 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10968 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10969 echo "You have int (*signal())() instead of void." >&4
10971 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10972 echo "You have void (*signal())()." >&4
10974 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10975 echo "You have int (*signal())() instead of void." >&4
10977 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10978 echo "You have void (*signal())()." >&4
10981 case "$d_voidsig" in
10983 echo "I can't determine whether signal handler returns void or int..." >&4
10985 rp="What type does your signal handler return?"
10988 v*) val="$define";;
10992 echo "As you already told me, signal handler returns void." >&4
10995 *) echo "As you already told me, signal handler returns int." >&4
11002 case "$d_voidsig" in
11003 "$define") signal_t="void";;
11004 *) signal_t="int";;
11008 : check for ability to cast large floats to 32-bit ints.
11010 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
11011 if $test "$intsize" -ge 4; then
11018 #$i_stdlib I_STDLIB
11020 #include <stdlib.h>
11022 #include <sys/types.h>
11023 #include <signal.h>
11024 $signal_t blech(int s) { exit(3); }
11031 signal(SIGFPE, blech);
11033 /* Don't let compiler optimize the test away. Store the number
11034 in a writable string for gcc to pass to sscanf under HP-UX.
11036 sprintf(str, "2147483647");
11037 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
11041 /* x86 processors will probably give 0x8000 0000, which is a
11042 sign change. We don't want that. We want to mimic SPARC
11043 behavior here, which is to preserve the sign and give
11046 if (i32 != ($xxx) f)
11052 if eval $compile_ok; then
11056 echo "(I can't seem to compile the test program--assuming it can't)"
11061 echo "Yup, it can."
11064 echo "Nope, it can't."
11071 : check for ability to cast negative floats to unsigned
11073 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
11076 #$i_stdlib I_STDLIB
11078 #include <stdlib.h>
11080 #include <sys/types.h>
11081 #include <signal.h>
11082 $signal_t blech(int s) { exit(7); }
11083 $signal_t blech_in_list(int s) { exit(4); }
11084 unsigned long dummy_long(unsigned long p) { return p; }
11085 unsigned int dummy_int(unsigned int p) { return p; }
11086 unsigned short dummy_short(unsigned short p) { return p; }
11090 unsigned long along;
11092 unsigned short ashort;
11096 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11097 a direct f = -123. assignment. gcc-2.8.0 reportedly
11098 optimized the whole file away
11100 /* Store the number in a writable string for gcc to pass to
11101 sscanf under HP-UX.
11103 sprintf(str, "-123");
11104 sscanf(str, "%lf", &f); /* f = -123.; */
11106 signal(SIGFPE, blech);
11107 along = (unsigned long)f;
11108 aint = (unsigned int)f;
11109 ashort = (unsigned short)f;
11110 if (along != (unsigned long)-123)
11112 if (aint != (unsigned int)-123)
11114 if (ashort != (unsigned short)-123)
11116 sprintf(str, "1073741824.");
11117 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11120 along = (unsigned long)f;
11121 if (along != 0x80000000)
11125 along = (unsigned long)f;
11126 if (along != 0x7fffffff)
11130 along = (unsigned long)f;
11131 if (along != 0x80000001)
11135 signal(SIGFPE, blech_in_list);
11136 sprintf(str, "123.");
11137 sscanf(str, "%lf", &f); /* f = 123.; */
11138 along = dummy_long((unsigned long)f);
11139 aint = dummy_int((unsigned int)f);
11140 ashort = dummy_short((unsigned short)f);
11141 if (along != (unsigned long)123)
11143 if (aint != (unsigned int)123)
11145 if (ashort != (unsigned short)123)
11152 if eval $compile_ok; then
11156 echo "(I can't seem to compile the test program--assuming it can't)"
11159 case "$castflags" in
11161 echo "Yup, it can."
11164 echo "Nope, it can't."
11171 : see if vprintf exists
11173 if set vprintf val -f d_vprintf; eval $csym; $val; then
11174 echo 'vprintf() found.' >&4
11177 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11178 #$i_varargs I_VARARGS
11180 #$i_stdlib I_STDLIB
11181 #$i_unistd I_UNISTD
11184 # include <stdarg.h>
11185 #else /* I_VARARGS */
11186 # include <varargs.h>
11190 # include <unistd.h>
11194 # include <stdlib.h>
11197 #include <stdio.h> /* vsprintf prototype */
11200 void xxx(int n, ...)
11205 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11207 int main() { xxx(1, "foo"); }
11209 #else /* I_VARARGS */
11217 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11219 int main() { xxx("foo"); }
11225 if eval $compile_ok; then
11226 if $run ./try; then
11227 echo "Your vsprintf() returns (int)." >&4
11230 echo "Your vsprintf() returns (char*)." >&4
11234 echo 'I am unable to compile the vsprintf() test program.' >&4
11235 # We shouldn't get here. If we do, assume the standard signature,
11236 # not the old BSD one.
11237 echo 'Guessing that vsprintf() returns (int).' >&4
11241 echo 'vprintf() NOT found.' >&4
11252 : see if chown exists
11256 : see if chroot exists
11257 set chroot d_chroot
11260 : see if chsize exists
11261 set chsize d_chsize
11264 : see if class exists
11268 : see if clearenv exists
11269 set clearenv d_clearenv
11272 : Define hasstruct macro for Configure internal use
11273 hasstruct='varname=$1; struct=$2; shift; shift;
11274 while $test $# -ge 2; do
11276 $define) echo "#include <$2>";;
11280 echo "int main () { struct $struct foo; }" >> try.c;
11282 if eval $compile; then
11291 : see whether socket exists
11295 $echo $n "Hmm... $c" >&4
11296 if set socket val -f d_socket; eval $csym; $val; then
11297 echo "Looks like you have Berkeley networking support." >&4
11299 if set setsockopt val -f; eval $csym; $val; then
11302 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11303 d_oldsock="$define"
11306 if $contains socklib libc.list >/dev/null 2>&1; then
11307 echo "Looks like you have Berkeley networking support." >&4
11309 : we will have to assume that it supports the 4.2 BSD interface
11312 echo "You don't have Berkeley networking in libc$_a..." >&4
11313 if test "X$d_socket" = "X$define"; then
11314 echo "...but you seem to believe that you have sockets." >&4
11316 for net in net socket
11318 if test -f /usr/lib/lib$net$_a; then
11319 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11320 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11321 if $contains socket libc.list >/dev/null 2>&1; then
11326 echo "...but the Wollongong group seems to have hacked it in." >&4
11327 sockethdr="-I/usr/netinclude"
11330 echo "Found Berkeley sockets interface in lib$net." >&4
11331 if $contains setsockopt libc.list >/dev/null 2>&1; then
11334 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11335 d_oldsock="$define"
11341 if test "X$d_socket" != "X$define"; then
11342 echo "or anywhere else I see." >&4
11350 : see if socketpair exists
11351 set socketpair d_sockpair
11356 echo "Checking the availability of certain socket constants..." >&4
11357 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11358 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11360 #include <sys/types.h>
11361 #include <sys/socket.h>
11367 set try; if eval $compile; then
11370 set d_${enum}; eval $setvar
11374 : see if this is a sys/uio.h system
11375 set sys/uio.h i_sysuio
11378 : Check for cmsghdr support
11380 echo "Checking to see if your system supports struct cmsghdr..." >&4
11381 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11383 case "$d_cmsghdr_s" in
11384 "$define") echo "Yes, it does." ;;
11385 *) echo "No, it doesn't." ;;
11389 : check for const keyword
11391 echo 'Checking to see if your C compiler knows about "const"...' >&4
11392 $cat >const.c <<'EOCP'
11393 typedef struct spug { int drokk; } spug;
11397 const spug y = { 0 };
11400 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11402 echo "Yup, it does."
11405 echo "Nope, it doesn't."
11410 : see if copysignl exists
11411 set copysignl d_copysignl
11414 : see if crypt exists
11419 $define) cryptlib='' ;;
11420 *) if set crypt val -f d_crypt; eval $csym; $val; then
11421 echo 'crypt() found.' >&4
11425 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11426 if $test -z "$cryptlib"; then
11427 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11431 if $test -z "$cryptlib"; then
11432 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11436 if $test -z "$cryptlib"; then
11437 cryptlib=`./loc libcrypt$_a "" $libpth`
11441 if $test -z "$cryptlib"; then
11442 echo 'crypt() NOT found.' >&4
11453 : see if this is a crypt.h system
11454 set crypt.h i_crypt
11457 : see if crypt_r exists
11458 set crypt_r d_crypt_r
11460 case "$d_crypt_r" in
11462 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11463 case "$d_crypt_r_proto:$usethreads" in
11464 ":define") d_crypt_r_proto=define
11465 set d_crypt_r_proto crypt_r $hdrs
11469 case "$d_crypt_r_proto" in
11471 case "$crypt_r_proto" in
11472 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11473 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11475 case "$crypt_r_proto" in
11476 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11477 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11479 case "$crypt_r_proto" in
11480 ''|0) d_crypt_r=undef
11482 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11483 * ) case "$crypt_r_proto" in
11484 REENTRANT_PROTO*) ;;
11485 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11487 echo "Prototype: $try" ;;
11490 *) case "$usethreads" in
11491 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11502 : get csh whereabouts
11504 'csh') val="$undef" ;;
11505 *) val="$define" ;;
11509 : Respect a hint or command line value for full_csh.
11510 case "$full_csh" in
11511 '') full_csh=$csh ;;
11514 : see if ctermid exists
11515 set ctermid d_ctermid
11518 : see if ctermid_r exists
11519 set ctermid_r d_ctermid_r
11521 case "$d_ctermid_r" in
11523 hdrs="$i_systypes sys/types.h define stdio.h "
11524 case "$d_ctermid_r_proto:$usethreads" in
11525 ":define") d_ctermid_r_proto=define
11526 set d_ctermid_r_proto ctermid_r $hdrs
11530 case "$d_ctermid_r_proto" in
11532 case "$ctermid_r_proto" in
11533 ''|0) try='char* ctermid_r(char*);'
11534 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11536 case "$ctermid_r_proto" in
11537 ''|0) d_ctermid_r=undef
11539 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11540 * ) case "$ctermid_r_proto" in
11541 REENTRANT_PROTO*) ;;
11542 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11544 echo "Prototype: $try" ;;
11547 *) case "$usethreads" in
11548 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11555 *) ctermid_r_proto=0
11559 : see if ctime_r exists
11560 set ctime_r d_ctime_r
11562 case "$d_ctime_r" in
11564 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11565 case "$d_ctime_r_proto:$usethreads" in
11566 ":define") d_ctime_r_proto=define
11567 set d_ctime_r_proto ctime_r $hdrs
11571 case "$d_ctime_r_proto" in
11573 case "$ctime_r_proto" in
11574 ''|0) try='char* ctime_r(const time_t*, char*);'
11575 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11577 case "$ctime_r_proto" in
11578 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11579 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11581 case "$ctime_r_proto" in
11582 ''|0) try='int ctime_r(const time_t*, char*);'
11583 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11585 case "$ctime_r_proto" in
11586 ''|0) try='int ctime_r(const time_t*, char*, int);'
11587 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11589 case "$ctime_r_proto" in
11590 ''|0) d_ctime_r=undef
11592 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11593 * ) case "$ctime_r_proto" in
11594 REENTRANT_PROTO*) ;;
11595 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11597 echo "Prototype: $try" ;;
11600 *) case "$usethreads" in
11601 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11612 : see if cuserid exists
11613 set cuserid d_cuserid
11616 : see if this is a limits.h system
11617 set limits.h i_limits
11620 : see if this is a float.h system
11621 set float.h i_float
11624 : See if number of significant digits in a double precision number is known
11626 $cat >dbl_dig.c <<EOM
11627 #$i_limits I_LIMITS
11630 #include <limits.h>
11636 printf("Contains DBL_DIG");
11639 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11640 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11641 echo "DBL_DIG found." >&4
11644 echo "DBL_DIG NOT found." >&4
11651 : see if dbm.h is available
11652 : see if dbmclose exists
11653 set dbmclose d_dbmclose
11656 case "$d_dbmclose" in
11666 *) set rpcsvc/dbm.h i_rpcsvcdbm
11671 *) echo "We won't be including <dbm.h>"
11681 : see if prototype for dbminit is available
11683 set d_dbminitproto dbminit $i_dbm dbm.h
11686 : see if difftime exists
11687 set difftime d_difftime
11690 : see if this is a dirent system
11692 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11694 echo "<dirent.h> found." >&4
11697 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11698 echo "<sys/dir.h> found." >&4
11701 xinc=`./findhdr sys/ndir.h`
11703 echo "<dirent.h> NOT found." >&4
11708 : Look for type of directory structure.
11710 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11712 case "$direntrytype" in
11714 case "$i_dirent" in
11715 $define) guess1='struct dirent' ;;
11716 *) guess1='struct direct' ;;
11719 *) guess1="$direntrytype"
11724 'struct dirent') guess2='struct direct' ;;
11725 *) guess2='struct dirent' ;;
11728 if $contains "$guess1" try.c >/dev/null 2>&1; then
11729 direntrytype="$guess1"
11730 echo "Your directory entries are $direntrytype." >&4
11731 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11732 direntrytype="$guess2"
11733 echo "Your directory entries seem to be $direntrytype." >&4
11735 echo "I don't recognize your system's directory entries." >&4
11736 rp="What type is used for directory entries on this system?"
11739 direntrytype="$ans"
11743 : see if the directory entry stores field length
11745 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11746 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11747 echo "Good, your directory entry keeps length information in d_namlen." >&4
11750 echo "Your directory entry does not know about the d_namlen field." >&4
11757 : Look for DIR.dd_fd
11758 case "$i_dirent" in
11760 echo "Checking to see if DIR has a dd_fd member variable" >&4
11762 #$i_stdlib I_STDLIB
11764 #include <stdlib.h>
11766 #include <dirent.h>
11776 if eval $compile; then
11777 echo "Yes, it does."
11780 echo "No, it does not."
11785 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11793 : see if this is an sysdir system
11794 set sys/dir.h i_sysdir
11797 : see if this is an sysndir system
11798 set sys/ndir.h i_sysndir
11803 $cat >dirfd.c <<EOM
11805 #$i_stdlib I_STDLIB
11807 #include <stdlib.h>
11809 #$i_dirent I_DIRENT /**/
11810 #$i_sysdir I_SYS_DIR /**/
11811 #$i_sysndir I_SYS_NDIR /**/
11812 #$i_systypes I_SYS_TYPES /**/
11813 #if defined(I_SYS_TYPES)
11814 #include <sys/types.h>
11816 #if defined(I_DIRENT)
11817 #include <dirent.h>
11818 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11819 #include <sys/dir.h>
11823 #include <sys/ndir.h>
11827 #include <ndir.h> /* may be wrong in the future */
11829 #include <sys/dir.h>
11835 DIR *dirp = opendir(".");
11836 if (dirfd(dirp) >= 0)
11844 if eval $compile; then
11848 $define) echo "dirfd() found." >&4 ;;
11849 *) echo "dirfd() NOT found." >&4 ;;
11855 : see if dlerror exists
11858 set dlerror d_dlerror
11862 : see if dlfcn is available
11863 set dlfcn.h i_dlfcn
11866 : Check what extension to use for shared libs
11871 On a few systems, the dynamically loaded modules that perl generates and uses
11872 will need a different extension than shared libs. The default will probably
11878 *) dflt="$dlext" ;;
11880 rp='What is the extension of dynamically loaded modules'
11889 : Check if dlsym need a leading underscore
11895 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11896 $cat >dyna.c <<'EOM'
11903 #$i_stdlib I_STDLIB
11905 #include <stdlib.h>
11909 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11911 #include <sys/types.h>
11916 extern int fred() ;
11925 int mode = RTLD_LAZY ;
11927 handle = dlopen("./dyna.$dlext", mode) ;
11928 if (handle == NULL) {
11933 symbol = dlsym(handle, "fred") ;
11934 if (symbol == NULL) {
11935 /* try putting a leading underscore */
11936 symbol = dlsym(handle, "_fred") ;
11937 if (symbol == NULL) {
11950 : Call the object file tmp-dyna.o in case dlext=o.
11951 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11952 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11953 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11954 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11957 1) echo "Test program failed using dlopen." >&4
11958 echo "Perhaps you should not use dynamic loading." >&4;;
11959 2) echo "Test program failed using dlsym." >&4
11960 echo "Perhaps you should not use dynamic loading." >&4;;
11961 3) echo "dlsym needs a leading underscore" >&4
11963 4) echo "dlsym doesn't need a leading underscore." >&4;;
11966 echo "I can't compile and run the test program." >&4
11967 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11972 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11977 : see if drand48_r exists
11978 set drand48_r d_drand48_r
11980 case "$d_drand48_r" in
11982 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11983 case "$d_drand48_r_proto:$usethreads" in
11984 ":define") d_drand48_r_proto=define
11985 set d_drand48_r_proto drand48_r $hdrs
11989 case "$d_drand48_r_proto" in
11991 case "$drand48_r_proto" in
11992 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11993 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
11995 case "$drand48_r_proto" in
11996 ''|0) d_drand48_r=undef
11998 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11999 * ) case "$drand48_r_proto" in
12000 REENTRANT_PROTO*) ;;
12001 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
12003 echo "Prototype: $try" ;;
12006 *) case "$usethreads" in
12007 define) echo "drand48_r has no prototype, not using it." >&4 ;;
12014 *) drand48_r_proto=0
12018 : see if prototype for drand48 is available
12020 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
12023 : see if dup2 exists
12027 : see if eaccess exists
12028 set eaccess d_eaccess
12031 : see if endgrent exists
12032 set endgrent d_endgrent
12035 : see if this is an grp system
12041 xxx=`./findhdr grp.h`
12042 $cppstdin $cppflags $cppminus < $xxx >$$.h
12044 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
12056 set d_grpasswd; eval $setvar
12060 : see if endgrent_r exists
12061 set endgrent_r d_endgrent_r
12063 case "$d_endgrent_r" in
12065 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12066 case "$d_endgrent_r_proto:$usethreads" in
12067 ":define") d_endgrent_r_proto=define
12068 set d_endgrent_r_proto endgrent_r $hdrs
12072 case "$d_endgrent_r_proto" in
12074 case "$endgrent_r_proto" in
12075 ''|0) try='int endgrent_r(FILE**);'
12076 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
12078 case "$endgrent_r_proto" in
12079 ''|0) try='void endgrent_r(FILE**);'
12080 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
12082 case "$endgrent_r_proto" in
12083 ''|0) d_endgrent_r=undef
12085 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
12086 * ) case "$endgrent_r_proto" in
12087 REENTRANT_PROTO*) ;;
12088 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
12090 echo "Prototype: $try" ;;
12093 *) case "$usethreads" in
12094 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12101 *) endgrent_r_proto=0
12105 : see if endhostent exists
12106 set endhostent d_endhent
12109 : see if this is a netdb.h system
12110 set netdb.h i_netdb
12113 : see if endhostent_r exists
12114 set endhostent_r d_endhostent_r
12116 case "$d_endhostent_r" in
12118 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12119 case "$d_endhostent_r_proto:$usethreads" in
12120 ":define") d_endhostent_r_proto=define
12121 set d_endhostent_r_proto endhostent_r $hdrs
12125 case "$d_endhostent_r_proto" in
12127 case "$endhostent_r_proto" in
12128 ''|0) try='int endhostent_r(struct hostent_data*);'
12129 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12131 case "$endhostent_r_proto" in
12132 ''|0) try='void endhostent_r(struct hostent_data*);'
12133 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12135 case "$endhostent_r_proto" in
12136 ''|0) d_endhostent_r=undef
12137 endhostent_r_proto=0
12138 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12139 * ) case "$endhostent_r_proto" in
12140 REENTRANT_PROTO*) ;;
12141 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12143 echo "Prototype: $try" ;;
12146 *) case "$usethreads" in
12147 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12149 d_endhostent_r=undef
12150 endhostent_r_proto=0
12154 *) endhostent_r_proto=0
12158 : see if endnetent exists
12159 set endnetent d_endnent
12162 : see if endnetent_r exists
12163 set endnetent_r d_endnetent_r
12165 case "$d_endnetent_r" in
12167 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12168 case "$d_endnetent_r_proto:$usethreads" in
12169 ":define") d_endnetent_r_proto=define
12170 set d_endnetent_r_proto endnetent_r $hdrs
12174 case "$d_endnetent_r_proto" in
12176 case "$endnetent_r_proto" in
12177 ''|0) try='int endnetent_r(struct netent_data*);'
12178 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12180 case "$endnetent_r_proto" in
12181 ''|0) try='void endnetent_r(struct netent_data*);'
12182 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12184 case "$endnetent_r_proto" in
12185 ''|0) d_endnetent_r=undef
12186 endnetent_r_proto=0
12187 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12188 * ) case "$endnetent_r_proto" in
12189 REENTRANT_PROTO*) ;;
12190 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12192 echo "Prototype: $try" ;;
12195 *) case "$usethreads" in
12196 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12198 d_endnetent_r=undef
12199 endnetent_r_proto=0
12203 *) endnetent_r_proto=0
12207 : see if endprotoent exists
12208 set endprotoent d_endpent
12211 : see if endprotoent_r exists
12212 set endprotoent_r d_endprotoent_r
12214 case "$d_endprotoent_r" in
12216 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12217 case "$d_endprotoent_r_proto:$usethreads" in
12218 ":define") d_endprotoent_r_proto=define
12219 set d_endprotoent_r_proto endprotoent_r $hdrs
12223 case "$d_endprotoent_r_proto" in
12225 case "$endprotoent_r_proto" in
12226 ''|0) try='int endprotoent_r(struct protoent_data*);'
12227 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12229 case "$endprotoent_r_proto" in
12230 ''|0) try='void endprotoent_r(struct protoent_data*);'
12231 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12233 case "$endprotoent_r_proto" in
12234 ''|0) d_endprotoent_r=undef
12235 endprotoent_r_proto=0
12236 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12237 * ) case "$endprotoent_r_proto" in
12238 REENTRANT_PROTO*) ;;
12239 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12241 echo "Prototype: $try" ;;
12244 *) case "$usethreads" in
12245 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12247 d_endprotoent_r=undef
12248 endprotoent_r_proto=0
12252 *) endprotoent_r_proto=0
12256 : see if endpwent exists
12257 set endpwent d_endpwent
12260 : see if this is a pwd.h system
12266 xxx=`./findhdr pwd.h`
12267 $cppstdin $cppflags $cppminus < $xxx >$$.h
12269 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12277 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12285 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12293 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12301 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12309 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12317 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12325 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12337 set d_pwquota; eval $setvar
12338 set d_pwage; eval $setvar
12339 set d_pwchange; eval $setvar
12340 set d_pwclass; eval $setvar
12341 set d_pwexpire; eval $setvar
12342 set d_pwcomment; eval $setvar
12343 set d_pwgecos; eval $setvar
12344 set d_pwpasswd; eval $setvar
12348 : see if endpwent_r exists
12349 set endpwent_r d_endpwent_r
12351 case "$d_endpwent_r" in
12353 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12354 case "$d_endpwent_r_proto:$usethreads" in
12355 ":define") d_endpwent_r_proto=define
12356 set d_endpwent_r_proto endpwent_r $hdrs
12360 case "$d_endpwent_r_proto" in
12362 case "$endpwent_r_proto" in
12363 ''|0) try='int endpwent_r(FILE**);'
12364 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12366 case "$endpwent_r_proto" in
12367 ''|0) try='void endpwent_r(FILE**);'
12368 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12370 case "$endpwent_r_proto" in
12371 ''|0) d_endpwent_r=undef
12373 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12374 * ) case "$endpwent_r_proto" in
12375 REENTRANT_PROTO*) ;;
12376 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12378 echo "Prototype: $try" ;;
12381 *) case "$usethreads" in
12382 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12389 *) endpwent_r_proto=0
12393 : see if endservent exists
12394 set endservent d_endsent
12397 : see if endservent_r exists
12398 set endservent_r d_endservent_r
12400 case "$d_endservent_r" in
12402 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12403 case "$d_endservent_r_proto:$usethreads" in
12404 ":define") d_endservent_r_proto=define
12405 set d_endservent_r_proto endservent_r $hdrs
12409 case "$d_endservent_r_proto" in
12411 case "$endservent_r_proto" in
12412 ''|0) try='int endservent_r(struct servent_data*);'
12413 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12415 case "$endservent_r_proto" in
12416 ''|0) try='void endservent_r(struct servent_data*);'
12417 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12419 case "$endservent_r_proto" in
12420 ''|0) d_endservent_r=undef
12421 endservent_r_proto=0
12422 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12423 * ) case "$endservent_r_proto" in
12424 REENTRANT_PROTO*) ;;
12425 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12427 echo "Prototype: $try" ;;
12430 *) case "$usethreads" in
12431 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12433 d_endservent_r=undef
12434 endservent_r_proto=0
12438 *) endservent_r_proto=0
12442 : Locate the flags for 'open()'
12445 #include <sys/types.h>
12450 #include <sys/file.h>
12452 #$i_stdlib I_STDLIB
12454 #include <stdlib.h>
12465 : check sys/file.h first to get FREAD on Sun
12466 if $test `./findhdr sys/file.h` && \
12467 set try -DI_SYS_FILE && eval $compile; then
12469 echo "<sys/file.h> defines the O_* constants..." >&4
12470 if $run ./try; then
12471 echo "and you have the 3 argument form of open()." >&4
12474 echo "but not the 3 argument form of open(). Oh, well." >&4
12477 elif $test `./findhdr fcntl.h` && \
12478 set try -DI_FCNTL && eval $compile; then
12480 echo "<fcntl.h> defines the O_* constants..." >&4
12481 if $run ./try; then
12482 echo "and you have the 3 argument form of open()." >&4
12485 echo "but not the 3 argument form of open(). Oh, well." >&4
12490 echo "I can't find the O_* constant definitions! You got problems." >&4
12496 : see if this is a sys/file.h system
12501 : do we need to include sys/file.h ?
12505 if $h_sysfile; then
12507 echo "We'll be including <sys/file.h>." >&4
12510 echo "We won't be including <sys/file.h>." >&4
12520 : see if fcntl.h is there
12525 : see if we can include fcntl.h
12531 echo "We'll be including <fcntl.h>." >&4
12534 if $h_sysfile; then
12535 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12537 echo "We won't be including <fcntl.h>." >&4
12549 : see if fork exists
12553 : see if pipe exists
12557 : check for non-blocking I/O stuff
12558 case "$h_sysfile" in
12559 true) echo "#include <sys/file.h>" > head.c;;
12562 true) echo "#include <fcntl.h>" > head.c;;
12563 *) echo "#include <sys/fcntl.h>" > head.c;;
12568 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12569 case "$o_nonblock" in
12571 $cat head.c > try.c
12572 $cat >>try.c <<EOCP
12574 #$i_stdlib I_STDLIB
12576 #include <stdlib.h>
12584 printf("O_NONBLOCK\n");
12588 printf("O_NDELAY\n");
12592 printf("FNDELAY\n");
12599 if eval $compile_ok; then
12600 o_nonblock=`$run ./try`
12601 case "$o_nonblock" in
12602 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12603 *) echo "Seems like we can use $o_nonblock.";;
12606 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12609 *) echo "Using $hint value $o_nonblock.";;
12614 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12617 case "$d_fork:$d_pipe" in
12619 $cat head.c > try.c
12620 $cat >>try.c <<EOCP
12622 #include <sys/types.h>
12623 #include <signal.h>
12625 #$i_stdlib I_STDLIB
12627 #include <stdlib.h>
12633 #define MY_O_NONBLOCK $o_nonblock
12634 #ifndef errno /* XXX need better Configure test */
12637 #$i_unistd I_UNISTD
12639 #include <unistd.h>
12641 #$i_string I_STRING
12643 #include <string.h>
12645 #include <strings.h>
12647 $signal_t blech(int x) { exit(3); }
12649 $cat >> try.c <<'EOCP'
12657 pipe(pd); /* Down: child -> parent */
12658 pipe(pu); /* Up: parent -> child */
12661 close(pd[1]); /* Parent reads from pd[0] */
12662 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12664 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12669 signal(SIGALRM, blech);
12671 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12673 sprintf(string, "%d\n", ret);
12674 write(2, string, strlen(string));
12677 if (errno == EAGAIN) {
12678 printf("EAGAIN\n");
12683 if (errno == EWOULDBLOCK)
12684 printf("EWOULDBLOCK\n");
12687 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12688 sleep(2); /* Give it time to close our pipe */
12690 ret = read(pd[0], buf, 1); /* Should read EOF */
12692 sprintf(string, "%d\n", ret);
12693 write(4, string, strlen(string));
12697 close(pd[0]); /* We write to pd[1] */
12698 close(pu[1]); /* We read from pu[0] */
12699 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12700 close(pd[1]); /* Pipe pd is now fully closed! */
12701 exit(0); /* Bye bye, thank you for playing! */
12705 if eval $compile_ok; then
12706 echo "$startsh" >mtry
12707 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12709 ./mtry >/dev/null 2>&1
12711 0) eagain=`$cat try.out`;;
12712 1) echo "Could not perform non-blocking setting!";;
12713 2) echo "I did a successful read() for something that was not there!";;
12714 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12715 4) echo "Could not find F_SETFL!";;
12716 *) echo "Something terribly wrong happened during testing.";;
12718 rd_nodata=`$cat try.ret`
12719 echo "A read() system call with no data present returns $rd_nodata."
12720 case "$rd_nodata" in
12723 echo "(That's peculiar, fixing that to be -1.)"
12729 echo "Forcing errno EAGAIN on read() with no data available."
12733 echo "Your read() sets errno to $eagain when no data is available."
12736 status=`$cat try.err`
12738 0) echo "And it correctly returns 0 to signal EOF.";;
12739 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12740 *) echo "However, your read() returns '$status' on EOF??";;
12743 if test "$status" = "$rd_nodata"; then
12744 echo "WARNING: you can't distinguish between EOF and no data!"
12748 echo "I can't compile the test program--assuming errno EAGAIN will do."
12752 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12761 echo "Using $hint value $eagain."
12762 echo "Your read() returns $rd_nodata when no data is present."
12763 case "$d_eofnblk" in
12764 "$define") echo "And you can see EOF because read() returns 0.";;
12765 "$undef") echo "But you can't see EOF status from read() returned value.";;
12767 echo "(Assuming you can't see EOF status from read anyway.)"
12773 $rm_try head.c mtry
12775 : see if _ptr and _cnt from stdio act std
12778 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12779 echo "(Looks like you have stdio.h from BSD.)"
12780 case "$stdio_ptr" in
12781 '') stdio_ptr='((fp)->_p)'
12784 *) ptr_lval=$d_stdio_ptr_lval;;
12786 case "$stdio_cnt" in
12787 '') stdio_cnt='((fp)->_r)'
12790 *) cnt_lval=$d_stdio_cnt_lval;;
12792 case "$stdio_base" in
12793 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12795 case "$stdio_bufsiz" in
12796 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12798 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12799 echo "(Looks like you have stdio.h from Linux.)"
12800 case "$stdio_ptr" in
12801 '') stdio_ptr='((fp)->_IO_read_ptr)'
12804 *) ptr_lval=$d_stdio_ptr_lval;;
12806 case "$stdio_cnt" in
12807 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12810 *) cnt_lval=$d_stdio_cnt_lval;;
12812 case "$stdio_base" in
12813 '') stdio_base='((fp)->_IO_read_base)';;
12815 case "$stdio_bufsiz" in
12816 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12819 case "$stdio_ptr" in
12820 '') stdio_ptr='((fp)->_ptr)'
12823 *) ptr_lval=$d_stdio_ptr_lval;;
12825 case "$stdio_cnt" in
12826 '') stdio_cnt='((fp)->_cnt)'
12829 *) cnt_lval=$d_stdio_cnt_lval;;
12831 case "$stdio_base" in
12832 '') stdio_base='((fp)->_base)';;
12834 case "$stdio_bufsiz" in
12835 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12839 : test whether _ptr and _cnt really work
12840 echo "Checking how std your stdio is..." >&4
12843 #$i_stdlib I_STDLIB
12845 #include <stdlib.h>
12847 #define FILE_ptr(fp) $stdio_ptr
12848 #define FILE_cnt(fp) $stdio_cnt
12850 FILE *fp = fopen("try.c", "r");
12853 18 <= FILE_cnt(fp) &&
12854 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12862 if eval $compile && $to try.c; then
12863 if $run ./try; then
12864 echo "Your stdio acts pretty std."
12867 echo "Your stdio isn't very std."
12870 echo "Your stdio doesn't appear very std."
12874 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12875 # direct buffer manipulation no longer works. The Configure tests
12876 # should be changed to correctly detect this, but until then,
12877 # the following check should at least let perl compile and run.
12878 # (This quick fix should be updated before 5.8.1.)
12879 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12880 # A. Dougherty, June 3, 2002.
12881 case "$d_gnulibc" in
12883 case "$gnulibc_version" in
12887 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12896 : Can _ptr be used as an lvalue?
12897 case "$d_stdstdio$ptr_lval" in
12898 $define$define) val=$define ;;
12901 set d_stdio_ptr_lval
12904 : Can _cnt be used as an lvalue?
12905 case "$d_stdstdio$cnt_lval" in
12906 $define$define) val=$define ;;
12909 set d_stdio_cnt_lval
12913 : test whether setting _ptr sets _cnt as a side effect
12914 d_stdio_ptr_lval_sets_cnt="$undef"
12915 d_stdio_ptr_lval_nochange_cnt="$undef"
12916 case "$d_stdio_ptr_lval$d_stdstdio" in
12918 echo "Checking to see what happens if we set the stdio ptr..." >&4
12921 /* Can we scream? */
12922 /* Eat dust sed :-) */
12923 /* In the buffer space, no one can hear you scream. */
12924 #$i_stdlib I_STDLIB
12926 #include <stdlib.h>
12928 #define FILE_ptr(fp) $stdio_ptr
12929 #define FILE_cnt(fp) $stdio_cnt
12930 #include <sys/types.h>
12932 FILE *fp = fopen("try.c", "r");
12937 puts("Fail even to read");
12940 c = getc(fp); /* Read away the first # */
12942 puts("Fail even to read");
12946 18 <= FILE_cnt(fp) &&
12947 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12949 puts("Fail even to read");
12952 ptr = (char*) FILE_ptr(fp);
12953 cnt = (size_t)FILE_cnt(fp);
12955 FILE_ptr(fp) += 42;
12957 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12958 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12961 if (FILE_cnt(fp) <= 20) {
12962 printf ("Fail (<20 chars to test)");
12965 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12966 puts("Fail compare");
12969 if (cnt == FILE_cnt(fp)) {
12970 puts("Pass_unchanged");
12973 if (FILE_cnt(fp) == (cnt - 42)) {
12974 puts("Pass_changed");
12977 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12983 if eval $compile && $to try.c; then
12984 case `$run ./try` in
12986 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12987 d_stdio_ptr_lval_sets_cnt="$define" ;;
12989 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12990 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12992 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12994 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12997 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
13003 : see if _base is also standard
13005 case "$d_stdstdio" in
13009 #$i_stdlib I_STDLIB
13011 #include <stdlib.h>
13013 #define FILE_base(fp) $stdio_base
13014 #define FILE_bufsiz(fp) $stdio_bufsiz
13016 FILE *fp = fopen("try.c", "r");
13019 19 <= FILE_bufsiz(fp) &&
13020 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
13027 if eval $compile && $to try.c; then
13028 if $run ./try; then
13029 echo "And its _base field acts std."
13032 echo "But its _base field isn't std."
13035 echo "However, it seems to be lacking the _base field."
13043 : see if fast_stdio exists
13045 case "$d_stdstdio:$d_stdio_ptr_lval" in
13047 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
13049 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
13060 : see if fchdir exists
13061 set fchdir d_fchdir
13064 : see if fchmod exists
13065 set fchmod d_fchmod
13068 : see if fchown exists
13069 set fchown d_fchown
13072 : see if this is an fcntl system
13076 : See if fcntl-based locking works.
13079 #$i_stdlib I_STDLIB
13081 #include <stdlib.h>
13083 #include <unistd.h>
13085 #include <signal.h>
13086 $signal_t blech(int x) { exit(3); }
13088 #if defined(F_SETLK) && defined(F_SETLKW)
13089 struct flock flock;
13091 fd = open("try.c", O_RDONLY);
13092 flock.l_type = F_RDLCK;
13093 flock.l_whence = SEEK_SET;
13094 flock.l_start = flock.l_len = 0;
13095 signal(SIGALRM, blech);
13097 retval = fcntl(fd, F_SETLK, &flock);
13099 (retval < 0 ? exit(2) : exit(0));
13105 echo "Checking if fcntl-based file locking works... "
13109 if eval $compile_ok; then
13110 if $run ./try; then
13111 echo "Yes, it seems to work."
13114 echo "Nope, it didn't work."
13119 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13120 *** This is (almost) impossible.
13121 *** If your NFS lock daemons are not feeling well, something like
13122 *** this may happen, please investigate. Cannot continue, aborting.
13130 echo "I'm unable to compile the test program, so I'll assume not."
13135 echo "Nope, since you don't even have fcntl()."
13138 set d_fcntl_can_lock
13142 : check for fd_set items
13145 Checking to see how well your C compiler handles fd_set and friends ...
13148 #$i_stdlib I_STDLIB
13150 #include <stdlib.h>
13152 #$i_systime I_SYS_TIME
13153 #$i_sysselct I_SYS_SELECT
13154 #$d_socket HAS_SOCKET
13155 #include <sys/types.h>
13157 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13160 #include <sys/time.h>
13162 #ifdef I_SYS_SELECT
13163 #include <sys/select.h>
13172 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13180 if eval $compile; then
13181 d_fds_bits="$define"
13183 echo "Well, your system knows about the normal fd_set typedef..." >&4
13184 if $run ./try; then
13185 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13186 d_fd_macros="$define"
13189 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13191 d_fd_macros="$undef"
13195 Hmm, your compiler has some difficulty with fd_set. Checking further...
13198 if eval $compile; then
13199 d_fds_bits="$undef"
13201 echo "Well, your system has some sort of fd_set available..." >&4
13202 if $run ./try; then
13203 echo "and you have the normal fd_set macros." >&4
13204 d_fd_macros="$define"
13207 but not the normal fd_set macros! Gross! More work for me...
13209 d_fd_macros="$undef"
13212 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13214 d_fds_bits="$undef"
13215 d_fd_macros="$undef"
13220 : see if fgetpos exists
13221 set fgetpos d_fgetpos
13224 : see if finite exists
13225 set finite d_finite
13228 : see if finitel exists
13229 set finitel d_finitel
13232 : see if flock exists
13236 : see if prototype for flock is available
13238 set d_flockproto flock $i_sysfile sys/file.h
13241 : see if fp_class exists
13242 set fp_class d_fp_class
13245 : see if pathconf exists
13246 set pathconf d_pathconf
13249 : see if fpathconf exists
13250 set fpathconf d_fpathconf
13253 : see if fpclass exists
13254 set fpclass d_fpclass
13257 : see if fpclassify exists
13258 set fpclassify d_fpclassify
13261 : see if fpclassl exists
13262 set fpclassl d_fpclassl
13265 : check for fpos64_t
13267 echo "Checking to see if you have fpos64_t..." >&4
13270 int main() { fpos64_t x = 7; }
13273 if eval $compile; then
13275 echo "You have fpos64_t."
13278 echo "You do not have fpos64_t."
13279 case "$fpossize" in
13280 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13287 : see if frexpl exists
13288 set frexpl d_frexpl
13291 : see if this is a sys/param system
13292 set sys/param.h i_sysparam
13295 : see if this is a sys/mount.h system
13296 set sys/mount.h i_sysmount
13299 : Check for fs_data_s
13301 echo "Checking to see if your system supports struct fs_data..." >&4
13302 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13304 case "$d_fs_data_s" in
13305 "$define") echo "Yes, it does." ;;
13306 *) echo "No, it doesn't." ;;
13309 : see if fseeko exists
13310 set fseeko d_fseeko
13312 case "$longsize" in
13313 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13316 : see if fsetpos exists
13317 set fsetpos d_fsetpos
13320 : see if fstatfs exists
13321 set fstatfs d_fstatfs
13324 : see if statvfs exists
13325 set statvfs d_statvfs
13328 : see if fstatvfs exists
13329 set fstatvfs d_fstatvfs
13333 : see if fsync exists
13337 : see if ftello exists
13338 set ftello d_ftello
13340 case "$longsize" in
13341 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13344 : check for a working futimes
13347 echo "Checking if you have a working futimes()" >&4
13350 #include <sys/time.h>
13357 fd = open ("try.c", O_RDWR);
13358 if (-1 == fd) exit (1);
13359 rv = futimes (fd, NULL);
13360 exit (rv == -1 ? errno : 0);
13364 if eval $compile; then
13368 0) echo "Yes, you have" >&4
13369 d_futimes="$define"
13371 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13375 echo "No, it does not (probably harmless)" >&4
13379 : see if ndbm.h is available
13382 : Compatibility location for RedHat 7.1
13383 set gdbm/ndbm.h i_gdbmndbm
13385 : Compatibility location for Debian 4.0
13386 set gdbm-ndbm.h i_gdbm_ndbm
13390 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
13391 : see if dbm_open exists
13392 set dbm_open d_dbm_open
13394 case "$d_dbm_open" in
13397 i_gdbmndbm="$undef"
13398 i_gdbm_ndbm="$undef"
13399 echo "We won't be including <ndbm.h>"
13409 ndbm_hdr_protochk='name=$1; hdr=$2;
13410 eval "ihdr=\$""i_$name";
13412 if $test "$ihdr" = "$define"; then
13413 $echo "Checking if your <$hdr> uses prototypes..." >&4;
13414 case "$d_cplusplus" in
13415 $define) ./protochk "$extern_C void dbm_close(DBM *);" literal "extern \"C\" {" $ihdr $hdr literal "}" && val="$define" ;;
13416 *) ./protochk "$extern_C void dbm_close(int, int);" $ihdr $hdr || val="$define" ;;
13419 $define) $echo "Your <$hdr> seems to have prototypes";;
13420 *) $echo "Your <$hdr> does not seem to have prototypes";;
13423 set "d_${name}_h_uses_prototypes";
13427 eval $ndbm_hdr_protochk
13428 set gdbmndbm gdbm/ndbm.h
13429 eval $ndbm_hdr_protochk
13430 set gdbm_ndbm gdbm-ndbm.h
13431 eval $ndbm_hdr_protochk
13433 : see if getaddrinfo exists
13434 set getaddrinfo d_getaddrinfo
13437 : see if getcwd exists
13438 set getcwd d_getcwd
13441 : see if getespwnam exists
13442 set getespwnam d_getespwnam
13445 : see if getfsstat exists
13446 set getfsstat d_getfsstat
13449 : see if getgrent exists
13450 set getgrent d_getgrent
13453 : see if getgrent_r exists
13454 set getgrent_r d_getgrent_r
13456 case "$d_getgrent_r" in
13458 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13459 case "$d_getgrent_r_proto:$usethreads" in
13460 ":define") d_getgrent_r_proto=define
13461 set d_getgrent_r_proto getgrent_r $hdrs
13465 case "$d_getgrent_r_proto" in
13467 case "$getgrent_r_proto" in
13468 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13469 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13471 case "$getgrent_r_proto" in
13472 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13473 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13475 case "$getgrent_r_proto" in
13476 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13477 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13479 case "$getgrent_r_proto" in
13480 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13481 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13483 case "$getgrent_r_proto" in
13484 ''|0) try='int getgrent_r(struct group*, char*, int);'
13485 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13487 case "$getgrent_r_proto" in
13488 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13489 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13491 case "$getgrent_r_proto" in
13492 ''|0) d_getgrent_r=undef
13494 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13495 * ) case "$getgrent_r_proto" in
13496 REENTRANT_PROTO*) ;;
13497 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13499 echo "Prototype: $try" ;;
13502 *) case "$usethreads" in
13503 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13510 *) getgrent_r_proto=0
13514 : see if getgrgid_r exists
13515 set getgrgid_r d_getgrgid_r
13517 case "$d_getgrgid_r" in
13519 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13520 case "$d_getgrgid_r_proto:$usethreads" in
13521 ":define") d_getgrgid_r_proto=define
13522 set d_getgrgid_r_proto getgrgid_r $hdrs
13526 case "$d_getgrgid_r_proto" in
13528 case "$getgrgid_r_proto" in
13529 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13530 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13532 case "$getgrgid_r_proto" in
13533 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13534 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13536 case "$getgrgid_r_proto" in
13537 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13538 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13540 case "$getgrgid_r_proto" in
13541 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13542 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13544 case "$getgrgid_r_proto" in
13545 ''|0) d_getgrgid_r=undef
13547 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13548 * ) case "$getgrgid_r_proto" in
13549 REENTRANT_PROTO*) ;;
13550 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13552 echo "Prototype: $try" ;;
13555 *) case "$usethreads" in
13556 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13563 *) getgrgid_r_proto=0
13567 : see if getgrnam_r exists
13568 set getgrnam_r d_getgrnam_r
13570 case "$d_getgrnam_r" in
13572 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13573 case "$d_getgrnam_r_proto:$usethreads" in
13574 ":define") d_getgrnam_r_proto=define
13575 set d_getgrnam_r_proto getgrnam_r $hdrs
13579 case "$d_getgrnam_r_proto" in
13581 case "$getgrnam_r_proto" in
13582 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13583 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13585 case "$getgrnam_r_proto" in
13586 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13587 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13589 case "$getgrnam_r_proto" in
13590 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13591 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13593 case "$getgrnam_r_proto" in
13594 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13595 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13597 case "$getgrnam_r_proto" in
13598 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13599 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13601 case "$getgrnam_r_proto" in
13602 ''|0) d_getgrnam_r=undef
13604 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13605 * ) case "$getgrnam_r_proto" in
13606 REENTRANT_PROTO*) ;;
13607 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13609 echo "Prototype: $try" ;;
13612 *) case "$usethreads" in
13613 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13620 *) getgrnam_r_proto=0
13624 : see if gethostbyaddr exists
13625 set gethostbyaddr d_gethbyaddr
13628 : see if gethostbyname exists
13629 set gethostbyname d_gethbyname
13632 : see if gethostent exists
13633 set gethostent d_gethent
13636 : see how we will look up host name
13639 if set gethostname val -f d_gethname; eval $csym; $val; then
13640 echo 'gethostname() found.' >&4
13641 d_gethname="$define"
13644 if set uname val -f d_uname; eval $csym; $val; then
13647 uname() was found, but you're running xenix, and older versions of xenix
13648 have a broken uname(). If you don't really know whether your xenix is old
13649 enough to have a broken system call, use the default answer.
13654 "$define") dflt=n;;
13656 rp='Is your uname() broken?'
13659 n*) d_uname="$define"; call=uname;;
13662 echo 'uname() found.' >&4
13669 case "$d_gethname" in
13670 '') d_gethname="$undef";;
13673 '') d_uname="$undef";;
13675 case "$d_uname$d_gethname" in
13680 Every now and then someone has a $call() that lies about the hostname
13681 but can't be fixed for political or economic reasons. If you wish, I can
13682 pretend $call() isn't there and maybe compute hostname at run-time
13683 thanks to the '$phostname' command.
13686 rp="Shall I ignore $call() from now on?"
13689 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13692 case "$phostname" in
13693 '') aphostname='';;
13694 *) case "$aphostname" in
13696 *) set X $phostname
13700 file=`./loc $file $file $pth`
13701 aphostname=`echo $file $*`
13706 case "$d_uname$d_gethname" in
13709 case "$phostname" in
13711 echo "There will be no way for $package to get your hostname." >&4;;
13713 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13717 case "$d_phostname" in
13718 '') d_phostname="$undef";;
13721 : see if gethostbyaddr_r exists
13722 set gethostbyaddr_r d_gethostbyaddr_r
13724 case "$d_gethostbyaddr_r" in
13726 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13727 case "$d_gethostbyaddr_r_proto:$usethreads" in
13728 ":define") d_gethostbyaddr_r_proto=define
13729 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13733 case "$d_gethostbyaddr_r_proto" in
13735 case "$gethostbyaddr_r_proto" in
13736 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13737 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13739 case "$gethostbyaddr_r_proto" in
13740 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13741 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13743 case "$gethostbyaddr_r_proto" in
13744 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13745 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13747 case "$gethostbyaddr_r_proto" in
13748 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13749 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13751 case "$gethostbyaddr_r_proto" in
13752 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13753 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13755 case "$gethostbyaddr_r_proto" in
13756 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13757 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13759 case "$gethostbyaddr_r_proto" in
13760 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13761 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13763 case "$gethostbyaddr_r_proto" in
13764 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13765 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13767 case "$gethostbyaddr_r_proto" in
13768 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13769 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13771 case "$gethostbyaddr_r_proto" in
13772 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13773 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13775 case "$gethostbyaddr_r_proto" in
13776 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13777 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13779 case "$gethostbyaddr_r_proto" in
13780 ''|0) d_gethostbyaddr_r=undef
13781 gethostbyaddr_r_proto=0
13782 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13783 * ) case "$gethostbyaddr_r_proto" in
13784 REENTRANT_PROTO*) ;;
13785 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13787 echo "Prototype: $try" ;;
13790 *) case "$usethreads" in
13791 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13793 d_gethostbyaddr_r=undef
13794 gethostbyaddr_r_proto=0
13798 *) gethostbyaddr_r_proto=0
13802 : see if gethostbyname_r exists
13803 set gethostbyname_r d_gethostbyname_r
13805 case "$d_gethostbyname_r" in
13807 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13808 case "$d_gethostbyname_r_proto:$usethreads" in
13809 ":define") d_gethostbyname_r_proto=define
13810 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13814 case "$d_gethostbyname_r_proto" in
13816 case "$gethostbyname_r_proto" in
13817 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13818 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13820 case "$gethostbyname_r_proto" in
13821 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13822 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13824 case "$gethostbyname_r_proto" in
13825 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13826 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13828 case "$gethostbyname_r_proto" in
13829 ''|0) d_gethostbyname_r=undef
13830 gethostbyname_r_proto=0
13831 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13832 * ) case "$gethostbyname_r_proto" in
13833 REENTRANT_PROTO*) ;;
13834 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13836 echo "Prototype: $try" ;;
13839 *) case "$usethreads" in
13840 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13842 d_gethostbyname_r=undef
13843 gethostbyname_r_proto=0
13847 *) gethostbyname_r_proto=0
13851 : see if gethostent_r exists
13852 set gethostent_r d_gethostent_r
13854 case "$d_gethostent_r" in
13856 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13857 case "$d_gethostent_r_proto:$usethreads" in
13858 ":define") d_gethostent_r_proto=define
13859 set d_gethostent_r_proto gethostent_r $hdrs
13863 case "$d_gethostent_r_proto" in
13865 case "$gethostent_r_proto" in
13866 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13867 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13869 case "$gethostent_r_proto" in
13870 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13871 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13873 case "$gethostent_r_proto" in
13874 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13875 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13877 case "$gethostent_r_proto" in
13878 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13879 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
13881 case "$gethostent_r_proto" in
13882 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13883 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
13885 case "$gethostent_r_proto" in
13886 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13887 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
13889 case "$gethostent_r_proto" in
13890 ''|0) d_gethostent_r=undef
13891 gethostent_r_proto=0
13892 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13893 * ) case "$gethostent_r_proto" in
13894 REENTRANT_PROTO*) ;;
13895 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13897 echo "Prototype: $try" ;;
13900 *) case "$usethreads" in
13901 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13903 d_gethostent_r=undef
13904 gethostent_r_proto=0
13908 *) gethostent_r_proto=0
13912 : see if prototypes for various gethostxxx netdb.h functions are available
13914 set d_gethostprotos gethostent $i_netdb netdb.h
13917 : see if getitimer exists
13918 set getitimer d_getitimer
13921 : see if getlogin exists
13922 set getlogin d_getlogin
13925 : see if getlogin_r exists
13926 set getlogin_r d_getlogin_r
13928 case "$d_getlogin_r" in
13930 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13931 case "$d_getlogin_r_proto:$usethreads" in
13932 ":define") d_getlogin_r_proto=define
13933 set d_getlogin_r_proto getlogin_r $hdrs
13937 case "$d_getlogin_r_proto" in
13939 case "$getlogin_r_proto" in
13940 ''|0) try='int getlogin_r(char*, size_t);'
13941 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
13943 case "$getlogin_r_proto" in
13944 ''|0) try='int getlogin_r(char*, int);'
13945 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
13947 case "$getlogin_r_proto" in
13948 ''|0) try='char* getlogin_r(char*, size_t);'
13949 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
13951 case "$getlogin_r_proto" in
13952 ''|0) try='char* getlogin_r(char*, int);'
13953 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
13955 case "$getlogin_r_proto" in
13956 ''|0) d_getlogin_r=undef
13958 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13959 * ) case "$getlogin_r_proto" in
13960 REENTRANT_PROTO*) ;;
13961 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13963 echo "Prototype: $try" ;;
13966 *) case "$usethreads" in
13967 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13974 *) getlogin_r_proto=0
13978 : see if getmnt exists
13979 set getmnt d_getmnt
13982 : see if getmntent exists
13983 set getmntent d_getmntent
13986 : see if getnameinfo exists
13987 set getnameinfo d_getnameinfo
13990 : see if getnetbyaddr exists
13991 set getnetbyaddr d_getnbyaddr
13994 : see if getnetbyname exists
13995 set getnetbyname d_getnbyname
13998 : see if getnetent exists
13999 set getnetent d_getnent
14002 : see if getnetbyaddr_r exists
14003 set getnetbyaddr_r d_getnetbyaddr_r
14005 case "$d_getnetbyaddr_r" in
14007 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14008 case "$d_getnetbyaddr_r_proto:$usethreads" in
14009 ":define") d_getnetbyaddr_r_proto=define
14010 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
14014 case "$d_getnetbyaddr_r_proto" in
14016 case "$getnetbyaddr_r_proto" in
14017 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
14018 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
14020 case "$getnetbyaddr_r_proto" in
14021 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
14022 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
14024 case "$getnetbyaddr_r_proto" in
14025 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
14026 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
14028 case "$getnetbyaddr_r_proto" in
14029 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
14030 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
14032 case "$getnetbyaddr_r_proto" in
14033 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
14034 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
14036 case "$getnetbyaddr_r_proto" in
14037 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
14038 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
14040 case "$getnetbyaddr_r_proto" in
14041 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
14042 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
14044 case "$getnetbyaddr_r_proto" in
14045 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
14046 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
14048 case "$getnetbyaddr_r_proto" in
14049 ''|0) d_getnetbyaddr_r=undef
14050 getnetbyaddr_r_proto=0
14051 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
14052 * ) case "$getnetbyaddr_r_proto" in
14053 REENTRANT_PROTO*) ;;
14054 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
14056 echo "Prototype: $try" ;;
14059 *) case "$usethreads" in
14060 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
14062 d_getnetbyaddr_r=undef
14063 getnetbyaddr_r_proto=0
14067 *) getnetbyaddr_r_proto=0
14071 : see if getnetbyname_r exists
14072 set getnetbyname_r d_getnetbyname_r
14074 case "$d_getnetbyname_r" in
14076 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14077 case "$d_getnetbyname_r_proto:$usethreads" in
14078 ":define") d_getnetbyname_r_proto=define
14079 set d_getnetbyname_r_proto getnetbyname_r $hdrs
14083 case "$d_getnetbyname_r_proto" in
14085 case "$getnetbyname_r_proto" in
14086 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
14087 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
14089 case "$getnetbyname_r_proto" in
14090 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
14091 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
14093 case "$getnetbyname_r_proto" in
14094 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
14095 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
14097 case "$getnetbyname_r_proto" in
14098 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
14099 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
14101 case "$getnetbyname_r_proto" in
14102 ''|0) d_getnetbyname_r=undef
14103 getnetbyname_r_proto=0
14104 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
14105 * ) case "$getnetbyname_r_proto" in
14106 REENTRANT_PROTO*) ;;
14107 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
14109 echo "Prototype: $try" ;;
14112 *) case "$usethreads" in
14113 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
14115 d_getnetbyname_r=undef
14116 getnetbyname_r_proto=0
14120 *) getnetbyname_r_proto=0
14124 : see if getnetent_r exists
14125 set getnetent_r d_getnetent_r
14127 case "$d_getnetent_r" in
14129 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14130 case "$d_getnetent_r_proto:$usethreads" in
14131 ":define") d_getnetent_r_proto=define
14132 set d_getnetent_r_proto getnetent_r $hdrs
14136 case "$d_getnetent_r_proto" in
14138 case "$getnetent_r_proto" in
14139 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
14140 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
14142 case "$getnetent_r_proto" in
14143 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
14144 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
14146 case "$getnetent_r_proto" in
14147 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
14148 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
14150 case "$getnetent_r_proto" in
14151 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
14152 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
14154 case "$getnetent_r_proto" in
14155 ''|0) try='int getnetent_r(struct netent*, char*, int);'
14156 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
14158 case "$getnetent_r_proto" in
14159 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14160 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14162 case "$getnetent_r_proto" in
14163 ''|0) d_getnetent_r=undef
14164 getnetent_r_proto=0
14165 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14166 * ) case "$getnetent_r_proto" in
14167 REENTRANT_PROTO*) ;;
14168 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14170 echo "Prototype: $try" ;;
14173 *) case "$usethreads" in
14174 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14176 d_getnetent_r=undef
14177 getnetent_r_proto=0
14181 *) getnetent_r_proto=0
14185 : see if prototypes for various getnetxxx netdb.h functions are available
14187 set d_getnetprotos getnetent $i_netdb netdb.h
14190 : see if getpagesize exists
14191 set getpagesize d_getpagsz
14194 : Optional checks for getprotobyname and getprotobynumber
14196 : see if getprotobyname exists
14197 set getprotobyname d_getpbyname
14200 : see if getprotobynumber exists
14201 set getprotobynumber d_getpbynumber
14204 : see if getprotoent exists
14205 set getprotoent d_getpent
14208 : see if getpgid exists
14209 set getpgid d_getpgid
14212 : see if getpgrp2 exists
14213 set getpgrp2 d_getpgrp2
14216 : see if getppid exists
14217 set getppid d_getppid
14220 : see if getpriority exists
14221 set getpriority d_getprior
14224 : see if getprotobyname_r exists
14225 set getprotobyname_r d_getprotobyname_r
14227 case "$d_getprotobyname_r" in
14229 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14230 case "$d_getprotobyname_r_proto:$usethreads" in
14231 ":define") d_getprotobyname_r_proto=define
14232 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14236 case "$d_getprotobyname_r_proto" in
14238 case "$getprotobyname_r_proto" in
14239 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14240 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14242 case "$getprotobyname_r_proto" in
14243 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14244 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14246 case "$getprotobyname_r_proto" in
14247 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14248 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14250 case "$getprotobyname_r_proto" in
14251 ''|0) d_getprotobyname_r=undef
14252 getprotobyname_r_proto=0
14253 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14254 * ) case "$getprotobyname_r_proto" in
14255 REENTRANT_PROTO*) ;;
14256 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14258 echo "Prototype: $try" ;;
14261 *) case "$usethreads" in
14262 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14264 d_getprotobyname_r=undef
14265 getprotobyname_r_proto=0
14269 *) getprotobyname_r_proto=0
14273 : see if getprotobynumber_r exists
14274 set getprotobynumber_r d_getprotobynumber_r
14276 case "$d_getprotobynumber_r" in
14278 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14279 case "$d_getprotobynumber_r_proto:$usethreads" in
14280 ":define") d_getprotobynumber_r_proto=define
14281 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14285 case "$d_getprotobynumber_r_proto" in
14287 case "$getprotobynumber_r_proto" in
14288 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14289 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14291 case "$getprotobynumber_r_proto" in
14292 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14293 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14295 case "$getprotobynumber_r_proto" in
14296 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14297 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14299 case "$getprotobynumber_r_proto" in
14300 ''|0) d_getprotobynumber_r=undef
14301 getprotobynumber_r_proto=0
14302 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14303 * ) case "$getprotobynumber_r_proto" in
14304 REENTRANT_PROTO*) ;;
14305 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14307 echo "Prototype: $try" ;;
14310 *) case "$usethreads" in
14311 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14313 d_getprotobynumber_r=undef
14314 getprotobynumber_r_proto=0
14318 *) getprotobynumber_r_proto=0
14322 : see if getprotoent_r exists
14323 set getprotoent_r d_getprotoent_r
14325 case "$d_getprotoent_r" in
14327 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14328 case "$d_getprotoent_r_proto:$usethreads" in
14329 ":define") d_getprotoent_r_proto=define
14330 set d_getprotoent_r_proto getprotoent_r $hdrs
14334 case "$d_getprotoent_r_proto" in
14336 case "$getprotoent_r_proto" in
14337 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14338 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14340 case "$getprotoent_r_proto" in
14341 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14342 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14344 case "$getprotoent_r_proto" in
14345 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14346 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14348 case "$getprotoent_r_proto" in
14349 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14350 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14352 case "$getprotoent_r_proto" in
14353 ''|0) d_getprotoent_r=undef
14354 getprotoent_r_proto=0
14355 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14356 * ) case "$getprotoent_r_proto" in
14357 REENTRANT_PROTO*) ;;
14358 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14360 echo "Prototype: $try" ;;
14363 *) case "$usethreads" in
14364 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14366 d_getprotoent_r=undef
14367 getprotoent_r_proto=0
14371 *) getprotoent_r_proto=0
14375 : see if prototypes for various getprotoxxx netdb.h functions are available
14377 set d_getprotoprotos getprotoent $i_netdb netdb.h
14380 : see if getprpwnam exists
14381 set getprpwnam d_getprpwnam
14384 : see if getpwent exists
14385 set getpwent d_getpwent
14388 : see if getpwent_r exists
14389 set getpwent_r d_getpwent_r
14391 case "$d_getpwent_r" in
14393 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14394 case "$d_getpwent_r_proto:$usethreads" in
14395 ":define") d_getpwent_r_proto=define
14396 set d_getpwent_r_proto getpwent_r $hdrs
14400 case "$d_getpwent_r_proto" in
14402 case "$getpwent_r_proto" in
14403 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14404 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14406 case "$getpwent_r_proto" in
14407 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14408 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14410 case "$getpwent_r_proto" in
14411 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14412 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14414 case "$getpwent_r_proto" in
14415 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14416 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14418 case "$getpwent_r_proto" in
14419 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14420 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14422 case "$getpwent_r_proto" in
14423 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14424 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14426 case "$getpwent_r_proto" in
14427 ''|0) d_getpwent_r=undef
14429 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14430 * ) case "$getpwent_r_proto" in
14431 REENTRANT_PROTO*) ;;
14432 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14434 echo "Prototype: $try" ;;
14437 *) case "$usethreads" in
14438 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14445 *) getpwent_r_proto=0
14449 : see if getpwnam_r exists
14450 set getpwnam_r d_getpwnam_r
14452 case "$d_getpwnam_r" in
14454 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14455 case "$d_getpwnam_r_proto:$usethreads" in
14456 ":define") d_getpwnam_r_proto=define
14457 set d_getpwnam_r_proto getpwnam_r $hdrs
14461 case "$d_getpwnam_r_proto" in
14463 case "$getpwnam_r_proto" in
14464 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14465 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14467 case "$getpwnam_r_proto" in
14468 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14469 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14471 case "$getpwnam_r_proto" in
14472 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14473 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14475 case "$getpwnam_r_proto" in
14476 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14477 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14479 case "$getpwnam_r_proto" in
14480 ''|0) d_getpwnam_r=undef
14482 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14483 * ) case "$getpwnam_r_proto" in
14484 REENTRANT_PROTO*) ;;
14485 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14487 echo "Prototype: $try" ;;
14490 *) case "$usethreads" in
14491 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14498 *) getpwnam_r_proto=0
14502 : see if getpwuid_r exists
14503 set getpwuid_r d_getpwuid_r
14505 case "$d_getpwuid_r" in
14507 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14508 case "$d_getpwuid_r_proto:$usethreads" in
14509 ":define") d_getpwuid_r_proto=define
14510 set d_getpwuid_r_proto getpwuid_r $hdrs
14514 case "$d_getpwuid_r_proto" in
14516 case "$getpwuid_r_proto" in
14517 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14518 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14520 case "$getpwuid_r_proto" in
14521 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14522 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14524 case "$getpwuid_r_proto" in
14525 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14526 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14528 case "$getpwuid_r_proto" in
14529 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14530 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14532 case "$getpwuid_r_proto" in
14533 ''|0) d_getpwuid_r=undef
14535 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14536 * ) case "$getpwuid_r_proto" in
14537 REENTRANT_PROTO*) ;;
14538 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14540 echo "Prototype: $try" ;;
14543 *) case "$usethreads" in
14544 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14551 *) getpwuid_r_proto=0
14555 : Optional checks for getsbyname and getsbyport
14557 : see if getservbyname exists
14558 set getservbyname d_getsbyname
14561 : see if getservbyport exists
14562 set getservbyport d_getsbyport
14565 : see if getservent exists
14566 set getservent d_getsent
14569 : see if getservbyname_r exists
14570 set getservbyname_r d_getservbyname_r
14572 case "$d_getservbyname_r" in
14574 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14575 case "$d_getservbyname_r_proto:$usethreads" in
14576 ":define") d_getservbyname_r_proto=define
14577 set d_getservbyname_r_proto getservbyname_r $hdrs
14581 case "$d_getservbyname_r_proto" in
14583 case "$getservbyname_r_proto" in
14584 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14585 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14587 case "$getservbyname_r_proto" in
14588 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14589 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14591 case "$getservbyname_r_proto" in
14592 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14593 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14595 case "$getservbyname_r_proto" in
14596 ''|0) d_getservbyname_r=undef
14597 getservbyname_r_proto=0
14598 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14599 * ) case "$getservbyname_r_proto" in
14600 REENTRANT_PROTO*) ;;
14601 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14603 echo "Prototype: $try" ;;
14606 *) case "$usethreads" in
14607 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14609 d_getservbyname_r=undef
14610 getservbyname_r_proto=0
14614 *) getservbyname_r_proto=0
14618 : see if getservbyport_r exists
14619 set getservbyport_r d_getservbyport_r
14621 case "$d_getservbyport_r" in
14623 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14624 case "$d_getservbyport_r_proto:$usethreads" in
14625 ":define") d_getservbyport_r_proto=define
14626 set d_getservbyport_r_proto getservbyport_r $hdrs
14630 case "$d_getservbyport_r_proto" in
14632 case "$getservbyport_r_proto" in
14633 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14634 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14636 case "$getservbyport_r_proto" in
14637 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14638 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14640 case "$getservbyport_r_proto" in
14641 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14642 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14644 case "$getservbyport_r_proto" in
14645 ''|0) d_getservbyport_r=undef
14646 getservbyport_r_proto=0
14647 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14648 * ) case "$getservbyport_r_proto" in
14649 REENTRANT_PROTO*) ;;
14650 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14652 echo "Prototype: $try" ;;
14655 *) case "$usethreads" in
14656 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14658 d_getservbyport_r=undef
14659 getservbyport_r_proto=0
14663 *) getservbyport_r_proto=0
14667 : see if getservent_r exists
14668 set getservent_r d_getservent_r
14670 case "$d_getservent_r" in
14672 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14673 case "$d_getservent_r_proto:$usethreads" in
14674 ":define") d_getservent_r_proto=define
14675 set d_getservent_r_proto getservent_r $hdrs
14679 case "$d_getservent_r_proto" in
14681 case "$getservent_r_proto" in
14682 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14683 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14685 case "$getservent_r_proto" in
14686 ''|0) try='int getservent_r(struct servent*, char*, int);'
14687 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14689 case "$getservent_r_proto" in
14690 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14691 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14693 case "$getservent_r_proto" in
14694 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14695 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14697 case "$getservent_r_proto" in
14698 ''|0) d_getservent_r=undef
14699 getservent_r_proto=0
14700 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14701 * ) case "$getservent_r_proto" in
14702 REENTRANT_PROTO*) ;;
14703 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14705 echo "Prototype: $try" ;;
14708 *) case "$usethreads" in
14709 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14711 d_getservent_r=undef
14712 getservent_r_proto=0
14716 *) getservent_r_proto=0
14720 : see if prototypes for various getservxxx netdb.h functions are available
14722 set d_getservprotos getservent $i_netdb netdb.h
14725 : see if getspnam exists
14726 set getspnam d_getspnam
14729 : see if this is a shadow.h system
14730 set shadow.h i_shadow
14733 : see if getspnam_r exists
14734 set getspnam_r d_getspnam_r
14736 case "$d_getspnam_r" in
14738 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14739 case "$d_getspnam_r_proto:$usethreads" in
14740 ":define") d_getspnam_r_proto=define
14741 set d_getspnam_r_proto getspnam_r $hdrs
14745 case "$d_getspnam_r_proto" in
14747 case "$getspnam_r_proto" in
14748 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14749 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14751 case "$getspnam_r_proto" in
14752 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14753 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14755 case "$getspnam_r_proto" in
14756 ''|0) d_getspnam_r=undef
14758 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14759 * ) case "$getspnam_r_proto" in
14760 REENTRANT_PROTO*) ;;
14761 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14763 echo "Prototype: $try" ;;
14766 *) case "$usethreads" in
14767 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14774 *) getspnam_r_proto=0
14778 : see if gettimeofday or ftime exists
14779 set gettimeofday d_gettimeod
14781 case "$d_gettimeod" in
14787 val="$undef"; set d_ftime; eval $setvar
14790 case "$d_gettimeod$d_ftime" in
14793 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14797 : see if gmtime_r exists
14798 set gmtime_r d_gmtime_r
14800 case "$d_gmtime_r" in
14802 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14803 case "$d_gmtime_r_proto:$usethreads" in
14804 ":define") d_gmtime_r_proto=define
14805 set d_gmtime_r_proto gmtime_r $hdrs
14809 case "$d_gmtime_r_proto" in
14811 case "$gmtime_r_proto" in
14812 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14813 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
14815 case "$gmtime_r_proto" in
14816 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14817 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
14819 case "$gmtime_r_proto" in
14820 ''|0) d_gmtime_r=undef
14822 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14823 * ) case "$gmtime_r_proto" in
14824 REENTRANT_PROTO*) ;;
14825 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14827 echo "Prototype: $try" ;;
14830 *) case "$usethreads" in
14831 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14838 *) gmtime_r_proto=0
14842 : see if hasmntopt exists
14843 set hasmntopt d_hasmntopt
14846 : see if this is a netinet/in.h or sys/in.h system
14847 set netinet/in.h i_niin sys/in.h i_sysin
14850 : see if arpa/inet.h has to be included
14851 set arpa/inet.h i_arpainet
14854 : see if htonl --and friends-- exists
14859 : Maybe they are macros.
14862 $cat >htonl.c <<EOM
14864 #include <sys/types.h>
14865 #$i_niin I_NETINET_IN
14867 #$i_arpainet I_ARPA_INET
14868 #ifdef I_NETINET_IN
14869 #include <netinet/in.h>
14872 #include <sys/in.h>
14875 #include <arpa/inet.h>
14878 printf("Defined as a macro.");
14881 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14882 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14884 echo "But it seems to be defined as a macro." >&4
14892 : see if ilogbl exists
14893 set ilogbl d_ilogbl
14898 if set index val -f; eval $csym; $val; then
14899 if set strchr val -f d_strchr; eval $csym; $val; then
14900 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14903 echo "strchr() found." >&4
14907 echo "index() found." >&4
14912 echo "index() found." >&4
14915 if set strchr val -f d_strchr; eval $csym; $val; then
14918 echo "strchr() found." >&4
14920 echo "No index() or strchr() found!" >&4
14925 set d_strchr; eval $setvar
14927 set d_index; eval $setvar
14929 : check whether inet_aton exists
14930 set inet_aton d_inetaton
14933 : see if inet_ntop exists
14934 set inet_ntop d_inetntop
14937 : see if inet_pton exists
14938 set inet_pton d_inetpton
14943 $cat >isascii.c <<EOCP
14946 #$i_stdlib I_STDLIB
14948 #include <stdlib.h>
14959 if eval $compile; then
14960 echo "isascii() found." >&4
14963 echo "isascii() NOT found." >&4
14970 : see if isfinite exists
14971 set isfinite d_isfinite
14974 : see if isinf exists
14978 : see if isnan exists
14982 : see if isnanl exists
14983 set isnanl d_isnanl
14986 : see if killpg exists
14987 set killpg d_killpg
14990 : see if lchown exists
14992 $cat > try.c <<'EOCP'
14993 /* System header to define __stub macros and hopefully few prototypes,
14994 which can conflict with char lchown(); below. */
14995 #include <assert.h>
14996 /* Override any gcc2 internal prototype to avoid an error. */
14997 /* We use char because int might match the return type of a gcc2
14998 builtin and then its argument prototype would still apply. */
15001 /* The GNU C library defines this for functions which it implements
15002 to always fail with ENOSYS. Some functions are actually named
15003 something starting with __ and the normal name is an alias. */
15004 #if defined (__stub_lchown) || defined (__stub___lchown)
15012 if eval $compile; then
15013 $echo "lchown() found." >&4
15016 $echo "lchown() NOT found." >&4
15022 : See if number of significant digits in a double precision number is known
15024 $cat >ldbl_dig.c <<EOM
15025 #$i_limits I_LIMITS
15028 #include <limits.h>
15034 printf("Contains LDBL_DIG");
15037 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
15038 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
15039 echo "LDBL_DIG found." >&4
15042 echo "LDBL_DIG NOT found." >&4
15049 : see if this is a math.h system
15053 : check to see if math.h defines _LIB_VERSION
15054 d_libm_lib_version="$undef"
15058 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
15060 #include <unistd.h>
15062 int main (int argc, char *argv[])
15064 printf ("%d\n", _LIB_VERSION);
15069 if eval $compile; then
15071 echo "Yes, it does ($foo)" >&4
15072 d_libm_lib_version="$define"
15074 echo "No, it does not (probably harmless)" >&4
15081 : see if link exists
15085 : see if localtime_r exists
15086 set localtime_r d_localtime_r
15088 case "$d_localtime_r" in
15090 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
15091 case "$d_localtime_r_proto:$usethreads" in
15092 ":define") d_localtime_r_proto=define
15093 set d_localtime_r_proto localtime_r $hdrs
15097 case "$d_localtime_r_proto" in
15099 case "$localtime_r_proto" in
15100 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
15101 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
15103 case "$localtime_r_proto" in
15104 ''|0) try='int localtime_r(const time_t*, struct tm*);'
15105 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
15107 case "$localtime_r_proto" in
15108 ''|0) d_localtime_r=undef
15109 localtime_r_proto=0
15110 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
15111 * ) case "$localtime_r_proto" in
15112 REENTRANT_PROTO*) ;;
15113 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
15115 echo "Prototype: $try" ;;
15118 *) case "$usethreads" in
15119 define) echo "localtime_r has no prototype, not using it." >&4 ;;
15121 d_localtime_r=undef
15122 localtime_r_proto=0
15126 *) localtime_r_proto=0
15130 : see if localtime_r calls tzset
15131 case "$localtime_r_proto" in
15134 /* Does our libc's localtime_r call tzset ?
15135 * return 0 if so, 1 otherwise.
15137 #$i_systypes I_SYS_TYPES
15138 #$i_unistd I_UNISTD
15140 #$i_stdlib I_STDLIB
15141 #$i_string I_STRING
15142 #$i_malloc I_MALLOC
15144 # include <sys/types.h>
15147 # include <unistd.h>
15153 #include <stdlib.h>
15156 # include <string.h>
15158 # include <strings.h>
15161 # include <malloc.h>
15165 time_t t = time(0L);
15166 char w_tz[]="TZ" "=GMT+5",
15167 e_tz[]="TZ" "=GMT-5",
15168 *tz_e = (char*)malloc(16),
15169 *tz_w = (char*)malloc(16);
15170 struct tm tm_e, tm_w;
15171 memset(&tm_e,'\0',sizeof(struct tm));
15172 memset(&tm_w,'\0',sizeof(struct tm));
15177 localtime_r(&t, &tm_e);
15180 localtime_r(&t, &tm_w);
15182 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15188 if eval $compile; then
15189 if $run ./try; then
15190 d_localtime_r_needs_tzset=undef;
15192 d_localtime_r_needs_tzset=define;
15195 d_localtime_r_needs_tzset=undef;
15199 d_localtime_r_needs_tzset=undef;
15204 : see if localeconv exists
15205 set localeconv d_locconv
15208 : see if lockf exists
15212 : see if prototype for lseek is available
15214 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15217 : see if lstat exists
15221 : see if madvise exists
15222 set madvise d_madvise
15225 : see if malloc_size exists
15226 set malloc_size d_malloc_size
15229 : see if malloc_size_good exists
15230 set malloc_good_size d_malloc_good_size
15233 : see if mblen exists
15237 : see if mbstowcs exists
15238 set mbstowcs d_mbstowcs
15241 : see if mbtowc exists
15242 set mbtowc d_mbtowc
15245 : see if memchr exists
15246 set memchr d_memchr
15249 : see if memcmp exists
15250 set memcmp d_memcmp
15253 : see if memcpy exists
15254 set memcpy d_memcpy
15257 : see if memmove exists
15258 set memmove d_memmove
15261 : see if memset exists
15262 set memset d_memset
15265 : see if mkdir exists
15269 : see if mkdtemp exists
15270 set mkdtemp d_mkdtemp
15273 : see if mkfifo exists
15274 set mkfifo d_mkfifo
15277 : see if mkstemp exists
15278 set mkstemp d_mkstemp
15281 : see if mkstemps exists
15282 set mkstemps d_mkstemps
15285 : see if mktime exists
15286 set mktime d_mktime
15289 : see if this is a sys/mman.h system
15290 set sys/mman.h i_sysmman
15293 : see if mmap exists
15296 : see what shmat returns
15297 : default to something harmless
15299 case "$i_sysmman$d_mmap" in
15301 $cat >mmap.c <<'END'
15302 #include <sys/mman.h>
15305 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15310 echo "and it returns ($mmaptype)." >&4
15316 : see if sqrtl exists
15320 : see if scalbnl exists
15321 set scalbnl d_scalbnl
15324 : see if modfl exists
15328 : see if prototype for modfl is available
15330 set d_modflproto modfl $i_math math.h
15333 d_modfl_pow32_bug="$undef"
15335 case "$d_longdbl$d_modfl" in
15338 Checking to see whether your modfl() is okay for large values...
15344 if $test "X$d_modflproto" != "X$define"; then
15345 $cat >>try.c <<EOCP
15346 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15347 long double modfl (long double, long double *);
15350 $cat >>try.c <<EOCP
15352 long double nv = 4294967303.15;
15358 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15362 case "$osname:$gccversion" in
15363 aix:) saveccflags="$ccflags"
15364 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15367 if eval $compile; then
15370 *" 4294967303.150000 1.150000 4294967302.000000")
15371 echo >&4 "Your modfl() is broken for large values."
15372 d_modfl_pow32_bug="$define"
15374 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15378 *" 4294967303.150000 0.150000 4294967303.000000")
15379 echo >&4 "Your modfl() seems okay for large values."
15381 *) echo >&4 "I don't understand your modfl() at all."
15387 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15390 case "$osname:$gccversion" in
15391 aix:) ccflags="$saveccflags" ;; # restore
15396 if $test "$uselongdouble" = "$define"; then
15398 if $test "$d_sqrtl" != "$define"; then
15399 message="$message sqrtl"
15401 if $test "$d_modfl" != "$define"; then
15402 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15403 echo "You have both aintl and copysignl, so I can emulate modfl."
15405 message="$message modfl"
15408 if $test "$d_frexpl" != "$define"; then
15409 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15410 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15412 message="$message frexpl"
15416 if $test "$message" != ""; then
15419 *** You requested the use of long doubles but you do not seem to have
15420 *** the following mathematical functions needed for long double support:
15422 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15423 *** Cannot continue, aborting.
15431 : see if mprotect exists
15432 set mprotect d_mprotect
15435 : see if msgctl exists
15436 set msgctl d_msgctl
15439 : see if msgget exists
15440 set msgget d_msgget
15443 : see if msgsnd exists
15444 set msgsnd d_msgsnd
15447 : see if msgrcv exists
15448 set msgrcv d_msgrcv
15451 : see how much of the 'msg*(2)' library is present.
15454 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15455 *"$undef"*) h_msg=false;;
15459 case "`ipcs 2>&1`" in
15460 "SVID messages"*"not configured"*)
15461 echo "Your $osname does not have the msg*(2) configured." >&4
15464 set msgctl d_msgctl
15466 set msgget d_msgget
15468 set msgsnd d_msgsnd
15470 set msgrcv d_msgrcv
15476 : we could also check for sys/ipc.h ...
15477 if $h_msg && $test `./findhdr sys/msg.h`; then
15478 echo "You have the full msg*(2) library." >&4
15481 echo "You don't have the full msg*(2) library." >&4
15487 : Check for msghdr_s
15489 echo "Checking to see if your system supports struct msghdr..." >&4
15490 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15492 case "$d_msghdr_s" in
15493 "$define") echo "Yes, it does." ;;
15494 *) echo "No, it doesn't." ;;
15498 : see if msync exists
15502 : see if munmap exists
15503 set munmap d_munmap
15506 : see if nice exists
15510 : see if this is a langinfo.h system
15511 set langinfo.h i_langinfo
15514 : see if nl_langinfo exists
15515 set nl_langinfo d_nl_langinfo
15518 : check for volatile keyword
15520 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15521 $cat >try.c <<'EOCP'
15524 typedef struct _goo_struct goo_struct;
15525 goo_struct * volatile goo = ((goo_struct *)0);
15526 struct _goo_struct {
15531 typedef unsigned short foo_t;
15532 char *volatile foo;
15534 volatile foo_t blech;
15538 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15540 echo "Yup, it does."
15543 echo "Nope, it doesn't."
15549 : Check basic sizes
15551 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15553 case "$use64bitint:$d_quad:$quadtype" in
15556 uvtype="$uquadtype"
15561 uvtype="unsigned long"
15567 case "$uselongdouble:$d_longdbl" in
15569 nvtype="long double"
15570 nvsize=$longdblsize
15577 $echo "(IV will be "$ivtype", $ivsize bytes)"
15578 $echo "(UV will be "$uvtype", $uvsize bytes)"
15579 $echo "(NV will be "$nvtype", $nvsize bytes)"
15582 #$i_inttypes I_INTTYPES
15584 #include <inttypes.h>
15589 int8_t i = INT8_MAX;
15590 uint8_t u = UINT8_MAX;
15591 printf("int8_t\n");
15594 int16_t i = INT16_MAX;
15595 uint16_t i = UINT16_MAX;
15596 printf("int16_t\n");
15599 int32_t i = INT32_MAX;
15600 uint32_t u = UINT32_MAX;
15601 printf("int32_t\n");
15606 i8type="signed char"
15607 u8type="unsigned char"
15612 '') case "$shortsize" in
15614 u16type="unsigned short"
15622 '') set try -DINT16
15623 if eval $compile; then
15624 case "`$run ./try`" in
15636 '') if $test $shortsize -ge 2; then
15638 u16type="unsigned short"
15646 '') case "$longsize" in
15648 u32type="unsigned long"
15652 *) case "$intsize" in
15654 u32type="unsigned int"
15664 '') set try -DINT32
15665 if eval $compile; then
15666 case "`$run ./try`" in
15678 '') if $test $intsize -ge 4; then
15680 u32type="unsigned int"
15688 '') case "$d_quad:$quadtype" in
15690 i64type="$quadtype"
15691 u64type="$uquadtype"
15699 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15700 : volatile so that the compiler has to store it out to memory.
15701 if test X"$d_volatile" = X"$define"; then
15706 #$i_stdlib I_STDLIB
15708 #include <stdlib.h>
15710 #include <sys/types.h>
15711 #include <signal.h>
15713 $volatile int bletched = 0;
15714 $signal_t blech(int s) { bletched = 1; }
15719 int n = 8 * $uvsize;
15722 signal(SIGFPE, blech);
15725 for (i = 0; i < n; i++) {
15726 u = u << 1 | ($uvtype)1;
15728 if (($uvtype)d != u)
15732 d = ($nvtype)(u - 1);
15733 if (($uvtype)d != (u - 1))
15740 printf("%d\n", ((i == n) ? -n : i));
15746 d_nv_preserves_uv="$undef"
15747 if eval $compile; then
15748 nv_preserves_uv_bits="`$run ./try`"
15750 case "$nv_preserves_uv_bits" in
15752 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15753 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15754 d_nv_preserves_uv="$define"
15756 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15757 d_nv_preserves_uv="$undef" ;;
15758 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15759 nv_preserves_uv_bits="0" ;;
15763 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15764 : volatile so that the compiler has to store it out to memory.
15765 if test X"$d_volatile" = X"$define"; then
15771 typedef $nvtype NV;
15778 while(count < 256) {
15779 $volatile NV up = value + 1.0;
15780 $volatile NV negated = -value;
15781 $volatile NV down = negated - 1.0;
15782 $volatile NV got_up = up - value;
15783 int up_good = got_up == 1.0;
15784 int got_down = down - negated;
15785 int down_good = got_down == -1.0;
15787 if (down_good != up_good) {
15789 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15790 up_good, (double) got_up, down_good, (double) got_down,
15791 count, (double) value);
15798 fputs("256.0", stdout);
15801 fputs("2.0", stdout);
15807 fputs("*", stdout);
15813 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15814 count, (double) value);
15820 nv_overflows_integers_at='0'
15821 if eval $compile; then
15827 The largest integer your NVs can preserve is equal to $xxx
15829 nv_overflows_integers_at="$xxx"
15832 Cannot determine the largest integer value your NVs can hold, unexpected output
15839 Cannot determine the largest integer value your NVs can hold
15846 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15847 : volatile so that the compiler has to store it out to memory.
15848 if test X"$d_volatile" = X"$define"; then
15853 #$i_stdlib I_STDLIB
15855 #include <stdlib.h>
15857 #$i_string I_STRING
15859 # include <string.h>
15861 # include <strings.h>
15863 #include <sys/types.h>
15864 #include <signal.h>
15866 $volatile int bletched = 0;
15867 $signal_t blech(int s) { bletched = 1; }
15870 int checkit($nvtype d, char *where) {
15871 unsigned char *p = (char *)&d;
15872 unsigned char *end = p + sizeof(d);
15882 printf("No - %s: 0x", where);
15884 printf ("%02X", *p++);
15889 int main(int argc, char **argv) {
15892 fail += checkit(d, "0.0");
15894 /* The compiler shouldn't be assuming that bletched is 0 */
15897 fail += checkit(d, "bleched");
15900 signal(SIGFPE, blech);
15903 /* Paranoia - the compiler should have no way of knowing that ANSI says
15904 that argv[argc] will always be NULL. Actually, if it did assume this it
15905 would be buggy, as this is C and main() can be called from elsewhere in
15907 d = argv[argc] ? 1 : 0;
15910 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15913 fail += checkit(d, "ternary");
15915 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15918 printf("No - memset doesn't give 0.0\n");
15919 /* This might just blow up: */
15920 printf("(gives %g)\n", d);
15926 printf("No - something bleched\n");
15931 printf("No - %d fail(s)\n", fail);
15940 d_nv_zero_is_allbits_zero="$undef"
15941 if eval $compile; then
15947 0.0 is represented as all bits zero in memory
15949 d_nv_zero_is_allbits_zero="$define"
15952 0.0 is not represented as all bits zero in memory
15954 d_nv_zero_is_allbits_zero="$undef"
15959 0.0 is not represented as all bits zero in memory
15961 d_nv_zero_is_allbits_zero="$undef"
15967 : check for off64_t
15969 echo "Checking to see if you have off64_t..." >&4
15971 #include <sys/types.h>
15972 #include <unistd.h>
15973 int main() { off64_t x = 7; }
15976 if eval $compile; then
15978 echo "You have off64_t."
15981 echo "You do not have off64_t."
15982 case "$lseeksize" in
15983 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15990 : how to create joinable pthreads
15991 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15993 echo "Checking what constant to use for creating joinable pthreads..." >&4
15994 $cat >try.c <<'EOCP'
15995 #include <pthread.h>
15997 int detachstate = JOINABLE;
16000 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
16001 if eval $compile; then
16002 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
16003 val="$undef" # Yes, undef.
16004 set d_old_pthread_create_joinable
16007 set old_pthread_create_joinable
16010 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
16011 if eval $compile; then
16012 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
16014 set d_old_pthread_create_joinable
16016 val=PTHREAD_CREATE_UNDETACHED
16017 set old_pthread_create_joinable
16020 set try -DJOINABLE=__UNDETACHED
16021 if eval $compile; then
16022 echo "You seem to use __UNDETACHED." >&4
16024 set d_old_pthread_create_joinable
16027 set old_pthread_create_joinable
16030 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
16032 set d_old_pthread_create_joinable
16035 set old_pthread_create_joinable
16042 d_old_pthread_create_joinable="$undef"
16043 old_pthread_create_joinable=""
16046 : see if pause exists
16050 : see if poll exists
16054 : see if prctl exists
16058 : see if prctl supports PR_SET_NAME
16059 d_prctl_set_name=$undef
16063 #include <sys/prctl.h>
16065 int main (int argc, char *argv[])
16067 return (prctl (PR_SET_NAME, "Test"));
16071 if eval $compile_ok && $run ./try; then
16072 echo "Your prctl (PR_SET_NAME, ...) works"
16073 d_prctl_set_name=$define
16079 : see if readlink exists
16080 set readlink d_readlink
16083 : Check if exe is symlink to abs path of executing program
16087 case "$d_readlink" in
16089 if $issymlink /proc/self/exe ; then
16090 $ls -l /proc/self/exe > reflect
16091 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16092 echo "You have Linux-like /proc/self/exe."
16093 procselfexe='"/proc/self/exe"'
16097 if $issymlink /proc/curproc/file ; then
16098 $ls -l /proc/curproc/file > reflect
16099 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
16100 echo "You have BSD-like /proc/curproc/file."
16101 procselfexe='"/proc/curproc/file"'
16111 : backward compatibility for d_hvfork
16112 if test X$d_hvfork != X; then
16113 d_vfork="$d_hvfork"
16116 : see if there is a vfork
16121 d_pseudofork=$undef
16123 : Ok, but do we want to use it. vfork is reportedly unreliable in
16124 : perl on Solaris 2.x, and probably elsewhere.
16128 case "$usevfork" in
16134 Perl can only use a vfork() that doesn't suffer from strict
16135 restrictions on calling functions or modifying global data in
16136 the child. For example, glibc-2.1 contains such a vfork()
16137 that is unsuitable. If your system provides a proper fork()
16138 call, chances are that you do NOT want perl to use vfork().
16141 rp="Do you still want to use vfork()?"
16146 echo "Ok, we won't use vfork()."
16155 $define) usevfork='true';;
16156 *) usevfork='false';;
16159 : see whether the pthread_atfork exists
16161 #include <pthread.h>
16164 #ifdef PTHREAD_ATFORK
16165 pthread_atfork(NULL,NULL,NULL);
16170 : see if pthread_atfork exists
16171 set try -DPTHREAD_ATFORK
16172 if eval $compile; then
16177 case "$usethreads" in
16180 $define) echo 'pthread_atfork found.' >&4 ;;
16181 *) echo 'pthread_atfork NOT found.' >&4 ;;
16184 set d_pthread_atfork
16187 : see if pthread_attr_setscope exists
16188 set pthread_attr_setscope d_pthread_attr_setscope
16191 : see whether the various POSIXish _yields exist
16193 #include <pthread.h>
16199 #ifdef PTHREAD_YIELD
16202 #ifdef PTHREAD_YIELD_NULL
16203 pthread_yield(NULL);
16209 : see if sched_yield exists
16210 set try -DSCHED_YIELD
16211 if eval $compile; then
16213 sched_yield='sched_yield()'
16217 case "$usethreads" in
16220 $define) echo 'sched_yield() found.' >&4 ;;
16221 *) echo 'sched_yield() NOT found.' >&4 ;;
16227 : see if pthread_yield exists
16228 set try -DPTHREAD_YIELD
16229 if eval $compile; then
16231 case "$sched_yield" in
16232 '') sched_yield='pthread_yield()' ;;
16235 set try -DPTHREAD_YIELD_NULL
16236 if eval $compile; then
16238 case "$sched_yield" in
16239 '') sched_yield='pthread_yield(NULL)' ;;
16245 case "$usethreads" in
16248 $define) echo 'pthread_yield() found.' >&4 ;;
16249 *) echo 'pthread_yield() NOT found.' >&4 ;;
16253 set d_pthread_yield
16255 case "$sched_yield" in
16256 '') sched_yield=undef ;;
16260 : see if random_r exists
16261 set random_r d_random_r
16263 case "$d_random_r" in
16265 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16266 case "$d_random_r_proto:$usethreads" in
16267 ":define") d_random_r_proto=define
16268 set d_random_r_proto random_r $hdrs
16272 case "$d_random_r_proto" in
16274 case "$random_r_proto" in
16275 ''|0) try='int random_r(int*, struct random_data*);'
16276 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16278 case "$random_r_proto" in
16279 ''|0) try='int random_r(long*, struct random_data*);'
16280 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16282 case "$random_r_proto" in
16283 ''|0) try='int random_r(struct random_data*, int32_t*);'
16284 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16286 case "$random_r_proto" in
16287 ''|0) d_random_r=undef
16289 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16290 * ) case "$random_r_proto" in
16291 REENTRANT_PROTO*) ;;
16292 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16294 echo "Prototype: $try" ;;
16297 *) case "$usethreads" in
16298 define) echo "random_r has no prototype, not using it." >&4 ;;
16305 *) random_r_proto=0
16309 : see if readdir and friends exist
16310 set readdir d_readdir
16312 set seekdir d_seekdir
16314 set telldir d_telldir
16316 set rewinddir d_rewinddir
16319 : see if readdir64_r exists
16320 set readdir64_r d_readdir64_r
16322 case "$d_readdir64_r" in
16324 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16325 case "$d_readdir64_r_proto:$usethreads" in
16326 ":define") d_readdir64_r_proto=define
16327 set d_readdir64_r_proto readdir64_r $hdrs
16331 case "$d_readdir64_r_proto" in
16333 case "$readdir64_r_proto" in
16334 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16335 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16337 case "$readdir64_r_proto" in
16338 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16339 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16341 case "$readdir64_r_proto" in
16342 ''|0) d_readdir64_r=undef
16343 readdir64_r_proto=0
16344 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16345 * ) case "$readdir64_r_proto" in
16346 REENTRANT_PROTO*) ;;
16347 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16349 echo "Prototype: $try" ;;
16352 *) case "$usethreads" in
16353 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16355 d_readdir64_r=undef
16356 readdir64_r_proto=0
16360 *) readdir64_r_proto=0
16364 : see if readdir_r exists
16365 set readdir_r d_readdir_r
16367 case "$d_readdir_r" in
16369 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16370 case "$d_readdir_r_proto:$usethreads" in
16371 ":define") d_readdir_r_proto=define
16372 set d_readdir_r_proto readdir_r $hdrs
16376 case "$d_readdir_r_proto" in
16378 case "$readdir_r_proto" in
16379 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16380 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16382 case "$readdir_r_proto" in
16383 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16384 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16386 case "$readdir_r_proto" in
16387 ''|0) d_readdir_r=undef
16389 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16390 * ) case "$readdir_r_proto" in
16391 REENTRANT_PROTO*) ;;
16392 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16394 echo "Prototype: $try" ;;
16397 *) case "$usethreads" in
16398 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16405 *) readdir_r_proto=0
16409 : see if readv exists
16413 : see if recvmsg exists
16414 set recvmsg d_recvmsg
16417 : see if rename exists
16418 set rename d_rename
16421 : see if rmdir exists
16425 : see if memory.h is available.
16430 : See if it conflicts with string.h
16436 $cppstdin $cppflags $cppminus < $strings > mem.h
16437 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16439 echo "We won't be including <memory.h>."
16449 : can bcopy handle overlapping blocks?
16452 case "$d_memmove" in
16453 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16454 *) case "$d_bcopy" in
16456 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16458 #$i_memory I_MEMORY
16459 #$i_stdlib I_STDLIB
16460 #$i_string I_STRING
16461 #$i_unistd I_UNISTD
16463 $cat >>try.c <<'EOCP'
16466 # include <memory.h>
16469 # include <stdlib.h>
16472 # include <string.h>
16474 # include <strings.h>
16477 # include <unistd.h> /* Needed for NetBSD */
16481 char buf[128], abc[128];
16487 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16488 try to store the string in read-only memory. */
16489 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16491 for (align = 7; align >= 0; align--) {
16492 for (len = 36; len; len--) {
16494 bcopy(abc, b, len);
16495 for (off = 1; off <= len; off++) {
16496 bcopy(b, b+off, len);
16497 bcopy(b+off, b, len);
16498 if (bcmp(b, abc, len))
16507 if eval $compile_ok; then
16508 if $run ./try 2>/dev/null; then
16509 echo "Yes, it can."
16512 echo "It can't, sorry."
16515 echo "(I can't compile the test program, so we'll assume not...)"
16525 : can memcpy handle overlapping blocks?
16528 case "$d_memmove" in
16529 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16530 *) case "$d_memcpy" in
16532 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16534 #$i_memory I_MEMORY
16535 #$i_stdlib I_STDLIB
16536 #$i_string I_STRING
16537 #$i_unistd I_UNISTD
16539 $cat >>try.c <<'EOCP'
16542 # include <memory.h>
16545 # include <stdlib.h>
16548 # include <string.h>
16550 # include <strings.h>
16553 # include <unistd.h> /* Needed for NetBSD */
16557 char buf[128], abc[128];
16563 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16564 try to store the string in read-only memory. */
16565 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16567 for (align = 7; align >= 0; align--) {
16568 for (len = 36; len; len--) {
16570 memcpy(b, abc, len);
16571 for (off = 1; off <= len; off++) {
16572 memcpy(b+off, b, len);
16573 memcpy(b, b+off, len);
16574 if (memcmp(b, abc, len))
16583 if eval $compile_ok; then
16584 if $run ./try 2>/dev/null; then
16585 echo "Yes, it can."
16588 echo "It can't, sorry."
16591 echo "(I can't compile the test program, so we'll assume not...)"
16601 : can memcmp be trusted to compare relative magnitude?
16603 case "$d_memcmp" in
16606 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16608 #$i_memory I_MEMORY
16609 #$i_stdlib I_STDLIB
16610 #$i_string I_STRING
16611 #$i_unistd I_UNISTD
16613 $cat >>try.c <<'EOCP'
16616 # include <memory.h>
16619 # include <stdlib.h>
16622 # include <string.h>
16624 # include <strings.h>
16627 # include <unistd.h> /* Needed for NetBSD */
16633 if ((a < b) && memcmp(&a, &b, 1) < 0)
16639 if eval $compile_ok; then
16640 if $run ./try 2>/dev/null; then
16641 echo "Yes, it can."
16644 echo "No, it can't (it uses signed chars)."
16647 echo "(I can't compile the test program, so we'll assume not...)"
16655 : see if prototype for sbrk is available
16657 set d_sbrkproto sbrk $i_unistd unistd.h
16660 : see if select exists
16661 set select d_select
16664 : see if semctl exists
16665 set semctl d_semctl
16668 : see if semget exists
16669 set semget d_semget
16672 : see if semop exists
16676 : see how much of the 'sem*(2)' library is present.
16679 case "$d_semctl$d_semget$d_semop" in
16680 *"$undef"*) h_sem=false;;
16684 case "`ipcs 2>&1`" in
16685 "SVID messages"*"not configured"*)
16686 echo "Your $osname does not have the sem*(2) configured." >&4
16689 set semctl d_semctl
16691 set semget d_semget
16699 : we could also check for sys/ipc.h ...
16700 if $h_sem && $test `./findhdr sys/sem.h`; then
16701 echo "You have the full sem*(2) library." >&4
16704 echo "You don't have the full sem*(2) library." >&4
16710 : see whether sys/sem.h defines union semun
16712 $cat > try.c <<'END'
16713 #include <sys/types.h>
16714 #include <sys/ipc.h>
16715 #include <sys/sem.h>
16716 int main () { union semun semun; semun.buf = 0; }
16719 if eval $compile; then
16720 echo "You have union semun in <sys/sem.h>." >&4
16723 echo "You do not have union semun in <sys/sem.h>." >&4
16730 : see how to do semctl IPC_STAT
16734 $cat > tryh.h <<END
16737 # define S_IRUSR S_IREAD
16738 # define S_IWUSR S_IWRITE
16739 # define S_IXUSR S_IEXEC
16741 # define S_IRUSR 0400
16742 # define S_IWUSR 0200
16743 # define S_IXUSR 0100
16745 # define S_IRGRP (S_IRUSR>>3)
16746 # define S_IWGRP (S_IWUSR>>3)
16747 # define S_IXGRP (S_IXUSR>>3)
16748 # define S_IROTH (S_IRUSR>>6)
16749 # define S_IWOTH (S_IWUSR>>6)
16750 # define S_IXOTH (S_IXUSR>>6)
16753 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16754 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16755 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16758 : see whether semctl IPC_STAT can use union semun
16759 case "$d_semctl_semun" in
16763 #include <sys/types.h>
16764 #include <sys/ipc.h>
16765 #include <sys/sem.h>
16766 #include <sys/stat.h>
16773 #$d_union_semun HAS_UNION_SEMUN
16776 #ifndef HAS_UNION_SEMUN
16779 struct semid_ds *buf;
16780 unsigned short *array;
16786 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16787 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16789 struct semid_ds argbuf;
16792 st = semctl(sem, 0, IPC_STAT, arg);
16796 # endif /* IPC_STAT */
16797 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16799 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16800 # endif /* IPC_RMID */
16801 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16803 #endif /* IPC_PRIVATE && ... */
16804 printf("semget failed: errno = %d\n", errno);
16809 if eval $compile; then
16812 semun) val="$define" ;;
16820 case "$d_semctl_semun" in
16822 echo "You can use union semun for semctl IPC_STAT." >&4
16825 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16830 : see whether semctl IPC_STAT can use struct semid_ds pointer
16831 case "$d_semctl_semid_ds" in
16834 $cat > try.c <<'END'
16835 #include <sys/types.h>
16836 #include <sys/ipc.h>
16837 #include <sys/sem.h>
16838 #include <sys/stat.h>
16846 struct semid_ds arg;
16849 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16850 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16853 st = semctl(sem, 0, IPC_STAT, &arg);
16855 printf("semid_ds\n");
16857 # endif /* IPC_STAT */
16858 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16860 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16861 # endif /* IPC_RMID */
16862 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16864 #endif /* IPC_PRIVATE && ... */
16865 printf("semget failed: errno = %d\n", errno);
16871 if eval $compile; then
16874 semid_ds) val="$define" ;;
16878 set d_semctl_semid_ds
16882 case "$d_semctl_semid_ds" in
16884 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16886 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16892 # We do not have the full sem*(2) library, so assume we can not
16898 set d_semctl_semid_ds
16904 : see if sendmsg exists
16905 set sendmsg d_sendmsg
16908 : see if setegid exists
16909 set setegid d_setegid
16912 : see if seteuid exists
16913 set seteuid d_seteuid
16916 : see if setgrent exists
16917 set setgrent d_setgrent
16920 : see if setgrent_r exists
16921 set setgrent_r d_setgrent_r
16923 case "$d_setgrent_r" in
16925 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16926 case "$d_setgrent_r_proto:$usethreads" in
16927 ":define") d_setgrent_r_proto=define
16928 set d_setgrent_r_proto setgrent_r $hdrs
16932 case "$d_setgrent_r_proto" in
16934 case "$setgrent_r_proto" in
16935 ''|0) try='int setgrent_r(FILE**);'
16936 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
16938 case "$setgrent_r_proto" in
16939 ''|0) try='void setgrent_r(FILE**);'
16940 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
16942 case "$setgrent_r_proto" in
16943 ''|0) d_setgrent_r=undef
16945 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16946 * ) case "$setgrent_r_proto" in
16947 REENTRANT_PROTO*) ;;
16948 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16950 echo "Prototype: $try" ;;
16953 *) case "$usethreads" in
16954 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16961 *) setgrent_r_proto=0
16965 : see if sethostent exists
16966 set sethostent d_sethent
16969 : see if sethostent_r exists
16970 set sethostent_r d_sethostent_r
16972 case "$d_sethostent_r" in
16974 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16975 case "$d_sethostent_r_proto:$usethreads" in
16976 ":define") d_sethostent_r_proto=define
16977 set d_sethostent_r_proto sethostent_r $hdrs
16981 case "$d_sethostent_r_proto" in
16983 case "$sethostent_r_proto" in
16984 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16985 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
16987 case "$sethostent_r_proto" in
16988 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16989 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
16991 case "$sethostent_r_proto" in
16992 ''|0) d_sethostent_r=undef
16993 sethostent_r_proto=0
16994 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16995 * ) case "$sethostent_r_proto" in
16996 REENTRANT_PROTO*) ;;
16997 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16999 echo "Prototype: $try" ;;
17002 *) case "$usethreads" in
17003 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
17005 d_sethostent_r=undef
17006 sethostent_r_proto=0
17010 *) sethostent_r_proto=0
17014 : see if setitimer exists
17015 set setitimer d_setitimer
17018 : see if setlinebuf exists
17019 set setlinebuf d_setlinebuf
17022 : see if setlocale exists
17023 set setlocale d_setlocale
17026 : see if locale.h is available
17027 set locale.h i_locale
17030 : see if setlocale_r exists
17031 set setlocale_r d_setlocale_r
17033 case "$d_setlocale_r" in
17035 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
17036 case "$d_setlocale_r_proto:$usethreads" in
17037 ":define") d_setlocale_r_proto=define
17038 set d_setlocale_r_proto setlocale_r $hdrs
17042 case "$d_setlocale_r_proto" in
17044 case "$setlocale_r_proto" in
17045 ''|0) try='int setlocale_r(int, const char*, char*, int);'
17046 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
17048 case "$setlocale_r_proto" in
17049 ''|0) d_setlocale_r=undef
17050 setlocale_r_proto=0
17051 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
17052 * ) case "$setlocale_r_proto" in
17053 REENTRANT_PROTO*) ;;
17054 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
17056 echo "Prototype: $try" ;;
17059 *) case "$usethreads" in
17060 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
17062 d_setlocale_r=undef
17063 setlocale_r_proto=0
17067 *) setlocale_r_proto=0
17071 : see if setnetent exists
17072 set setnetent d_setnent
17075 : see if setnetent_r exists
17076 set setnetent_r d_setnetent_r
17078 case "$d_setnetent_r" in
17080 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17081 case "$d_setnetent_r_proto:$usethreads" in
17082 ":define") d_setnetent_r_proto=define
17083 set d_setnetent_r_proto setnetent_r $hdrs
17087 case "$d_setnetent_r_proto" in
17089 case "$setnetent_r_proto" in
17090 ''|0) try='int setnetent_r(int, struct netent_data*);'
17091 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
17093 case "$setnetent_r_proto" in
17094 ''|0) try='void setnetent_r(int, struct netent_data*);'
17095 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
17097 case "$setnetent_r_proto" in
17098 ''|0) d_setnetent_r=undef
17099 setnetent_r_proto=0
17100 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
17101 * ) case "$setnetent_r_proto" in
17102 REENTRANT_PROTO*) ;;
17103 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
17105 echo "Prototype: $try" ;;
17108 *) case "$usethreads" in
17109 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
17111 d_setnetent_r=undef
17112 setnetent_r_proto=0
17116 *) setnetent_r_proto=0
17120 : see if setprotoent exists
17121 set setprotoent d_setpent
17124 : see if setpgid exists
17125 set setpgid d_setpgid
17128 : see if setpgrp2 exists
17129 set setpgrp2 d_setpgrp2
17132 : see if setpriority exists
17133 set setpriority d_setprior
17136 : see if setproctitle exists
17137 set setproctitle d_setproctitle
17140 : see if setprotoent_r exists
17141 set setprotoent_r d_setprotoent_r
17143 case "$d_setprotoent_r" in
17145 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17146 case "$d_setprotoent_r_proto:$usethreads" in
17147 ":define") d_setprotoent_r_proto=define
17148 set d_setprotoent_r_proto setprotoent_r $hdrs
17152 case "$d_setprotoent_r_proto" in
17154 case "$setprotoent_r_proto" in
17155 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
17156 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
17158 case "$setprotoent_r_proto" in
17159 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
17160 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
17162 case "$setprotoent_r_proto" in
17163 ''|0) d_setprotoent_r=undef
17164 setprotoent_r_proto=0
17165 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
17166 * ) case "$setprotoent_r_proto" in
17167 REENTRANT_PROTO*) ;;
17168 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
17170 echo "Prototype: $try" ;;
17173 *) case "$usethreads" in
17174 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
17176 d_setprotoent_r=undef
17177 setprotoent_r_proto=0
17181 *) setprotoent_r_proto=0
17185 : see if setpwent exists
17186 set setpwent d_setpwent
17189 : see if setpwent_r exists
17190 set setpwent_r d_setpwent_r
17192 case "$d_setpwent_r" in
17194 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17195 case "$d_setpwent_r_proto:$usethreads" in
17196 ":define") d_setpwent_r_proto=define
17197 set d_setpwent_r_proto setpwent_r $hdrs
17201 case "$d_setpwent_r_proto" in
17203 case "$setpwent_r_proto" in
17204 ''|0) try='int setpwent_r(FILE**);'
17205 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17207 case "$setpwent_r_proto" in
17208 ''|0) try='void setpwent_r(FILE**);'
17209 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17211 case "$setpwent_r_proto" in
17212 ''|0) d_setpwent_r=undef
17214 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17215 * ) case "$setpwent_r_proto" in
17216 REENTRANT_PROTO*) ;;
17217 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17219 echo "Prototype: $try" ;;
17222 *) case "$usethreads" in
17223 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17230 *) setpwent_r_proto=0
17234 : see if setregid exists
17235 set setregid d_setregid
17237 set setresgid d_setresgid
17240 : see if setreuid exists
17241 set setreuid d_setreuid
17243 set setresuid d_setresuid
17246 : see if setrgid exists
17247 set setrgid d_setrgid
17250 : see if setruid exists
17251 set setruid d_setruid
17254 : see if setservent exists
17255 set setservent d_setsent
17258 : see if setservent_r exists
17259 set setservent_r d_setservent_r
17261 case "$d_setservent_r" in
17263 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17264 case "$d_setservent_r_proto:$usethreads" in
17265 ":define") d_setservent_r_proto=define
17266 set d_setservent_r_proto setservent_r $hdrs
17270 case "$d_setservent_r_proto" in
17272 case "$setservent_r_proto" in
17273 ''|0) try='int setservent_r(int, struct servent_data*);'
17274 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17276 case "$setservent_r_proto" in
17277 ''|0) try='void setservent_r(int, struct servent_data*);'
17278 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17280 case "$setservent_r_proto" in
17281 ''|0) d_setservent_r=undef
17282 setservent_r_proto=0
17283 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17284 * ) case "$setservent_r_proto" in
17285 REENTRANT_PROTO*) ;;
17286 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17288 echo "Prototype: $try" ;;
17291 *) case "$usethreads" in
17292 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17294 d_setservent_r=undef
17295 setservent_r_proto=0
17299 *) setservent_r_proto=0
17303 : see if setsid exists
17304 set setsid d_setsid
17307 : see if setvbuf exists
17308 set setvbuf d_setvbuf
17311 : see if sfio.h is available
17315 : see if sfio library is available
17326 : Ok, but do we want to use it.
17330 true|$define|[yY]*) dflt='y';;
17333 echo "$package can use the sfio library, but it is experimental."
17334 case "$useperlio" in
17336 echo "For sfio also the PerlIO abstraction layer is needed."
17337 echo "Earlier you said you wouldn't want that."
17340 rp="You seem to have sfio available, do you want to try using it?"
17343 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
17344 useperlio="$define"
17347 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17352 *) case "$usesfio" in
17353 true|$define|[yY]*)
17354 echo "Sorry, cannot find sfio on this machine." >&4
17355 echo "Ignoring your setting of usesfio=$usesfio." >&4
17364 $define) usesfio='true';;
17365 *) usesfio='false';;
17369 *) : Remove sfio from list of libraries to use
17372 echo "Removing unneeded -lsfio from library list" >&4
17373 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17376 echo "libs = $libs" >&4
17383 : see if shmctl exists
17384 set shmctl d_shmctl
17387 : see if shmget exists
17388 set shmget d_shmget
17391 : see if shmat exists
17394 : see what shmat returns
17397 $cat >shmat.c <<'END'
17398 #include <sys/shm.h>
17401 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17406 echo "and it returns ($shmattype)." >&4
17407 : see if a prototype for shmat is available
17408 xxx=`./findhdr sys/shm.h`
17409 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17410 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17421 set d_shmatprototype
17424 : see if shmdt exists
17428 : see how much of the 'shm*(2)' library is present.
17431 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17432 *"$undef"*) h_shm=false;;
17436 case "`ipcs 2>&1`" in
17437 "SVID shared memory"*"not configured"*)
17438 echo "Your $osname does not have the shm*(2) configured." >&4
17441 set shmctl d_shmctl
17443 set shmget d_shmget
17453 : we could also check for sys/ipc.h ...
17454 if $h_shm && $test `./findhdr sys/shm.h`; then
17455 echo "You have the full shm*(2) library." >&4
17458 echo "You don't have the full shm*(2) library." >&4
17464 : see if we have sigaction
17466 if set sigaction val -f d_sigaction; eval $csym; $val; then
17467 echo 'sigaction() found.' >&4
17470 #include <sys/types.h>
17471 #include <signal.h>
17472 #$i_stdlib I_STDLIB
17474 #include <stdlib.h>
17478 struct sigaction act, oact;
17480 oact.sa_handler = 0;
17481 /* so that act and oact are used */
17482 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17486 if eval $compile_ok; then
17489 echo "But you don't seem to have a useable struct sigaction." >&4
17493 echo 'sigaction NOT found.' >&4
17496 set d_sigaction; eval $setvar
17499 : see if this is a sunmath.h system
17500 set sunmath.h i_sunmath
17503 : see if signbit exists
17504 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17507 #$i_sunmath I_SUNMATH
17511 #ifdef I_SUNMATH /* Solaris special math library */
17512 # include <sunmath.h>
17515 int main(int argc, char **argv)
17519 if ((signbit(x) == 0) && (signbit(y) != 0))
17527 if eval $compile; then
17528 if $run ./try; then
17532 $echo "Signbit seems to be available, but doesn't work as I expected."
17533 $echo "I won't use it." >&4
17544 : see if sigprocmask exists
17545 set sigprocmask d_sigprocmask
17548 : see if sigsetjmp exists
17550 case "$d_sigsetjmp" in
17553 #include <setjmp.h>
17554 #$i_stdlib I_STDLIB
17556 #include <stdlib.h>
17562 if (sigsetjmp(env,1))
17565 siglongjmp(env, 1);
17570 if eval $compile; then
17571 if $run ./try >/dev/null 2>&1; then
17572 echo "POSIX sigsetjmp found." >&4
17576 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17582 echo "sigsetjmp not found." >&4
17586 *) val="$d_sigsetjmp"
17587 case "$d_sigsetjmp" in
17588 $define) echo "POSIX sigsetjmp found." >&4;;
17589 $undef) echo "sigsetjmp not found." >&4;;
17597 : see if snprintf exists
17598 set snprintf d_snprintf
17601 : see if vsnprintf exists
17602 set vsnprintf d_vsnprintf
17605 case "$d_snprintf-$d_vsnprintf" in
17608 Checking whether your snprintf() and vsnprintf() work okay...
17610 $cat >try.c <<'EOCP'
17611 /* v?snprintf testing logic courtesy of Russ Allbery.
17612 * According to C99:
17613 * - if the buffer is too short it still must be \0-terminated
17614 * - if the buffer is too short the potentially required length
17615 * must be returned and not -1
17616 * - if the buffer is NULL the potentially required length
17617 * must be returned and not -1 or core dump
17620 #include <stdarg.h>
17624 int test (char *format, ...)
17629 va_start (args, format);
17630 count = vsnprintf (buf, sizeof buf, format, args);
17637 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17638 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17642 if eval $compile; then
17645 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17647 Your snprintf() and snprintf() don't seem to be working okay.
17649 d_snprintf="$undef"
17650 d_vsnprintf="$undef"
17654 echo "(I can't seem to compile the test program--assuming they don't)"
17655 d_snprintf="$undef"
17656 d_vsnprintf="$undef"
17662 : see if sockatmark exists
17663 set sockatmark d_sockatmark
17666 : see if prototype for sockatmark is available
17668 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17671 : see if socks5_init exists
17672 set socks5_init d_socks5_init
17675 : see if sprintf returns the length of the string in the buffer as per ANSI
17676 $echo "Checking whether sprintf returns the length of the string..." >&4
17679 #$i_stdlib I_STDLIB
17681 #include <stdlib.h>
17683 #$i_string I_STRING
17685 # include <string.h>
17687 # include <strings.h>
17696 int check (size_t expect, int test) {
17697 size_t got = strlen(buffer);
17701 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17706 int main(int argc, char **argv) {
17709 check(sprintf(buffer, ""), ++test);
17710 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17711 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17718 if eval $compile; then
17722 sprintf returns the length of the string (as ANSI says it should)
17724 d_sprintf_returns_strlen="$define"
17727 sprintf does not return the length of the string (how old is this system?)
17729 d_sprintf_returns_strlen="$undef"
17733 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17734 d_sprintf_returns_strlen="$undef"
17738 : see if srand48_r exists
17739 set srand48_r d_srand48_r
17741 case "$d_srand48_r" in
17743 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17744 case "$d_srand48_r_proto:$usethreads" in
17745 ":define") d_srand48_r_proto=define
17746 set d_srand48_r_proto srand48_r $hdrs
17750 case "$d_srand48_r_proto" in
17752 case "$srand48_r_proto" in
17753 ''|0) try='int srand48_r(long, struct drand48_data*);'
17754 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17756 case "$srand48_r_proto" in
17757 ''|0) d_srand48_r=undef
17759 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17760 * ) case "$srand48_r_proto" in
17761 REENTRANT_PROTO*) ;;
17762 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17764 echo "Prototype: $try" ;;
17767 *) case "$usethreads" in
17768 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17775 *) srand48_r_proto=0
17779 : see if srandom_r exists
17780 set srandom_r d_srandom_r
17782 case "$d_srandom_r" in
17784 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17785 case "$d_srandom_r_proto:$usethreads" in
17786 ":define") d_srandom_r_proto=define
17787 set d_srandom_r_proto srandom_r $hdrs
17791 case "$d_srandom_r_proto" in
17793 case "$srandom_r_proto" in
17794 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17795 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
17797 case "$srandom_r_proto" in
17798 ''|0) d_srandom_r=undef
17800 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17801 * ) case "$srandom_r_proto" in
17802 REENTRANT_PROTO*) ;;
17803 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17805 echo "Prototype: $try" ;;
17808 *) case "$usethreads" in
17809 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17816 *) srandom_r_proto=0
17820 : see if prototype for setresgid is available
17822 set d_sresgproto setresgid $i_unistd unistd.h
17825 : see if prototype for setresuid is available
17827 set d_sresuproto setresuid $i_unistd unistd.h
17830 : see if sys/stat.h is available
17831 set sys/stat.h i_sysstat
17834 : see if stat knows about block sizes
17836 echo "Checking to see if your struct stat has st_blocks field..." >&4
17837 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17840 : see if this is a sys/vfs.h system
17841 set sys/vfs.h i_sysvfs
17844 : see if this is a sys/statfs.h system
17845 set sys/statfs.h i_sysstatfs
17848 : Check for statfs_s
17850 echo "Checking to see if your system supports struct statfs..." >&4
17851 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
17853 case "$d_statfs_s" in
17854 "$define") echo "Yes, it does." ;;
17855 *) echo "No, it doesn't." ;;
17859 : see if struct statfs knows about f_flags
17860 case "$d_statfs_s" in
17863 echo "Checking to see if your struct statfs has f_flags field..." >&4
17864 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
17868 set d_statfs_f_flags
17872 case "$d_statfs_f_flags" in
17873 "$define") echo "Yes, it does." ;;
17874 *) echo "No, it doesn't." ;;
17877 : Check stream access
17879 Checking how to access stdio streams by file descriptor number...
17881 case "$stdio_stream_array" in
17882 '') $cat >try.c <<EOCP
17885 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17889 for s in _iob __iob __sF
17891 set try -DSTDIO_STREAM_ARRAY=$s
17892 if eval $compile; then
17893 case "`$run ./try`" in
17894 yes) stdio_stream_array=$s; break ;;
17900 case "$stdio_stream_array" in
17902 I can't figure out how to access stdio streams by file descriptor number.
17904 d_stdio_stream_array="$undef"
17907 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17909 d_stdio_stream_array="$define"
17913 : see if strcoll exists
17914 set strcoll d_strcoll
17917 : check for structure copying
17919 echo "Checking to see if your C compiler can copy structs..." >&4
17920 $cat >try.c <<'EOCP'
17930 if $cc -c try.c >/dev/null 2>&1 ; then
17932 echo "Yup, it can."
17935 echo "Nope, it can't."
17941 : see if strerror and/or sys_errlist[] exist
17943 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17944 if set strerror val -f d_strerror; eval $csym; $val; then
17945 echo 'strerror() found.' >&4
17946 d_strerror="$define"
17947 d_strerrm='strerror(e)'
17948 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17949 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17950 d_syserrlst="$define"
17952 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17953 d_syserrlst="$undef"
17955 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17956 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17957 echo 'strerror() found in string header.' >&4
17958 d_strerror="$define"
17959 d_strerrm='strerror(e)'
17960 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17961 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17962 d_syserrlst="$define"
17964 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17965 d_syserrlst="$undef"
17967 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17968 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17969 d_strerror="$undef"
17970 d_syserrlst="$define"
17971 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17973 echo 'strerror() and sys_errlist[] NOT found.' >&4
17974 d_strerror="$undef"
17975 d_syserrlst="$undef"
17976 d_strerrm='"unknown"'
17980 : see if strerror_r exists
17981 set strerror_r d_strerror_r
17983 case "$d_strerror_r" in
17985 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17986 case "$d_strerror_r_proto:$usethreads" in
17987 ":define") d_strerror_r_proto=define
17988 set d_strerror_r_proto strerror_r $hdrs
17992 case "$d_strerror_r_proto" in
17994 case "$strerror_r_proto" in
17995 ''|0) try='int strerror_r(int, char*, size_t);'
17996 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
17998 case "$strerror_r_proto" in
17999 ''|0) try='int strerror_r(int, char*, int);'
18000 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
18002 case "$strerror_r_proto" in
18003 ''|0) try='char* strerror_r(int, char*, size_t);'
18004 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
18006 case "$strerror_r_proto" in
18007 ''|0) d_strerror_r=undef
18009 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
18010 * ) case "$strerror_r_proto" in
18011 REENTRANT_PROTO*) ;;
18012 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
18014 echo "Prototype: $try" ;;
18017 *) case "$usethreads" in
18018 define) echo "strerror_r has no prototype, not using it." >&4 ;;
18025 *) strerror_r_proto=0
18029 : see if strftime exists
18030 set strftime d_strftime
18033 : see if strlcat exists
18034 set strlcat d_strlcat
18037 : see if strlcpy exists
18038 set strlcpy d_strlcpy
18041 : see if strtod exists
18042 set strtod d_strtod
18045 : see if strtol exists
18046 set strtol d_strtol
18049 : see if strtold exists
18050 set strtold d_strtold
18053 : see if strtoll exists
18054 set strtoll d_strtoll
18057 case "$d_longlong-$d_strtoll" in
18060 Checking whether your strtoll() works okay...
18062 $cat >try.c <<'EOCP'
18065 #define strtoll __strtoll
18068 #define strtoll _strtoll
18071 extern long long int strtoll(char *s, char **, int);
18072 static int bad = 0;
18073 int check(char *s, long long ell, int een) {
18076 gll = strtoll(s, 0, 10);
18077 if (!((gll == ell) && (errno == een)))
18081 check(" 1", 1LL, 0);
18082 check(" 0", 0LL, 0);
18083 check("-1", -1LL, 0);
18084 check("-9223372036854775808", -9223372036854775808LL, 0);
18085 check("-9223372036854775808", -9223372036854775808LL, 0);
18086 check(" 9223372036854775807", 9223372036854775807LL, 0);
18087 check("-9223372036854775808", -9223372036854775808LL, 0);
18088 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
18089 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
18095 if eval $compile; then
18098 ok) echo "Your strtoll() seems to be working okay." ;;
18100 Your strtoll() doesn't seem to be working okay.
18106 echo "(I can't seem to compile the test program--assuming it doesn't)"
18112 : see if strtoq exists
18113 set strtoq d_strtoq
18116 : see if strtoul exists
18117 set strtoul d_strtoul
18120 case "$d_strtoul" in
18123 Checking whether your strtoul() works okay...
18125 $cat >try.c <<'EOCP'
18128 extern unsigned long int strtoul(char *s, char **, int);
18129 static int bad = 0;
18130 void check(char *s, unsigned long eul, int een) {
18133 gul = strtoul(s, 0, 10);
18134 if (!((gul == eul) && (errno == een)))
18138 check(" 1", 1L, 0);
18139 check(" 0", 0L, 0);
18141 case "$longsize" in
18143 $cat >>try.c <<'EOCP'
18144 check("18446744073709551615", 18446744073709551615UL, 0);
18145 check("18446744073709551616", 18446744073709551615UL, ERANGE);
18146 #if 0 /* strtoul() for /^-/ strings is undefined. */
18147 check("-1", 18446744073709551615UL, 0);
18148 check("-18446744073709551614", 2, 0);
18149 check("-18446744073709551615", 1, 0);
18150 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
18151 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
18156 $cat >>try.c <<'EOCP'
18157 check("4294967295", 4294967295UL, 0);
18158 check("4294967296", 4294967295UL, ERANGE);
18159 #if 0 /* strtoul() for /^-/ strings is undefined. */
18160 check("-1", 4294967295UL, 0);
18161 check("-4294967294", 2, 0);
18162 check("-4294967295", 1, 0);
18163 check("-4294967296", 4294967295UL, ERANGE);
18164 check("-4294967297", 4294967295UL, ERANGE);
18169 : Should we write these tests to be more portable by sprintf-ing
18170 : ~0 and then manipulating that char string as input for strtol?
18173 $cat >>try.c <<'EOCP'
18180 if eval $compile; then
18181 case "`$run ./try`" in
18182 ok) echo "Your strtoul() seems to be working okay." ;;
18184 Your strtoul() doesn't seem to be working okay.
18190 echo "(I can't seem to compile the test program--assuming it doesn't)"
18196 : see if strtoull exists
18197 set strtoull d_strtoull
18200 case "$d_longlong-$d_strtoull" in
18203 Checking whether your strtoull() works okay...
18205 $cat >try.c <<'EOCP'
18208 #define strtoull __strtoull
18211 extern unsigned long long int strtoull(char *s, char **, int);
18212 static int bad = 0;
18213 int check(char *s, long long eull, int een) {
18216 gull = strtoull(s, 0, 10);
18217 if (!((gull == eull) && (errno == een)))
18221 check(" 1", 1LL, 0);
18222 check(" 0", 0LL, 0);
18223 check("18446744073709551615", 18446744073709551615ULL, 0);
18224 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18225 #if 0 /* strtoull() for /^-/ strings is undefined. */
18226 check("-1", 18446744073709551615ULL, 0);
18227 check("-18446744073709551614", 2LL, 0);
18228 check("-18446744073709551615", 1LL, 0);
18229 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18230 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18237 if eval $compile; then
18238 case "`$run ./try`" in
18239 ok) echo "Your strtoull() seems to be working okay." ;;
18241 Your strtoull() doesn't seem to be working okay.
18243 d_strtoull="$undef"
18247 echo "(I can't seem to compile the test program--assuming it doesn't)"
18248 d_strtoull="$undef"
18253 : see if strtouq exists
18254 set strtouq d_strtouq
18257 case "$d_strtouq" in
18260 Checking whether your strtouq() works okay...
18262 $cat >try.c <<'EOCP'
18265 extern unsigned long long int strtouq(char *s, char **, int);
18266 static int bad = 0;
18267 void check(char *s, unsigned long long eull, int een) {
18268 unsigned long long gull;
18270 gull = strtouq(s, 0, 10);
18271 if (!((gull == eull) && (errno == een)))
18275 check(" 1", 1LL, 0);
18276 check(" 0", 0LL, 0);
18277 check("18446744073709551615", 18446744073709551615ULL, 0);
18278 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18279 #if 0 /* strtouq() for /^-/ strings is undefined. */
18280 check("-1", 18446744073709551615ULL, 0);
18281 check("-18446744073709551614", 2LL, 0);
18282 check("-18446744073709551615", 1LL, 0);
18283 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18284 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18292 if eval $compile; then
18293 case "`$run ./try`" in
18294 ok) echo "Your strtouq() seems to be working okay." ;;
18296 Your strtouq() doesn't seem to be working okay.
18302 echo "(I can't seem to compile the test program--assuming it doesn't)"
18308 : see if strxfrm exists
18309 set strxfrm d_strxfrm
18312 : see if symlink exists
18313 set symlink d_symlink
18316 : see if syscall exists
18317 set syscall d_syscall
18320 : see if prototype for syscall is available
18322 set d_syscallproto syscall $i_unistd unistd.h
18325 : see if sysconf exists
18326 set sysconf d_sysconf
18329 : see if system exists
18330 set system d_system
18333 : see if tcgetpgrp exists
18334 set tcgetpgrp d_tcgetpgrp
18337 : see if tcsetpgrp exists
18338 set tcsetpgrp d_tcsetpgrp
18341 : see if prototype for telldir is available
18343 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18346 : see if time exists
18348 if test "X$d_time" = X -o X"$timetype" = X; then
18349 if set time val -f d_time; eval $csym; $val; then
18350 echo 'time() found.' >&4
18352 rp="What is the type returned by time() on this system?"
18353 set time_t timetype long stdio.h sys/types.h
18356 echo 'time() not found, hope that will do.' >&4
18364 : see if timegm exists
18365 set timegm d_timegm
18368 : see if this is a sys/times.h system
18369 set sys/times.h i_systimes
18372 : see if times exists
18374 if set times val -f d_times; eval $csym; $val; then
18375 echo 'times() found.' >&4
18378 case "$i_systimes" in
18379 "$define") inc='sys/times.h';;
18381 rp="What is the type returned by times() on this system?"
18382 set clock_t clocktype long stdio.h sys/types.h $inc
18385 echo 'times() NOT found, hope that will do.' >&4
18390 : see if tmpnam_r exists
18391 set tmpnam_r d_tmpnam_r
18393 case "$d_tmpnam_r" in
18395 hdrs="$i_systypes sys/types.h define stdio.h "
18396 case "$d_tmpnam_r_proto:$usethreads" in
18397 ":define") d_tmpnam_r_proto=define
18398 set d_tmpnam_r_proto tmpnam_r $hdrs
18402 case "$d_tmpnam_r_proto" in
18404 case "$tmpnam_r_proto" in
18405 ''|0) try='char* tmpnam_r(char*);'
18406 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18408 case "$tmpnam_r_proto" in
18409 ''|0) d_tmpnam_r=undef
18411 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18412 * ) case "$tmpnam_r_proto" in
18413 REENTRANT_PROTO*) ;;
18414 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18416 echo "Prototype: $try" ;;
18419 *) case "$usethreads" in
18420 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18427 *) tmpnam_r_proto=0
18431 : see if truncate exists
18432 set truncate d_truncate
18435 : see if ttyname_r exists
18436 set ttyname_r d_ttyname_r
18438 case "$d_ttyname_r" in
18440 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18441 case "$d_ttyname_r_proto:$usethreads" in
18442 ":define") d_ttyname_r_proto=define
18443 set d_ttyname_r_proto ttyname_r $hdrs
18447 case "$d_ttyname_r_proto" in
18449 case "$ttyname_r_proto" in
18450 ''|0) try='int ttyname_r(int, char*, size_t);'
18451 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18453 case "$ttyname_r_proto" in
18454 ''|0) try='int ttyname_r(int, char*, int);'
18455 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18457 case "$ttyname_r_proto" in
18458 ''|0) try='char* ttyname_r(int, char*, int);'
18459 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18461 case "$ttyname_r_proto" in
18462 ''|0) d_ttyname_r=undef
18464 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18465 * ) case "$ttyname_r_proto" in
18466 REENTRANT_PROTO*) ;;
18467 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18469 echo "Prototype: $try" ;;
18472 *) case "$usethreads" in
18473 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18480 *) ttyname_r_proto=0
18484 : see if tzname[] exists
18486 if set tzname val -a d_tzname; eval $csym; $val; then
18488 echo 'tzname[] found.' >&4
18491 echo 'tzname[] NOT found.' >&4
18496 : Check if is a multiplatform env
18498 next|rhapsody|darwin) multiarch="$define" ;;
18500 case "$multiarch" in
18501 ''|[nN]*) multiarch="$undef" ;;
18504 : check for ordering of bytes in a UV
18506 case "$usecrosscompile$multiarch" in
18509 You seem to be either cross-compiling or doing a multiarchitecture build,
18510 skipping the byteorder check.
18516 case "$byteorder" in
18519 In the following, larger digits indicate more significance. A big-endian
18520 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18521 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18522 machines may have weird orders like 3412. A Cray will report 87654321,
18523 an Alpha will report 12345678. If the test program works the default is
18525 I'm now running the test program...
18529 #$i_stdlib I_STDLIB
18531 #include <stdlib.h>
18533 #include <sys/types.h>
18534 typedef $uvtype UV;
18544 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18546 u.l = (UV)0x04030201;
18547 for (i = 0; i < $uvsize; i++)
18548 printf("%c", u.c[i]+'0');
18555 if eval $compile && $run ./try > /dev/null; then
18558 [1-4][1-4][1-4][1-4]|12345678|87654321)
18559 echo "(The test program ran ok.)"
18560 echo "byteorder=$dflt"
18563 ????|????????) echo "(The test program ran ok.)" ;;
18564 *) echo "(The test program didn't run right for some reason.)" ;;
18569 (I can't seem to compile the test program. Guessing big-endian...)
18572 case "$xxx_prompt" in
18574 rp="What is the order of bytes in $uvtype?"
18587 : Checking 32bit aligndness
18590 Checking to see whether you can access character data unalignedly...
18592 case "$d_u32align" in
18593 '') $cat >try.c <<EOCP
18595 #$i_stdlib I_STDLIB
18597 #include <stdlib.h>
18599 #define U32 $u32type
18600 #define BYTEORDER 0x$byteorder
18602 #include <signal.h>
18604 $signal_t bletch(int s) { exit(4); }
18607 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18612 if (sizeof(U32) != 4) {
18613 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18620 signal(SIGBUS, bletch);
18632 for (i = 0; i < 4; i++) {
18633 up = (U32*)(buf + i);
18634 if (! ((*up == 1 << (8*i)) || /* big-endian */
18635 (*up == 1 << (8*(3-i))) /* little-endian */
18639 printf("read failed (%x)\n", *up);
18645 for (i = 0; i < 4; i++) {
18646 up = (U32*)(buf + i);
18648 if (*up != 0xBeef) {
18649 printf("write failed (%x)\n", *up);
18663 if eval $compile_ok; then
18664 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18665 $run ./try 2>&1 >/dev/null
18668 You can access character data pretty unalignedly.
18670 d_u32align="$undef"
18673 It seems that you must access character data in an aligned manner.
18675 d_u32align="$define"
18679 rp='Can you access character data at unaligned addresses?'
18683 [yY]*) d_u32align="$undef" ;;
18684 *) d_u32align="$define" ;;
18691 : see if ualarm exists
18692 set ualarm d_ualarm
18695 : see if umask exists
18699 : see if unordered exists
18700 set unordered d_unordered
18703 : see if unsetenv exists
18704 set unsetenv d_unsetenv
18707 : see if usleep exists
18708 set usleep d_usleep
18711 : see if prototype for usleep is available
18713 set d_usleepproto usleep $i_unistd unistd.h
18716 : see if ustat exists
18720 : see if closedir exists
18721 set closedir d_closedir
18724 case "$d_closedir" in
18727 echo "Checking whether closedir() returns a status..." >&4
18729 #$i_dirent I_DIRENT /**/
18730 #$i_sysdir I_SYS_DIR /**/
18731 #$i_sysndir I_SYS_NDIR /**/
18732 #$i_systypes I_SYS_TYPES /**/
18734 #if defined(I_SYS_TYPES)
18735 #include <sys/types.h>
18737 #if defined(I_DIRENT)
18738 #include <dirent.h>
18739 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18740 #include <sys/dir.h>
18744 #include <sys/ndir.h>
18748 #include <ndir.h> /* may be wrong in the future */
18750 #include <sys/dir.h>
18755 int main() { return closedir(opendir(".")); }
18758 if eval $compile_ok; then
18759 if $run ./try > /dev/null 2>&1 ; then
18760 echo "Yes, it does."
18763 echo "No, it doesn't."
18767 echo "(I can't seem to compile the test program--assuming it doesn't)"
18775 set d_void_closedir
18779 : see if there is a wait4
18783 : see if waitpid exists
18784 set waitpid d_waitpid
18787 : see if wcstombs exists
18788 set wcstombs d_wcstombs
18791 : see if wctomb exists
18792 set wctomb d_wctomb
18795 : see if writev exists
18796 set writev d_writev
18799 : preserve RCS keywords in files with variable substitution, grrr
18804 Revision='$Revision'
18806 : check for alignment requirements
18808 case "$usecrosscompile$multiarch" in
18811 You seem to be either cross-compiling or doing a multiarchitecture build,
18812 skipping the memory alignment check.
18815 case "$alignbytes" in
18816 '') alignbytes=8 ;;
18820 case "$alignbytes" in
18821 '') echo "Checking alignment constraints..." >&4
18822 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18823 $cat >try.c <<'EOCP'
18824 typedef long double NV;
18827 $cat >try.c <<'EOCP'
18831 $cat >>try.c <<'EOCP'
18839 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18844 if eval $compile_ok; then
18848 echo "(I can't seem to compile the test program...)"
18851 *) dflt="$alignbytes"
18854 rp="Doubles must be aligned on a how-many-byte boundary?"
18862 : set the base revision
18865 : check for length of character
18867 case "$charsize" in
18869 echo "Checking to see how big your characters are (hey, you never know)..." >&4
18872 #$i_stdlib I_STDLIB
18874 #include <stdlib.h>
18878 printf("%d\n", (int)sizeof(char));
18883 if eval $compile_ok; then
18887 echo "(I can't seem to compile the test program. Guessing...)"
18894 rp="What is the size of a character (in bytes)?"
18899 : Check for the number of bits in a character
18900 case "$charbits" in
18901 '') echo "Checking how long a character is (in bits)..." >&4
18908 for (c = 1, n = 0; c; c <<= 1, n++) ;
18909 printf ("%d\n", n);
18914 if eval $compile_ok; then
18918 echo "(I can't seem to compile the test program. Guessing...)"
18925 rp="What is the length of a character (in bits)?"
18929 case "$charbits" in
18932 Your system has an unsigned character size of $charbits bits, which
18933 is rather unusual (normally it is 8 bits). Perl likely will not work
18934 correctly on your system, with subtle bugs in various places.
18936 rp='Do you really want to continue?'
18940 [yY]) echo >&4 "Okay, continuing." ;;
18945 : how do we concatenate cpp tokens here?
18947 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18948 $cat >cpp_stuff.c <<'EOCP'
18949 #define RCAT(a,b)a/**/b
18950 #define ACAT(a,b)a ## b
18954 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18955 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18956 echo "Oh! Smells like ANSI's been here." >&4
18957 echo "We can catify or stringify, separately or together!"
18959 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18960 echo "Ah, yes! The good old days!" >&4
18961 echo "However, in the good old days we don't know how to stringify and"
18962 echo "catify at the same time."
18966 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18967 You're going to have to edit the values of CAT[2-5] in config.h...
18969 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18973 : see if this is a db.h system
18979 : Check db version.
18981 echo "Checking Berkeley DB version ..." >&4
18987 #include <sys/types.h>
18989 #$i_stdlib I_STDLIB
18991 #include <stdlib.h>
18994 int main(int argc, char *argv[])
18996 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18997 int Major, Minor, Patch ;
18998 unsigned long Version ;
18999 (void)db_version(&Major, &Minor, &Patch) ;
19001 printf("%d %d %d %d %d %d\n",
19002 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
19003 Major, Minor, Patch);
19006 printf("You have Berkeley DB Version 2 or greater.\n");
19008 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
19009 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
19010 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
19011 Major, Minor, Patch) ;
19013 /* check that db.h & libdb are compatible */
19014 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
19015 printf("db.h and libdb are incompatible.\n") ;
19019 printf("db.h and libdb are compatible.\n") ;
19021 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
19022 + DB_VERSION_PATCH ;
19024 /* needs to be >= 2.3.4 */
19025 if (Version < 2003004) {
19026 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
19027 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
19033 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
19038 printf("You have Berkeley DB Version 1.\n");
19039 exit(0); /* DB version < 2: the coast is clear. */
19041 exit(1); /* <db.h> not Berkeley DB? */
19047 if eval $compile_ok && $run ./try; then
19048 echo 'Looks OK.' >&4
19050 db_version_major=$1
19051 db_version_minor=$2
19052 db_version_patch=$3
19054 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
19058 : Remove db from list of libraries to use
19059 echo "Removing unusable -ldb from library list" >&4
19060 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
19063 echo "libs = $libs" >&4
19073 : Check the return type needed for hash
19075 echo "Checking return type needed for hash for Berkeley DB ..." >&4
19081 #include <sys/types.h>
19084 #ifndef DB_VERSION_MAJOR
19085 u_int32_t hash_cb (ptr, size)
19093 info.hash = hash_cb;
19097 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19098 if $contains warning try.out >>/dev/null 2>&1 ; then
19101 db_hashtype='u_int32_t'
19104 : XXX Maybe we should just give up here.
19105 db_hashtype=u_int32_t
19107 echo "Help: I can't seem to compile the db test program." >&4
19108 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
19111 echo "Your version of Berkeley DB uses $db_hashtype for hash."
19113 *) db_hashtype=u_int32_t
19118 : Check the return type needed for prefix
19120 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
19126 #include <sys/types.h>
19129 #ifndef DB_VERSION_MAJOR
19130 size_t prefix_cb (key1, key2)
19138 info.prefix = prefix_cb;
19142 if $cc $ccflags -c try.c >try.out 2>&1 ; then
19143 if $contains warning try.out >>/dev/null 2>&1 ; then
19144 db_prefixtype='int'
19146 db_prefixtype='size_t'
19149 db_prefixtype='size_t'
19150 : XXX Maybe we should just give up here.
19152 echo "Help: I can't seem to compile the db test program." >&4
19153 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
19156 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
19158 *) db_prefixtype='size_t'
19162 : How can we generate normalized random numbers ?
19164 echo "Looking for a random number function..." >&4
19165 case "$randfunc" in
19167 if set drand48 val -f; eval $csym; $val; then
19169 echo "Good, found drand48()." >&4
19170 elif set random val -f; eval $csym; $val; then
19172 echo "OK, found random()." >&4
19175 echo "Yick, looks like I have to use rand()." >&4
19186 *-Dmy_rand=*|*-Dmy_srand=*)
19187 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
19188 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
19189 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
19190 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
19194 while $test "$cont"; do
19195 rp="Use which function to generate random numbers?"
19197 if $test "$ans" = "$dflt"; then
19203 if set $ans val -f; eval $csym; $val; then
19207 rp="I cannot find function $ans. Use that name anyway?"
19216 case "$randfunc" in
19218 drand01="drand48()"
19224 case "$randbits" in
19226 echo "Checking to see how many bits your $randfunc() function produces..." >&4
19228 #$i_unistd I_UNISTD
19229 #$i_stdlib I_STDLIB
19232 # include <unistd.h>
19235 # include <stdlib.h>
19240 register unsigned long tmp;
19241 register unsigned long max = 0L;
19243 for (i = 1000; i; i--) {
19244 tmp = (unsigned long) $randfunc();
19245 if (tmp > max) max = tmp;
19247 for (i = 0; max; i++)
19253 if eval $compile_ok; then
19257 echo "(I can't seem to compile the test program...)"
19264 rp="How many bits does your $randfunc() function produce?"
19268 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19269 seedfunc="s$randfunc"
19270 randseedtype=unsigned
19274 rp="How many bits does your $randfunc() function produce?"
19277 seedfunc="s$randfunc"
19278 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19279 if set $seedfunc val -f; eval $csym; $val; then
19280 echo "(Using $seedfunc() to seed random generator)"
19282 echo "(Warning: no $seedfunc() to seed random generator)"
19285 randseedtype=unsigned
19292 : Determine if this is an EBCDIC system
19294 echo "Determining whether or not we are on an EBCDIC system..." >&4
19295 $cat >try.c <<'EOM'
19298 if ('M'==0xd4) return 0;
19305 if eval $compile_ok; then
19306 if $run ./try; then
19307 echo "You seem to speak EBCDIC." >&4
19310 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19313 echo "I'm unable to compile the test program." >&4
19314 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19320 : Check how to flush
19323 Checking how to flush all pending stdio output...
19325 # I only know how to find the first 32 possibly open files on SunOS.
19326 # See also hints/sunos_4_1.sh and util.c --AD
19328 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19330 $cat >>try.c <<EOCP
19332 #$i_stdlib I_STDLIB
19334 #include <stdlib.h>
19336 #$i_unistd I_UNISTD
19338 # include <unistd.h>
19340 #$d_sysconf HAS_SYSCONF
19341 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19342 #ifdef HAS_STDIO_STREAM_ARRAY
19343 # define STDIO_STREAM_ARRAY $stdio_stream_array
19348 p = fopen("try.out", "w");
19352 # ifdef TRY_FPRINTF
19356 #ifdef TRY_FFLUSH_NULL
19359 #ifdef TRY_FFLUSH_ALL
19361 long open_max = -1;
19362 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19363 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19365 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19366 open_max = sysconf(_SC_OPEN_MAX);
19369 open_max = FOPEN_MAX;
19372 open_max = OPEN_MAX;
19381 # ifdef HAS_STDIO_STREAM_ARRAY
19382 if (open_max > 0) {
19384 for (i = 0; i < open_max; i++)
19385 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19386 STDIO_STREAM_ARRAY[i]._file < open_max &&
19387 STDIO_STREAM_ARRAY[i]._flag)
19388 fflush(&STDIO_STREAM_ARRAY[i]);
19396 : first we have to find out how _not_ to flush
19398 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19400 set try -DTRY_FPUTC
19401 if eval $compile; then
19402 $run ./try 2>/dev/null
19405 if $test ! -s try.out -a "X$code" = X42; then
19411 set try -DTRY_FPRINTF
19412 if eval $compile; then
19413 $run ./try 2>/dev/null
19416 if $test ! -s try.out -a "X$code" = X42; then
19417 output=-DTRY_FPRINTF
19423 : check for fflush NULL behaviour
19424 case "$fflushNULL" in
19425 '') set try -DTRY_FFLUSH_NULL $output
19426 if eval $compile; then
19427 $run ./try 2>/dev/null
19430 if $test -s try.out -a "X$code" = X42; then
19431 fflushNULL="`$cat try.out`"
19433 if $test "X$code" != X42; then
19435 (If this test failed, don't worry, we'll try another method shortly.)
19440 $rm -f core try.core core.try.*
19441 case "$fflushNULL" in
19443 Your fflush(NULL) works okay for output streams.
19444 Let's see if it clobbers input pipes...
19446 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19447 # bug that improperly flushes the input end of pipes. So we avoid the
19448 # autoflush on fork/system/exec support for now. :-(
19449 $cat >tryp.c <<EOCP
19452 main(int argc, char **argv)
19458 while ((i = getc(stdin)) != -1
19459 && (*bp++ = i) != '\n'
19460 && bp < &buf[1024])
19463 fprintf(stdout, "%s", buf);
19471 fflushNULL="$define"
19473 if eval $compile; then
19475 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19476 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19478 fflush(NULL) seems to behave okay with input streams.
19480 fflushNULL="$define"
19483 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19485 fflushNULL="$undef"
19488 $rm -f core tryp.c tryp.core core.tryp.*
19491 Your fflush(NULL) isn't working (contrary to ANSI C).
19493 fflushNULL="$undef"
19496 Cannot figure out whether your fflush(NULL) works or not.
19497 I'm assuming it doesn't (contrary to ANSI C).
19499 fflushNULL="$undef"
19503 $define|true|[yY]*)
19504 fflushNULL="$define"
19507 fflushNULL="$undef"
19510 : check explicit looping only if NULL did not work, and if the pipe
19511 : bug does not show up on an explicit flush too
19512 case "$fflushNULL" in
19514 $cat >tryp.c <<EOCP
19517 main(int argc, char **argv)
19523 while ((i = getc(stdin)) != -1
19524 && (*bp++ = i) != '\n'
19525 && bp < &buf[1024])
19528 fprintf(stdout, "%s", buf);
19537 if eval $compile; then
19539 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19540 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19542 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19544 : now check for fflushall behaviour
19545 case "$fflushall" in
19546 '') set try -DTRY_FFLUSH_ALL $output
19547 if eval $compile; then
19549 (Now testing the other method--but note that this also may fail.)
19551 $run ./try 2>/dev/null
19554 if $test -s try.out -a "X$code" = X42; then
19555 fflushall="`$cat try.out`"
19559 case "$fflushall" in
19561 Whew. Flushing explicitly all the stdio streams works.
19563 fflushall="$define"
19566 Sigh. Flushing explicitly all the stdio streams doesn't work.
19571 Cannot figure out whether flushing stdio streams explicitly works or not.
19572 I'm assuming it doesn't.
19578 "$define"|true|[yY]*)
19579 fflushall="$define"
19587 All is futile. Even fflush(stdin) clobbers input pipes!
19594 $rm -f core tryp.c tryp.core core.tryp.*
19596 *) fflushall="$undef"
19600 case "$fflushNULL$fflushall" in
19603 OK, I give up. I cannot figure out how to flush pending stdio output.
19604 We won't be flushing handles at all before fork/exec/popen.
19610 : Store the full pathname to the ar program for use in the C program
19611 : Respect a hint or command line value for full_ar.
19616 : Store the full pathname to the sed program for use in the C program
19619 : see what type gids are declared as in the kernel
19621 echo "Looking for the type for group ids returned by getgid()."
19622 set gid_t gidtype xxx stdio.h sys/types.h
19626 xxx=`./findhdr sys/user.h`
19627 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19629 unsigned) dflt="$1 $2" ;;
19633 *) dflt="$gidtype";;
19636 gid_t) echo "gid_t found." ;;
19637 *) rp="What is the type for group ids returned by getgid()?"
19643 : Check the size of GID
19646 *_t) zzz="$gidtype" ;;
19649 echo "Checking the size of $zzz..." >&4
19651 #include <sys/types.h>
19653 #$i_stdlib I_STDLIB
19655 #include <stdlib.h>
19658 printf("%d\n", (int)sizeof($gidtype));
19663 if eval $compile_ok; then
19667 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19670 echo "Your $zzz is $gidsize bytes long."
19675 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19679 : Check if GID is signed
19682 *_t) zzz="$gidtype" ;;
19685 echo "Checking the sign of $zzz..." >&4
19687 #include <sys/types.h>
19698 if eval $compile; then
19702 echo "(I can't execute the test program--guessing unsigned.)" >&4
19706 1) echo "Your $zzz is unsigned." ;;
19707 -1) echo "Your $zzz is signed." ;;
19713 echo "(I can't compile the test program--guessing unsigned.)" >&4
19717 : Check 64bit sizes
19720 if $test X"$quadtype" != X; then
19722 echo "Checking how to print 64-bit integers..." >&4
19724 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19725 $cat >try.c <<'EOCP'
19726 #include <sys/types.h>
19729 int q = 12345678901;
19730 printf("%ld\n", q);
19734 if eval $compile; then
19738 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19739 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19740 echo "We will use %d."
19746 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19747 $cat >try.c <<'EOCP'
19748 #include <sys/types.h>
19751 long q = 12345678901;
19752 printf("%ld\n", q);
19756 if eval $compile; then
19760 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19761 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19762 echo "We will use %ld."
19768 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19769 $cat >try.c <<'EOCP'
19770 #include <sys/types.h>
19771 #include <inttypes.h>
19774 int64_t q = 12345678901;
19775 printf("%" PRId64 "\n", q);
19779 if eval $compile; then
19783 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19784 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19785 echo "We will use the C9X style."
19791 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19793 #include <sys/types.h>
19796 $quadtype q = 12345678901;
19797 printf("%Ld\n", q);
19801 if eval $compile; then
19805 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19806 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19807 echo "We will use %Ld."
19813 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19814 $cat >try.c <<'EOCP'
19815 #include <sys/types.h>
19818 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19819 printf("%lld\n", q);
19823 if eval $compile; then
19827 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19828 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19829 echo "We will use the %lld style."
19835 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19837 #include <sys/types.h>
19840 $quadtype q = 12345678901;
19841 printf("%qd\n", q);
19845 if eval $compile; then
19849 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19850 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19851 echo "We will use %qd."
19857 if $test X"$sPRId64" = X; then
19858 echo "Cannot figure out how to print 64-bit integers." >&4
19865 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19866 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19868 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19869 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19873 : Check format strings for internal types
19875 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19877 if $test X"$ivsize" = X8; then
19878 ivdformat="$sPRId64"
19879 uvuformat="$sPRIu64"
19880 uvoformat="$sPRIo64"
19881 uvxformat="$sPRIx64"
19882 uvXUformat="$sPRIXU64"
19884 if $test X"$ivsize" = X"$longsize"; then
19891 if $test X"$ivsize" = X"$intsize"; then
19899 if $test X"$ivsize" = X"$shortsize"; then
19910 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19911 nveformat="$sPRIeldbl"
19912 nvfformat="$sPRIfldbl"
19913 nvgformat="$sPRIgldbl"
19914 nvEUformat="$sPRIEUldbl"
19915 nvFUformat="$sPRIFUldbl"
19916 nvGUformat="$sPRIGUldbl"
19926 case "$ivdformat" in
19927 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19932 : Check format string for GID
19935 $echo "Checking the format string to be used for gids..." >&4
19938 -1) if $test X"$gidsize" = X"$ivsize"; then
19939 gidformat="$ivdformat"
19941 if $test X"$gidsize" = X"$longsize"; then
19944 if $test X"$gidsize" = X"$intsize"; then
19947 if $test X"$gidsize" = X"$shortsize"; then
19954 *) if $test X"$gidsize" = X"$uvsize"; then
19955 gidformat="$uvuformat"
19957 if $test X"$gidsize" = X"$longsize"; then
19960 if $test X"$gidsize" = X"$intsize"; then
19963 if $test X"$gidsize" = X"$shortsize"; then
19972 : see if getgroups exists
19973 set getgroups d_getgrps
19976 : see if setgroups exists
19977 set setgroups d_setgrps
19980 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19982 case "$d_getgrps$d_setgrps" in
19984 case "$groupstype" in
19985 '') dflt="$gidtype" ;;
19986 *) dflt="$groupstype" ;;
19989 What type of pointer is the second argument to getgroups() and setgroups()?
19990 Usually this is the same as group ids, $gidtype, but not always.
19993 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19997 *) groupstype="$gidtype";;
20000 : MAD = Misc Attribute Definition
20002 if $test $patchlevel -lt 9; then
20003 : MAD is not available in 5.8.x or earlier.
20007 $define|true|[yY]*) dflt='y' ;;
20012 Would you like to build with Misc Attribute Decoration? This is development
20013 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
20014 overhead on the interpreter.
20016 If this doesn't make any sense to you, just accept the default '$dflt'.
20018 rp='Build Perl with MAD?'
20023 madlyh='madly.h madly.act madly.tab'
20025 madlyobj="madly$_o" ;;
20034 : check whether make sets MAKE
20036 echo "Checking if your $make program sets \$(MAKE)..." >&4
20037 case "$make_set_make" in
20039 $sed 's/^X //' > testmake.mak << 'EOF'
20041 X @echo 'maketemp="$(MAKE)"'
20043 case "`$make -f testmake.mak 2>/dev/null`" in
20044 *maketemp=*) make_set_make='#' ;;
20045 *) make_set_make="MAKE=$make" ;;
20047 $rm -f testmake.mak
20050 case "$make_set_make" in
20051 '#') echo "Yup, it does.";;
20052 *) echo "Nope, it doesn't.";;
20055 : see what type is used for mode_t
20056 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
20057 set mode_t modetype int stdio.h sys/types.h
20060 : see if we need va_copy
20062 case "$i_stdarg" in
20065 #include <stdarg.h>
20067 #$i_stdlib I_STDLIB
20069 #include <stdlib.h>
20071 #include <signal.h>
20074 ivfprintf(FILE *f, const char *fmt, va_list *valp)
20076 return vfprintf(f, fmt, *valp);
20080 myvfprintf(FILE *f, const char *fmt, va_list val)
20082 return ivfprintf(f, fmt, &val);
20086 myprintf(char *fmt, ...)
20089 va_start(val, fmt);
20090 return myvfprintf(stdout, fmt, val);
20094 main(int ac, char **av)
20096 signal(SIGSEGV, exit);
20098 myprintf("%s%cs all right, then\n", "that", '\'');
20103 if eval $compile && $run ./try 2>&1 >/dev/null; then
20104 case "`$run ./try`" in
20105 "that's all right, then")
20111 yes) echo "It seems that you don't need va_copy()." >&4
20112 need_va_copy="$undef"
20114 *) echo "It seems that va_copy() or similar will be needed." >&4
20115 need_va_copy="$define"
20120 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
20124 : see what type is used for size_t
20125 rp="What is the type used for the length parameter for string functions?"
20126 set size_t sizetype 'unsigned int' stdio.h sys/types.h
20129 : check for type of arguments to gethostbyaddr.
20130 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
20131 case "$d_gethbyaddr" in
20135 Checking to see what type of arguments are accepted by gethostbyaddr().
20137 hdrs="$define sys/types.h
20138 $d_socket sys/socket.h
20139 $i_niin netinet/in.h
20141 $i_unistd unistd.h"
20142 : The first arg can 'char *' or 'void *'
20143 : The second arg is some of integral type
20144 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
20145 for yyy in size_t long int; do
20146 case "$netdb_host_type" in
20147 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
20148 if ./protochk "$try" $hdrs; then
20149 echo "Your system accepts $xxx for the first arg."
20150 echo "...and $yyy for the second arg."
20151 netdb_host_type="$xxx"
20152 netdb_hlen_type="$yyy"
20158 : In case none of those worked, prompt the user.
20159 case "$netdb_host_type" in
20160 '') rp='What is the type for the 1st argument to gethostbyaddr?'
20163 netdb_host_type=$ans
20164 rp='What is the type for the 2nd argument to gethostbyaddr?'
20167 netdb_hlen_type=$ans
20171 *) : no gethostbyaddr, so pick harmless defaults
20172 netdb_host_type='char *'
20173 netdb_hlen_type="$sizetype"
20176 # Remove the "const" if needed. -- but then we'll have a
20178 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
20181 : check for type of argument to gethostbyname.
20182 if test "X$netdb_name_type" = X ; then
20183 case "$d_gethbyname" in
20187 Checking to see what type of argument is accepted by gethostbyname().
20189 hdrs="$define sys/types.h
20190 $d_socket sys/socket.h
20191 $i_niin netinet/in.h
20193 $i_unistd unistd.h"
20194 for xxx in "const char *" "char *"; do
20195 case "$netdb_name_type" in
20196 '') try="$extern_C struct hostent *gethostbyname($xxx);"
20197 if ./protochk "$try" $hdrs; then
20198 echo "Your system accepts $xxx."
20199 netdb_name_type="$xxx"
20204 : In case none of those worked, prompt the user.
20205 case "$netdb_name_type" in
20206 '') rp='What is the type for the 1st argument to gethostbyname?'
20209 netdb_name_type=$ans
20213 *) : no gethostbyname, so pick harmless default
20214 netdb_name_type='char *'
20219 : check for type of 1st argument to getnetbyaddr.
20220 if test "X$netdb_net_type" = X ; then
20221 case "$d_getnbyaddr" in
20225 Checking to see what type of 1st argument is accepted by getnetbyaddr().
20227 hdrs="$define sys/types.h
20228 $d_socket sys/socket.h
20229 $i_niin netinet/in.h
20231 $i_unistd unistd.h"
20232 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
20233 case "$netdb_net_type" in
20234 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
20235 if ./protochk "$try" $hdrs; then
20236 echo "Your system accepts $xxx."
20237 netdb_net_type="$xxx"
20242 : In case none of those worked, prompt the user.
20243 case "$netdb_net_type" in
20244 '') rp='What is the type for the 1st argument to getnetbyaddr?'
20247 netdb_net_type=$ans
20251 *) : no getnetbyaddr, so pick harmless default
20252 netdb_net_type='long'
20256 : locate the preferred pager for this system
20263 [a-zA-Z]:/*) dflt=$pg;;
20267 [a-zA-Z]:/*) dflt=$more;;
20271 [a-zA-Z]:/*) dflt=$less;;
20274 '') dflt=/usr/ucb/more;;
20282 rp='What pager is used on your system?'
20286 : see what type pids are declared as in the kernel
20287 rp="What is the type of process ids on this system?"
20288 set pid_t pidtype int stdio.h sys/types.h
20291 : see if ar generates random libraries by itself
20293 echo "Checking how to generate random libraries on your machine..." >&4
20294 echo 'int bar1() { return bar2(); }' > bar1.c
20295 echo 'int bar2() { return 2; }' > bar2.c
20297 #$i_stdlib I_STDLIB
20299 #include <stdlib.h>
20301 int main() { printf("%d\n", bar1()); exit(0); }
20303 $cc $ccflags -c bar1.c >/dev/null 2>&1
20304 $cc $ccflags -c bar2.c >/dev/null 2>&1
20305 $cc $ccflags -c foo.c >/dev/null 2>&1
20306 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20307 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20308 $run ./foobar >/dev/null 2>&1; then
20309 echo "$ar appears to generate random libraries itself."
20311 if [ "X$ranlib" = "X" ]; then
20314 elif $ar s bar$_a >/dev/null 2>&1 &&
20315 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20316 $run ./foobar >/dev/null 2>&1; then
20317 echo "a table of contents needs to be added with '$ar s'."
20320 elif $ar ts bar$_a >/dev/null 2>&1 &&
20321 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20322 $run ./foobar >/dev/null 2>&1; then
20323 echo "a table of contents needs to be added with '$ar ts'."
20330 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20331 $test -f $ranlib || ranlib=''
20334 if $test -n "$ranlib"; then
20335 echo "your system has '$ranlib'; we'll use that."
20338 echo "your system doesn't seem to support random libraries"
20339 echo "so we'll use lorder and tsort to order the libraries."
20346 : see if this is a values.h system
20347 set values.h i_values
20350 : Check the max offset that gmtime and localtime accept
20351 echo "Checking max offsets that gmtime () accepts"
20354 define) yyy="#include <values.h>" ;;
20358 case "$sGMTIME_min/$sGMTIME_max" in
20361 #include <sys/types.h>
20370 void gm_check (time_t t, int min_year, int max_year)
20373 if ( tmp == NULL ||
20374 /* Check tm_year overflow */
20375 tmp->tm_year < min_year || tmp->tm_year > max_year)
20386 gm_check (MAXLONG, 69, 0x7fffffff);
20388 if (tmp == NULL || tmp->tm_year < 0) {
20389 for (i = 63; i >= 0; i--) {
20390 time_t x = pt | ((time_t)1 << i);
20391 if (x < 0 || x < pt) continue;
20392 gm_check (x, 69, 0x7fffffff);
20395 printf ("sGMTIME_max=%ld\n", pt);
20404 gm_check (MINLONG, -1900, 70);
20407 for (i = 36; i >= 0; i--) {
20408 time_t x = pt - ((time_t)1 << i);
20409 if (x > 0) continue;
20410 gm_check (x, -1900, 70);
20413 printf ("sGMTIME_min=%ld\n", pt);
20417 int main (int argc, char *argv[])
20419 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20426 if eval $compile; then
20429 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20435 echo "Checking max offsets that localtime () accepts"
20437 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20440 #include <sys/types.h>
20449 void local_check (time_t t, int min_year, int max_year)
20451 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20454 tmp = localtime (&t);
20455 if ( tmp == NULL ||
20456 /* Check tm_year overflow */
20457 tmp->tm_year < min_year || tmp->tm_year > max_year)
20461 } /* local_check */
20468 local_check (MAXLONG, 69, 0x7fffffff);
20470 if (tmp == NULL || tmp->tm_year < 0) {
20471 for (i = 63; i >= 0; i--) {
20472 time_t x = pt | ((time_t)1 << i);
20473 if (x < 0 || x < pt) continue;
20474 local_check (x, 69, 0x7fffffff);
20477 printf ("sLOCALTIME_max=%ld\n", pt);
20486 local_check (MINLONG, -1900, 70);
20489 for (i = 36; i >= 0; i--) {
20490 time_t x = pt - ((time_t)1 << i);
20491 if (x > 0) continue;
20492 local_check (x, -1900, 70);
20495 printf ("sLOCALTIME_min=%ld\n", pt);
20499 int main (int argc, char *argv[])
20507 if eval $compile; then
20510 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20516 : check for type of arguments to select.
20517 case "$selecttype" in
20518 '') case "$d_select" in
20522 Checking to see what type of arguments are accepted by select().
20524 hdrs="$define sys/types.h
20525 $i_systime sys/time.h
20526 $i_sysselct sys/select.h
20527 $d_socket sys/socket.h"
20528 : The first arg can be int, unsigned, or size_t
20529 : The last arg may or may not be 'const'
20531 : void pointer has been seen but using that
20532 : breaks the selectminbits test
20533 for xxx in 'fd_set *' 'int *'; do
20534 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20535 for tmo in 'struct timeval *' 'const struct timeval *'; do
20537 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20538 if ./protochk "$try" $hdrs; then
20539 echo "Your system accepts $xxx."
20548 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20549 case "$d_fd_set" in
20550 $define) dflt="fd_set *" ;;
20559 *) : no select, so pick a harmless default
20566 : check for the select 'width'
20567 case "$selectminbits" in
20568 '') safebits=`expr $ptrsize \* 8`
20569 case "$d_select" in
20573 Checking to see on how many bits at a time your select() operates...
20576 #include <sys/types.h>
20578 #$i_systime I_SYS_TIME
20579 #$i_systimek I_SYS_TIME_KERNEL
20584 # ifdef I_SYS_TIME_KERNEL
20587 # include <sys/time.h>
20588 # ifdef I_SYS_TIME_KERNEL
20592 #$i_sysselct I_SYS_SELECT
20593 #ifdef I_SYS_SELECT
20594 #include <sys/select.h>
20596 #$d_socket HAS_SOCKET
20598 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20601 #$i_stdlib I_STDLIB
20603 #include <stdlib.h>
20606 #define S sizeof(*(b))
20608 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20609 #define NBITS (NBYTES * 8)
20611 char *s = (char *)malloc(NBYTES);
20620 fp = fopen("try.c", "r");
20626 b = ($selecttype)s;
20627 for (i = 0; i < NBITS; i++)
20631 select(fd + 1, b, 0, 0, &t);
20632 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20634 printf("%d\n", i + 1);
20639 if eval $compile_ok; then
20640 selectminbits=`$run ./try`
20641 case "$selectminbits" in
20643 Cannot figure out on how many bits at a time your select() operates.
20644 I'll play safe and guess it is $safebits bits.
20646 selectminbits=$safebits
20647 bits="$safebits bits"
20650 *) bits="$selectminbits bits" ;;
20652 echo "Your select() operates on $bits at a time." >&4
20654 rp='What is the minimum number of bits your select() operates on?'
20655 case "$byteorder" in
20656 12345678) dflt=64 ;;
20662 selectminbits="$val"
20666 *) : no select, so pick a harmless default
20667 selectminbits=$safebits
20673 : Trace out the files included by signal.h, then look for SIGxxx names.
20674 if [ "X$fieldn" = X ]; then
20675 : Just make some guesses. We check them later.
20676 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20678 xxx=`echo '#include <signal.h>' |
20679 $cppstdin $cppminus $cppflags 2>/dev/null |
20680 $grep '^[ ]*#.*include' |
20681 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20682 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20685 for xx in $xxx /dev/null ; do
20686 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20688 case "$xxxfiles" in
20689 '') xxxfiles=`./findhdr signal.h` ;;
20692 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20693 print substr($2, 4, 20)
20695 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20696 print substr($3, 4, 20)
20698 : Append some common names just in case the awk scan failed.
20699 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20700 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20701 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20702 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20703 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20705 : generate a few handy files for later
20706 $cat > signal.c <<EOCP
20707 #include <sys/types.h>
20708 #include <signal.h>
20709 #$i_stdlib I_STDLIB
20711 #include <stdlib.h>
20716 /* Strange style to avoid deeply-nested #if/#else/#endif */
20719 # define NSIG (_NSIG)
20725 # define NSIG (SIGMAX+1)
20731 # define NSIG (SIG_MAX+1)
20737 # define NSIG (_SIG_MAX+1)
20743 # define NSIG (MAXSIG+1)
20749 # define NSIG (MAX_SIG+1)
20754 # ifdef SIGARRAYSIZE
20755 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20761 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20765 /* Default to some arbitrary number that's big enough to get most
20766 of the common signals.
20772 printf("NSIG %d\n", NSIG);
20778 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20780 printf "#ifdef SIG"; printf $1; printf "\n"
20781 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20782 printf $1; printf ");\n"
20786 printf "#endif /* JUST_NSIG */\n";
20787 printf "exit(0);\n}\n";
20790 $cat >signal.awk <<'EOP'
20791 BEGIN { ndups = 0 }
20792 $1 ~ /^NSIG$/ { nsig = $2 }
20793 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20794 if ($2 > maxsig) { maxsig = $2 }
20795 if (sig_name[$2]) {
20796 dup_name[ndups] = $1
20797 dup_num[ndups] = $2
20809 printf("NSIG %d\n", nsig);
20810 for (n = 1; n < nsig; n++) {
20812 printf("%s %d\n", sig_name[n], sig_num[n])
20815 printf("NUM%d %d\n", n, n)
20818 for (n = 0; n < ndups; n++) {
20819 printf("%s %d\n", dup_name[n], dup_num[n])
20823 $cat >signal_cmd <<EOS
20825 if $test -s signal.lst; then
20826 echo "Using your existing signal.lst file"
20831 $cat >>signal_cmd <<'EOS'
20834 if eval $compile_ok; then
20835 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20836 $uniq | $awk -f signal.awk >signal.lst
20838 echo "(I can't seem be able to compile the whole test program)" >&4
20839 echo "(I'll try it in little pieces.)" >&4
20840 set signal -DJUST_NSIG
20841 if eval $compile_ok; then
20842 $run ./signal$_exe > signal.nsg
20845 echo "I can't seem to figure out how many signals you have." >&4
20846 echo "Guessing 50." >&4
20847 echo 'NSIG 50' > signal.nsg
20849 : Now look at all the signal names, one at a time.
20850 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20851 $cat > signal.c <<EOCP
20852 #include <sys/types.h>
20853 #include <signal.h>
20856 printf("$xx %d\n", SIG${xx});
20861 if eval $compile; then
20862 echo "SIG${xx} found."
20863 $run ./signal$_exe >> signal.ls1
20865 echo "SIG${xx} NOT found."
20868 if $test -s signal.ls1; then
20869 $cat signal.nsg signal.ls1 |
20870 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20874 if $test -s signal.lst; then
20877 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20878 echo 'kill -l' >signal
20879 set X `csh -f <signal`
20883 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20885 echo $@ | $tr ' ' $trnl | \
20886 $awk '{ printf "%s %d\n", $1, ++s; }
20887 END { printf "NSIG %d\n", ++s }' >signal.lst
20889 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20891 chmod a+x signal_cmd
20892 $eunicefix signal_cmd
20894 : generate list of signal names
20896 case "$sig_name_init" in
20898 *) case "$sig_num_init" in
20899 ''|*,*) doinit=yes ;;
20904 echo "Generating a list of signal names and numbers..." >&4
20906 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20907 sig_name=`$awk 'BEGIN { printf "ZERO " }
20908 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20909 sig_num=`$awk 'BEGIN { printf "0 " }
20910 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20911 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20912 !/^NSIG/ { printf "\"%s\", ", $1 }
20913 END { printf "0\n" }' signal.lst`
20914 sig_num_init=`$awk 'BEGIN { printf "0, " }
20915 !/^NSIG/ { printf "%d, ", $2}
20916 END { printf "0\n"}' signal.lst`
20919 echo "The following $sig_count signals are available:"
20921 echo $sig_name | $awk \
20922 'BEGIN { linelen = 0 }
20924 for (i = 1; i <= NF; i++) {
20925 name = "SIG" $i " "
20926 linelen = linelen + length(name)
20927 if (linelen > 70) {
20929 linelen = length(name)
20935 sig_size=`echo $sig_name | awk '{print NF}'`
20936 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20938 : Check size of size
20940 case "$sizetype" in
20941 *_t) zzz="$sizetype" ;;
20942 *) zzz="filesize" ;;
20944 echo "Checking the size of $zzz..." >&4
20946 #include <sys/types.h>
20948 #$i_stdlib I_STDLIB
20950 #include <stdlib.h>
20953 printf("%d\n", (int)sizeof($sizetype));
20958 if eval $compile_ok; then
20962 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20965 echo "Your $zzz size is $sizesize bytes."
20970 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20974 : check for socklen_t
20976 echo "Checking to see if you have socklen_t..." >&4
20978 #include <sys/types.h>
20979 #$d_socket HAS_SOCKET
20981 #include <sys/socket.h>
20983 int main() { socklen_t x = 16; }
20986 if eval $compile; then
20988 echo "You have socklen_t."
20991 echo "You do not have socklen_t."
20992 case "$sizetype" in
20993 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
21000 : see if this is a socks.h system
21001 set socks.h i_socks
21004 : check for type of the size argument to socket calls
21005 case "$d_socket" in
21009 Checking to see what type is the last argument of accept().
21012 case "$d_socklen_t" in
21013 "$define") yyy="$yyy socklen_t"
21015 yyy="$yyy $sizetype int long unsigned"
21016 for xxx in $yyy; do
21017 case "$socksizetype" in
21018 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
21019 case "$usesocks" in
21021 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
21022 echo "Your system accepts '$xxx *' for the last argument of accept()."
21023 socksizetype="$xxx"
21026 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
21027 echo "Your system accepts '$xxx *' for the last argument of accept()."
21028 socksizetype="$xxx"
21035 : In case none of those worked, prompt the user.
21036 case "$socksizetype" in
21037 '') rp='What is the type for socket address structure sizes?'
21044 *) : no sockets, so pick relatively harmless default
21049 : see what type is used for signed size_t
21050 set ssize_t ssizetype int stdio.h sys/types.h
21055 #$i_stdlib I_STDLIB
21057 #include <stdlib.h>
21059 #include <sys/types.h>
21060 #define Size_t $sizetype
21061 #define SSize_t $dflt
21064 if (sizeof(Size_t) == sizeof(SSize_t))
21066 else if (sizeof(Size_t) == sizeof(int))
21075 if eval $compile_ok && $run ./try > /dev/null; then
21076 ssizetype=`$run ./try`
21077 echo "I'll be using $ssizetype for functions returning a byte count." >&4
21080 Help! I can't compile and run the ssize_t test program: please enlighten me!
21081 (This is probably a misconfiguration in your system or libraries, and
21082 you really ought to fix it. Still, I'll try anyway.)
21084 I need a type that is the same size as $sizetype, but is guaranteed to
21085 be signed. Common values are ssize_t, int and long.
21088 rp="What signed type is the same size as $sizetype?"
21094 : see what type of char stdio uses.
21096 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
21097 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
21098 echo "Your stdio uses unsigned chars." >&4
21099 stdchar="unsigned char"
21101 echo "Your stdio uses signed chars." >&4
21106 : see what type uids are declared as in the kernel
21108 echo "Looking for the type for user ids returned by getuid()."
21109 set uid_t uidtype xxx stdio.h sys/types.h
21113 xxx=`./findhdr sys/user.h`
21114 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
21116 unsigned) dflt="$1 $2" ;;
21120 *) dflt="$uidtype";;
21123 uid_t) echo "uid_t found." ;;
21124 *) rp="What is the type for user ids returned by getuid()?"
21130 : Check size of UID
21133 *_t) zzz="$uidtype" ;;
21136 echo "Checking the size of $zzz..." >&4
21138 #include <sys/types.h>
21140 #$i_stdlib I_STDLIB
21142 #include <stdlib.h>
21145 printf("%d\n", (int)sizeof($uidtype));
21150 if eval $compile_ok; then
21154 echo "(I can't execute the test program--guessing $uidsize.)" >&4
21157 echo "Your $zzz is $uidsize bytes long."
21162 echo "(I can't compile the test program--guessing $uidsize.)" >&4
21165 : Check if UID is signed
21168 *_t) zzz="$uidtype" ;;
21171 echo "Checking the sign of $zzz..." >&4
21173 #include <sys/types.h>
21184 if eval $compile; then
21188 echo "(I can't execute the test program--guessing unsigned.)" >&4
21192 1) echo "Your $zzz is unsigned." ;;
21193 -1) echo "Your $zzz is signed." ;;
21199 echo "(I can't compile the test program--guessing unsigned.)" >&4
21203 : Check format string for UID
21205 $echo "Checking the format string to be used for uids..." >&4
21208 -1) if $test X"$uidsize" = X"$ivsize"; then
21209 uidformat="$ivdformat"
21211 if $test X"$uidsize" = X"$longsize"; then
21214 if $test X"$uidsize" = X"$intsize"; then
21217 if $test X"$uidsize" = X"$shortsize"; then
21224 *) if $test X"$uidsize" = X"$uvsize"; then
21225 uidformat="$uvuformat"
21227 if $test X"$uidsize" = X"$longsize"; then
21230 if $test X"$uidsize" = X"$intsize"; then
21233 if $test X"$uidsize" = X"$shortsize"; then
21242 : Check if site customization support was requested
21243 case "$usesitecustomize" in
21244 $define|true|[Yy]*)
21245 usesitecustomize="$define"
21248 usesitecustomize="$undef"
21252 : see if prototypes support variable argument declarations
21254 case "$prototype$i_stdarg" in
21256 echo "It appears we'll be able to prototype varargs functions." >&4
21260 echo "Too bad... We won't be using prototyped varargs functions..." >&4
21267 : determine compiler compiler
21276 if $test -f "$byacc$_exe"; then
21278 comp="byacc or $comp"
21280 if $test -f "$bison$_exe"; then
21281 comp="$comp or bison -y"
21283 rp="Which compiler compiler ($comp) shall I use?"
21292 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
21298 : see if this is a assert.h system
21299 set assert.h i_assert
21302 : see if this is a fp.h system
21306 : see if this is a fp_class.h system
21307 set fp_class.h i_fp_class
21310 : see if gdbm.h is available
21315 : see if gdbm_open exists
21316 set gdbm_open d_gdbm_open
21318 case "$d_gdbm_open" in
21321 echo "We won't be including <gdbm.h>"
21330 : see if this is a ieeefp.h system
21331 case "$i_ieeefp" in
21332 '' ) set ieeefp.h i_ieeefp
21337 : see if this is a libutil.h system
21338 set libutil.h i_libutil
21341 : see if mach cthreads are available
21342 if test "X$usethreads" = "X$define"; then
21343 set mach/cthreads.h i_machcthr
21346 i_machcthr="$undef"
21349 : see if this is a mntent.h system
21350 set mntent.h i_mntent
21353 : see if net/errno.h is available
21355 set net/errno.h val
21358 : Unfortunately, it causes problems on some systems. Arrgh.
21361 cat > try.c <<'EOM'
21364 #include <net/errno.h>
21370 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21371 echo "We'll be including <net/errno.h>." >&4
21373 echo "We won't be including <net/errno.h>." >&4
21382 : see if netinet/tcp.h is available
21383 set netinet/tcp.h i_netinettcp
21386 : see if this is a poll.h system
21390 : see if this is a prot.h system
21394 : Preprocessor symbols
21396 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21397 $cat <<'EOSH' > Cppsym.know
21398 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21399 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21400 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21401 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21402 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21403 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21404 bull c cadmus clipper CMU COFF COMPILER_VERSION
21405 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21406 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21407 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21408 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21410 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21411 H3050R H3050RX hbullx20 hcx host_mips
21412 hp200 hp300 hp700 HP700 hp800 hp9000
21413 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21414 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21415 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21416 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21417 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21418 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21419 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21420 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21421 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21422 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21423 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21424 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21425 MATH_HAS_NO_SIDE_EFFECTS
21426 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21427 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21428 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21429 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21430 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21431 NetBSD news1500 news1700 news1800 news1900 news3700
21432 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21433 ns32016 ns32332 ns32k nsc32000
21434 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21435 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21436 pc532 pdp11 PGC PIC plexus PORTAR posix
21437 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21438 POSIX_C_SOURCE POSIX_SOURCE POWER
21439 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21440 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21441 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21442 sony sony_news sonyrisc sparc sparclite spectrum
21443 stardent stdc STDC_EXT stratos sun sun3 sun386
21444 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21445 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21446 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21447 sysV68 sysV88 Tek4132 Tek4300 titan
21448 TM3200 TM5400 TM5600
21449 tower tower32 tower32_200 tower32_600 tower32_700
21450 tower32_800 tower32_850 tss
21451 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21452 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21453 unix UNIX95 UNIX99 unixpc unos
21454 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21455 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21456 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21458 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21459 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21460 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21463 # Maybe put other stuff here too.
21464 cat <<EOSH >>Cppsym.know
21467 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21468 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21469 $cat Cppsym.know > Cppsym.c
21470 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21471 $rm -f Cppsym.a Cppsym.b Cppsym.c
21472 cat <<EOSH > Cppsym
21474 if $test \$# -gt 0; then
21475 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21476 if $test -s Cppsym.got; then
21483 $tr " " "$trnl" | ./Cppsym.try
21489 cat <<EOSH > Cppsym.try
21491 cat <<'EOCP' > try.c
21494 #define STRINGIFY(a) "a"
21496 #if cpp_stuff == 42
21497 #define StGiFy(a) #a
21498 #define STRINGIFY(a) StGiFy(a)
21500 #if $cpp_stuff != 1 && $cpp_stuff != 42
21501 # include "Bletch: How does this C preprocessor stringify macros?"
21507 cat <<'EOSH' >> Cppsym.try
21509 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21510 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21511 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21512 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21514 echo 'return 0;}' >> try.c
21516 cat <<EOSH >> Cppsym.try
21518 case "$osname-$gccversion" in
21519 irix-) ccflags="\$ccflags -woff 1178" ;;
21520 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21522 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21524 chmod +x Cppsym.try
21525 $eunicefix Cppsym.try
21526 ./Cppsym < Cppsym.know > Cppsym.true
21527 : Add in any linux cpp "predefined macros":
21528 case "$osname::$gccversion" in
21529 *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
21531 rm -f $tHdrH'.h' $tHdrH
21533 if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21534 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21535 if [ -s $tHdrH'_cppsym.real' ]; then
21536 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21539 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21542 : now check the C compiler for additional symbols
21543 postprocess_cc_v=''
21545 aix) postprocess_cc_v="|$tr , ' '" ;;
21552 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21555 -D*) echo "\$i" | $sed 's/^-D//';;
21556 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21561 postprocess_cc_v=''
21564 ./ccsym > ccsym1.raw
21565 if $test -s ccsym1.raw; then
21566 $sort ccsym1.raw | $uniq >ccsym.raw
21568 mv ccsym1.raw ccsym.raw
21571 $awk '/\=/ { print $0; next }
21572 { print $0"=1" }' ccsym.raw >ccsym.list
21573 $comm -13 Cppsym.true ccsym.list >ccsym.own
21574 $comm -12 Cppsym.true ccsym.list >ccsym.com
21575 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21577 if $test -z ccsym.raw; then
21578 echo "Your C compiler doesn't seem to define any symbols!" >&4
21580 echo "However, your C preprocessor defines the following symbols:"
21583 cppsymbols=`$cat Cppsym.true`
21584 cppsymbols=`echo $cppsymbols`
21585 cppccsymbols="$cppsymbols"
21587 if $test -s ccsym.com; then
21588 echo "Your C compiler and pre-processor define these symbols:"
21589 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
21592 cppccsymbols=`$cat ccsym.com`
21593 cppccsymbols=`echo $cppccsymbols`
21594 $test "$silent" || sleep 1
21596 if $test -s ccsym.cpp; then
21597 $test "$also" && echo " "
21598 echo "Your C pre-processor ${also}defines the following symbols:"
21599 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
21601 cppsymbols=`$cat ccsym.cpp`
21602 cppsymbols=`echo $cppsymbols`
21603 $test "$silent" || sleep 1
21605 if $test -s ccsym.own; then
21606 $test "$also" && echo " "
21607 echo "Your C compiler ${also}defines the following cpp symbols:"
21608 $sed -e 's/\(..*\)=1/\1/' ccsym.own
21609 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
21610 ccsymbols=`$cat ccsym.own`
21611 ccsymbols=`echo $ccsymbols`
21612 $test "$silent" || sleep 1
21616 : see if this is a termio system
21620 if $test `./findhdr termios.h`; then
21621 set tcsetattr i_termios
21627 "$define") echo "You have POSIX termios.h... good!" >&4;;
21628 *) if ./Cppsym pyr; then
21629 case "`/bin/universe`" in
21630 ucb) if $test `./findhdr sgtty.h`; then
21632 echo "<sgtty.h> found." >&4
21634 echo "System is pyramid with BSD universe."
21635 ./warn "<sgtty.h> not found--you could have problems."
21637 *) if $test `./findhdr termio.h`; then
21639 echo "<termio.h> found." >&4
21641 echo "System is pyramid with USG universe."
21642 ./warn "<termio.h> not found--you could have problems."
21646 if $test `./findhdr termio.h`; then
21647 echo "<termio.h> found." >&4
21649 elif $test `./findhdr sgtty.h`; then
21650 echo "<sgtty.h> found." >&4
21653 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
21656 if $test `./findhdr sgtty.h`; then
21657 echo "<sgtty.h> found." >&4
21659 elif $test `./findhdr termio.h`; then
21660 echo "<termio.h> found." >&4
21663 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
21667 set i_termio; eval $setvar
21668 val=$val2; set i_sgtty; eval $setvar
21669 val=$val3; set i_termios; eval $setvar
21671 : see if stddef is available
21672 set stddef.h i_stddef
21675 : see if sys/access.h is available
21676 set sys/access.h i_sysaccess
21679 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
21680 set sys/filio.h i_sysfilio
21683 if $test `./findhdr sys/ioctl.h`; then
21685 echo '<sys/ioctl.h> found.' >&4
21688 if $test $i_sysfilio = "$define"; then
21689 echo '<sys/ioctl.h> NOT found.' >&4
21691 $test $i_sgtty = "$define" && xxx="sgtty.h"
21692 $test $i_termio = "$define" && xxx="termio.h"
21693 $test $i_termios = "$define" && xxx="termios.h"
21694 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
21700 : see if socket ioctl defs are in sys/sockio.h
21702 xxx=`./findhdr sys/sockio.h`
21703 if $test "$xxx"; then
21704 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
21706 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
21709 echo "No socket ioctls found in <sys/sockio.h>." >&4
21714 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
21720 : see if this is a syslog.h system
21721 set syslog.h i_syslog
21724 : see if this is a sys/mode.h system
21725 set sys/mode.h i_sysmode
21728 : see if there is a sys/poll.h file
21729 set sys/poll.h i_syspoll
21732 : see if sys/resource.h has to be included
21733 set sys/resource.h i_sysresrc
21736 : see if sys/security.h is available
21737 set sys/security.h i_syssecrt
21740 : see if this is a sys/statvfs.h system
21741 set sys/statvfs.h i_sysstatvfs
21744 : see if this is a sys/un.h system
21745 set sys/un.h i_sysun
21748 : see if this is a sys/utsname.h system
21749 set sys/utsname.h i_sysutsname
21752 : see if this is a syswait system
21753 set sys/wait.h i_syswait
21756 : see if this is a ustat.h system
21757 set ustat.h i_ustat
21760 : see if this is an utime system
21761 set utime.h i_utime
21764 : see if this is a vfork system
21767 set vfork.h i_vfork
21777 echo "Looking for extensions..." >&4
21778 : If we are using the old config.sh, known_extensions may contain
21779 : old or inaccurate or duplicate values.
21780 known_extensions=''
21781 nonxs_extensions=''
21782 : We do not use find because it might not be available.
21783 : We do not just use MANIFEST because the user may have dropped
21784 : some additional extensions into the source tree and expect them
21787 : Function to recursively find available extensions, ignoring DynaLoader
21788 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21789 : In 5.10.1 and later, extensions are stored in directories
21790 : like File-Glob instead of the older File/Glob/.
21794 DynaLoader|dynaload) ;;
21796 this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
21797 leaf=`echo $xxx | $sed -e s/.*-//`;
21798 if $test -d File; then
21799 if $test -f $xxx/$leaf.xs -o -f $xxx/$leaf.c; then
21800 known_extensions="$known_extensions $1$this_ext";
21801 elif $test -f $xxx/Makefile.PL; then
21802 nonxs_extensions="$nonxs_extensions $1$this_ext";
21804 if $test -d $xxx -a $# -lt 10; then
21807 eval $find_extensions;
21813 $ls -1 $xxx > $$.tmp;
21814 if $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
21815 known_extensions="$known_extensions $this_ext";
21816 elif $contains "\.c$" $$.tmp > /dev/null 2>&1; then
21817 known_extensions="$known_extensions $this_ext";
21818 elif $test -d $xxx; then
21819 nonxs_extensions="$nonxs_extensions $this_ext";
21830 eval $find_extensions
21834 eval $find_extensions
21838 eval $find_extensions
21839 if $test -d File-Glob; then
21840 : All ext/ flattened
21842 # Special case: Add in modules that nest beyond the first level.
21843 # Currently threads/shared and Hash/Util/FieldHash, since they are
21844 # not picked up by the recursive find above (and adding in general
21845 # recursive finding breaks SDBM_File/sdbm).
21846 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
21847 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
21849 set X $known_extensions
21851 known_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
21852 set X $nonxs_extensions
21854 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
21857 : Now see which are supported on this system.
21859 for xxx in $known_extensions ; do
21863 $define) avail_ext="$avail_ext $xxx" ;;
21866 GDBM_File|gdbm_fil)
21868 $define) avail_ext="$avail_ext $xxx" ;;
21871 I18N/Langinfo|i18n_lan)
21872 case "$i_langinfo$d_nl_langinfo" in
21873 $define$define) avail_ext="$avail_ext $xxx" ;;
21877 : XXX Do we need a useipcsysv variable here
21878 case "${d_msg}${d_sem}${d_shm}" in
21879 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21882 NDBM_File|ndbm_fil)
21885 case "$osname-$use64bitint" in
21888 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21891 *) avail_ext="$avail_ext $xxx" ;;
21896 ODBM_File|odbm_fil)
21897 case "${i_dbm}${i_rpcsvcdbm}" in
21899 case "$d_cplusplus" in
21900 define) ;; # delete as a function name will not work
21901 *) case "$osname-$use64bitint" in
21904 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21907 *) avail_ext="$avail_ext $xxx" ;;
21915 case "$useopcode" in
21916 true|define|y) avail_ext="$avail_ext $xxx" ;;
21920 case "$useposix" in
21921 true|define|y) avail_ext="$avail_ext $xxx" ;;
21925 case "$d_socket" in
21928 beos) ;; # not unless BONE
21929 *) avail_ext="$avail_ext $xxx" ;;
21934 Sys/Syslog|sys/syslog)
21935 : XXX syslog requires socket
21936 case "$d_socket" in
21937 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21941 case "$usethreads" in
21943 case "$use5005threads" in
21944 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
21948 threads|threads/shared)
21949 # threads and threads::shared are special cases.
21950 # To stop people from asking "Perl 5.8.0 was supposed
21951 # to have this new fancy threads implementation but my
21952 # perl doesn't have it" and from people trying to
21953 # (re)install the threads module using CPAN.pm and
21954 # CPAN.pm then offering to reinstall Perl 5.8.0,
21955 # the threads.pm and threads/shared.pm will always be
21956 # there, croaking informatively ("you need to rebuild
21957 # all of Perl with threads, sorry") when threads haven't
21958 # been compiled in.
21960 avail_ext="$avail_ext $xxx"
21966 cygwin) avail_ext="$avail_ext $xxx" ;;
21969 XS/APItest|xs/apitest)
21970 # This is just for testing. Skip it unless we have dynamic loading.
21973 $define) avail_ext="$avail_ext $xxx" ;;
21976 XS/APItest/KeywordRPN|xs/apitest/keywordrpn)
21977 # This is just for testing. Skip it unless we have dynamic loading.
21980 $define) avail_ext="$avail_ext $xxx" ;;
21983 XS/Typemap|xs/typemap)
21984 # This is just for testing. Skip it unless we have dynamic loading.
21986 $define) avail_ext="$avail_ext $xxx" ;;
21989 *) avail_ext="$avail_ext $xxx"
21998 case "$onlyextensions" in
22000 *) keepextensions=''
22001 echo "You have requested that only certains extensions be included..." >&4
22002 for i in $onlyextensions; do
22003 case " $avail_ext " in
22005 echo "Keeping extension $i."
22006 keepextensions="$keepextensions $i"
22008 *) echo "Ignoring extension $i." ;;
22011 avail_ext="$keepextensions"
22015 case "$noextensions" in
22017 *) keepextensions=''
22018 echo "You have requested that certain extensions be ignored..." >&4
22019 for i in $avail_ext; do
22020 case " $noextensions " in
22021 *" $i "*) echo "Ignoring extension $i." ;;
22022 *) echo "Keeping extension $i.";
22023 keepextensions="$keepextensions $i"
22027 avail_ext="$keepextensions"
22031 : Now see which nonxs extensions are supported on this system.
22032 : For now assume all are.
22034 for xxx in $nonxs_extensions ; do
22036 *) nonxs_ext="$nonxs_ext $xxx"
22048 A number of extensions are supplied with $package. You may choose to
22049 compile these extensions for dynamic loading (the default), compile
22050 them into the $package executable (static loading), or not include
22051 them at all. Answer "none" to include no extensions.
22052 Note that DynaLoader is always built and need not be mentioned here.
22055 case "$dynamic_ext" in
22057 : Exclude those listed in static_ext
22059 for xxx in $avail_ext; do
22060 case " $static_ext " in
22062 *) dflt="$dflt $xxx" ;;
22069 *) dflt="$dynamic_ext"
22070 # Perhaps we are reusing an old out-of-date config.sh.
22073 if test X"$dynamic_ext" != X"$avail_ext"; then
22075 NOTICE: Your previous config.sh list may be incorrect.
22076 The extensions now available to you are
22078 but the default list from your previous config.sh is
22090 rp="What extensions do you wish to load dynamically?"
22093 none) dynamic_ext=' ' ;;
22094 *) dynamic_ext="$ans" ;;
22097 case "$static_ext" in
22099 : Exclude those already listed in dynamic linking
22101 for xxx in $avail_ext; do
22102 case " $dynamic_ext " in
22104 *) dflt="$dflt $xxx" ;;
22111 *) dflt="$static_ext"
22118 rp="What extensions do you wish to load statically?"
22121 none) static_ext=' ' ;;
22122 *) static_ext="$ans" ;;
22127 A number of extensions are supplied with $package. Answer "none"
22128 to include no extensions.
22129 Note that DynaLoader is always built and need not be mentioned here.
22132 case "$static_ext" in
22133 '') dflt="$avail_ext" ;;
22134 *) dflt="$static_ext"
22135 # Perhaps we are reusing an old out-of-date config.sh.
22138 if test X"$static_ext" != X"$avail_ext"; then
22140 NOTICE: Your previous config.sh list may be incorrect.
22141 The extensions now available to you are
22143 but the default list from your previous config.sh is
22152 : Exclude those that are not xs extensions
22156 rp="What extensions do you wish to include?"
22159 none) static_ext=' ' ;;
22160 *) static_ext="$ans" ;;
22165 # Encode is a special case. If we are building Encode as a static
22166 # extension, we need to explicitly list its subextensions as well.
22167 # For other nested extensions, this is handled automatically by
22168 # the appropriate Makefile.PL.
22169 case " $static_ext " in
22170 *" Encode "*) # Add the subextensions of Encode
22172 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
22173 static_ext="$static_ext Encode/$xxx"
22179 set X $dynamic_ext $static_ext $nonxs_ext
22183 # Sanity check: We require an extension suitable for use with
22184 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
22185 # should show up as failures in the test suite, but it's helpful to
22186 # catch them now.) The 'extensions' list is normally sorted
22187 # alphabetically, so we need to accept either
22188 # DB_File ... Fcntl ... IO ....
22189 # or something like
22190 # Fcntl ... NDBM_File ... IO ....
22191 case " $extensions" in
22192 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
22193 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
22194 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
22195 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
22196 echo "WARNING: The Perl you are building will be quite crippled." >& 4
22200 : Remove libraries needed only for extensions
22201 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
22202 : The exception is SunOS 4.x, which needs them.
22203 case "${osname}X${osvers}" in
22207 *) case "$usedl" in
22208 $define|true|[yY]*)
22209 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
22213 *) perllibs="$libs"
22219 : Remove build directory name from cppstdin so it can be used from
22220 : either the present location or the final installed location.
22222 : Get out of the UU directory to get correct path name.
22224 case "$cppstdin" in
22226 echo "Stripping down cppstdin path name"
22232 : end of configuration questions
22234 echo "End of configuration questions."
22237 : back to where it started
22238 if test -d ../UU; then
22242 : configuration may be unconditionally patched via a 'config.arch' file
22243 if $test -f config.arch; then
22244 echo "I see a config.arch file, loading it." >&4
22248 : configuration may be patched via a 'config.over' file
22249 if $test -f config.over; then
22252 rp='I see a config.over file. Do you wish to load it?'
22255 n*) echo "OK, I'll ignore it.";;
22257 echo "Configuration override changes have been loaded."
22262 : in case they want portability, strip down executable paths
22263 case "$d_portable" in
22266 echo "Stripping down executable paths..." >&4
22267 for file in $loclist $trylist; do
22269 eval $file=`basename $temp`
22274 : create config.sh file
22276 echo "Creating config.sh..." >&4
22277 $spitshell <<EOT >config.sh
22280 # This file was produced by running the Configure script. It holds all the
22281 # definitions figured out by Configure. Should you modify one of these values,
22282 # do not forget to propagate your changes by running "Configure -der". You may
22283 # instead choose to run each of the .SH files by yourself, or "Configure -S".
22286 # Package name : $package
22287 # Source directory : $src
22288 # Configuration time: $cf_time
22289 # Configured by : $cf_by
22290 # Target system : $myuname
22293 : Add in command line options if available
22294 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22296 $spitshell <<EOT >>config.sh
22305 Revision='$Revision'
22313 alignbytes='$alignbytes'
22314 ansi2knr='$ansi2knr'
22315 aphostname='$aphostname'
22316 api_revision='$api_revision'
22317 api_subversion='$api_subversion'
22318 api_version='$api_version'
22319 api_versionstring='$api_versionstring'
22322 archlibexp='$archlibexp'
22323 archname64='$archname64'
22324 archname='$archname'
22325 archobjs='$archobjs'
22326 asctime_r_proto='$asctime_r_proto'
22335 byteorder='$byteorder'
22337 castflags='$castflags'
22340 cccdlflags='$cccdlflags'
22341 ccdlflags='$ccdlflags'
22343 ccflags_uselargefiles='$ccflags_uselargefiles'
22345 ccsymbols='$ccsymbols'
22346 ccversion='$ccversion'
22348 cf_email='$cf_email'
22350 charbits='$charbits'
22351 charsize='$charsize'
22355 clocktype='$clocktype'
22357 compress='$compress'
22358 contains='$contains'
22362 cpp_stuff='$cpp_stuff'
22363 cppccsymbols='$cppccsymbols'
22364 cppflags='$cppflags'
22366 cppminus='$cppminus'
22368 cppstdin='$cppstdin'
22369 cppsymbols='$cppsymbols'
22370 crypt_r_proto='$crypt_r_proto'
22371 cryptlib='$cryptlib'
22373 ctermid_r_proto='$ctermid_r_proto'
22374 ctime_r_proto='$ctime_r_proto'
22375 d_Gconvert='$d_Gconvert'
22376 d_PRIEUldbl='$d_PRIEUldbl'
22377 d_PRIFUldbl='$d_PRIFUldbl'
22378 d_PRIGUldbl='$d_PRIGUldbl'
22379 d_PRIXU64='$d_PRIXU64'
22380 d_PRId64='$d_PRId64'
22381 d_PRIeldbl='$d_PRIeldbl'
22382 d_PRIfldbl='$d_PRIfldbl'
22383 d_PRIgldbl='$d_PRIgldbl'
22384 d_PRIi64='$d_PRIi64'
22385 d_PRIo64='$d_PRIo64'
22386 d_PRIu64='$d_PRIu64'
22387 d_PRIx64='$d_PRIx64'
22388 d_SCNfldbl='$d_SCNfldbl'
22389 d__fwalk='$d__fwalk'
22390 d_access='$d_access'
22391 d_accessx='$d_accessx'
22394 d_archlib='$d_archlib'
22395 d_asctime64='$d_asctime64'
22396 d_asctime_r='$d_asctime_r'
22399 d_attribute_deprecated='$d_attribute_deprecated'
22400 d_attribute_format='$d_attribute_format'
22401 d_attribute_malloc='$d_attribute_malloc'
22402 d_attribute_nonnull='$d_attribute_nonnull'
22403 d_attribute_noreturn='$d_attribute_noreturn'
22404 d_attribute_pure='$d_attribute_pure'
22405 d_attribute_unused='$d_attribute_unused'
22406 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22410 d_bsdgetpgrp='$d_bsdgetpgrp'
22411 d_bsdsetpgrp='$d_bsdsetpgrp'
22412 d_builtin_choose_expr='$d_builtin_choose_expr'
22413 d_builtin_expect='$d_builtin_expect'
22415 d_c99_variadic_macros='$d_c99_variadic_macros'
22416 d_casti32='$d_casti32'
22417 d_castneg='$d_castneg'
22418 d_charvspr='$d_charvspr'
22420 d_chroot='$d_chroot'
22421 d_chsize='$d_chsize'
22423 d_clearenv='$d_clearenv'
22424 d_closedir='$d_closedir'
22425 d_cmsghdr_s='$d_cmsghdr_s'
22427 d_copysignl='$d_copysignl'
22428 d_cplusplus='$d_cplusplus'
22430 d_crypt_r='$d_crypt_r'
22432 d_ctermid='$d_ctermid'
22433 d_ctermid_r='$d_ctermid_r'
22434 d_ctime64='$d_ctime64'
22435 d_ctime_r='$d_ctime_r'
22436 d_cuserid='$d_cuserid'
22437 d_dbl_dig='$d_dbl_dig'
22438 d_dbminitproto='$d_dbminitproto'
22439 d_difftime64='$d_difftime64'
22440 d_difftime='$d_difftime'
22441 d_dir_dd_fd='$d_dir_dd_fd'
22443 d_dirnamlen='$d_dirnamlen'
22444 d_dlerror='$d_dlerror'
22445 d_dlopen='$d_dlopen'
22446 d_dlsymun='$d_dlsymun'
22447 d_dosuid='$d_dosuid'
22448 d_drand48_r='$d_drand48_r'
22449 d_drand48proto='$d_drand48proto'
22451 d_eaccess='$d_eaccess'
22452 d_endgrent='$d_endgrent'
22453 d_endgrent_r='$d_endgrent_r'
22454 d_endhent='$d_endhent'
22455 d_endhostent_r='$d_endhostent_r'
22456 d_endnent='$d_endnent'
22457 d_endnetent_r='$d_endnetent_r'
22458 d_endpent='$d_endpent'
22459 d_endprotoent_r='$d_endprotoent_r'
22460 d_endpwent='$d_endpwent'
22461 d_endpwent_r='$d_endpwent_r'
22462 d_endsent='$d_endsent'
22463 d_endservent_r='$d_endservent_r'
22464 d_eofnblk='$d_eofnblk'
22465 d_eunice='$d_eunice'
22466 d_faststdio='$d_faststdio'
22467 d_fchdir='$d_fchdir'
22468 d_fchmod='$d_fchmod'
22469 d_fchown='$d_fchown'
22471 d_fcntl_can_lock='$d_fcntl_can_lock'
22472 d_fd_macros='$d_fd_macros'
22473 d_fd_set='$d_fd_set'
22474 d_fds_bits='$d_fds_bits'
22475 d_fgetpos='$d_fgetpos'
22476 d_finite='$d_finite'
22477 d_finitel='$d_finitel'
22478 d_flexfnam='$d_flexfnam'
22480 d_flockproto='$d_flockproto'
22482 d_fp_class='$d_fp_class'
22483 d_fpathconf='$d_fpathconf'
22484 d_fpclass='$d_fpclass'
22485 d_fpclassify='$d_fpclassify'
22486 d_fpclassl='$d_fpclassl'
22487 d_fpos64_t='$d_fpos64_t'
22488 d_frexpl='$d_frexpl'
22489 d_fs_data_s='$d_fs_data_s'
22490 d_fseeko='$d_fseeko'
22491 d_fsetpos='$d_fsetpos'
22492 d_fstatfs='$d_fstatfs'
22493 d_fstatvfs='$d_fstatvfs'
22495 d_ftello='$d_ftello'
22497 d_futimes='$d_futimes'
22498 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
22499 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
22500 d_getaddrinfo='$d_getaddrinfo'
22501 d_getcwd='$d_getcwd'
22502 d_getespwnam='$d_getespwnam'
22503 d_getfsstat='$d_getfsstat'
22504 d_getgrent='$d_getgrent'
22505 d_getgrent_r='$d_getgrent_r'
22506 d_getgrgid_r='$d_getgrgid_r'
22507 d_getgrnam_r='$d_getgrnam_r'
22508 d_getgrps='$d_getgrps'
22509 d_gethbyaddr='$d_gethbyaddr'
22510 d_gethbyname='$d_gethbyname'
22511 d_gethent='$d_gethent'
22512 d_gethname='$d_gethname'
22513 d_gethostbyaddr_r='$d_gethostbyaddr_r'
22514 d_gethostbyname_r='$d_gethostbyname_r'
22515 d_gethostent_r='$d_gethostent_r'
22516 d_gethostprotos='$d_gethostprotos'
22517 d_getitimer='$d_getitimer'
22518 d_getlogin='$d_getlogin'
22519 d_getlogin_r='$d_getlogin_r'
22520 d_getmnt='$d_getmnt'
22521 d_getmntent='$d_getmntent'
22522 d_getnameinfo='$d_getnameinfo'
22523 d_getnbyaddr='$d_getnbyaddr'
22524 d_getnbyname='$d_getnbyname'
22525 d_getnent='$d_getnent'
22526 d_getnetbyaddr_r='$d_getnetbyaddr_r'
22527 d_getnetbyname_r='$d_getnetbyname_r'
22528 d_getnetent_r='$d_getnetent_r'
22529 d_getnetprotos='$d_getnetprotos'
22530 d_getpagsz='$d_getpagsz'
22531 d_getpbyname='$d_getpbyname'
22532 d_getpbynumber='$d_getpbynumber'
22533 d_getpent='$d_getpent'
22534 d_getpgid='$d_getpgid'
22535 d_getpgrp2='$d_getpgrp2'
22536 d_getpgrp='$d_getpgrp'
22537 d_getppid='$d_getppid'
22538 d_getprior='$d_getprior'
22539 d_getprotobyname_r='$d_getprotobyname_r'
22540 d_getprotobynumber_r='$d_getprotobynumber_r'
22541 d_getprotoent_r='$d_getprotoent_r'
22542 d_getprotoprotos='$d_getprotoprotos'
22543 d_getprpwnam='$d_getprpwnam'
22544 d_getpwent='$d_getpwent'
22545 d_getpwent_r='$d_getpwent_r'
22546 d_getpwnam_r='$d_getpwnam_r'
22547 d_getpwuid_r='$d_getpwuid_r'
22548 d_getsbyname='$d_getsbyname'
22549 d_getsbyport='$d_getsbyport'
22550 d_getsent='$d_getsent'
22551 d_getservbyname_r='$d_getservbyname_r'
22552 d_getservbyport_r='$d_getservbyport_r'
22553 d_getservent_r='$d_getservent_r'
22554 d_getservprotos='$d_getservprotos'
22555 d_getspnam='$d_getspnam'
22556 d_getspnam_r='$d_getspnam_r'
22557 d_gettimeod='$d_gettimeod'
22558 d_gmtime64='$d_gmtime64'
22559 d_gmtime_r='$d_gmtime_r'
22560 d_gnulibc='$d_gnulibc'
22561 d_grpasswd='$d_grpasswd'
22562 d_hasmntopt='$d_hasmntopt'
22564 d_ilogbl='$d_ilogbl'
22565 d_inc_version_list='$d_inc_version_list'
22567 d_inetaton='$d_inetaton'
22568 d_inetntop='$d_inetntop'
22569 d_inetpton='$d_inetpton'
22570 d_int64_t='$d_int64_t'
22571 d_isascii='$d_isascii'
22572 d_isfinite='$d_isfinite'
22575 d_isnanl='$d_isnanl'
22576 d_killpg='$d_killpg'
22577 d_lchown='$d_lchown'
22578 d_ldbl_dig='$d_ldbl_dig'
22579 d_libm_lib_version='$d_libm_lib_version'
22581 d_localtime64='$d_localtime64'
22582 d_localtime_r='$d_localtime_r'
22583 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
22584 d_locconv='$d_locconv'
22586 d_longdbl='$d_longdbl'
22587 d_longlong='$d_longlong'
22588 d_lseekproto='$d_lseekproto'
22590 d_madvise='$d_madvise'
22591 d_malloc_good_size='$d_malloc_good_size'
22592 d_malloc_size='$d_malloc_size'
22594 d_mbstowcs='$d_mbstowcs'
22595 d_mbtowc='$d_mbtowc'
22596 d_memchr='$d_memchr'
22597 d_memcmp='$d_memcmp'
22598 d_memcpy='$d_memcpy'
22599 d_memmove='$d_memmove'
22600 d_memset='$d_memset'
22602 d_mkdtemp='$d_mkdtemp'
22603 d_mkfifo='$d_mkfifo'
22604 d_mkstemp='$d_mkstemp'
22605 d_mkstemps='$d_mkstemps'
22606 d_mktime64='$d_mktime64'
22607 d_mktime='$d_mktime'
22610 d_modfl_pow32_bug='$d_modfl_pow32_bug'
22611 d_modflproto='$d_modflproto'
22612 d_mprotect='$d_mprotect'
22614 d_msg_ctrunc='$d_msg_ctrunc'
22615 d_msg_dontroute='$d_msg_dontroute'
22616 d_msg_oob='$d_msg_oob'
22617 d_msg_peek='$d_msg_peek'
22618 d_msg_proxy='$d_msg_proxy'
22619 d_msgctl='$d_msgctl'
22620 d_msgget='$d_msgget'
22621 d_msghdr_s='$d_msghdr_s'
22622 d_msgrcv='$d_msgrcv'
22623 d_msgsnd='$d_msgsnd'
22625 d_munmap='$d_munmap'
22626 d_mymalloc='$d_mymalloc'
22628 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
22630 d_nl_langinfo='$d_nl_langinfo'
22631 d_nv_preserves_uv='$d_nv_preserves_uv'
22632 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
22633 d_off64_t='$d_off64_t'
22634 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
22635 d_oldpthreads='$d_oldpthreads'
22636 d_oldsock='$d_oldsock'
22638 d_pathconf='$d_pathconf'
22640 d_perl_otherlibdirs='$d_perl_otherlibdirs'
22641 d_phostname='$d_phostname'
22644 d_portable='$d_portable'
22646 d_prctl_set_name='$d_prctl_set_name'
22647 d_printf_format_null='$d_printf_format_null'
22648 d_procselfexe='$d_procselfexe'
22649 d_pseudofork='$d_pseudofork'
22650 d_pthread_atfork='$d_pthread_atfork'
22651 d_pthread_attr_setscope='$d_pthread_attr_setscope'
22652 d_pthread_yield='$d_pthread_yield'
22654 d_pwchange='$d_pwchange'
22655 d_pwclass='$d_pwclass'
22656 d_pwcomment='$d_pwcomment'
22657 d_pwexpire='$d_pwexpire'
22658 d_pwgecos='$d_pwgecos'
22659 d_pwpasswd='$d_pwpasswd'
22660 d_pwquota='$d_pwquota'
22663 d_random_r='$d_random_r'
22664 d_readdir64_r='$d_readdir64_r'
22665 d_readdir='$d_readdir'
22666 d_readdir_r='$d_readdir_r'
22667 d_readlink='$d_readlink'
22669 d_recvmsg='$d_recvmsg'
22670 d_rename='$d_rename'
22671 d_rewinddir='$d_rewinddir'
22673 d_safebcpy='$d_safebcpy'
22674 d_safemcpy='$d_safemcpy'
22675 d_sanemcmp='$d_sanemcmp'
22676 d_sbrkproto='$d_sbrkproto'
22677 d_scalbnl='$d_scalbnl'
22678 d_sched_yield='$d_sched_yield'
22679 d_scm_rights='$d_scm_rights'
22680 d_seekdir='$d_seekdir'
22681 d_select='$d_select'
22683 d_semctl='$d_semctl'
22684 d_semctl_semid_ds='$d_semctl_semid_ds'
22685 d_semctl_semun='$d_semctl_semun'
22686 d_semget='$d_semget'
22688 d_sendmsg='$d_sendmsg'
22689 d_setegid='$d_setegid'
22690 d_seteuid='$d_seteuid'
22691 d_setgrent='$d_setgrent'
22692 d_setgrent_r='$d_setgrent_r'
22693 d_setgrps='$d_setgrps'
22694 d_sethent='$d_sethent'
22695 d_sethostent_r='$d_sethostent_r'
22696 d_setitimer='$d_setitimer'
22697 d_setlinebuf='$d_setlinebuf'
22698 d_setlocale='$d_setlocale'
22699 d_setlocale_r='$d_setlocale_r'
22700 d_setnent='$d_setnent'
22701 d_setnetent_r='$d_setnetent_r'
22702 d_setpent='$d_setpent'
22703 d_setpgid='$d_setpgid'
22704 d_setpgrp2='$d_setpgrp2'
22705 d_setpgrp='$d_setpgrp'
22706 d_setprior='$d_setprior'
22707 d_setproctitle='$d_setproctitle'
22708 d_setprotoent_r='$d_setprotoent_r'
22709 d_setpwent='$d_setpwent'
22710 d_setpwent_r='$d_setpwent_r'
22711 d_setregid='$d_setregid'
22712 d_setresgid='$d_setresgid'
22713 d_setresuid='$d_setresuid'
22714 d_setreuid='$d_setreuid'
22715 d_setrgid='$d_setrgid'
22716 d_setruid='$d_setruid'
22717 d_setsent='$d_setsent'
22718 d_setservent_r='$d_setservent_r'
22719 d_setsid='$d_setsid'
22720 d_setvbuf='$d_setvbuf'
22724 d_shmatprototype='$d_shmatprototype'
22725 d_shmctl='$d_shmctl'
22727 d_shmget='$d_shmget'
22728 d_sigaction='$d_sigaction'
22729 d_signbit='$d_signbit'
22730 d_sigprocmask='$d_sigprocmask'
22731 d_sigsetjmp='$d_sigsetjmp'
22732 d_sitearch='$d_sitearch'
22733 d_snprintf='$d_snprintf'
22734 d_sockatmark='$d_sockatmark'
22735 d_sockatmarkproto='$d_sockatmarkproto'
22736 d_socket='$d_socket'
22737 d_socklen_t='$d_socklen_t'
22738 d_sockpair='$d_sockpair'
22739 d_socks5_init='$d_socks5_init'
22740 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
22742 d_srand48_r='$d_srand48_r'
22743 d_srandom_r='$d_srandom_r'
22744 d_sresgproto='$d_sresgproto'
22745 d_sresuproto='$d_sresuproto'
22746 d_statblks='$d_statblks'
22747 d_statfs_f_flags='$d_statfs_f_flags'
22748 d_statfs_s='$d_statfs_s'
22749 d_statvfs='$d_statvfs'
22750 d_stdio_cnt_lval='$d_stdio_cnt_lval'
22751 d_stdio_ptr_lval='$d_stdio_ptr_lval'
22752 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
22753 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
22754 d_stdio_stream_array='$d_stdio_stream_array'
22755 d_stdiobase='$d_stdiobase'
22756 d_stdstdio='$d_stdstdio'
22757 d_strchr='$d_strchr'
22758 d_strcoll='$d_strcoll'
22759 d_strctcpy='$d_strctcpy'
22760 d_strerrm='$d_strerrm'
22761 d_strerror='$d_strerror'
22762 d_strerror_r='$d_strerror_r'
22763 d_strftime='$d_strftime'
22764 d_strlcat='$d_strlcat'
22765 d_strlcpy='$d_strlcpy'
22766 d_strtod='$d_strtod'
22767 d_strtol='$d_strtol'
22768 d_strtold='$d_strtold'
22769 d_strtoll='$d_strtoll'
22770 d_strtoq='$d_strtoq'
22771 d_strtoul='$d_strtoul'
22772 d_strtoull='$d_strtoull'
22773 d_strtouq='$d_strtouq'
22774 d_strxfrm='$d_strxfrm'
22775 d_suidsafe='$d_suidsafe'
22776 d_symlink='$d_symlink'
22777 d_syscall='$d_syscall'
22778 d_syscallproto='$d_syscallproto'
22779 d_sysconf='$d_sysconf'
22780 d_sysernlst='$d_sysernlst'
22781 d_syserrlst='$d_syserrlst'
22782 d_system='$d_system'
22783 d_tcgetpgrp='$d_tcgetpgrp'
22784 d_tcsetpgrp='$d_tcsetpgrp'
22785 d_telldir='$d_telldir'
22786 d_telldirproto='$d_telldirproto'
22788 d_timegm='$d_timegm'
22790 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
22791 d_tm_tm_zone='$d_tm_tm_zone'
22792 d_tmpnam_r='$d_tmpnam_r'
22793 d_truncate='$d_truncate'
22794 d_ttyname_r='$d_ttyname_r'
22795 d_tzname='$d_tzname'
22796 d_u32align='$d_u32align'
22797 d_ualarm='$d_ualarm'
22800 d_union_semun='$d_union_semun'
22801 d_unordered='$d_unordered'
22802 d_unsetenv='$d_unsetenv'
22803 d_usleep='$d_usleep'
22804 d_usleepproto='$d_usleepproto'
22806 d_vendorarch='$d_vendorarch'
22807 d_vendorbin='$d_vendorbin'
22808 d_vendorlib='$d_vendorlib'
22809 d_vendorscript='$d_vendorscript'
22811 d_void_closedir='$d_void_closedir'
22812 d_voidsig='$d_voidsig'
22813 d_voidtty='$d_voidtty'
22814 d_volatile='$d_volatile'
22815 d_vprintf='$d_vprintf'
22816 d_vsnprintf='$d_vsnprintf'
22818 d_waitpid='$d_waitpid'
22819 d_wcstombs='$d_wcstombs'
22820 d_wctomb='$d_wctomb'
22821 d_writev='$d_writev'
22824 db_hashtype='$db_hashtype'
22825 db_prefixtype='$db_prefixtype'
22826 db_version_major='$db_version_major'
22827 db_version_minor='$db_version_minor'
22828 db_version_patch='$db_version_patch'
22829 defvoidused='$defvoidused'
22830 direntrytype='$direntrytype'
22833 doublesize='$doublesize'
22835 drand48_r_proto='$drand48_r_proto'
22837 dynamic_ext='$dynamic_ext'
22843 endgrent_r_proto='$endgrent_r_proto'
22844 endhostent_r_proto='$endhostent_r_proto'
22845 endnetent_r_proto='$endnetent_r_proto'
22846 endprotoent_r_proto='$endprotoent_r_proto'
22847 endpwent_r_proto='$endpwent_r_proto'
22848 endservent_r_proto='$endservent_r_proto'
22849 eunicefix='$eunicefix'
22852 extensions='$extensions'
22853 extern_C='$extern_C'
22855 fflushNULL='$fflushNULL'
22856 fflushall='$fflushall'
22858 firstmakefile='$firstmakefile'
22860 fpossize='$fpossize'
22861 fpostype='$fpostype'
22862 freetype='$freetype'
22865 full_csh='$full_csh'
22866 full_sed='$full_sed'
22867 gccansipedantic='$gccansipedantic'
22868 gccosandvers='$gccosandvers'
22869 gccversion='$gccversion'
22870 getgrent_r_proto='$getgrent_r_proto'
22871 getgrgid_r_proto='$getgrgid_r_proto'
22872 getgrnam_r_proto='$getgrnam_r_proto'
22873 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22874 gethostbyname_r_proto='$gethostbyname_r_proto'
22875 gethostent_r_proto='$gethostent_r_proto'
22876 getlogin_r_proto='$getlogin_r_proto'
22877 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22878 getnetbyname_r_proto='$getnetbyname_r_proto'
22879 getnetent_r_proto='$getnetent_r_proto'
22880 getprotobyname_r_proto='$getprotobyname_r_proto'
22881 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22882 getprotoent_r_proto='$getprotoent_r_proto'
22883 getpwent_r_proto='$getpwent_r_proto'
22884 getpwnam_r_proto='$getpwnam_r_proto'
22885 getpwuid_r_proto='$getpwuid_r_proto'
22886 getservbyname_r_proto='$getservbyname_r_proto'
22887 getservbyport_r_proto='$getservbyport_r_proto'
22888 getservent_r_proto='$getservent_r_proto'
22889 getspnam_r_proto='$getspnam_r_proto'
22890 gidformat='$gidformat'
22896 gmtime_r_proto='$gmtime_r_proto'
22897 gnulibc_version='$gnulibc_version'
22899 groupcat='$groupcat'
22900 groupstype='$groupstype'
22903 h_sysfile='$h_sysfile'
22906 html1dir='$html1dir'
22907 html1direxp='$html1direxp'
22908 html3dir='$html3dir'
22909 html3direxp='$html3direxp'
22918 i_arpainet='$i_arpainet'
22919 i_assert='$i_assert'
22920 i_bsdioctl='$i_bsdioctl'
22924 i_dirent='$i_dirent'
22930 i_fp_class='$i_fp_class'
22932 i_gdbm_ndbm='$i_gdbm_ndbm'
22933 i_gdbmndbm='$i_gdbmndbm'
22935 i_ieeefp='$i_ieeefp'
22936 i_inttypes='$i_inttypes'
22937 i_langinfo='$i_langinfo'
22938 i_libutil='$i_libutil'
22939 i_limits='$i_limits'
22940 i_locale='$i_locale'
22941 i_machcthr='$i_machcthr'
22942 i_malloc='$i_malloc'
22943 i_mallocmalloc='$i_mallocmalloc'
22945 i_memory='$i_memory'
22946 i_mntent='$i_mntent'
22949 i_neterrno='$i_neterrno'
22950 i_netinettcp='$i_netinettcp'
22954 i_pthread='$i_pthread'
22956 i_rpcsvcdbm='$i_rpcsvcdbm'
22959 i_shadow='$i_shadow'
22961 i_stdarg='$i_stdarg'
22962 i_stddef='$i_stddef'
22963 i_stdlib='$i_stdlib'
22964 i_string='$i_string'
22965 i_sunmath='$i_sunmath'
22966 i_sysaccess='$i_sysaccess'
22967 i_sysdir='$i_sysdir'
22968 i_sysfile='$i_sysfile'
22969 i_sysfilio='$i_sysfilio'
22971 i_sysioctl='$i_sysioctl'
22972 i_syslog='$i_syslog'
22973 i_sysmman='$i_sysmman'
22974 i_sysmode='$i_sysmode'
22975 i_sysmount='$i_sysmount'
22976 i_sysndir='$i_sysndir'
22977 i_sysparam='$i_sysparam'
22978 i_syspoll='$i_syspoll'
22979 i_sysresrc='$i_sysresrc'
22980 i_syssecrt='$i_syssecrt'
22981 i_sysselct='$i_sysselct'
22982 i_syssockio='$i_syssockio'
22983 i_sysstat='$i_sysstat'
22984 i_sysstatfs='$i_sysstatfs'
22985 i_sysstatvfs='$i_sysstatvfs'
22986 i_systime='$i_systime'
22987 i_systimek='$i_systimek'
22988 i_systimes='$i_systimes'
22989 i_systypes='$i_systypes'
22990 i_sysuio='$i_sysuio'
22992 i_sysutsname='$i_sysutsname'
22993 i_sysvfs='$i_sysvfs'
22994 i_syswait='$i_syswait'
22995 i_termio='$i_termio'
22996 i_termios='$i_termios'
22998 i_unistd='$i_unistd'
23001 i_values='$i_values'
23002 i_varargs='$i_varargs'
23003 i_varhdr='$i_varhdr'
23005 ignore_versioned_solibs='$ignore_versioned_solibs'
23006 inc_version_list='$inc_version_list'
23007 inc_version_list_init='$inc_version_list_init'
23010 initialinstalllocation='$initialinstalllocation'
23011 installarchlib='$installarchlib'
23012 installbin='$installbin'
23013 installhtml1dir='$installhtml1dir'
23014 installhtml3dir='$installhtml3dir'
23015 installman1dir='$installman1dir'
23016 installman3dir='$installman3dir'
23017 installprefix='$installprefix'
23018 installprefixexp='$installprefixexp'
23019 installprivlib='$installprivlib'
23020 installscript='$installscript'
23021 installsitearch='$installsitearch'
23022 installsitebin='$installsitebin'
23023 installsitehtml1dir='$installsitehtml1dir'
23024 installsitehtml3dir='$installsitehtml3dir'
23025 installsitelib='$installsitelib'
23026 installsiteman1dir='$installsiteman1dir'
23027 installsiteman3dir='$installsiteman3dir'
23028 installsitescript='$installsitescript'
23029 installstyle='$installstyle'
23030 installusrbinperl='$installusrbinperl'
23031 installvendorarch='$installvendorarch'
23032 installvendorbin='$installvendorbin'
23033 installvendorhtml1dir='$installvendorhtml1dir'
23034 installvendorhtml3dir='$installvendorhtml3dir'
23035 installvendorlib='$installvendorlib'
23036 installvendorman1dir='$installvendorman1dir'
23037 installvendorman3dir='$installvendorman3dir'
23038 installvendorscript='$installvendorscript'
23040 issymlink='$issymlink'
23041 ivdformat='$ivdformat'
23044 known_extensions='$known_extensions'
23047 lddlflags='$lddlflags'
23049 ldflags_uselargefiles='$ldflags_uselargefiles'
23050 ldlibpthname='$ldlibpthname'
23057 libsdirs='$libsdirs'
23058 libsfiles='$libsfiles'
23059 libsfound='$libsfound'
23060 libspath='$libspath'
23061 libswanted='$libswanted'
23062 libswanted_uselargefiles='$libswanted_uselargefiles'
23068 localtime_r_proto='$localtime_r_proto'
23069 locincpth='$locincpth'
23070 loclibpth='$loclibpth'
23071 longdblsize='$longdblsize'
23072 longlongsize='$longlongsize'
23073 longsize='$longsize'
23077 lseeksize='$lseeksize'
23078 lseektype='$lseektype'
23081 madlyobj='$madlyobj'
23082 madlysrc='$madlysrc'
23086 make_set_make='$make_set_make'
23087 mallocobj='$mallocobj'
23088 mallocsrc='$mallocsrc'
23089 malloctype='$malloctype'
23091 man1direxp='$man1direxp'
23094 man3direxp='$man3direxp'
23096 mips_type='$mips_type'
23097 mistrustnm='$mistrustnm'
23099 mmaptype='$mmaptype'
23100 modetype='$modetype'
23102 multiarch='$multiarch'
23104 myarchname='$myarchname'
23105 mydomain='$mydomain'
23106 myhostname='$myhostname'
23109 need_va_copy='$need_va_copy'
23110 netdb_hlen_type='$netdb_hlen_type'
23111 netdb_host_type='$netdb_host_type'
23112 netdb_name_type='$netdb_name_type'
23113 netdb_net_type='$netdb_net_type'
23116 nm_so_opt='$nm_so_opt'
23117 nonxs_ext='$nonxs_ext'
23119 nvEUformat='$nvEUformat'
23120 nvFUformat='$nvFUformat'
23121 nvGUformat='$nvGUformat'
23122 nv_overflows_integers_at='$nv_overflows_integers_at'
23123 nv_preserves_uv_bits='$nv_preserves_uv_bits'
23124 nveformat='$nveformat'
23125 nvfformat='$nvfformat'
23126 nvgformat='$nvgformat'
23129 o_nonblock='$o_nonblock'
23131 old_pthread_create_joinable='$old_pthread_create_joinable'
23132 optimize='$optimize'
23133 orderlib='$orderlib'
23136 otherlibdirs='$otherlibdirs'
23140 patchlevel='$patchlevel'
23141 path_sep='$path_sep'
23144 perl_patchlevel='$perl_patchlevel'
23145 perladmin='$perladmin'
23146 perllibs='$perllibs'
23147 perlpath='$perlpath'
23149 phostname='$phostname'
23155 prefixexp='$prefixexp'
23157 privlibexp='$privlibexp'
23158 procselfexe='$procselfexe'
23159 prototype='$prototype'
23161 quadkind='$quadkind'
23162 quadtype='$quadtype'
23163 randbits='$randbits'
23164 randfunc='$randfunc'
23165 random_r_proto='$random_r_proto'
23166 randseedtype='$randseedtype'
23168 rd_nodata='$rd_nodata'
23169 readdir64_r_proto='$readdir64_r_proto'
23170 readdir_r_proto='$readdir_r_proto'
23171 revision='$revision'
23177 sGMTIME_max='$sGMTIME_max'
23178 sGMTIME_min='$sGMTIME_min'
23179 sLOCALTIME_max='$sLOCALTIME_max'
23180 sLOCALTIME_min='$sLOCALTIME_min'
23181 sPRIEUldbl='$sPRIEUldbl'
23182 sPRIFUldbl='$sPRIFUldbl'
23183 sPRIGUldbl='$sPRIGUldbl'
23184 sPRIXU64='$sPRIXU64'
23186 sPRIeldbl='$sPRIeldbl'
23187 sPRIfldbl='$sPRIfldbl'
23188 sPRIgldbl='$sPRIgldbl'
23193 sSCNfldbl='$sSCNfldbl'
23194 sched_yield='$sched_yield'
23195 scriptdir='$scriptdir'
23196 scriptdirexp='$scriptdirexp'
23198 seedfunc='$seedfunc'
23199 selectminbits='$selectminbits'
23200 selecttype='$selecttype'
23201 sendmail='$sendmail'
23202 setgrent_r_proto='$setgrent_r_proto'
23203 sethostent_r_proto='$sethostent_r_proto'
23204 setlocale_r_proto='$setlocale_r_proto'
23205 setnetent_r_proto='$setnetent_r_proto'
23206 setprotoent_r_proto='$setprotoent_r_proto'
23207 setpwent_r_proto='$setpwent_r_proto'
23208 setservent_r_proto='$setservent_r_proto'
23211 sharpbang='$sharpbang'
23212 shmattype='$shmattype'
23213 shortsize='$shortsize'
23216 sig_count='$sig_count'
23217 sig_name='$sig_name'
23218 sig_name_init='$sig_name_init'
23220 sig_num_init='$sig_num_init'
23221 sig_size='$sig_size'
23222 signal_t='$signal_t'
23223 sitearch='$sitearch'
23224 sitearchexp='$sitearchexp'
23226 sitebinexp='$sitebinexp'
23227 sitehtml1dir='$sitehtml1dir'
23228 sitehtml1direxp='$sitehtml1direxp'
23229 sitehtml3dir='$sitehtml3dir'
23230 sitehtml3direxp='$sitehtml3direxp'
23232 sitelib_stem='$sitelib_stem'
23233 sitelibexp='$sitelibexp'
23234 siteman1dir='$siteman1dir'
23235 siteman1direxp='$siteman1direxp'
23236 siteman3dir='$siteman3dir'
23237 siteman3direxp='$siteman3direxp'
23238 siteprefix='$siteprefix'
23239 siteprefixexp='$siteprefixexp'
23240 sitescript='$sitescript'
23241 sitescriptexp='$sitescriptexp'
23242 sizesize='$sizesize'
23243 sizetype='$sizetype'
23247 sockethdr='$sockethdr'
23248 socketlib='$socketlib'
23249 socksizetype='$socksizetype'
23251 spackage='$spackage'
23252 spitshell='$spitshell'
23253 srand48_r_proto='$srand48_r_proto'
23254 srandom_r_proto='$srandom_r_proto'
23256 ssizetype='$ssizetype'
23257 startperl='$startperl'
23259 static_ext='$static_ext'
23261 stdio_base='$stdio_base'
23262 stdio_bufsiz='$stdio_bufsiz'
23263 stdio_cnt='$stdio_cnt'
23264 stdio_filbuf='$stdio_filbuf'
23265 stdio_ptr='$stdio_ptr'
23266 stdio_stream_array='$stdio_stream_array'
23267 strerror_r_proto='$strerror_r_proto'
23270 subversion='$subversion'
23274 targetarch='$targetarch'
23278 timeincl='$timeincl'
23279 timetype='$timetype'
23280 tmpnam_r_proto='$tmpnam_r_proto'
23286 ttyname_r_proto='$ttyname_r_proto'
23295 uidformat='$uidformat'
23301 uquadtype='$uquadtype'
23302 use5005threads='$use5005threads'
23303 use64bitall='$use64bitall'
23304 use64bitint='$use64bitint'
23305 usecrosscompile='$usecrosscompile'
23306 usedevel='$usedevel'
23308 usedtrace='$usedtrace'
23309 usefaststdio='$usefaststdio'
23310 useithreads='$useithreads'
23311 uselargefiles='$uselargefiles'
23312 uselongdouble='$uselongdouble'
23313 usemallocwrap='$usemallocwrap'
23314 usemorebits='$usemorebits'
23315 usemultiplicity='$usemultiplicity'
23316 usemymalloc='$usemymalloc'
23318 useopcode='$useopcode'
23319 useperlio='$useperlio'
23320 useposix='$useposix'
23321 usereentrant='$usereentrant'
23322 userelocatableinc='$userelocatableinc'
23324 useshrplib='$useshrplib'
23325 usesitecustomize='$usesitecustomize'
23326 usesocks='$usesocks'
23327 usethreads='$usethreads'
23328 usevendorprefix='$usevendorprefix'
23329 usevfork='$usevfork'
23332 uvXUformat='$uvXUformat'
23333 uvoformat='$uvoformat'
23336 uvuformat='$uvuformat'
23337 uvxformat='$uvxformat'
23339 vendorarch='$vendorarch'
23340 vendorarchexp='$vendorarchexp'
23341 vendorbin='$vendorbin'
23342 vendorbinexp='$vendorbinexp'
23343 vendorhtml1dir='$vendorhtml1dir'
23344 vendorhtml1direxp='$vendorhtml1direxp'
23345 vendorhtml3dir='$vendorhtml3dir'
23346 vendorhtml3direxp='$vendorhtml3direxp'
23347 vendorlib='$vendorlib'
23348 vendorlib_stem='$vendorlib_stem'
23349 vendorlibexp='$vendorlibexp'
23350 vendorman1dir='$vendorman1dir'
23351 vendorman1direxp='$vendorman1direxp'
23352 vendorman3dir='$vendorman3dir'
23353 vendorman3direxp='$vendorman3direxp'
23354 vendorprefix='$vendorprefix'
23355 vendorprefixexp='$vendorprefixexp'
23356 vendorscript='$vendorscript'
23357 vendorscriptexp='$vendorscriptexp'
23359 version_patchlevel_string='$version_patchlevel_string'
23360 versiononly='$versiononly'
23362 voidflags='$voidflags'
23365 yaccflags='$yaccflags'
23370 : add special variables
23371 $test -f $src/patchlevel.h && \
23372 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23373 echo "PERL_PATCHLEVEL='$perl_patchlevel'" >>config.sh
23374 echo "PERL_CONFIG_SH=true" >>config.sh
23376 : propagate old symbols
23377 if $test -f UU/config.sh; then
23378 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23379 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23380 config.sh config.sh UU/oldconfig.sh |\
23381 $sort | $uniq -u >UU/oldsyms
23382 set X `cat UU/oldsyms`
23388 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23390 echo ": Variables propagated from previous config.sh file." >>config.sh
23391 for sym in `cat UU/oldsyms`; do
23392 echo " Propagating $hint variable "'$'"$sym..."
23393 eval 'tmp="$'"${sym}"'"'
23395 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23401 : Finish up by extracting the .SH files
23405 echo "Extraction done."
23415 If you'd like to make any changes to the config.sh file before I begin
23416 to configure things, do it as a shell escape now (e.g. !vi config.sh).
23419 rp="Press return or use a shell escape to edit config.sh:"
23424 *) : in case they cannot read
23425 sh 1>&4 -c "$ans";;
23430 : if this fails, just run all the .SH files by hand
23439 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
23446 Now you need to generate make dependencies by running "$make depend".
23447 You might prefer to run it in background: "$make depend > makedepend.out &"
23448 It can take a while, so you might not want to run it right now.
23453 rp="Run $make depend now?"
23457 $make depend && echo "Now you must run '$make'."
23460 echo "You must run '$make depend' then '$make'."
23463 elif test -f [Mm]akefile; then
23465 echo "Now you must run a $make."
23467 echo "Configure done."
23470 if $test -f Policy.sh; then
23473 If you compile $package on a different machine or from a different object
23474 directory, copy the Policy.sh file from this object directory to the
23475 new one before you run Configure -- this will help you with most of
23476 the policy defaults.
23480 if $test -f config.msg; then
23481 echo "Hmm. I also noted the following information while running:"
23483 $cat config.msg >&4
23486 $rm -f kit*isdone ark*isdone